@arcgis/core 6.0.0-next.42 → 6.0.0-next.43

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 (489) hide show
  1. package/Basemap.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebDocument2D.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/analysis/ElevationProfile/ElevationProfileLineScene.d.ts +1 -0
  7. package/analysis/ElevationProfileAnalysis.d.ts +15 -0
  8. package/analysis/LineOfSightAnalysis.d.ts +6 -1
  9. package/analysis/ShadowCastAnalysis.d.ts +18 -22
  10. package/analysis/ShadowCastAnalysis.js +1 -1
  11. package/analysis/ViewshedAnalysis.d.ts +6 -1
  12. package/applications/Components/analysisUtils.d.ts +6 -0
  13. package/applications/Components/analysisUtils.js +1 -1
  14. package/arcade/ArcadeModuleResolver.js +1 -1
  15. package/arcade/arcadeCompiler.js +1 -1
  16. package/arcade/featureset/actions/Adapted.js +1 -1
  17. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  18. package/arcade/featureset/support/FeatureSet.js +1 -1
  19. package/arcade/featureset/support/shared.js +1 -1
  20. package/arcade/featureset/support/sqlUtils.js +1 -1
  21. package/arcade/functions/knowledgegraph.js +1 -1
  22. package/arcade/functions/maths.js +1 -1
  23. package/assets/esri/core/workers/RemoteClient.js +1 -1
  24. package/assets/esri/core/workers/chunks/{2f54e4feb554c1a7b9c4.js → 02debe67e6fef9d88bdd.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{bd046399e05e759e0bc2.js → 035204000954973b0ebc.js} +1 -1
  26. package/assets/esri/core/workers/chunks/05225506fdba0c827407.js +1 -0
  27. package/assets/esri/core/workers/chunks/{4c73c493dabe949c2512.js → 077b755688346e0dc8d3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/0c1d8e0c2eae21f97fc0.js +1 -0
  29. package/assets/esri/core/workers/chunks/105865a4d8cb4ddf8a8a.js +1 -0
  30. package/assets/esri/core/workers/chunks/{afe3e89737fb45189a99.js → 14ed0c34b910eba3434e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{f67b37253d6d05d1e339.js → 14ef986665b4a1f6ccdc.js} +1 -1
  32. package/assets/esri/core/workers/chunks/158cbf4075d3eca83a6a.js +1 -0
  33. package/assets/esri/core/workers/chunks/{a03f15f2cbc3fed291c2.js → 15f2b27b8edc0d53e399.js} +1 -1
  34. package/assets/esri/core/workers/chunks/181d24ced5ef6b1f959b.js +1 -0
  35. package/assets/esri/core/workers/chunks/18dbee576b7b9dbe69fb.js +1 -0
  36. package/assets/esri/core/workers/chunks/1aebb8fe0692058bf2fb.js +1 -0
  37. package/assets/esri/core/workers/chunks/1cdb55d9a5ab1a5e3f08.js +1 -0
  38. package/assets/esri/core/workers/chunks/{cf2e5f827cea7d7319ce.js → 1e5c5029b0653047a769.js} +1 -1
  39. package/assets/esri/core/workers/chunks/20db6e844708d3e71437.js +1 -0
  40. package/assets/esri/core/workers/chunks/21a4c3d8265aca775616.js +1 -0
  41. package/assets/esri/core/workers/chunks/23fff0505e02fd364909.js +1 -0
  42. package/assets/esri/core/workers/chunks/286e3e050b29e6158e6f.js +1 -0
  43. package/assets/esri/core/workers/chunks/29ef9d357e30082d267a.js +1 -0
  44. package/assets/esri/core/workers/chunks/29feef121b0916fb90bf.js +1 -0
  45. package/assets/esri/core/workers/chunks/2ef91e8da260454f46d8.js +1 -0
  46. package/assets/esri/core/workers/chunks/32b9bedd4bb0504f0b1d.js +1 -0
  47. package/assets/esri/core/workers/chunks/{279089a6a3f08022c678.js → 361d620b3f91868b1490.js} +1 -1
  48. package/assets/esri/core/workers/chunks/37c16e20f022ca27cdae.js +1 -0
  49. package/assets/esri/core/workers/chunks/380aefa522dfeccb8c65.js +1 -0
  50. package/assets/esri/core/workers/chunks/394ae3199c78a94c6a2a.js +1 -0
  51. package/assets/esri/core/workers/chunks/{fdd2b35388f9fe42b623.js → 3a90b6eafa92f1a68ac5.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{6a65fc1a2931230fe994.js → 3bb1e06861cd0563ed9f.js} +1 -1
  53. package/assets/esri/core/workers/chunks/3f92afa58c895bf87e62.js +1 -0
  54. package/assets/esri/core/workers/chunks/422784ceae0d511868a0.js +1 -0
  55. package/assets/esri/core/workers/chunks/44782e8318dc47cb08a0.js +1 -0
  56. package/assets/esri/core/workers/chunks/{5882f349f3771868e67f.js → 4521f72ab0ea872e5d7c.js} +1 -1
  57. package/assets/esri/core/workers/chunks/45b5a61c4e9fbd9ca0b3.js +1 -0
  58. package/assets/esri/core/workers/chunks/47af220003adfca2167e.js +1 -0
  59. package/assets/esri/core/workers/chunks/487500443a6037d3599f.js +1 -0
  60. package/assets/esri/core/workers/chunks/4a4fab74442c3d914505.js +1 -0
  61. package/assets/esri/core/workers/chunks/4a8903fb1a5d30a68df9.js +1 -0
  62. package/assets/esri/core/workers/chunks/4d818b231e6d1fa73cc5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{e0cf6e1e21d0ee739009.js → 4e03aa5518d46a36661c.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{1a614bac5db42c6263f8.js → 4fe10650ba3cd30aa9a2.js} +1 -1
  65. package/assets/esri/core/workers/chunks/50b8b1cce0a5f77c8372.js +1 -0
  66. package/assets/esri/core/workers/chunks/5470a29a69010c8361c4.js +1 -0
  67. package/assets/esri/core/workers/chunks/564d7f2e58fbc16853c0.js +1 -0
  68. package/assets/esri/core/workers/chunks/5c2e79f2ca401741bf3e.js +1 -0
  69. package/assets/esri/core/workers/chunks/5c9ab86bec07264dc9f2.js +1 -0
  70. package/assets/esri/core/workers/chunks/{04d55ed51e8b2683c4b4.js → 5d908a823b324bafda1e.js} +1 -1
  71. package/assets/esri/core/workers/chunks/5e6d6676a5c47c0e132a.js +1 -0
  72. package/assets/esri/core/workers/chunks/5fd4d3cb3c9350131a59.js +1 -0
  73. package/assets/esri/core/workers/chunks/60637f38159e9bf68d4e.js +1 -0
  74. package/assets/esri/core/workers/chunks/69b73251257088ce7099.js +1 -0
  75. package/assets/esri/core/workers/chunks/6cd17c3a254a0b5c2476.js +1 -0
  76. package/assets/esri/core/workers/chunks/{06102715e9a8f218e07c.js → 6f3732e7ba2d031ba789.js} +1 -1
  77. package/assets/esri/core/workers/chunks/7191ab31fa040a7c561e.js +1 -0
  78. package/assets/esri/core/workers/chunks/71ba848c3352ea3ff96f.js +1 -0
  79. package/assets/esri/core/workers/chunks/76dc8e3264a456f33e61.js +1 -0
  80. package/assets/esri/core/workers/chunks/77d80b6d65d761214a7c.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e2430bc3a1edeb5c3266.js → 78a69594c82d37aecbfb.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{787c1a8bda7d745633f2.js → 81b9894e81cce3490984.js} +1 -1
  83. package/assets/esri/core/workers/chunks/85cd525705eec6803dd3.js +1 -0
  84. package/assets/esri/core/workers/chunks/863f04cacdc843d3f208.js +1 -0
  85. package/assets/esri/core/workers/chunks/8766832c7253557da8fe.js +1 -0
  86. package/assets/esri/core/workers/chunks/87992070008812f8ae6f.js +1 -0
  87. package/assets/esri/core/workers/chunks/892fd2c3533ce46a9258.js +1 -0
  88. package/assets/esri/core/workers/chunks/89b9d716d96135d4f057.js +1 -0
  89. package/assets/esri/core/workers/chunks/{4b2d392ad8e381bfd6b3.js → 89e9ebc8d5c1022cb265.js} +1 -1
  90. package/assets/esri/core/workers/chunks/8b38798ac6d774185238.js +1 -0
  91. package/assets/esri/core/workers/chunks/8b53369cace136ed1329.js +1 -0
  92. package/assets/esri/core/workers/chunks/8ba4f5e1912edf397947.js +1 -0
  93. package/assets/esri/core/workers/chunks/{987424121cf30b0f3c50.js → 8d3e92a3367a3ddc02bd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/8e7a3b1b088c160f4db7.js +1 -0
  95. package/assets/esri/core/workers/chunks/8f4fba4d2339c91c8b3f.js +1 -0
  96. package/assets/esri/core/workers/chunks/{45aaefbdffe5e15dfb24.js → 919a6aedf38e9631ee09.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{487c46d5245cfb35c4bb.js → 921917e53bac82693ec8.js} +1 -1
  98. package/assets/esri/core/workers/chunks/92809b209b68abcb97ee.js +1 -0
  99. package/assets/esri/core/workers/chunks/{beccbfff549902733c4e.js → 9869c696e6321c8db0a9.js} +1 -1
  100. package/assets/esri/core/workers/chunks/98957dba728c93506e50.js +1 -0
  101. package/assets/esri/core/workers/chunks/99ffb839407cb3c26ad8.js +1 -0
  102. package/assets/esri/core/workers/chunks/9b517c8d26a86dedb921.js +1 -0
  103. package/assets/esri/core/workers/chunks/{cb2329d1ea72ce5cc057.js → 9c3f56f22e9baa80a387.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{1860104c2b33f68785dd.js → 9d0976f5979c4f9154dc.js} +1 -1
  105. package/assets/esri/core/workers/chunks/9fe1812aad6e566aea31.js +1 -0
  106. package/assets/esri/core/workers/chunks/a1602995ef96beb7df29.js +1 -0
  107. package/assets/esri/core/workers/chunks/{dff845574c0037a1dca6.js → a332e31165b65a6fb92e.js} +1 -1
  108. package/assets/esri/core/workers/chunks/a553478664a688f32488.js +1 -0
  109. package/assets/esri/core/workers/chunks/a7937b06f4b0860c7671.js +1 -0
  110. package/assets/esri/core/workers/chunks/{1980fd7ae1617ef4d19d.js → a95186214f1206efd8ed.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{853563c66ecf58d53d36.js → ab60e8fbe0f92340616a.js} +1 -1
  112. package/assets/esri/core/workers/chunks/acea0946049136578354.js +1 -0
  113. package/assets/esri/core/workers/chunks/{342a97974a78007b25e0.js → ad94f54b4c88b3a047bc.js} +1 -1
  114. package/assets/esri/core/workers/chunks/ae29fec228e70a93ced1.js +1 -0
  115. package/assets/esri/core/workers/chunks/ae6dc159be974ca0e8da.js +1 -0
  116. package/assets/esri/core/workers/chunks/ae70972bf88d586fd453.js +1 -0
  117. package/assets/esri/core/workers/chunks/b021fa4654ede1d04279.js +1 -0
  118. package/assets/esri/core/workers/chunks/b03f32f02858244c6cd0.js +1 -0
  119. package/assets/esri/core/workers/chunks/b2d922ecc2c4899dbee1.js +1 -0
  120. package/assets/esri/core/workers/chunks/b42e50ec6b819f669400.js +1 -0
  121. package/assets/esri/core/workers/chunks/b6a82775b83d20599635.js +1 -0
  122. package/assets/esri/core/workers/chunks/b6d365b9198b74b05338.js +1 -0
  123. package/assets/esri/core/workers/chunks/{48c6230b8a6d3a8a7906.js → bc21241bc9acb83d1b1c.js} +1 -1
  124. package/assets/esri/core/workers/chunks/bd02d927b0b4991b61c5.js +1 -0
  125. package/assets/esri/core/workers/chunks/bdf1c4c038d556527483.js +1 -0
  126. package/assets/esri/core/workers/chunks/c1273f14a5ef3d81de0d.js +1 -0
  127. package/assets/esri/core/workers/chunks/c752f1e732bb019f657d.js +1 -0
  128. package/assets/esri/core/workers/chunks/{3f74c61359b4bd6dcf00.js → c7f49493bd548d5dc1e0.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{36bafcc29ac133a05558.js → c86d3af148b28ded5875.js} +10 -10
  130. package/assets/esri/core/workers/chunks/{692f0093c444fcc752b5.js → cadd60fa4370284c7ae3.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{d5e251cddd41d643510c.js → cb62326b6526cde429c1.js} +1 -1
  132. package/assets/esri/core/workers/chunks/cd8304b1db83d48c57db.js +1 -0
  133. package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
  134. package/assets/esri/core/workers/chunks/d00dd961a5b79f563123.js +1 -0
  135. package/assets/esri/core/workers/chunks/d893c3bb093104d3db95.js +1 -0
  136. package/assets/esri/core/workers/chunks/d8fb1d9da16492574a11.js +1 -0
  137. package/assets/esri/core/workers/chunks/{520f499d79fa71f262c7.js → dd7e4c94a88452425750.js} +1 -1
  138. package/assets/esri/core/workers/chunks/ddb4689624d091922471.js +1 -0
  139. package/assets/esri/core/workers/chunks/df32a3fe81d60f0d7462.js +1 -0
  140. package/assets/esri/core/workers/chunks/dfc6b33f51dc81f3a7be.js +1 -0
  141. package/assets/esri/core/workers/chunks/e55934eb4a17a5b24c94.js +1 -0
  142. package/assets/esri/core/workers/chunks/{5473409fee59db80f87d.js → e5bdfef7c2cc5354be52.js} +1 -1
  143. package/assets/esri/core/workers/chunks/e8cdec961e9cff1cb73b.js +1 -0
  144. package/assets/esri/core/workers/chunks/{446d172834f8675f1202.js → eaf720dfdf6ceca31249.js} +1 -1
  145. package/assets/esri/core/workers/chunks/ef274db3fa260eadf371.js +1 -0
  146. package/assets/esri/core/workers/chunks/efca82a4dc494f57380b.js +1 -0
  147. package/assets/esri/core/workers/chunks/f05990e6fb378e2e1a3b.js +1 -0
  148. package/assets/esri/core/workers/chunks/f0fc89cdf50a40913c02.js +1 -0
  149. package/assets/esri/core/workers/chunks/{8b5dcc4282772bf6b675.js → f11eaab5354cc6aa9569.js} +1 -1
  150. package/assets/esri/core/workers/chunks/f1c2f7c7ce4bd4096eb0.js +1 -0
  151. package/assets/esri/core/workers/chunks/f4e63c5f82b8c2bbfacb.js +1 -0
  152. package/assets/esri/core/workers/chunks/f86ff791a10c802879ec.js +1 -0
  153. package/assets/esri/core/workers/chunks/{7452b5ae971a9ff2e6e9.js → fdffefd7de540272a8a6.js} +1 -1
  154. package/assets/esri/core/workers/chunks/fe0248af95d3f37e099e.js +1 -0
  155. package/chunks/languageUtils.js +1 -1
  156. package/config.js +1 -1
  157. package/core/Accessor.js +1 -1
  158. package/core/Collection.js +1 -1
  159. package/core/LRUCache.js +1 -1
  160. package/core/MapUtils.js +1 -1
  161. package/core/Version.js +1 -1
  162. package/core/asyncUtils.js +1 -1
  163. package/core/fontUtils.js +1 -1
  164. package/core/has.js +1 -1
  165. package/core/sql/SqlInterval.js +1 -1
  166. package/core/sql/WhereClause.js +1 -1
  167. package/core/sql/writeUtils.js +1 -1
  168. package/core/sql.js +1 -1
  169. package/core/urlUtils.js +1 -1
  170. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  171. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  172. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  173. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  174. package/geometry/Point.js +1 -1
  175. package/geometry/Polygon.js +1 -1
  176. package/geometry/SpatialReference.js +1 -1
  177. package/geometry/support/webMercatorUtils.js +1 -1
  178. package/kernel.js +1 -1
  179. package/layers/FeatureLayer.js +1 -1
  180. package/layers/GeoJSONLayer.d.ts +5 -1
  181. package/layers/GeospatialPDFLayer.js +1 -1
  182. package/layers/KnowledgeGraphLayer.js +1 -1
  183. package/layers/LineOfSightLayer.d.ts +6 -1
  184. package/layers/LinkChartLayer.js +1 -1
  185. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  186. package/layers/SubtypeGroupLayer.js +1 -1
  187. package/layers/TileLayer.js +1 -1
  188. package/layers/VectorTileLayer.d.ts +53 -0
  189. package/layers/VectorTileLayer.js +1 -1
  190. package/layers/VideoLayer.js +1 -1
  191. package/layers/ViewshedLayer.d.ts +6 -1
  192. package/layers/VoxelLayer.js +1 -1
  193. package/layers/effects/jsonUtils.js +1 -1
  194. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  195. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  196. package/layers/graphics/data/QueryEngineResult.js +1 -1
  197. package/layers/graphics/data/projectionSupport.js +1 -1
  198. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  199. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  200. package/layers/graphics/sources/geojson/geojson.js +1 -1
  201. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  202. package/layers/graphics/sources/support/QueryTask.js +1 -1
  203. package/layers/graphics/sources/support/uploads.js +1 -1
  204. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  205. package/layers/mixins/refresh.js +1 -1
  206. package/layers/ogc/ogcFeatureUtils.js +1 -1
  207. package/layers/ogc/wfsUtils.js +1 -1
  208. package/layers/parquet.js +1 -1
  209. package/layers/raster/datasets/BaseRaster.js +1 -1
  210. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  211. package/layers/raster/datasets/TIFFRaster.js +1 -1
  212. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  213. package/layers/raster/formats/Lerc.js +1 -1
  214. package/layers/support/ClientSideConnection.js +1 -1
  215. package/layers/support/ElevationSampler.js +1 -1
  216. package/layers/support/MultidimensionalSubset.js +1 -1
  217. package/layers/support/SpriteSource.js +1 -1
  218. package/layers/support/TileInfo.js +1 -1
  219. package/layers/support/fieldUtils.js +1 -1
  220. package/layers/support/infoFor3D.js +1 -1
  221. package/layers/support/vectorTileLayerLoader.js +1 -1
  222. package/layers/support/wmsUtils.js +1 -1
  223. package/layers/support/wmtsUtils.js +1 -1
  224. package/layers/video/videoUtils.js +1 -1
  225. package/libs/lyr3d/Lyr3DModule.js +1 -1
  226. package/linkChart/utils.js +1 -1
  227. package/networks/support/Circuit.js +1 -1
  228. package/networks/support/CircuitSection.js +1 -1
  229. package/package.json +2 -2
  230. package/portal/Portal.js +1 -1
  231. package/portal/PortalItemResource.js +1 -1
  232. package/portal/PortalQueryParams.js +1 -1
  233. package/renderers/HeatmapRenderer.js +1 -1
  234. package/renderers/UniqueValueRenderer.js +1 -1
  235. package/rest/knowledgeGraphService.js +1 -1
  236. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  237. package/rest/query/operations/queryAttachments.js +1 -1
  238. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  239. package/symbols/cim/types.d.ts +15 -11
  240. package/symbols/support/previewSymbol3D.js +1 -1
  241. package/tables/support/templateUtils.js +1 -1
  242. package/views/2d/engine/vectorTiles/SourceLayerData.js +1 -1
  243. package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
  244. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  245. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  246. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  247. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  248. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  249. package/views/2d/engine/vectorTiles/VectorTileSourceData.js +2 -0
  250. package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
  251. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  252. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  253. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  254. package/views/2d/engine/vectorTiles/style/Filter.js +1 -1
  255. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +1 -1
  256. package/views/2d/engine/vectorTiles/style/StyleProperty.js +1 -1
  257. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  258. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
  259. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +4 -4
  260. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  261. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  262. package/views/2d/layers/features/Processor.js +1 -1
  263. package/views/2d/layers/features/support/TileStore.js +1 -1
  264. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  265. package/views/2d/tiling/TileKey.js +1 -1
  266. package/views/2d/tiling/TileStrategy.js +1 -1
  267. package/views/3d/analysis/Dimension/LengthDimensionComputation.js +1 -1
  268. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  269. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  270. package/views/3d/analysis/images/generateTextures.js +1 -1
  271. package/views/3d/environment/EnvironmentView.js +1 -1
  272. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  273. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  274. package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
  275. package/views/3d/layers/I3SMeshView3D.js +1 -1
  276. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  277. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  278. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  279. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  280. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  281. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  282. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  283. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  284. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  285. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  286. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  287. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  288. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  289. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  290. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  291. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  292. package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
  293. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  294. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  295. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  296. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  297. package/views/3d/state/ConstraintsManager.js +1 -1
  298. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  299. package/views/3d/support/QualityProfile.js +1 -1
  300. package/views/3d/support/TextureCollection.js +1 -1
  301. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  302. package/views/3d/terrain/TerrainRenderer.js +1 -1
  303. package/views/3d/terrain/Tile.js +1 -1
  304. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  305. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  306. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js +1 -1
  307. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  308. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
  309. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  310. package/views/3d/webgl-engine/lib/CutFill.js +1 -1
  311. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  312. package/views/3d/webgl-engine/lib/TextureRepository.js +1 -1
  313. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  314. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  315. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  316. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  317. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  318. package/views/3d/webgl-engine/materials/intersectWithPolygonOffset.js +1 -1
  319. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  320. package/views/SceneView.js +1 -1
  321. package/views/SelectionManager.js +1 -1
  322. package/views/analysis/ElevationProfile/ElevationProfileChart.js +2 -2
  323. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  324. package/views/draw/DrawAction.js +1 -1
  325. package/views/draw/support/PluginContext.js +1 -1
  326. package/views/interactive/sketch/normalizedPoint.js +1 -1
  327. package/views/interactive/tooltip/fields/TooltipFieldElevation.js +1 -1
  328. package/views/interactive/tooltip/fields/TooltipFieldOrientation.js +1 -1
  329. package/views/interactive/tooltip/fields/TooltipFieldSize.js +1 -1
  330. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  331. package/widgets/Attachments.js +1 -1
  332. package/widgets/Attribution/AttributionViewModel.js +1 -1
  333. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  334. package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
  335. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  336. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
  337. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  338. package/widgets/BatchAttributeForm.js +1 -1
  339. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  340. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  341. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  342. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  343. package/widgets/CatalogLayerList.js +1 -1
  344. package/widgets/Compass/CompassViewModel.js +1 -1
  345. package/widgets/CoordinateConversion/support/Format.js +1 -1
  346. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  347. package/widgets/Daylight/DaylightViewModel.js +1 -1
  348. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  349. package/widgets/Editor/support/SketchController.js +1 -1
  350. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  351. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  352. package/widgets/Expand/ExpandViewModel.js +1 -1
  353. package/widgets/Expand.js +1 -1
  354. package/widgets/Feature/FeatureMedia.js +1 -1
  355. package/widgets/Feature/FeatureViewModel.js +1 -1
  356. package/widgets/Feature.js +1 -1
  357. package/widgets/FeatureForm.js +1 -1
  358. package/widgets/FeatureTemplates.js +1 -1
  359. package/widgets/Features/FeaturesViewModel.js +1 -1
  360. package/widgets/Features.js +1 -1
  361. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  362. package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
  363. package/widgets/Histogram/HistogramViewModel.js +1 -1
  364. package/widgets/Histogram.js +1 -1
  365. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
  366. package/widgets/Home/HomeViewModel.js +1 -1
  367. package/widgets/LayerList/LayerListViewModel.js +1 -1
  368. package/widgets/Legend/LegendViewModel.js +1 -1
  369. package/widgets/Legend/styles/card/CardView.js +1 -1
  370. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  371. package/widgets/Locate/LocateViewModel.js +1 -1
  372. package/widgets/Locate.js +1 -1
  373. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  374. package/widgets/NavigationToggle.js +1 -1
  375. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  376. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  377. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  378. package/widgets/OrientedImageryViewer/support/urlUtils.js +1 -1
  379. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  380. package/widgets/Search.js +1 -1
  381. package/widgets/ShadowCast/DiscreteOptions.js +1 -1
  382. package/widgets/ShadowCast/DurationOptions.js +1 -1
  383. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  384. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  385. package/widgets/Sketch.js +1 -1
  386. package/widgets/Slider/SliderViewModel.js +1 -1
  387. package/widgets/Slider.js +1 -1
  388. package/widgets/TableList/TableListViewModel.js +1 -1
  389. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  390. package/widgets/Weather/WeatherViewModel.js +1 -1
  391. package/widgets/Widget.js +1 -1
  392. package/widgets/Zoom/ZoomViewModel.js +1 -1
  393. package/widgets/support/AnalysisViewModelMixin.js +1 -1
  394. package/widgets/support/GridControls.js +1 -1
  395. package/widgets/support/dateUtils.js +1 -1
  396. package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +0 -1
  397. package/assets/esri/core/workers/chunks/0696fa44a04b99738d7b.js +0 -1
  398. package/assets/esri/core/workers/chunks/091ec4fe83038f3558f4.js +0 -1
  399. package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +0 -1
  400. package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +0 -1
  401. package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +0 -1
  402. package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +0 -1
  403. package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +0 -1
  404. package/assets/esri/core/workers/chunks/1380cec385426673f294.js +0 -1
  405. package/assets/esri/core/workers/chunks/1b24a40c0fa197014873.js +0 -1
  406. package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +0 -1
  407. package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +0 -1
  408. package/assets/esri/core/workers/chunks/1f76f6dcdae9f55389cb.js +0 -1
  409. package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +0 -1
  410. package/assets/esri/core/workers/chunks/247617c0dbae2386ab3b.js +0 -1
  411. package/assets/esri/core/workers/chunks/25657f70c5f04a4ed978.js +0 -1
  412. package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +0 -1
  413. package/assets/esri/core/workers/chunks/2853606099602f73d379.js +0 -1
  414. package/assets/esri/core/workers/chunks/28ed020d9995b6577be5.js +0 -1
  415. package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +0 -1
  416. package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +0 -1
  417. package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +0 -1
  418. package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +0 -1
  419. package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +0 -1
  420. package/assets/esri/core/workers/chunks/4e17665dd9048c300d87.js +0 -1
  421. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +0 -1
  422. package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +0 -1
  423. package/assets/esri/core/workers/chunks/5396b6e99a0546a25d19.js +0 -1
  424. package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +0 -1
  425. package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +0 -1
  426. package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +0 -1
  427. package/assets/esri/core/workers/chunks/60c8eedd06080edab3e3.js +0 -1
  428. package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +0 -1
  429. package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +0 -1
  430. package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +0 -1
  431. package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +0 -1
  432. package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +0 -1
  433. package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +0 -1
  434. package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +0 -1
  435. package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +0 -1
  436. package/assets/esri/core/workers/chunks/69627b2634da64dd885f.js +0 -1
  437. package/assets/esri/core/workers/chunks/6f2e7e663229b223b4df.js +0 -1
  438. package/assets/esri/core/workers/chunks/7390af96250e89194332.js +0 -1
  439. package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +0 -1
  440. package/assets/esri/core/workers/chunks/7e0ed6e8f7b77e43f628.js +0 -1
  441. package/assets/esri/core/workers/chunks/832c887fdc5af4c08cf2.js +0 -1
  442. package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +0 -1
  443. package/assets/esri/core/workers/chunks/8502274806ea52308822.js +0 -1
  444. package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +0 -1
  445. package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +0 -1
  446. package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +0 -1
  447. package/assets/esri/core/workers/chunks/8e6276ddd8d094c61f08.js +0 -1
  448. package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +0 -1
  449. package/assets/esri/core/workers/chunks/90d797ab82d4a68ba32f.js +0 -1
  450. package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +0 -1
  451. package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +0 -1
  452. package/assets/esri/core/workers/chunks/9826baa3c15ea2062669.js +0 -1
  453. package/assets/esri/core/workers/chunks/9c3de54513bf8619271c.js +0 -1
  454. package/assets/esri/core/workers/chunks/a125650edbed802e419a.js +0 -1
  455. package/assets/esri/core/workers/chunks/a18c3cbe505a19d29569.js +0 -1
  456. package/assets/esri/core/workers/chunks/a422a801e55fa125546e.js +0 -1
  457. package/assets/esri/core/workers/chunks/a5f17e9a025ac2b6e1bf.js +0 -1
  458. package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +0 -1
  459. package/assets/esri/core/workers/chunks/a91dc05a6a609d04ed04.js +0 -1
  460. package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +0 -1
  461. package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +0 -1
  462. package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +0 -1
  463. package/assets/esri/core/workers/chunks/acf4737ba509cbd73cce.js +0 -1
  464. package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +0 -1
  465. package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +0 -1
  466. package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +0 -1
  467. package/assets/esri/core/workers/chunks/c0eb27263f608dc3684b.js +0 -1
  468. package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +0 -1
  469. package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +0 -1
  470. package/assets/esri/core/workers/chunks/c8057b47c7c6c02a0bda.js +0 -1
  471. package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +0 -1
  472. package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +0 -1
  473. package/assets/esri/core/workers/chunks/d4c8673ca65df874a7ce.js +0 -1
  474. package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +0 -1
  475. package/assets/esri/core/workers/chunks/dcdf837a452dc0cac582.js +0 -1
  476. package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +0 -1
  477. package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +0 -1
  478. package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +0 -1
  479. package/assets/esri/core/workers/chunks/f190a3124d6d03417d73.js +0 -1
  480. package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +0 -1
  481. package/assets/esri/core/workers/chunks/f6bd7b52745b82ba73dc.js +0 -1
  482. package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +0 -1
  483. package/assets/esri/core/workers/chunks/fc77eb7683e708774168.js +0 -1
  484. package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +0 -1
  485. package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +0 -1
  486. package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +0 -2
  487. package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +0 -2
  488. package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +0 -2
  489. /package/views/2d/engine/vectorTiles/{Feature.js → PbfFeature.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{destroyMaybe as a}from"../core/maybe.js";import o from"../core/ReactiveMap.js";import{watch as s,when as c,on as l,sync as u}from"../core/reactiveUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{formatDate as m}from"../intl/date.js";import{isIntegerField as h}from"../layers/support/fieldUtils.js";import{isString as g}from"../support/guards.js";import ee from"./Widget.js";import{getAttachmentTypeCategory as te,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as v,isImageAttachment as y,getAttachmentFilenameParts as b}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as ne,getMessageString as x,isElementTemplateWithInputType as S,subtypeChangeShouldPrompt as re,flattenInputs as ie}from"./BatchAttributeForm/batchAttributeFormUtils.js";import C from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as w}from"./BatchAttributeForm/css.js";import{makeViewingEditedAttachmentFooterButtons as ae,makeViewingAttachmentFooterButtons as oe,makeCancelFooterButton as T,makeDefaultFooterButtons as E}from"./BatchAttributeForm/interfaceUtils.js";import D from"./BatchAttributeForm/VisibleElements.js";import{isDynamicChoiceController as O,isMultipleChoiceController as k}from"./BatchAttributeForm/inputs/support/controllerUtils.js";import{isGroupInput as A,isFieldInput as j,isTextElementInput as se,isRelationshipElementInput as ce,isAttachmentElementInput as le,isUtilityNetworkAssociationsElementInput as ue,differentValuesString as M,getNormalizedFieldName as N,isGroupedInput as P}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as F,otherChoiceCheckedPlaceholderValue as I,canRestoreMultipleChoiceOtherChoiceDraftValue as L}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as R,RelationshipDetails as z}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{Prompt as B}from"./Editor/components/Prompt.js";import{downloadAttachmentInfo as V}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as H}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as de,getIntlOptionsForField as fe,prepareISOFieldValueForDateComponents as U,prepareUnixFieldValueForDateComponents as W,normalizeTimeOnlyString as G,getISOFieldValueFromDateComponents as pe,getUnixFieldValueFromDateComponents as me}from"./support/dateUtils.js";import{globalCss as K}from"./support/globalCss.js";import{Heading as he}from"./support/Heading.js";import{calciteListFilterProps as ge}from"./support/listUtils.js";import{messageBundle as q,vmEvent as _e,tsx as J}from"./support/widget.js";import{setFocus as ve}from"./support/widgetUtils.js";import{isEmptyValue as Y,ContingentValuesValidationError as X}from"./support/forms/formUtils.js";const Z=`data-element-id`,Q=`data-field-name`;let $=class extends ee{constructor(e){super(e),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new C,this.visibleElements=new D,this.groupDisplay=`all`,this._associationsList=null,this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._dynamicChoiceItemSelections=new WeakSet,this._focusedFieldInput=null,this._pendingSubtypeChoice=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText=``,this._attachmentFileInputMap=new Map,this._prompt=null,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{let e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{let e=this.selectedAttachmentDetails;if(!e?.attachment)return;let t=e.input.getAttachmentEditState(e.attachment).initialName;if(t==null)return;let n=e.input.template.elementId,r=v(e.attachment);this.viewModel.stageRenameAttachment(n,r,t)},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInputFromElement=this._saveInputFromElement.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{n(r.getLogger(this),`Editor`,`arcgis-editor`,{version:`5.0`})})}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([s(()=>this.features.toArray(),()=>{this._dateComponentMap.clear(),F(this.viewModel,{includeDraftValues:!0})}),s(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),F(this.viewModel),this._setFocusableInput()}),s(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),c(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),s(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=``}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),l(()=>this.viewModel,`submit`,()=>{this.valid||this.goToFirstError()}),s(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),u),s(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e)),s(()=>this.groupDisplay,()=>this._syncGroupInputStates())])}loadDependencies(){return Promise.all([H({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),autocomplete:()=>import(`@esri/calcite-components/dist/components/calcite-autocomplete`),"autocomplete-item":()=>import(`@esri/calcite-components/dist/components/calcite-autocomplete-item`),block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),checkbox:()=>import(`@esri/calcite-components/dist/components/calcite-checkbox`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),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`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`)}),R()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=a(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){let{features:e,messages:t,page:n}=this;return t?n===`replacing-attachment`?t.titles.replaceAttachment:n===`viewing-attachment-details`?t.titles.editAttachment:n===`adding-attachments`?t.titles.addAttachments:n===`viewing-attachments`?t.titles.attachments:e.length===1||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:``:``}get effectiveDisabled(){return this.disabledOrReadOnly||this.viewModel.updating}get disabledOrReadOnly(){return this.disabled||this.readOnly}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];let{messages:e,messagesCommon:t,page:n}=this,r=this.effectiveDisabled;if(n===`adding-attachments`||n===`replacing-attachment`)return[];if(n===`viewing-attachment-details`){let t=this.selectedAttachmentDetails,n=t?.input?.getAttachmentEditState(t.attachment);return!t?.input||!n?[]:n.isRenamed||n.isReplaced?ae({doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons,resetOnclick:()=>this._resetSelectedAttachmentChanges(),resetDisabled:this._disableAttachmentModification(t.input)}):oe({deleteDisabled:this._disableAttachmentModification(t.input),deleteOnclick:()=>this._deleteSelectedAttachment(),doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons})}return n===`viewing-associated-features`?T({messages:t,purpose:`cancel-viewing-associated-features`,onclick:()=>this.goBack()}):n===`viewing-associated-layers`?T({messages:t,purpose:`cancel-viewing-associated-layers`,onclick:()=>this.goBack()}):n===`viewing-attachments`||n===`viewing-related-records`?[]:E({disabled:r||!this.valid,formId:this._formId,messages:e,callback:()=>this.submit()})}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return`edit-attributes`}set icon(e){this._overrideIfSome(`icon`,e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return this.viewModel.mode===`batch`||!this.viewModel.activeFeature?!1:!!(this.viewModel.formDescription||this.viewModel.formTitle)}get _associationsEnabled(){let{callbacks:e}=this;return!!(e?.addAssociation||e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord))}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){let e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;let{groupInput:t}=e;t&&(t.open||=!0),this._setFocusableInput(e.input),this.scheduleRender()}render(){return J(`div`,{class:this.classes(w.base,K.widget,K.panel),ondragover:this._handleDragAndDrop,ondrop:this._handleDragAndDrop},this._renderContent(),this._renderAttachmentDialog(),this._prompt?J(B,{...this._prompt,headingLevel:this.headingLevel}):void 0)}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}get test(){return{saveInput:this._saveInput.bind(this),pendingSubtypeChoice:this._pendingSubtypeChoice,touchedInputs:this._touchedInputs}}_setDateTimeTimeZoneMap(e){let{datePart:t,elementId:n}=e.dataset,r=i(this._dateComponentMap,`${n}`,()=>({}));switch(t){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}}_renderContent(){let{messages:e,viewModel:n}=this,{status:r}=n;if(r===`failed`)return n.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:n.maximumFeatureCountWithComplexForms})):n.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:n.maximumFeatureCount})):e.formFailedToLoad;if(n.hasLayersWithContingentValues&&this.viewModel.features.length>1)return this._renderErrorNotice(e.unsupportedContingentValues);if(r===`loading`&&this.visibleElements.loadingIndicator)return J(`calcite-loader`,{key:`loader`,label:this.messagesCommon?.loading});if(this.features.length!==0)return this._renderForm()}_renderErrorNotice(e,t=`warning`){return J(`calcite-notice`,{class:w.noticeError,icon:!0,kind:t,open:!0},J(`div`,{slot:`message`},e))}_renderForm(){return J(`form`,{class:w.form,id:this._formId,inert:!!this._prompt,onsubmit:this._onFormSubmit},this.viewModel.expressionEvaluationFailed&&this.visibleElements.expressionsErrorNotice&&this._renderErrorNotice(this.messages.expressionEvaluationFailed),this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case`adding-attachments`:return this._renderAttachmentAddPage();case`viewing-attachment-details`:case`replacing-attachment`:return this._renderAttachmentDetailPage();case`viewing-attachments`:return this._renderAttachmentListPage();case`viewing-associated-layers`:case`viewing-associated-features`:return this._renderViewingAssociationsPage();case`viewing-related-categories`:case`viewing-related-records`:return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){let{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:n}=e,r;if(!e.submitHasBeenAttempted)return null;if(n.invalidHiddenInputs.length>0){if(r=ne(n,e.mode,this.messages),this.viewModel.mode===`batch`){let e=n.invalidHiddenInputs.filter(e=>e.effectiveVisibilityCode===`hidden:group-visibility-expression:all-features`||e.visibilityCode===`hidden:visibility-expression:all-features`);e.length>0?r+=` (${e.map(e=>e.label).join(`, `)})`:r=null}else r=null}else if(t)return null;return r?this._renderErrorNotice(r,`danger`):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return J(`calcite-notice`,{class:w.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},this.featureFormMessages.disabledForm))}_renderFormHeader(){let{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;let n=e?J(he,{key:`title`,level:this.headingLevel},e):void 0,r=t?J(`p`,{class:w.description,key:`description`},t):void 0;return J(`div`,{class:w.formHeader},n,r)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){if(A(e))return this._renderGroupInput(e);if(j(e))return this._renderLabeledField(e);if(se(e))return this._renderTextComponent(e);if(ce(e))return this._renderRelationshipElementInput(e);if(le(e))return this._renderAttachmentElementInput(e);if(ue(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderGroupInput(e){let{inputs:t,template:n,open:r}=e,i=t.filter(e=>e.visible),a=e.label??``,o=this._focusedFieldInput?.group===e,s=this.groupDisplay===`sequential`;return J(`calcite-block`,{class:this.classes(w.group,s?w.groupSequential:null,o?w.groupActive:null,this.disabled?w.inputDisabled:null),description:e.description??void 0,expandable:!0,expanded:r,heading:a,headingLevel:this.headingLevel,key:`{${n.elementId}-key}`,label:a,onCalciteBlockCollapse:({currentTarget:t})=>{e.open=!1,this._onGroupToggle(t,e)},onCalciteBlockExpand:({currentTarget:t})=>{e.open=!0,this._onGroupToggle(t,e)}},i.map(e=>this._renderInput(e)))}_renderLabeledField(e){let{elementId:n}=e.template,{label:r,required:i,dataType:a}=e,o=i?t(this.messages.requiredFieldLabel,{name:r}):r;return J(`calcite-label`,{"aria-label":o,class:w.label,key:`field--${n}`},J(`div`,{class:w.labelTextContent,key:`labelTextContainer`},r,i?J(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),a===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){let t=this.getCommonInputProps(e),{dataType:n}=e;return O(e.inputController)?this._renderDynamicChoiceComponent({input:e,props:t,controller:e.inputController}):e.domain?.type===`coded-value`?this._renderCodedInputs({input:e,props:t}):k(e.inputController)?this._renderMultipleChoiceComponent({input:e,props:t}):n===`date`?this._renderDateComponents(e,t):(t.disabled=this.disabled,t.readOnly=t.readOnly||this.viewModel.updating,n===`number`?this._renderNumberComponent(e,t):this._renderStringComponent(e,t))}_renderAuxiliaryText(e){let{description:t}=e,n=this._getErrorToDisplay(e),r=n?x(e,n,this.messages):null;return r?J(`calcite-input-message`,{icon:!0,status:`invalid`},r):e.valueIsOutOfDomain&&(this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted)?J(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):t?J(`calcite-input-message`,{class:w.description,icon:!1,status:`idle`},t):null}_renderCodedInputs({input:e,props:t}){let n=e.input?.type??null,r=e.codedValueOptions;switch(n){case`switch`:return this._renderSwitchField({input:e,props:t});case`radio-buttons`:return this._renderRadioButtonGroupComponent({input:e,options:r,props:t});default:return this._renderComboBoxComponent({options:r,props:t,input:e})}}_renderDynamicChoiceComponent({input:e,props:t,controller:n}){let r=n.filteredChoices,i=t.readOnly||t.disabled,a=e.showNoValueLabel||this.messages.empty,o=n.evaluated&&!n.evaluating&&!n.choices.length&&J(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,scale:`s`,slot:`content-bottom`,width:`full`},J(`div`,{slot:`message`},e.showNoValueOptionEnabled?this.messages.noDynamicChoicesWithNoValue:this.messages.noDynamicChoices)),s=t=>{this._saveInput(e,t)},l=(e,t)=>{this._dynamicChoiceItemSelections.delete(n);let r=e.closest(`calcite-autocomplete`);if(r){let e=t==null?``:n.getLabel(t);n.filterValue=``,r.inputValue=e}s(t)},u=({currentTarget:t})=>{let r=t.inputValue??``;n.filterValue=r,!r&&e.value!=null&&s(null)},d=e.showNoValueOptionEnabled?J(`calcite-autocomplete-item`,{disabled:i,heading:a,key:`dynamic-choice-empty`,selected:e.value==null,value:``,onCalciteAutocompleteItemSelect:({currentTarget:e})=>l(e,null),onpointerdown:()=>{this._dynamicChoiceItemSelections.add(n)}}):null,f=t=>{this.addHandles(c(()=>!n.initialEvaluationInProgress,()=>{t.inputValue=e.value===M?this.messages.differentValuesPlaceholder:e.value==null?``:n.inputValue},{once:!0,initial:!0}))};return J(`calcite-autocomplete`,{...t,afterCreate:f,disabled:i&&!n.interactionActive,loading:n.initialEvaluationInProgress,placeholder:e.value==null?a:t.placeholder,value:t.value===M?this.messages.differentValuesPlaceholder:String(t.value),onblur:e=>this._onDynamicChoiceBlur(e,n),onCalciteAutocompleteBeforeOpen:()=>n.beginInteraction(),onCalciteAutocompleteTextInput:u},n.evaluating?J(`calcite-loader`,{key:`dynamic-choice-loader`,label:this.messagesCommon.loading,scale:`s`,slot:`content-top`}):[o,d,...r.map(t=>J(`calcite-autocomplete-item`,{disabled:i,heading:t.name,key:`dynamic-choice-${t.code}`,selected:t.code===e.value,value:String(t.code),onCalciteAutocompleteItemSelect:({currentTarget:e})=>l(e,t.code),onpointerdown:()=>{this._dynamicChoiceItemSelections.add(n)}}))])}_renderMultipleChoiceComponent({input:e,props:t}){let{messages:n}=this,r=this._getMultipleChoiceController(e);if(!r)return null;let{input:i}=r,a=i.includeSelectAllChoices===!0,{checkboxStatesByValue:o,selectAllState:s}=r.selectionState,c=s.checked?n.deselectAllLabel:n.selectAllLabel,l=r.otherChoiceRenderState;return J(`div`,{class:w.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},a?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:s,selectAllLabel:c,handleSelectAllCheckboxChange:t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})}}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})}}),l.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:a,otherChoiceRenderState:l,handleOtherChoiceCheckboxChange:t=>{let{fieldName:n}=l;n&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:n})},handleOtherChoiceInputChange:t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:l.fieldName??void 0})},differentValuesPlaceholder:n.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:n,handleSelectAllCheckboxChange:r}){return J(`calcite-checkbox`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],checked:t.checked,class:w.multipleChoiceSelectAll,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:n,labelText:n,value:`esri_BatchAttributeForm_select_all`,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:n,handleChoiceCheckboxChange:r}){let i=this._getMultipleChoiceController(e);if(!i)return[];let{choices:a}=i;return a.map(e=>{let i=n.get(e.value)??{checked:!1,indeterminate:!1};return J(`calcite-checkbox`,{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t[`aria-invalid`],checked:i.checked,class:t.class,"data-element-id":t[Z],disabled:t.readOnly||t.disabled,indeterminate:i.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:t.onfocus})})}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:n,handleOtherChoiceCheckboxChange:r,handleOtherChoiceInputChange:i,differentValuesPlaceholder:a}){let o=n.label??this.messages.otherOptionLabel;return J(`div`,{class:this.classes(w.multipleChoiceOtherChoice,t?w.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},J(`calcite-checkbox`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],checked:n.checkboxState.checked,class:e.class,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,indeterminate:n.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:o,labelText:o,value:`esri_BatchAttributeForm_other_choice`,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:e.onfocus}),n.checkboxState.checked?J(`calcite-input`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],"aria-label":o,class:w.textElementInput,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,key:`${e.key}-other-choice-input`,maxLength:n.maxLength,placeholder:n.value===M?a:n.hint,status:n.status,type:`text`,value:n.normalizedValue===M?``:n.normalizedValue?String(n.normalizedValue):``,onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>i(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:n=!1}){this._markInputTouched(e);let r=this._getMultipleChoiceController(e);if(!r)return;if(r.input&&!n&&this.viewModel.mode===`batch`){await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});return}let i=e.value,a=this._parseValue(t,e,n);a!==i&&await this.viewModel.setValue(e.template.elementId,a)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:n}){if(!n)return;let r=t.value,i=r==null||r===``?null:r,a=this._getMultipleChoiceController(e);if(!a)return;a.initializeExplicitOtherChoiceCheckedState(),a.stashOtherChoiceDraftValueForFeatures(e.features,i);let o=N(e,n);o&&await this.viewModel.setValueForFieldName(o,i,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:n}){let r=this._getMultipleChoiceController(e);if(!r)return;r.setExplicitOtherChoiceCheckedState(t),this._markInputTouched(e),t||r.setOtherChoiceDraftValuesFromFeatures(e.features.toArray());let i=N(e,n);if(!i)return;let a=new Map;for(let i of e.features){let e=i.getAttribute(n);if(t){if(!Y(e))continue;let t=r.getOtherChoiceDraftValue(i),n=L(t)?t:I;a.set(i,n)}else e!=null&&a.set(i,null)}a.size!==0&&await this.viewModel.setValuePerFeatureForFieldName(i,new Map(Array.from(a,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){let n=this._getMultipleChoiceController(e);if(!n)return;let r=new Map(e.features.map(r=>[r,n.getUpdatedValueForFeature({choiceValue:t.value,currentValue:r.getAttribute(e.fieldName),isChecked:t.checked})]));r.size!==0&&await this.viewModel.setFieldInputValuePerFeature(e,r)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===M||e.value===M)&&this.viewModel.mode===`batch`){let n={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,onblur:t.onblur,onfocus:t.onfocus,[Z]:t[Z]},trigger:{appearance:`transparent`,iconEnd:`chevron-down`,kind:`neutral`,slot:`trigger`,label:t.label},group:{mode:`single`}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:n,options:[{name:this.messages.differentValuesPlaceholder,value:M,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return J(`calcite-switch`,{...t,checked:S(e.template,`switch`)?e.value===e.template.input.onValue:!1,class:w.inputSwitch,disabled:t.readOnly||t.disabled,onCalciteSwitchChange:({currentTarget:e})=>this._saveInputFromElement(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:n}){let{trigger:r,dropdown:i,group:a}=n;return J(`calcite-dropdown`,{...i,topLayerDisabled:this.topLayerDisabled,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInputFromElement(e)},J(`calcite-button`,{...r},e===M?this.messages.differentValuesPlaceholder:e),J(`calcite-dropdown-group`,{selectionMode:a.mode},t.map(t=>J(`calcite-dropdown-item`,{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:n}){let r=this.viewModel.editType===`INSERT`,i=this._touchedInputs.has(e?.template.elementId),a=r&&e.showNoValueOptionEnabled&&!i?()=>{}:n.onblur,o={...n,onblur:a};return J(`calcite-combobox`,{...o,clearDisabled:e.isSubtypeField,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,value:n.placeholder===this.messages.differentValuesPlaceholder?M:String(n.value),onCalciteComboboxChange:({currentTarget:t})=>{t.value!==M&&(e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveInputFromElement(t))}},this.renderComboboxOptionsList({input:e,options:t,props:n}))}renderComboboxOptionsList({input:e,options:t,props:n}){let r=e=>e.map(e=>{let{value:t}=e,r=Y(e.value)?this.messages.empty:e.name;return J(`calcite-combobox-item`,{heading:r,key:`#${t}`,selected:n.value===t,value:`${t}`})}),i=[],{messages:a}=this;t.other.length>0&&i.push(J(`calcite-combobox-item-group`,{key:`other`,label:a.other},r(t.other))),t.unsupported.length>0&&i.push(J(`calcite-combobox-item-group`,{key:`unsupported`,label:a.unsupported},r(t.unsupported)));let o=r(t.recommended);i.length>0?i.unshift(J(`calcite-combobox-item-group`,{key:`recommended`,label:a.recommended},o)):i=o;let s=n.placeholder===this.messages.differentValuesPlaceholder,c=!s&&Y(n.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&i.unshift(J(`calcite-combobox-item`,{heading:e.showNoValueLabel||this.messages.empty,key:`empty-option`,selected:c,value:``})),s&&i.unshift(J(`calcite-combobox-item`,{heading:this.messages.differentValuesPlaceholder,key:M,selected:!0,value:M})),i}_renderRadioButtonGroupComponent({input:e,options:t,props:n}){let r=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:r})=>this._renderRadioButtons({label:t,value:r,selected:r===e.value,props:n}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){let t=e.showNoValueLabel||this.messages.empty,i=Y(e.value);r.unshift(this._renderRadioButtons({label:t,value:``,selected:i,props:n}))}return J(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:w.inputRadioGroup,"data-field-name":n[Q],disabled:n.readOnly||n.disabled,key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.name}-${this.id}`,required:n.required},r,n.placeholder===this.messages.differentValuesPlaceholder?J(`calcite-label`,{class:w.placeholderRadio,key:n.label,layout:`inline`},J(`calcite-radio-button`,{checked:!0,class:w.inputRadio,disabled:!0,value:n.placeholder}),n.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:n,props:r}){return J(`calcite-label`,{class:w.inputRadioLabel,key:r.label,layout:`inline`},J(`calcite-radio-button`,{...r,afterCreate:void 0,afterUpdate:void 0,checked:t,class:w.inputRadio,disabled:r.readOnly||r.disabled,name:void 0,value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInputFromElement(e)}}),n)}_renderStringComponent(e,t){let{template:n}=e;return!n.field.editable||this.readOnly?this._renderReadOnlyComponent(e):n.input?.type===`text-area`?J(`calcite-text-area`,{...t,class:this.classes(w.individualElement),resize:`vertical`,value:t.value?String(t.value):``,onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteTextAreaInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}}):J(`calcite-input`,{...t,class:this.classes(w.individualElement),type:`text`,value:t.value?String(t.value):``,onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteInputInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}})}_renderNumberComponent(e,t){let n=h(e.field);return J(`calcite-input-number`,{...t,integer:n,step:n?1:`any`,type:`number`,value:n&&t.value!==``?Math.round(parseFloat(String(t.value))).toString():String(t.value),onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteInputNumberInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}})}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return J(`calcite-input`,{...n,class:this.classes(w.fieldInput,w.inputDisabled,w.individualElement),readOnly:!0,type:`text`,value:String(t??n.value??``)})}_renderDateComponents(e,t){let{field:n}=e,r;switch(n.type){case`date`:r=this._renderDateFieldComponents(e,t);break;case`date-only`:r=this._renderDateOnlyFieldComponent(e,t);break;case`time-only`:r=this._renderTimeOnlyFieldComponent(e,t);break;case`timestamp-offset`:r=this._renderTimestampOffsetFieldComponents(e,t);break;default:r=this._renderReadOnlyComponent(e,de(n,t.value,{timeZone:e.effectiveTimeZone,...fe(e.template.field)}))}return e.value===M?[r,J(`calcite-input-message`,{icon:`information`,key:`diff-values-message`,status:`idle`},this.messages.differentValues)]:r}_renderDateOnlyFieldComponent(e,t){let{class:n,disabled:r,key:i,readOnly:a}=t,{rawMax:o,rawMin:s}=e.range;return J(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:n,"data-date-part":`date`,"data-element-id":t[Z],"data-field-name":t[Q],disabled:r,key:`${i}-date-input`,max:g(o)?o:void 0,min:g(s)?s:void 0,overlayPositioning:`fixed`,readOnly:a,topLayerDisabled:this.topLayerDisabled,value:e.value===M?``:e.value?String(e.value):``,onblur:t.onblur,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:t.onfocus})}_renderTimeOnlyFieldComponent(e,t){let{class:n,disabled:r,key:i,readOnly:a}=t;return J(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:n,"data-date-part":`time`,"data-element-id":t[Z],"data-field-name":t[Q],disabled:r,key:`${i}-time-input`,overlayPositioning:`fixed`,readOnly:a,step:e.timeStep,value:e.value===M?``:e.value?String(e.value):``,onblur:t.onblur,onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:t.onfocus})}_renderTimestampOffsetFieldComponents(e,t){let{class:n,disabled:r,key:i,readOnly:a,onblur:o,onfocus:s}=t,{rawMax:c,rawMin:l}=e.range,u=e.effectiveTimeZone,d=U(c,u),f=U(l,u),p=U(e.value===M?``:e.value,u),m=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:r,[Z]:t[Z],[Q]:t[Q],onblur:o,onfocus:s,overlayPositioning:`fixed`,readOnly:a};return J(`div`,{class:w.dateInputContainer,key:`${i}-date-time-container`},J(`calcite-input-date-picker`,{...h,class:n,"data-date-part":`date`,key:`${i}-date-input`,max:d?.date??void 0,min:f?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??``,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),J(`calcite-input-time-picker`,{...h,class:n,"data-date-part":`time`,key:`${i}-time-input`,step:e.timeStep,value:p.time??``,onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?J(`calcite-input-time-zone`,{...h,class:n,clearable:e.value===M||e.value==null,"data-date-part":`timeZone`,key:`${i}-timezone-input`,value:p.timeZoneOffset||``,onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){let{class:n,disabled:r,key:i,readOnly:a,min:o,max:s}=t,c=e.effectiveTimeZone,l=W(e.value===M?``:e.value,c),u=W(s,c),d=W(o,c),f=e.includeTime,p={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:r,[Z]:t[Z],[Q]:t[Q],onblur:t.onblur,onfocus:t.onfocus,overlayPositioning:`fixed`,readOnly:a};return J(`div`,{class:w.dateInputContainer,key:`${i}-date-time-container`},J(`calcite-input-date-picker`,{...p,class:n,"data-date-part":`date`,key:`${i}-date-input`,max:u?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:l.date??``,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),f?J(`calcite-input-time-picker`,{...p,"data-date-part":`time`,key:`${i}-time-input`,step:1,value:l.time??``,onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?J(z,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){let{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;let{allAttachmentsVisibleOnDefaultPage:t,attachments:n,defaultPageAttachments:r,template:{description:i,elementId:a,label:o}}=e,s=t?n:r;return J(`div`,{class:w.attachmentElementInput,"data-testid":`attachment-element-${a}`,key:`attachment-element-${a}`},o?J(`div`,{class:w.attachmentElementLabel,key:`attachment-element-label-${a}`},o):null,i?J(`div`,{class:w.description,key:`attachment-element-description-${a}`},i):null,n.length?this._renderAttachmentList(e,s,{label:o||this.messagesCommon.details,viewAllCount:t?null:n.length}):J(`div`,{class:w.attachmentElementEmptyState,key:`attachment-element-empty-state-${a}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){let e=this.viewModel.selectedAttachmentListInput;if(e)return J(`div`,{class:w.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,n){let{filterEnabled:r,label:i,viewAllCount:a}=n;return J(`calcite-list`,{class:w.attachmentElementList,filterEnabled:r,filterPlaceholder:r?this.messages.attachments.searchAttachments:void 0,filterProps:r?ge:void 0,filterText:r?this._attachmentListFilterText:void 0,label:i,selectionAppearance:`border`,selectionMode:`none`,onCalciteListFilter:r?e=>{this._attachmentListFilterText=e.currentTarget.filterText??``}:void 0},this._renderAttachmentListItems(e,t),a==null?null:this._renderViewAllAttachmentsItem(e,a))}_renderAttachmentListItems(e,t){let{elementId:n}=e.template;return t.map((t,r)=>{let i=this._formatAttachmentSize(t.size),a=this._getAttachmentLabel(t,r,i,e.displayFilename),o=a===i?void 0:i,s=v(t),c=e.isStagedAttachmentAddition(t),l=e.getAttachmentEditState(t),u=l.isDeleted,d=!u&&(c||l.isRenamed||l.isReplaced);return J(`calcite-list-item`,{class:w.attachmentElementListItem,description:o,key:`attachment-item-${s}`,label:a,onCalciteListItemSelect:c||u?void 0:()=>this._setSelectedAttachment({attachmentKey:s,elementId:n})},J(`div`,{class:w.attachmentElementListItemStart,slot:`content-start`},this._renderAttachmentPreviewThumbnail(t,a,e)),d?J(`span`,{class:w.attachmentElementListItemStagedIndicator,slot:`content-end`}):null,c?[J(`calcite-action`,{disabled:this._disableAttachmentModification(e),icon:`x`,scale:`s`,slot:`actions-end`,text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(n,v(t))})]:u?J(`calcite-chip`,{label:this.messages.attachments.deleted,scale:`s`,slot:`content-end`},this.messages.attachments.deleted):J(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))})}_renderViewAllAttachmentsItem(e,n){let{elementId:r}=e.template,{viewAll:i}=this.messages.attachments;return J(`calcite-list-item`,{class:w.attachmentElementListItem,description:t(this.messages.attachments.count,{count:n}),key:`attachment-item-view-all-${r}`,label:i,onCalciteListItemSelect:()=>this._setAttachmentListElementId(r)},J(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderAttachmentAddAction(e){let{elementId:t}=e.template,n=this.effectiveDisabled||e.addDisabled,r=this._renderAttachmentCountLimitsLabel(e),i=this._getAttachmentNoticeMessage(e),a=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?`danger`:`info`,o=e.canUploadFiles,s=e.isCaptureOnly&&!this.effectiveDisabled&&!i;return J(`div`,{class:w.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},o?J(`calcite-button`,{appearance:`outline`,disabled:n,iconStart:`attachment`,kind:`neutral`,round:!0,scale:`s`,onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),s?this._renderAttachmentCaptureDisabledNotice(t):null,r?J(`div`,{class:w.attachmentElementEmptyActionHint},r):null,!this.effectiveDisabled&&i?J(`calcite-notice`,{closable:!1,icon:a===`danger`?`exclamation-mark-circle`:`lightbulb`,kind:a,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},i)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;let t=e.captureMediaType;return J(`calcite-button`,{appearance:`outline`,disabled:!0,iconStart:ye(t),kind:`neutral`,round:!0,scale:`s`},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){let t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){let{capture:t,recordAudio:n,takePhoto:r,takeVideo:i}=this.messages.attachments;switch(e){case`image`:return r||t;case`video`:return i||t;case`audio`:return n||t;default:return t}}_renderAttachmentAddPage(){let e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){let{maxAttachmentCount:t}=e,{elementId:n}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(n);let r=t==null||t-e.attachments.length>1,i=this.effectiveDisabled||e.addDisabled,a=this.messages.attachments,o=a.dragAndDropFile,s=e=>{this._attachmentFileInputMap.set(n,e)};return J(`div`,{class:w.attachmentElementAddPanel,key:`attachment-element-add-panel-${n}`},J(`input`,{accept:e.accept,afterCreate:s,afterRemoved:()=>{this._attachmentFileInputMap.delete(n)},afterUpdate:s,class:w.attachmentElementFileInput,"data-element-id":n,disabled:i,multiple:r,type:`file`,onchange:e=>{let t=e.currentTarget,r=t.files?Array.from(t.files):[];this._stageAttachmentFiles(n,r),t.value=``}}),J(`div`,{class:w.attachmentElementAddDropzone,"data-disabled":i?`true`:`false`,ondragover:e=>{e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},ondrop:e=>{if(e.preventDefault(),e.stopPropagation(),i)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(n,t)}},J(`calcite-icon`,{class:w.attachmentElementAddDropzoneIcon,icon:`upload`,scale:`l`}),J(`div`,{class:w.attachmentElementAddDropzoneHeading},a.addFile),J(`div`,{class:w.attachmentElementAddDropzoneDetail,title:o},o),J(`calcite-button`,{appearance:`transparent`,disabled:i,iconStart:`folder-open`,kind:`brand`,scale:`s`,type:`button`,onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(n,i)}},a.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return J(`calcite-notice`,{class:w.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:`warning`,open:!0,scale:`s`},J(`div`,{slot:`message`},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(t.length===0)return;let n=this.viewModel.selectedAttachmentAddInput,r=!0;try{r=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!n?.hasInvalidValidationCriteria&&!n?.hasUnsupportedFileTypeValidationError}finally{r&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){let e=this.selectedAttachmentDetails;if(!e)return;if(this.page===`replacing-attachment`)return this._renderAttachmentReplacePanel(e);let{attachment:t,input:n}=e,r=v(t),i=!!n.getAttachmentPreviewUrl(t),a=!this._disableAttachmentModification(n)&&n.canUploadFiles,o=n.getAttachmentEditState(t);return J(`div`,{class:w.attachmentElementDetail,key:`attachment-detail-panel-${n.template.elementId}-${r}`},J(`div`,{class:w.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,n)),J(`div`,{class:w.attachmentElementDetailActions},y(t)?J(`calcite-button`,{appearance:`outline`,disabled:!i,iconStart:`expand`,kind:`neutral`,label:this.messages.attachments.maximize,scale:`m`,title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,J(`calcite-button`,{appearance:`outline`,disabled:!i||o.isReplaced,iconStart:`download`,kind:`neutral`,label:this.messages.attachments.download,scale:`m`,title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),J(`calcite-button`,{appearance:`outline`,disabled:!a,iconStart:`upload-to`,kind:`neutral`,label:this.messages.attachments.replace,scale:`m`,title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),J(`div`,{class:w.attachmentElementDetailMetadata},J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),this._renderFileNameContent(t,n)),J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.size),J(`span`,{class:w.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.type),J(`span`,{class:w.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderFileNameContent(e,t){if(!t.allowUserRename)return J(`span`,{class:w.attachmentElementDetailMetadataValue},e.name);let n=t.getAttachmentEditState(e),{baseName:r,extension:i}=b(e.name),a=this._disableAttachmentModification(t),o=!a&&e.name.trim().length===0;return[J(`div`,{class:w.attachmentElementDetailFileNameRow,key:`file-name-row`},J(`calcite-input`,{class:w.attachmentElementDetailFileNameInput,disabled:a,scale:`m`,status:o?`invalid`:`idle`,suffixText:i,value:r,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),J(`calcite-button`,{appearance:`transparent`,disabled:a||n.initialName==null||!n.isRenamed,iconStart:`reset`,kind:`neutral`,label:this.messages.footerButtons.reset,scale:`m`,title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})),o?J(`calcite-input-message`,{icon:!0,key:`file-name-message`,status:`invalid`},this.messages.validationErrors.cannotBeNull):null]}_renderAttachmentReplacePanel(e){let{attachment:t,input:n}=e,r=this._disableAttachmentModification(n)||!n.canUploadFiles,i=n.template.elementId;return J(`div`,{class:w.attachmentElementAddPanel,key:`attachment-replace-panel-${i}-${v(t)}`},J(`input`,{accept:n.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:w.attachmentElementFileInput,disabled:r,type:`file`,onchange:e=>{let t=e.currentTarget,n=t.files?.[0];n&&this._stageSelectedAttachmentReplacement(n),t.value=``}}),J(`div`,{class:w.attachmentElementAddDropzone,"data-disabled":r?`true`:`false`,ondragover:e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},ondrop:e=>{if(e.preventDefault(),e.stopPropagation(),r)return;let t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},J(`calcite-icon`,{class:w.attachmentElementAddDropzoneIcon,icon:`refresh`,scale:`l`}),J(`div`,{class:w.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),J(`div`,{class:w.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),J(`calcite-button`,{appearance:`transparent`,disabled:r,iconStart:`folder-open`,kind:`brand`,scale:`s`,onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(n,{includeCountCriteria:!1}),J(`div`,{class:w.attachmentElementDetailMetadata},J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),J(`span`,{class:w.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){let e=this._attachmentDialogInfo;if(!e)return null;let{attachment:t,input:n}=e;return J(`calcite-dialog`,{heading:t.name||this.messagesCommon.details,key:`attachment-preview-dialog`,modal:!0,open:!0,placement:`cover`,width:`l`,onCalciteDialogClose:this._closeAttachmentDialog},J(`div`,{class:w.attachmentElementDialogPreview},this._renderAttachmentPreviewImageForInput(t,n)))}_setSelectedAttachment(e,t){this._markInputTouched(t),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){let{viewModel:t}=this;t.setSelectedAttachmentAddElementId(e),this._markInputTouched(t.selectedAttachmentAddInput),t.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){let{viewModel:t}=this;t.setSelectedAttachmentListElementId(e),this._markInputTouched(t.selectedAttachmentListInput),this.hideAttachmentDialog()}_getAttachmentLabel(e,n,r,i){return i!==!1&&g(e.name)&&e.name.length>0?e.name:r===this.messagesCommon.notApplicable?t(this.messages.attachments.attachmentNumberedLabel,{index:n+1}):r}_renderAttachmentCountLimitsLabel(e){let t=this.messages.attachments,n=e.minAttachmentCount!=null&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,`min`):null,r=e.maxAttachmentCount==null?null:this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,`max`);return!n&&!r?null:[n,n&&r?J(`span`,{key:`attachment-count-limits-separator`},`, `):null,r]}_renderAttachmentCountLimitLabel(e,n,r){let i=`__count__`,[a,o]=t(e,{count:i}).split(i);return J(`span`,{key:r},a,J(`span`,{class:w.attachmentElementEmptyActionHintValue},n),o)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){let n=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),r=`attachment-validation-criteria-${e.template.elementId}`;return n.length===0?null:J(`div`,{class:w.attachmentElementValidationCriteria,key:r},n.map(({key:e,message:t,state:n})=>J(`calcite-notice`,{appearance:n===`danger`?`outline-fill`:`transparent`,closable:!1,icon:!0,key:e,kind:n,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:n}){let r=[],i=e.validationCriterionStates,a=this.messages.attachments,o=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&r.push({key:`unsupported-file-type`,message:this._getUnsupportedFileTypeMessage(),state:`danger`});for(let e of o)e.type===`document`&&e.maxFileSize!=null&&r.push({key:`maximum-file-size`,message:t(a.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(e.maxFileSize)}),state:i.get(`maximum-file-size`)??`info`}),e.type===`audio`&&e.maxDuration!=null&&r.push({key:`maximum-audio-length`,message:t(a.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(e.maxDuration)}),state:i.get(`maximum-audio-length`)??`info`}),e.type===`video`&&e.maxDuration!=null&&r.push({key:`maximum-video-length`,message:t(a.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(e.maxDuration)}),state:i.get(`maximum-video-length`)??`info`}),e.type===`image`&&e.maxImageSize!=null&&r.push({key:`maximum-image-size`,message:t(a.attachmentMustBeSmallerThan,{maxSize:`${e.maxImageSize}px`}),state:i.get(`maximum-image-size`)??`info`});return n&&e.minAttachmentCount!=null&&e.minAttachmentCount>0&&r.push({key:`minimum-number-of-files`,message:t(a.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:i.get(`minimum-number-of-files`)??`info`}),n&&e.maxAttachmentCount!=null&&r.push({key:`maximum-number-of-files`,message:t(a.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:i.get(`maximum-number-of-files`)??`info`}),r}_getNestableAttachmentInputs(e){return e==null?[]:e.type===`attachment`?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return e==null||Number.isNaN(e)?this.messagesCommon.notApplicable:d(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return d(this.messagesUnits,e*1048576)}_formatAttachmentDurationLimit(e){return m(Math.round(e)*1e3,{...e>=3600?{hour:`2-digit`,hourCycle:`h23`}:{},minute:`2-digit`,second:`2-digit`,timeZone:`UTC`})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;let t=this.messages.attachments.attachmentTypes,n=te(e);return t?.[n]||e}_renderAttachmentPreviewThumbnail(e,t,n){let r=n.getAttachmentPreviewUrl(e,64);return r&&y(e)?J(`img`,{alt:t,class:w.attachmentElementListItemThumb,src:r}):J(`calcite-icon`,{class:w.attachmentElementListItemIcon,icon:_(e.contentType),scale:`s`})}_renderAttachmentPreviewImageForInput(e,t){let n=t.getAttachmentPreviewUrl(e),r=e.name||this.messagesCommon.details;return n&&y(e)?J(`img`,{alt:r,class:w.attachmentElementDetailPreviewImage,src:n,title:r}):[J(`calcite-icon`,{class:w.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:`l`,textLabel:r,title:r}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await V(e)}_canReplaceSelectedAttachment(){return!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){let t=this.selectedAttachmentDetails;if(!t?.attachment)return;let n=t.input.template.elementId,r=v(t.attachment),i=!1;try{i=await this.viewModel.stageReplaceAttachment(n,r,e)}finally{i&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){let t=this.selectedAttachmentDetails;if(!t?.attachment)return;let n=t.input.template.elementId,r=v(t.attachment);this.viewModel.stageRenameAttachment(n,r,e)}_resetSelectedAttachmentChanges(){let e=this.selectedAttachmentDetails;e?.attachment&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,v(e.attachment))}_deleteSelectedAttachment(){let e=this.selectedAttachmentDetails;if(!e?.attachment||this._disableAttachmentModification(e.input))return;let t=e.input.template.elementId,n=v(e.attachment);this.viewModel.stageDeleteAttachment(t,n),this._setSelectedAttachment(null)}_disableAttachmentModification(e){return this.disabledOrReadOnly||!e.editable}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){let{elementId:t}=e.template;return J(`div`,{class:w.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;let{elementId:t}=e.template;return J(`div`,{class:w.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){let{template:t,valid:n,value:r,minLength:i,maxLength:a,required:o,fieldName:s,editable:c,range:{max:l,min:u}}=e,d=!c||this.readOnly,f=this.disabled||this.viewModel.updating,p=this._getErrorToDisplay(e)?`invalid`:`idle`,m=t.hint??void 0,h=!1;return r===M&&(m=this.messages.differentValuesPlaceholder,h=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?`false`:`true`,class:this.classes(w.fieldInput,d?w.inputDisabled:null),status:p,maxLength:a&&a>-1?a:void 0,minLength:i&&i>-1?i:void 0,key:t.elementId,label:s,name:s,max:l??void 0,min:u??void 0,disabled:f,readOnly:d,onblur:this._onComponentBlur,required:o,placeholder:m,value:h?``:r??``,[Z]:t.elementId,[Q]:s,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_handleDragAndDrop(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`)}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(Z))}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldInput=n}_markInputTouched(e){e&&this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){let n=this._getMultipleChoiceController(t);return e.tagName===`CALCITE-CHECKBOX`&&n?.input!=null}_afterComponentCreateOrUpdate(e){let t=this._getFieldInputFromHTMLElement(e),n=this._focusedFieldInput;this._attemptFocusOnNextRender&&n===t&&(this._attemptFocusOnNextRender=!1,ve(e))}_onComponentBlur(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,n)||this._markInputTouched(n),this._focusedFieldInput=null}_onDynamicChoiceBlur(e,t){let n=e.currentTarget;if(this._dynamicChoiceItemSelections.delete(t))return;let r=e.relatedTarget;r instanceof Node&&n.contains(r)||(t.endInteraction(),n.inputValue=t.fieldInput.value===M?this.messages.differentValuesPlaceholder:t.inputValue,this._onComponentBlur(e))}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText=``,this._attachmentFileInputMap.clear()}_parseValue(e,t,n=!1){let r=this._getMultipleChoiceController(t);if(r){let{input:t,values:i}=r;if(t&&i){let t=e;return r.getValueFromCheckboxChange({choiceValue:t.value,isChecked:t.checked,isSelectAllCheckbox:n})}}if(S(t.template,`switch`)){if(e.localName===`calcite-dropdown`&&t.domain){for(let n of t.domain.codedValues)if(n.name===e.selectedItems[0].textContent)return n.code}return e.checked?t.template.input.onValue:t.template.input.offValue}let i=e.value;return i==null||i===``?null:t.dataType===`number`?i===`-0`||i===`-0.`||i===`-0,`?i:parseFloat(i):t.field.type===`date`?parseFloat(i):i}_getMultipleChoiceController(e){return k(e.inputController)?e.inputController:null}_saveInputFromElement(e){let t=this._getFieldInputFromHTMLElement(e);if(!t)return;let n=this._parseValue(e,t);this._saveInput(t,n)}_saveInput(e,t){let{elementId:n}=e.template,r=e?.value,{viewModel:a}=this;if(S(e.template,`switch`)&&a.mode!==`single`){let t=i(this._batchSwitchInputInitialValues,e,()=>e.value);this._batchSwitchInputInitialValues.set(e,t===null?r:t)}t!==r&&(this._markInputTouched(e),!e.isSubtypeField||a.mode===`batch`||!re(a.activeLayer,r,t)?a.setValue(n,t):this._pendingSubtypeChoice||=this._handleSubtypeChoice(e,t))}async _handleSubtypeChoice(e,n){let{value:r,template:i}=e,{elementId:a}=i,{messages:o,viewModel:s,messagesCommon:c}=this,{subtypes:l,activeFeatureIndex:u}=s;if(await s.setValue(a,n),!l?.length)return;let d=l.find(e=>e.code===n),f=l.find(e=>e.code===r)?.name??`${r}`;if(!d)return;let p=Promise.withResolvers();s.pendingSubtypeChoice=p;let m=`update-fields`,h=[{label:o.subtypes.useDefaultValuesOption,value:`update-fields`},{label:o.subtypes.keepCurrentValuesOption,value:`keep-existing`}],g={context:`info`,title:o.subtypes.changeWarningTitle,message:t(o.subtypes.changeWarning,{originalType:f,newType:d.name}),radios:h,defaultRadioSelection:`update-fields`,onRadioSelection:e=>{m=e},actions:{primary:{label:c.apply,action:()=>p.resolve(m),type:`positive`},secondary:{label:c.cancel,type:`neutral`,action:()=>p.resolve(`undo`)}},cancel:()=>p.reject()};try{switch(this.showPrompt(g),await p.promise){case`update-fields`:await s.applySubtypeDefaults(d),await s.handleSubtypeChanged(u);break;case`keep-existing`:await s.handleSubtypeChanged(u);break;case`undo`:await this.viewModel.setValue(a,r)}}finally{s.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_afterDateComponentCreateOrUpdate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){let{elementId:n}=e.template,r=e.field.type,i=this._dateComponentMap.get(`${n}`);if(!i)return;let a=e.effectiveTimeZone,o=e.value===M?void 0:e.value,s=null;r===`date-only`?s=Array.isArray(t.value)?t.value[0]:t.value:r===`time-only`?(o=G(o),s=G(t.value)):s=r===`timestamp-offset`?t.value==null?null:pe({dateComponent:i.date,timeComponent:i.time,oldValue:o,timeZoneComponent:i.timeZone,defaultTimeZone:a}):t.value==null?null:me({oldValue:o,dateComponent:i.date,timeZone:a,timeComponent:i.time?.value===M?void 0:i.time}),o!==s&&(this._markInputTouched(e),s===null||!t.value?this.viewModel.setValue(n,null):this.viewModel.setValue(n,s))}_getErrorToDisplay(e){let t=e.compositeError;return e.valid||!t?null:t===X.CONTINGENCY_VIOLATION_ERROR||t===X.CONTINGENCY_VIOLATION_WARNING?t:!this._touchedInputs.has(e.template.elementId)&&!this.viewModel.submitHasBeenAttempted?null:t}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){let t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){let e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&e.length!==0){await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});let t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>a(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){let t=this.callbacks?.editAssociatedFeature,n=this.viewModel.activeAssociationsInput;if(!t||!n?.feature)return;let{association:r,feature:i}=e;await t({parentFeature:n.feature.plainGraphic,association:r,feature:i})}_onAddAssociation(e){let t=this.callbacks?.addAssociation,n=this.viewModel.activeAssociationsInput;if(!t||!n?.feature)return;let{associationType:r,utilityNetwork:i}=e;t({feature:n.feature.plainGraphic,associationType:r,utilityNetwork:i})}_setFocusableInput(e){let t=e&&j(e)?e:this._findFocusableInput(e);this._syncGroupInputStates(),this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){let t=this.viewModel.activeForm.inputs;if(!t.length)return;let n=ie(t),r;if(!e)r=0;else if(A(e)){let t=e.inputs.find(e=>e.visible);r=t?n.indexOf(t):0}else{let i;i=P(e)&&!e.group.open?e.group.inputs.filter(j)[t.length-1]:e,r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&j(t)){if(this.disabledOrReadOnly&&(t?.inputType===`switch`||t?.inputType===`radio-buttons`))continue;return t}}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t),this.groupDisplay===`sequential`&&this.viewModel.activeForm.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.activeForm?.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}};e([f()],$.prototype,`activeFeatureIndex`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`callbacks`,null),e([f()],$.prototype,`disabled`,null),e([f()],$.prototype,`effectiveTitle`,null),e([f()],$.prototype,`effectiveDisabled`,null),e([f()],$.prototype,`disabledOrReadOnly`,null),e([f()],$.prototype,`features`,null),e([f()],$.prototype,`footerButtonInfos`,null),e([f()],$.prototype,`map`,null),e([f()],$.prototype,`maximumFeatureCount`,null),e([f()],$.prototype,`maximumFeatureCountWithComplexForms`,null),e([f()],$.prototype,`spatialReference`,null),e([f()],$.prototype,`layerInfos`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`headingLevel`,void 0),e([f()],$.prototype,`icon`,null),e([f(),q(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([f(),q(`esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm`)],$.prototype,`messages`,void 0),e([f(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],$.prototype,`featureFormMessages`,void 0),e([f(),q(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`featureTableMessages`,void 0),e([f(),q(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,void 0),e([f()],$.prototype,`page`,null),e([f()],$.prototype,`readOnly`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`selectedAttachment`,null),e([f()],$.prototype,`selectedAttachmentDetails`,null),e([f()],$.prototype,`valid`,null),e([f({type:C}),_e([`attachments-change`,`value-change`,`values-change`,`submit`])],$.prototype,`viewModel`,void 0),e([f({type:D,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f()],$.prototype,`groupDisplay`,void 0),e([f()],$.prototype,`_formHeaderVisible`,null),e([f()],$.prototype,`_associationsEnabled`,null),e([f()],$.prototype,`_associationsList`,void 0),e([f()],$.prototype,`_attemptFocusOnNextRender`,void 0),e([f()],$.prototype,`_formId`,null),e([f()],$.prototype,`_focusedFieldInput`,void 0),e([f()],$.prototype,`_pendingSubtypeChoice`,void 0),e([f()],$.prototype,`_relatedRecordsEnabled`,null),e([f()],$.prototype,`_listObserverNode`,void 0),e([f()],$.prototype,`_attachmentDialogInfo`,void 0),e([f()],$.prototype,`_attachmentListFilterText`,void 0),e([f()],$.prototype,`_prompt`,void 0),e([f()],$.prototype,`test`,null),$=e([p(`esri.widgets.BatchAttributeForm`)],$);function ye(e){switch(e){case`audio`:return _(`audio/mpeg`);case`video`:return _(`video/mp4`);case`image`:return _(`image/png`);default:return`camera`}}const be=$;export{be as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as n}from"../core/deprecate.js";import r from"../core/Logger.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{destroyMaybe as a}from"../core/maybe.js";import o from"../core/ReactiveMap.js";import{watch as s,when as c,on as l,sync as u}from"../core/reactiveUtils.js";import{formatFileSize as d}from"../core/unitFormatUtils.js";import{property as f,subclass as p}from"../core/accessorSupport/decorators.js";import{formatDate as m}from"../intl/date.js";import{isIntegerField as h}from"../layers/support/fieldUtils.js";import{isString as g}from"../support/guards.js";import ee from"./Widget.js";import{getAttachmentTypeCategory as te,getCalciteIconForAttachment as _}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as v,isImageAttachment as y,getAttachmentFilenameParts as b}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as ne,getMessageString as x,isElementTemplateWithInputType as S,subtypeChangeShouldPrompt as re,flattenInputs as ie}from"./BatchAttributeForm/batchAttributeFormUtils.js";import C from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as w}from"./BatchAttributeForm/css.js";import{makeViewingEditedAttachmentFooterButtons as ae,makeViewingAttachmentFooterButtons as oe,makeCancelFooterButton as T,makeDefaultFooterButtons as E}from"./BatchAttributeForm/interfaceUtils.js";import D from"./BatchAttributeForm/VisibleElements.js";import{isDynamicChoiceController as O,isMultipleChoiceController as k}from"./BatchAttributeForm/inputs/support/controllerUtils.js";import{isGroupInput as A,isFieldInput as j,isTextElementInput as se,isRelationshipElementInput as ce,isAttachmentElementInput as le,isUtilityNetworkAssociationsElementInput as ue,differentValuesString as M,getNormalizedFieldName as N,isGroupedInput as P}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as F,otherChoiceCheckedPlaceholderValue as I,canRestoreMultipleChoiceOtherChoiceDraftValue as L}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{loadRelationshipDetailsComponents as R,RelationshipDetails as z}from"./BatchAttributeForm/rendered-content/RelationshipDetails.js";import{Prompt as B}from"./Editor/components/Prompt.js";import{downloadAttachmentInfo as V}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as H}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as de,getIntlOptionsForField as fe,prepareISOFieldValueForDateComponents as U,prepareUnixFieldValueForDateComponents as W,normalizeTimeOnlyString as G,getISOFieldValueFromDateComponents as pe,getUnixFieldValueFromDateComponents as me}from"./support/dateUtils.js";import{globalCss as K}from"./support/globalCss.js";import{Heading as he}from"./support/Heading.js";import{calciteListFilterProps as ge}from"./support/listUtils.js";import{messageBundle as q,vmEvent as _e,tsx as J}from"./support/widget.js";import{setFocus as ve}from"./support/widgetUtils.js";import{isEmptyValue as Y,ContingentValuesValidationError as X}from"./support/forms/formUtils.js";const Z=`data-element-id`,Q=`data-field-name`;let $=class extends ee{constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.featureFormMessages=null,this.featureTableMessages=null,this.messagesUnits=null,this.viewModel=new C,this.visibleElements=new D,this.groupDisplay=`all`,this._associationsList=null,this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._dynamicChoiceItemSelections=new WeakSet,this._focusedFieldInput=null,this._pendingSubtypeChoice=null,this._batchSwitchInputInitialValues=new Map,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.viewModel.activeRelationshipInput?.incrementPage()},{root:window.document}),this._attachmentDialogInfo=null,this._attachmentListFilterText=``,this._attachmentFileInputMap=new Map,this._prompt=null,this._selectedAttachmentReplaceFileInput=null,this._afterListObserverCreated=e=>{this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)},this._afterListObserverRemoved=()=>{this._listObserverNode=null},this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._enterAttachmentReplaceView=()=>{let e=this.selectedAttachmentDetails;this._canReplaceSelectedAttachment()&&e&&(e.input.clearValidationCriteriaState(),this.viewModel.setShowingSelectedAttachmentReplacePage(!0))},this._setSelectedAttachmentReplaceFileInput=e=>{this._selectedAttachmentReplaceFileInput=e},this._openSelectedAttachmentReplaceFilePicker=()=>{this._canReplaceSelectedAttachment()&&this._selectedAttachmentReplaceFileInput?.click()},this._resetSelectedAttachmentName=()=>{let e=this.selectedAttachmentDetails;if(!e?.attachment)return;let t=e.input.getAttachmentEditState(e.attachment).initialName;if(t==null)return;let n=e.input.template.elementId,r=v(e.attachment);this.viewModel.stageRenameAttachment(n,r,t)},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInputFromElement=this._saveInputFromElement.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),t||(this.announceDeprecation=()=>{n(r.getLogger(this),`Editor`,`arcgis-editor`,{version:`5.0`})})}initialize(){this.addHandles([s(()=>this.features.toArray(),()=>{this._dateComponentMap.clear(),F(this.viewModel,{includeDraftValues:!0})}),s(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),F(this.viewModel),this._setFocusableInput()}),s(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),c(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),s(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=``}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),l(()=>this.viewModel,`submit`,()=>{this.valid||this.goToFirstError()}),s(()=>[this._associationsEnabled,this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs],()=>this._setUpAssociationsWidgets(),u),s(()=>this.viewModel.activeAssociationsInput,e=>this._onActiveAssociationsInputChange(e)),s(()=>this.groupDisplay,()=>this._syncGroupInputStates())])}loadDependencies(){return Promise.all([H({action:()=>import(`@esri/calcite-components/dist/components/calcite-action`),autocomplete:()=>import(`@esri/calcite-components/dist/components/calcite-autocomplete`),"autocomplete-item":()=>import(`@esri/calcite-components/dist/components/calcite-autocomplete-item`),block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),checkbox:()=>import(`@esri/calcite-components/dist/components/calcite-checkbox`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),dialog:()=>import(`@esri/calcite-components/dist/components/calcite-dialog`),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`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`)}),R()])}destroy(){this._destroyAssociationsWidgets(),this._associationsList=a(this._associationsList),this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){let{features:e,messages:t,page:n}=this;return t?n===`replacing-attachment`?t.titles.replaceAttachment:n===`viewing-attachment-details`?t.titles.editAttachment:n===`adding-attachments`?t.titles.addAttachments:n===`viewing-attachments`?t.titles.attachments:e.length===1||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:``:``}get effectiveDisabled(){return this.disabledOrReadOnly||this.viewModel.updating}get disabledOrReadOnly(){return this.disabled||this.readOnly}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length||!this.messages||!this.messagesCommon)return[];let{messages:e,messagesCommon:t,page:n}=this,r=this.effectiveDisabled;if(n===`adding-attachments`||n===`replacing-attachment`)return[];if(n===`viewing-attachment-details`){let t=this.selectedAttachmentDetails,n=t?.input?.getAttachmentEditState(t.attachment);return!t?.input||!n?[]:n.isRenamed||n.isReplaced?ae({doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons,resetOnclick:()=>this._resetSelectedAttachmentChanges(),resetDisabled:this._disableAttachmentModification(t.input)}):oe({deleteDisabled:this._disableAttachmentModification(t.input),deleteOnclick:()=>this._deleteSelectedAttachment(),doneOnclick:()=>this._setSelectedAttachment(null),messages:e.footerButtons})}return n===`viewing-associated-features`?T({messages:t,purpose:`cancel-viewing-associated-features`,onclick:()=>this.goBack()}):n===`viewing-associated-layers`?T({messages:t,purpose:`cancel-viewing-associated-layers`,onclick:()=>this.goBack()}):n===`viewing-attachments`||n===`viewing-related-records`?[]:E({disabled:r||!this.valid,formId:this._formId,messages:e,callback:()=>this.submit()})}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return`edit-attributes`}set icon(e){this._overrideIfSome(`icon`,e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formHeaderVisible(){return this.viewModel.mode===`batch`||!this.viewModel.activeFeature?!1:!!(this.viewModel.formDescription||this.viewModel.formTitle)}get _associationsEnabled(){let{callbacks:e}=this;return!!(e?.addAssociation||e?.editAssociatedFeature)}get _formId(){return`${this.id}-form`}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord))}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){let e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;let{groupInput:t}=e;t&&(t.open||=!0),this._setFocusableInput(e.input),this.scheduleRender()}render(){return J(`div`,{class:this.classes(w.base,K.widget,K.panel),ondragover:this._handleDragAndDrop,ondrop:this._handleDragAndDrop},this._renderContent(),this._renderAttachmentDialog(),this._prompt?J(B,{...this._prompt,headingLevel:this.headingLevel}):void 0)}setActiveAssociationsInput(e){this.viewModel.setActiveAssociationsInput(e)}setActiveAssociationsLayer(e){this.viewModel.setActiveAssociationsLayer(e)}setActiveAssociationType(e){this.viewModel.setActiveAssociationType(e)}submit(){return this.viewModel.submit()}get test(){return{saveInput:this._saveInput.bind(this),pendingSubtypeChoice:this._pendingSubtypeChoice,touchedInputs:this._touchedInputs}}_setDateTimeTimeZoneMap(e){let{datePart:t,elementId:n}=e.dataset,r=i(this._dateComponentMap,`${n}`,()=>({}));switch(t){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}}_renderContent(){let{messages:e,viewModel:n}=this,{status:r}=n;if(r===`failed`)return n.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:n.maximumFeatureCountWithComplexForms})):n.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:n.maximumFeatureCount})):e.formFailedToLoad;if(n.hasLayersWithContingentValues&&this.viewModel.features.length>1)return this._renderErrorNotice(e.unsupportedContingentValues);if(r===`loading`&&this.visibleElements.loadingIndicator)return J(`calcite-loader`,{key:`loader`,label:this.messagesCommon?.loading});if(this.features.length!==0)return this._renderForm()}_renderErrorNotice(e,t=`warning`){return J(`calcite-notice`,{class:w.noticeError,icon:!0,kind:t,open:!0},J(`div`,{slot:`message`},e))}_renderForm(){return J(`form`,{class:w.form,id:this._formId,inert:!!this._prompt,onsubmit:this._onFormSubmit},this.viewModel.expressionEvaluationFailed&&this.visibleElements.expressionsErrorNotice&&this._renderErrorNotice(this.messages.expressionEvaluationFailed),this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case`adding-attachments`:return this._renderAttachmentAddPage();case`viewing-attachment-details`:case`replacing-attachment`:return this._renderAttachmentDetailPage();case`viewing-attachments`:return this._renderAttachmentListPage();case`viewing-associated-layers`:case`viewing-associated-features`:return this._renderViewingAssociationsPage();case`viewing-related-categories`:case`viewing-related-records`:return this._renderRelationshipListPage();default:return this._renderDefaultPage()}}_renderInvisibleFieldsError(){let{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:n}=e,r;if(!e.submitHasBeenAttempted)return null;if(n.invalidHiddenInputs.length>0){if(r=ne(n,e.mode,this.messages),this.viewModel.mode===`batch`){let e=n.invalidHiddenInputs.filter(e=>e.effectiveVisibilityCode===`hidden:group-visibility-expression:all-features`||e.visibilityCode===`hidden:visibility-expression:all-features`);e.length>0?r+=` (${e.map(e=>e.label).join(`, `)})`:r=null}else r=null}else if(t)return null;return r?this._renderErrorNotice(r,`danger`):null}_renderDefaultPage(){return[this._renderReadOnlyNotice(),this._renderFormHeader(),this._renderFormContent()]}_renderReadOnlyNotice(){if((this.disabled||this.readOnly)&&this.visibleElements.readOnlyNotice)return J(`calcite-notice`,{class:w.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},this.featureFormMessages.disabledForm))}_renderFormHeader(){let{formTitle:e,formDescription:t}=this.viewModel;if(!this._formHeaderVisible)return;let n=e?J(he,{key:`title`,level:this.headingLevel},e):void 0,r=t?J(`p`,{class:w.description,key:`description`},t):void 0;return J(`div`,{class:w.formHeader},n,r)}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){if(A(e))return this._renderGroupInput(e);if(j(e))return this._renderLabeledField(e);if(se(e))return this._renderTextComponent(e);if(ce(e))return this._renderRelationshipElementInput(e);if(le(e))return this._renderAttachmentElementInput(e);if(ue(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderGroupInput(e){let{inputs:t,template:n,open:r}=e,i=t.filter(e=>e.visible),a=e.label??``,o=this._focusedFieldInput?.group===e,s=this.groupDisplay===`sequential`;return J(`calcite-block`,{class:this.classes(w.group,s?w.groupSequential:null,o?w.groupActive:null,this.disabled?w.inputDisabled:null),description:e.description??void 0,expandable:!0,expanded:r,heading:a,headingLevel:this.headingLevel,key:`{${n.elementId}-key}`,label:a,onCalciteBlockCollapse:({currentTarget:t})=>{e.open=!1,this._onGroupToggle(t,e)},onCalciteBlockExpand:({currentTarget:t})=>{e.open=!0,this._onGroupToggle(t,e)}},i.map(e=>this._renderInput(e)))}_renderLabeledField(e){let{elementId:n}=e.template,{label:r,required:i,dataType:a}=e,o=i?t(this.messages.requiredFieldLabel,{name:r}):r;return J(`calcite-label`,{"aria-label":o,class:w.label,key:`field--${n}`},J(`div`,{class:w.labelTextContent,key:`labelTextContainer`},r,i?J(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),a===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){let t=this.getCommonInputProps(e),{dataType:n}=e;return O(e.inputController)?this._renderDynamicChoiceComponent({input:e,props:t,controller:e.inputController}):e.domain?.type===`coded-value`?this._renderCodedInputs({input:e,props:t}):k(e.inputController)?this._renderMultipleChoiceComponent({input:e,props:t}):n===`date`?this._renderDateComponents(e,t):(t.disabled=this.disabled,t.readOnly=t.readOnly||this.viewModel.updating,n===`number`?this._renderNumberComponent(e,t):this._renderStringComponent(e,t))}_renderAuxiliaryText(e){let{description:t}=e,n=this._getErrorToDisplay(e),r=n?x(e,n,this.messages):null;return r?J(`calcite-input-message`,{icon:!0,status:`invalid`},r):e.valueIsOutOfDomain&&(this._touchedInputs.has(e.template.elementId)||this.viewModel.submitHasBeenAttempted)?J(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):t?J(`calcite-input-message`,{class:w.description,icon:!1,status:`idle`},t):null}_renderCodedInputs({input:e,props:t}){let n=e.input?.type??null,r=e.codedValueOptions;switch(n){case`switch`:return this._renderSwitchField({input:e,props:t});case`radio-buttons`:return this._renderRadioButtonGroupComponent({input:e,options:r,props:t});default:return this._renderComboBoxComponent({options:r,props:t,input:e})}}_renderDynamicChoiceComponent({input:e,props:t,controller:n}){let r=n.filteredChoices,i=t.readOnly||t.disabled,a=e.showNoValueLabel||this.messages.empty,o=n.evaluated&&!n.evaluating&&!n.choices.length&&J(`calcite-notice`,{appearance:`transparent`,kind:`neutral`,open:!0,scale:`s`,slot:`content-bottom`,width:`full`},J(`div`,{slot:`message`},e.showNoValueOptionEnabled?this.messages.noDynamicChoicesWithNoValue:this.messages.noDynamicChoices)),s=t=>{this._saveInput(e,t)},l=(e,t)=>{this._dynamicChoiceItemSelections.delete(n);let r=e.closest(`calcite-autocomplete`);if(r){let e=t==null?``:n.getLabel(t);n.filterValue=``,r.inputValue=e}s(t)},u=({currentTarget:t})=>{let r=t.inputValue??``;n.filterValue=r,!r&&e.value!=null&&s(null)},d=e.showNoValueOptionEnabled?J(`calcite-autocomplete-item`,{disabled:i,heading:a,key:`dynamic-choice-empty`,selected:e.value==null,value:``,onCalciteAutocompleteItemSelect:({currentTarget:e})=>l(e,null),onpointerdown:()=>{this._dynamicChoiceItemSelections.add(n)}}):null,f=t=>{this.addHandles(c(()=>!n.initialEvaluationInProgress,()=>{t.inputValue=e.value===M?this.messages.differentValuesPlaceholder:e.value==null?``:n.inputValue},{once:!0,initial:!0}))};return J(`calcite-autocomplete`,{...t,afterCreate:f,disabled:i&&!n.interactionActive,loading:n.initialEvaluationInProgress,placeholder:e.value==null?a:t.placeholder,value:t.value===M?this.messages.differentValuesPlaceholder:String(t.value),onblur:e=>this._onDynamicChoiceBlur(e,n),onCalciteAutocompleteBeforeOpen:()=>n.beginInteraction(),onCalciteAutocompleteTextInput:u},n.evaluating?J(`calcite-loader`,{key:`dynamic-choice-loader`,label:this.messagesCommon.loading,scale:`s`,slot:`content-top`}):[o,d,...r.map(t=>J(`calcite-autocomplete-item`,{disabled:i,heading:t.name,key:`dynamic-choice-${t.code}`,selected:t.code===e.value,value:String(t.code),onCalciteAutocompleteItemSelect:({currentTarget:e})=>l(e,t.code),onpointerdown:()=>{this._dynamicChoiceItemSelections.add(n)}}))])}_renderMultipleChoiceComponent({input:e,props:t}){let{messages:n}=this,r=this._getMultipleChoiceController(e);if(!r)return null;let{input:i}=r,a=i.includeSelectAllChoices===!0,{checkboxStatesByValue:o,selectAllState:s}=r.selectionState,c=s.checked?n.deselectAllLabel:n.selectAllLabel,l=r.otherChoiceRenderState;return J(`div`,{class:w.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},a?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:s,selectAllLabel:c,handleSelectAllCheckboxChange:t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})}}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})}}),l.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:a,otherChoiceRenderState:l,handleOtherChoiceCheckboxChange:t=>{let{fieldName:n}=l;n&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:n})},handleOtherChoiceInputChange:t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:l.fieldName??void 0})},differentValuesPlaceholder:n.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:n,handleSelectAllCheckboxChange:r}){return J(`calcite-checkbox`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],checked:t.checked,class:w.multipleChoiceSelectAll,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:n,labelText:n,value:`esri_BatchAttributeForm_select_all`,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:n,handleChoiceCheckboxChange:r}){let i=this._getMultipleChoiceController(e);if(!i)return[];let{choices:a}=i;return a.map(e=>{let i=n.get(e.value)??{checked:!1,indeterminate:!1};return J(`calcite-checkbox`,{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t[`aria-invalid`],checked:i.checked,class:t.class,"data-element-id":t[Z],disabled:t.readOnly||t.disabled,indeterminate:i.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:t.onfocus})})}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:n,handleOtherChoiceCheckboxChange:r,handleOtherChoiceInputChange:i,differentValuesPlaceholder:a}){let o=n.label??this.messages.otherOptionLabel;return J(`div`,{class:this.classes(w.multipleChoiceOtherChoice,t?w.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},J(`calcite-checkbox`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],checked:n.checkboxState.checked,class:e.class,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,indeterminate:n.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:o,labelText:o,value:`esri_BatchAttributeForm_other_choice`,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>r(e),onfocus:e.onfocus}),n.checkboxState.checked?J(`calcite-input`,{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e[`aria-invalid`],"aria-label":o,class:w.textElementInput,"data-element-id":e[Z],disabled:e.readOnly||e.disabled,key:`${e.key}-other-choice-input`,maxLength:n.maxLength,placeholder:n.value===M?a:n.hint,status:n.status,type:`text`,value:n.normalizedValue===M?``:n.normalizedValue?String(n.normalizedValue):``,onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>i(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:n=!1}){this._markInputTouched(e);let r=this._getMultipleChoiceController(e);if(!r)return;if(r.input&&!n&&this.viewModel.mode===`batch`){await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});return}let i=e.value,a=this._parseValue(t,e,n);a!==i&&await this.viewModel.setValue(e.template.elementId,a)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:n}){if(!n)return;let r=t.value,i=r==null||r===``?null:r,a=this._getMultipleChoiceController(e);if(!a)return;a.initializeExplicitOtherChoiceCheckedState(),a.stashOtherChoiceDraftValueForFeatures(e.features,i);let o=N(e,n);o&&await this.viewModel.setValueForFieldName(o,i,Array.from(e.features,e=>e.source))}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:n}){let r=this._getMultipleChoiceController(e);if(!r)return;r.setExplicitOtherChoiceCheckedState(t),this._markInputTouched(e),t||r.setOtherChoiceDraftValuesFromFeatures(e.features.toArray());let i=N(e,n);if(!i)return;let a=new Map;for(let i of e.features){let e=i.getAttribute(n);if(t){if(!Y(e))continue;let t=r.getOtherChoiceDraftValue(i),n=L(t)?t:I;a.set(i,n)}else e!=null&&a.set(i,null)}a.size!==0&&await this.viewModel.setValuePerFeatureForFieldName(i,new Map(Array.from(a,([e,t])=>[e.source,t])))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){let n=this._getMultipleChoiceController(e);if(!n)return;let r=new Map(e.features.map(r=>[r,n.getUpdatedValueForFeature({choiceValue:t.value,currentValue:r.getAttribute(e.fieldName),isChecked:t.checked})]));r.size!==0&&await this.viewModel.setFieldInputValuePerFeature(e,r)}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===M||e.value===M)&&this.viewModel.mode===`batch`){let n={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,onblur:t.onblur,onfocus:t.onfocus,[Z]:t[Z]},trigger:{appearance:`transparent`,iconEnd:`chevron-down`,kind:`neutral`,slot:`trigger`,label:t.label},group:{mode:`single`}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:n,options:[{name:this.messages.differentValuesPlaceholder,value:M,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return J(`calcite-switch`,{...t,checked:S(e.template,`switch`)?e.value===e.template.input.onValue:!1,class:w.inputSwitch,disabled:t.readOnly||t.disabled,onCalciteSwitchChange:({currentTarget:e})=>this._saveInputFromElement(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:n}){let{trigger:r,dropdown:i,group:a}=n;return J(`calcite-dropdown`,{...i,topLayerDisabled:this.topLayerDisabled,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInputFromElement(e)},J(`calcite-button`,{...r},e===M?this.messages.differentValuesPlaceholder:e),J(`calcite-dropdown-group`,{selectionMode:a.mode},t.map(t=>J(`calcite-dropdown-item`,{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:n}){let r=this.viewModel.editType===`INSERT`,i=this._touchedInputs.has(e?.template.elementId),a=r&&e.showNoValueOptionEnabled&&!i?()=>{}:n.onblur,o={...n,onblur:a};return J(`calcite-combobox`,{...o,clearDisabled:e.isSubtypeField,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,value:n.placeholder===this.messages.differentValuesPlaceholder?M:String(n.value),onCalciteComboboxChange:({currentTarget:t})=>{t.value!==M&&(e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveInputFromElement(t))}},this.renderComboboxOptionsList({input:e,options:t,props:n}))}renderComboboxOptionsList({input:e,options:t,props:n}){let r=e=>e.map(e=>{let{value:t}=e,r=Y(e.value)?this.messages.empty:e.name;return J(`calcite-combobox-item`,{heading:r,key:`#${t}`,selected:n.value===t,value:`${t}`})}),i=[],{messages:a}=this;t.other.length>0&&i.push(J(`calcite-combobox-item-group`,{key:`other`,label:a.other},r(t.other))),t.unsupported.length>0&&i.push(J(`calcite-combobox-item-group`,{key:`unsupported`,label:a.unsupported},r(t.unsupported)));let o=r(t.recommended);i.length>0?i.unshift(J(`calcite-combobox-item-group`,{key:`recommended`,label:a.recommended},o)):i=o;let s=n.placeholder===this.messages.differentValuesPlaceholder,c=!s&&Y(n.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&i.unshift(J(`calcite-combobox-item`,{heading:e.showNoValueLabel||this.messages.empty,key:`empty-option`,selected:c,value:``})),s&&i.unshift(J(`calcite-combobox-item`,{heading:this.messages.differentValuesPlaceholder,key:M,selected:!0,value:M})),i}_renderRadioButtonGroupComponent({input:e,options:t,props:n}){let r=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:r})=>this._renderRadioButtons({label:t,value:r,selected:r===e.value,props:n}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){let t=e.showNoValueLabel||this.messages.empty,i=Y(e.value);r.unshift(this._renderRadioButtons({label:t,value:``,selected:i,props:n}))}return J(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:w.inputRadioGroup,"data-field-name":n[Q],disabled:n.readOnly||n.disabled,key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.name}-${this.id}`,required:n.required},r,n.placeholder===this.messages.differentValuesPlaceholder?J(`calcite-label`,{class:w.placeholderRadio,key:n.label,layout:`inline`},J(`calcite-radio-button`,{checked:!0,class:w.inputRadio,disabled:!0,value:n.placeholder}),n.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:n,props:r}){return J(`calcite-label`,{class:w.inputRadioLabel,key:r.label,layout:`inline`},J(`calcite-radio-button`,{...r,afterCreate:void 0,afterUpdate:void 0,checked:t,class:w.inputRadio,disabled:r.readOnly||r.disabled,name:void 0,value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInputFromElement(e)}}),n)}_renderStringComponent(e,t){let{template:n}=e;return!n.field.editable||this.readOnly?this._renderReadOnlyComponent(e):n.input?.type===`text-area`?J(`calcite-text-area`,{...t,class:this.classes(w.individualElement),resize:`vertical`,value:t.value?String(t.value):``,onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteTextAreaInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}}):J(`calcite-input`,{...t,class:this.classes(w.individualElement),type:`text`,value:t.value?String(t.value):``,onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteInputInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}})}_renderNumberComponent(e,t){let n=h(e.field);return J(`calcite-input-number`,{...t,integer:n,step:n?1:`any`,type:`number`,value:n&&t.value!==``?Math.round(parseFloat(String(t.value))).toString():String(t.value),onblur:n=>{t.onblur(n),e.userHasChangedValue&&this._saveInputFromElement(n.currentTarget)},onCalciteInputNumberInput:t=>{e.userHasChangedValue=!0,t.currentTarget.value===``&&this._saveInputFromElement(t.currentTarget)}})}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return J(`calcite-input`,{...n,class:this.classes(w.fieldInput,w.inputDisabled,w.individualElement),readOnly:!0,type:`text`,value:String(t??n.value??``)})}_renderDateComponents(e,t){let{field:n}=e,r;switch(n.type){case`date`:r=this._renderDateFieldComponents(e,t);break;case`date-only`:r=this._renderDateOnlyFieldComponent(e,t);break;case`time-only`:r=this._renderTimeOnlyFieldComponent(e,t);break;case`timestamp-offset`:r=this._renderTimestampOffsetFieldComponents(e,t);break;default:r=this._renderReadOnlyComponent(e,de(n,t.value,{timeZone:e.effectiveTimeZone,...fe(e.template.field)}))}return e.value===M?[r,J(`calcite-input-message`,{icon:`information`,key:`diff-values-message`,status:`idle`},this.messages.differentValues)]:r}_renderDateOnlyFieldComponent(e,t){let{class:n,disabled:r,key:i,readOnly:a}=t,{rawMax:o,rawMin:s}=e.range;return J(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:n,"data-date-part":`date`,"data-element-id":t[Z],"data-field-name":t[Q],disabled:r,key:`${i}-date-input`,max:g(o)?o:void 0,min:g(s)?s:void 0,overlayPositioning:`fixed`,readOnly:a,topLayerDisabled:this.topLayerDisabled,value:e.value===M?``:e.value?String(e.value):``,onblur:t.onblur,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:t.onfocus})}_renderTimeOnlyFieldComponent(e,t){let{class:n,disabled:r,key:i,readOnly:a}=t;return J(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,class:n,"data-date-part":`time`,"data-element-id":t[Z],"data-field-name":t[Q],disabled:r,key:`${i}-time-input`,overlayPositioning:`fixed`,readOnly:a,step:e.timeStep,value:e.value===M?``:e.value?String(e.value):``,onblur:t.onblur,onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:t.onfocus})}_renderTimestampOffsetFieldComponents(e,t){let{class:n,disabled:r,key:i,readOnly:a,onblur:o,onfocus:s}=t,{rawMax:c,rawMin:l}=e.range,u=e.effectiveTimeZone,d=U(c,u),f=U(l,u),p=U(e.value===M?``:e.value,u),m=e.includeTimeOffset,h={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:r,[Z]:t[Z],[Q]:t[Q],onblur:o,onfocus:s,overlayPositioning:`fixed`,readOnly:a};return J(`div`,{class:w.dateInputContainer,key:`${i}-date-time-container`},J(`calcite-input-date-picker`,{...h,class:n,"data-date-part":`date`,key:`${i}-date-input`,max:d?.date??void 0,min:f?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??``,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),J(`calcite-input-time-picker`,{...h,class:n,"data-date-part":`time`,key:`${i}-time-input`,step:e.timeStep,value:p.time??``,onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?J(`calcite-input-time-zone`,{...h,class:n,clearable:e.value===M||e.value==null,"data-date-part":`timeZone`,key:`${i}-timezone-input`,value:p.timeZoneOffset||``,onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){let{class:n,disabled:r,key:i,readOnly:a,min:o,max:s}=t,c=e.effectiveTimeZone,l=W(e.value===M?``:e.value,c),u=W(s,c),d=W(o,c),f=e.includeTime,p={afterCreate:this._afterDateComponentCreateOrUpdate,afterUpdate:this._afterDateComponentCreateOrUpdate,disabled:r,[Z]:t[Z],[Q]:t[Q],onblur:t.onblur,onfocus:t.onfocus,overlayPositioning:`fixed`,readOnly:a};return J(`div`,{class:w.dateInputContainer,key:`${i}-date-time-container`},J(`calcite-input-date-picker`,{...p,class:n,"data-date-part":`date`,key:`${i}-date-input`,max:u?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:l.date??``,onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),f?J(`calcite-input-time-picker`,{...p,"data-date-part":`time`,key:`${i}-time-input`,step:1,value:l.time??``,onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){return this._relatedRecordsEnabled?J(z,{afterObserverCreated:this._afterListObserverCreated,afterObserverRemoved:this._afterListObserverRemoved,input:e,messages:this.messages,messagesCommon:this.messagesCommon,viewModel:this.viewModel}):null}_renderRelationshipListPage(){let{activeRelationshipInput:e}=this.viewModel;if(e)return this._renderRelationshipElementInput(e)}_renderAttachmentElementInput(e){if(!this.attachmentsEnabled)return;let{allAttachmentsVisibleOnDefaultPage:t,attachments:n,defaultPageAttachments:r,template:{description:i,elementId:a,label:o}}=e,s=t?n:r;return J(`div`,{class:w.attachmentElementInput,"data-testid":`attachment-element-${a}`,key:`attachment-element-${a}`},o?J(`div`,{class:w.attachmentElementLabel,key:`attachment-element-label-${a}`},o):null,i?J(`div`,{class:w.description,key:`attachment-element-description-${a}`},i):null,n.length?this._renderAttachmentList(e,s,{label:o||this.messagesCommon.details,viewAllCount:t?null:n.length}):J(`div`,{class:w.attachmentElementEmptyState,key:`attachment-element-empty-state-${a}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){let e=this.viewModel.selectedAttachmentListInput;if(e)return J(`div`,{class:w.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,n){let{filterEnabled:r,label:i,viewAllCount:a}=n;return J(`calcite-list`,{class:w.attachmentElementList,filterEnabled:r,filterPlaceholder:r?this.messages.attachments.searchAttachments:void 0,filterProps:r?ge:void 0,filterText:r?this._attachmentListFilterText:void 0,label:i,selectionAppearance:`border`,selectionMode:`none`,onCalciteListFilter:r?e=>{this._attachmentListFilterText=e.currentTarget.filterText??``}:void 0},this._renderAttachmentListItems(e,t),a==null?null:this._renderViewAllAttachmentsItem(e,a))}_renderAttachmentListItems(e,t){let{elementId:n}=e.template;return t.map((t,r)=>{let i=this._formatAttachmentSize(t.size),a=this._getAttachmentLabel(t,r,i,e.displayFilename),o=a===i?void 0:i,s=v(t),c=e.isStagedAttachmentAddition(t),l=e.getAttachmentEditState(t),u=l.isDeleted,d=!u&&(c||l.isRenamed||l.isReplaced);return J(`calcite-list-item`,{class:w.attachmentElementListItem,description:o,key:`attachment-item-${s}`,label:a,onCalciteListItemSelect:c||u?void 0:()=>this._setSelectedAttachment({attachmentKey:s,elementId:n})},J(`div`,{class:w.attachmentElementListItemStart,slot:`content-start`},this._renderAttachmentPreviewThumbnail(t,a,e)),d?J(`span`,{class:w.attachmentElementListItemStagedIndicator,slot:`content-end`}):null,c?[J(`calcite-action`,{disabled:this._disableAttachmentModification(e),icon:`x`,scale:`s`,slot:`actions-end`,text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(n,v(t))})]:u?J(`calcite-chip`,{label:this.messages.attachments.deleted,scale:`s`,slot:`content-end`},this.messages.attachments.deleted):J(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))})}_renderViewAllAttachmentsItem(e,n){let{elementId:r}=e.template,{viewAll:i}=this.messages.attachments;return J(`calcite-list-item`,{class:w.attachmentElementListItem,description:t(this.messages.attachments.count,{count:n}),key:`attachment-item-view-all-${r}`,label:i,onCalciteListItemSelect:()=>this._setAttachmentListElementId(r)},J(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderAttachmentAddAction(e){let{elementId:t}=e.template,n=this.effectiveDisabled||e.addDisabled,r=this._renderAttachmentCountLimitsLabel(e),i=this._getAttachmentNoticeMessage(e),a=e.hasMinimumAttachmentCountNotMet||e.hasExceededAttachmentLimit?`danger`:`info`,o=e.canUploadFiles,s=e.isCaptureOnly&&!this.effectiveDisabled&&!i;return J(`div`,{class:w.attachmentElementAddActions,key:`attachment-element-add-actions-${t}`},o?J(`calcite-button`,{appearance:`outline`,disabled:n,iconStart:`attachment`,kind:`neutral`,round:!0,scale:`s`,onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach):null,this._renderAttachmentCaptureButton(e),s?this._renderAttachmentCaptureDisabledNotice(t):null,r?J(`div`,{class:w.attachmentElementEmptyActionHint},r):null,!this.effectiveDisabled&&i?J(`calcite-notice`,{closable:!1,icon:a===`danger`?`exclamation-mark-circle`:`lightbulb`,kind:a,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},i)):null)}_renderAttachmentCaptureButton(e){if(!e.hasCaptureInputs)return null;let t=e.captureMediaType;return J(`calcite-button`,{appearance:`outline`,disabled:!0,iconStart:ye(t),kind:`neutral`,round:!0,scale:`s`},this._getCaptureButtonLabel(t))}_getAttachmentNoticeMessage(e){let t=this.messages.attachments;return e.hasUnsupportedFileTypeValidationError?this._getUnsupportedFileTypeMessage():e.hasMinimumAttachmentCountNotMet&&this._shouldShowMinimumAttachmentNotice(e)?t.minimumNotMet:e.hasExceededAttachmentLimit?t.attachmentLimitExceeded:e.hasReachedAttachmentLimit?t.attachmentLimitReached:null}_shouldShowMinimumAttachmentNotice(e){return e.hasAttachmentChanges||this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId)}_getCaptureButtonLabel(e){let{capture:t,recordAudio:n,takePhoto:r,takeVideo:i}=this.messages.attachments;switch(e){case`image`:return r||t;case`video`:return i||t;case`audio`:return n||t;default:return t}}_renderAttachmentAddPage(){let e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){let{maxAttachmentCount:t}=e,{elementId:n}=e.template;if(e.isCaptureOnly)return this._renderAttachmentCaptureDisabledNotice(n);let r=t==null||t-e.attachments.length>1,i=this.effectiveDisabled||e.addDisabled,a=this.messages.attachments,o=a.dragAndDropFile,s=e=>{this._attachmentFileInputMap.set(n,e)};return J(`div`,{class:w.attachmentElementAddPanel,key:`attachment-element-add-panel-${n}`},J(`input`,{accept:e.accept,afterCreate:s,afterRemoved:()=>{this._attachmentFileInputMap.delete(n)},afterUpdate:s,class:w.attachmentElementFileInput,"data-element-id":n,disabled:i,multiple:r,type:`file`,onchange:e=>{let t=e.currentTarget,r=t.files?Array.from(t.files):[];this._stageAttachmentFiles(n,r),t.value=``}}),J(`div`,{class:w.attachmentElementAddDropzone,"data-disabled":i?`true`:`false`,ondragover:e=>{e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},ondrop:e=>{if(e.preventDefault(),e.stopPropagation(),i)return;let t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(n,t)}},J(`calcite-icon`,{class:w.attachmentElementAddDropzoneIcon,icon:`upload`,scale:`l`}),J(`div`,{class:w.attachmentElementAddDropzoneHeading},a.addFile),J(`div`,{class:w.attachmentElementAddDropzoneDetail,title:o},o),J(`calcite-button`,{appearance:`transparent`,disabled:i,iconStart:`folder-open`,kind:`brand`,scale:`s`,type:`button`,onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(n,i)}},a.selectFile)),this._renderAttachmentValidationCriteria(e,{includeCountCriteria:!0}))}_renderAttachmentCaptureDisabledNotice(e){return J(`calcite-notice`,{class:w.attachmentElementCaptureNotice,icon:!0,key:`attachment-element-capture-disabled-notice-${e}`,kind:`warning`,open:!0,scale:`s`},J(`div`,{slot:`message`},this.messages.attachments.captureMethodNotSupported))}async _stageAttachmentFiles(e,t){if(t.length===0)return;let n=this.viewModel.selectedAttachmentAddInput,r=!0;try{r=(await this.viewModel.stageAddAttachments(e,t)).length>0&&!n?.hasInvalidValidationCriteria&&!n?.hasUnsupportedFileTypeValidationError}finally{r&&this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){let e=this.selectedAttachmentDetails;if(!e)return;if(this.page===`replacing-attachment`)return this._renderAttachmentReplacePanel(e);let{attachment:t,input:n}=e,r=v(t),i=!!n.getAttachmentPreviewUrl(t),a=!this._disableAttachmentModification(n)&&n.canUploadFiles,o=n.getAttachmentEditState(t);return J(`div`,{class:w.attachmentElementDetail,key:`attachment-detail-panel-${n.template.elementId}-${r}`},J(`div`,{class:w.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,n)),J(`div`,{class:w.attachmentElementDetailActions},y(t)?J(`calcite-button`,{appearance:`outline`,disabled:!i,iconStart:`expand`,kind:`neutral`,label:this.messages.attachments.maximize,scale:`m`,title:this.messages.attachments.maximize,onclick:this._maximizeSelectedAttachment}):null,J(`calcite-button`,{appearance:`outline`,disabled:!i||o.isReplaced,iconStart:`download`,kind:`neutral`,label:this.messages.attachments.download,scale:`m`,title:this.messages.attachments.download,onclick:()=>{this._downloadAttachment(t)}}),J(`calcite-button`,{appearance:`outline`,disabled:!a,iconStart:`upload-to`,kind:`neutral`,label:this.messages.attachments.replace,scale:`m`,title:this.messages.attachments.replace,onclick:this._enterAttachmentReplaceView})),J(`div`,{class:w.attachmentElementDetailMetadata},J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),this._renderFileNameContent(t,n)),J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.size),J(`span`,{class:w.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size))),J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.type),J(`span`,{class:w.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t)))))}_renderFileNameContent(e,t){if(!t.allowUserRename)return J(`span`,{class:w.attachmentElementDetailMetadataValue},e.name);let n=t.getAttachmentEditState(e),{baseName:r,extension:i}=b(e.name),a=this._disableAttachmentModification(t),o=!a&&e.name.trim().length===0;return[J(`div`,{class:w.attachmentElementDetailFileNameRow,key:`file-name-row`},J(`calcite-input`,{class:w.attachmentElementDetailFileNameInput,disabled:a,scale:`m`,status:o?`invalid`:`idle`,suffixText:i,value:r,onCalciteInputInput:({currentTarget:e})=>this._renameSelectedAttachment(e.value)}),J(`calcite-button`,{appearance:`transparent`,disabled:a||n.initialName==null||!n.isRenamed,iconStart:`reset`,kind:`neutral`,label:this.messages.footerButtons.reset,scale:`m`,title:this.messages.footerButtons.reset,onclick:this._resetSelectedAttachmentName})),o?J(`calcite-input-message`,{icon:!0,key:`file-name-message`,status:`invalid`},this.messages.validationErrors.cannotBeNull):null]}_renderAttachmentReplacePanel(e){let{attachment:t,input:n}=e,r=this._disableAttachmentModification(n)||!n.canUploadFiles,i=n.template.elementId;return J(`div`,{class:w.attachmentElementAddPanel,key:`attachment-replace-panel-${i}-${v(t)}`},J(`input`,{accept:n.accept,afterCreate:this._setSelectedAttachmentReplaceFileInput,afterRemoved:()=>{this._selectedAttachmentReplaceFileInput=null},afterUpdate:this._setSelectedAttachmentReplaceFileInput,class:w.attachmentElementFileInput,disabled:r,type:`file`,onchange:e=>{let t=e.currentTarget,n=t.files?.[0];n&&this._stageSelectedAttachmentReplacement(n),t.value=``}}),J(`div`,{class:w.attachmentElementAddDropzone,"data-disabled":r?`true`:`false`,ondragover:e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`)},ondrop:e=>{if(e.preventDefault(),e.stopPropagation(),r)return;let t=e.dataTransfer?.files?.[0];t&&this._stageSelectedAttachmentReplacement(t)}},J(`calcite-icon`,{class:w.attachmentElementAddDropzoneIcon,icon:`refresh`,scale:`l`}),J(`div`,{class:w.attachmentElementAddDropzoneHeading},this.messages.attachments.replace),J(`div`,{class:w.attachmentElementAddDropzoneDetail,title:this.messages.attachments.dragAndDropFile},this.messages.attachments.dragAndDropFile),J(`calcite-button`,{appearance:`transparent`,disabled:r,iconStart:`folder-open`,kind:`brand`,scale:`s`,onclick:e=>{e.stopPropagation(),this._openSelectedAttachmentReplaceFilePicker()}},this.messages.attachments.selectFile)),this._renderAttachmentValidationCriteria(n,{includeCountCriteria:!1}),J(`div`,{class:w.attachmentElementDetailMetadata},J(`div`,{class:w.attachmentElementDetailMetadataGroup},J(`span`,{class:w.attachmentElementDetailMetadataLabel},this.messages.attachments.fileToBeReplaced),J(`span`,{class:w.attachmentElementDetailMetadataValue},t.name))))}_renderAttachmentDialog(){let e=this._attachmentDialogInfo;if(!e)return null;let{attachment:t,input:n}=e;return J(`calcite-dialog`,{heading:t.name||this.messagesCommon.details,key:`attachment-preview-dialog`,modal:!0,open:!0,placement:`cover`,width:`l`,onCalciteDialogClose:this._closeAttachmentDialog},J(`div`,{class:w.attachmentElementDialogPreview},this._renderAttachmentPreviewImageForInput(t,n)))}_setSelectedAttachment(e,t){this._markInputTouched(t),this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){let{viewModel:t}=this;t.setSelectedAttachmentAddElementId(e),this._markInputTouched(t.selectedAttachmentAddInput),t.selectedAttachmentAddInput?.clearValidationCriteriaState(),this.hideAttachmentDialog()}_setAttachmentListElementId(e){let{viewModel:t}=this;t.setSelectedAttachmentListElementId(e),this._markInputTouched(t.selectedAttachmentListInput),this.hideAttachmentDialog()}_getAttachmentLabel(e,n,r,i){return i!==!1&&g(e.name)&&e.name.length>0?e.name:r===this.messagesCommon.notApplicable?t(this.messages.attachments.attachmentNumberedLabel,{index:n+1}):r}_renderAttachmentCountLimitsLabel(e){let t=this.messages.attachments,n=e.minAttachmentCount!=null&&e.minAttachmentCount>0?this._renderAttachmentCountLimitLabel(t.minAttachmentsShort,e.minAttachmentCount,`min`):null,r=e.maxAttachmentCount==null?null:this._renderAttachmentCountLimitLabel(t.maxAttachmentsShort,e.maxAttachmentCount,`max`);return!n&&!r?null:[n,n&&r?J(`span`,{key:`attachment-count-limits-separator`},`, `):null,r]}_renderAttachmentCountLimitLabel(e,n,r){let i=`__count__`,[a,o]=t(e,{count:i}).split(i);return J(`span`,{key:r},a,J(`span`,{class:w.attachmentElementEmptyActionHintValue},n),o)}_renderAttachmentValidationCriteria(e,{includeCountCriteria:t}){let n=this._getAttachmentValidationCriteria(e,{includeCountCriteria:t}),r=`attachment-validation-criteria-${e.template.elementId}`;return n.length===0?null:J(`div`,{class:w.attachmentElementValidationCriteria,key:r},n.map(({key:e,message:t,state:n})=>J(`calcite-notice`,{appearance:n===`danger`?`outline-fill`:`transparent`,closable:!1,icon:!0,key:e,kind:n,open:!0,scale:`s`,width:`full`},J(`div`,{slot:`message`},t))))}_getAttachmentValidationCriteria(e,{includeCountCriteria:n}){let r=[],i=e.validationCriterionStates,a=this.messages.attachments,o=this._getNestableAttachmentInputs(e.input);e.hasUnsupportedFileTypeValidationError&&r.push({key:`unsupported-file-type`,message:this._getUnsupportedFileTypeMessage(),state:`danger`});for(let e of o)e.type===`document`&&e.maxFileSize!=null&&r.push({key:`maximum-file-size`,message:t(a.maximumFileSize,{maxSize:this._formatAttachmentSizeLimitInMegabytes(e.maxFileSize)}),state:i.get(`maximum-file-size`)??`info`}),e.type===`audio`&&e.maxDuration!=null&&r.push({key:`maximum-audio-length`,message:t(a.maximumAudioLength,{maxDuration:this._formatAttachmentDurationLimit(e.maxDuration)}),state:i.get(`maximum-audio-length`)??`info`}),e.type===`video`&&e.maxDuration!=null&&r.push({key:`maximum-video-length`,message:t(a.maximumVideoLength,{maxDuration:this._formatAttachmentDurationLimit(e.maxDuration)}),state:i.get(`maximum-video-length`)??`info`}),e.type===`image`&&e.maxImageSize!=null&&r.push({key:`maximum-image-size`,message:t(a.attachmentMustBeSmallerThan,{maxSize:`${e.maxImageSize}px`}),state:i.get(`maximum-image-size`)??`info`});return n&&e.minAttachmentCount!=null&&e.minAttachmentCount>0&&r.push({key:`minimum-number-of-files`,message:t(a.minimumNumberOfFiles,{count:e.minAttachmentCount}),state:i.get(`minimum-number-of-files`)??`info`}),n&&e.maxAttachmentCount!=null&&r.push({key:`maximum-number-of-files`,message:t(a.maximumNumberOfFiles,{count:e.maxAttachmentCount}),state:i.get(`maximum-number-of-files`)??`info`}),r}_getNestableAttachmentInputs(e){return e==null?[]:e.type===`attachment`?e.inputTypes?.slice()??[]:[e]}_getUnsupportedFileTypeMessage(){return this.featureTableMessages.errorFileUnsupported}_formatAttachmentSize(e){return e==null||Number.isNaN(e)?this.messagesCommon.notApplicable:d(this.messagesUnits,e)}_formatAttachmentSizeLimitInMegabytes(e){return d(this.messagesUnits,e*1048576)}_formatAttachmentDurationLimit(e){return m(Math.round(e)*1e3,{...e>=3600?{hour:`2-digit`,hourCycle:`h23`}:{},minute:`2-digit`,second:`2-digit`,timeZone:`UTC`})}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;let t=this.messages.attachments.attachmentTypes,n=te(e);return t?.[n]||e}_renderAttachmentPreviewThumbnail(e,t,n){let r=n.getAttachmentPreviewUrl(e,64);return r&&y(e)?J(`img`,{alt:t,class:w.attachmentElementListItemThumb,src:r}):J(`calcite-icon`,{class:w.attachmentElementListItemIcon,icon:_(e.contentType),scale:`s`})}_renderAttachmentPreviewImageForInput(e,t){let n=t.getAttachmentPreviewUrl(e),r=e.name||this.messagesCommon.details;return n&&y(e)?J(`img`,{alt:r,class:w.attachmentElementDetailPreviewImage,src:n,title:r}):[J(`calcite-icon`,{class:w.attachmentElementDetailPreviewIcon,icon:_(e.contentType),scale:`l`,textLabel:r,title:r}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await V(e)}_canReplaceSelectedAttachment(){return!this.effectiveDisabled&&!!this.selectedAttachmentDetails?.input.canUploadFiles}_exitAttachmentReplaceView(){this.viewModel.setShowingSelectedAttachmentReplacePage(!1),this._selectedAttachmentReplaceFileInput=null}async _stageSelectedAttachmentReplacement(e){let t=this.selectedAttachmentDetails;if(!t?.attachment)return;let n=t.input.template.elementId,r=v(t.attachment),i=!1;try{i=await this.viewModel.stageReplaceAttachment(n,r,e)}finally{i&&this._exitAttachmentReplaceView()}}_renameSelectedAttachment(e){let t=this.selectedAttachmentDetails;if(!t?.attachment)return;let n=t.input.template.elementId,r=v(t.attachment);this.viewModel.stageRenameAttachment(n,r,e)}_resetSelectedAttachmentChanges(){let e=this.selectedAttachmentDetails;e?.attachment&&this.viewModel.resetAttachmentChanges(e.input.template.elementId,v(e.attachment))}_deleteSelectedAttachment(){let e=this.selectedAttachmentDetails;if(!e?.attachment||this._disableAttachmentModification(e.input))return;let t=e.input.template.elementId,n=v(e.attachment);this.viewModel.stageDeleteAttachment(t,n),this._setSelectedAttachment(null)}_disableAttachmentModification(e){return this.disabledOrReadOnly||!e.editable}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){let{elementId:t}=e.template;return J(`div`,{class:w.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){if(!this._associationsEnabled)return;let{elementId:t}=e.template;return J(`div`,{class:w.utilityNetworkAssociationsElementInput,"data-testid":t,key:t},this._associationsWidgetsMap.get(e)?.render())}getCommonInputProps(e){let{template:t,valid:n,value:r,minLength:i,maxLength:a,required:o,fieldName:s,editable:c,range:{max:l,min:u}}=e,d=!c||this.readOnly,f=this.disabled||this.viewModel.updating,p=this._getErrorToDisplay(e)?`invalid`:`idle`,m=t.hint??void 0,h=!1;return r===M&&(m=this.messages.differentValuesPlaceholder,h=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?`false`:`true`,class:this.classes(w.fieldInput,d?w.inputDisabled:null),status:p,maxLength:a&&a>-1?a:void 0,minLength:i&&i>-1?i:void 0,key:t.elementId,label:s,name:s,max:l??void 0,min:u??void 0,disabled:f,readOnly:d,onblur:this._onComponentBlur,required:o,placeholder:m,value:h?``:r??``,[Z]:t.elementId,[Q]:s,onfocus:this._onComponentFocus}}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_onFormSubmit(e){e.preventDefault()}_handleDragAndDrop(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`)}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(Z))}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldInput=n}_markInputTouched(e){e&&this._touchedInputs.add(e.template.elementId)}_isMultipleChoiceCheckbox(e,t){let n=this._getMultipleChoiceController(t);return e.tagName===`CALCITE-CHECKBOX`&&n?.input!=null}_afterComponentCreateOrUpdate(e){let t=this._getFieldInputFromHTMLElement(e),n=this._focusedFieldInput;this._attemptFocusOnNextRender&&n===t&&(this._attemptFocusOnNextRender=!1,ve(e))}_onComponentBlur(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._isMultipleChoiceCheckbox(t,n)||this._markInputTouched(n),this._focusedFieldInput=null}_onDynamicChoiceBlur(e,t){let n=e.currentTarget;if(this._dynamicChoiceItemSelections.delete(t))return;let r=e.relatedTarget;r instanceof Node&&n.contains(r)||(t.endInteraction(),n.inputValue=t.fieldInput.value===M?this.messages.differentValuesPlaceholder:t.inputValue,this._onComponentBlur(e))}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._selectedAttachmentReplaceFileInput=null,this._attachmentListFilterText=``,this._attachmentFileInputMap.clear()}_parseValue(e,t,n=!1){let r=this._getMultipleChoiceController(t);if(r){let{input:t,values:i}=r;if(t&&i){let t=e;return r.getValueFromCheckboxChange({choiceValue:t.value,isChecked:t.checked,isSelectAllCheckbox:n})}}if(S(t.template,`switch`)){if(e.localName===`calcite-dropdown`&&t.domain){for(let n of t.domain.codedValues)if(n.name===e.selectedItems[0].textContent)return n.code}return e.checked?t.template.input.onValue:t.template.input.offValue}let i=e.value;return i==null||i===``?null:t.dataType===`number`?i===`-0`||i===`-0.`||i===`-0,`?i:parseFloat(i):t.field.type===`date`?parseFloat(i):i}_getMultipleChoiceController(e){return k(e.inputController)?e.inputController:null}_saveInputFromElement(e){let t=this._getFieldInputFromHTMLElement(e);if(!t)return;let n=this._parseValue(e,t);this._saveInput(t,n)}_saveInput(e,t){let{elementId:n}=e.template,r=e?.value,{viewModel:a}=this;if(S(e.template,`switch`)&&a.mode!==`single`){let t=i(this._batchSwitchInputInitialValues,e,()=>e.value);this._batchSwitchInputInitialValues.set(e,t===null?r:t)}t!==r&&(this._markInputTouched(e),!e.isSubtypeField||a.mode===`batch`||!re(a.activeLayer,r,t)?a.setValue(n,t):this._pendingSubtypeChoice||=this._handleSubtypeChoice(e,t))}async _handleSubtypeChoice(e,n){let{value:r,template:i}=e,{elementId:a}=i,{messages:o,viewModel:s,messagesCommon:c}=this,{subtypes:l,activeFeatureIndex:u}=s;if(await s.setValue(a,n),!l?.length)return;let d=l.find(e=>e.code===n),f=l.find(e=>e.code===r)?.name??`${r}`;if(!d)return;let p=Promise.withResolvers();s.pendingSubtypeChoice=p;let m=`update-fields`,h=[{label:o.subtypes.useDefaultValuesOption,value:`update-fields`},{label:o.subtypes.keepCurrentValuesOption,value:`keep-existing`}],g={context:`info`,title:o.subtypes.changeWarningTitle,message:t(o.subtypes.changeWarning,{originalType:f,newType:d.name}),radios:h,defaultRadioSelection:`update-fields`,onRadioSelection:e=>{m=e},actions:{primary:{label:c.apply,action:()=>p.resolve(m),type:`positive`},secondary:{label:c.cancel,type:`neutral`,action:()=>p.resolve(`undo`)}},cancel:()=>p.reject()};try{switch(this.showPrompt(g),await p.promise){case`update-fields`:await s.applySubtypeDefaults(d),await s.handleSubtypeChanged(u);break;case`keep-existing`:await s.handleSubtypeChanged(u);break;case`undo`:await this.viewModel.setValue(a,r)}}finally{s.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_afterDateComponentCreateOrUpdate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){let{elementId:n}=e.template,r=e.field.type,i=this._dateComponentMap.get(`${n}`);if(!i)return;let a=e.effectiveTimeZone,o=e.value===M?void 0:e.value,s=null;r===`date-only`?s=Array.isArray(t.value)?t.value[0]:t.value:r===`time-only`?(o=G(o),s=G(t.value)):s=r===`timestamp-offset`?t.value==null?null:pe({dateComponent:i.date,timeComponent:i.time,oldValue:o,timeZoneComponent:i.timeZone,defaultTimeZone:a}):t.value==null?null:me({oldValue:o,dateComponent:i.date,timeZone:a,timeComponent:i.time?.value===M?void 0:i.time}),o!==s&&(this._markInputTouched(e),s===null||!t.value?this.viewModel.setValue(n,null):this.viewModel.setValue(n,s))}_getErrorToDisplay(e){let t=e.compositeError;return e.valid||!t?null:t===X.CONTINGENCY_VIOLATION_ERROR||t===X.CONTINGENCY_VIOLATION_WARNING?t:!this._touchedInputs.has(e.template.elementId)&&!this.viewModel.submitHasBeenAttempted?null:t}_renderViewingAssociationsPage(){return this._associationsList?.render()}_onActiveAssociationsInputChange(e){let t=this._associationsList;t&&(e?(t.associationInput=e,t.viewModel=e.viewModel):t.associationInput=null)}async _setUpAssociationsWidgets(){let e=this.viewModel.activeForm.allUtilityNetworkAssociationsElementInputs;if(this._associationsEnabled&&e.length!==0){await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.set(t,await this._createAssociationsWidget(t))}}async _setUpUtilityNetworkAssociationList(){if(this._associationsList)return;let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._associationsList=new e({onSelectLayer:this._onSelectAssociatedLayer.bind(this),onSelectFeature:this._onEditAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)});let t=this.viewModel.activeAssociationsInput;t&&(this._associationsList.associationInput=t,this._associationsList.viewModel=t.viewModel)}async _createAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({viewModel:e.viewModel,onSelectAssociationType:t=>this._onSelectAssociationType(e,t)})}_destroyAssociationsWidgets(){this._associationsWidgetsMap.forEach(e=>a(e)),this._associationsWidgetsMap.clear()}_onSelectAssociationType(e,{listType:t}){this.setActiveAssociationsInput(e),this.setActiveAssociationType(t)}_onSelectAssociatedLayer({layer:e}){this.setActiveAssociationsLayer(e)}async _onEditAssociatedFeature(e){let t=this.callbacks?.editAssociatedFeature,n=this.viewModel.activeAssociationsInput;if(!t||!n?.feature)return;let{association:r,feature:i}=e;await t({parentFeature:n.feature.plainGraphic,association:r,feature:i})}_onAddAssociation(e){let t=this.callbacks?.addAssociation,n=this.viewModel.activeAssociationsInput;if(!t||!n?.feature)return;let{associationType:r,utilityNetwork:i}=e;t({feature:n.feature.plainGraphic,associationType:r,utilityNetwork:i})}_setFocusableInput(e){let t=e&&j(e)?e:this._findFocusableInput(e);this._syncGroupInputStates(),this._focusedFieldInput=t,this._attemptFocusOnNextRender=!0}_findFocusableInput(e){let t=this.viewModel.activeForm.inputs;if(!t.length)return;let n=ie(t),r;if(!e)r=0;else if(A(e)){let t=e.inputs.find(e=>e.visible);r=t?n.indexOf(t):0}else{let i;i=P(e)&&!e.group.open?e.group.inputs.filter(j)[t.length-1]:e,r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&j(t)){if(this.disabledOrReadOnly&&(t?.inputType===`switch`||t?.inputType===`radio-buttons`))continue;return t}}return null}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._setFocusableInput(t),this.groupDisplay===`sequential`&&this.viewModel.activeForm.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.activeForm?.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}};e([f()],$.prototype,`activeFeatureIndex`,null),e([f()],$.prototype,`attachmentsEnabled`,null),e([f()],$.prototype,`callbacks`,null),e([f()],$.prototype,`disabled`,null),e([f()],$.prototype,`effectiveTitle`,null),e([f()],$.prototype,`effectiveDisabled`,null),e([f()],$.prototype,`disabledOrReadOnly`,null),e([f()],$.prototype,`features`,null),e([f()],$.prototype,`footerButtonInfos`,null),e([f()],$.prototype,`map`,null),e([f()],$.prototype,`maximumFeatureCount`,null),e([f()],$.prototype,`maximumFeatureCountWithComplexForms`,null),e([f()],$.prototype,`spatialReference`,null),e([f()],$.prototype,`layerInfos`,null),e([f()],$.prototype,`timeZone`,null),e([f()],$.prototype,`headingLevel`,void 0),e([f()],$.prototype,`icon`,null),e([f(),q(`esri/t9n/common`)],$.prototype,`messagesCommon`,void 0),e([f(),q(`esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm`)],$.prototype,`messages`,void 0),e([f(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],$.prototype,`featureFormMessages`,void 0),e([f(),q(`esri/widgets/FeatureTable/t9n/FeatureTable`)],$.prototype,`featureTableMessages`,void 0),e([f(),q(`esri/core/t9n/Units`)],$.prototype,`messagesUnits`,void 0),e([f()],$.prototype,`page`,null),e([f()],$.prototype,`readOnly`,null),e([f()],$.prototype,`showPrompt`,null),e([f()],$.prototype,`clearPrompt`,null),e([f()],$.prototype,`selectedAttachment`,null),e([f()],$.prototype,`selectedAttachmentDetails`,null),e([f()],$.prototype,`valid`,null),e([f({type:C}),_e([`attachments-change`,`value-change`,`values-change`,`submit`])],$.prototype,`viewModel`,void 0),e([f({type:D,nonNullable:!0})],$.prototype,`visibleElements`,void 0),e([f()],$.prototype,`groupDisplay`,void 0),e([f()],$.prototype,`_formHeaderVisible`,null),e([f()],$.prototype,`_associationsEnabled`,null),e([f()],$.prototype,`_associationsList`,void 0),e([f()],$.prototype,`_attemptFocusOnNextRender`,void 0),e([f()],$.prototype,`_formId`,null),e([f()],$.prototype,`_focusedFieldInput`,void 0),e([f()],$.prototype,`_pendingSubtypeChoice`,void 0),e([f()],$.prototype,`_relatedRecordsEnabled`,null),e([f()],$.prototype,`_listObserverNode`,void 0),e([f()],$.prototype,`_attachmentDialogInfo`,void 0),e([f()],$.prototype,`_attachmentListFilterText`,void 0),e([f()],$.prototype,`_prompt`,void 0),e([f()],$.prototype,`test`,null),$=e([p(`esri.widgets.BatchAttributeForm`)],$);function ye(e){switch(e){case`audio`:return _(`audio/mpeg`);case`video`:return _(`video/mp4`);case`image`:return _(`image/png`);default:return`camera`}}const be=$;export{be as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Viewpoint.js";import n from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import i from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import o from"../../core/Logger.js";import{property as s,cast as c,subclass as l}from"../../core/accessorSupport/decorators.js";import u from"../../webdoc/support/SlideThumbnail.js";import d from"../../webmap/Bookmark.js";import{GoTo as f}from"../support/GoTo.js";const p=n.ofType(d),m={width:128,height:128,format:`png`},h={takeScreenshot:!0,captureViewpoint:!0,captureRotation:!0,captureScale:!0,captureTimeExtent:!0},g={time:!0};let _=class extends f(a){constructor(e){super(e),this.capabilities={...g},this.activeBookmark=null,this.view=null,e?.suppressDeprecationWarning||r(o.getLogger(this),`Bookmarks`,`arcgis-bookmarks`,{version:`5.0`})}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}destroy(){this.view=null,this._set(`activeBookmark`,null)}castCapabilities(e){return{...g,...e}}get bookmarks(){return this.view?.map?.bookmarks??new p}set bookmarks(e){this._overrideIfSome(`bookmarks`,e)}set defaultCreateOptions(e){this._set(`defaultCreateOptions`,{...h,...e})}get defaultCreateOptions(){return h}set defaultEditOptions(e){this._set(`defaultEditOptions`,{...h,...e})}get defaultEditOptions(){return h}get state(){let{view:e}=this;return e&&!e.ready?`loading`:`ready`}async createBookmark(e){let{view:t,defaultCreateOptions:n,capabilities:r}=this;if(!t)throw new i(`create-bookmark:invalid-view`,`Cannot create a bookmark without a view.`);let{takeScreenshot:a,screenshotSettings:o,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:u}={...n,...e},f=a?await this._createThumbnail(o):void 0,p=r.time&&u&&t.timeExtent!=null?t.timeExtent.clone():void 0;return new d({...f&&{thumbnail:f},...u&&{timeExtent:p},...s&&{viewpoint:this._createViewpoint({view:t,captureScale:l,captureRotation:c})}})}async editBookmark(e,t){if(!e)return e;let{view:n,defaultEditOptions:r}=this;if(!n)throw new i(`edit-bookmark:invalid-view`,`Cannot edit a bookmark without a view.`);let{takeScreenshot:a,screenshotSettings:o,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:u}={...r,...t},d=a?await this._createThumbnail(o):void 0;return d&&(e.thumbnail=d),s&&(e.viewpoint=this._createViewpoint({view:n,captureScale:l,captureRotation:c})),u&&n.timeExtent!=null&&(e.timeExtent=n.timeExtent.clone()),this.emit(`bookmark-edit`,{bookmark:e}),e}goTo(e){let{capabilities:t,view:n}=this;if(!n)throw new i(`go-to:invalid-view`,`Cannot go to a bookmark without a view`);let r=e?.viewpoint;if(!r)throw new i(`go-to:invalid-bookmark`,`Cannot go to a bookmark that does not contain a 'viewpoint'.`,{bookmark:e});this._set(`activeBookmark`,e);let a=this.callGoTo({target:r}),o=e?.timeExtent;return t.time&&o&&(n.timeExtent=o),this.emit(`bookmark-select`,{bookmark:e}),a.catch(()=>{}).then(()=>this._set(`activeBookmark`,null)),a}async _createThumbnail(e){let{view:t}=this;if(!t)throw new i(`bookmark:invalid-view`,`Cannot create slide thumbnail without a view`);let n=await t.takeScreenshot({...m,...e});return new u({url:n.dataUrl})}_createViewpoint({view:e,captureRotation:n,captureScale:r}){let i=e.viewpoint?.clone();return new t({targetGeometry:e.extent?.clone(),rotation:(n?i?.rotation:null)??0,scale:(r?i?.scale:null)??0})}};e([s()],_.prototype,`capabilities`,void 0),e([c(`capabilities`)],_.prototype,`castCapabilities`,null),e([s({readOnly:!0})],_.prototype,`activeBookmark`,void 0),e([s({type:p})],_.prototype,`bookmarks`,null),e([s()],_.prototype,`defaultCreateOptions`,null),e([s()],_.prototype,`defaultEditOptions`,null),e([s({readOnly:!0})],_.prototype,`state`,null),e([s()],_.prototype,`view`,void 0),_=e([l(`esri.widgets.Bookmarks.BookmarksViewModel`)],_);const v=_;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../Viewpoint.js";import n from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as r}from"../../core/deprecate.js";import i from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import o from"../../core/Logger.js";import{property as s,cast as c,subclass as l}from"../../core/accessorSupport/decorators.js";import u from"../../webdoc/support/SlideThumbnail.js";import d from"../../webmap/Bookmark.js";import{GoTo as f}from"../support/GoTo.js";const p=n.ofType(d),m={width:128,height:128,format:`png`},h={takeScreenshot:!0,captureViewpoint:!0,captureRotation:!0,captureScale:!0,captureTimeExtent:!0},g={time:!0};let _=class extends f(a){constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.capabilities={...g},this.activeBookmark=null,this.view=null,t||r(o.getLogger(this),`Bookmarks`,`arcgis-bookmarks`,{version:`5.0`})}destroy(){this.view=null,this._set(`activeBookmark`,null)}castCapabilities(e){return{...g,...e}}get bookmarks(){return this.view?.map?.bookmarks??new p}set bookmarks(e){this._overrideIfSome(`bookmarks`,e)}set defaultCreateOptions(e){this._set(`defaultCreateOptions`,{...h,...e})}get defaultCreateOptions(){return h}set defaultEditOptions(e){this._set(`defaultEditOptions`,{...h,...e})}get defaultEditOptions(){return h}get state(){let{view:e}=this;return e&&!e.ready?`loading`:`ready`}async createBookmark(e){let{view:t,defaultCreateOptions:n,capabilities:r}=this;if(!t)throw new i(`create-bookmark:invalid-view`,`Cannot create a bookmark without a view.`);let{takeScreenshot:a,screenshotSettings:o,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:u}={...n,...e},f=a?await this._createThumbnail(o):void 0,p=r.time&&u&&t.timeExtent!=null?t.timeExtent.clone():void 0;return new d({...f&&{thumbnail:f},...u&&{timeExtent:p},...s&&{viewpoint:this._createViewpoint({view:t,captureScale:l,captureRotation:c})}})}async editBookmark(e,t){if(!e)return e;let{view:n,defaultEditOptions:r}=this;if(!n)throw new i(`edit-bookmark:invalid-view`,`Cannot edit a bookmark without a view.`);let{takeScreenshot:a,screenshotSettings:o,captureViewpoint:s,captureRotation:c,captureScale:l,captureTimeExtent:u}={...r,...t},d=a?await this._createThumbnail(o):void 0;return d&&(e.thumbnail=d),s&&(e.viewpoint=this._createViewpoint({view:n,captureScale:l,captureRotation:c})),u&&n.timeExtent!=null&&(e.timeExtent=n.timeExtent.clone()),this.emit(`bookmark-edit`,{bookmark:e}),e}goTo(e){let{capabilities:t,view:n}=this;if(!n)throw new i(`go-to:invalid-view`,`Cannot go to a bookmark without a view`);let r=e?.viewpoint;if(!r)throw new i(`go-to:invalid-bookmark`,`Cannot go to a bookmark that does not contain a 'viewpoint'.`,{bookmark:e});this._set(`activeBookmark`,e);let a=this.callGoTo({target:r}),o=e?.timeExtent;return t.time&&o&&(n.timeExtent=o),this.emit(`bookmark-select`,{bookmark:e}),a.catch(()=>{}).then(()=>this._set(`activeBookmark`,null)),a}async _createThumbnail(e){let{view:t}=this;if(!t)throw new i(`bookmark:invalid-view`,`Cannot create slide thumbnail without a view`);let n=await t.takeScreenshot({...m,...e});return new u({url:n.dataUrl})}_createViewpoint({view:e,captureRotation:n,captureScale:r}){let i=e.viewpoint?.clone();return new t({targetGeometry:e.extent?.clone(),rotation:(n?i?.rotation:null)??0,scale:(r?i?.scale:null)??0})}};e([s()],_.prototype,`capabilities`,void 0),e([c(`capabilities`)],_.prototype,`castCapabilities`,null),e([s({readOnly:!0})],_.prototype,`activeBookmark`,void 0),e([s({type:p})],_.prototype,`bookmarks`,null),e([s()],_.prototype,`defaultCreateOptions`,null),e([s()],_.prototype,`defaultEditOptions`,null),e([s({readOnly:!0})],_.prototype,`state`,null),e([s()],_.prototype,`view`,void 0),_=e([l(`esri.widgets.Bookmarks.BookmarksViewModel`)],_);const v=_;export{v as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import n from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{watch as s,whenOnce as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import d from"../../layers/BuildingSceneLayer.js";import f from"../../layers/support/BuildingFilter.js";import p from"./BuildingDisciplinesViewModel.js";import m from"./BuildingLevel.js";import h from"./BuildingPhase.js";import{showFullModel as g}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as _,getFilterBlockSolid as v,getFilterBlockXRay as y,generateFilterId as b}from"./support/filterUtils.js";import{createLoadLayersFunction as x}from"./support/layerUtils.js";let S=class extends t{constructor(e){super(e),this.view=null,this.state=`disabled`,this.level=new m({suppressDeprecationWarning:!0}),this.phase=new h({suppressDeprecationWarning:!0}),this.disciplines=new p,this._loadLayers=x(),e?.suppressDeprecationWarning||i(a.getLogger(this),`Building Explorer`,`arcgis-building-explorer`,{version:`5.0`}),this.layers=new n}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([this.layers.on(`change`,()=>this._onLayersChange()),s(()=>({state:this.state,layers:this.layers,filter:this._filter}),({state:e,layers:t,filter:n})=>{e===`ready`&&_(t,n)},{initial:!0})]),this._onLayersChange()}destroy(){this.level.destroyed||this.level.destroy(),this.phase.destroyed||this.phase.destroy(),this.disciplines.destroyed||this.disciplines.destroy()}get isSupported(){return this.view?.type===`3d`}get layers(){return this._get(`layers`)}set layers(e){let t=e.filter(e=>e instanceof d);t.length!==e.length&&a.getLogger(this).error(`Some layers are not BuildingSceneLayers but only BuildingSceneLayers can be passed to the widget.`),this._set(`layers`,r(t,this._get(`layers`)))}get _filter(){let e=this.level.filterExpressions,t=this.phase.filterExpressions,n=[],r=v([e.solid,t.solid]);r!=null&&n.push(r);let i=y([e.xRay,t.xRay]);return i!=null&&n.push(i),n.length===0?null:new f({id:b(),name:`Building Explorer Filter`,filterBlocks:n})}async _onLayersChange(){let e=this.layers;if(this.level.layers=e,this.phase.layers=e,this.disciplines.layers=e,e.length===0)this._set(`state`,`disabled`);else{this._set(`state`,`loading`);try{await this._loadLayers(e),await Promise.all([c(()=>this.level.state===`ready`),c(()=>this.phase.state===`ready`),c(()=>this.disciplines.state===`ready`)]),e.forEach(g),this._set(`state`,`ready`)}catch(e){o(e)||this._set(`state`,`failed`)}}}};e([l({value:null})],S.prototype,`view`,void 0),e([l()],S.prototype,`isSupported`,null),e([l({type:n.ofType(d),nonNullable:!0})],S.prototype,`layers`,null),e([l({readOnly:!0})],S.prototype,`state`,void 0),e([l({readOnly:!0,type:m})],S.prototype,`level`,void 0),e([l({readOnly:!0,type:h})],S.prototype,`phase`,void 0),e([l({readOnly:!0,type:p})],S.prototype,`disciplines`,void 0),e([l()],S.prototype,`_filter`,null),S=e([u(`esri.widgets.BuildingExplorer.BuildingExplorerViewModel`)],S);const C=S;export{C as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import n from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as i}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{isAbortError as o}from"../../core/promiseUtils.js";import{watch as s,whenOnce as c}from"../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import d from"../../layers/BuildingSceneLayer.js";import f from"../../layers/support/BuildingFilter.js";import p from"./BuildingDisciplinesViewModel.js";import m from"./BuildingLevel.js";import h from"./BuildingPhase.js";import{showFullModel as g}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as _,getFilterBlockSolid as v,getFilterBlockXRay as y,generateFilterId as b}from"./support/filterUtils.js";import{createLoadLayersFunction as x}from"./support/layerUtils.js";let S=class extends t{constructor(e){let{suppressDeprecationWarning:t,...r}=e??{};super(r),this.view=null,this.state=`disabled`,this.level=new m({suppressDeprecationWarning:!0}),this.phase=new h({suppressDeprecationWarning:!0}),this.disciplines=new p,this._loadLayers=x(),t||i(a.getLogger(this),`Building Explorer`,`arcgis-building-explorer`,{version:`5.0`}),this.layers=new n}initialize(){this.addHandles([this.layers.on(`change`,()=>this._onLayersChange()),s(()=>({state:this.state,layers:this.layers,filter:this._filter}),({state:e,layers:t,filter:n})=>{e===`ready`&&_(t,n)},{initial:!0})]),this._onLayersChange()}destroy(){this.level.destroyed||this.level.destroy(),this.phase.destroyed||this.phase.destroy(),this.disciplines.destroyed||this.disciplines.destroy()}get isSupported(){return this.view?.type===`3d`}get layers(){return this._get(`layers`)}set layers(e){let t=e.filter(e=>e instanceof d);t.length!==e.length&&a.getLogger(this).error(`Some layers are not BuildingSceneLayers but only BuildingSceneLayers can be passed to the widget.`),this._set(`layers`,r(t,this._get(`layers`)))}get _filter(){let e=this.level.filterExpressions,t=this.phase.filterExpressions,n=[],r=v([e.solid,t.solid]);r!=null&&n.push(r);let i=y([e.xRay,t.xRay]);return i!=null&&n.push(i),n.length===0?null:new f({id:b(),name:`Building Explorer Filter`,filterBlocks:n})}async _onLayersChange(){let e=this.layers;if(this.level.layers=e,this.phase.layers=e,this.disciplines.layers=e,e.length===0)this._set(`state`,`disabled`);else{this._set(`state`,`loading`);try{await this._loadLayers(e),await Promise.all([c(()=>this.level.state===`ready`),c(()=>this.phase.state===`ready`),c(()=>this.disciplines.state===`ready`)]),e.forEach(g),this._set(`state`,`ready`)}catch(e){o(e)||this._set(`state`,`failed`)}}}};e([l({value:null})],S.prototype,`view`,void 0),e([l()],S.prototype,`isSupported`,null),e([l({type:n.ofType(d),nonNullable:!0})],S.prototype,`layers`,null),e([l({readOnly:!0})],S.prototype,`state`,void 0),e([l({readOnly:!0,type:m})],S.prototype,`level`,void 0),e([l({readOnly:!0,type:h})],S.prototype,`phase`,void 0),e([l({readOnly:!0,type:p})],S.prototype,`disciplines`,void 0),e([l()],S.prototype,`_filter`,null),S=e([u(`esri.widgets.BuildingExplorer.BuildingExplorerViewModel`)],S);const C=S;export{C as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{binaryIndexOf as n}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{isAbortError as s}from"../../core/promiseUtils.js";import{property as c,subclass as l}from"../../core/accessorSupport/decorators.js";import{createLoadLayersFunction as u}from"./support/layerUtils.js";import{getDomainInfo as d,getValidNumber as f,getMin as p,getMax as m}from"./support/validation.js";let h=class extends t{constructor(e){super(e),this.state=`disabled`,this._valueBeforeReady=null,this._domainInfo=d([]),this._loadLayers=u(),e?.suppressDeprecationWarning||a(o.getLogger(this),`Building Explorer`,`arcgis-building-explorer`,{version:`5.0`}),this.layers=new r}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles(this.layers.on(`change`,()=>this._onLayersChange())),this._onLayersChange()}destroy(){this._set(`state`,`disabled`)}get enabled(){return this.allowedValues.length>0&&this._get(`enabled`)}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set(`enabled`,e)}get value(){return(this.state===`ready`?this._get(`value`):this._valueBeforeReady)??0}set value(e){if(this.state!==`ready`){this._valueBeforeReady=e;return}if(e===this.value)return;let t=f(e,this);t!=null&&this._set(`value`,t)}get min(){return p(this.allowedValues)}get max(){return m(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}set allowedValues(e){e==null?this._clearOverride(`allowedValues`):this._override(`allowedValues`,e);let t=f(this.value,this);t!=null&&(this.value=t)}get hasNext(){if(!this.enabled)return!0;let e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){let t=this._get(`layers`);this._set(`layers`,i(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return n(this.allowedValues,this.value)}select(e){this.state===`ready`?f(e,this)!=null&&(this.enabled=!0,this.value=e):this._valueBeforeReady=e}clear(){this.state===`ready`?this.enabled=!1:this._valueBeforeReady=null}next(){let{state:e,allowedValues:t,enabled:n,hasNext:r,_valueIndex:i}=this;e!==`ready`&&this._valueBeforeReady!=null?this._valueBeforeReady++:t.length!==0&&(n?r&&(this.value=t[i+1]):(this.enabled=!0,this.value=t[0]))}previous(){let{state:e,allowedValues:t,enabled:n,hasPrevious:r,_valueIndex:i}=this;e!==`ready`&&this._valueBeforeReady!=null?this._valueBeforeReady++:t.length!==0&&(n?r&&(this.value=t[i-1]):(this.enabled=!0,this.value=t[t.length-1]))}getValueLabel(e){return this.layers.length===0?null:this._domainInfo.fieldValueMap.get(e)??null}async _onLayersChange(){if(this._set(`state`,`loading`),this._domainInfo=d([]),this.layers.length!==0)try{await this._loadLayers(this.layers),this._setup()}catch(e){s(e)||this._set(`state`,`failed`)}}};e([c({value:!1,nonNullable:!0})],h.prototype,`enabled`,null),e([c({nonNullable:!0})],h.prototype,`value`,null),e([c({readOnly:!0})],h.prototype,`min`,null),e([c({readOnly:!0})],h.prototype,`max`,null),e([c()],h.prototype,`allowedValues`,null),e([c({readOnly:!0})],h.prototype,`hasNext`,null),e([c({readOnly:!0})],h.prototype,`hasPrevious`,null),e([c({type:r,nonNullable:!0})],h.prototype,`layers`,null),e([c({nonNullable:!0})],h.prototype,`state`,void 0),e([c()],h.prototype,`_valueBeforeReady`,void 0),e([c({readOnly:!0})],h.prototype,`_valueIndex`,null),e([c()],h.prototype,`_domainInfo`,void 0),h=e([l(`esri.widgets.BuildingExplorer.BuildingNumericFilterViewModel`)],h);const g=h;export{g as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{binaryIndexOf as n}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{referenceSetter as i}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as a}from"../../core/deprecate.js";import o from"../../core/Logger.js";import{isAbortError as s}from"../../core/promiseUtils.js";import{property as c,subclass as l}from"../../core/accessorSupport/decorators.js";import{createLoadLayersFunction as u}from"./support/layerUtils.js";import{getDomainInfo as d,getValidNumber as f,getMin as p,getMax as m}from"./support/validation.js";let h=class extends t{constructor(e){let{suppressDeprecationWarning:t,...n}=e??{};super(n),this.state=`disabled`,this._valueBeforeReady=null,this._domainInfo=d([]),this._loadLayers=u(),t||a(o.getLogger(this),`Building Explorer`,`arcgis-building-explorer`,{version:`5.0`}),this.layers=new r}initialize(){this.addHandles(this.layers.on(`change`,()=>this._onLayersChange())),this._onLayersChange()}destroy(){this._set(`state`,`disabled`)}get enabled(){return this.allowedValues.length>0&&this._get(`enabled`)}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set(`enabled`,e)}get value(){return(this.state===`ready`?this._get(`value`):this._valueBeforeReady)??0}set value(e){if(this.state!==`ready`){this._valueBeforeReady=e;return}if(e===this.value)return;let t=f(e,this);t!=null&&this._set(`value`,t)}get min(){return p(this.allowedValues)}get max(){return m(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}set allowedValues(e){e==null?this._clearOverride(`allowedValues`):this._override(`allowedValues`,e);let t=f(this.value,this);t!=null&&(this.value=t)}get hasNext(){if(!this.enabled)return!0;let e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){let t=this._get(`layers`);this._set(`layers`,i(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return n(this.allowedValues,this.value)}select(e){this.state===`ready`?f(e,this)!=null&&(this.enabled=!0,this.value=e):this._valueBeforeReady=e}clear(){this.state===`ready`?this.enabled=!1:this._valueBeforeReady=null}next(){let{state:e,allowedValues:t,enabled:n,hasNext:r,_valueIndex:i}=this;e!==`ready`&&this._valueBeforeReady!=null?this._valueBeforeReady++:t.length!==0&&(n?r&&(this.value=t[i+1]):(this.enabled=!0,this.value=t[0]))}previous(){let{state:e,allowedValues:t,enabled:n,hasPrevious:r,_valueIndex:i}=this;e!==`ready`&&this._valueBeforeReady!=null?this._valueBeforeReady++:t.length!==0&&(n?r&&(this.value=t[i-1]):(this.enabled=!0,this.value=t[t.length-1]))}getValueLabel(e){return this.layers.length===0?null:this._domainInfo.fieldValueMap.get(e)??null}async _onLayersChange(){if(this._set(`state`,`loading`),this._domainInfo=d([]),this.layers.length!==0)try{await this._loadLayers(this.layers),this._setup()}catch(e){s(e)||this._set(`state`,`failed`)}}};e([c({value:!1,nonNullable:!0})],h.prototype,`enabled`,null),e([c({nonNullable:!0})],h.prototype,`value`,null),e([c({readOnly:!0})],h.prototype,`min`,null),e([c({readOnly:!0})],h.prototype,`max`,null),e([c()],h.prototype,`allowedValues`,null),e([c({readOnly:!0})],h.prototype,`hasNext`,null),e([c({readOnly:!0})],h.prototype,`hasPrevious`,null),e([c({type:r,nonNullable:!0})],h.prototype,`layers`,null),e([c({nonNullable:!0})],h.prototype,`state`,void 0),e([c()],h.prototype,`_valueBeforeReady`,void 0),e([c({readOnly:!0})],h.prototype,`_valueIndex`,null),e([c()],h.prototype,`_domainInfo`,void 0),h=e([l(`esri.widgets.BuildingExplorer.BuildingNumericFilterViewModel`)],h);const g=h;export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import{EventedAccessor as r}from"../../core/Evented.js";import i from"../../core/Logger.js";import{watch as a,initial as o,on as s}from"../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../core/accessorSupport/decorators.js";import u from"../LayerList/ListItem.js";import{findLayerListMode as d}from"../LayerList/support/layerListUtils.js";const f={layerListMode:`layer-list-mode`},p=t.ofType(u);let m=class extends r{constructor(e){super(e),this.catalogItems=new p,this.checkPublishStatusEnabled=!1,this.catalogLayer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.view=null,e?.suppressDeprecationWarning||n(i.getLogger(this),`Catalog Layer List (Next)`,`arcgis-catalog-layer-list-next`,{version:`5.2`})}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this.addHandles([a(()=>[this.catalogLayer?.loaded,this.view?.ready],()=>this._compileList(),o),s(()=>this.catalogLayer?.dynamicGroupLayer.layers,`change`,()=>this._compileList()),a(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())])}destroy(){this.view=null,this._removeAllItems()}get state(){let{view:e,catalogLayer:t}=this;return e?.ready&&t?.loaded?`ready`:e&&t?`loading`:`disabled`}get totalItems(){return this.catalogItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit(`trigger-action`,{action:e,item:t})}_createListItem(e){let{view:t,listItemCreatedFunction:n,checkPublishStatusEnabled:r,listModeDisabled:i}=this;return new u({checkPublishStatusEnabled:r,listModeDisabled:i,layer:e,listItemCreatedFunction:n,view:t})}_removeAllItems(){this.catalogItems.destroyAll()}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>d(e)!==`hide`):void 0}_watchLayersListMode(e){this.removeHandles(f.layerListMode),e&&!this.listModeDisabled&&this.addHandles(a(()=>e.filter(e=>`listMode`in e).map(e=>e.listMode).toArray(),()=>this._compileList()),f.layerListMode)}_compileList(){let{catalogLayer:e}=this;if(!e?.loaded)return;let t=e?.dynamicGroupLayer.layers;this._watchLayersListMode(t);let n=this._getViewableLayers(t);n?.length?(this._createNewItems(n),this._removeItems(n),this._sortItems(n)):this._removeAllItems()}_createNewItems(e){let{catalogItems:t}=this;e.forEach(e=>{t.some(t=>t.layer===e)||t.add(this._createListItem(e))})}_removeItems(e){let{catalogItems:t}=this,n=[];t.forEach(t=>{t&&e?.includes(t.layer)||n.push(t)}),t.destroyMany(n)}_sortItems(e){let{catalogItems:t}=this;t.sort((t,n)=>{let r=e.indexOf(t.layer),i=e.indexOf(n.layer);return r>i?-1:+(r<i)})}_recompileList(){this._removeAllItems(),this._compileList()}};e([c({type:p})],m.prototype,`catalogItems`,void 0),e([c()],m.prototype,`checkPublishStatusEnabled`,void 0),e([c()],m.prototype,`catalogLayer`,void 0),e([c()],m.prototype,`listItemCreatedFunction`,void 0),e([c({nonNullable:!0})],m.prototype,`listModeDisabled`,void 0),e([c({readOnly:!0})],m.prototype,`state`,null),e([c()],m.prototype,`totalItems`,null),e([c()],m.prototype,`view`,void 0),m=e([l(`esri.widgets.CatalogLayerList.CatalogLayerListViewModel`)],m);export{m as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import{EventedAccessor as r}from"../../core/Evented.js";import i from"../../core/Logger.js";import{watch as a,initial as o,on as s}from"../../core/reactiveUtils.js";import{property as c,subclass as l}from"../../core/accessorSupport/decorators.js";import u from"../LayerList/ListItem.js";import{findLayerListMode as d}from"../LayerList/support/layerListUtils.js";const f={layerListMode:`layer-list-mode`},p=t.ofType(u);let m=class extends r{constructor(e){let{suppressDeprecationWarning:t,...r}=e??{};super(r),this.catalogItems=new p,this.checkPublishStatusEnabled=!1,this.catalogLayer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.view=null,t||n(i.getLogger(this),`Catalog Layer List (Next)`,`arcgis-catalog-layer-list-next`,{version:`5.2`})}initialize(){this.addHandles([a(()=>[this.catalogLayer?.loaded,this.view?.ready],()=>this._compileList(),o),s(()=>this.catalogLayer?.dynamicGroupLayer.layers,`change`,()=>this._compileList()),a(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())])}destroy(){this.view=null,this._removeAllItems()}get state(){let{view:e,catalogLayer:t}=this;return e?.ready&&t?.loaded?`ready`:e&&t?`loading`:`disabled`}get totalItems(){return this.catalogItems.flatten(e=>e.children).length}triggerAction(e,t){e&&!e.disabled&&this.emit(`trigger-action`,{action:e,item:t})}_createListItem(e){let{view:t,listItemCreatedFunction:n,checkPublishStatusEnabled:r,listModeDisabled:i}=this;return new u({checkPublishStatusEnabled:r,listModeDisabled:i,layer:e,listItemCreatedFunction:n,view:t})}_removeAllItems(){this.catalogItems.destroyAll()}_getViewableLayers(e){return e?this.listModeDisabled?e:e.filter(e=>d(e)!==`hide`):void 0}_watchLayersListMode(e){this.removeHandles(f.layerListMode),e&&!this.listModeDisabled&&this.addHandles(a(()=>e.filter(e=>`listMode`in e).map(e=>e.listMode).toArray(),()=>this._compileList()),f.layerListMode)}_compileList(){let{catalogLayer:e}=this;if(!e?.loaded)return;let t=e?.dynamicGroupLayer.layers;this._watchLayersListMode(t);let n=this._getViewableLayers(t);n?.length?(this._createNewItems(n),this._removeItems(n),this._sortItems(n)):this._removeAllItems()}_createNewItems(e){let{catalogItems:t}=this;e.forEach(e=>{t.some(t=>t.layer===e)||t.add(this._createListItem(e))})}_removeItems(e){let{catalogItems:t}=this,n=[];t.forEach(t=>{t&&e?.includes(t.layer)||n.push(t)}),t.destroyMany(n)}_sortItems(e){let{catalogItems:t}=this;t.sort((t,n)=>{let r=e.indexOf(t.layer),i=e.indexOf(n.layer);return r>i?-1:+(r<i)})}_recompileList(){this._removeAllItems(),this._compileList()}};e([c({type:p})],m.prototype,`catalogItems`,void 0),e([c()],m.prototype,`checkPublishStatusEnabled`,void 0),e([c()],m.prototype,`catalogLayer`,void 0),e([c()],m.prototype,`listItemCreatedFunction`,void 0),e([c({nonNullable:!0})],m.prototype,`listModeDisabled`,void 0),e([c({readOnly:!0})],m.prototype,`state`,null),e([c()],m.prototype,`totalItems`,null),e([c()],m.prototype,`view`,void 0),m=e([l(`esri.widgets.CatalogLayerList.CatalogLayerListViewModel`)],m);export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as n}from"../core/deprecate.js";import{IdentifiableMixin as r}from"../core/Identifiable.js";import i from"../core/Logger.js";import a from"../core/ReactiveMap.js";import{on as o,initial as s,watch as c}from"../core/reactiveUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import d from"./Widget.js";import f from"./CatalogLayerList/CatalogLayerListViewModel.js";import p from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import h from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as _,getItem as v,removeDestroyedListItems as y,setFilterPredicate as b}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{calciteListFilterProps as C}from"./support/listUtils.js";import{tsx as w,messageBundle as T,vmEvent as E}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";var O;const k=t.ofType(g),A=`nested`;let j=O=class extends r(d){constructor(e){super(e),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new a,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new a,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder=``,this.filterPredicate=null,this.filterText=``,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t([`knowledge-graph`]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new k,this.selectionMode=`none`,this.tableList=null,this.tileOptions=null,this.viewModel=new f({suppressDeprecationWarning:!0}),this.visibilityAppearance=`default`,this.visibleElements=new p,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=v(t)},e?.suppressDeprecationWarning!==!0&&(this.announceDeprecation=()=>{n(i.getLogger(this),`Catalog Layer List`,`arcgis-catalog-layer-list-next`,{version:`5.0`})})}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([o(()=>this.openedLayers,`change`,()=>this._handleOpenedLayersChange(),s),o(()=>this.viewModel.catalogItems,`change`,()=>y(this.selectedItems),s),c(()=>[this.filterPredicate,this._rootListEl],()=>b(this._rootListEl,this.filterPredicate))])}loadDependencies(){return x({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){let{openedLayers:e}=this;return e.toArray().map((t,n)=>this._renderLayerFlowItem(t,n===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return`catalog-dataset`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){let e=this.viewModel?.state,t={[S.hidden]:e===`loading`,[S.disabled]:e===`disabled`};return w(`div`,{class:this.classes(m.base,S.widget,S.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){let{_layerListMap:n}=this,r=n.get(e);if(r)return r;let i=e.type===`catalog`?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||n.set(e,i),i}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:n}=this;this._openedLayersController?.abort();let r=new AbortController,{signal:i}=r;this._openedLayersController=r,e.forEach((n,r)=>{t.includes(r)||(n.destroy(),e.delete(r))});let a=await Promise.all(t.map(e=>this._createFlowList(e,i)));if(i.aborted)return;n.removeAll(),n.addMany(a);let o=n.at(-1);o?`catalogLayer`in o?(this._set(`catalogLayerList`,o),this._set(`tableList`,null)):(this._set(`catalogLayerList`,null),this._set(`tableList`,o)):(this._set(`catalogLayerList`,null),this._set(`tableList`,null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){let{_tooltipReferenceMap:t,messages:n}=this;return e?.layer?w(`calcite-tooltip`,{key:`tooltip-${e.layer.uid}`,overlayPositioning:`fixed`,referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},n.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return w(`div`,{slot:`message`},this.messages.noItemsToDisplay)}_renderNoItems(){return w(`div`,{class:m.itemMessage,key:`esri-layer-list__no-items`},w(`calcite-notice`,{icon:`information`,kind:`info`,open:!0,width:`full`},this._renderNoItemsMessage()))}_renderPanelFlowItems(){let{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:n,panel:r},i)=>{let a=()=>this._handlePanelFlowItemBack(r);return w(`calcite-flow-item`,{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:n,heading:r.title,headingLevel:this.headingLevel,key:`flow-panel-${r.uid}`,selected:!t.length&&i===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),a()}},r.render(),w(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:a},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,D(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,D(e))}_renderItems(){let{visible:e,collapsed:t,_visibleItems:n,_filterEnabled:r,_rootGroupUid:i,visibleElements:{closeButton:a,collapseButton:o,heading:s,flow:c},selectionMode:l,filterText:u,filterPlaceholder:d,messages:f,openedLayers:p,_openedPanelItems:h}=this,g=[w(`calcite-flow-item`,{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:a,closed:!e,collapsed:t,collapsible:o,heading:s?f.widgetLabel:void 0,headingLevel:this.headingLevel,key:`root-flow-item`,selected:!p.length&&!h.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?null:this._renderNoItems(),w(`calcite-list`,{afterCreate:e=>{this._rootListEl=e,e.addEventListener(`focusin`,this._setActiveItem),e.addEventListener(`focusout`,this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener(`focusin`,this._setActiveItem),e.removeEventListener(`focusout`,this._clearActiveItem)},"data-layer-type":i,displayMode:A,filterEnabled:r,filterPlaceholder:d,filterProps:C,filterText:r?u:``,group:i,key:`root-list`,label:f.widgetLabel,selectionAppearance:`border`,selectionMode:l,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??``,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},n.toArray().map(e=>this._renderItem(e)),r?w(`div`,{class:m.filterNoResults,slot:`filter-no-results`},w(`calcite-notice`,{kind:`info`,open:!0,width:`full`},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?c?w(`calcite-flow`,{key:`root-flow`},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,D(e))}_renderLayerFlowItem(e,t){let{messages:n,openedLayers:r}=this,i=e.title||this.messages.untitledLayer;return w(`calcite-flow-item`,{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:i,heading:n[e.type===`catalog`?`catalogLayers`:`tables`],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),r.pop();let t=r.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){let{headingLevel:t,catalogOptions:n,view:r,filterPlaceholder:i,listItemCreatedFunction:a,minFilterItems:o,selectionMode:s,visibilityAppearance:c,onCatalogOpen:l,onTablesOpen:u}=this;return new O({headingLevel:t,view:r,filterPlaceholder:i,listItemCreatedFunction:a,minFilterItems:o,selectionMode:s,visibilityAppearance:c,...n,catalogLayer:e,onCatalogOpen:l,onTablesOpen:u,suppressDeprecationWarning:!0})}_getTableListParams(e){switch(e.type){case`knowledge-graph`:return{...this.knowledgeGraphOptions,tables:e.tables};case`map-image`:return{...this.mapImageOptions,tables:e.subtables};case`tile`:return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let{default:t}=await import(`./TableList.js`),{headingLevel:n,selectionMode:r}=this;return new t({headingLevel:n,selectionMode:r,...this._getTableListParams(e)})}_renderItem(e,t,n){return w(h,{activeItem:this._activeItem,css:m,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:n,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){let{selectionMode:t,selectedItems:n}=this;if(t===`none`)return;let r=e.target.selectedItems.map(e=>v(e)).filter(Boolean);n.removeAll(),n.addMany(r)}};e([l()],j.prototype,`_rootListEl`,void 0),e([l()],j.prototype,`_activeItem`,void 0),e([l()],j.prototype,`_tooltipReferenceMap`,void 0),e([l()],j.prototype,`_focusRootFlowItem`,void 0),e([l()],j.prototype,`_focusPanelFlowItem`,void 0),e([l()],j.prototype,`_focusLayerFlowItem`,void 0),e([l()],j.prototype,`_layerListMap`,void 0),e([l()],j.prototype,`_filterEnabled`,null),e([l()],j.prototype,`_visibleItems`,null),e([l()],j.prototype,`_openedPanelItems`,null),e([l()],j.prototype,`_renderedOpenLayerFlowItems`,null),e([l()],j.prototype,`catalogItems`,null),e([l()],j.prototype,`catalogLayer`,null),e([l({readOnly:!0})],j.prototype,`catalogLayerList`,void 0),e([l()],j.prototype,`catalogOptions`,void 0),e([l()],j.prototype,`collapsed`,void 0),e([l()],j.prototype,`filterPlaceholder`,void 0),e([l()],j.prototype,`filterPredicate`,void 0),e([l()],j.prototype,`filterText`,void 0),e([l()],j.prototype,`headingLevel`,void 0),e([l()],j.prototype,`icon`,null),e([l()],j.prototype,`knowledgeGraphOptions`,void 0),e([l()],j.prototype,`label`,null),e([l()],j.prototype,`layerTablesEnabled`,void 0),e([l()],j.prototype,`listItemCreatedFunction`,null),e([l()],j.prototype,`mapImageOptions`,void 0),e([l(),T(`esri/widgets/CatalogLayerList/t9n/CatalogLayerList`)],j.prototype,`messages`,void 0),e([l(),T(`esri/t9n/common`)],j.prototype,`messagesCommon`,void 0),e([l()],j.prototype,`minFilterItems`,void 0),e([l({readOnly:!0})],j.prototype,`openedLayers`,void 0),e([l({readOnly:!0})],j.prototype,`openedLayerLists`,void 0),e([l()],j.prototype,`onCatalogOpen`,void 0),e([l()],j.prototype,`onTablesOpen`,void 0),e([l({type:k})],j.prototype,`selectedItems`,void 0),e([l()],j.prototype,`selectionMode`,void 0),e([l({readOnly:!0})],j.prototype,`tableList`,void 0),e([l()],j.prototype,`tileOptions`,void 0),e([l()],j.prototype,`view`,null),e([E(`trigger-action`),l({type:f})],j.prototype,`viewModel`,void 0),e([l()],j.prototype,`visibilityAppearance`,void 0),e([l({type:p,nonNullable:!0})],j.prototype,`visibleElements`,void 0),j=O=e([u(`esri.widgets.CatalogLayerList`)],j);const M=j;export{M as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as n}from"../core/deprecate.js";import{IdentifiableMixin as r}from"../core/Identifiable.js";import i from"../core/Logger.js";import a from"../core/ReactiveMap.js";import{on as o,initial as s,watch as c}from"../core/reactiveUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import d from"./Widget.js";import f from"./CatalogLayerList/CatalogLayerListViewModel.js";import p from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as m}from"./CatalogLayerList/css.js";import h from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as _,getItem as v,removeDestroyedListItems as y,setFilterPredicate as b}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{calciteListFilterProps as C}from"./support/listUtils.js";import{tsx as w,messageBundle as T,vmEvent as E}from"./support/widget.js";import{setFocus as D}from"./support/widgetUtils.js";var O;const k=t.ofType(g),A=`nested`;let j=O=class extends r(d){constructor(e){let{suppressDeprecationWarning:r,...o}=e??{};super(o),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new a,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new a,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder=``,this.filterPredicate=null,this.filterText=``,this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t([`knowledge-graph`]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=_,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new k,this.selectionMode=`none`,this.tableList=null,this.tileOptions=null,this.viewModel=new f({suppressDeprecationWarning:!0}),this.visibilityAppearance=`default`,this.visibleElements=new p,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(e=>e.classList?.contains(m.item));this._activeItem=v(t)},r!==!0&&(this.announceDeprecation=()=>{n(i.getLogger(this),`Catalog Layer List`,`arcgis-catalog-layer-list-next`,{version:`5.0`})})}initialize(){this.addHandles([o(()=>this.openedLayers,`change`,()=>this._handleOpenedLayersChange(),s),o(()=>this.viewModel.catalogItems,`change`,()=>y(this.selectedItems),s),c(()=>[this.filterPredicate,this._rootListEl],()=>b(this._rootListEl,this.filterPredicate))])}loadDependencies(){return x({button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),flow:()=>import(`@esri/calcite-components/dist/components/calcite-flow`),"flow-item":()=>import(`@esri/calcite-components/dist/components/calcite-flow-item`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),tooltip:()=>import(`@esri/calcite-components/dist/components/calcite-tooltip`)})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){let{openedLayers:e}=this;return e.toArray().map((t,n)=>this._renderLayerFlowItem(t,n===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return`catalog-dataset`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){let e=this.viewModel?.state,t={[S.hidden]:e===`loading`,[S.disabled]:e===`disabled`};return w(`div`,{class:this.classes(m.base,S.widget,S.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){let{_layerListMap:n}=this,r=n.get(e);if(r)return r;let i=e.type===`catalog`?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||n.set(e,i),i}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:n}=this;this._openedLayersController?.abort();let r=new AbortController,{signal:i}=r;this._openedLayersController=r,e.forEach((n,r)=>{t.includes(r)||(n.destroy(),e.delete(r))});let a=await Promise.all(t.map(e=>this._createFlowList(e,i)));if(i.aborted)return;n.removeAll(),n.addMany(a);let o=n.at(-1);o?`catalogLayer`in o?(this._set(`catalogLayerList`,o),this._set(`tableList`,null)):(this._set(`catalogLayerList`,null),this._set(`tableList`,o)):(this._set(`catalogLayerList`,null),this._set(`tableList`,null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){let{_tooltipReferenceMap:t,messages:n}=this;return e?.layer?w(`calcite-tooltip`,{key:`tooltip-${e.layer.uid}`,overlayPositioning:`fixed`,referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},n.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return w(`div`,{slot:`message`},this.messages.noItemsToDisplay)}_renderNoItems(){return w(`div`,{class:m.itemMessage,key:`esri-layer-list__no-items`},w(`calcite-notice`,{icon:`information`,kind:`info`,open:!0,width:`full`},this._renderNoItemsMessage()))}_renderPanelFlowItems(){let{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:n,panel:r},i)=>{let a=()=>this._handlePanelFlowItemBack(r);return w(`calcite-flow-item`,{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:n,heading:r.title,headingLevel:this.headingLevel,key:`flow-panel-${r.uid}`,selected:!t.length&&i===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),a()}},r.render(),w(`calcite-button`,{appearance:`transparent`,slot:`footer-start`,width:`full`,onclick:a},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,D(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,D(e))}_renderItems(){let{visible:e,collapsed:t,_visibleItems:n,_filterEnabled:r,_rootGroupUid:i,visibleElements:{closeButton:a,collapseButton:o,heading:s,flow:c},selectionMode:l,filterText:u,filterPlaceholder:d,messages:f,openedLayers:p,_openedPanelItems:h}=this,g=[w(`calcite-flow-item`,{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:a,closed:!e,collapsed:t,collapsible:o,heading:s?f.widgetLabel:void 0,headingLevel:this.headingLevel,key:`root-flow-item`,selected:!p.length&&!h.length,onCalciteFlowItemClose:()=>this.visible=!1},n?.length?null:this._renderNoItems(),w(`calcite-list`,{afterCreate:e=>{this._rootListEl=e,e.addEventListener(`focusin`,this._setActiveItem),e.addEventListener(`focusout`,this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener(`focusin`,this._setActiveItem),e.removeEventListener(`focusout`,this._clearActiveItem)},"data-layer-type":i,displayMode:A,filterEnabled:r,filterPlaceholder:d,filterProps:C,filterText:r?u:``,group:i,key:`root-list`,label:f.widgetLabel,selectionAppearance:`border`,selectionMode:l,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??``,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},n.toArray().map(e=>this._renderItem(e)),r?w(`div`,{class:m.filterNoResults,slot:`filter-no-results`},w(`calcite-notice`,{kind:`info`,open:!0,width:`full`},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?c?w(`calcite-flow`,{key:`root-flow`},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,D(e))}_renderLayerFlowItem(e,t){let{messages:n,openedLayers:r}=this,i=e.title||this.messages.untitledLayer;return w(`calcite-flow-item`,{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:i,heading:n[e.type===`catalog`?`catalogLayers`:`tables`],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),r.pop();let t=r.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){let{headingLevel:t,catalogOptions:n,view:r,filterPlaceholder:i,listItemCreatedFunction:a,minFilterItems:o,selectionMode:s,visibilityAppearance:c,onCatalogOpen:l,onTablesOpen:u}=this;return new O({headingLevel:t,view:r,filterPlaceholder:i,listItemCreatedFunction:a,minFilterItems:o,selectionMode:s,visibilityAppearance:c,...n,catalogLayer:e,onCatalogOpen:l,onTablesOpen:u,suppressDeprecationWarning:!0})}_getTableListParams(e){switch(e.type){case`knowledge-graph`:return{...this.knowledgeGraphOptions,tables:e.tables};case`map-image`:return{...this.mapImageOptions,tables:e.subtables};case`tile`:return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let{default:t}=await import(`./TableList.js`),{headingLevel:n,selectionMode:r}=this;return new t({headingLevel:n,selectionMode:r,...this._getTableListParams(e)})}_renderItem(e,t,n){return w(h,{activeItem:this._activeItem,css:m,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:n,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){let{selectionMode:t,selectedItems:n}=this;if(t===`none`)return;let r=e.target.selectedItems.map(e=>v(e)).filter(Boolean);n.removeAll(),n.addMany(r)}};e([l()],j.prototype,`_rootListEl`,void 0),e([l()],j.prototype,`_activeItem`,void 0),e([l()],j.prototype,`_tooltipReferenceMap`,void 0),e([l()],j.prototype,`_focusRootFlowItem`,void 0),e([l()],j.prototype,`_focusPanelFlowItem`,void 0),e([l()],j.prototype,`_focusLayerFlowItem`,void 0),e([l()],j.prototype,`_layerListMap`,void 0),e([l()],j.prototype,`_filterEnabled`,null),e([l()],j.prototype,`_visibleItems`,null),e([l()],j.prototype,`_openedPanelItems`,null),e([l()],j.prototype,`_renderedOpenLayerFlowItems`,null),e([l()],j.prototype,`catalogItems`,null),e([l()],j.prototype,`catalogLayer`,null),e([l({readOnly:!0})],j.prototype,`catalogLayerList`,void 0),e([l()],j.prototype,`catalogOptions`,void 0),e([l()],j.prototype,`collapsed`,void 0),e([l()],j.prototype,`filterPlaceholder`,void 0),e([l()],j.prototype,`filterPredicate`,void 0),e([l()],j.prototype,`filterText`,void 0),e([l()],j.prototype,`headingLevel`,void 0),e([l()],j.prototype,`icon`,null),e([l()],j.prototype,`knowledgeGraphOptions`,void 0),e([l()],j.prototype,`label`,null),e([l()],j.prototype,`layerTablesEnabled`,void 0),e([l()],j.prototype,`listItemCreatedFunction`,null),e([l()],j.prototype,`mapImageOptions`,void 0),e([l(),T(`esri/widgets/CatalogLayerList/t9n/CatalogLayerList`)],j.prototype,`messages`,void 0),e([l(),T(`esri/t9n/common`)],j.prototype,`messagesCommon`,void 0),e([l()],j.prototype,`minFilterItems`,void 0),e([l({readOnly:!0})],j.prototype,`openedLayers`,void 0),e([l({readOnly:!0})],j.prototype,`openedLayerLists`,void 0),e([l()],j.prototype,`onCatalogOpen`,void 0),e([l()],j.prototype,`onTablesOpen`,void 0),e([l({type:k})],j.prototype,`selectedItems`,void 0),e([l()],j.prototype,`selectionMode`,void 0),e([l({readOnly:!0})],j.prototype,`tableList`,void 0),e([l()],j.prototype,`tileOptions`,void 0),e([l()],j.prototype,`view`,null),e([E(`trigger-action`),l({type:f})],j.prototype,`viewModel`,void 0),e([l()],j.prototype,`visibilityAppearance`,void 0),e([l({type:p,nonNullable:!0})],j.prototype,`visibleElements`,void 0),j=O=e([u(`esri.widgets.CatalogLayerList`)],j);const M=j;export{M as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{initial as i,watch as a}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{getGoToDuration as c}from"../../views/2d/navigation/duration.js";import{canShowNorth as l}from"./utils.js";import{GoTo as u}from"../support/GoTo.js";let d=class extends u(t){constructor(e){super(e),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this),e?.suppressDeprecationWarning||n(r.getLogger(this),`Compass`,`arcgis-compass`,{version:`5.1`})}normalizeCtorArgs(e){let{suppressDeprecationWarning:t,...n}=e??{};return n}initialize(){this._watchForView(i)}destroy(){this.view=null}get canShowNorth(){return l(this.view)}get state(){return!this.view?.ready||this.view.type===`2d`&&!this.view.constraints.rotationEnabled?`disabled`:this.canShowNorth?`compass`:`rotation`}reset(){this.view?.ready&&(this.view?.type===`2d`?this.callGoTo({target:{rotation:0},options:{animationMode:`always`,duration:c()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(e){e!=null&&this._set(`orientation`,{z:e})}_updateForCamera(e){if(!e)return;let t=-e.heading;this._set(`orientation`,{x:0,y:0,z:t})}_updateRotationWatcher(e){this.removeAllHandles(),this._watchForView(),e&&this.addHandles(e.type===`2d`?a(()=>e?.rotation,this._updateForRotation,i):a(()=>e?.camera,this._updateForCamera,i))}_watchForView(e){this.addHandles(a(()=>this.view,this._updateRotationWatcher,e))}};e([o({readOnly:!0})],d.prototype,`canShowNorth`,null),e([o({readOnly:!0})],d.prototype,`orientation`,void 0),e([o({readOnly:!0})],d.prototype,`state`,null),e([o()],d.prototype,`view`,void 0),d=e([s(`esri.widgets.Compass.CompassViewModel`)],d);const f=d;export{f as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{initial as i,watch as a}from"../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{getGoToDuration as c}from"../../views/2d/navigation/duration.js";import{canShowNorth as l}from"./utils.js";import{GoTo as u}from"../support/GoTo.js";let d=class extends u(t){constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this),t||n(r.getLogger(this),`Compass`,`arcgis-compass`,{version:`5.1`})}initialize(){this._watchForView(i)}destroy(){this.view=null}get canShowNorth(){return l(this.view)}get state(){return!this.view?.ready||this.view.type===`2d`&&!this.view.constraints.rotationEnabled?`disabled`:this.canShowNorth?`compass`:`rotation`}reset(){this.view?.ready&&(this.view?.type===`2d`?this.callGoTo({target:{rotation:0},options:{animationMode:`always`,duration:c()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(e){e!=null&&this._set(`orientation`,{z:e})}_updateForCamera(e){if(!e)return;let t=-e.heading;this._set(`orientation`,{x:0,y:0,z:t})}_updateRotationWatcher(e){this.removeAllHandles(),this._watchForView(),e&&this.addHandles(e.type===`2d`?a(()=>e?.rotation,this._updateForRotation,i):a(()=>e?.camera,this._updateForCamera,i))}_watchForView(e){this.addHandles(a(()=>this.view,this._updateRotationWatcher,e))}};e([o({readOnly:!0})],d.prototype,`canShowNorth`,null),e([o({readOnly:!0})],d.prototype,`orientation`,void 0),e([o({readOnly:!0})],d.prototype,`state`,null),e([o()],d.prototype,`view`,void 0),d=e([s(`esri.widgets.Compass.CompassViewModel`)],d);const f=d;export{f as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Error.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{fromUsng as o,fromUtm as s,fromMgrs as c,fromLatitudeLongitude as l,toUtm as u,toUsng as d,toMgrs as f,toLatitudeLongitude as p}from"../../../geometry/coordinateFormatter.js";import{isLoaded as m,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{equals as _}from"../../../geometry/support/spatialReferenceUtils.js";import{project as v}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as y,fromXY as b,pointToCoordinate as x,removeLeadingZeros as S,getGeometryPrecision as C,getDegreePrecision as w}from"./coordinateConversionUtils.js";let T=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??``}set currentPattern(e){this._currentPattern=e}get label(){return this.name??``}set label(e){this._overrideIfSome(`label`,e)}get hasDisplayProperties(){return!!(this.defaultPattern&&this.coordinateSegments)}get spatialReference(){return this.name===`basemap`?this._viewSpatialReference:this.conversionInfo?.spatialReference??g.WGS84}set spatialReference(e){this._overrideIfSome(`spatialReference`,e)}get _viewSpatialReference(){return this.viewModel?.view?.spatialReference??g.WGS84}get _additionalCharactersPattern(){let e=this.coordinateSegments;if(!e)return null;let t=e.map(e=>e.alias),n=this.currentPattern.replaceAll(RegExp(`["nsew${t.join()}]`,`gi`),``).replaceAll(` `,``);return RegExp(`[${n}]`,`g`)}get test(){}async convert(e){if(!y(e))throw new n(`format:invalid-point`,`Could not convert invalid point.`,{point:e});let t=this.conversionInfo?.convert;if(t)return Promise.resolve().then(()=>t(e));let r=this._project(e,this.spatialReference);return{location:r,coordinate:this._getCoordinate(r)}}getConversionStrategy(){let e=this._viewSpatialReference;return this.conversionInfo?.convert||this.viewModel?.formatterAvailable||this.name===`xy`&&(e.isWebMercator||e.isWGS84)||this.name===`basemap`?`client`:`server`}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern,n=this._getSegmentMatches(e,!1);for(let e=this.coordinateSegments.length-1;e>=0;e--){let r=this.coordinateSegments[e];t=t.replace(r.alias,n[e])}return t}_parseUserInput(e){let{defaultPattern:t,_additionalCharactersPattern:n,coordinateSegments:r}=this;if(!t||!n)return``;let i=t.replace(n,``);e=e.replace(n,``);let a=this._getSegmentMatches(e,!0);if(r)for(let e=r.length-1;e>=0;e--){let t=r[e];i=i.replace(t.alias,a[e])}return i}_getSegmentMatches(e,t){let n=[],{coordinateSegments:r}=this;if(!r)return n;for(let i=0;i<r.length;i++){let a=r[i],o=e.match(a.searchPattern);if(!o){n.push(``);continue}let s=o[0];if(e=e.replace(s,``).trim(),a.substitution){let e=t?a.substitution.input(s):a.substitution.output(s);e&&(s=`${e}`)}n.push(s)}return n}async reverseConvert(e){let t=this._parseUserInput(e),i=this.conversionInfo?.reverseConvert,a;if(i)a=i(t);else if(this.name===`xy`||this.name===`basemap`)a=b(t,this.spatialReference);else if(this.viewModel?.formatterAvailable)switch(this.name){case`dd`:case`ddm`:case`dms`:a=l(t,this.spatialReference);break;case`mgrs`:a=c(t,this.spatialReference,`automatic`);break;case`utm`:a=s(t,this.spatialReference,`latitude-band-indicators`);break;case`usng`:a=o(t,this.spatialReference);break;default:a=null}if(!a)throw new n(`format:invalid-input`,`Could not parse input into point.`,{coordinate:e});if(this.viewModel?.view?.type===`3d`&&this.viewModel.view.map.ground)try{let e=await this.viewModel?.view?.map.ground.queryElevation(a);a.z=e?.geometry.z??a.z}catch(e){r.getLogger(this).warn(new n(`coordinate-conversion:elevation-query-error`,`Could not get elevation for point.`,{error:e}))}return this._project(a,this._viewSpatialReference)}_getCoordinate(e){let t=this.viewModel?.view?.resolution??0,r=this.viewModel?.view?.scale??0,i=this.viewModel?.view?.spatialReference??g.WebMercator;if(!y(e))throw new n(`format:invalid-point`,`Could not transform invalid point into coordinate.`,{point:e});if(this.viewModel?.formatterAvailable||this.name===`basemap`||this.name===`xy`)switch(this.name){case`dd`:case`ddm`:case`dms`:{let n=this._getPrecision(r,t,i,this.name),a=p(e,this.name,n);return this.viewModel?.removeLeadingZeros?S(a):a}case`mgrs`:return f(e,`automatic`,5,!1);case`usng`:return d(e,5,!1);case`utm`:return u(e,`latitude-band-indicators`,!0);default:return x(e,this._getPrecision(r,t,i,`dd`))}return x(e,this._getPrecision(r,t,i,`dd`))}_getPrecision(e,t,n,r){return this.viewModel?.calculateCoordinatePrecision?C(t,n,r):w(e)}_project(e,t){if(_(e.spatialReference,t)||!t)return e;if(this.viewModel?.formatterAvailable&&m())return h(e,t);if(!this.viewModel?.formatterAvailable){let n=v(e,t);if(n!=null)return n}return null}};e([i()],T.prototype,`conversionInfo`,void 0),e([i()],T.prototype,`coordinateSegments`,void 0),e([i()],T.prototype,`currentPattern`,null),e([i()],T.prototype,`_currentPattern`,void 0),e([i()],T.prototype,`label`,null),e([i()],T.prototype,`defaultPattern`,void 0),e([i({readOnly:!0})],T.prototype,`hasDisplayProperties`,null),e([i()],T.prototype,`name`,void 0),e([i({type:g})],T.prototype,`spatialReference`,null),e([i()],T.prototype,`viewModel`,void 0),e([i({readOnly:!0})],T.prototype,`_viewSpatialReference`,null),e([i({readOnly:!0})],T.prototype,`_additionalCharactersPattern`,null),T=e([a(`esri.widgets.CoordinateConversion.support.Format`)],T);const E=T;export{E as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Error.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import{fromUsng as o,fromUtm as s,fromMgrs as c,fromLatitudeLongitude as l,toUtm as u,toUsng as d,toMgrs as f,toLatitudeLongitude as p}from"../../../geometry/coordinateFormatter.js";import{isLoaded as m,project as h}from"../../../geometry/projectionUtils.js";import g from"../../../geometry/SpatialReference.js";import{equals as _}from"../../../geometry/support/spatialReferenceUtils.js";import{projectIfNeeded as v}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as y,fromXY as b,pointToCoordinate as x,removeLeadingZeros as S,getGeometryPrecision as C,getDegreePrecision as w}from"./coordinateConversionUtils.js";let T=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??``}set currentPattern(e){this._currentPattern=e}get label(){return this.name??``}set label(e){this._overrideIfSome(`label`,e)}get hasDisplayProperties(){return!!(this.defaultPattern&&this.coordinateSegments)}get spatialReference(){return this.name===`basemap`?this._viewSpatialReference:this.conversionInfo?.spatialReference??g.WGS84}set spatialReference(e){this._overrideIfSome(`spatialReference`,e)}get _viewSpatialReference(){return this.viewModel?.view?.spatialReference??g.WGS84}get _additionalCharactersPattern(){let e=this.coordinateSegments;if(!e)return null;let t=e.map(e=>e.alias),n=this.currentPattern.replaceAll(RegExp(`["nsew${t.join()}]`,`gi`),``).replaceAll(` `,``);return RegExp(`[${n}]`,`g`)}get test(){}async convert(e){if(!y(e))throw new n(`format:invalid-point`,`Could not convert invalid point.`,{point:e});let t=this.conversionInfo?.convert;if(t)return Promise.resolve().then(()=>t(e));let r=this._project(e,this.spatialReference);return{location:r,coordinate:this._getCoordinate(r)}}getConversionStrategy(){let e=this._viewSpatialReference;return this.conversionInfo?.convert||this.viewModel?.formatterAvailable||this.name===`xy`&&(e.isWebMercator||e.isWGS84)||this.name===`basemap`?`client`:`server`}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern,n=this._getSegmentMatches(e,!1);for(let e=this.coordinateSegments.length-1;e>=0;e--){let r=this.coordinateSegments[e];t=t.replace(r.alias,n[e])}return t}_parseUserInput(e){let{defaultPattern:t,_additionalCharactersPattern:n,coordinateSegments:r}=this;if(!t||!n)return``;let i=t.replace(n,``);e=e.replace(n,``);let a=this._getSegmentMatches(e,!0);if(r)for(let e=r.length-1;e>=0;e--){let t=r[e];i=i.replace(t.alias,a[e])}return i}_getSegmentMatches(e,t){let n=[],{coordinateSegments:r}=this;if(!r)return n;for(let i=0;i<r.length;i++){let a=r[i],o=e.match(a.searchPattern);if(!o){n.push(``);continue}let s=o[0];if(e=e.replace(s,``).trim(),a.substitution){let e=t?a.substitution.input(s):a.substitution.output(s);e&&(s=`${e}`)}n.push(s)}return n}async reverseConvert(e){let t=this._parseUserInput(e),i=this.conversionInfo?.reverseConvert,a;if(i)a=i(t);else if(this.name===`xy`||this.name===`basemap`)a=b(t,this.spatialReference);else if(this.viewModel?.formatterAvailable)switch(this.name){case`dd`:case`ddm`:case`dms`:a=l(t,this.spatialReference);break;case`mgrs`:a=c(t,this.spatialReference,`automatic`);break;case`utm`:a=s(t,this.spatialReference,`latitude-band-indicators`);break;case`usng`:a=o(t,this.spatialReference);break;default:a=null}if(!a)throw new n(`format:invalid-input`,`Could not parse input into point.`,{coordinate:e});if(this.viewModel?.view?.type===`3d`&&this.viewModel.view.map.ground)try{let e=await this.viewModel?.view?.map.ground.queryElevation(a);a.z=e?.geometry.z??a.z}catch(e){r.getLogger(this).warn(new n(`coordinate-conversion:elevation-query-error`,`Could not get elevation for point.`,{error:e}))}return this._project(a,this._viewSpatialReference)}_getCoordinate(e){let t=this.viewModel?.view?.resolution??0,r=this.viewModel?.view?.scale??0,i=this.viewModel?.view?.spatialReference??g.WebMercator;if(!y(e))throw new n(`format:invalid-point`,`Could not transform invalid point into coordinate.`,{point:e});if(this.viewModel?.formatterAvailable||this.name===`basemap`||this.name===`xy`)switch(this.name){case`dd`:case`ddm`:case`dms`:{let n=this._getPrecision(r,t,i,this.name),a=p(e,this.name,n);return this.viewModel?.removeLeadingZeros?S(a):a}case`mgrs`:return f(e,`automatic`,5,!1);case`usng`:return d(e,5,!1);case`utm`:return u(e,`latitude-band-indicators`,!0);default:return x(e,this._getPrecision(r,t,i,`dd`))}return x(e,this._getPrecision(r,t,i,`dd`))}_getPrecision(e,t,n,r){return this.viewModel?.calculateCoordinatePrecision?C(t,n,r):w(e)}_project(e,t){if(_(e.spatialReference,t)||!t)return e;if(this.viewModel?.formatterAvailable&&m())return h(e,t);if(!this.viewModel?.formatterAvailable){let n=v(e,t);if(n!=null)return n}return null}};e([i()],T.prototype,`conversionInfo`,void 0),e([i()],T.prototype,`coordinateSegments`,void 0),e([i()],T.prototype,`currentPattern`,null),e([i()],T.prototype,`_currentPattern`,void 0),e([i()],T.prototype,`label`,null),e([i()],T.prototype,`defaultPattern`,void 0),e([i({readOnly:!0})],T.prototype,`hasDisplayProperties`,null),e([i()],T.prototype,`name`,void 0),e([i({type:g})],T.prototype,`spatialReference`,null),e([i()],T.prototype,`viewModel`,void 0),e([i({readOnly:!0})],T.prototype,`_viewSpatialReference`,null),e([i({readOnly:!0})],T.prototype,`_additionalCharactersPattern`,null),T=e([a(`esri.widgets.CoordinateConversion.support.Format`)],T);const E=T;export{E as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{getCustoms as e,format as t,parse as n}from"../../../core/number.js";import{getLocale as r}from"../../../intl/locale.js";import i from"./Format.js";const a=e().decimal,o={N:`north`,S:`south`,E:`east`,W:`west`},s=`°‎`,c=RegExp(`-?\\d+[\\.|\\${a}]?\\d*`),l=/^[\\0]+(?=\d)/;function u(t,n){let i=r()===`ar`,a=t.abbreviatedDirections.north,c=t.abbreviatedDirections.south,l=t.abbreviatedDirections.east,u=t.abbreviatedDirections.west,d=e().decimal,m={[a]:`N`,[c]:`S`,[l]:`E`,[u]:`W`},h=RegExp(`-?\\d+[\\.|\\${d}]?\\d*`),g=RegExp(`N|S|${a}|${c}`,`i`),_=RegExp(`E|W|${l}|${u}`,`i`),v={ddm:`Y${s} A'${t.abbreviatedDirections.north}, X${s} B'${t.abbreviatedDirections.east}`,dms:`Y${s} A' B"${t.abbreviatedDirections.north}, X${s} C' D"${t.abbreviatedDirections.east}`,dd:`Y${s}${t.abbreviatedDirections.north}, X${s}${t.abbreviatedDirections.east}`,xy:`X${s}, Y${s}`,basemap:`X, Y`},y={ddm:`${t.abbreviatedDirections.north}${s}Y 'A ,${t.abbreviatedDirections.east}${s}X 'B`,dms:`${t.abbreviatedDirections.north}${s}Y 'A "B ,${t.abbreviatedDirections.east}${s}X 'C "D`,dd:`${t.abbreviatedDirections.north}${s}Y ,${t.abbreviatedDirections.east}${s}X`,xy:`X${s} ,Y${s}`,basemap:`X ,Y`},b=e=>e!=null&&Object.keys(v).includes(e),x=RegExp(`\\d{1,2}[\\.|\\${d}]?\\d*`,`i`),S=RegExp(`\\d{1,3}[\\.|\\${d}]?\\d*`,`i`);n.forEach(e=>{let{name:n}=e;if(n===`dd`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`ddm`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`dms`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:(e.name===`xy`||e.name===`basemap`)&&(e.coordinateSegments=[{alias:`X`,description:`easting`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}}]),b(n)){let t=i?y[n]:v[n];e.defaultPattern=t,e.currentPattern=t}})}function d(){let e=RegExp(`N|S`,`i`),t=RegExp(`E|W`,`i`);return[new i({name:`basemap`,coordinateSegments:[{alias:`X`,description:`easting`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X, Y`,viewModel:null}),new i({name:`dd`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=\\D*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}[\\.|\\${a}]?\\d*(?=\\D*?[E|W|])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s}N, X${s}E`,viewModel:null}),new i({name:`ddm`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}[\\.\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=\\D*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\|${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A'N, X${s} B'E`,viewModel:null}),new i({name:`dms`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=.*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A' B"N, X${s} C' D"E`,viewModel:null}),new i({name:`xy`,coordinateSegments:[{alias:`X`,description:`longitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`latitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X${s}, Y${s}`,viewModel:null}),new i({name:`mgrs`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new i({name:`usng`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new i({name:`utm`,coordinateSegments:[{alias:`Z`,description:`zone number`,searchPattern:/\d{1,2}|[abyz]/i},{alias:`B`,description:`latitude band`,searchPattern:/^\D/},{alias:`X`,description:`easting`,searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:`Y`,description:`northing`,searchPattern:/\d{1,7}/}],defaultPattern:`ZB X Y`,viewModel:null})]}function f(e){let n=e.match(l),r=n?n[0]:``,i=e.includes(`.`)?e.split(`.`)[1].length:0;return r+t(Number(e),{pattern:`###0.###`,places:i,round:-1})}function p(e){return n(e)}export{s as degreeSymbol,d as generateDefaultFormats,u as setDefaultPatterns};
2
+ import{getCustoms as e,format as t,parse as n}from"../../../core/number.js";import{getLocale as r}from"../../../intl/locale.js";import i from"./Format.js";const a=e().decimal,o={N:`north`,S:`south`,E:`east`,W:`west`},s=`°‎`,c=RegExp(`-?\\d+[\\.|\\${a}]?\\d*`),l=/^[\\0]+(?=\d)/;function u(t,n){let i=r()===`ar`,a=t.abbreviatedDirections.north,c=t.abbreviatedDirections.south,l=t.abbreviatedDirections.east,u=t.abbreviatedDirections.west,d=e().decimal,m={[a]:`N`,[c]:`S`,[l]:`E`,[u]:`W`},h=RegExp(`-?\\d+[\\.|\\${d}]?\\d*`),g=RegExp(`N|S|${a}|${c}`,`i`),_=RegExp(`E|W|${l}|${u}`,`i`),v={ddm:`Y${s} A'${t.abbreviatedDirections.north}, X${s} B'${t.abbreviatedDirections.east}`,dms:`Y${s} A' B"${t.abbreviatedDirections.north}, X${s} C' D"${t.abbreviatedDirections.east}`,dd:`Y${s}${t.abbreviatedDirections.north}, X${s}${t.abbreviatedDirections.east}`,xy:`X${s}, Y${s}`,basemap:`X, Y`},y={ddm:`${t.abbreviatedDirections.north}${s}Y 'A ,${t.abbreviatedDirections.east}${s}X 'B`,dms:`${t.abbreviatedDirections.north}${s}Y 'A "B ,${t.abbreviatedDirections.east}${s}X 'C "D`,dd:`${t.abbreviatedDirections.north}${s}Y ,${t.abbreviatedDirections.east}${s}X`,xy:`X${s} ,Y${s}`,basemap:`X ,Y`},b=e=>e!=null&&Object.keys(v).includes(e),x=RegExp(`\\d{1,2}[\\.|\\${d}]?\\d*`,`i`),S=RegExp(`\\d{1,3}[\\.|\\${d}]?\\d*`,`i`);n.forEach(e=>{let{name:n}=e;if(n===`dd`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`ddm`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:n===`dms`?e.coordinateSegments=[{alias:`Y`,description:`degrees latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.north,description:`north/south indicator`,searchPattern:g,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}},{alias:`X`,description:`degrees longitude`,searchPattern:S,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:x,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:t.abbreviatedDirections.east,description:`east/west indicator`,searchPattern:_,substitution:{input:e=>m[e],output:e=>t.abbreviatedDirections[o[e]]}}]:(e.name===`xy`||e.name===`basemap`)&&(e.coordinateSegments=[{alias:`X`,description:`easting`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:h,substitution:{input:e=>p(e),output:e=>f(e)}}]),b(n)){let t=i?y[n]:v[n];e.defaultPattern=t,e.currentPattern=t}})}function d(){let e=RegExp(`N|S`,`i`),t=RegExp(`E|W`,`i`);return[new i({name:`basemap`,coordinateSegments:[{alias:`X`,description:`easting`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`northing`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X, Y`,viewModel:null}),new i({name:`dd`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=\\D*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}[\\.|\\${a}]?\\d*(?=\\D*?[E|W|])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s}N, X${s}E`,viewModel:null}),new i({name:`ddm`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}[\\.\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=\\D*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\|${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A'N, X${s} B'E`,viewModel:null}),new i({name:`dms`,coordinateSegments:[{alias:`Y`,description:`degrees latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?\\s+.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`A`,description:`minutes latitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`B`,description:`seconds latitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[N|S])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`N`,description:`north/south indicator`,searchPattern:e},{alias:`X`,description:`degrees longitude`,searchPattern:RegExp(`\\d{1,3}(?=.*?\\s+.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`C`,description:`minutes longitude`,searchPattern:RegExp(`\\d{1,2}(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`D`,description:`seconds longitude`,searchPattern:RegExp(`\\d{1,2}[\\.|\\${a}]?\\d*(?=.*?[E|W])`,`i`),substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`E`,description:`east/west indicator`,searchPattern:t}],defaultPattern:`Y${s} A' B"N, X${s} C' D"E`,viewModel:null}),new i({name:`xy`,coordinateSegments:[{alias:`X`,description:`longitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}},{alias:`Y`,description:`latitude`,searchPattern:c,substitution:{input:e=>p(e),output:e=>f(e)}}],defaultPattern:`X${s}, Y${s}`,viewModel:null}),new i({name:`mgrs`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new i({name:`usng`,coordinateSegments:[{alias:`Z`,description:`grid zone`,searchPattern:/\d{1,2}\w|[abyz]/i},{alias:`S`,description:`grid square`,searchPattern:/\w{2}/},{alias:`X`,description:`easting`,searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:`Y`,description:`northing`,searchPattern:/^\d{1,5}/}],defaultPattern:`Z S X Y`,viewModel:null}),new i({name:`utm`,coordinateSegments:[{alias:`Z`,description:`zone number`,searchPattern:/\d{1,2}|[abyz]/i},{alias:`B`,description:`latitude band`,searchPattern:/^\D/},{alias:`X`,description:`easting`,searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:`Y`,description:`northing`,searchPattern:/\d{1,7}/}],defaultPattern:`ZB X Y`,viewModel:null})]}function f(e){let n=e.match(l),r=n?n[0]:``,i=e.includes(`.`)?e.split(`.`,2)[1].length:0;return r+t(Number(e),{pattern:`###0.###`,places:i,round:-1})}function p(e){return n(e)}export{s as degreeSymbol,d as generateDefaultFormats,u as setDefaultPatterns};