@arcgis/map-components 5.2.0-next.60 → 5.2.0-next.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/cdn/2SZEQV37.js +2 -0
  2. package/dist/cdn/3WTBTYMS.js +2 -0
  3. package/dist/cdn/4ZHTGN7K.js +2 -0
  4. package/dist/cdn/55DP6FNP.js +2 -0
  5. package/dist/cdn/{X6K2RSPI.js → 5IYDETJ3.js} +1 -1
  6. package/dist/cdn/{WYZPOKJF.js → 7MH3SB7P.js} +1 -1
  7. package/dist/cdn/A2T36WPR.js +2 -0
  8. package/dist/cdn/AEIJFBBW.js +2 -0
  9. package/dist/cdn/{NRHOAASJ.js → APOCPBJG.js} +1 -1
  10. package/dist/cdn/AZFN3LR3.js +2 -0
  11. package/dist/cdn/{F3VS53GP.js → B4IHQKAA.js} +1 -1
  12. package/dist/cdn/{AFJW3C3J.js → CZ35ZBQO.js} +1 -1
  13. package/dist/cdn/DBA7NSTP.js +2 -0
  14. package/dist/cdn/{KEV6I36K.js → DJ5IUHJS.js} +1 -1
  15. package/dist/cdn/GU3M4JMW.js +2 -0
  16. package/dist/cdn/HFKN54XG.js +2 -0
  17. package/dist/cdn/{2JV5SN44.js → IDKRMHDS.js} +1 -1
  18. package/dist/cdn/{Y3X3K2RU.js → IYLOUQFV.js} +1 -1
  19. package/dist/cdn/{CJS5I43A.js → MZBHKC3U.js} +1 -1
  20. package/dist/cdn/{OMGRHB7H.js → ND6OMAWU.js} +1 -1
  21. package/dist/cdn/{KKBZEDN4.js → OIYQ43VS.js} +1 -1
  22. package/dist/cdn/{UX6QVJG6.js → ORL32J3S.js} +1 -1
  23. package/dist/cdn/{5W6NJGFF.js → QKCBSK73.js} +1 -1
  24. package/dist/cdn/{SCPSWHG4.js → QU6ARDF6.js} +1 -1
  25. package/dist/cdn/{QVOYYXIU.js → RLA7OC3V.js} +1 -1
  26. package/dist/cdn/{ALUQRMZW.js → RUI2QLEM.js} +1 -1
  27. package/dist/cdn/S3XR7KRN.js +2 -0
  28. package/dist/cdn/{T6CKYPI7.js → SADIYG5D.js} +1 -1
  29. package/dist/cdn/SRTPZO5Z.js +2 -0
  30. package/dist/cdn/U4S4I3VD.js +2 -0
  31. package/dist/cdn/{N2KU7FO4.js → UAA66BVA.js} +1 -1
  32. package/dist/cdn/VDTRRLON.js +2 -0
  33. package/dist/cdn/{CFIH5Y4K.js → YAXMVCUT.js} +1 -1
  34. package/dist/cdn/{5F6Q3XF5.js → ZV5BQFVT.js} +1 -1
  35. package/dist/cdn/assets/oriented-imagery-viewer-panoramic-viewer/t9n/messages.en.json +1 -0
  36. package/dist/cdn/index.js +1 -1
  37. package/dist/cdn/main.css +1 -1
  38. package/dist/chunks/action-utils.js +9 -9
  39. package/dist/chunks/graphicsLayerController.js +74 -0
  40. package/dist/chunks/utils3.js +13 -45
  41. package/dist/chunks/utils4.js +51 -0
  42. package/dist/chunks/zoom.js +32 -0
  43. package/dist/components/arcgis-aggregated-features/customElement.js +11 -11
  44. package/dist/components/arcgis-area-measurement-2d/customElement.d.ts +4 -4
  45. package/dist/components/arcgis-area-measurement-3d/customElement.d.ts +2 -2
  46. package/dist/components/arcgis-basemap-gallery/customElement.d.ts +2 -2
  47. package/dist/components/arcgis-basemap-layer-list/customElement.d.ts +2 -2
  48. package/dist/components/arcgis-basemap-layer-list-next/customElement.d.ts +2 -2
  49. package/dist/components/arcgis-basemap-toggle/customElement.d.ts +2 -2
  50. package/dist/components/arcgis-bookmarks/customElement.d.ts +2 -2
  51. package/dist/components/arcgis-building-explorer/customElement.d.ts +2 -2
  52. package/dist/components/arcgis-catalog-layer-list/customElement.d.ts +2 -2
  53. package/dist/components/arcgis-catalog-layer-list-next/customElement.d.ts +23 -18
  54. package/dist/components/arcgis-catalog-layer-list-next/customElement.js +125 -114
  55. package/dist/components/arcgis-clipboard/customElement.d.ts +2 -2
  56. package/dist/components/arcgis-compass/customElement.d.ts +2 -2
  57. package/dist/components/arcgis-coordinate-conversion/customElement.d.ts +2 -2
  58. package/dist/components/arcgis-coordinate-conversion-next/customElement.d.ts +2 -2
  59. package/dist/components/arcgis-daylight/customElement.d.ts +2 -2
  60. package/dist/components/arcgis-direct-line-measurement-3d/customElement.d.ts +2 -2
  61. package/dist/components/arcgis-directional-pad/customElement.d.ts +2 -2
  62. package/dist/components/arcgis-directions/customElement.d.ts +2 -2
  63. package/dist/components/arcgis-distance-measurement-2d/customElement.d.ts +2 -2
  64. package/dist/components/arcgis-editor/customElement.d.ts +3 -3
  65. package/dist/components/arcgis-elevation-profile/customElement.d.ts +2 -2
  66. package/dist/components/arcgis-expand/customElement.d.ts +2 -2
  67. package/dist/components/arcgis-feature/customElement.d.ts +2 -2
  68. package/dist/components/arcgis-feature-next/customElement.d.ts +2 -2
  69. package/dist/components/arcgis-feature-next/customElement.js +1 -1
  70. package/dist/components/arcgis-feature-relationship/customElement.js +1 -1
  71. package/dist/components/arcgis-feature-table/customElement.d.ts +2 -2
  72. package/dist/components/arcgis-feature-templates/customElement.d.ts +2 -2
  73. package/dist/components/arcgis-feature-utility-network-associations/customElement.js +1 -1
  74. package/dist/components/arcgis-features-next/customElement.d.ts +1 -1
  75. package/dist/components/arcgis-features-next/customElement.js +1 -1
  76. package/dist/components/arcgis-floor-filter/customElement.d.ts +2 -2
  77. package/dist/components/arcgis-grid-controls/customElement.d.ts +2 -2
  78. package/dist/components/arcgis-home/customElement.d.ts +2 -2
  79. package/dist/components/arcgis-layer-list/customElement.d.ts +2 -2
  80. package/dist/components/arcgis-layer-list-next/customElement.d.ts +2 -2
  81. package/dist/components/arcgis-legend/customElement.d.ts +2 -2
  82. package/dist/components/arcgis-line-of-sight/customElement.d.ts +2 -2
  83. package/dist/components/arcgis-link-chart-layout-switcher/customElement.d.ts +2 -2
  84. package/dist/components/arcgis-link-chart-nonspatial-visibility-toggle/customElement.d.ts +2 -2
  85. package/dist/components/arcgis-locate/customElement.d.ts +2 -2
  86. package/dist/components/arcgis-measurement/customElement.d.ts +2 -2
  87. package/dist/components/arcgis-multi-feature-form/customElement.d.ts +2 -2
  88. package/dist/components/arcgis-navigation-toggle/customElement.d.ts +2 -2
  89. package/dist/components/arcgis-oriented-imagery-viewer/customElement.d.ts +2 -2
  90. package/dist/components/arcgis-oriented-imagery-viewer-image-viewer/customElement.js +64 -132
  91. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/customElement.d.ts +51 -0
  92. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/customElement.js +1006 -0
  93. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/index.d.ts +1 -0
  94. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/index.js +5 -0
  95. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/support/PanoramicMedia.d.ts +49 -0
  96. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/support/PanoramicTilePlanner.d.ts +18 -0
  97. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/support/PanoramicTileSource.d.ts +36 -0
  98. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer-zoom/customElement.d.ts +91 -0
  99. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer-zoom/customElement.js +93 -0
  100. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer-zoom/index.d.ts +1 -0
  101. package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer-zoom/index.js +2 -0
  102. package/dist/components/arcgis-paste/customElement.d.ts +2 -2
  103. package/dist/components/arcgis-popup/customElement.d.ts +3 -3
  104. package/dist/components/arcgis-popup/customElement.js +1 -1
  105. package/dist/components/arcgis-presentation/customElement.d.ts +2 -2
  106. package/dist/components/arcgis-print/customElement.d.ts +2 -2
  107. package/dist/components/arcgis-print-dpi-input/customElement.js +1 -1
  108. package/dist/components/arcgis-print-export-button/customElement.js +1 -1
  109. package/dist/components/arcgis-print-format-select/customElement.js +1 -1
  110. package/dist/components/arcgis-print-main-panel/customElement.js +1 -1
  111. package/dist/components/arcgis-print-template-select/customElement.js +1 -1
  112. package/dist/components/arcgis-print-template-selector/customElement.js +1 -1
  113. package/dist/components/arcgis-scale-bar/customElement.d.ts +2 -2
  114. package/dist/components/arcgis-scale-range-slider/customElement.d.ts +2 -2
  115. package/dist/components/arcgis-search/customElement.d.ts +2 -2
  116. package/dist/components/arcgis-shadow-cast/customElement.d.ts +2 -2
  117. package/dist/components/arcgis-sketch/customElement.d.ts +2 -2
  118. package/dist/components/arcgis-slice/customElement.d.ts +2 -2
  119. package/dist/components/arcgis-slider-scale-range/customElement.d.ts +2 -2
  120. package/dist/components/arcgis-snapping-controls/customElement.d.ts +2 -2
  121. package/dist/components/arcgis-swipe/customElement.d.ts +2 -2
  122. package/dist/components/arcgis-table-list/customElement.d.ts +2 -2
  123. package/dist/components/arcgis-table-list-next/customElement.d.ts +2 -2
  124. package/dist/components/arcgis-time-bar/customElement.d.ts +5 -5
  125. package/dist/components/arcgis-time-bar/customElement.js +1 -1
  126. package/dist/components/arcgis-time-bar-slider/customElement.js +11 -11
  127. package/dist/components/arcgis-time-slider/customElement.d.ts +2 -2
  128. package/dist/components/arcgis-time-zone-label/customElement.d.ts +2 -2
  129. package/dist/components/arcgis-track/customElement.d.ts +2 -2
  130. package/dist/components/arcgis-utility-network-associations/customElement.d.ts +2 -2
  131. package/dist/components/arcgis-utility-network-trace/customElement.d.ts +2 -2
  132. package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +2 -2
  133. package/dist/components/arcgis-utility-network-trace-inputs/customElement.d.ts +2 -2
  134. package/dist/components/arcgis-utility-network-trace-location/customElement.d.ts +2 -2
  135. package/dist/components/arcgis-utility-network-trace-location-list/customElement.d.ts +2 -2
  136. package/dist/components/arcgis-utility-network-trace-results/customElement.d.ts +2 -2
  137. package/dist/components/arcgis-utility-network-validate-topology/customElement.d.ts +2 -2
  138. package/dist/components/arcgis-video-player/customElement.d.ts +2 -2
  139. package/dist/components/arcgis-volume-measurement/customElement.d.ts +2 -2
  140. package/dist/components/arcgis-weather/customElement.d.ts +2 -2
  141. package/dist/components/arcgis-zoom/customElement.d.ts +2 -2
  142. package/dist/components/arcgis-zoom/customElement.js +21 -45
  143. package/dist/controllers/useT9n.d.ts +3 -0
  144. package/dist/docs/api.json +1 -1
  145. package/dist/docs/docs.json +1 -1
  146. package/dist/docs/vscode.html-custom-data.json +1 -1
  147. package/dist/docs/web-types.json +1 -1
  148. package/dist/index.d.ts +14 -0
  149. package/dist/loader.js +3 -1
  150. package/dist/types/lumina.d.ts +13 -0
  151. package/dist/types/preact.d.ts +15 -0
  152. package/dist/types/react.d.ts +17 -0
  153. package/dist/types/stencil.d.ts +13 -0
  154. package/package.json +4 -4
  155. package/dist/cdn/A5XIQWD5.js +0 -2
  156. package/dist/cdn/AK62SYBC.js +0 -2
  157. package/dist/cdn/D7DH54CE.js +0 -2
  158. package/dist/cdn/KBBYF7KD.js +0 -2
  159. package/dist/cdn/M4HY5VMM.js +0 -2
  160. package/dist/cdn/MBRWWICI.js +0 -2
  161. package/dist/cdn/OO6NV5GK.js +0 -2
  162. /package/dist/cdn/{MOJH7XEP.js → 3ZXNGXHC.js} +0 -0
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as e,b as r,c as z}from"./AZFN3LR3.js";import{a as y}from"./PUAXDNBG.js";import{a as p}from"./JD74LG7K.js";import b from"./7ICJOTUR.js";import{g as d}from"./A22AUGYH.js";import"./MZQT7KZP.js";import a from"./TWMQVARD.js";import"./QUZTFUWM.js";import"./XUSIBTEV.js";import{O as m,P as h,R as o,U as u,b as n,x as i}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([{when:v},,{a:g}])=>{var c=class extends m{constructor(){super(...arguments),this.messages=y({}),this._state="disabled",this.view=g(this),this.autoDestroyDisabled=!1,this.icon="magnifying-glass-plus",this.layout="vertical",this.visualScale="m",this.arcgisActionZoom=i(),this.arcgisPropertyChange=d()("state"),this.arcgisReady=i()}static{this.properties={_state:16,view:0,autoDestroyDisabled:5,icon:1,label:1,layout:3,messageOverrides:0,referenceElement:1,visualScale:1,state:32}}static{this.styles=z}get state(){return this._state}async destroy(){await this.manager.destroy()}async zoomIn(){await this.zoomBy(1)}async zoomOut(){await this.zoomBy(-1)}loaded(){this.manager.onLifecycle(()=>[v(()=>this.view?.ready?"ready":"disabled",a=>{this._state=a},{sync:!0,initial:!0})])}async zoomBy(a){let{view:t}=this,s=a===1;!(s?e(t):r(t))||!t||(this.arcgisActionZoom.emit({action:s?"zoomIn":"zoomOut"}),s?await t.zoomIn():await t.zoomOut())}render(){let a=e(this.view),t=r(this.view),{zoomIn:s,zoomOut:l}=this.messages;return n`<div class=${h({[p.arcgisButton]:!0,horizontal:this.layout==="horizontal"})}><calcite-button class="zoom-in" .disabled=${!a} icon-start=plus kind=neutral .label=${s} @click=${this.zoomIn} .scale=${this.visualScale} title=${s??o}></calcite-button><calcite-button class="zoom-out" .disabled=${!t} icon-start=minus kind=neutral .label=${l} @click=${this.zoomOut} .scale=${this.visualScale} title=${l??o}></calcite-button></div>`}};u("arcgis-zoom",c);return c},"core/reactiveUtils",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ export default $arcgis.t(([o])=>{var a=/\.(\w+)$/iv;function r(e){let t=new URL(e).pathname.match(a);if(!(!t||t.length<2))return t[1].toUpperCase()}async function p(e,t){let n=(await o(e,{...t,method:"head"}))?.getHeader?.("Content-Type");if(n)return n.split("/")[1].toUpperCase()}return{a:r,b:p}},"request")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"./IDKRMHDS.js";import{a as u}from"./GU3M4JMW.js";import{a as c}from"./OWAKPT2D.js";import{e as v}from"./A22AUGYH.js";import"./MZQT7KZP.js";import"./QUZTFUWM.js";import"./XUSIBTEV.js";import{O as l,P as s,R as d,U as p,a as n,b as t,x as h}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([{when:w,watch:f}])=>{var x=n`:host{--num-phases: 7;--container-width: 100cqw;--phase-size: 24px;--arrow-width: 16px;--padding: var(--calcite-spacing-xxs);--divider-width-min: var(--calcite-spacing-base);--divider-width-max: var(--calcite-spacing-xl);--divider-width: calc( (var(--container-width) - (var(--phase-size) * var(--num-phases)) - (var(--arrow-width) * 2) - (var(--padding) * 2) ) / (var(--num-phases) - 1) );container-type:inline-size}.phase-picker,.phases-container{display:flex;flex-direction:row;align-items:center}.phases-container{position:relative;flex-shrink:1;padding:var(--calcite-spacing-xxs);overflow:hidden}.phase-button{appearance:none;display:flex;flex-shrink:0;align-items:center;justify-content:center;border:solid var(--calcite-border-width-sm) var(--calcite-color-border-2);border-radius:var(--calcite-corner-radius-pill);background:var(--calcite-color-background);cursor:pointer;padding:1px 0 0;width:var(--phase-size);height:var(--phase-size);color:var(--calcite-color-text-1);font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size);font-weight:var(--calcite-font-weight-regular)}.phase-button:hover{border-width:var(--calcite-border-width-md);border-color:var(--calcite-color-brand)}.phase-button:focus-visible{outline:var(--calcite-border-width-md) solid var(--calcite-color-brand);outline-offset:var(--calcite-border-width-md)}.phase-button.active{border-color:var(--calcite-color-brand);background-color:var(--calcite-foreground-1)}.phase-button.current{background-color:var(--calcite-color-brand);color:var(--calcite-color-text-inverse)}.arrow-left,.arrow-right{--calcite-internal-action-padding-inline: 0;width:var(--arrow-width);min-width:var(--arrow-width)}.divider{flex:0;background:var(--calcite-color-border-1);min-width:clamp(var(--divider-width-min),var(--divider-width),var(--divider-width-max));height:var(--calcite-border-width-sm)}.divider.active{background-color:var(--calcite-color-brand)}`,o=class extends l{constructor(){super(...arguments),this.#i=v(),this.#e=!0,this.#a=!1,this.arcgisBuildingPhaseChange=h({bubbles:!0,composed:!0})}static{this.properties={messages:0,phase:0,numberOfPhases:32,phaseHeight:32}}static{this.styles=x}get phases(){return this.phase?.allowedValues??[]}#i;#e;#a;#t(){let e=this.renderRoot.querySelector("button.current");e&&(this.#e&&(e.scrollIntoView({block:"nearest",inline:"center"}),this.#e=!1),this.#a&&(e.focus(),this.#a=!1))}#r(){this.phase&&(this.phase.next(),this.arcgisBuildingPhaseChange.emit())}#s(){this.phase&&(this.phase.previous(),this.arcgisBuildingPhaseChange.emit())}#c(e){this.phase!=null&&this.phase?.value!==e&&(this.phase?.select(e),this.arcgisBuildingPhaseChange.emit())}get numberOfPhases(){return this.phases.length}get phaseHeight(){let e=14,r=e*2/Math.sqrt(this.numberOfPhases);return Math.round(u(r,2,e))}loaded(){this.listen("keydown",e=>{switch(e.key){case"ArrowDown":case"ArrowLeft":e.stopPropagation(),e.preventDefault(),this.#s(),this.#a=!0;break;case"ArrowUp":case"ArrowRight":e.stopPropagation(),e.preventDefault(),this.#r(),this.#a=!0;break}}),this.manager.onLifecycle(()=>[w(()=>this.phase?.state==="ready",()=>{requestAnimationFrame(()=>{this.#e=!0,this.#t()})},{initial:!0}),f(()=>this.phase?.value,()=>{this.#e=!0,this.#t()})])}render(){let e=this.phase,r=this.messages;return!r||e==null?null:t`<div class="phase-picker">${g({className:"arrow-left",disabled:!1,icon:this.#i==="rtl"?"chevron-right":"chevron-left",onClick:()=>this.#s(),text:r.previousPhase})}<div class="phases-container">${this.phases.map((i,m)=>t`${m>0&&t`<span class=${s({divider:!0,active:e.value>=i})}></span>`||""}${c(i,t`<button class=${s({"phase-button":!0,active:e.value>=i,current:e.value===i})} @click=${()=>{this.#c(i)}}>${i}</button>`)}`)}</div>${g({className:"arrow-right",disabled:!1,icon:this.#i==="rtl"?"chevron-left":"chevron-right",onClick:()=>this.#r(),text:r.nextPhase})}</div>`}};function g(a){return c(a.className,t`<calcite-action class=${s(a.className)} .disabled=${a.disabled} .icon=${a.icon} icon-flip-rtl @click=${a.onClick} scale=s .text=${a.text} title=${a.text??d}></calcite-action>`)}p("arcgis-building-phase-picker",o);return o},"core/reactiveUtils")
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as _,b as z,c as V}from"./AZFN3LR3.js";import{a as e,b as O,c as p,d as s,e as o,f as r}from"./VDTRRLON.js";import{a as y}from"./GU3M4JMW.js";import{a as d}from"./PUAXDNBG.js";import{a as g}from"./JD74LG7K.js";import f from"./7ICJOTUR.js";import"./A22AUGYH.js";import"./MZQT7KZP.js";import b from"./TWMQVARD.js";import"./QUZTFUWM.js";import"./XUSIBTEV.js";import{O as l,P as u,R as a,U as w,b as c,x as v}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([,{a:f}])=>{var h=class extends l{constructor(){super(...arguments),this.messages=d({name:"zoom"}),this._state="disabled",this.view=f(this),this.autoDestroyDisabled=!1,this.icon="magnifying-glass-plus",this.layout="vertical",this.visualScale="m",this.arcgisReady=v()}static{this.properties={_state:16,_canZoomIn:16,_canZoomOut:16,_maxFOV:16,_minFOV:16,zoomLevel:32,view:0,autoDestroyDisabled:5,icon:1,label:1,layout:3,messageOverrides:0,referenceElement:1,visualScale:1,state:32,hfov:32,vfov:32}}static{this.styles=V}get _canZoomIn(){return this.view?.ready?this._minFOV===0?!0:this.view.camera.fov>this._minFOV:!1}get _canZoomOut(){return this.view?.ready?this._maxFOV===0?!0:this.view.camera.fov<this._maxFOV:!1}get _maxFOV(){if(!this.view?.ready)return s;let t=this.view.width/this.view.height;return e(s,t)}get _minFOV(){if(!this.view?.ready)return o;let t=this.view.width/this.view.height;return e(o,t)}get zoomLevel(){if(!this.view?.ready)return;let{hfov:t}=this;return Math.max(1,Math.log(s/t)/Math.log(2))}get state(){return this._state}get hfov(){let{view:t}=this;if(!t?.ready)return;let i=t.width/t.height;return O(t.camera.fov,i)}get vfov(){let{view:t}=this;if(!t?.ready)return;let i=t.width/t.height;return p(t.camera.fov,i)}async destroy(){await this.manager.destroy()}zoomFOV(t){this.view?.ready&&(this.view.camera.fov=y(t,this._minFOV,this._maxFOV),this.view.camera=this.view.camera.clone())}zoomIn(){if(!this._canZoomIn||!this.view)return;let t=this.view.width/this.view.height;this.zoomFOV(this.view.camera.fov-e(r,t))}zoomOut(){if(!this._canZoomOut||!this.view)return;let t=this.view.width/this.view.height;this.zoomFOV(this.view.camera.fov+e(r,t))}render(){let t=_(this.view),i=z(this.view),{zoomIn:n,zoomOut:m}=this.messages;return c`<div class=${u({[g.arcgisButton]:!0,horizontal:this.layout==="horizontal"})}><calcite-button class="zoom-in" .disabled=${!t} icon-start=plus kind=neutral .label=${n} @click=${this.zoomIn} .scale=${this.visualScale} title=${n??a}></calcite-button><calcite-button class="zoom-out" .disabled=${!i} icon-start=minus kind=neutral .label=${m} @click=${this.zoomOut} .scale=${this.visualScale} title=${m??a}></calcite-button></div>`}};w("arcgis-oriented-imagery-viewer-panoramic-viewer-zoom",h);return h},b,f)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import o from"./5W6NJGFF.js";import l from"./NRHOAASJ.js";import"./KXLECJE4.js";import{a as K}from"./JCRPP54Z.js";import"./FYNG6CYN.js";import{a as U,b as G,g as N,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as S}from"./AR56PQPF.js";import{a as m}from"./OWAKPT2D.js";import j from"./XFH2TUXK.js";import i from"./MZWO5JYA.js";import h from"./XD52OHCM.js";import"./VJVKFKSG.js";import f from"./5W7XCJ5B.js";import{a as O}from"./PUAXDNBG.js";import{a as y}from"./JD74LG7K.js";import{a as k}from"./V63SHRQJ.js";import e from"./EI6T7BKN.js";import b from"./7ICJOTUR.js";import{g as B}from"./A22AUGYH.js";import"./MZQT7KZP.js";import a from"./TWMQVARD.js";import"./QUZTFUWM.js";import{d as P}from"./XUSIBTEV.js";import{B as M,M as d,N as g,O as R,P as p,R as u,S as w,U as A,a as C,b as n,x as I}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,b,{on:se,watch:ae},,,{a:D},x,,,,,{a:j,b:z,c:J}])=>{var f={...K,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)}`,Q="nested",le=".*\\S+.*",V="data-basemap-layer-type",ne=x(ie),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 r=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=c(e,this._allItems);if(!l?.sortable)return!1;let a=c(t,this._allItems),o=$(t),h=c(i,this._allItems),L=$(i),_=!!o&&!!L&&o===L,X={selected:l,from:a,to:h},Y=t.group,Z=i.group,ee=a?.layer?.type??"",te=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Y&&Z&&typeof r=="function"?r(X):_&&!T.has(ee)&&!T.has(te)&&l.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(f.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 b,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseListItemCreatedFunction=this.viewModel.baseListItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.icon="layers",this.layerTablesEnabled=new b(["knowledge-graph"]),this.minFilterItems=G,this.openedLayers=new b,this.referenceFilterText="",this.referenceListItemCreatedFunction=this.viewModel.referenceListItemCreatedFunction,this.selectedItems=new b,this.selectionMode="none",this.visibilityAppearance="default",this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=I(),this.arcgisBaseFilterChange=I(),this.arcgisReferenceFilterChange=I(),this.arcgisOpenedLayersChange=I(),this.arcgisTriggerAction=D(()=>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,view:0,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItems:32,baseListItemCreatedFunction:0,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,mapImageOptions:0,minFilterItems:9,openedLayers:32,position:1,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceListItemCreatedFunction:0,selectedItems:0,selectionMode:1,tableList:32,tileOptions:0,visibilityAppearance:1,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideReferenceLayers:5,hideStatusIndicators:5,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,messageOverrides:0,state:32}}static{this.styles=[J,re,z]}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(()=>[se(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),ae(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>N(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:r}=s;this._openedLayersController=s,e.forEach((o,h)=>{t.includes(h)||(o?.destroy?.(),e.delete(h))});let l=await Promise.all(t.map(o=>this._createFlowList(o,r)));if(r.aborted)return;i.removeAll(),i.addMany(l);let a=i.at(-1);a?"catalogLayer"in a?(this._catalogLayerList=a,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=a):(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:r,selectionMode:l,visibilityAppearance:a,layerTablesEnabled:o}=this;return w(n`<arcgis-catalog-layer-list .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??a} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${o} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list>`)}_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(n`<arcgis-table-list .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>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let r=c(i,this._allItems),l=c(e,this._allItems),a=c(t,this._allItems),o=W(t),h=W(e);s==null||!r||!a||!l||!o||!h||this.viewModel.moveListItem({targetItem:r,fromParentItem:a,toParentItem:l,newIndex:s,from:o,to:h})}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:r}=e;if(t!==i){s.remove();return}r==null||!t||!s||t.insertBefore(s,t.children[r])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:r,newIndex:l}=e,a=t?.newIndex===l&&t?.dragEl===r&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||a)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=r.value.layer?.uid??null;let o=s,h=i;if(o===h){let L=Array.from(s.children).filter(_=>_?.matches("calcite-list-item")).map(_=>_.value.layer?.uid??"");this._sortLayers(o,L);return}this._moveLayerFromChildList({toEl:h,fromEl:o,dragEl:r,newIndex:l})}_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={[y.hidden]:this.state==="loading",[y.disabled]:this.state==="disabled"};return n`<div class=${p(P(y.widget,y.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?n`<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 n`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return n`<div class=${p(f.itemMessage)}>${m(t,n`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return n`<div class=${p(f.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${le} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??u} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?n`<form class=${p(f.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?n`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??u}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",n`<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",n`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return S(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,r=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),n`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${l=>{l.preventDefault(),r()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${r} 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,n`<calcite-flow-item data-layer-uid=${e.uid??u} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let r=this.openedLayers.at(-1);r?this._focusLayerFlowItem=r.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,r=t==="reference"?this.referenceFilterText:this.baseFilterText,l=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,n`<calcite-block class=${p(f.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(l,t)}${m(`list-${t}`,n`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${a=>this._canMove(a,"pull")} .canPut=${a=>this._canMove(a,"put")} data-basemap-layer-type=${t??u} data-layer-type=${this._rootGroupUid??u} .displayMode=${Q} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${U} .filterText=${s?r:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${a=>this._handleCalciteListDragEnd(a.detail)} @calciteListFilter=${a=>{let o=a.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=o,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${a=>this._onCalciteListOrderChange(a.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(a=>this._renderItem(a,i))}${s?n`<div class=${p(f.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(l)}</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,j({activeItem:this._activeItem,canMove:this._canMove,css:f,displayMode:Q,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 W(E){let e=E.closest(`[${V}]`)?.getAttribute(V);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"widgets/BasemapLayerList/BasemapLayerListViewModel","core/Collection","core/reactiveUtils",a,b,e,f,h,i,j,l,o)
2
+ import o from"./QKCBSK73.js";import l from"./APOCPBJG.js";import"./KXLECJE4.js";import{a as K}from"./JCRPP54Z.js";import"./FYNG6CYN.js";import{a as U,b as G,g as N,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as S}from"./AR56PQPF.js";import{a as m}from"./OWAKPT2D.js";import j from"./XFH2TUXK.js";import i from"./MZWO5JYA.js";import h from"./XD52OHCM.js";import"./VJVKFKSG.js";import f from"./5W7XCJ5B.js";import{a as O}from"./PUAXDNBG.js";import{a as y}from"./JD74LG7K.js";import{a as k}from"./V63SHRQJ.js";import e from"./EI6T7BKN.js";import b from"./7ICJOTUR.js";import{g as B}from"./A22AUGYH.js";import"./MZQT7KZP.js";import a from"./TWMQVARD.js";import"./QUZTFUWM.js";import{d as P}from"./XUSIBTEV.js";import{B as M,M as d,N as g,O as R,P as p,R as u,S as w,U as A,a as C,b as n,x as I}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,b,{on:se,watch:ae},,,{a:D},x,,,,,{a:j,b:z,c:J}])=>{var f={...K,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)}`,Q="nested",le=".*\\S+.*",V="data-basemap-layer-type",ne=x(ie),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 r=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=c(e,this._allItems);if(!l?.sortable)return!1;let a=c(t,this._allItems),o=$(t),h=c(i,this._allItems),L=$(i),_=!!o&&!!L&&o===L,X={selected:l,from:a,to:h},Y=t.group,Z=i.group,ee=a?.layer?.type??"",te=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Y&&Z&&typeof r=="function"?r(X):_&&!T.has(ee)&&!T.has(te)&&l.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(f.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 b,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseListItemCreatedFunction=this.viewModel.baseListItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.icon="layers",this.layerTablesEnabled=new b(["knowledge-graph"]),this.minFilterItems=G,this.openedLayers=new b,this.referenceFilterText="",this.referenceListItemCreatedFunction=this.viewModel.referenceListItemCreatedFunction,this.selectedItems=new b,this.selectionMode="none",this.visibilityAppearance="default",this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=I(),this.arcgisBaseFilterChange=I(),this.arcgisReferenceFilterChange=I(),this.arcgisOpenedLayersChange=I(),this.arcgisTriggerAction=D(()=>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,view:0,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItems:32,baseListItemCreatedFunction:0,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,mapImageOptions:0,minFilterItems:9,openedLayers:32,position:1,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceListItemCreatedFunction:0,selectedItems:0,selectionMode:1,tableList:32,tileOptions:0,visibilityAppearance:1,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideReferenceLayers:5,hideStatusIndicators:5,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,messageOverrides:0,state:32}}static{this.styles=[J,re,z]}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(()=>[se(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),ae(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>N(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:r}=s;this._openedLayersController=s,e.forEach((o,h)=>{t.includes(h)||(o?.destroy?.(),e.delete(h))});let l=await Promise.all(t.map(o=>this._createFlowList(o,r)));if(r.aborted)return;i.removeAll(),i.addMany(l);let a=i.at(-1);a?"catalogLayer"in a?(this._catalogLayerList=a,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=a):(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:r,selectionMode:l,visibilityAppearance:a,layerTablesEnabled:o}=this;return w(n`<arcgis-catalog-layer-list .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??a} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${o} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list>`)}_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(n`<arcgis-table-list .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>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let r=c(i,this._allItems),l=c(e,this._allItems),a=c(t,this._allItems),o=W(t),h=W(e);s==null||!r||!a||!l||!o||!h||this.viewModel.moveListItem({targetItem:r,fromParentItem:a,toParentItem:l,newIndex:s,from:o,to:h})}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:r}=e;if(t!==i){s.remove();return}r==null||!t||!s||t.insertBefore(s,t.children[r])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:r,newIndex:l}=e,a=t?.newIndex===l&&t?.dragEl===r&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||a)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=r.value.layer?.uid??null;let o=s,h=i;if(o===h){let L=Array.from(s.children).filter(_=>_?.matches("calcite-list-item")).map(_=>_.value.layer?.uid??"");this._sortLayers(o,L);return}this._moveLayerFromChildList({toEl:h,fromEl:o,dragEl:r,newIndex:l})}_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={[y.hidden]:this.state==="loading",[y.disabled]:this.state==="disabled"};return n`<div class=${p(P(y.widget,y.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?n`<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 n`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return n`<div class=${p(f.itemMessage)}>${m(t,n`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return n`<div class=${p(f.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${le} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??u} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?n`<form class=${p(f.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?n`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??u}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",n`<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",n`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return S(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,r=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),n`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${l=>{l.preventDefault(),r()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${r} 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,n`<calcite-flow-item data-layer-uid=${e.uid??u} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let r=this.openedLayers.at(-1);r?this._focusLayerFlowItem=r.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,r=t==="reference"?this.referenceFilterText:this.baseFilterText,l=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,n`<calcite-block class=${p(f.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(l,t)}${m(`list-${t}`,n`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${a=>this._canMove(a,"pull")} .canPut=${a=>this._canMove(a,"put")} data-basemap-layer-type=${t??u} data-layer-type=${this._rootGroupUid??u} .displayMode=${Q} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${U} .filterText=${s?r:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${a=>this._handleCalciteListDragEnd(a.detail)} @calciteListFilter=${a=>{let o=a.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=o,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${a=>this._onCalciteListOrderChange(a.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(a=>this._renderItem(a,i))}${s?n`<div class=${p(f.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(l)}</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,j({activeItem:this._activeItem,canMove:this._canMove,css:f,displayMode:Q,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 W(E){let e=E.closest(`[${V}]`)?.getAttribute(V);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"widgets/BasemapLayerList/BasemapLayerListViewModel","core/Collection","core/reactiveUtils",a,b,e,f,h,i,j,l,o)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import j from"./NRHOAASJ.js";import{a as k}from"./OWAKPT2D.js";import i from"./XFH2TUXK.js";import h from"./MZWO5JYA.js";import g from"./XD52OHCM.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./5W7XCJ5B.js";import{a as P}from"./PUAXDNBG.js";import e from"./EI6T7BKN.js";import d from"./7ICJOTUR.js";import{e as L,g as H}from"./A22AUGYH.js";import"./MZQT7KZP.js";import b from"./TWMQVARD.js";import"./QUZTFUWM.js";import{d as y}from"./XUSIBTEV.js";import{M,N as v,O as N,P as x,R as c,S as R,U as B,a as O,b as a,o as C,p as $,x as A}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.hideExpressionContent=!1,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.visible,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null)}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)
2
+ import j from"./APOCPBJG.js";import{a as k}from"./OWAKPT2D.js";import i from"./XFH2TUXK.js";import h from"./MZWO5JYA.js";import g from"./XD52OHCM.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./5W7XCJ5B.js";import{a as P}from"./PUAXDNBG.js";import e from"./EI6T7BKN.js";import d from"./7ICJOTUR.js";import{e as L,g as H}from"./A22AUGYH.js";import"./MZQT7KZP.js";import b from"./TWMQVARD.js";import"./QUZTFUWM.js";import{d as y}from"./XUSIBTEV.js";import{M,N as v,O as N,P as x,R as c,S as R,U as B,a as O,b as a,o as C,p as $,x as A}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.hideExpressionContent=!1,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.visible,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null)}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import b from"./SRTPZO5Z.js";import a from"./XD52OHCM.js";import"./VJVKFKSG.js";import{a as C}from"./PUAXDNBG.js";import"./A22AUGYH.js";import"./MZQT7KZP.js";import"./QUZTFUWM.js";import"./XUSIBTEV.js";import{M as u,N as f,O as y,U as w,a as g,b as p,p as _}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:d,subclass:b},M,,P,{watch:m},{rotateDimensions:I,registerPanConstraint:G},z,,{b:c},R])=>{var L=g`:host{height:100%;--arcgis-view-color-focus: none}`,O=Object.defineProperty,x=Object.getOwnPropertyDescriptor,h=(t,e,r,i)=>{for(var a=i>1?void 0:i?x(e,r):e,s=t.length-1,o;s>=0;s--)(o=t[s])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&O(e,r,a),a},n=class extends M{constructor(t){super(t),this.autoLoad=!1}static isNonPanoramicMedia(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass==="components.oriented-imagery-viewer.support.NonPanoramicMedia"}destroy(){this._cache?.destroy(),this._cache=void 0}get layer(){return this._cache}get size(){if(!this._cache||this._cache.destroyed||this._cache.loadError||!this._cache.serviceRasterInfo)return;let{serviceRasterInfo:t}=this._cache;return[t.width,t.height]}async load(t){if(this._cache&&!this._cache.destroyed)return await this._cache.load(t),{layer:this._cache,size:this.size};let{url:e,customParameters:r}=this,i=this.datasetFormat;if(!e)throw new Error("URL is required to load NonPanoramicMedia.");if(!i){let o=await import("./DBA7NSTP.js").then(m=>m.default);if(c(t),i=o.guessExtensionFromURI(e),!i){try{i=await o.getDatasetFormat(e)}catch{_("warn",this,"Failed to determine dataset format from URL or response headers."),i="UNKNOWN FORMAT"}c(t)}}this.datasetFormat=i;let a=(await $arcgis.t(m=>m[0],"layers/ImageryTileLayer")).default;c(t);let s=new a({url:e,ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:i},customParameters:r??void 0});return await s.load(t),c(t),this._cache=s,{layer:this._cache,size:this.size}}};h([d()],n.prototype,"_cache",2);h([d()],n.prototype,"autoLoad",2);h([d()],n.prototype,"customParameters",2);h([d()],n.prototype,"datasetFormat",2);h([d()],n.prototype,"url",2);h([d()],n.prototype,"layer",1);h([d()],n.prototype,"size",1);n=h([b("components.oriented-imagery-viewer.support.NonPanoramicMedia")],n);function E(t,e,r,i,a){let{width:s,height:o}=I(t,e,a);return Math.max(s/r,o/i)}var F=96,A=39.37,v=A*F;function N(t){let e=v*.25,r=v*t,i=[],a=r;for(;a>e;)i.push(a),a*=.5;i.push(e);let{lods:s}=z.create({scales:i});return{minScale:r,lods:s}}var l=class extends y{constructor(){super(...arguments),this._messages=C(),this._graphicsController=new R(this),this._imageChanged=!1,this._internalMap=u(),this._loading=!1,this.hideHeader=!1,this.hideLoader=!1,this.hideZoomControls=!1,this.rotation=0}static{this.properties={_imageChanged:16,_internalMap:16,_image:16,_loading:16,_media:16,hideHeader:5,hideLoader:5,hideZoomControls:5,messageOverrides:0,media:0,rotation:9}}static{this.styles=[L]}get imageRenderer(){return this._internalMap?.value?.view}get map(){return this.imageRenderer?.map}get media(){return this._media}set media(e){if(!e){this._mediaAbortController?.abort(),this._media=void 0,this._clearImage();return}this._media=e instanceof n?e:new n(e)}addGraphic(e){this._graphicsController.addGraphic(e)}addGraphics(e){this._graphicsController.addGraphics(e)}clearGraphics(){this._graphicsController.clearGraphics()}async mediaOnLoad(){return this._mediaPromise&&await this._mediaPromise,this._media}removeGraphic(e){this._graphicsController.removeGraphic(e)}removeGraphics(e){this._graphicsController.removeGraphics(e)}loaded(){this.manager.onLifecycle(()=>[this._createResizeConstraint(),this._createRotationHandler(),this._createPanConstraint(),m(()=>this._media,e=>{this._mediaAbortController?.abort(),e&&(this._mediaAbortController=new AbortController,this._mediaPromise=this._loadMediaInternal(e,this._mediaAbortController))},{initial:!0,sync:!0})])}_createPanConstraint(){return m(()=>({image:this._image,imageRenderer:this.imageRenderer}),({image:e,imageRenderer:r})=>{!e||!r?.ready||G(r,e)},{sync:!0,initial:!0})}_createResizeConstraint(){return m(()=>{if(!this.imageRenderer?.ready||!this._image)return;let{width:e,height:r}=this._image.serviceRasterInfo,{width:i,height:a,rotation:s}=this.imageRenderer;return E(e,r,i,a,s)},e=>{if(!e||!this.imageRenderer)return;let{constraints:r,scale:i}=this.imageRenderer,a=r.minScale,{lods:s,minScale:o}=N(e);r.set({minScale:o,lods:s}),this.imageRenderer.scale=this._imageChanged||Math.abs(i-a)<=1e-6?o:i,this._imageChanged=!1},{sync:!0,initial:!0})}_createRotationHandler(){return m(()=>this.rotation,e=>{this.imageRenderer&&(this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=e,this.imageRenderer.constraints.rotationEnabled=!1)},{sync:!0,initial:!0})}_clearImage(){this._image?.destroy(),this._image=void 0}async _loadMediaInternal(e,r){if(this._loading=!0,this._clearImage(),!e)throw new Error("No media provided");let{layer:i}=await e.load(r).finally(()=>{this._loading=!1});c(r),this._imageChanged=!0,this._image=i,this.imageRenderer?.map?.layers.add(this._image)}render(){return p`<calcite-panel .loading=${this.hideLoader?void 0:this._loading} .heading=${this.hideHeader?void 0:this._messages.title}><arcgis-map hide-attribution .spatialReference=${P.WebMercator} ${f(this._internalMap)}><arcgis-zoom .hidden=${this.hideZoomControls} .messageOverrides=${this.messageOverrides} slot=top-left></arcgis-zoom></arcgis-map></calcite-panel>`}};w("arcgis-oriented-imagery-viewer-image-viewer",l);return l},"core/accessorSupport/decorators","core/Accessor","views/MapView","geometry/SpatialReference","core/reactiveUtils","applications/Components/OrientedImageryViewer/ImageViewer/utils","layers/support/TileInfo","Graphic",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as w}from"./IZ46HAUJ.js";import{M as o,N as m,O as u,P as v,R as g,U as f,a as h,b as a}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([c,{watch:x}])=>{var p=h`:host{background-color:var(--calcite-color-surface-2);block-size:var(--calcite-size-fixed-xxxl);color:var(--calcite-color-text-1);display:flex;flex:1 0 auto;font-family:var(--calcite-font-family);font-size:var(--calcite-font-size-sm);inline-size:auto}.root{align-items:center;block-size:100%;display:flex;inline-size:100%}slot[name=max],slot[name=min]{display:flex}.slider{--labels-container-width: 100%;flex:1 1 auto;min-inline-size:calc(var(--calcite-spacing-md) * 15)}.slider--has-ticks{margin-top:calc(var(--calcite-spacing-md) * -1)}.hidden,.max-date,.min-date{flex:0 0 auto}.hidden{inline-size:0}.max-date,.min-date{inline-size:calc(var(--calcite-size-md) * 3.125)}.popover{padding:var(--calcite-spacing-xxs) var(--calcite-spacing-xs) var(--calcite-spacing-xs)}.ticks-container{flex:1;position:relative;width:100%}.major-ticks,.minor-ticks{inset:0;position:absolute}.major-ticks,.minor-ticks{--arcgis-ticks-tick-transform: unset;--arcgis-ticks-tick-width: var(--calcite-size-px)}.minor-ticks{--arcgis-ticks-tick-length: var(--calcite-size-fixed-xxs)}.major-ticks{--arcgis-ticks-font-weight: var(--calcite-font-weight-normal)}.slider.slider--out-of-range{--arcgis-internal-slider-handle-color: var(--calcite-color-status-danger);--arcgis-internal-slider-track-range-background-color: var(--calcite-color-status-danger)}`,d=class extends u{constructor(){super(...arguments),this.#e=new ResizeObserver(()=>{let e=this.#r.value?.clientWidth;e&&(this._sliderWidth=e)}),this.#l=3,this.#a=o(),this.#r=o(),this._sliderWidth=100,this.autoDestroyDisabled=!1,this.showMax=!1,this.showMin=!1,this.showTicks=!1,this.showTimeExtentPopover=!1}static{this.properties={_activeValue:16,_sliderFillPlacement:16,_sliderWidth:16,_timeExtentEpochValues:16,activeValue:32,autoDestroyDisabled:5,showMax:5,showMin:5,showTicks:5,showTimeExtentPopover:5,viewModel:0}}static{this.styles=p}#e;#t;#i;#s;#l;#a;#r;get _sliderFillPlacement(){switch(this.viewModel?.mode){case"cumulative-from-end":return"end";case"cumulative-from-start":return"start";case"instant":return"none";default:return}}get _timeExtentEpochValues(){let{viewModel:e}=this;if(!e)return;let{timeExtent:t,fullTimeExtent:i}=e;if(!t||!i)return;let{start:s,end:r}=t,{start:l,end:n}=i;if(!(!l||!n))switch(e.mode){case"cumulative-from-end":case"instant":return s?s.getTime()<l.getTime()?[l.getTime()]:s.getTime()>n.getTime()?[n.getTime()]:[s.getTime()]:void 0;case"cumulative-from-start":return r?r.getTime()<l.getTime()?[l.getTime()]:r.getTime()>n.getTime()?[n.getTime()]:[r.getTime()]:void 0;case"time-window":return s&&r?[s.getTime(),r.getTime()]:void 0}}get activeValue(){switch(this._activeValue){case void 0:return;case"all":return this.viewModel?.timeExtent;default:return new Date(this._activeValue)}}async destroy(){await this.manager.destroy()}async loaded(){this.manager.onLifecycle(()=>[x(()=>this.#a.value,e=>{this.#e.disconnect(),e&&this.#e.observe(e)},{initial:!0}),w(()=>{this.#e.disconnect()})])}#n(e,t){let{viewModel:i}=this;if(!i)return;let{start:s,end:r}=e;if(!s||!r)return;let l=(r.getTime()-s.getTime())/t;return i.tickFormats.find(({duration:n})=>n>this.#l*l)??i.tickFormats.at(-1)}#c(e){this._activeValue=e.target.activeValue}#o(e){let{viewModel:t}=this,i=t?.mode;i&&(t.timeExtent=this.#m(e.target.values,i),this._activeValue=e.target.activeValue)}#m([e,t],i){switch(i){case"cumulative-from-end":return new c({start:new Date(e),end:null});case"cumulative-from-start":return new c({start:null,end:new Date(e)});case"instant":return new c({start:new Date(e),end:new Date(e)});case"time-window":return new c({start:new Date(e),end:new Date(t??e)})}}render(){return a`<div class="root" ${m(this.#a)}>${this.#h()}${this.#g()}${this.#d()}</div>`}#d(){return this.showMax?a`<slot name=max><arcgis-time-bar-date class="max-date" .date=${this.viewModel?.fullTimeExtent?.end} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>`:a`<div class="hidden"></div>`}#h(){return this.showMin?a`<slot name=min><arcgis-time-bar-date class="min-date" .date=${this.viewModel?.fullTimeExtent?.start} .viewModel=${this.viewModel}></arcgis-time-bar-date></slot>`:a`<div class="hidden"></div>`}#u(){return this.showTimeExtentPopover?a`<div class="popover" slot=popover><slot name=popover>${this.#v()}</slot></div>`:null}#v(){return this.activeValue?this.activeValue instanceof Date?a`<arcgis-time-bar-date .date=${this.activeValue} .viewModel=${this.viewModel}></arcgis-time-bar-date>`:a`<arcgis-time-bar-extent .viewModel=${this.viewModel}></arcgis-time-bar-extent>`:null}#g(){let{viewModel:e}=this;if(!e?.fullTimeExtent?.start||!e?.fullTimeExtent?.end||!this._sliderWidth)return null;let t=this.#n(e.fullTimeExtent,this._sliderWidth);if(!t)return null;(!this.#t||!this.#s||!this.#i||this.#t!==t)&&(this.#t=t,this.#s=e.getTickValues(t.minor),this.#i=e.getTickValues(t.major),e.majorTickFormat=t.format);let i=e.fullTimeExtent.start.getTime(),s=e.fullTimeExtent.end.getTime();return a`<arcgis-slider allow-values-overlap class=${v({slider:!0,"slider--has-ticks":this.showTicks,"slider--out-of-range":e.isOutOfRange})} .disabled=${!e.interactive} fill-placement=${this._sliderFillPlacement??g} .max=${s} .min=${i} @arcgisActiveValueChange=${this.#c} @arcgisInput=${this.#o} precision=0 .steps=${e.effectiveStopsEpoch} .values=${this._timeExtentEpochValues} ${m(this.#r)}>${this.#u()}${this.#f(e,i,s)}</arcgis-slider>`}#f(e,t,i){return this.showTicks?a`<div slot=content-end class="ticks-container"><arcgis-ticks class="minor-ticks" .max=${i} .min=${t} mode=value .values=${this.#s}></arcgis-ticks><arcgis-ticks class="major-ticks" .labelFormatter=${e.majorTickFormatter} .max=${i} .min=${t} mode=value show-labels .values=${this.#i}></arcgis-ticks></div>`:null}};f("arcgis-time-bar-slider",d);return d},"time/TimeExtent","core/reactiveUtils")
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import b from"./XFH2TUXK.js";import a from"./XD52OHCM.js";export default $arcgis.t(([{isZoomScreenSize:m},{d:g},{d:u}])=>{function q(e){if(e.icon)return e.icon;if(!("image"in e&&e.image)&&!e.className)return"question"}function M(e){return e?{backgroundImage:`url(${e})`}:{}}function b(e){let{selectedFeature:r,location:o,view:t}=e;return t?r??o??null:null}function v(e){return"browseClusterEnabled"in e&&"featureMenuOpen"in e}function h(e){return"aggregatedFeaturesEnabled"in e}async function E(e,r,o){let{location:t,selectedFeature:a,view:i,zoomFactor:n}=e;await o?.viewModel?.updateGeometry();let s=o?.graphic,d=s?.geometry?s:b(e);if(!i||!d)throw new Error("Cannot zoom to location without a target and view.");let w=i.scale/n,c=s?.geometry??e.selectedFeature?.geometry??t,l=c?.type==="point"&&await m(s??a,i);r.active=!0,r.disabled=!0;try{await e.zoomTo({target:{target:d,scale:l?w:void 0}})}catch(f){if(g(f))return;throw new Error("Could not zoom to the location of the graphic.")}finally{r.active=!1,r.disabled=!1,l&&e.location!==c&&(e.location=c)}}async function p(e,r){let o=await e.whenLayerView(u(r)),t=o.createQuery(),a=r.getObjectId();return t.aggregateIds=a!=null?[a]:[],[o,t]}async function y(e,r){let{selectedFeature:o,view:t}=e;if(t?.type!=="2d")throw new Error("zoomToAggregate:invalid-view: View must be 2d MapView.");if(!o?.isAggregate)throw new Error("zoomToAggregate:invalid-selectedFeature: Selected feature must represent an aggregate graphic.");let[a,i]=await p(t,o);r.active=!0,r.disabled=!0;let{extent:n}=await a.queryExtent(i);n&&await e.zoomTo({target:n}),r.active=!1,r.disabled=!1}var T=async(e,r)=>{if(!e)throw new Error("trigger-action:missing-arguments: Event has no action");let{disabled:o,id:t}=e;if(!t)throw new Error("trigger-action:invalid-action: action.id is missing");if(o)throw new Error("trigger-action:invalid-action: Action is disabled");if(t==="zoom-to-feature")return await E(r,e).catch(a=>{if(!g(a))throw a});if(t==="zoom-to-aggregated-features")return await y(r,e);if(t==="browse-clustered-features"){if(!v(r))throw new Error("trigger-action:invalid-view-model: browse-clustered-features requires FeaturesViewModel.");r.browseClusterEnabled=!r.browseClusterEnabled,r.featureMenuOpen=r.browseClusterEnabled;return}if(t==="browse-aggregated-features"){if(!h(r))throw new Error("trigger-action:invalid-view-model: browse-aggregated-features requires Features.");r.aggregatedFeaturesEnabled=!r.aggregatedFeaturesEnabled;return}if(t==="remove-selected-feature"){r.open=!1;let{selectedFeature:a}=r;if(!a)throw new Error("trigger-action:missing-selected-feature: Cannot remove selected feature without a selected feature.");let i=u(a);i?i.remove(a):r.view?.graphics.remove(a)}};return{a:q,b:M,c:E,d:T}},"applications/Components/actionUtils",a,b)
2
+ import b from"./XFH2TUXK.js";import a from"./XD52OHCM.js";export default $arcgis.t(([{isZoomScreenSize:m},{d:g},{d:u}])=>{function q(e){if(e.icon)return e.icon;if(!("image"in e&&e.image)&&!e.className)return"question"}function M(e){return e?{backgroundImage:`url(${e})`}:{}}function v(e){let{selectedFeature:r,location:o,view:t}=e;return t?r??o??null:null}function b(e){return"browseClusterEnabled"in e&&"featureMenuOpen"in e}function h(e){return"aggregatedFeaturesEnabled"in e}async function E(e,r,o){let{location:t,selectedFeature:a,view:i,zoomFactor:n}=e;await o?.viewModel?.updateGeometry();let s=o?.graphic,l=s?.geometry?s:v(e);if(!i||!l)throw new Error("Cannot zoom to location without a target and view.");let w=i.scale/n,c=s?.geometry??e.selectedFeature?.geometry??t,d=c?.type==="point"&&await m(s??a,i);r.active=!0,r.disabled=!0;try{await e.zoomTo({target:{target:l,scale:d?w:void 0}})}catch(f){if(g(f))return;throw new Error("Could not zoom to the location of the graphic.")}finally{r.active=!1,r.disabled=!1,d&&e.location!==c&&(e.location=c)}}async function p(e,r){let o=await e.whenLayerView(u(r)),t=o.createQuery(),a=r.getObjectId();return t.aggregateIds=a!=null?[a]:[],[o,t]}async function y(e,r){let{selectedFeature:o,view:t}=e;if(t?.type!=="2d")throw new Error("zoomToAggregate:invalid-view: View must be 2d MapView.");if(!o?.isAggregate)throw new Error("zoomToAggregate:invalid-selectedFeature: Selected feature must represent an aggregate graphic.");let[a,i]=await p(t,o);r.active=!0,r.disabled=!0;let{extent:n}=await a.queryExtent(i);n&&await e.zoomTo({target:n}),r.active=!1,r.disabled=!1}var T=async(e,r)=>{if(!e)throw new Error("trigger-action:missing-arguments: Event has no action");let{disabled:o,id:t}=e;if(!t)throw new Error("trigger-action:invalid-action: action.id is missing");if(o)throw new Error("trigger-action:invalid-action: Action is disabled");if(t==="zoom-to-feature")return await E(r,e).catch(a=>{if(!g(a))throw a});if(t==="zoom-to-aggregated-features")return await y(r,e);if(t==="browse-clustered-features"){if(!b(r))throw new Error("trigger-action:invalid-view-model: browse-clustered-features requires FeaturesViewModel.");r.browseClusterEnabled=!r.browseClusterEnabled,r.featureMenuOpen=r.browseClusterEnabled;return}if(t==="browse-aggregated-features"){if(!h(r))throw new Error("trigger-action:invalid-view-model: browse-aggregated-features requires FeatureContentCollection.");r.aggregatedFeaturesEnabled=!r.aggregatedFeaturesEnabled;return}if(t==="remove-selected-feature"){r.open=!1;let{selectedFeature:a}=r;if(!a)throw new Error("trigger-action:missing-selected-feature: Cannot remove selected feature without a selected feature.");let i=u(a);i?i.remove(a):r.view?.graphics.remove(a)}};return{a:q,b:M,c:E,d:T}},"applications/Components/actionUtils",a,b)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{a as o}from"./XRPUXUOQ.js";function i(r){if(!r)return!1;if(r.type==="3d")return r.ready;if(!r?.ready)return!1;let t=c(r),e=r.constraints?.effectiveMaxScale;return e===0||t>e}function n(r){if(!r)return!1;if(r.type==="3d")return r.ready;if(!r?.ready)return!1;let t=c(r),e=r.constraints?.effectiveMinScale;return e===0||t<e}function c(r){let t=r?.animation?.target;return(t&&"then"in t?void 0:t?.scale)??r?.scale??0}var l=o`.arcgis-button{--calcite-icon-color: var(--calcite-color-text-3);--calcite-button-background-color: var(--calcite-color-foreground-1);color:var(--calcite-color-text-3);line-height:var(--calcite-font-line-height-relative-tight);calcite-button{--calcite-offset-invert-focus: 1}display:flex;flex-flow:column;cursor:pointer;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);:hover{--calcite-icon-color: var(--calcite-color-text-1);--calcite-button-background-color: var(--calcite-color-transparent-hover)}}:host{display:flex;max-width:fit-content}.zoom-out{border-block-start:solid 1px var(--calcite-color-border-1)}.horizontal{flex-flow:row-reverse nowrap}.horizontal .zoom-out{border-block-start:none;border-inline-end:solid 1px var(--calcite-color-border-1)}`;export{i as a,n as b,l as c};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import g from"./I3WV6OM4.js";import{a as Y,k as G}from"./4SV6HHMC.js";import f from"./XD52OHCM.js";import"./VJVKFKSG.js";import e from"./5W7XCJ5B.js";import{a as L}from"./PUAXDNBG.js";import c from"./EI6T7BKN.js";import b from"./7ICJOTUR.js";import{e as B,g as I}from"./A22AUGYH.js";import"./MZQT7KZP.js";import a from"./TWMQVARD.js";import"./QUZTFUWM.js";import{b as z}from"./XUSIBTEV.js";import{M as A,N as M,O as W,U as N,a as R,b as d,p as j,x as C}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([x,ut,mt,ht,{convertDateFormatToIntlOptions:T},it,{getTimeSliderSettingsFromWebDocument:ct},{property:l,subclass:dt},{watch:w,whenOnce:at},,,,U,{d:q,f:V,i:H},{a:J,b:K,c:S,d:$,e:Q,f:X,g:tt,h:D,i:et}])=>{var nt=new WeakMap,ot=new WeakMap;function vt(t){let{locale:e,formatOptions:a}=t,n=yt(a),u=new Intl.DateTimeFormat(e,n);return nt.set(t,u),u}function pt(t){let{locale:e,formatOptions:a}=t,n=new Intl.NumberFormat(e,a);return ot.set(t,n),n}function ft(t){return nt.get(t)??vt(t)}function gt(t){return ot.get(t)??pt(t)}function yt(t){return t.timeZone?{...t,timeZone:G(t.timeZone)}:t}var i=(t,e,a)=>({minorTick:t,majorTick:e,majorTickFormat:a}),s={sf:{second:"numeric",fractionalSecondDigits:3},s:{second:"numeric"},ms:{minute:"numeric",second:"numeric"},mi:{minute:"numeric"},hm:{hour:"numeric",minute:"numeric"},dm:{day:"numeric",month:"short"},m:{month:"short"},my:{month:"short",year:"numeric"},y:{year:"numeric"}},wt=[i({value:1,unit:"milliseconds"},{value:20,unit:"milliseconds"},s.sf),i({value:2,unit:"milliseconds"},{value:50,unit:"milliseconds"},s.sf),i({value:5,unit:"milliseconds"},{value:100,unit:"milliseconds"},s.sf),i({value:10,unit:"milliseconds"},{value:200,unit:"milliseconds"},s.sf),i({value:20,unit:"milliseconds"},{value:500,unit:"milliseconds"},s.sf),i({value:50,unit:"milliseconds"},{value:1,unit:"seconds"},s.s),i({value:100,unit:"milliseconds"},{value:2,unit:"seconds"},s.s),i({value:200,unit:"milliseconds"},{value:5,unit:"seconds"},s.s),i({value:500,unit:"milliseconds"},{value:10,unit:"seconds"},s.s),i({value:1,unit:"seconds"},{value:20,unit:"seconds"},s.ms),i({value:2,unit:"seconds"},{value:30,unit:"seconds"},s.ms),i({value:5,unit:"seconds"},{value:1,unit:"minutes"},s.mi),i({value:10,unit:"seconds"},{value:2,unit:"minutes"},s.mi),i({value:20,unit:"seconds"},{value:5,unit:"minutes"},s.mi),i({value:40,unit:"seconds"},{value:10,unit:"minutes"},s.mi),i({value:1,unit:"minutes"},{value:30,unit:"minutes"},s.hm),i({value:2,unit:"minutes"},{value:1,unit:"hours"},s.hm),i({value:5,unit:"minutes"},{value:2,unit:"hours"},s.hm),i({value:10,unit:"minutes"},{value:4,unit:"hours"},s.hm),i({value:20,unit:"minutes"},{value:8,unit:"hours"},s.hm),i({value:40,unit:"minutes"},{value:1,unit:"days"},s.dm),i({value:1,unit:"hours"},{value:1,unit:"days"},s.dm),i({value:2,unit:"hours"},{value:2,unit:"days"},s.dm),i({value:5,unit:"hours"},{value:4,unit:"days"},s.dm),i({value:10,unit:"hours"},{value:10,unit:"days"},s.dm),i({value:20,unit:"hours"},{value:15,unit:"days"},s.dm),i({value:1,unit:"days"},{value:20,unit:"days"},s.dm),i({value:2,unit:"days"},{value:1,unit:"months"},s.m),i({value:5,unit:"days"},{value:3,unit:"months"},s.m),i({value:10,unit:"days"},{value:6,unit:"months"},s.my),i({value:20,unit:"days"},{value:1,unit:"years"},s.y),i({value:1,unit:"months"},{value:2,unit:"years"},s.y),i({value:2,unit:"months"},{value:4,unit:"years"},s.y),i({value:5,unit:"months"},{value:10,unit:"years"},s.y),i({value:1,unit:"years"},{value:20,unit:"years"},s.y),i({value:2,unit:"years"},{value:50,unit:"years"},s.y),i({value:5,unit:"years"},{value:100,unit:"years"},s.y),i({value:10,unit:"years"},{value:200,unit:"years"},s.y),i({value:20,unit:"years"},{value:500,unit:"years"},s.y),i({value:50,unit:"years"},{value:1e3,unit:"years"},s.y),i({value:1,unit:"centuries"},{value:20,unit:"centuries"},s.y),i({value:2,unit:"centuries"},{value:50,unit:"centuries"},s.y),i({value:5,unit:"centuries"},{value:100,unit:"centuries"},s.y),i({value:10,unit:"centuries"},{value:200,unit:"centuries"},s.y),i({value:20,unit:"centuries"},{value:500,unit:"centuries"},s.y),i({value:50,unit:"centuries"},{value:1e3,unit:"centuries"},s.y),i({value:100,unit:"centuries"},{value:2e3,unit:"centuries"},s.y),i({value:200,unit:"centuries"},{value:5e3,unit:"centuries"},s.y),i({value:500,unit:"centuries"},{value:1e4,unit:"centuries"},s.y),i({value:1e3,unit:"centuries"},{value:2e4,unit:"centuries"},s.y)];function xt(t){return wt.map(({minorTick:e,majorTick:a,majorTickFormat:n},u)=>{let h=new it(e),m=new it(a),p=h.toMilliseconds(),g={...n,timeZone:t};return{minor:h,major:m,duration:p,format:g,index:u}})}var Et=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,rt=t=>{throw TypeError(t)},r=(t,e,a,n)=>{for(var u=n>1?void 0:n?bt(e,a):e,h=t.length-1,m;h>=0;h--)(m=t[h])&&(u=(n?m(e,a,u):m(u))||u);return n&&u&&Et(e,a,u),u},lt=(t,e,a)=>e.has(t)||rt("Cannot "+a),k=(t,e,a)=>(lt(t,e,"read from private field"),a?a.call(t):e.get(t)),st=(t,e,a)=>e.has(t)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),v=(t,e,a)=>(lt(t,e,"access private method"),a),E,c,P,Z,b,_,F,o=class extends ut{constructor(){super(...arguments),st(this,c),st(this,E,new AbortController),this.disabled=!1,this.format="date",this.loadPersistedSettingsDisabled=!1,this.loop=!1,this.mode="time-window",this.savePersistedSettingsDisabled=!1,this.stops=J}get _adjustedMajorTickFormat(){let{era:t,timeZone:e}=this;return{...this.majorTickFormat,era:this.majorTickFormat?.year?t:void 0,timeZone:e}}get _dateFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),era:t,timeZone:e}}get _dateTimeFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),...T("long-time"),era:t,timeZone:e}}get _thumbPositions(){if(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty)return null;let{start:t,end:e}=this.timeExtent;switch(this.mode){case"cumulative-from-end":case"instant":return t?[t.getTime()]:null;case"cumulative-from-start":return e?[e.getTime()]:null;case"time-window":return t&&e?[t.getTime(),e.getTime()]:null}}get _timeFormat(){let{timeZone:t}=this;return{...T("long-time"),timeZone:t}}get effectiveStops(){let{fullTimeExtent:t,stops:e}=this;if(!e)return;if($(e)){let{dates:n}=e;if(!n?.length)return;let u=n.sort((f,y)=>f.getTime()-y.getTime());if(!t?.start||!t?.end)return u;let{start:h,end:m}=t,p=h.getTime(),g=m.getTime();return u.filter(f=>{let y=f.getTime();return y>=p&&y<=g})}let a=e.timeExtent??t;if(a)return S(e)?X(a,e.count):tt(a,e.interval)}get effectiveStopsEpoch(){return this.effectiveStops?.map(t=>t.getTime())}get era(){return(this.fullTimeExtent?.start?.getFullYear()??0)<0?"short":void 0}get interactive(){return!(this.disabled||this.state==="disabled")}get isOutOfRange(){let{timeExtent:t,fullTimeExtent:e}=this,{start:a,end:n}=e??{};if(!a||!n||!t||t.isAllTime||t.isEmpty)return!0;let{start:u,end:h}=t??{},m=u!=null&&(u<a||u>n),p=h!=null&&(h>n||h<a);return m||p}get majorTickFormatter(){return t=>this._formatDate(t,this._adjustedMajorTickFormat)}set playRate(t){t<=0||t>1e3*60*60||(this.state==="playing"&&v(this,c,Z).call(this),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get tickFormats(){return xt(this.timeZone)}get timeZone(){return this._userTimeZone??this.viewTimeZone??Y}set timeZone(t){this._userTimeZone=t??void 0}get viewTimeZone(){return this.view?.type==="2d"?this.view.timeZone:void 0}destroy(){k(this,E).abort(),this.view?.unregisterComponent(this),v(this,c,_).call(this)}formatDate(t){return this._formatDate(t,this._dateFormat)}formatDateTime(t){return this._formatDate(t,this._dateTimeFormat)}formatNumber(t,e){return this._formatNumber(t,e)}formatTime(t){return this._formatDate(t,this._timeFormat)}getTickValues(t){let{fullTimeExtent:e,timeZone:a}=this;if(!e)return[];let{start:n,end:u}=e;return!n||!u?[]:et(n,u,t,a).map(h=>h.getTime())}async initialize(){this.addHandles([w(()=>this.effectiveStops,t=>{t&&(this.timeExtent??=D(t,this.mode))},{initial:!0}),w(()=>this.timeExtent,t=>{!this.view||this.view.timeExtent&&t?.equals(this.view.timeExtent)||(!t||t.isAllTime)&&(!this.view.timeExtent||this.view.timeExtent.isAllTime)||(this.view.timeExtent=t)},{initial:!0}),w(()=>this.view,t=>{t?.timeExtent&&(this.timeExtent=t.timeExtent)}),w(()=>this.view,(t,e)=>{e?.unregisterComponent(this),t?.registerComponent(this)},{initial:!0,sync:!0}),w(()=>this.view?.timeExtent,t=>{!t||t.equals(this.timeExtent)||t.isAllTime&&(!this.timeExtent||this.timeExtent.isAllTime)||(this.timeExtent=t??void 0)}),w(()=>this.mode,t=>{if(!(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||!this.fullTimeExtent?.start||!this.fullTimeExtent.end))switch(t){case"time-window":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-start":this.timeExtent=new x({start:null,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-end":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:null});break;case"instant":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.start??this.timeExtent.end});break}})]),await V((async()=>{if(await at(()=>this.view?.ready,{signal:k(this,E).signal}),this.loadPersistedSettingsDisabled)return;let t=await ct(this.view?.map,k(this,E).signal);t&&(this.fullTimeExtent=t.fullTimeExtent??void 0,this.loop=t.loop,this.mode=t.mode,this.playRate=t.playRate,this.stops=t.stops??void 0,this.timeExtent=t.timeExtent??void 0)})())}next(){v(this,c,b).call(this,{forward:!0,allowRestart:!1})}play(){v(this,c,Z).call(this)}previous(){v(this,c,b).call(this,{forward:!1,allowRestart:!1})}stop(){v(this,c,_).call(this)}updateWebDocument(t){if(this.savePersistedSettingsDisabled)return;let e=new mt({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:S(this.stops)?this.stops.count:null,numThumbs:this.mode==="time-window"?2:1,stopDelay:this.playRate,stopInterval:Q(this.stops)?this.stops.interval:null,stops:$(this.stops)?this.stops.dates:null});t.widgets??=new ht,t.widgets.timeSlider=e}_formatDate(t,e){return ft({locale:this.locale,formatOptions:e}).format(t)}_formatNumber(t,e){return gt({locale:this.locale,formatOptions:e}).format(t)}};E=new WeakMap;c=new WeakSet;P=async function(){try{let{view:t}=this,e=this._animationController?.signal;await Promise.all([H(this.playRate,e),t&&at(()=>!t.updating,e)])}catch(t){q(t)||j("error","arcgis-slider-time","animation error",{detail:{error:t}}),this._animationController=void 0;return}v(this,c,b).call(this,{forward:!0,allowRestart:!1}),this._animationController&&v(this,c,P).call(this)};Z=function(){v(this,c,_).call(this),this._animationController=new AbortController,v(this,c,b).call(this,{forward:!0,allowRestart:!0}),v(this,c,P).call(this)};b=function({forward:t,allowRestart:e}){let{_thumbPositions:a,effectiveStopsEpoch:n}=this;if(!a||!n)return;let u=a.map(m=>{let p=n.indexOf(m);if(p!==-1)return p;let g=n.reduce((f,y)=>Math.abs(y-m)<Math.abs(f-m)?y:f);return n.indexOf(g)}),h=u.map(m=>m+=t?1:-1);if(h.some(m=>m<0||m>n.length-1))if(this.loop||e){let m=Math.min(...u),p=Math.max(...u),g=(t?u.map(f=>f-m):u.map(f=>f+(n.length-1-p))).map(f=>n[f]);this.timeExtent=v(this,c,F).call(this,g)}else this.state==="playing"&&this.stop();else{let m=h.map(p=>n[p]);this.timeExtent=v(this,c,F).call(this,m)}};_=function(){this._animationController?.abort(),this._animationController=void 0};F=function(t){if(!t)return;let e=[...t].sort((a,n)=>a-n).map(a=>new Date(a));return D(e,this.mode)};r([l()],o.prototype,"_adjustedMajorTickFormat",1);r([l()],o.prototype,"_animationController",2);r([l()],o.prototype,"_dateFormat",1);r([l()],o.prototype,"_dateTimeFormat",1);r([l()],o.prototype,"_thumbPositions",1);r([l()],o.prototype,"_timeFormat",1);r([l()],o.prototype,"_userTimeZone",2);r([l()],o.prototype,"disabled",2);r([l()],o.prototype,"effectiveStops",1);r([l()],o.prototype,"effectiveStopsEpoch",1);r([l()],o.prototype,"era",1);r([l()],o.prototype,"format",2);r([l({type:x})],o.prototype,"fullTimeExtent",2);r([l()],o.prototype,"interactive",1);r([l()],o.prototype,"isOutOfRange",1);r([l()],o.prototype,"loadPersistedSettingsDisabled",2);r([l()],o.prototype,"locale",2);r([l()],o.prototype,"loop",2);r([l()],o.prototype,"majorTickFormat",2);r([l()],o.prototype,"majorTickFormatter",1);r([l()],o.prototype,"mode",2);r([l({value:1e3})],o.prototype,"playRate",1);r([l()],o.prototype,"savePersistedSettingsDisabled",2);r([l()],o.prototype,"state",1);r([l({cast:K})],o.prototype,"stops",2);r([l()],o.prototype,"tickFormats",1);r([l({type:x})],o.prototype,"timeExtent",2);r([l()],o.prototype,"timeZone",1);r([l()],o.prototype,"view",2);r([l()],o.prototype,"viewTimeZone",1);o=r([dt("components.time-bar.TimeBarViewModel")],o);var Tt=R`:host{box-shadow:var(--arcgis-internal-box-shadow, var(--calcite-shadow-sm));transition:max-height var(--calcite-internal-animation-timing-medium) ease-in-out}::slotted([slot="actions-end"]){border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);padding-inline-start:var(--calcite-spacing-sm)}.action-bar,.time-extent-group,.time-extent-group>slot{display:flex;flex:1 0 auto;place-items:center}.label{block-size:var(--calcite-size-fixed-xxxl);inline-size:175px}.settings{inline-size:calc(var(--arcgis-internal-panel-width) - 2 * var(--calcite-spacing-lg))}`,_t=U(o),O=class extends W{constructor(){super(...arguments),this._viewModel=_t(this),this.messages=L({name:"time-bar",blocking:!0}),this.#t=A(),this.#e=B(),this.#i=e=>{this._settingsActionElement=e},this.autoDestroyDisabled=!1,this.disabled=this._viewModel.disabled,this.effectiveStops=this._viewModel.effectiveStops,this.format=this._viewModel.format,this.fullTimeExtent=this._viewModel.fullTimeExtent,this.icon="clock",this.loadPersistedSettingsDisabled=this._viewModel.loadPersistedSettingsDisabled,this.loop=this._viewModel.loop,this.mode=this._viewModel.mode,this.playRate=this._viewModel.playRate,this.savePersistedSettingsDisabled=this._viewModel.savePersistedSettingsDisabled,this.showNext=!1,this.showPlay=!1,this.showPrevious=!1,this.showSettings=!1,this.state=this._viewModel.state,this.stops=this._viewModel.stops,this.timeExtent=this._viewModel.timeExtent,this.timeZone=this._viewModel.timeZone,this.view=this._viewModel.view,this.arcgisPropertyChange=I()("effectiveStops","fullTimeExtent","state","timeExtent"),this.arcgisReady=C()}static{this.properties={_settingsActionElement:16,autoDestroyDisabled:5,disabled:5,effectiveStops:32,format:1,fullTimeExtent:0,icon:1,label:1,loadPersistedSettingsDisabled:5,loop:5,messageOverrides:0,mode:1,playRate:9,referenceElement:1,savePersistedSettingsDisabled:5,showNext:5,showPlay:5,showPrevious:5,showSettings:5,state:32,stops:0,timeExtent:0,timeZone:1,view:0}}static{this.styles=Tt}#t;#e;#i;async applyTimeSliderSettings(e){this._viewModel.set(e)}async destroy(){await this.manager.destroy()}async next(){this._viewModel.next()}async play(){this._viewModel.play()}async previous(){this._viewModel.previous()}async stop(){this._viewModel.stop()}async updateWebDocument(e){this._viewModel.updateWebDocument(e)}willUpdate(e){e.has("messages")&&(this._viewModel.locale=this.messages._lang)}#m(e){let{currentTarget:a}=e,n=z(a).at(0)??a.querySelector("arcgis-time-bar-extent");n&&(n.viewModel=this._viewModel)}async#h(){switch(this.state){case"disabled":case"playing":return await this.stop();case"ready":return await this.play()}}render(){return d`<div role=presentation><calcite-action-bar class="action-bar" layout=horizontal expand-disabled floating>${this.#e==="ltr"?d`${this.#a()}${this.#u()}${this.#l()}${this.#s()}`:d`${this.#l()}${this.#u()}${this.#a()}${this.#s()}`}</calcite-action-bar></div>`}#s(){return d`<slot name=actions-end slot=actions-end></slot>`}#a(){return this.showPrevious||this.showPlay||this.showNext?d`<calcite-action-group>${this.#e==="ltr"?d`${this.#o()}${this.#r()}${this.#n()}`:d`${this.#n()}${this.#r()}${this.#o()}`}</calcite-action-group>`:null}#n(){return this.showNext?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=forward @click=${this.next} .text=${this.messages.next}></calcite-action>`:null}#o(){return this.showPlay?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length} .icon=${this.state==="playing"?"pause-f":"play-f"} @click=${this.#h} .text=${this.state==="playing"?this.messages.stop:this.messages.play}></calcite-action>`:null}#r(){return this.showPrevious?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=reverse @click=${this.previous} .text=${this.messages.previous}></calcite-action>`:null}#l(){return this.showSettings?d`<calcite-action-group><calcite-action .disabled=${!this._viewModel.interactive} .text=${this.messages.settings} icon=sliders-horizontal ${M(this.#i)}></calcite-action>${this._settingsActionElement?d`<calcite-popover auto-close .heading=${this.messages.timeBarSettings} .label=${this.messages.timeBarSettings} .referenceElement=${this._settingsActionElement} @calcitePopoverClose=${()=>{this.#t.value?.navigateToOverview()}} overlay-positioning=fixed><slot name=settings><arcgis-time-bar-settings class="settings" .messages=${this.messages} .viewModel=${this._viewModel} ${M(this.#t)}></arcgis-time-bar-settings></slot></calcite-popover>`:void 0}</calcite-action-group>`:null}#u(){return d`<calcite-action-group class="time-extent-group"><slot name=time-extent @slotchange=${this.#m}><arcgis-time-bar-extent class="label" .viewModel=${this._viewModel}></arcgis-time-bar-extent></slot></calcite-action-group>`}};N("arcgis-time-bar",O);return O},"time/TimeExtent","core/Accessor","webdoc/widgets/TimeSlider","webdoc/Widgets","intl","time/TimeInterval","support/timeUtils","core/accessorSupport/decorators","core/reactiveUtils",a,b,c,e,f,g)
2
+ import g from"./I3WV6OM4.js";import{a as Y,k as G}from"./4SV6HHMC.js";import f from"./XD52OHCM.js";import"./VJVKFKSG.js";import e from"./5W7XCJ5B.js";import{a as L}from"./PUAXDNBG.js";import c from"./EI6T7BKN.js";import b from"./7ICJOTUR.js";import{e as B,g as I}from"./A22AUGYH.js";import"./MZQT7KZP.js";import a from"./TWMQVARD.js";import"./QUZTFUWM.js";import{b as z}from"./XUSIBTEV.js";import{M as A,N as M,O as W,U as N,a as R,b as d,p as j,x as C}from"./XRPUXUOQ.js";import"./H6RQVSYM.js";export default $arcgis.t(([x,ut,mt,ht,{convertDateFormatToIntlOptions:T},it,{getTimeSliderSettingsFromWebDocument:ct},{property:l,subclass:dt},{watch:w,whenOnce:at},,,,U,{d:q,f:V,i:H},{a:J,b:K,c:S,d:$,e:Q,f:X,g:tt,h:D,i:et}])=>{var nt=new WeakMap,ot=new WeakMap;function vt(t){let{locale:e,formatOptions:a}=t,n=yt(a),u=new Intl.DateTimeFormat(e,n);return nt.set(t,u),u}function pt(t){let{locale:e,formatOptions:a}=t,n=new Intl.NumberFormat(e,a);return ot.set(t,n),n}function ft(t){return nt.get(t)??vt(t)}function gt(t){return ot.get(t)??pt(t)}function yt(t){return t.timeZone?{...t,timeZone:G(t.timeZone)}:t}var i=(t,e,a)=>({minorTick:t,majorTick:e,majorTickFormat:a}),s={sf:{second:"numeric",fractionalSecondDigits:3},s:{second:"numeric"},ms:{minute:"numeric",second:"numeric"},mi:{minute:"numeric"},hm:{hour:"numeric",minute:"numeric"},dm:{day:"numeric",month:"short"},m:{month:"short"},my:{month:"short",year:"numeric"},y:{year:"numeric"}},wt=[i({value:1,unit:"milliseconds"},{value:20,unit:"milliseconds"},s.sf),i({value:2,unit:"milliseconds"},{value:50,unit:"milliseconds"},s.sf),i({value:5,unit:"milliseconds"},{value:100,unit:"milliseconds"},s.sf),i({value:10,unit:"milliseconds"},{value:200,unit:"milliseconds"},s.sf),i({value:20,unit:"milliseconds"},{value:500,unit:"milliseconds"},s.sf),i({value:50,unit:"milliseconds"},{value:1,unit:"seconds"},s.s),i({value:100,unit:"milliseconds"},{value:2,unit:"seconds"},s.s),i({value:200,unit:"milliseconds"},{value:5,unit:"seconds"},s.s),i({value:500,unit:"milliseconds"},{value:10,unit:"seconds"},s.s),i({value:1,unit:"seconds"},{value:20,unit:"seconds"},s.ms),i({value:2,unit:"seconds"},{value:30,unit:"seconds"},s.ms),i({value:5,unit:"seconds"},{value:1,unit:"minutes"},s.mi),i({value:10,unit:"seconds"},{value:2,unit:"minutes"},s.mi),i({value:20,unit:"seconds"},{value:5,unit:"minutes"},s.mi),i({value:40,unit:"seconds"},{value:10,unit:"minutes"},s.mi),i({value:1,unit:"minutes"},{value:30,unit:"minutes"},s.hm),i({value:2,unit:"minutes"},{value:1,unit:"hours"},s.hm),i({value:5,unit:"minutes"},{value:2,unit:"hours"},s.hm),i({value:10,unit:"minutes"},{value:4,unit:"hours"},s.hm),i({value:20,unit:"minutes"},{value:8,unit:"hours"},s.hm),i({value:40,unit:"minutes"},{value:1,unit:"days"},s.dm),i({value:1,unit:"hours"},{value:1,unit:"days"},s.dm),i({value:2,unit:"hours"},{value:2,unit:"days"},s.dm),i({value:5,unit:"hours"},{value:4,unit:"days"},s.dm),i({value:10,unit:"hours"},{value:10,unit:"days"},s.dm),i({value:20,unit:"hours"},{value:15,unit:"days"},s.dm),i({value:1,unit:"days"},{value:20,unit:"days"},s.dm),i({value:2,unit:"days"},{value:1,unit:"months"},s.m),i({value:5,unit:"days"},{value:3,unit:"months"},s.m),i({value:10,unit:"days"},{value:6,unit:"months"},s.my),i({value:20,unit:"days"},{value:1,unit:"years"},s.y),i({value:1,unit:"months"},{value:2,unit:"years"},s.y),i({value:2,unit:"months"},{value:4,unit:"years"},s.y),i({value:5,unit:"months"},{value:10,unit:"years"},s.y),i({value:1,unit:"years"},{value:20,unit:"years"},s.y),i({value:2,unit:"years"},{value:50,unit:"years"},s.y),i({value:5,unit:"years"},{value:100,unit:"years"},s.y),i({value:10,unit:"years"},{value:200,unit:"years"},s.y),i({value:20,unit:"years"},{value:500,unit:"years"},s.y),i({value:50,unit:"years"},{value:1e3,unit:"years"},s.y),i({value:1,unit:"centuries"},{value:20,unit:"centuries"},s.y),i({value:2,unit:"centuries"},{value:50,unit:"centuries"},s.y),i({value:5,unit:"centuries"},{value:100,unit:"centuries"},s.y),i({value:10,unit:"centuries"},{value:200,unit:"centuries"},s.y),i({value:20,unit:"centuries"},{value:500,unit:"centuries"},s.y),i({value:50,unit:"centuries"},{value:1e3,unit:"centuries"},s.y),i({value:100,unit:"centuries"},{value:2e3,unit:"centuries"},s.y),i({value:200,unit:"centuries"},{value:5e3,unit:"centuries"},s.y),i({value:500,unit:"centuries"},{value:1e4,unit:"centuries"},s.y),i({value:1e3,unit:"centuries"},{value:2e4,unit:"centuries"},s.y)];function xt(t){return wt.map(({minorTick:e,majorTick:a,majorTickFormat:n},u)=>{let h=new it(e),m=new it(a),p=h.toMilliseconds(),g={...n,timeZone:t};return{minor:h,major:m,duration:p,format:g,index:u}})}var Et=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,rt=t=>{throw TypeError(t)},r=(t,e,a,n)=>{for(var u=n>1?void 0:n?bt(e,a):e,h=t.length-1,m;h>=0;h--)(m=t[h])&&(u=(n?m(e,a,u):m(u))||u);return n&&u&&Et(e,a,u),u},lt=(t,e,a)=>e.has(t)||rt("Cannot "+a),k=(t,e,a)=>(lt(t,e,"read from private field"),a?a.call(t):e.get(t)),st=(t,e,a)=>e.has(t)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),v=(t,e,a)=>(lt(t,e,"access private method"),a),E,c,P,Z,b,_,F,o=class extends ut{constructor(){super(...arguments),st(this,c),st(this,E,new AbortController),this.disabled=!1,this.format="date",this.loadPersistedSettingsDisabled=!1,this.loop=!1,this.mode="time-window",this.savePersistedSettingsDisabled=!1,this.stops=J}get _adjustedMajorTickFormat(){let{era:t,timeZone:e}=this;return{...this.majorTickFormat,era:this.majorTickFormat?.year?t:void 0,timeZone:e}}get _dateFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),era:t,timeZone:e}}get _dateTimeFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),...T("long-time"),era:t,timeZone:e}}get _thumbPositions(){if(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty)return null;let{start:t,end:e}=this.timeExtent;switch(this.mode){case"cumulative-from-end":case"instant":return t?[t.getTime()]:null;case"cumulative-from-start":return e?[e.getTime()]:null;case"time-window":return t&&e?[t.getTime(),e.getTime()]:null}}get _timeFormat(){let{timeZone:t}=this;return{...T("long-time"),timeZone:t}}get effectiveStops(){let{fullTimeExtent:t,stops:e}=this;if(!e)return;if($(e)){let{dates:n}=e;if(!n?.length)return;let u=n.sort((f,y)=>f.getTime()-y.getTime());if(!t?.start||!t?.end)return u;let{start:h,end:m}=t,p=h.getTime(),g=m.getTime();return u.filter(f=>{let y=f.getTime();return y>=p&&y<=g})}let a=e.timeExtent??t;if(a)return S(e)?X(a,e.count):tt(a,e.interval)}get effectiveStopsEpoch(){return this.effectiveStops?.map(t=>t.getTime())}get era(){return(this.fullTimeExtent?.start?.getFullYear()??0)<0?"short":void 0}get interactive(){return!(this.disabled||this.state==="disabled")}get isOutOfRange(){let{timeExtent:t,fullTimeExtent:e}=this,{start:a,end:n}=e??{};if(!a||!n||!t||t.isAllTime||t.isEmpty)return!0;let{start:u,end:h}=t??{},m=u!=null&&(u<a||u>n),p=h!=null&&(h>n||h<a);return m||p}get majorTickFormatter(){return t=>this._formatDate(t,this._adjustedMajorTickFormat)}set playRate(t){t<=0||t>1e3*60*60||(this.state==="playing"&&v(this,c,Z).call(this),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get tickFormats(){return xt(this.timeZone)}get timeZone(){return this._userTimeZone??this.viewTimeZone??Y}set timeZone(t){this._userTimeZone=t??void 0}get viewTimeZone(){return this.view?.type==="2d"?this.view.timeZone:void 0}destroy(){k(this,E).abort(),this.view?.unregisterComponent(this),v(this,c,_).call(this)}formatDate(t){return this._formatDate(t,this._dateFormat)}formatDateTime(t){return this._formatDate(t,this._dateTimeFormat)}formatNumber(t,e){return this._formatNumber(t,e)}formatTime(t){return this._formatDate(t,this._timeFormat)}getTickValues(t){let{fullTimeExtent:e,timeZone:a}=this;if(!e)return[];let{start:n,end:u}=e;return!n||!u?[]:et(n,u,t,a).map(h=>h.getTime())}async initialize(){this.addHandles([w(()=>this.effectiveStops,t=>{t&&(this.timeExtent??=D(t,this.mode))},{initial:!0}),w(()=>this.timeExtent,t=>{!this.view||this.view.timeExtent&&t?.equals(this.view.timeExtent)||(!t||t.isAllTime)&&(!this.view.timeExtent||this.view.timeExtent.isAllTime)||(this.view.timeExtent=t)},{initial:!0}),w(()=>this.view,t=>{t?.timeExtent&&(this.timeExtent=t.timeExtent)}),w(()=>this.view,(t,e)=>{e?.unregisterComponent(this),t?.registerComponent(this)},{initial:!0,sync:!0}),w(()=>this.view?.timeExtent,t=>{!t||t.equals(this.timeExtent)||t.isAllTime&&(!this.timeExtent||this.timeExtent.isAllTime)||(this.timeExtent=t??void 0)}),w(()=>this.mode,t=>{if(!(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||!this.fullTimeExtent?.start||!this.fullTimeExtent.end))switch(t){case"time-window":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-start":this.timeExtent=new x({start:null,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-end":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:null});break;case"instant":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.start??this.timeExtent.end});break}})]),await V((async()=>{if(await at(()=>this.view?.ready,{signal:k(this,E).signal}),this.loadPersistedSettingsDisabled)return;let t=await ct(this.view?.map,k(this,E).signal);t&&(this.fullTimeExtent=t.fullTimeExtent??void 0,this.loop=t.loop,this.mode=t.mode,this.playRate=t.playRate,this.stops=t.stops??void 0,this.timeExtent=t.timeExtent??void 0)})())}next(){v(this,c,b).call(this,{forward:!0,allowRestart:!1})}play(){v(this,c,Z).call(this)}previous(){v(this,c,b).call(this,{forward:!1,allowRestart:!1})}stop(){v(this,c,_).call(this)}updateWebDocument(t){if(this.savePersistedSettingsDisabled)return;let e=new mt({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:S(this.stops)?this.stops.count:null,numThumbs:this.mode==="time-window"?2:1,stopDelay:this.playRate,stopInterval:Q(this.stops)?this.stops.interval:null,stops:$(this.stops)?this.stops.dates:null});t.widgets??=new ht,t.widgets.timeSlider=e}_formatDate(t,e){return ft({locale:this.locale,formatOptions:e}).format(t)}_formatNumber(t,e){return gt({locale:this.locale,formatOptions:e}).format(t)}};E=new WeakMap;c=new WeakSet;P=async function(){try{let{view:t}=this,e=this._animationController?.signal;await Promise.all([H(this.playRate,e),t&&at(()=>!t.updating,e)])}catch(t){q(t)||j("error","arcgis-slider-time","animation error",{detail:{error:t}}),this._animationController=void 0;return}v(this,c,b).call(this,{forward:!0,allowRestart:!1}),this._animationController&&v(this,c,P).call(this)};Z=function(){v(this,c,_).call(this),this._animationController=new AbortController,v(this,c,b).call(this,{forward:!0,allowRestart:!0}),v(this,c,P).call(this)};b=function({forward:t,allowRestart:e}){let{_thumbPositions:a,effectiveStopsEpoch:n}=this;if(!a||!n)return;let u=a.map(m=>{let p=n.indexOf(m);if(p!==-1)return p;let g=n.reduce((f,y)=>Math.abs(y-m)<Math.abs(f-m)?y:f);return n.indexOf(g)}),h=u.map(m=>m+=t?1:-1);if(h.some(m=>m<0||m>n.length-1))if(this.loop||e){let m=Math.min(...u),p=Math.max(...u),g=(t?u.map(f=>f-m):u.map(f=>f+(n.length-1-p))).map(f=>n[f]);this.timeExtent=v(this,c,F).call(this,g)}else this.state==="playing"&&this.stop();else{let m=h.map(p=>n[p]);this.timeExtent=v(this,c,F).call(this,m)}};_=function(){this._animationController?.abort(),this._animationController=void 0};F=function(t){if(!t)return;let e=[...t].sort((a,n)=>a-n).map(a=>new Date(a));return D(e,this.mode)};r([l()],o.prototype,"_adjustedMajorTickFormat",1);r([l()],o.prototype,"_animationController",2);r([l()],o.prototype,"_dateFormat",1);r([l()],o.prototype,"_dateTimeFormat",1);r([l()],o.prototype,"_thumbPositions",1);r([l()],o.prototype,"_timeFormat",1);r([l()],o.prototype,"_userTimeZone",2);r([l()],o.prototype,"disabled",2);r([l()],o.prototype,"effectiveStops",1);r([l()],o.prototype,"effectiveStopsEpoch",1);r([l()],o.prototype,"era",1);r([l()],o.prototype,"format",2);r([l({type:x})],o.prototype,"fullTimeExtent",2);r([l()],o.prototype,"interactive",1);r([l()],o.prototype,"isOutOfRange",1);r([l()],o.prototype,"loadPersistedSettingsDisabled",2);r([l()],o.prototype,"locale",2);r([l()],o.prototype,"loop",2);r([l()],o.prototype,"majorTickFormat",2);r([l()],o.prototype,"majorTickFormatter",1);r([l()],o.prototype,"mode",2);r([l({value:1e3})],o.prototype,"playRate",1);r([l()],o.prototype,"savePersistedSettingsDisabled",2);r([l()],o.prototype,"state",1);r([l({cast:K})],o.prototype,"stops",2);r([l()],o.prototype,"tickFormats",1);r([l({type:x})],o.prototype,"timeExtent",2);r([l()],o.prototype,"timeZone",1);r([l()],o.prototype,"view",2);r([l()],o.prototype,"viewTimeZone",1);o=r([dt("components.time-bar.TimeBarViewModel")],o);var Tt=R`:host{box-shadow:var(--arcgis-internal-box-shadow, var(--calcite-shadow-sm));transition:max-height var(--calcite-internal-animation-timing-medium) ease-in-out}::slotted([slot="actions-end"]){border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);padding-inline-start:var(--calcite-spacing-sm)}.action-bar,.time-extent-group,.time-extent-group>slot{display:flex;flex:1 0 auto;place-items:center}.label{block-size:var(--calcite-size-fixed-xxxl);inline-size:175px}.settings{inline-size:calc(var(--arcgis-internal-panel-width) - 2 * var(--calcite-spacing-lg))}`,_t=U(o),O=class extends W{constructor(){super(...arguments),this._viewModel=_t(this),this.messages=L({name:"time-bar",blocking:!0}),this.#t=A(),this.#e=B(),this.#i=e=>{this._settingsActionElement=e},this.autoDestroyDisabled=!1,this.disabled=this._viewModel.disabled,this.effectiveStops=this._viewModel.effectiveStops,this.format=this._viewModel.format,this.fullTimeExtent=this._viewModel.fullTimeExtent,this.icon="clock",this.loadPersistedSettingsDisabled=this._viewModel.loadPersistedSettingsDisabled,this.loop=this._viewModel.loop,this.mode=this._viewModel.mode,this.playRate=this._viewModel.playRate,this.savePersistedSettingsDisabled=this._viewModel.savePersistedSettingsDisabled,this.showNext=!1,this.showPlay=!1,this.showPrevious=!1,this.showSettings=!1,this.state=this._viewModel.state,this.stops=this._viewModel.stops,this.timeExtent=this._viewModel.timeExtent,this.timeZone=this._viewModel.timeZone,this.view=this._viewModel.view,this.arcgisPropertyChange=I()("effectiveStops","fullTimeExtent","state","timeExtent"),this.arcgisReady=C()}static{this.properties={_settingsActionElement:16,autoDestroyDisabled:5,disabled:5,effectiveStops:32,format:1,fullTimeExtent:0,icon:1,label:1,loadPersistedSettingsDisabled:5,loop:5,messageOverrides:0,mode:1,playRate:9,referenceElement:1,savePersistedSettingsDisabled:5,showNext:5,showPlay:5,showPrevious:5,showSettings:5,state:32,stops:0,timeExtent:0,timeZone:1,view:0}}static{this.styles=Tt}#t;#e;#i;async applyTimeSettings(e){this._viewModel.set(e)}async destroy(){await this.manager.destroy()}async next(){this._viewModel.next()}async play(){this._viewModel.play()}async previous(){this._viewModel.previous()}async stop(){this._viewModel.stop()}async updateWebDocument(e){this._viewModel.updateWebDocument(e)}willUpdate(e){e.has("messages")&&(this._viewModel.locale=this.messages._lang)}#m(e){let{currentTarget:a}=e,n=z(a).at(0)??a.querySelector("arcgis-time-bar-extent");n&&(n.viewModel=this._viewModel)}async#h(){switch(this.state){case"disabled":case"playing":return await this.stop();case"ready":return await this.play()}}render(){return d`<div role=presentation><calcite-action-bar class="action-bar" layout=horizontal expand-disabled floating>${this.#e==="ltr"?d`${this.#a()}${this.#u()}${this.#l()}${this.#s()}`:d`${this.#l()}${this.#u()}${this.#a()}${this.#s()}`}</calcite-action-bar></div>`}#s(){return d`<slot name=actions-end slot=actions-end></slot>`}#a(){return this.showPrevious||this.showPlay||this.showNext?d`<calcite-action-group>${this.#e==="ltr"?d`${this.#o()}${this.#r()}${this.#n()}`:d`${this.#n()}${this.#r()}${this.#o()}`}</calcite-action-group>`:null}#n(){return this.showNext?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=forward @click=${this.next} .text=${this.messages.next}></calcite-action>`:null}#o(){return this.showPlay?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length} .icon=${this.state==="playing"?"pause-f":"play-f"} @click=${this.#h} .text=${this.state==="playing"?this.messages.stop:this.messages.play}></calcite-action>`:null}#r(){return this.showPrevious?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=reverse @click=${this.previous} .text=${this.messages.previous}></calcite-action>`:null}#l(){return this.showSettings?d`<calcite-action-group><calcite-action .disabled=${!this._viewModel.interactive} .text=${this.messages.settings} icon=sliders-horizontal ${M(this.#i)}></calcite-action>${this._settingsActionElement?d`<calcite-popover auto-close .heading=${this.messages.timeBarSettings} .label=${this.messages.timeBarSettings} .referenceElement=${this._settingsActionElement} @calcitePopoverClose=${()=>{this.#t.value?.navigateToOverview()}} overlay-positioning=fixed><slot name=settings><arcgis-time-bar-settings class="settings" .messages=${this.messages} .viewModel=${this._viewModel} ${M(this.#t)}></arcgis-time-bar-settings></slot></calcite-popover>`:void 0}</calcite-action-group>`:null}#u(){return d`<calcite-action-group class="time-extent-group"><slot name=time-extent @slotchange=${this.#m}><arcgis-time-bar-extent class="label" .viewModel=${this._viewModel}></arcgis-time-bar-extent></slot></calcite-action-group>`}};N("arcgis-time-bar",O);return O},"time/TimeExtent","core/Accessor","webdoc/widgets/TimeSlider","webdoc/Widgets","intl","time/TimeInterval","support/timeUtils","core/accessorSupport/decorators","core/reactiveUtils",a,b,c,e,f,g)