@arcgis/core 5.1.0-next.59 → 5.1.0-next.60

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 (177) hide show
  1. package/applications/Components/arcadeFeatureUtils.js +1 -1
  2. package/applications/Components/featureUtils.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{9321f5ec514805307219.js → 05c8d2c0362af4511d86.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{ad1946c084219bb678a0.js → 06868e4f52de9d918255.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{8df0c154bb0d79a905c0.js → 06c0b93e276cfc1fb7ac.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{05d25a98c54679233902.js → 0888baa99c9007ad63bc.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{1613123918e9b0f7cfdb.js → 0f597c690e5c60fe944b.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{e2e3c39876bbe019c57a.js → 0f8736242544f9e9a57a.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{c9c5e6996f36ec4b1558.js → 11a8541f3909f9ffb000.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{3de17e89973160b42923.js → 16806f5044a9da553b66.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{3e0752a81a7247c567ab.js → 185f59f90070d5d6ac94.js} +1 -1
  13. package/assets/esri/core/workers/chunks/1984c0f037065acd21d3.js +1 -0
  14. package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +1 -0
  15. package/assets/esri/core/workers/chunks/{1f91280032aa42b1585b.js → 2a7e7a497823e9f05aa3.js} +1 -1
  16. package/assets/esri/core/workers/chunks/2d92ba11781a3cfc3a78.js +1 -0
  17. package/assets/esri/core/workers/chunks/{9d580b5bcd59857a5702.js → 2f74147597805828cb38.js} +23 -7
  18. package/assets/esri/core/workers/chunks/{d9444dd0d40aa8332b28.js → 31e0bfc2cab055aebf9a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{93d1118f7a909d123b40.js → 32360a55d1836b2a737e.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{a9eb90b901e64e67b7a3.js → 368b4c0a5eecbb06feac.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{7b6e3cc086d13da770fa.js → 37729578a7c4cf15eded.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{4b3622fc355fd2fd8678.js → 3af1e2f0b3d30c58d0c2.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{83113a9e284701d053b5.js → 3c155efd5768003a91eb.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{7ed2aa1092c0a2c839c0.js → 3f0d9fdd8c37605dd85d.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{86a6dd19903fa5023cc7.js → 58614f12796dbba013f4.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{26cafd20c8d03c274389.js → 5c1abb46b9937a050c32.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{1f8e22df08c2f5fbb8c8.js → 6172715b2b2853819d8a.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{87077f4cbca13e030411.js → 62c2757f5dc4aaca2df8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{23f6d24bf850bc3280ec.js → 6355de3ee89916b74dae.js} +1 -1
  30. package/assets/esri/core/workers/chunks/64ad6130de549083caba.js +1 -0
  31. package/assets/esri/core/workers/chunks/{9b53aa2429573f1b977f.js → 68475eba323b4aa892a3.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{a7a553e245ba011d259f.js → 78c7eace6ec3fa5c7413.js} +1 -1
  33. package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +1 -0
  34. package/assets/esri/core/workers/chunks/{b20f4c82d0b44fdb4670.js → 7e1ef2a55f8d123f31e2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{5a9f5a49dc68b42762bb.js → 8083dface1ca2dbd12b2.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{85c72d9fa533552a6e8a.js → 82e0691995d821137d5f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ec1b2eb05410848081c9.js → 8432ffc33843e898bab7.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bacc343a79828e456de7.js → 8435b6bf356959009b76.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{56bce3a6701f8549606b.js → 8878ab87ef7961fafae8.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{3ef740d25dc17bef11b2.js → 8a893f23827769d42092.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e8a23ae30d586e3a973c.js → 8e68b4628e9616356c34.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{e7e565e7c0ce1464c6b0.js → 8ea67b502f9355dab7e9.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{66fc3c4d6c54eee231b9.js → 8edae79554843dd77ada.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{0e88e61d89f89994c4bf.js → 909ef35fa33be2b6da41.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c91d39e8e14be3d8bdf5.js → 90b7acc70adba193b215.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{b1a0a7cdaf50f98adb3e.js → 97f10efb0fe05bedcebd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +1 -0
  48. package/assets/esri/core/workers/chunks/{4fb718174c6e07d752e0.js → 9c52d4b54dfdb69dee29.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{5143f74f1fe7533a6069.js → 9c72127de7afcbaafbaf.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{155c741a9839d24f04a2.js → 9def5d17b94e5db71883.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{a41fabf8b2cf15b7d0c9.js → a10be7eb05a007fff1ed.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{ab3183f2327ff26e2b45.js → a226ba96d9a3ecc14e3e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{2bc6edeb3156d241677b.js → a32c87b89567a9fd1efc.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{e26894655823849947f4.js → a446dff865332268625a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/a520f83ae0c3c3e78858.js +1 -0
  56. package/assets/esri/core/workers/chunks/{bb047157f09471ecea53.js → a6d166058e3025bb280e.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{691d0a60354b6458b9de.js → a80eb704e75d13732878.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{75e28458e08b0738b35a.js → ab223c508f3dd562e7d3.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{3cb0f020f9bfc6653c5d.js → b42487c6a989e11a2559.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b6d94cbd1c5adad2f247.js +1 -0
  61. package/assets/esri/core/workers/chunks/{cd391415b8b8320e12e4.js → b75165880704efccc47c.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{45eddf3918973fa8d751.js → ba72989749543122a6fe.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{0b4a2361b9f9a6c0b8a7.js → ba9e107edc2027238be3.js} +1 -1
  64. package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
  65. package/assets/esri/core/workers/chunks/{e9dd60d0220036545ebb.js → bf4bad2c9a541cd425f5.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{78cb6b9ab32abdd1d530.js → c08e9914deb1dc62bc0f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{52dbfd7519555028a8af.js → c0bb53d8d58ad18334d3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{c6149e0ac1c103e03baf.js → c0d453f93af2d4a6ce64.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c72e90a952543d06d84b.js +1 -0
  70. package/assets/esri/core/workers/chunks/{005fe95c3329cfe74219.js → cf7acf5acb6d322fd996.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{457bbf27e9bc18132464.js → d23dd7da45a7aa341540.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{929b26999321519824b9.js → d2801df3fa44dee15ec8.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{932a0b39d85a76377d52.js → d626e08d23330d84413b.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{9d11e7972bc298cb94ce.js → db6e03fe8dd316f5005f.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{a37697ef360e2425768a.js → dca595fdd5e1a571e441.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{da2a10e72a315c3c1f82.js → e2779965db231fb666a5.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{f7af90c5f9d371eb7009.js → e4144ccc85ad4c76a9b7.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{9066f095f16448c0a04e.js → e4e2f059c52674dcae5b.js} +1 -1
  79. package/assets/esri/core/workers/chunks/edc2e87968c958bc852b.js +1 -0
  80. package/assets/esri/core/workers/chunks/{a256edc8337e462f80f0.js → efdd75896ca53eb6242f.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{c250799c131aa4ed2c35.js → f1c348cf2a1e35da9b20.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{861a7d0e665add901e11.js → f4d577ff61da7964e08a.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{5aff2d6ae0d2a2d92ecc.js → f7da652f8dab57677cc3.js} +1 -1
  84. package/chunks/GlobalIllumination.glsl.js +24 -8
  85. package/chunks/OITBlend.glsl.js +4 -3
  86. package/config.js +1 -1
  87. package/interfaces.d.ts +7 -0
  88. package/kernel.js +1 -1
  89. package/layers/graphics/OptimizedGeometry.js +1 -1
  90. package/layers/graphics/data/QueryEngineResult.js +1 -1
  91. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  92. package/layers/mixins/RasterJobHandlerMixin.js +1 -1
  93. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  94. package/layers/support/RasterJobHandler.js +1 -1
  95. package/layers/support/RasterWorker.js +1 -1
  96. package/layers/support/TitleCreator.js +1 -1
  97. package/layers/video/VideoController.js +1 -1
  98. package/networks/support/NamedTraceConfiguration.d.ts +2 -1
  99. package/networks/support/NamedTraceConfiguration.js +1 -1
  100. package/networks/support/TraceConfiguration.d.ts +4 -2
  101. package/networks/support/TraceConfiguration.js +1 -1
  102. package/package.json +2 -2
  103. package/popup/Feature.d.ts +250 -0
  104. package/popup/Feature.js +2 -0
  105. package/popup/support/arcadeFeatureUtils.js +2 -0
  106. package/popup/support/featureUtils.js +2 -0
  107. package/popup/support/relatedFeatureUtils.js +2 -0
  108. package/popup/types.d.ts +17 -3
  109. package/support/revision.js +1 -1
  110. package/tables/AttributeTableTemplate.d.ts +2 -2
  111. package/tables/elements/AttributeTableGroupElement.d.ts +3 -16
  112. package/tables/support/tablesUtils.d.ts +6 -5
  113. package/tables/types.d.ts +18 -0
  114. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  115. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  116. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  117. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  119. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  121. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  124. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  125. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  126. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  127. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  128. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  129. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  130. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  131. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  132. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  133. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  134. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  135. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  136. package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
  137. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  138. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  139. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  140. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  141. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  142. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  143. package/views/3d/webgl-engine/shaders/GlobalIllumination.glsl.js +1 -1
  144. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  145. package/widgets/Editor/UpdateWorkflow.js +1 -1
  146. package/widgets/Editor/support/EditorEditingCapabilities.js +1 -1
  147. package/widgets/Feature/FeatureContent/FeatureContentViewModel.js +1 -1
  148. package/widgets/Feature/FeatureContent.js +1 -1
  149. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  150. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  151. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  152. package/widgets/Feature/FeatureMedia.js +1 -1
  153. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  154. package/widgets/Feature/FeatureViewModel.js +1 -1
  155. package/widgets/FeatureForm/FieldInput.js +1 -1
  156. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  157. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  158. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  159. package/widgets/FeatureForm.js +1 -1
  160. package/widgets/Popup/actionUtils.js +1 -1
  161. package/widgets/Search.js +1 -1
  162. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  163. package/assets/esri/core/workers/chunks/0f2ab57e4eb722b3b0c0.js +0 -1
  164. package/assets/esri/core/workers/chunks/522bc1d79dbe957301e4.js +0 -1
  165. package/assets/esri/core/workers/chunks/60ad54e5707d4414d8b9.js +0 -1
  166. package/assets/esri/core/workers/chunks/76064c2c801da55cd844.js +0 -1
  167. package/assets/esri/core/workers/chunks/ad4f0a4e2dde44cd43d4.js +0 -1
  168. package/assets/esri/core/workers/chunks/b3e5dcb530cef678c8f8.js +0 -1
  169. package/assets/esri/core/workers/chunks/d01a98c13501c89205b6.js +0 -1
  170. package/assets/esri/core/workers/chunks/d3b3e8c6d7096bc59489.js +0 -1
  171. package/assets/esri/core/workers/chunks/d53c6fc10425adc2c0cf.js +0 -1
  172. package/assets/esri/core/workers/chunks/e543bb228f3f9d937d43.js +0 -1
  173. package/assets/esri/core/workers/chunks/f8ee1a99580a7da42cde.js +0 -1
  174. package/widgets/Feature/support/arcadeFeatureUtils.js +0 -2
  175. package/widgets/Feature/support/featureUtils.js +0 -2
  176. package/widgets/Feature/support/relatedFeatureUtils.js +0 -2
  177. /package/assets/esri/core/workers/chunks/{75e28458e08b0738b35a.js.LICENSE.txt → ab223c508f3dd562e7d3.js.LICENSE.txt} +0 -0
package/widgets/Search.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import s from"../PopupTemplate.js";import{deprecateWidget as o,deprecatedPropertyValue as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as l,abortMaybe as n}from"../core/maybe.js";import{ignoreAbortErrors as a,isAbortError as c}from"../core/promiseUtils.js";import{watch as u,initial as h,on as d}from"../core/reactiveUtils.js";import{waitAnimationFrame as p}from"../core/scheduling.js";import{property as g,subclass as m}from"../core/accessorSupport/decorators.js";import v from"../portal/Portal.js";import{popupFromView as _,closePopup as w}from"../views/popupAdapter.js";import M from"./Widget.js";import{css as S}from"./Search/css.js";import b from"./Search/SearchResultRenderer.js";import y from"./Search/SearchViewModel.js";import{SourceCollection as f}from"./Search/types.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{messageBundle as A,vmEvent as R,tsx as E}from"./support/widget.js";let x=class extends M{constructor(e,t){super(e,t),this._currentLocationValue=`${this.id}-search-use-current-location`,this._autocompleteNode=null,this._focusAbortController=null,this._searchResultRenderer=new b,this._suggestController=null,this._searchController=null,this._lastSearchTerm="",this._locateFailed=!1,this._showNoResults=!1,this.disabled=!1,this.messages=null,this.messagesCommon=null,this.viewModel=new y,this._renderSearchResultsContent=()=>this._searchResultRenderer,!0!==e?.suppressDeprecationWarning&&o(i.getLogger(this),"Search","arcgis-search",{version:"4.33"}),this.addHandles([u(()=>this.viewModel,e=>this._searchResultRenderer.viewModel=e,h),u(()=>this.viewModel.results,()=>this._searchResultRenderer.showMoreResultsOpen=!1),u(()=>this.messages,e=>this.viewModel.messages=e),u(()=>this.viewModel?.defaultPopupTemplate,e=>{e&&(e.content=this._renderSearchResultsContent)},h),u(()=>this.viewModel?.view?.popupElement&&this.viewModel?.defaultPopupTemplate,()=>{if(this.viewModel?.defaultPopupTemplate&&this.viewModel?.view?.popupElement){const e=document.createElement("arcgis-search-result-renderer");e.viewModel=this.viewModel,e.messages=this.messages,this.viewModel.defaultPopupTemplate.content=e}},h),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),d(()=>this.viewModel,"select-result",e=>{const{popupEnabled:t}=e,{view:s,resultGraphic:o,resultLocation:r}=this.viewModel,i=_(s);s&&i&&t&&r&&o?.getEffectivePopupTemplate(i.defaultPopupTemplateEnabled)&&s.openPopup({features:o?[o]:[],location:r})})])}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...s}=e;return s}loadDependencies(){return C({autocomplete:()=>import("@esri/calcite-components/dist/components/calcite-autocomplete"),"autocomplete-item-group":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item-group"),"autocomplete-item":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._cancelQueries(),this._searchResultRenderer=l(this._searchResultRenderer),this._focusAbortController?.abort()}get _isDisabled(){const{state:e}=this.viewModel;return"disabled"===e||"loading"===e||this.disabled}get _showCurrentLocation(){return this.locationEnabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){const{activeMenu:e}=this;return this._isDisabled?"none":"warning"===e?"suggestion":e}get activeMenu(){return"none"}set activeMenu(e){"warning"===e&&r(i.getLogger(this),"activeMenu","warning",{replacement:"Use the value 'suggestion' instead",version:"4.32",warnOnce:!0}),this._overrideIfSome("activeMenu",e)}get activeSource(){return this.viewModel?.activeSource}get activeSourceIndex(){return this.viewModel.activeSourceIndex}set activeSourceIndex(e){this.viewModel.activeSourceIndex=e}get allPlaceholder(){return this.viewModel.allPlaceholder}set allPlaceholder(e){this.viewModel.allPlaceholder=e}get allSources(){return this.viewModel.allSources}get autoNavigate(){return this.viewModel.autoNavigate}set autoNavigate(e){this.viewModel.autoNavigate=e}get autoSelect(){return this.viewModel.autoSelect}set autoSelect(e){this.viewModel.autoSelect=e}get defaultSources(){return this.viewModel.defaultSources}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"search"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultSources(){return this.viewModel.includeDefaultSources}set includeDefaultSources(e){this.viewModel.includeDefaultSources=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get locationEnabled(){return this.viewModel.locationEnabled}set locationEnabled(e){this.viewModel.locationEnabled=e}get maxResults(){return this.viewModel.maxResults}set maxResults(e){this.viewModel.maxResults=e}get maxSuggestions(){return this.viewModel.maxSuggestions}set maxSuggestions(e){this.viewModel.maxSuggestions=e}get minSuggestCharacters(){return this.viewModel.minSuggestCharacters}set minSuggestCharacters(e){this.viewModel.minSuggestCharacters=e}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get portal(){return this.viewModel?.portal}set portal(e){this.viewModel&&(this.viewModel.portal=e)}get resultGraphic(){return this.viewModel.resultGraphic}set resultGraphic(e){this.viewModel.resultGraphic=e}get resultGraphicEnabled(){return this.viewModel.resultGraphicEnabled}set resultGraphicEnabled(e){this.viewModel.resultGraphicEnabled=e}get results(){return this.viewModel.results}get searchAllEnabled(){return this.viewModel.searchAllEnabled}set searchAllEnabled(e){this.viewModel.searchAllEnabled=e}get searchTerm(){return this.viewModel.searchTerm}set searchTerm(e){this.viewModel.searchTerm=e}get selectedResult(){return this.viewModel.selectedResult}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get suggestions(){return this.viewModel.suggestions}get suggestionsEnabled(){return this.viewModel.suggestionsEnabled}set suggestionsEnabled(e){this.viewModel.suggestionsEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}clear(){this._locateFailed=!1,this.viewModel.clear()}focus(){this._handleFocus(),this._emitFocus()}blur(){this._autocompleteNode?.blur(),this._emitBlur()}async search(e){this._cancelQueries();const t=new AbortController,{signal:s}=t;this._searchController=t;try{const o=await this.viewModel.search(e,{signal:s});if(this._searchController!==t)return;return o?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=null,o}catch(o){if(this._searchController!==t)return;return void(this._searchController=null)}}async suggest(e){this._cancelSuggest();const t=new AbortController,{signal:s}=t;this._suggestController=t;try{const o=await this.viewModel.suggest(e,null,{signal:s});if(this._suggestController!==t)return;return this._suggestController=null,o?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),o}catch(o){return this._suggestController!==t||(this._suggestController=null),null}}render(){return E("div",{class:this.classes(S.base,T.widget)},E("div",{class:S.container},this._renderSourcesMenu(),this._renderForm()))}_closePopup(e){const t=_(this.view);e&&t?.selectedFeature===e&&w(this.view?.popup,this.view?.popupElement)}_handleInputKeydown(e){"Tab"===e.key&&this._cancelSuggest()}_emitFocus(){this.emit("search-focus")}_emitBlur(){this.emit("search-blur")}async _handleFocus(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await a(p(e)),this._autocompleteNode?.setFocus()}_renderSourcesMenu(){const{messages:e,_isDisabled:t,_effectiveActiveMenu:s}=this,{allSources:o,searchAllEnabled:r}=this.viewModel;return o.length>1?E("calcite-dropdown",{bind:this,class:S.dropdown,disabled:t,open:"source"===s,overlayPositioning:"fixed",topLayerDisabled:this.topLayerDisabled,onCalciteDropdownClose:this._handleSourceClose,onCalciteDropdownOpen:this._handleSourceOpen,onCalciteDropdownSelect:this._handleSourceSelect},E("calcite-button",{appearance:"outline-fill",iconStart:"caret-down",kind:"neutral",label:e.searchIn,slot:"trigger"}),E("calcite-dropdown-group",{groupTitle:e.searchIn},r?this._renderSource(y.ALL_INDEX):null,o.map((e,t)=>this._renderSource(t)).toArray())):null}_renderUseCurrentLocation(){const{_currentLocationValue:e}=this;return E("calcite-autocomplete-item",{heading:this.messages.useCurrentLocation,iconStart:"gps-on",key:e,value:e})}_handleAutocompleteCreate(e){this._autocompleteNode=e}_handleCalciteAutocompleteTextInput(e){const t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){"suggestion"===this.activeMenu&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){const t=e.target.value;if(t===this._currentLocationValue)return void this._useCurrentLocation();const s=JSON.parse(t),o=this.viewModel.suggestions?.find(({sourceIndex:e})=>e===s.sourceIndex)?.results?.find(({key:e})=>`${e}`==`${s.key}`);o&&this.search(o)}_renderAutocomplete(){const{_effectiveActiveMenu:e,messages:t,_isDisabled:s}=this,{maxInputLength:o,placeholder:r,searchTerm:i,state:l}=this.viewModel,n=this.label??t.searchButtonTitle??"";return E("calcite-autocomplete",{afterCreate:this._handleAutocompleteCreate,autocomplete:"off",bind:this,class:S.autocomplete,disabled:s,icon:this.icon||!1,inputValue:i,label:n,loading:"searching"===l,maxLength:o,name:this.id,onblur:this._emitBlur,onfocus:this._emitFocus,onkeydown:this._handleInputKeydown,open:"suggestion"===e,overlayPositioning:"fixed",placeholder:r,title:i?"":r,topLayerDisabled:this.topLayerDisabled,onCalciteAutocompleteChange:this._handleCalciteAutocompleteChange,onCalciteAutocompleteClose:this._handleAutocompleteClose,onCalciteAutocompleteOpen:this._handleAutocompleteOpen,onCalciteAutocompleteTextChange:this._handleCalciteAutocompleteTextInput,onCalciteAutocompleteTextInput:this._handleCalciteAutocompleteTextInput},this._renderSuggestions(),this._renderNotices())}_renderForm(){return E("form",{bind:this,class:S.form,disabled:this._isDisabled,key:S.form,onsubmit:this._formSubmit,role:"search"},this._renderAutocomplete(),E("button",{class:S.submitButton,type:"submit"},this.label??this.messages.searchButtonTitle??""))}_renderSuggestGroup(e){return e.results?.map(e=>this._renderSuggestion(e))}_renderSuggestions(){const{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(e=>this._renderSuggestResults(e))}_renderSuggestResults(e){const{allSources:t,activeSourceIndex:s}=this.viewModel,{sourceIndex:o}=e,r=e.results?.length,i=t.length>1&&s===y.ALL_INDEX,l=this._getSourceName(o);return r&&i?E("calcite-autocomplete-item-group",{heading:l,key:`suggestion-group-${l}-${o}`},this._renderSuggestGroup(e)):this._renderSuggestGroup(e)}_renderSuggestion({key:e,sourceIndex:t,text:s}){const o={key:e,sourceIndex:t};return E("calcite-autocomplete-item",{heading:s??this.messages.untitledResult,key:`suggestion_${e}`,value:JSON.stringify(o)})}_renderSource(e){const t=this._getSourceName(e);return E("calcite-dropdown-item",{"data-source-index":`${e}`,key:`source-${t}-${e}`,selected:e===this.viewModel.activeSourceIndex},t)}_renderNoResultsWarning(e){const{messages:s}=this,o=e?t(s.noResultsFoundForValue,{value:`"${e}"`}):s.noResultsFound;return E("calcite-notice",{icon:"exclamation-mark-triangle",key:"no-results-warning",kind:"warning",open:!0,slot:"content-bottom"},E("div",{slot:"title"},s.noResults),E("div",{slot:"message"},o))}_renderLocateError(){return E("calcite-notice",{icon:"exclamation-mark-circle",key:"locate-warning",kind:"danger",open:!0,slot:"content-bottom"},E("div",{slot:"message"},this.messages.locateError))}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}async _useCurrentLocation(){this._cancelQueries();const e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(s){c(s)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=null}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){"source"===this.activeMenu&&(this.activeMenu="none")}_handleSourceSelect(e){const t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=n(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=n(this._searchController)}_scrollToTopSuggestion(){this._autocompleteNode?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){const{messages:t}=this,{allSources:s}=this.viewModel,o=s.at(e);return e===y.ALL_INDEX?t.all:o?.name||t.untitledSource}};e([g()],x.prototype,"_locateFailed",void 0),e([g()],x.prototype,"_showNoResults",void 0),e([g()],x.prototype,"_isDisabled",null),e([g()],x.prototype,"_showCurrentLocation",null),e([g()],x.prototype,"_effectiveActiveMenu",null),e([g()],x.prototype,"activeMenu",null),e([g({readOnly:!0})],x.prototype,"activeSource",null),e([g()],x.prototype,"activeSourceIndex",null),e([g()],x.prototype,"allPlaceholder",null),e([g({readOnly:!0})],x.prototype,"allSources",null),e([g()],x.prototype,"autoNavigate",null),e([g()],x.prototype,"autoSelect",null),e([g({readOnly:!0})],x.prototype,"defaultSources",null),e([g()],x.prototype,"disabled",void 0),e([g()],x.prototype,"goToOverride",null),e([g()],x.prototype,"icon",null),e([g()],x.prototype,"includeDefaultSources",null),e([g()],x.prototype,"label",null),e([g()],x.prototype,"locationEnabled",null),e([g()],x.prototype,"maxResults",null),e([g()],x.prototype,"maxSuggestions",null),e([g(),A("esri/widgets/Search/t9n/Search")],x.prototype,"messages",void 0),e([g(),A("esri/t9n/common")],x.prototype,"messagesCommon",void 0),e([g()],x.prototype,"minSuggestCharacters",null),e([g()],x.prototype,"popupEnabled",null),e([g({type:s})],x.prototype,"popupTemplate",null),e([g({type:v})],x.prototype,"portal",null),e([g()],x.prototype,"resultGraphic",null),e([g()],x.prototype,"resultGraphicEnabled",null),e([g({readOnly:!0})],x.prototype,"results",null),e([g()],x.prototype,"searchAllEnabled",null),e([g()],x.prototype,"searchTerm",null),e([g({readOnly:!0})],x.prototype,"selectedResult",null),e([g({type:f})],x.prototype,"sources",null),e([g({readOnly:!0})],x.prototype,"suggestions",null),e([g()],x.prototype,"suggestionsEnabled",null),e([g()],x.prototype,"view",null),e([R(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),g({type:y})],x.prototype,"viewModel",void 0),x=e([m("esri.widgets.Search")],x);const I=x;export{I as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import s from"../PopupTemplate.js";import{deprecateWidget as o,deprecatedPropertyValue as r}from"../core/deprecate.js";import i from"../core/Logger.js";import{destroyMaybe as l,abortMaybe as n}from"../core/maybe.js";import{ignoreAbortErrors as a,isAbortError as c}from"../core/promiseUtils.js";import{watch as u,initial as h,on as d}from"../core/reactiveUtils.js";import{waitAnimationFrame as p}from"../core/scheduling.js";import{property as g,subclass as m}from"../core/accessorSupport/decorators.js";import v from"../portal/Portal.js";import{popupFromView as _,closePopup as w}from"../views/popupAdapter.js";import M from"./Widget.js";import{css as S}from"./Search/css.js";import b from"./Search/SearchResultRenderer.js";import y from"./Search/SearchViewModel.js";import{SourceCollection as f}from"./Search/types.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as T}from"./support/globalCss.js";import{messageBundle as A,vmEvent as E,tsx as x}from"./support/widget.js";let R=class extends M{constructor(e,t){super(e,t),this._currentLocationValue=`${this.id}-search-use-current-location`,this._autocompleteNode=null,this._focusAbortController=null,this._searchResultRenderer=new b({container:document.createElement("div")}),this._suggestController=null,this._searchController=null,this._lastSearchTerm="",this._locateFailed=!1,this._showNoResults=!1,this.disabled=!1,this.messages=null,this.messagesCommon=null,this.viewModel=new y,!0!==e?.suppressDeprecationWarning&&o(i.getLogger(this),"Search","arcgis-search",{version:"4.33"}),this.addHandles([u(()=>this.viewModel,e=>this._searchResultRenderer.viewModel=e,h),u(()=>this.viewModel.results,()=>this._searchResultRenderer.showMoreResultsOpen=!1),u(()=>this.messages,e=>this.viewModel.messages=e),u(()=>this.viewModel?.defaultPopupTemplate,e=>{e&&(e.content=()=>this._searchResultRenderer.container)},h),u(()=>this.viewModel?.view?.popupElement&&this.viewModel?.defaultPopupTemplate,()=>{if(this.viewModel?.defaultPopupTemplate&&this.viewModel?.view?.popupElement){const e=document.createElement("arcgis-search-result-renderer");e.viewModel=this.viewModel,e.messages=this.messages,this.viewModel.defaultPopupTemplate.content=e}},h),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),d(()=>this.viewModel,"select-result",e=>{const{popupEnabled:t}=e,{view:s,resultGraphic:o,resultLocation:r}=this.viewModel,i=_(s);s&&i&&t&&r&&o?.getEffectivePopupTemplate(i.defaultPopupTemplateEnabled)&&s.openPopup({features:o?[o]:[],location:r})})])}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...s}=e;return s}loadDependencies(){return C({autocomplete:()=>import("@esri/calcite-components/dist/components/calcite-autocomplete"),"autocomplete-item-group":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item-group"),"autocomplete-item":()=>import("@esri/calcite-components/dist/components/calcite-autocomplete-item"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._cancelQueries(),this._searchResultRenderer=l(this._searchResultRenderer),this._focusAbortController?.abort()}get _isDisabled(){const{state:e}=this.viewModel;return"disabled"===e||"loading"===e||this.disabled}get _showCurrentLocation(){return this.locationEnabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){const{activeMenu:e}=this;return this._isDisabled?"none":"warning"===e?"suggestion":e}get activeMenu(){return"none"}set activeMenu(e){"warning"===e&&r(i.getLogger(this),"activeMenu","warning",{replacement:"Use the value 'suggestion' instead",version:"4.32",warnOnce:!0}),this._overrideIfSome("activeMenu",e)}get activeSource(){return this.viewModel?.activeSource}get activeSourceIndex(){return this.viewModel.activeSourceIndex}set activeSourceIndex(e){this.viewModel.activeSourceIndex=e}get allPlaceholder(){return this.viewModel.allPlaceholder}set allPlaceholder(e){this.viewModel.allPlaceholder=e}get allSources(){return this.viewModel.allSources}get autoNavigate(){return this.viewModel.autoNavigate}set autoNavigate(e){this.viewModel.autoNavigate=e}get autoSelect(){return this.viewModel.autoSelect}set autoSelect(e){this.viewModel.autoSelect=e}get defaultSources(){return this.viewModel.defaultSources}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"search"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultSources(){return this.viewModel.includeDefaultSources}set includeDefaultSources(e){this.viewModel.includeDefaultSources=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get locationEnabled(){return this.viewModel.locationEnabled}set locationEnabled(e){this.viewModel.locationEnabled=e}get maxResults(){return this.viewModel.maxResults}set maxResults(e){this.viewModel.maxResults=e}get maxSuggestions(){return this.viewModel.maxSuggestions}set maxSuggestions(e){this.viewModel.maxSuggestions=e}get minSuggestCharacters(){return this.viewModel.minSuggestCharacters}set minSuggestCharacters(e){this.viewModel.minSuggestCharacters=e}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get portal(){return this.viewModel?.portal}set portal(e){this.viewModel&&(this.viewModel.portal=e)}get resultGraphic(){return this.viewModel.resultGraphic}set resultGraphic(e){this.viewModel.resultGraphic=e}get resultGraphicEnabled(){return this.viewModel.resultGraphicEnabled}set resultGraphicEnabled(e){this.viewModel.resultGraphicEnabled=e}get results(){return this.viewModel.results}get searchAllEnabled(){return this.viewModel.searchAllEnabled}set searchAllEnabled(e){this.viewModel.searchAllEnabled=e}get searchTerm(){return this.viewModel.searchTerm}set searchTerm(e){this.viewModel.searchTerm=e}get selectedResult(){return this.viewModel.selectedResult}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get suggestions(){return this.viewModel.suggestions}get suggestionsEnabled(){return this.viewModel.suggestionsEnabled}set suggestionsEnabled(e){this.viewModel.suggestionsEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}clear(){this._locateFailed=!1,this.viewModel.clear()}focus(){this._handleFocus(),this._emitFocus()}blur(){this._autocompleteNode?.blur(),this._emitBlur()}async search(e){this._cancelQueries();const t=new AbortController,{signal:s}=t;this._searchController=t;try{const o=await this.viewModel.search(e,{signal:s});if(this._searchController!==t)return;return o?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=null,o}catch(o){if(this._searchController!==t)return;return void(this._searchController=null)}}async suggest(e){this._cancelSuggest();const t=new AbortController,{signal:s}=t;this._suggestController=t;try{const o=await this.viewModel.suggest(e,null,{signal:s});if(this._suggestController!==t)return;return this._suggestController=null,o?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),o}catch(o){return this._suggestController!==t||(this._suggestController=null),null}}render(){return x("div",{class:this.classes(S.base,T.widget)},x("div",{class:S.container},this._renderSourcesMenu(),this._renderForm()))}_closePopup(e){const t=_(this.view);e&&t?.selectedFeature===e&&w(this.view?.popup,this.view?.popupElement)}_handleInputKeydown(e){"Tab"===e.key&&this._cancelSuggest()}_emitFocus(){this.emit("search-focus")}_emitBlur(){this.emit("search-blur")}async _handleFocus(){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;await a(p(e)),this._autocompleteNode?.setFocus()}_renderSourcesMenu(){const{messages:e,_isDisabled:t,_effectiveActiveMenu:s}=this,{allSources:o,searchAllEnabled:r}=this.viewModel;return o.length>1?x("calcite-dropdown",{bind:this,class:S.dropdown,disabled:t,open:"source"===s,overlayPositioning:"fixed",topLayerDisabled:this.topLayerDisabled,onCalciteDropdownClose:this._handleSourceClose,onCalciteDropdownOpen:this._handleSourceOpen,onCalciteDropdownSelect:this._handleSourceSelect},x("calcite-button",{appearance:"outline-fill",iconStart:"caret-down",kind:"neutral",label:e.searchIn,slot:"trigger"}),x("calcite-dropdown-group",{groupTitle:e.searchIn},r?this._renderSource(y.ALL_INDEX):null,o.map((e,t)=>this._renderSource(t)).toArray())):null}_renderUseCurrentLocation(){const{_currentLocationValue:e}=this;return x("calcite-autocomplete-item",{heading:this.messages.useCurrentLocation,iconStart:"gps-on",key:e,value:e})}_handleAutocompleteCreate(e){this._autocompleteNode=e}_handleCalciteAutocompleteTextInput(e){const t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){"suggestion"===this.activeMenu&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){const t=e.target.value;if(t===this._currentLocationValue)return void this._useCurrentLocation();const s=JSON.parse(t),o=this.viewModel.suggestions?.find(({sourceIndex:e})=>e===s.sourceIndex)?.results?.find(({key:e})=>`${e}`==`${s.key}`);o&&this.search(o)}_renderAutocomplete(){const{_effectiveActiveMenu:e,messages:t,_isDisabled:s}=this,{maxInputLength:o,placeholder:r,searchTerm:i,state:l}=this.viewModel,n=this.label??t.searchButtonTitle??"";return x("calcite-autocomplete",{afterCreate:this._handleAutocompleteCreate,autocomplete:"off",bind:this,class:S.autocomplete,disabled:s,icon:this.icon||!1,inputValue:i,label:n,loading:"searching"===l,maxLength:o,name:this.id,onblur:this._emitBlur,onfocus:this._emitFocus,onkeydown:this._handleInputKeydown,open:"suggestion"===e,overlayPositioning:"fixed",placeholder:r,title:i?"":r,topLayerDisabled:this.topLayerDisabled,onCalciteAutocompleteChange:this._handleCalciteAutocompleteChange,onCalciteAutocompleteClose:this._handleAutocompleteClose,onCalciteAutocompleteOpen:this._handleAutocompleteOpen,onCalciteAutocompleteTextChange:this._handleCalciteAutocompleteTextInput,onCalciteAutocompleteTextInput:this._handleCalciteAutocompleteTextInput},this._renderSuggestions(),this._renderNotices())}_renderForm(){return x("form",{bind:this,class:S.form,disabled:this._isDisabled,key:S.form,onsubmit:this._formSubmit,role:"search"},this._renderAutocomplete(),x("button",{class:S.submitButton,type:"submit"},this.label??this.messages.searchButtonTitle??""))}_renderSuggestGroup(e){return e.results?.map(e=>this._renderSuggestion(e))}_renderSuggestions(){const{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(e=>this._renderSuggestResults(e))}_renderSuggestResults(e){const{allSources:t,activeSourceIndex:s}=this.viewModel,{sourceIndex:o}=e,r=e.results?.length,i=t.length>1&&s===y.ALL_INDEX,l=this._getSourceName(o);return r&&i?x("calcite-autocomplete-item-group",{heading:l,key:`suggestion-group-${l}-${o}`},this._renderSuggestGroup(e)):this._renderSuggestGroup(e)}_renderSuggestion({key:e,sourceIndex:t,text:s}){const o={key:e,sourceIndex:t};return x("calcite-autocomplete-item",{heading:s??this.messages.untitledResult,key:`suggestion_${e}`,value:JSON.stringify(o)})}_renderSource(e){const t=this._getSourceName(e);return x("calcite-dropdown-item",{"data-source-index":`${e}`,key:`source-${t}-${e}`,selected:e===this.viewModel.activeSourceIndex},t)}_renderNoResultsWarning(e){const{messages:s}=this,o=e?t(s.noResultsFoundForValue,{value:`"${e}"`}):s.noResultsFound;return x("calcite-notice",{icon:"exclamation-mark-triangle",key:"no-results-warning",kind:"warning",open:!0,slot:"content-bottom"},x("div",{slot:"title"},s.noResults),x("div",{slot:"message"},o))}_renderLocateError(){return x("calcite-notice",{icon:"exclamation-mark-circle",key:"locate-warning",kind:"danger",open:!0,slot:"content-bottom"},x("div",{slot:"message"},this.messages.locateError))}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}async _useCurrentLocation(){this._cancelQueries();const e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(s){c(s)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=null}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){"source"===this.activeMenu&&(this.activeMenu="none")}_handleSourceSelect(e){const t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=n(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=n(this._searchController)}_scrollToTopSuggestion(){this._autocompleteNode?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){const{messages:t}=this,{allSources:s}=this.viewModel,o=s.at(e);return e===y.ALL_INDEX?t.all:o?.name||t.untitledSource}};e([g()],R.prototype,"_locateFailed",void 0),e([g()],R.prototype,"_showNoResults",void 0),e([g()],R.prototype,"_isDisabled",null),e([g()],R.prototype,"_showCurrentLocation",null),e([g()],R.prototype,"_effectiveActiveMenu",null),e([g()],R.prototype,"activeMenu",null),e([g({readOnly:!0})],R.prototype,"activeSource",null),e([g()],R.prototype,"activeSourceIndex",null),e([g()],R.prototype,"allPlaceholder",null),e([g({readOnly:!0})],R.prototype,"allSources",null),e([g()],R.prototype,"autoNavigate",null),e([g()],R.prototype,"autoSelect",null),e([g({readOnly:!0})],R.prototype,"defaultSources",null),e([g()],R.prototype,"disabled",void 0),e([g()],R.prototype,"goToOverride",null),e([g()],R.prototype,"icon",null),e([g()],R.prototype,"includeDefaultSources",null),e([g()],R.prototype,"label",null),e([g()],R.prototype,"locationEnabled",null),e([g()],R.prototype,"maxResults",null),e([g()],R.prototype,"maxSuggestions",null),e([g(),A("esri/widgets/Search/t9n/Search")],R.prototype,"messages",void 0),e([g(),A("esri/t9n/common")],R.prototype,"messagesCommon",void 0),e([g()],R.prototype,"minSuggestCharacters",null),e([g()],R.prototype,"popupEnabled",null),e([g({type:s})],R.prototype,"popupTemplate",null),e([g({type:v})],R.prototype,"portal",null),e([g()],R.prototype,"resultGraphic",null),e([g()],R.prototype,"resultGraphicEnabled",null),e([g({readOnly:!0})],R.prototype,"results",null),e([g()],R.prototype,"searchAllEnabled",null),e([g()],R.prototype,"searchTerm",null),e([g({readOnly:!0})],R.prototype,"selectedResult",null),e([g({type:f})],R.prototype,"sources",null),e([g({readOnly:!0})],R.prototype,"suggestions",null),e([g()],R.prototype,"suggestionsEnabled",null),e([g()],R.prototype,"view",null),e([E(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),g({type:y})],R.prototype,"viewModel",void 0),R=e([m("esri.widgets.Search")],R);const I=R;export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import s from"../../../core/Collection.js";import{IdentifiableMixin as i}from"../../../core/Identifiable.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{ignoreAbortErrors as n,debounce as c}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as u,initial as y}from"../../../core/reactiveUtils.js";import{sqlIn as d}from"../../../core/sql.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import{queryAllJSON as m}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as g,isSubtypeGroupLayer as _}from"../../../layers/support/layerUtils.js";import w from"../../../rest/networks/support/NetworkElement.js";import b from"../../../rest/support/FeatureSet.js";import A from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as F}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as f}from"../../Feature/support/featureUtils.js";import{getFeatureTitle as C}from"./utils/getFeatureTitle.js";const I=100;let v=class extends(r(i(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await n(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await n(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=c(this._queryController,I),this._queryFeatureCountDebounced=c(this._queryFeatureCountController,I)}initialize(){this.addHandles([u(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>{this.refresh()},y),u(()=>this.activeAssociationType,t=>{this._queryDebounced(t)},y)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:r,_loaded:s,canLoad:i,source:a}=this;return e||i&&!s?"loading":t||o?"querying":!r||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=g(t)?t.parent:t;return f(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new s}get structureAssociations(){return this._get("structureAssociations")||new s}get contentAssociations(){return this._get("contentAssociations")||new s}get containerAssociations(){return this._get("containerAssociations")||new s}get connectivityAssociations(){return this._get("connectivityAssociations")||new s}get associationFeatures(){return this._get("associationFeatures")||new l}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(t=>t.destroyAll())}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map(async t=>{await t.load()})??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=null!=t.layerId?e.getSourceIdByLayerId(t.layerId):null;null!=o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,r=t=>{const o=t;if(!t.url)return!1;if(o.layerId===s){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const s=e.getLayerIdBySourceId(t),i=o.allLayers.filter(r),a=o.allTables.filter(r),n=i.concat(a).toArray();return await Promise.allSettled(n.map(t=>t.load())),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(t=>t.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r),a=new A({where:i,outFields:["*"],cacheHint:this.supportsCacheHint}),n=b.fromJSON(await m(t,a,s));return n.features.forEach(e=>{e.layer=e.sourceLayer=_(t)?t.findSublayerForFeature(e):t}),n.features}async _createAssociationFeatureObjects(t,e,o,r,s,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,r,s,i)).forEach(t=>{if("popup"===this.source?t.sourceLayer&&t.getEffectivePopupTemplate():!!t.sourceLayer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}})}}const n=[];return await Promise.all(t.toArray().map(async t=>{const{fromNetworkElement:e,toNetworkElement:r}=t,s=e.globalId===o?r:e,i=a.get(s.globalId)??[];await Promise.all(i.map(async e=>{const o=null!=s?.terminalId?this.utilityNetwork?.getTerminalById(s.terminalId)?.name:void 0,r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||C(e);n.push({title:r,feature:e,association:t,terminalName:o})}))})),n}_parseFeatureObjects(t,e){const o=new Map;t.forEach(t=>{const e=t?.feature,r=e.sourceLayer;a(o,r,()=>new s).add(t)});for(const[r,s]of o)this._sortFeatureObjectsByTitle(s),e.set(r,s)}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:r,utilityNetwork:s,canQuery:i}=this;if(await Promise.allSettled([e?.load(),s?.load()]),this._clearAssociations(),!(i&&e&&r&&s&&o))return;const a=g(e)?e.parent:e,n=new w({globalId:o,networkSourceId:s.getSourceIdByLayerId(a.layerId)}),c=new Set;r.forEach(t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}});const l=await(s?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;r.forEach(t=>{y.set(t.type,t),u.set(t.type,[])}),l.forEach(t=>{const{toNetworkElement:e,fromNetworkElement:r}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(r,"connectivity",y))break;u.get("connectivity")?.push(r.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"container",y))break;u.get("container")?.push(r.globalId),this.containerAssociations.add(t)}break;case"attachment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"structure",y))break;u.get("structure")?.push(r.globalId),this.structureAssociations.add(t)}}});const d=r.map(async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:r,associatedAssetType:s}=e,i=u.get(e.type),a=null!=r?await this._countAssociatedFeatures(o,i,r,s,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}});await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r);return t.queryFeatureCount({where:i,outFields:["*"],returnGeometry:!1},{signal:s?.signal})}async _countAssociatedFeatures(t,e,o,r,s){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map(async t=>this._countAssociatedFeatureCount(t,e,o,r,s));return(await Promise.all(i)).reduce((t,e)=>t+e,0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:r,associationTypes:s,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&s&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach(t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:s,elementGlobalId:i}=e.globalId===r?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=y.get(s)||[];a.push(i),y.set(s,a)});const d=await this._createAssociationFeatureObjects(c,y,r,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:r}=this,{networkSourceId:s}=t,i=o.get(e)?.associatedNetworkSourceId,a=r.has(s);return null!=i&&i!==s||!a}_getFeatureQueryWhereClause(t,e,o,r){const s=t.globalIdField,i=t.fieldsIndex.get(F.assetGroup),a=t.fieldsIndex.get(F.assetType),n=null!=o,c=null!=r;return[s?d(s,e):null,n?`(${i?.name} = ${o})`:null,n&&c?`(${a?.name} = ${r})`:null].filter(Boolean).join(" AND ")}};t([h()],v.prototype,"_loaded",void 0),t([h()],v.prototype,"_queryAbortController",void 0),t([h()],v.prototype,"_queryPageAbortController",void 0),t([h()],v.prototype,"_queryFeatureCountAbortController",void 0),t([h({readOnly:!0})],v.prototype,"supportsCacheHint",null),t([h({readOnly:!0})],v.prototype,"canLoad",null),t([h({readOnly:!0})],v.prototype,"canQuery",null),t([h()],v.prototype,"networkSourceIdsInUse",void 0),t([h({constructOnly:!0})],v.prototype,"source",void 0),t([h()],v.prototype,"description",void 0),t([h({value:3})],v.prototype,"displayCount",null),t([h({type:e})],v.prototype,"graphic",void 0),t([h()],v.prototype,"layer",void 0),t([h()],v.prototype,"map",void 0),t([h({readOnly:!0})],v.prototype,"objectId",null),t([h({readOnly:!0})],v.prototype,"objectIdField",null),t([h({readOnly:!0})],v.prototype,"globalId",null),t([h({readOnly:!0})],v.prototype,"globalIdField",null),t([h()],v.prototype,"featureCount",void 0),t([h()],v.prototype,"associationTypes",void 0),t([h()],v.prototype,"activeAssociationType",null),t([h()],v.prototype,"showAllEnabled",void 0),t([h()],v.prototype,"state",null),t([h()],v.prototype,"title",void 0),t([h({readOnly:!0})],v.prototype,"utilityNetwork",null),t([h({readOnly:!0})],v.prototype,"attachmentsFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"structureFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"attachmentsAssociations",null),t([h({readOnly:!0})],v.prototype,"structureAssociations",null),t([h({readOnly:!0})],v.prototype,"contentFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"containerFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"contentAssociations",null),t([h({readOnly:!0})],v.prototype,"containerAssociations",null),t([h({readOnly:!0})],v.prototype,"connectivityFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"connectivityAssociations",null),t([h({readOnly:!0})],v.prototype,"associationFeatures",null),t([h({readOnly:!0})],v.prototype,"associationViewModels",null),v=t([p("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],v);export{v as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import s from"../../../core/Collection.js";import{IdentifiableMixin as i}from"../../../core/Identifiable.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{ignoreAbortErrors as n,debounce as c}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as u,initial as y}from"../../../core/reactiveUtils.js";import{sqlIn as d}from"../../../core/sql.js";import{property as h,subclass as p}from"../../../core/accessorSupport/decorators.js";import{queryAllJSON as m}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as g,isSubtypeGroupLayer as _}from"../../../layers/support/layerUtils.js";import{findUtilityNetwork as w}from"../../../popup/support/featureUtils.js";import b from"../../../rest/networks/support/NetworkElement.js";import A from"../../../rest/support/FeatureSet.js";import F from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as f}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{getFeatureTitle as C}from"./utils/getFeatureTitle.js";const I=100;let v=class extends(r(i(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await n(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await n(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=c(this._queryController,I),this._queryFeatureCountDebounced=c(this._queryFeatureCountController,I)}initialize(){this.addHandles([u(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>{this.refresh()},y),u(()=>this.activeAssociationType,t=>{this._queryDebounced(t)},y)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:r,_loaded:s,canLoad:i,source:a}=this;return e||i&&!s?"loading":t||o?"querying":!r||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=g(t)?t.parent:t;return w(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new s}get structureAssociations(){return this._get("structureAssociations")||new s}get contentAssociations(){return this._get("contentAssociations")||new s}get containerAssociations(){return this._get("containerAssociations")||new s}get connectivityAssociations(){return this._get("connectivityAssociations")||new s}get associationFeatures(){return this._get("associationFeatures")||new l}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(t=>t.destroyAll())}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map(async t=>{await t.load()})??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=null!=t.layerId?e.getSourceIdByLayerId(t.layerId):null;null!=o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,r=t=>{const o=t;if(!t.url)return!1;if(o.layerId===s){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const s=e.getLayerIdBySourceId(t),i=o.allLayers.filter(r),a=o.allTables.filter(r),n=i.concat(a).toArray();return await Promise.allSettled(n.map(t=>t.load())),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(t=>t.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r),a=new F({where:i,outFields:["*"],cacheHint:this.supportsCacheHint}),n=A.fromJSON(await m(t,a,s));return n.features.forEach(e=>{e.layer=e.sourceLayer=_(t)?t.findSublayerForFeature(e):t}),n.features}async _createAssociationFeatureObjects(t,e,o,r,s,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,r,s,i)).forEach(t=>{if("popup"===this.source?t.sourceLayer&&t.getEffectivePopupTemplate():!!t.sourceLayer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}})}}const n=[];return await Promise.all(t.toArray().map(async t=>{const{fromNetworkElement:e,toNetworkElement:r}=t,s=e.globalId===o?r:e,i=a.get(s.globalId)??[];await Promise.all(i.map(async e=>{const o=null!=s?.terminalId?this.utilityNetwork?.getTerminalById(s.terminalId)?.name:void 0,r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer&&await e.sourceLayer.getFeatureTitle(e)||C(e);n.push({title:r,feature:e,association:t,terminalName:o})}))})),n}_parseFeatureObjects(t,e){const o=new Map;t.forEach(t=>{const e=t?.feature,r=e.sourceLayer;a(o,r,()=>new s).add(t)});for(const[r,s]of o)this._sortFeatureObjectsByTitle(s),e.set(r,s)}_sortFeatureObjectsByTitle(t){t.sort(this._compareByFeatureTitle)}_compareByFeatureTitle(t,e){return t.title.localeCompare(e.title,void 0,{numeric:!0})}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:r,utilityNetwork:s,canQuery:i}=this;if(await Promise.allSettled([e?.load(),s?.load()]),this._clearAssociations(),!(i&&e&&r&&s&&o))return;const a=g(e)?e.parent:e,n=new b({globalId:o,networkSourceId:s.getSourceIdByLayerId(a.layerId)}),c=new Set;r.forEach(t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}});const l=await(s?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;r.forEach(t=>{y.set(t.type,t),u.set(t.type,[])}),l.forEach(t=>{const{toNetworkElement:e,fromNetworkElement:r}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(r,"connectivity",y))break;u.get("connectivity")?.push(r.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"container",y))break;u.get("container")?.push(r.globalId),this.containerAssociations.add(t)}break;case"attachment":if(r?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(r,"structure",y))break;u.get("structure")?.push(r.globalId),this.structureAssociations.add(t)}}});const d=r.map(async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:r,associatedAssetType:s}=e,i=u.get(e.type),a=null!=r?await this._countAssociatedFeatures(o,i,r,s,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}});await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,r,s){const i=this._getFeatureQueryWhereClause(t,e,o,r);return t.queryFeatureCount({where:i,outFields:["*"],returnGeometry:!1},{signal:s?.signal})}async _countAssociatedFeatures(t,e,o,r,s){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map(async t=>this._countAssociatedFeatureCount(t,e,o,r,s));return(await Promise.all(i)).reduce((t,e)=>t+e,0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:r,associationTypes:s,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&s&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach(t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:s,elementGlobalId:i}=e.globalId===r?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=y.get(s)||[];a.push(i),y.set(s,a)});const d=await this._createAssociationFeatureObjects(c,y,r,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:r}=this,{networkSourceId:s}=t,i=o.get(e)?.associatedNetworkSourceId,a=r.has(s);return null!=i&&i!==s||!a}_getFeatureQueryWhereClause(t,e,o,r){const s=t.globalIdField,i=t.fieldsIndex.get(f.assetGroup),a=t.fieldsIndex.get(f.assetType),n=null!=o,c=null!=r;return[s?d(s,e):null,n?`(${i?.name} = ${o})`:null,n&&c?`(${a?.name} = ${r})`:null].filter(Boolean).join(" AND ")}};t([h()],v.prototype,"_loaded",void 0),t([h()],v.prototype,"_queryAbortController",void 0),t([h()],v.prototype,"_queryPageAbortController",void 0),t([h()],v.prototype,"_queryFeatureCountAbortController",void 0),t([h({readOnly:!0})],v.prototype,"supportsCacheHint",null),t([h({readOnly:!0})],v.prototype,"canLoad",null),t([h({readOnly:!0})],v.prototype,"canQuery",null),t([h()],v.prototype,"networkSourceIdsInUse",void 0),t([h({constructOnly:!0})],v.prototype,"source",void 0),t([h()],v.prototype,"description",void 0),t([h({value:3})],v.prototype,"displayCount",null),t([h({type:e})],v.prototype,"graphic",void 0),t([h()],v.prototype,"layer",void 0),t([h()],v.prototype,"map",void 0),t([h({readOnly:!0})],v.prototype,"objectId",null),t([h({readOnly:!0})],v.prototype,"objectIdField",null),t([h({readOnly:!0})],v.prototype,"globalId",null),t([h({readOnly:!0})],v.prototype,"globalIdField",null),t([h()],v.prototype,"featureCount",void 0),t([h()],v.prototype,"associationTypes",void 0),t([h()],v.prototype,"activeAssociationType",null),t([h()],v.prototype,"showAllEnabled",void 0),t([h()],v.prototype,"state",null),t([h()],v.prototype,"title",void 0),t([h({readOnly:!0})],v.prototype,"utilityNetwork",null),t([h({readOnly:!0})],v.prototype,"attachmentsFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"structureFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"attachmentsAssociations",null),t([h({readOnly:!0})],v.prototype,"structureAssociations",null),t([h({readOnly:!0})],v.prototype,"contentFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"containerFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"contentAssociations",null),t([h({readOnly:!0})],v.prototype,"containerAssociations",null),t([h({readOnly:!0})],v.prototype,"connectivityFeatureCount",void 0),t([h({readOnly:!0})],v.prototype,"connectivityAssociations",null),t([h({readOnly:!0})],v.prototype,"associationFeatures",null),t([h({readOnly:!0})],v.prototype,"associationViewModels",null),v=t([p("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],v);export{v as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7883],{61473(e,t,n){function r(e){return e=e||globalThis.location.hostname,u.some(t=>null!=e?.match(t))}function i(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(l)||null!=t.match(a)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}n.d(t,{EM:()=>i,b5:()=>r});const o=/^devext\.arcgis\.com$/,l=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,a=/^[\w-]*\.mapsqa\.arcgis\.com$/,u=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,l,/^jsapps\.esri\.com$/,s,a]},4146(e,t,n){n.d(t,{A:()=>h});var r=n(5482),i=n(11254),o=n(49186),l=n(65529),s=n(4902),a=n(92474),u=n(53966),c=n(17676),y=n(84952),m=n(91429),p=n(5443),d=n(16930),f=n(92602),b=n(79677);let g=0,h=class extends((0,l.Zt)((0,s.s)(a.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p.A(-180,-90,180,90,d.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=d.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([n.e(812),n.e(7982)]).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await Promise.all([n.e(812),n.e(5613),n.e(5710)]).then(n.bind(n,45613));try{return await r(t)}catch(e){const n=t?.portalItem,r=n?.id||"unset",i=n?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,c.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,y.An)(this.url)}createLayerView(e,t){return Promise.reject(new o.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new o.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r.Cg)([(0,m.MZ)({type:String})],h.prototype,"attributionDataUrl",void 0),(0,r.Cg)([(0,m.MZ)({readOnly:!0})],h.prototype,"effectiveVisible",null),(0,r.Cg)([(0,m.MZ)({type:p.A})],h.prototype,"fullExtent",void 0),(0,r.Cg)([(0,m.MZ)({readOnly:!0})],h.prototype,"hasAttributionData",null),(0,r.Cg)([(0,m.MZ)({type:String,clonable:!1})],h.prototype,"id",void 0),(0,r.Cg)([(0,m.MZ)({type:Boolean,nonNullable:!0})],h.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,m.MZ)({type:["show","hide","hide-children"]})],h.prototype,"listMode",void 0),(0,r.Cg)([(0,m.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,"opacity",void 0),(0,r.Cg)([(0,m.MZ)({clonable:!1})],h.prototype,"parent",void 0),(0,r.Cg)([(0,m.MZ)({readOnly:!0})],h.prototype,"parsedUrl",null),(0,r.Cg)([(0,m.MZ)({type:Boolean,readOnly:!0})],h.prototype,"persistenceEnabled",void 0),(0,r.Cg)([(0,m.MZ)({type:Boolean})],h.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,m.MZ)({type:Boolean})],h.prototype,"attributionVisible",void 0),(0,r.Cg)([(0,m.MZ)({type:d.A})],h.prototype,"spatialReference",void 0),(0,r.Cg)([(0,m.MZ)({type:String})],h.prototype,"title",void 0),(0,r.Cg)([(0,m.MZ)({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),(0,r.Cg)([(0,m.MZ)()],h.prototype,"url",void 0),(0,r.Cg)([(0,m.MZ)({type:b.A})],h.prototype,"visibilityTimeExtent",void 0),(0,r.Cg)([(0,m.MZ)({type:Boolean,nonNullable:!0})],h.prototype,"visible",void 0),h=(0,r.Cg)([(0,m.$K)("esri.layers.Layer")],h)},77548(e,t,n){n.d(t,{Gh:()=>L,tk:()=>C,BR:()=>v,p2:()=>S,qd:()=>M,wI:()=>A,G$:()=>U,$x:()=>T,Ov:()=>b,UC:()=>m,W_:()=>g,OP:()=>D,TU:()=>f,XX:()=>d,jy:()=>h});var r=n(70333),i=n(11254),o=n(7762),l=(n(84952),n(36563)),s=n(36708),a=n(4146);const u=new WeakMap;function c(e){return!e.destroyed&&(u.has(e)||e.addHandles([(0,s.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof a.A)&&("catalog-dynamic-group"===t.type||c(t))},t=>u.set(e,t),s.pc),(0,l.hA)(()=>u.delete(e))]),u.get(e))}function y(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function m(e){return y(e,"knowledge-graph-sublayer")}function p(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}n(16215);const d={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function f(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function b(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function g(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function h(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"oriented-imagery"===e.type}(e)||function(e){return y(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}function w(e){const t=e?.type;return"binning"===t||"cluster"===t}function S(e,t){if(!h(e))return;const n=t?.graphic,r=e.featureReduction;if(n){if(n.isAggregate){const e=n.origin;return e&&"featureReductionProvider"in e&&r?w(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?w(r)?r:null:e}async function A(e,t){const n=r.id?.findServerInfo(e);if(null!=n?.currentVersion)return n.owningSystemUrl||null;const o=e.toLowerCase().indexOf("/rest/services");if(-1===o)return null;const l=`${e.slice(0,o)}/rest/info`,s=null!=t?t.signal:null,{data:a}=await(0,i.A)(l,{query:{f:"json"},responseType:"json",signal:s});return a?.owningSystemUrl||null}function v(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function C(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function M(e){const t=new o.A;for(const n of e.allLayers.concat(e.allTables))c(n)||p(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function T(e,t){return null}function U(e){return null}function D(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function L(e,t){if(!t||!D(e))return;const n=(e.url,null);n&&(e.url=n)}},73133(e,t,n){n.d(t,{j:()=>r});const r=(0,n(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},16215(e,t,n){n.d(t,{S:()=>i,Y:()=>r});const r=Symbol("BasemapInstance");function i(e){return null!=e&&"object"==typeof e&&r in e}},59868(e,t,n){n.d(t,{A7:()=>u,Cx:()=>c,Hk:()=>y,UK:()=>a});var r=n(94985),i=n(31593),o=n(53930),l=n(68249),s=n(93470);const a=o.A.fromJSON(s.Cb),u=i.A.fromJSON(s.yM),c=r.A.fromJSON(s.WR),y=l.A.fromJSON(s.JZ);o.A.fromJSON(s.nC),i.A.fromJSON(s.HW),r.A.fromJSON(s.b6)},93470(e,t,n){n.d(t,{Cb:()=>o,HW:()=>c,JR:()=>i,JZ:()=>a,WR:()=>s,b6:()=>y,fT:()=>r,nC:()=>u,yM:()=>l});const r=[252,146,31,255],i=[153,153,153,255],o={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},l={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r},s={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},u={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},c={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},y={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},73838(e,t,n){n.d(t,{rS:()=>$,M9:()=>N,oO:()=>I});var r=n(93637),i=n(77548),o=n(37757),l=n(49186),s=n(13313),a=n(97887),u=n(68548),c=n(58592),y=n(75981),m=n(65365),p=n(94985),d=n(31593),f=n(53930),b=n(68249),g=n(68197),h=n(7762),w=n(90629),S=n(27845),A=n(11506),v=n(39065),C=n(59868),M=n(93470);y.A.fromSimpleMarkerSymbol(C.UK),a.A.fromSimpleLineSymbol(C.A7),m.A.fromSimpleFillSymbol(C.Cx),new u.A({symbolLayers:new h.A([new S.A({material:{color:M.fT},edges:new v.A({size:(0,w.PN)(1),color:new g.A(M.JR)})})])});const T=new a.A({symbolLayers:new h.A([new A.A({material:{color:new g.A([0,0,0])},size:(0,w.PN)(1)})])}),U=new m.A({symbolLayers:new h.A([new S.A({outline:{color:new g.A([0,0,0]),size:(0,w.PN)(1)}})])});var D=n(33910);const L="#useCIMFallbackSymbology()",k={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};var E=n(59923);function N(e,t,n,i){const o=j(e,{},{context:i,isLabelSymbol:!1});null!=o&&(0,r.sM)(n,o,t)}function I(e,t,n,r){const i=j(e,{},{context:r,isLabelSymbol:!0});null!=i&&(t[n]=i)}function x(e){return(0,D.wk)(e)||e instanceof o.A}function j(e,t,n){if(null==e)return null;const{context:r,isLabelSymbol:g}=n,h=r?.origin;if("web-scene"===h&&!x(e)){const n=function(e,t=k){if(!e)return{symbol:null};const{retainId:n=k.retainId,ignoreDrivers:r=k.ignoreDrivers,hasLabelingContext:i=k.hasLabelingContext,retainCIM:g=k.retainCIM,cimFallbackEnabled:h=k.cimFallbackEnabled}=t;let w=null;if((0,D.wk)(e))w=e.clone();else if("web-style"===e.type)w=e.clone();else if("cim"===e.type){const n=e.data?.symbol?.type;switch(n){case"CIMPointSymbol":w=g?e.clone():y.A.fromCIMSymbol(e);break;case"CIMLineSymbol":h&&(w=T.clone(),t?.logWarning?.(L,"Unsupported CIM line symbology converted to fallback 3D line symbology"));break;case"CIMPolygonSymbol":h&&(w=U.clone(),t?.logWarning?.(L,"Unsupported CIM polygon symbology converted to fallback 3D polygon symbology"))}if(!w)return{error:new l.A("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${n||"unknown"}' is unsupported in 3D`,{symbol:e})}}else if(e instanceof d.A)w=a.A.fromSimpleLineSymbol(e);else if(e instanceof f.A)w=y.A.fromSimpleMarkerSymbol(e);else if(e instanceof c.A)w=y.A.fromPictureMarkerSymbol(e);else if(e instanceof p.A)w=t.geometryType&&"mesh"===t.geometryType?u.A.fromSimpleFillSymbol(e):m.A.fromSimpleFillSymbol(e);else{if(!(e instanceof b.A))return{error:new l.A("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};w=i?s.A.fromTextSymbol(e):y.A.fromTextSymbol(e)}return n&&w&&"cim"!==w.type&&(w.id=e.id),!r||"cim"===w.type||w instanceof o.A||w.symbolLayers.forEach(e=>e.ignoreDrivers=!0),{symbol:w}}(e,{retainCIM:!0,hasLabelingContext:g});return null!=n.symbol?n.symbol.write(t,r):((0,E.bA)(r,e,"Use 3D symbology instead when working with WebScene and SceneView",{error:n.error}),null)}return(0,i.TU)(r?.layer)&&function(e){return"polygon-3d"===e?.type||"line-3d"===e?.type}(e)?((0,E.bA)(r,e,`unsupported in layers of type ${r?.layer?.declaredClass}`),null):("web-map"===h||"portal-item"===h&&!(0,i.TU)(r?.layer))&&x(e)?((0,E.bA)(r,e,"Use 2D symbology and CIMSymbol instead when working with MapView"),null):e.write(t,r)}function $(e,t){return(0,D.Bu)(e,null,t)}},85594(e,t,n){n.d(t,{jg:()=>h,cF:()=>y,bo:()=>m,yA:()=>f,o5:()=>p});var r=n(11254),i=n(49186),o=n(44208),l=n(17676),s=n(84952),a=n(20655),u=n(16405);const c=new Map;function y(e,t,n){return null!=e?.styleUrl?async function(e,t){try{return{data:(await f(e,t)).data,baseUrl:(0,s.nM)(e),styleUrl:e}}catch(e){return(0,l.QP)(e),null}}(e.styleUrl,n):null!=e?.styleName?function(e,t,n){const r=null!=t.portal?t.portal:a.A.getDefault();let o;const l=`${r.url} - ${r.user?.username} - ${e}`,s=c.get(l);if(s)return s;const y=function(e,t,n){return t.load(n).then(()=>{const r=new u.A({disableExtraQuery:!0,query:`owner:${b} AND type:${g} AND typekeywords:"${e}"`});return t.queryItems(r,n)}).then(({results:t})=>{let r=null;const o=e.toLowerCase();if(t&&Array.isArray(t))for(const e of t){const t=e.typeKeywords?.some(e=>e.toLowerCase()===o);if(t&&e.type===g&&e.owner===b){r=e;break}}if(!r)throw new i.A("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return r.load(n)})}(e,r,n).then(e=>(o=e,e.fetchData())).then(t=>({data:t,baseUrl:o.itemUrl??"",styleName:e}));return c.set(l,y),y}(e.styleName,t,n):Promise.reject(new i.A("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function p(e,t){for(const n of t)switch(n){case"cim":if(e.cimRef)return{format:n,url:encodeURI(e.cimRef)};break;case"web-gltf-basisu":{const t=d(e,"gltf_basisu");if(t)return{format:n,url:t};break}case"web-gltf":{const t=d(e,"gltf");if(t)return{format:n,url:t};break}case"web":{const t=d(e,"gltf");if(t)return{format:"web-gltf",url:t};if(e.webRef)return{format:n,url:encodeURI(e.webRef)};break}}}function d(e,t){if(!(0,o.A)("enable-feature:force-wosr"))return e.formatInfos?.find(e=>e.type===t)?.href}function f(e,t){const n={responseType:"json",query:{f:"json"},...t};return(0,r.A)((0,s.S8)(e),n)}const b="esri_en",g="Style",h="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},27883(e,t,n){n.d(t,{resolveWebStyleSymbol:()=>d});var r=n(61473),i=n(49186),o=n(84952),l=n(20655),s=n(97159),a=n(73838),u=n(98751),c=n(85594),y=n(57212),m=n(33910);const p=["web-gltf","web","cim"];function d(e,t,n){const r=e.name;return null==r?Promise.reject(new i.A("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):"Esri2DPointSymbolsStyle"===e.styleName?function(e,t,n){const r=c.jg.replaceAll(/\{SymbolName\}/gi,e),i=null!=t.portal?t.portal:l.A.getDefault();return(0,c.yA)(r,n).then(e=>{const t=(0,c.bo)(e.data);return(0,a.rS)(t,{portal:i,url:(0,o.An)((0,o.nM)(r)),origin:"portal-item"})})}(r,t,n):(0,c.cF)(e,t,n).then(e=>f(e,r,t,c.o5,n))}async function f(e,t,n,d,f){const b=null!=n?.portal?n.portal:l.A.getDefault(),g={portal:b,url:(0,o.An)(e.baseUrl)},h=function(e,t){return t.items.find(t=>t.name===e)}(t,e.data);if(!h)throw new i.A("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});const w=f?.acceptedFormats??p,S=d(h,w);if(!S)throw new i.A("symbolstyleutils:symbol-reference-no-accepted-format",`The symbol name '${t}' does not have an accepted format (one of ${w})`,{symbolName:t});const{url:A,format:v}=S;let C=(0,s.f)(A,g),M=h.thumbnail?.href??null;const T=h.thumbnail?.imageData;(0,r.b5)()&&(C=(0,r.EM)(C)??"",M=(0,r.EM)(M));const U={portal:b,url:(0,o.An)((0,o.nM)(C)),origin:"portal-item"};return(0,c.yA)(C,f).then(r=>{const i="cim"===v?(0,c.bo)(r.data):r.data,o=(0,a.rS)(i,U);if(o&&(0,m.wk)(o)){if(M){const e=(0,s.f)(M,g);o.thumbnail=new y.V({url:e})}else T&&(o.thumbnail=new y.V({url:`data:image/png;base64,${T}`}));e.styleUrl?o.styleOrigin=new u.A({portal:n.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(o.styleOrigin=new u.A({portal:n.portal,styleName:e.styleName,name:t}))}return o})}},79677(e,t,n){n.d(t,{A:()=>m});var r,i=n(5482),o=n(25482),l=n(88930),s=n(91429),a=n(98623),u=n(10184),c=n(36005),y=n(43937);let m=class extends o.o{static{r=this}static get allTime(){return p}static get empty(){return d}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===r&&n===i}expandTo(e,t=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let n=this.start;n&&(n=(0,l.lL)(n,new u.A({value:1,unit:e}),t));let i=this.end;if(i){const n=(0,l.lL)(i,new u.A({value:1,unit:e}),t);i=i.getTime()===n.getTime()?n:(0,l.S1)(n,1,e,t)}return new r({start:n,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,o=e.end?.getTime()??1/0;let l,s;return i>=t&&i<=n?l=i:t>=i&&t<=o&&(l=t),n>=i&&n<=o?s=n:o>=t&&o<=n&&(s=o),null==l||null==s||isNaN(l)||isNaN(s)?r.empty:new r({start:l===-1/0?null:new Date(l),end:s===1/0?null:new Date(s)})}offset(e,t,n=a.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const i=new r,{start:o,end:s}=this;return null!=o&&(i.start=(0,l.S1)(o,e,t,n)),null!=s&&(i.end=(0,l.S1)(s,e,t,n)),i}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:n})}};(0,i.Cg)([(0,s.MZ)({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"end",void 0),(0,i.Cg)([(0,c.w)("end")],m.prototype,"readEnd",null),(0,i.Cg)([(0,y.K)("end")],m.prototype,"writeEnd",null),(0,i.Cg)([(0,s.MZ)({readOnly:!0,json:{read:!1}})],m.prototype,"isAllTime",null),(0,i.Cg)([(0,s.MZ)({readOnly:!0,json:{read:!1}})],m.prototype,"isEmpty",null),(0,i.Cg)([(0,s.MZ)({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"start",void 0),(0,i.Cg)([(0,c.w)("start")],m.prototype,"readStart",null),(0,i.Cg)([(0,y.K)("start")],m.prototype,"writeStart",null),m=r=(0,i.Cg)([(0,s.$K)("esri.time.TimeExtent")],m);const p=new m,d=new m({start:void 0,end:void 0})},10184(e,t,n){n.d(t,{A:()=>c});var r=n(5482),i=n(69540),o=n(25482),l=n(88930),s=n(91429),a=n(73133),u=n(93223);let c=class extends((0,i.OU)(o.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,l.t)(this.value,this.unit,"milliseconds")}};(0,r.Cg)([(0,u.e)(a.j,{nonNullable:!0})],c.prototype,"unit",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0},nonNullable:!0})],c.prototype,"value",void 0),c=(0,r.Cg)([(0,s.$K)("esri.time.TimeInterval")],c)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3116],{83116(e,t,r){r.d(t,{default:()=>E});var s=r(5482),i=r(92602),a=r(11254),n=r(7762),o=r(62885),l=r(25482),c=r(4718),d=r(92474),y=r(81583),u=r(53966),p=r(97768),g=r(17676),h=r(84952),m=r(91429),b=r(16930),f=r(20655),v=r(80812),L=r(43281),w=r(69622),S=r(73444),T=r(10838);let M=class extends w.A{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2",this.worldview=null}get languageParameter(){const e=this.language;let t="local"===e||"global"===e?e:(0,T.xO)(e??(0,S.JK)())??"global";return t="no"===t?"nb":t,t}};(0,s.Cg)([(0,m.MZ)()],M.prototype,"apiKey",void 0),(0,s.Cg)([(0,m.MZ)()],M.prototype,"id",void 0),(0,s.Cg)([(0,m.MZ)()],M.prototype,"language",void 0),(0,s.Cg)([(0,m.MZ)()],M.prototype,"places",void 0),(0,s.Cg)([(0,m.MZ)()],M.prototype,"serviceUrl",void 0),(0,s.Cg)([(0,m.MZ)()],M.prototype,"worldview",void 0),M=(0,s.Cg)([(0,m.$K)("esri.support.BasemapStyle")],M);const A=M;var C,_,I=r(16215),U=r(751),k=r(43937);let j=class extends((0,l.T)(d.x_)){static{C=I.Y}static{_=this}constructor(e){super(e),this[C]=!0,this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.type="Basemap",this.id=Date.now().toString(16)+"-basemap-"+_.idCounter++,this.baseLayers=new n.A,this.referenceLayers=new n.A,this.groundLayers=new n.A;const t=e=>{const{parent:t}=e;t&&t!==this&&"remove"in t&&t.remove?.(e),e.parent=this,"elevation"!==e.type&&"integrated-mesh-3dtiles"!==e.type||u.A.getLogger(this).error(`Layer '${e.title}, id:${e.id}' of type '${e.type}' is not supported as a basemap layer and will therefore be ignored.`)},r=e=>{const{parent:t}=e;t&&t!==this&&"remove"in t&&t.remove?.(e),e.parent=this},s=e=>{e.parent=null},i=e=>{e.parent===this&&(e.parent=null)};this.addHandles([this.baseLayers.on("after-add",e=>t(e.item)),this.baseLayers.on("after-remove",e=>s(e.item)),this.referenceLayers.on("after-add",e=>t(e.item)),this.referenceLayers.on("after-remove",e=>s(e.item)),this.groundLayers.on("before-add",e=>{const t=e.item;return t.parent===this?(u.A.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),void e.preventDefault()):"integrated-mesh-3dtiles"!==t.type?(u.A.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored.`),void e.preventDefault()):void 0}),this.groundLayers.on("after-add",e=>r(e.item)),this.groundLayers.on("after-remove",e=>i(e.item))])}static{this.idCounter=0}initialize(){this.when().catch(e=>{u.A.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const t of e)t.destroyed||t.destroy();const t=this.groundLayers.toArray();for(const e of t)e.destroyed||e.destroy();const r=this.referenceLayers.toArray();for(const e of r)e.destroyed||e.destroy();this.baseLayers.destroy(),this.groundLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=(0,p.pR)(this.portalItem)}removeChildLayer(e){for(const t of[this.baseLayers,this.referenceLayers,this.groundLayers])t.remove(e)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}get baseLayers(){return this._get("baseLayers")}set baseLayers(e){this._set("baseLayers",(0,o.V)(e,this._get("baseLayers")))}_writeBaseLayers(e,t,r){const s=[];e?(r={...r,layerContainerType:"basemap-base-layers"},this.baseLayers.forEach(e=>{const t=(0,U.CJ)(e,r.webmap?r.webmap.getLayerJSONFromResourceInfo(e):null,r);null!=t&&s.push(t)}),this.referenceLayers.forEach(e=>{const t=(0,U.CJ)(e,r.webmap?r.webmap.getLayerJSONFromResourceInfo(e):null,r);null!=t&&("scene"!==e.type&&(t.isReference=!0),s.push(t))}),t.baseMapLayers=s):t.baseMapLayers=s}set groundLayers(e){this._set("groundLayers",(0,o.V)(e,this._get("groundLayers")))}_writeGroundLayers(e,t,r){const s=[];e&&(r={...r,layerContainerType:"basemap-ground-layers"},this.groundLayers.forEach(e=>{const t=(0,U.CJ)(e,r.webmap?r.webmap.getLayerJSONFromResourceInfo(e):null,r);null!=t&&s.push(t)}),s.length>0&&(t.groundLayers=s))}get loaded(){return super.loaded}get referenceLayers(){return this._get("referenceLayers")}set referenceLayers(e){this._set("referenceLayers",(0,o.V)(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return(0,y.g)(this,e=>{e(this.baseLayers,this.groundLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>(0,c.Nb)(e)?e.clone():e),groundLayers:this.groundLayers.map(e=>(0,c.Nb)(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>(0,c.Nb)(e)?e.clone():e)};return this.loaded&&(e.loadStatus="loaded"),new _({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){return e=e||{},t?.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(e=>{const t=(0,c.o8)(e);return t.url&&(0,h.BQ)(t.url)&&(t.url=`https:${t.url}`),t.templateUrl&&(0,h.BQ)(t.templateUrl)&&(t.templateUrl=`https:${t.templateUrl}`),t})),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:r,style:s}=this;(0,g.Te)(e);const i=[];if(t){const r=t.context?t.context.url:null;if(i.push(this._loadLayersFromJSON(t.data,r,e)),t.data.id&&!t.data.title){const e=t.data.id;i.push((0,L.q)(e).then(e=>{e&&this.read({title:e},t.context)}))}}else r?i.push(this._loadFromItem(r,e)):s&&i.push(this._loadFromStylesService(s,e));await Promise.all(i)}async _loadLayersFromJSON(e,t,s){const i=this.resourceInfo?.context,a=this.portalItem?.portal||i?.portal||null,n=O[i?.origin||""]??"web-map",{populateOperationalLayers:o}=await Promise.all([r.e(5613),r.e(9933)]).then(r.bind(r,75356)),l=[];if((0,g.Te)(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const r={context:{...i,origin:n,url:t,portal:a,layerContainerType:"basemap-base-layers"},defaultLayerType:"DefaultTileLayer"},s=e=>"web-scene"===n&&"ArcGISSceneServiceLayer"===e.layerType||e.isReference,c=o(this.baseLayers,e.baseMapLayers.filter(e=>!s(e)),r);l.push(c);const d=o(this.referenceLayers,e.baseMapLayers.filter(s),r);l.push(d)}if(e.groundLayers&&Array.isArray(e.groundLayers)){const r={context:{...i,origin:n,url:t,portal:a,layerContainerType:"basemap-ground-layers"},defaultLayerType:"IntegratedMesh3DTilesLayer"},s=o(this.groundLayers,e.groundLayers,r);l.push(s)}await Promise.allSettled(l)}async _loadFromItem(e,t){const r=await e.load(t),s=await r.fetchData("json",t),i=(0,h.An)(e.itemUrl??"");return this._set("resourceInfo",{data:s.baseMap??{},context:{origin:D[e.type||""]??"web-map",portal:e.portal||f.A.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||f.A.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,t)}async _loadFromStylesService(e,t){const r=e.serviceUrl.endsWith("/webmaps")?e.serviceUrl.slice(0,-8):e.serviceUrl,s=`${r}/styles/${e.id}/self`,n=`${r}/webmaps/${e.id}`,o=e.apiKey??(i.A.sessions?.basemap?.enabled?void 0:i.A.apiKeys.basemapStyles),[l,c]=await Promise.all([(await(0,a.A)(s,{query:{token:o},signal:t?.signal})).data,(await(0,a.A)(n,{query:{language:e.languageParameter,places:e.places,worldview:e.worldview,token:o},signal:t?.signal})).data]);this.thumbnailUrl??=l.thumbnailUrl;const d=(0,h.An)(n);if(this._set("resourceInfo",{data:c.baseMap??{},context:{origin:"web-map",url:d}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:c.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,d,t),o)for(const e of[...this.baseLayers,...this.groundLayers,...this.referenceLayers])"apiKey"in e&&(e.apiKey=o)}static fromId(e){const t=L.H[e];return t?t.itemId?new _({portalItem:{id:t.itemId,portal:{url:"https://www.arcgis.com"}}}):_.fromJSON(t,t.is3d?{origin:"web-scene",portal:new f.A({url:"https://www.arcgis.com"})}:{origin:"web-map"}):null}};(0,s.Cg)([(0,m.MZ)({json:{read:!1,write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,r,s){this._writeBaseLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:n.A}},writer(e,t,r,s){this._writeBaseLayers(e,t,s)}}}}}})],j.prototype,"baseLayers",null),(0,s.Cg)([(0,m.MZ)({json:{read:!1,write:{ignoreOrigin:!0,target:"groundLayers",writer(e,t,r,s){this._writeGroundLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{groundLayers:{type:n.A}},writer(e,t,r,s){this._writeGroundLayers(e,t,s)}}}}}})],j.prototype,"groundLayers",null),(0,s.Cg)([(0,m.MZ)({type:String,json:{origins:{"web-scene":{write:!0}}}})],j.prototype,"id",void 0),(0,s.Cg)([(0,m.MZ)({type:v.default})],j.prototype,"portalItem",void 0),(0,s.Cg)([(0,m.MZ)()],j.prototype,"referenceLayers",null),(0,s.Cg)([(0,m.MZ)({readOnly:!0})],j.prototype,"resourceInfo",void 0),(0,s.Cg)([(0,m.MZ)({type:b.A})],j.prototype,"spatialReference",void 0),(0,s.Cg)([(0,m.MZ)({type:A})],j.prototype,"style",void 0),(0,s.Cg)([(0,m.MZ)()],j.prototype,"thumbnailUrl",void 0),(0,s.Cg)([(0,m.MZ)({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],j.prototype,"title",void 0),(0,s.Cg)([(0,k.K)("title")],j.prototype,"writeTitle",null),j=_=(0,s.Cg)([(0,m.$K)("esri.Basemap")],j);const D={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},O={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},E=j},69540(e,t,r){r.d(t,{OU:()=>d,Pw:()=>y});var s=r(5482),i=r(69622),a=(r(44208),r(4718)),n=(r(53966),r(97768)),o=r(88620),l=r(64108);const c=Symbol("ClonableMixin"),d=e=>{var t;const r=e;let i=class extends r{constructor(){super(...arguments),this[t]=!0}static{t=c}clone(e){const t=(0,o.oY)(this);(0,n.Lw)(t,"unable to clone instance of non-accessor class");const r=t.metadata,s=t.store,i={},l=new Map;for(const t in r){const n=r[t],o=s?.originOf(t),c=n.clonable;if(n.readOnly||!1===c||7!==o&&0!==o&&5!==o&&4!==o)continue;const d=this[t];let y=null;if("function"==typeof c)y=c(d,e);else if("reference"===c)y=d;else if(y=(0,a.TU)(d,e),null!=d&&null==y)continue;0===o?l.set(t,y):i[t]=y}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(l.size){const e=(0,o.oY)(c)?.store;if(e)for(const[t,r]of l)e.set(t,r,0)}return c}};return i=(0,s.Cg)([(0,l.$)("esri.core.Clonable")],i),i},y=d(i.A)},4902(e,t,r){r.d(t,{s:()=>n});var s=r(5482),i=r(64108);let a=0;const n=e=>{const t=e;let r=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+a++})}};return r=(0,s.Cg)([(0,i.$)("esri.core.Identifiable")],r),r};n(class{})},60999(e,t,r){r.d(t,{DZ:()=>g,Ke:()=>p,Tj:()=>d,UT:()=>h,aD:()=>b,jJ:()=>c});var s=r(5482),i=r(69622),a=r(97768),n=r(17676),o=r(10107),l=r(64108);function c(e,t,r){return(0,n.Lx)(e.map((e,s)=>t.apply(r,[e,s])))}async function d(e,t,r){return(await(0,n.Lx)(e.map((e,s)=>t.apply(r,[e,s])))).map(e=>e.value)}function y(e){return{ok:!0,value:e}}function u(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return y(await e)}catch(e){return u(e)}}async function g(e){try{return y(await e)}catch(e){return(0,n.QP)(e),u(e)}}function h(e,t){return new m(e,t)}let m=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,a.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=y(e),this._cleanup()},e=>{this._result=u(e),this._cleanup()}),this._abortHandle=(0,n.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,a.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,o.MZ)()],m.prototype,"value",null),(0,s.Cg)([(0,o.MZ)()],m.prototype,"error",null),(0,s.Cg)([(0,o.MZ)()],m.prototype,"finished",null),(0,s.Cg)([(0,o.MZ)()],m.prototype,"promise",void 0),(0,s.Cg)([(0,o.MZ)()],m.prototype,"_result",void 0),m=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],m);class b{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,s.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,s.hk)(t)}}}},62885(e,t,r){r.d(t,{H:()=>a,V:()=>i});var s=r(7762);function i(e,t,r=s.A){return t||(t=new r),t===e||t.destroyed||(t.removeAll(),(i=e)&&(Array.isArray(i)||"items"in i&&Array.isArray(i.items))?t.addMany(e):e&&t.add(e)),t;var i}function a(e){return e}},81583(e,t,r){r.d(t,{L:()=>o,g:()=>n});var s=r(60999),i=r(7762),a=r(92474);async function n(e,t){return await e.load(),o(e,t)}async function o(e,t){const r=[],n=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?n(...t):i.A.isCollection(t)?t.forEach(e=>n(e)):(0,a.Zm)(t)&&r.push(t))};t(n);let o=null;if(await(0,s.Tj)(r,async e=>{const t=await(0,s.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||o||(o=t)}),o)throw o.error;return e}},36708(e,t,r){r.d(t,{C_:()=>u,OH:()=>h,Vh:()=>m,on:()=>y,pc:()=>b,wB:()=>l,z7:()=>c});var s=r(37955),i=r(36563),a=r(97768),n=r(17676),o=r(14012);function l(e,t,r={}){return d(e,t,r,p)}function c(e,t,r={}){return d(e,t,r,g)}function d(e,t,r={},s){let i=null;const n=r.once?(e,r)=>{s(e)&&((0,a.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,o.Cn)(e,n,r.sync,r.equals),r.initial){const t=e();n(t,t)}return i}function y(e,t,r,n={}){let o=null,c=null,d=null;function y(){o&&c&&(c.remove(),n.onListenerRemove?.(o),o=null,c=null)}function u(e){n.once&&n.once&&(0,a.xt)(d),r(e)}const p=l(e,(e,r)=>{y(),(0,s.wb)(e)&&(o=e,c=(0,s.on)(e,t,u),n.onListenerAdd?.(e))},{sync:n.sync,initial:!0});return d=(0,i.hA)(()=>{p.remove(),y()}),d}function u(e,t){return function(e,t,r){if((0,n.G4)(r))return Promise.reject((0,n.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let o=null;function l(){o=(0,a.xt)(o)}return new Promise((s,a)=>{o=(0,i.vE)([(0,n.u7)(r,()=>{l(),a((0,n.NK)())}),d(e,e=>{l(),s(e)},{sync:!1,once:!0},t??p)])})}(e,g,t)}function p(e){return!0}function g(e){return!!e}r(80559);const h={sync:!0},m={initial:!0},b={sync:!0,initial:!0}},4146(e,t,r){r.d(t,{A:()=>f});var s=r(5482),i=r(11254),a=r(49186),n=r(65529),o=r(4902),l=r(92474),c=r(53966),d=r(17676),y=r(84952),u=r(91429),p=r(5443),g=r(16930),h=r(92602),m=r(79677);let b=0,f=class extends((0,n.Zt)((0,o.s)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new p.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([r.e(812),r.e(7982)]).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:s}=await Promise.all([r.e(812),r.e(5613),r.e(5710)]).then(r.bind(r,45613));try{return await s(t)}catch(e){const r=t?.portalItem,s=r?.id||"unset",i=r?.portal?.url||h.A.portalUrl;throw c.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+s+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,d.zf)(e)||c.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,y.An)(this.url)}createLayerView(e,t){return Promise.reject(new a.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new a.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,s.Cg)([(0,u.MZ)({type:String})],f.prototype,"attributionDataUrl",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"effectiveVisible",null),(0,s.Cg)([(0,u.MZ)({type:p.A})],f.prototype,"fullExtent",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"hasAttributionData",null),(0,s.Cg)([(0,u.MZ)({type:String,clonable:!1})],f.prototype,"id",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,nonNullable:!0})],f.prototype,"legendEnabled",void 0),(0,s.Cg)([(0,u.MZ)({type:["show","hide","hide-children"]})],f.prototype,"listMode",void 0),(0,s.Cg)([(0,u.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],f.prototype,"opacity",void 0),(0,s.Cg)([(0,u.MZ)({clonable:!1})],f.prototype,"parent",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"parsedUrl",null),(0,s.Cg)([(0,u.MZ)({type:Boolean,readOnly:!0})],f.prototype,"persistenceEnabled",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean})],f.prototype,"popupEnabled",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean})],f.prototype,"attributionVisible",void 0),(0,s.Cg)([(0,u.MZ)({type:g.A})],f.prototype,"spatialReference",void 0),(0,s.Cg)([(0,u.MZ)({type:String})],f.prototype,"title",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0,json:{read:!1}})],f.prototype,"type",void 0),(0,s.Cg)([(0,u.MZ)()],f.prototype,"url",void 0),(0,s.Cg)([(0,u.MZ)({type:m.A})],f.prototype,"visibilityTimeExtent",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,nonNullable:!0})],f.prototype,"visible",void 0),f=(0,s.Cg)([(0,u.$K)("esri.layers.Layer")],f)},77548(e,t,r){r.d(t,{Gh:()=>I,tk:()=>T,BR:()=>S,p2:()=>L,qd:()=>M,wI:()=>w,G$:()=>C,$x:()=>A,Ov:()=>m,UC:()=>u,W_:()=>b,OP:()=>_,TU:()=>h,XX:()=>g,jy:()=>f});var s=r(70333),i=r(11254),a=r(7762),n=(r(84952),r(36563)),o=r(36708),l=r(4146);const c=new WeakMap;function d(e){return!e.destroyed&&(c.has(e)||e.addHandles([(0,o.wB)(()=>{const{parent:t}=e;return!!(t&&t instanceof l.A)&&("catalog-dynamic-group"===t.type||d(t))},t=>c.set(e,t),o.pc),(0,n.hA)(()=>c.delete(e))]),c.get(e))}function y(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function u(e){return y(e,"knowledge-graph-sublayer")}function p(e){const t=e.parent;return function(e){return"group"===e?.type}(t)&&t.tables.includes(e)}r(16215);const g={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function h(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function m(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function b(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function f(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"oriented-imagery"===e.type}(e)||function(e){return y(e,"feature")}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}function v(e){const t=e?.type;return"binning"===t||"cluster"===t}function L(e,t){if(!f(e))return;const r=t?.graphic,s=e.featureReduction;if(r){if(r.isAggregate){const e=r.origin;return e&&"featureReductionProvider"in e&&s?v(s)?s:null:void 0}return e}return t?.checkFeatureReduction&&s?v(s)?s:null:e}async function w(e,t){const r=s.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const a=e.toLowerCase().indexOf("/rest/services");if(-1===a)return null;const n=`${e.slice(0,a)}/rest/info`,o=null!=t?t.signal:null,{data:l}=await(0,i.A)(n,{query:{f:"json"},responseType:"json",signal:o});return l?.owningSystemUrl||null}function S(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function T(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function M(e){const t=new a.A;for(const r of e.allLayers.concat(e.allTables))d(r)||p(r)||("charts"in r&&t.push(r),"subtype-group"===r.type&&t.push(...r.sublayers));return t}function A(e,t){return null}function C(e){return null}function _(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function I(e,t){if(!t||!_(e))return;const r=(e.url,null);r&&(e.url=r)}},73133(e,t,r){r.d(t,{j:()=>s});const s=(0,r(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"})},43281(e,t,r){r.d(t,{H:()=>n,q:()=>a});var s=r(2741),i=r(10838);async function a(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,r=await(0,i.ud)("esri/t9n/basemaps");return r[e]||r[t]}const n={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-hillshade",url:"https://services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1},{id:"terrain-base",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/33064a20de0c48d2bb61efa8faca93a8/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Terrain Base"},{id:"terrain-reference",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/14fbc125ccc9488888b014db09f35f67/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Reference Reference",isReference:!0}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/94329802cbfa44a18f423e6f1a0b875c/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/d309c87e9f8c46a0af638d0533193e9b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/dbcfc899c38945d5b42416329e31df2a/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/204b38a0b9b24b0fac373167db16c5cd/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/4694cc30a67a434f80d09e557e74413d/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Style",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return(0,s.s)("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/75610658508d4d6e99298abaac8aff62/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Canvas",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_DarkLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"84f9f68a3b6e4f68b09ddf9cdef8cb9f",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/6a8f24366a8b42abb2535d8f14777768/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation (Dark)"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"0281b25f75b24ca9b8835c6285cef9c2",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/9a8a322ab26f412fa4c299039f441ad7/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets (Dark)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"da21f8d16bcd4bd392a06212e121de32",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/e6b230fe483b43f390a7e767731d52d6/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Canvas"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_LightLabels_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",layerType:"ArcGISSceneServiceLayer"}]}}},16215(e,t,r){r.d(t,{S:()=>i,Y:()=>s});const s=Symbol("BasemapInstance");function i(e){return null!=e&&"object"==typeof e&&s in e}},79677(e,t,r){r.d(t,{A:()=>u});var s,i=r(5482),a=r(25482),n=r(88930),o=r(91429),l=r(98623),c=r(10184),d=r(36005),y=r(43937);let u=class extends a.o{static{s=this}static get allTime(){return p}static get empty(){return g}static fromArray(e){return new s({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===s&&r===i}expandTo(e,t=l.qU){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let r=this.start;r&&(r=(0,n.lL)(r,new c.A({value:1,unit:e}),t));let i=this.end;if(i){const r=(0,n.lL)(i,new c.A({value:1,unit:e}),t);i=i.getTime()===r.getTime()?r:(0,n.S1)(r,1,e,t)}return new s({start:r,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,a=e.end?.getTime()??1/0;let n,o;return i>=t&&i<=r?n=i:t>=i&&t<=a&&(n=t),r>=i&&r<=a?o=r:a>=t&&a<=r&&(o=a),null==n||null==o||isNaN(n)||isNaN(o)?s.empty:new s({start:n===-1/0?null:new Date(n),end:o===1/0?null:new Date(o)})}offset(e,t,r=l.qU){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();const i=new s,{start:a,end:o}=this;return null!=a&&(i.start=(0,n.S1)(a,e,t,r)),null!=o&&(i.end=(0,n.S1)(o,e,t,r)),i}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:r})}};(0,i.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],u.prototype,"end",void 0),(0,i.Cg)([(0,d.w)("end")],u.prototype,"readEnd",null),(0,i.Cg)([(0,y.K)("end")],u.prototype,"writeEnd",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],u.prototype,"isAllTime",null),(0,i.Cg)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],u.prototype,"isEmpty",null),(0,i.Cg)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],u.prototype,"start",void 0),(0,i.Cg)([(0,d.w)("start")],u.prototype,"readStart",null),(0,i.Cg)([(0,y.K)("start")],u.prototype,"writeStart",null),u=s=(0,i.Cg)([(0,o.$K)("esri.time.TimeExtent")],u);const p=new u,g=new u({start:void 0,end:void 0})},10184(e,t,r){r.d(t,{A:()=>d});var s=r(5482),i=r(69540),a=r(25482),n=r(88930),o=r(91429),l=r(73133),c=r(93223);let d=class extends((0,i.OU)(a.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,n.t)(this.value,this.unit,"milliseconds")}};(0,s.Cg)([(0,c.e)(l.j,{nonNullable:!0})],d.prototype,"unit",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0},nonNullable:!0})],d.prototype,"value",void 0),d=(0,s.Cg)([(0,o.$K)("esri.time.TimeInterval")],d)},751(e,t,r){r.d(t,{CJ:()=>g});var s=r(4718),i=r(93637),a=r(67124),n=r(77548),o=r(59923);const l=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wcs","wms","wmts"]),c=new Set(["integrated-mesh-3dtiles"]),d=new Set(["catalog","csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","knowledge-graph","map-image","map-notes","media","ogc-feature","oriented-imagery","parquet","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","video","web-tile","wcs","wfs","wms","wmts"]),y=new Set([...d,"link-chart"]);function u(e,t){if(t.restrictedWebMapWriting){const r=function(e){switch(e.layerContainerType){case"basemap-base-layers":return l;case"basemap-ground-layers":return c;case"operational-layers":return"link-chart"===e.origin?y:d;default:return null}}(t);return null==r||r.has(e.type)&&!(0,n.Ov)(e)}return!0}function p(e,t){"maxScale"in e&&(t.maxScale=(0,a.B)(e.maxScale)??void 0),"minScale"in e&&(t.minScale=(0,a.B)(e.minScale)??void 0)}function g(e,t,r){if(!e.persistenceEnabled)return null;if(!("write"in e)||!e.write)return(0,o.U4)(r,e),null;if((0,n.Ov)(e)&&!e.isTable)t=e.resourceInfo;else if(u(e,r)){const t={};return e.write(t,r)?t:null}return null!=t&&function(e,t){if(function(e,t){if(t)if((0,n.Ov)(e)){const r=(0,i.wc)("featureCollection.layers",t),s=r?.[0]?.layerDefinition;s&&p(e,s)}else"group"!==e.type&&p(e,t)}(e,t),t&&(t.id=e.id,"blendMode"in e&&(t.blendMode=e.blendMode,"normal"===t.blendMode&&delete t.blendMode),t.opacity=(0,a.B)(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&"wmts"!==e.type))if((0,n.Ov)(e)){const r=t.featureCollection;r&&(r.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}(e,t=(0,s.o8)(t)),t}}}]);