@arcgis/core 5.0.0-next.4 → 5.0.0-next.6

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 (435) hide show
  1. package/Map.js +1 -1
  2. package/analysis/ElevationProfileAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  5. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  6. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  7. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  8. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  9. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  10. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  11. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
  14. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +1 -0
  15. package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +1 -0
  16. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
  17. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 17d5f8dba6ebb1184506.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 22d6b8102e75bdef204c.js} +1 -1
  23. package/assets/esri/core/workers/chunks/279366e6b743f9680603.js +1 -0
  24. package/assets/esri/core/workers/chunks/285762ff92d5388b6024.js +1 -0
  25. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  26. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{3d65b8a2fbe1df050a25.js → 377a66034e7c1bad5599.js} +1 -1
  28. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  29. package/assets/esri/core/workers/chunks/{0f9bb3187306f89e3d63.js → 398f356b11fd33bd3831.js} +1 -1
  30. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  31. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
  32. package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
  33. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +1 -0
  34. package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
  35. package/assets/esri/core/workers/chunks/4c5a7249a311070d8f43.js +1 -0
  36. package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c0feec6e2f0e45900ae0.js → 53bd8996e8812f1ad7b2.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{9a723d739ac44b45432c.js → 557960763695abee4a83.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5bd36dbf46c25bd961c8.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
  43. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  44. package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +1 -0
  46. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
  49. package/assets/esri/core/workers/chunks/{3d22fe2f2c40abbc246e.js → 7461124454bfb4fb6474.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
  51. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +1 -0
  52. package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
  54. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  55. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  56. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +1 -0
  57. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +1 -0
  58. package/assets/esri/core/workers/chunks/{2a5f331c0f18d8574b4e.js → 811d4c46c75cf6a63e78.js} +1 -1
  59. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  60. package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{dc31865edea480f0ebba.js → 8833c3d168951be4bf20.js} +1 -1
  62. package/assets/esri/core/workers/chunks/883ffaa69b3e6eb158bf.js +1 -0
  63. package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{b2add7338258ca7c24dd.js → 90250e9239c173aace88.js} +1 -1
  69. package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
  70. package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
  71. package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
  72. package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
  73. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +1 -0
  74. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +1 -0
  75. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +1 -0
  77. package/assets/esri/core/workers/chunks/9fac5a12e878cd745354.js +1 -0
  78. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +316 -0
  79. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  80. package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
  82. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → a4db5c9a90107e097df8.js} +1 -1
  83. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +1 -0
  84. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js.LICENSE.txt +1 -1
  85. package/assets/esri/core/workers/chunks/aa54b6f2aba6952af149.js +1 -0
  86. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  87. package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
  88. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  89. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → b017bac40dc8328013e3.js} +2 -2
  90. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → b017bac40dc8328013e3.js.LICENSE.txt} +1 -1
  91. package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  93. package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +2 -0
  94. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → b96eb0ea506379182d62.js.LICENSE.txt} +1 -1
  95. package/assets/esri/core/workers/chunks/{b5863afafd3a7d2d5c05.js → bb5484b5eeacc9ad2ceb.js} +3 -3
  96. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  97. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  98. package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{0eaa4dccba0d844b9da3.js → c3ddcf9148dd2640c402.js} +1 -1
  101. package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +1 -0
  102. package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
  103. package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
  104. package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
  105. package/assets/esri/core/workers/chunks/cd1930f08e1fc8b30b14.js +1 -0
  106. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  107. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  108. package/assets/esri/core/workers/chunks/d1fe816b6990918c13c7.js +1 -0
  109. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +1 -0
  110. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  111. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +1 -0
  112. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  113. package/assets/esri/core/workers/chunks/d97fadbc69e055d183a0.js +1 -0
  114. package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
  115. package/assets/esri/core/workers/chunks/e31192ae920e3e19b6aa.js +1 -0
  116. package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
  117. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +1 -0
  118. package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
  119. package/assets/esri/core/workers/chunks/{039ec0fbe3b4b398b8c6.js → f26dc1d83beed63b6045.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{fa5c87889c2f0bef896b.js → f35aaa04cca676c2d3f8.js} +1 -1
  121. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
  122. package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
  123. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  124. package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
  125. package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
  126. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +1 -0
  127. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +1 -0
  128. package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
  129. package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
  130. package/assets/esri/core/workers/chunks/fd2efd1d1cf9d95a87e6.js +1 -0
  131. package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
  133. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  134. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  135. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  136. package/assets/esri/themes/dark/main.css +1 -1
  137. package/assets/esri/themes/light/main.css +1 -1
  138. package/assets/esri/themes/light/view.css +1 -1
  139. package/chunks/ComponentShader.glsl.js +72 -39
  140. package/chunks/OITBlend.glsl.js +3 -3
  141. package/chunks/bundle.js +1 -1
  142. package/config.js +1 -1
  143. package/core/Identifiable.js +1 -1
  144. package/core/MultiOriginJSONSupport.js +1 -1
  145. package/core/NumericIdentifiable.js +5 -0
  146. package/core/QueueProcessor.js +1 -1
  147. package/core/WriteableMultiOriginJSONMixin.js +5 -0
  148. package/core/has.js +1 -1
  149. package/core/performance.js +5 -0
  150. package/core/sanitizerUtils.js +1 -1
  151. package/core/scheduling.js +1 -1
  152. package/core/workers/Connection.js +1 -1
  153. package/core/workers/WorkerHandle.js +1 -1
  154. package/core/workers/utils.js +1 -1
  155. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  156. package/geohash/GeohashCell.js +1 -1
  157. package/geohash/geohashUtils.js +1 -1
  158. package/geometry/GeometryCursor.js +1 -1
  159. package/geometry/geometryCursorCollectUtils.js +1 -1
  160. package/geometry/libtess.js +1 -1
  161. package/geometry/support/jsonUtils.js +1 -1
  162. package/geometry/support/normalizeUtilsSync.js +1 -1
  163. package/geometry/support/triangulationUtils.js +1 -1
  164. package/interfaces.d.ts +444 -349
  165. package/intl/date.js +1 -1
  166. package/intl.d.ts +2 -0
  167. package/intl.js +1 -1
  168. package/kernel.js +1 -1
  169. package/layers/FeatureLayer.js +1 -1
  170. package/layers/graphics/OptimizedFeature.js +1 -1
  171. package/layers/graphics/OptimizedGeometry.js +1 -1
  172. package/layers/graphics/centroid.js +1 -1
  173. package/layers/graphics/contains.js +1 -1
  174. package/layers/graphics/data/AttributesBuilder.js +1 -1
  175. package/layers/graphics/data/FeatureStore.js +1 -1
  176. package/layers/graphics/data/QueryEngine.js +1 -1
  177. package/layers/graphics/data/QueryEngineResult.js +1 -1
  178. package/layers/graphics/data/geometryUtils.js +1 -1
  179. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  180. package/layers/graphics/featureConversionUtils.js +1 -1
  181. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  182. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  183. package/layers/graphics/sources/geojson/geojson.js +1 -1
  184. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  185. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  186. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  187. package/layers/knowledgeGraph/layerUtils.js +1 -1
  188. package/layers/mixins/ArcGISImageService.js +1 -1
  189. package/layers/mixins/ImageryTileMixin.js +1 -1
  190. package/layers/support/MediaElementBase.js +1 -1
  191. package/layers/support/PixelBlock.js +1 -1
  192. package/layers/support/RasterInfo.js +1 -1
  193. package/layers/support/RasterJobHandler.js +1 -1
  194. package/layers/support/RasterSensorInfo.js +1 -1
  195. package/layers/support/RasterStorageInfo.js +1 -1
  196. package/layers/support/RasterWorker.js +1 -1
  197. package/layers/support/TitleCreator.js +1 -1
  198. package/layers/support/arcgisLayerUrl.js +1 -1
  199. package/layers/support/capabilities.js +1 -1
  200. package/layers/support/fieldUtils.js +1 -1
  201. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  202. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  203. package/layers/support/rasterFieldUtils.js +1 -1
  204. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  205. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  206. package/package.json +5 -5
  207. package/request.js +1 -1
  208. package/rest/print.js +1 -1
  209. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  210. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  211. package/rest/query/operations/query.js +1 -1
  212. package/rest/query/operations/queryZScale.js +1 -1
  213. package/rest/versionManagement/getVersionInfos.js +1 -1
  214. package/smartMapping/statistics/histogram.js +1 -1
  215. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  216. package/smartMapping/support/utils.js +1 -1
  217. package/support/basemapDefinitions.js +1 -1
  218. package/support/elevationInfoUtils.js +1 -1
  219. package/support/requestImageUtils.js +1 -1
  220. package/support/revision.js +1 -1
  221. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  222. package/undoredo/support/Services.js +1 -1
  223. package/views/2d/GoToManager.js +1 -1
  224. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  225. package/views/2d/constraints/GeometryConstraint.js +1 -1
  226. package/views/2d/constraints/RotationConstraint.js +1 -1
  227. package/views/2d/constraints/ZoomConstraint.js +1 -1
  228. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  229. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  230. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  231. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  232. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  233. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  234. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  235. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  236. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  237. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  238. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  239. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  240. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  241. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  242. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  243. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  244. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  245. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  246. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  247. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  248. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  249. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  250. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  251. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  252. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  253. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  254. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  255. package/views/3d/FocusAreasView.js +1 -1
  256. package/views/3d/GroundView3D.js +1 -1
  257. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  258. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  259. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  260. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  261. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  262. package/views/3d/layers/FlowSubView3D.js +1 -1
  263. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  264. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  265. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  266. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  267. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  268. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  269. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  270. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  271. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  272. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  273. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  274. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  275. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  276. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  277. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  278. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  279. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  280. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  281. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  282. package/views/3d/state/ViewStateManager.js +1 -1
  283. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  284. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  285. package/views/3d/state/controllers/RotateController.js +1 -1
  286. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  287. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  288. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  289. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  290. package/views/3d/state/utils/navigationUtils.js +1 -1
  291. package/views/3d/support/DisplayQualityProfile.js +1 -1
  292. package/views/3d/support/QualitySettings.js +1 -1
  293. package/views/3d/support/StreamDataLoader.js +1 -1
  294. package/views/3d/support/engineContent/line.js +1 -1
  295. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  296. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  297. package/views/3d/support/flow/FlowWorker.js +1 -1
  298. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  299. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  300. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  301. package/views/3d/support/flow/constants.js +1 -1
  302. package/views/3d/support/hitTest.js +1 -1
  303. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  304. package/views/3d/terrain/OverlayRenderer.js +1 -1
  305. package/views/3d/terrain/Tile.js +1 -1
  306. package/views/3d/terrain/TileOverlayData.js +1 -1
  307. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  308. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  309. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  310. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  312. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  313. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  314. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  315. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  316. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  317. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  318. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  319. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +4 -4
  320. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  321. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  322. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  323. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  324. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  325. package/views/analysis/ElevationProfile/constants.js +1 -1
  326. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  327. package/views/draw/support/Reshape.js +1 -1
  328. package/views/draw/support/reshapeUtils.js +1 -1
  329. package/views/interactive/dragEventPipeline.js +1 -1
  330. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  331. package/views/support/Scheduler.js +1 -1
  332. package/views/webgl/ShaderBuilder.js +1 -1
  333. package/views/webgl/Texture.js +1 -1
  334. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  335. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  336. package/widgets/BatchAttributeForm.js +1 -1
  337. package/widgets/Directions/css.js +1 -1
  338. package/widgets/Directions.js +1 -1
  339. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  340. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  341. package/widgets/Editor/EditorViewModel.js +1 -1
  342. package/widgets/Editor/Edits.js +1 -1
  343. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  344. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  345. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  346. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  347. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  348. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  349. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  350. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  351. package/widgets/Editor/components/UploadDetails.js +1 -1
  352. package/widgets/Editor/support/EditorItem.js +1 -1
  353. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  354. package/widgets/Editor/workflowUtils.js +1 -1
  355. package/widgets/Editor.js +1 -1
  356. package/widgets/Feature/FeatureExpression.js +1 -1
  357. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  358. package/widgets/Feature/FeatureFields.js +1 -1
  359. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  360. package/widgets/Feature/FeatureMedia.js +1 -1
  361. package/widgets/Feature/FeatureViewModel.js +1 -1
  362. package/widgets/Feature/support/featureUtils.js +1 -1
  363. package/widgets/Feature.js +1 -1
  364. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  365. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  366. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  367. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  368. package/widgets/Print.js +1 -1
  369. package/widgets/Search/LayerSearchSource.js +1 -1
  370. package/widgets/UtilityNetworkTrace.js +1 -1
  371. package/widgets/support/ColorPicker.js +1 -1
  372. package/widgets/support/SelectionList/LayerItem.js +1 -1
  373. package/widgets/support/jsxWidgetSupport.js +1 -1
  374. package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
  375. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  376. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  377. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  378. package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
  379. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  380. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  381. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  382. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  383. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  384. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  385. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  386. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  387. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  388. package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
  389. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  390. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  391. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  392. package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
  393. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  394. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  395. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  396. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  397. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  398. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  399. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  400. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  401. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  402. package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +0 -1
  403. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  404. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  405. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  406. package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +0 -1
  407. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  408. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  409. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  410. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  411. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  412. package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +0 -1
  413. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  414. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  415. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  416. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  417. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  418. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  419. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  420. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  421. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  422. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  423. package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
  424. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
  425. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  426. package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
  427. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  428. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  429. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  430. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  431. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  432. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  433. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  434. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  435. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as m,initial as f,on as _}from"../../core/reactiveUtils.js";import{throttle as y}from"../../core/throttle.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/Point.js";import A from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import E from"./FeatureFields/FeatureFieldsViewModel.js";import C from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as S,isAssociatedFeatureSupportedLayer as B,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as K,formatAttributes as z}from"./support/featureUtils.js";import{queryLayerInfos as Q,queryRelatedFeatures as J,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=y(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=y(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),f),m(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof C&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof C&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!S(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(_(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!B(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),f),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r,attachmentKeywords:a,attachmentTypes:n}=e;return this.contentViewModels[t]=new M({attachmentKeywords:a,attachmentTypes:n,graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=e?.fieldInfos||i?.fieldInfos,a=r?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),n=i?.expressionInfos,{description:l,title:p}=e;return{attributes:o,expressionInfos:n,fieldInfos:a,...this._compileTitleAndDesc({title:p,description:l})}}_compileFields(e,t){const i=e.clone(),s=new E(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new C(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?k(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=z({fieldInfos:s?.fieldInfos,graphic:o,attributes:{...l,...e.attributes},layer:a,fieldInfoMap:n,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=z({fieldInfos:e.fieldInfos,graphic:s,attributes:{...n,...e.attributes},layer:r,fieldInfoMap:a,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:z({fieldInfos:l,graphic:i,attributes:a,layer:o,fieldInfoMap:r,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await Q({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await J({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([g()],ne.prototype,"_error",void 0),e([g()],ne.prototype,"_graphicChangedTask",void 0),e([g()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([g()],ne.prototype,"_associationVMAbortController",void 0),e([g({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([g({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([g({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([g()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([g({readOnly:!0})],ne.prototype,"content",void 0),e([g({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([g()],ne.prototype,"description",void 0),e([g({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([g({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([g({readOnly:!0})],ne.prototype,"state",null),e([g({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([g({type:t})],ne.prototype,"graphic",void 0),e([g({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([g({type:w})],ne.prototype,"location",void 0),e([g({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([g({type:A})],ne.prototype,"spatialReference",null),e([g()],ne.prototype,"timeZone",null),e([g({readOnly:!0})],ne.prototype,"title",void 0),e([g()],ne.prototype,"map",null),e([g({readOnly:!0})],ne.prototype,"waitingForContent",null),e([g()],ne.prototype,"view",void 0),ne=te=e([v("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../../core/Accessor.js";import{isSome as o}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{IdentifiableMixin as n}from"../../core/Identifiable.js";import l from"../../core/Logger.js";import{abortMaybe as p}from"../../core/maybe.js";import{eachAlways as c,isAbortError as d,throwIfAborted as h}from"../../core/promiseUtils.js";import{watch as u,when as f,initial as m,on as g}from"../../core/reactiveUtils.js";import{throttle as _}from"../../core/throttle.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import{cast as b}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as A}from"../../core/accessorSupport/decorators/subclass.js";import v from"../../geometry/Point.js";import w from"../../geometry/SpatialReference.js";import I from"../../popup/content/TextContent.js";import{system as x}from"../../time/constants.js";import M from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import T from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import C from"./FeatureFields/FeatureFieldsViewModel.js";import E from"./FeatureMedia/FeatureMediaViewModel.js";import V from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as j,formatArcadeValue as k}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as P,preRequestCallback as R,createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as N,querySourceLayer as U,queryUpdatedFeature as Z,isRelatableFeatureSupportedLayer as S,isAssociatedFeatureSupportedLayer as B,substituteFieldsInLinksAndAttributes as H,isExpressionField as D,isRelatedField as G,formatEditInfo as q,graphicCallback as K,formatAttributes as z}from"./support/featureUtils.js";import{queryLayerInfos as Q,queryRelatedFeatures as J,setRelatedFeatures as W,getRelatedFieldInfo as X,createRelatedInfo as Y,updateRelatedInfo as $}from"./support/relatedFeatureUtils.js";import ee from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var te;const ie=1,se="content-view-models",oe="relationship-view-models",re="association-view-models",ae={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let ne=class extends(n(s)){static{te=this}constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ae},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=_(this._graphicChanged,()=>this.notifyChange("waitingForContent"),ie,this),this._isAllowedContentType=e=>{const{abilities:t}=this;return"attachments"===e.type&&!!t.attachmentsContent||"custom"===e.type&&!!t.customContent||"fields"===e.type&&!!t.fieldsContent||"media"===e.type&&!!t.mediaContent||"text"===e.type&&!!t.textContent||"expression"===e.type&&!!t.expressionContent||"relationship"===e.type&&!!t.relationshipContent||"utility-network-associations"===e.type&&!!t.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=_(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),ie,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),m),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const e=this._graphicChangedTask.value,t=e?.expressionInfos?.dependencies;return[e,t?.has("view-scale")?this.view?.scale:null,t?.has("view-time-extent")?this.view?.timeExtent?.start:null,t?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([e])=>this._evaluateExpressionAttributesThrottled(e))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=p(this._graphicChangedTask),this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}static{this.interceptor=new i(P,R)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...ae,...e}}get isFeatureFromTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){const{_graphicChangedThrottled:e,_evaluateExpressionAttributesThrottled:t,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s,_associationVMAbortController:o}=this;return e.hasPendingUpdates()||t.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished||!!o}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof E&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof E&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await(i?.load());const s=i?.objectIdField;if(!s||!e||!i)return;const o=e?.attributes?.[s];if(null==o)return;const r=[o];if(!e.geometry){const s=await U({layer:i,graphic:e,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:t}),o=s?.geometry;o&&(e.geometry=o)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._graphicChangedTask=p(this._graphicChangedTask),this._graphicChangedTask=r(async e=>{this._error=null,this._clear();const{graphic:t}=this;try{if(!t)return null;const{_sourceLayer:i,_effectivePopupTemplate:s}=this,o=this.spatialReference;await Z({graphic:t,popupTemplate:s,layer:i,spatialReference:o},{signal:e});const[{value:r},{value:a}]=await c([this._getContent(),this._getTitle()]),[,{value:n}]=await c([this._checkForRelatedFeatures({signal:e}),j(s?.expressionInfos,t)]);return{expressionInfos:n,content:r,title:a}}catch(i){throw d(i)||(this._error=i,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(e,t){return"attachments"===e.type?this._compileAttachments(e,t):"custom"===e.type?this._compileCustom(e,t):"fields"===e.type?this._compileFields(e,t):"media"===e.type?this._compileMedia(e,t):"text"===e.type?this._compileText(e,t):"expression"===e.type?this._compileExpression(e,t):"relationship"===e.type?this._compileRelationship(e,t):"utility-network-associations"===e.type?this._compileUtilityNetworkAssociation(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(o):"string"==typeof e?this._compileText(new I({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(oe),this.removeHandles(se),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),s=t?.getObjectId();return null!=i&&null!=s&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:s,spatialReference:o,timeZone:r}=this;t?.filter(Boolean).forEach(t=>{e.some(e=>this._matchesFeature(e,t))||e.add(new te({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:t}))}),e.forEach(i=>{const s=t?.find(e=>this._matchesFeature(i,e));s||e.remove(i)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:o}=e,r=s?.type;o&&r&&("fields"===r&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createFieldsVMParams(s,t))),"media"===r&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),o.set(this._createMediaVMParams(s,t))),"text"===r&&o.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:o,title:r,description:a}=e,{_sourceLayer:n,graphic:l,map:p}=this;if(!S(n))return;const c=new V({displayCount:i,graphic:l,orderByFields:s,relationshipId:o,layer:n,map:p,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[t]=c,this.addHandles(g(()=>c.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(c)),oe),e}_matchesGlobalFeature(e,t){return e.association.equals(t.association)}_setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:s,spatialReference:o,timeZone:r}=this;e.forEach((i,s)=>{const o=t.get(s);o?i.forEach(t=>{o.find(e=>this._matchesGlobalFeature(t,e))||(i.remove(t),0===i.length&&e.delete(s))}):(i.removeAll(),e.delete(s))}),t.forEach((t,n)=>{const l=e.get(n)||new a;t?.filter(Boolean).forEach((e,t)=>{if(!l.some(t=>this._matchesGlobalFeature(t,e))){const{association:a,feature:n,terminalName:p,title:c}=e;l.add({title:c,association:a,featureViewModel:new te({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:n}),terminalName:p},t)}}),e.set(n,l)})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!B(a))return;const p=new ee({graphic:n,displayCount:i,associationTypes:r,layer:a,map:l,...this._compileTitleAndDesc({title:s,description:o})});return this.contentViewModels[t]=p,this.addHandles([u(()=>p.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(p.associationViewModels,p.associationFeatures,p.map))],re),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:o,spatialReference:r,view:a,location:n}=this,l=new F({expressionInfo:i,graphic:s,interceptor:te.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u(()=>l.contentElementViewModel,()=>this._setExpressionContentVM(l,t),m),se),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r,attachmentKeywords:a,attachmentTypes:n}=e;return this.contentViewModels[t]=new M({attachmentKeywords:a,attachmentTypes:n,graphic:i,orderByFields:r,...this._compileTitleAndDesc({title:o,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:o}=e;return this.contentViewModels[t]=new T({graphic:i,creator:s,destroyer:o}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:o,formattedAttributes:r}=this,a=o?.attributes,n=this._expressionAttributes,l=r.global;return{title:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:H({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,s=this.formattedAttributes,o={...s?.global,...s?.content[t]},r=!!e?.fieldInfos,a=e?.fieldInfos||i?.fieldInfos,n=a?.filter(({fieldName:e})=>!!e&&(D(e)||G(e)||o.hasOwnProperty(e))),l=i?.expressionInfos,{description:p,title:c}=e;return{attributes:o,expressionInfos:l,fieldInfos:n,isContentFieldInfos:r,isAggregate:this.graphic?.isAggregate??!1,layer:this._sourceLayer,...this._compileTitleAndDesc({title:c,description:p})}}_compileFields(e,t){const i=e.clone(),s=new C(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:o,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:n,_expressionAttributes:l}=this,p=this.formattedAttributes,c=s?.attributes??{},{description:d,mediaInfos:h,title:u}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:c,isAggregate:s?.isAggregate??!1,layer:n,fieldInfoMap:o,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:l,mediaInfos:h,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:u,description:d})}}_compileMedia(e,t){const i=e.clone(),s=new E(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:o}=this;if(e&&e.text){const r=t?.attributes??{},a=this.formattedAttributes?.global??{};e.text=H({attributes:r,fieldInfoMap:i,globalAttributes:a,expressionAttributes:o,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new T(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:s}=this;if(!e)return;const{lastEditInfoEnabled:o}=e,r=t?.editFieldsInfo;return o&&r?q(r,i?.attributes,s,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:o}=this,r=s?.attributes??{},a=this.formattedAttributes?.global??{};return H({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?K({type:"content",value:e?.content,event:{graphic:t}}):null}_evaluateExpressionAttributes({title:e,content:t,expressionInfos:i}){this._evaluateExpressionAttributesTask=p(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=r(async s=>{const{graphic:o,map:r,view:a,spatialReference:n,location:p}=this;try{if(!o)return;let l;if(null!=i){const e=[];for(const[t,l]of i.expressions.entries())null!=l?e.push(l.evaluate({graphic:o,interceptor:te.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then(e=>[t,"string"==typeof e?k(e):e]).catch(()=>[t,void 0])):e.push(Promise.resolve([t,void 0]));l=Object.fromEntries(await Promise.all(e)),h(s)}this._expressionAttributes=l,this._graphicExpressionAttributes={...o.attributes,...l},this._set("formattedAttributes",this._createFormattedAttributes(t)),this._set("title",this._compileTitle(e)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(t)||null)}catch(c){d(c)||(this._error=c,l.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:c,graphic:o,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:o,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[t]=z({attributes:{...l,...e.attributes},fieldInfoMap:n,fieldInfos:s?.fieldInfos,graphic:o,isAggregate:o?.isAggregate??!1,layer:a,relatedInfos:r,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:o,_sourceLayer:r,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[t]=z({attributes:{...n,...e.attributes},fieldInfoMap:a,fieldInfos:e.fieldInfos,graphic:s,isAggregate:s?.isAggregate??!1,isContentFieldInfos:!0,layer:r,relatedInfos:o,timeZone:l})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:o,_fieldInfoMap:r,_graphicExpressionAttributes:a,timeZone:n}=this,l=t?.fieldInfos,p={global:z({attributes:a,fieldInfoMap:r,fieldInfos:l,graphic:i,isAggregate:i?.isAggregate??!1,layer:o,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(e)&&e.forEach((e,t)=>{"fields"===e.type&&this._createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p}),"media"===e.type&&this._createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,O(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:o}=this;s.clear();const r=null!=o?.associatedLayer?await(o?.associatedLayer.load(i)):o;if(!r||!e)return;const a=t.filter(e=>!!e.fieldName&&G(e.fieldName));if(!a?.length)return;t.forEach(e=>this._configureRelatedInfo(e,r));const n=await Q({relatedInfos:s,layer:r},i);Object.keys(n).forEach(e=>{const t=s.get(e.toString()),i=n[e]?.value;t&&i&&(t.layerInfo=i.data)});const l=await J({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach(e=>{W(l[e]?.value,s.get(e.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=X(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||Y(o,t);a&&($({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([y()],ne.prototype,"_error",void 0),e([y()],ne.prototype,"_graphicChangedTask",void 0),e([y()],ne.prototype,"_evaluateExpressionAttributesTask",void 0),e([y()],ne.prototype,"_associationVMAbortController",void 0),e([y({readOnly:!0})],ne.prototype,"_effectivePopupTemplate",null),e([y({readOnly:!0})],ne.prototype,"_fieldInfoMap",null),e([y({readOnly:!0})],ne.prototype,"_sourceLayer",null),e([y()],ne.prototype,"abilities",void 0),e([b("abilities")],ne.prototype,"castAbilities",null),e([y({readOnly:!0})],ne.prototype,"content",void 0),e([y({readOnly:!0})],ne.prototype,"contentViewModels",void 0),e([y()],ne.prototype,"description",void 0),e([y({type:Boolean})],ne.prototype,"defaultPopupTemplateEnabled",void 0),e([y({readOnly:!0})],ne.prototype,"isFeatureFromTable",null),e([y({readOnly:!0})],ne.prototype,"state",null),e([y({readOnly:!0})],ne.prototype,"formattedAttributes",void 0),e([y({type:t})],ne.prototype,"graphic",void 0),e([y({readOnly:!0})],ne.prototype,"lastEditInfo",void 0),e([y({type:v})],ne.prototype,"location",void 0),e([y({readOnly:!0})],ne.prototype,"relatedInfos",void 0),e([y({type:w})],ne.prototype,"spatialReference",null),e([y()],ne.prototype,"timeZone",null),e([y({readOnly:!0})],ne.prototype,"title",void 0),e([y()],ne.prototype,"map",null),e([y({readOnly:!0})],ne.prototype,"waitingForContent",null),e([y()],ne.prototype,"view",void 0),ne=te=e([A("esri.widgets.Feature.FeatureViewModel")],ne);export{ne as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../core/has.js";import e from"../../../core/Logger.js";import{replace as t}from"../../../core/string.js";import{convertDateFormatToIntlOptions as n,formatDate as r}from"../../../intl/date.js";import{formatNumber as i,convertNumberFormatToIntlOptions as o}from"../../../intl/number.js";import{isRasterPixelValueField as a,featureHasFields as l,isTimeOnlyField as u}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{formatAnyDate as f,isAnyDateField as c}from"../../../smartMapping/support/utils.js";import{loadArcade as d}from"../../../support/loadArcade.js";import{getTimeZoneFormattingOptions as p}from"../../../time/timeZoneUtils.js";const y="esri.widgets.Feature.support.featureUtils",m=()=>e.getLogger(y),b=/href=(""|'')/gi,g=/(\{([^{\r\n]+)\})/g,I=/'/g,h=/^\s*expression\//i,w=/(\n)/gi,F=/[\u00A0-\u9999<>&]/gim,T=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,N=/^(?:mailto:|tel:)/,j="relationships/",Z=n("short-date-short-time");function L(e){if(null!=e)return(e.sourceLayer||e.layer)??void 0}async function q({type:e,value:t,event:n}){try{return"function"==typeof t?t(n):await t}catch(r){return void m().error("error",`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t})}}function x(e=""){if(e)return!N.test(e.trim().toLowerCase())}function E(e){return!!e&&h.test(e)}function U(e,t){if(!t||!E(t)||!e)return;const n=t.replace(h,"").toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function v(e,t){const n=U(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function A(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}function C(e){return e.replaceAll(b,"")}function M(e,t){const n=R(t,e);return n?n.name:e}function k(e,t){return e&&e.map(e=>M(e,t))}function R(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function $(e){return`${e}`.trim()}function D({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:o}){return r?z({formattedAttributes:t,template:P(r,{...t,...i,...e},n),fieldInfoMap:o}):""}function z({formattedAttributes:e,template:n,fieldInfoMap:r}){return $(C(t(t(n,e=>A(e,r)),e)))}function O(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",o=(n?encodeURIComponent(r):r).replaceAll(I,i);t[e]=o}}function S(e,t=!1){const n={...e};return Object.keys(n).forEach(e=>O(e,n,t)),n}function G(e,n,r){const i=(n=$(n))&&!n.startsWith("{");return t(e,S(r,i||!1))}function Q(e,t){return e.replaceAll(g,(e,n,r)=>{const i=R(t,r);return i?`{${i.name}}`:n})}function P(e,t,n){const r=Q(e,n);return r?r.replaceAll(T,(e,n,r)=>G(e,n||r,t)):r}function _(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}function H(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function W(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function B(e){return H(e)&&W(e)}function J(e){return!(!(e&&"object"==typeof e&&"createQuery"in e&&"getField"in e&&"queryFeatureCount"in e&&"queryFeatures"in e&&"queryObjectIds"in e&&"capabilities"in e&&"fields"in e&&"fieldsIndex"in e&&"type"in e)||"feature"!==e.type&&"subtype-group"!==e.type&&"subtype-sublayer"!==e.type&&"sublayer"!==e.type||!("when"in e))&&("subtype-sublayer"===e.type&&"parent"in e&&e.parent&&"object"==typeof e.parent?"globalIdField"in e.parent:"globalIdField"in e)}function K(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&B(e.sourceLayer)}function V(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:l,layer:u,timeZone:s}=t,c=ee(n,r),d=R(u,r);if(c&&!a(r)){const t=d?.type,n=c.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||n)return f(e,{format:n,fieldType:t,timeZoneOptions:{layerTimeZone:u&&"preferredTimeZone"in u?u.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:!(!u||!("datesInUnknownTimezone"in u))&&!!u.datesInUnknownTimezone}})}const p=c?.format;return"string"==typeof e&&a(r)&&p?X(e,p):"string"==typeof(e=_(e,p))||null==e||null==p?le(e):i(e,l?{...o(p),minimumFractionDigits:0,maximumFractionDigits:20}:o(p))}function X(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?Y(e,",",", ",t):e.includes(";")?Y(e,";","; ",t):e.includes(" ")?Y(e," "," ",t):i(Number(e),o(t))}function Y(e,t,n,r){return e.trim().split(t).map(e=>i(Number(e),o(r))).join(n)}function ee(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function te({fieldName:e,graphic:t,layer:n}){if(ye(e))return null;if(!n||"function"!=typeof n.getFeatureType)return null;const{typeIdField:r}=n;if(!r||e!==r)return null;const i=n.getFeatureType(t);return i?i.name:null}function ne({fieldName:e,value:t,graphic:n,layer:r}){if(ye(e))return null;if(!r||"function"!=typeof r.getFieldDomain)return null;const i=n&&r.getFieldDomain(e,{feature:n,excludeImpliedDomains:has("esri-widget-legacy-field-domain-calculation")});return i&&"coded-value"===i.type?i.getName(t):null}function re(e,t,n,i){const{creatorField:o,creationDateField:a,editorField:l,editDateField:u}=e;if(!t)return;const s=p(i&&"preferredTimeZone"in i?i.preferredTimeZone:null,!(!i||!("datesInUnknownTimezone"in i))&&!!i.datesInUnknownTimezone,n,Z,"date"),f={...Z,...s},c=t[u];if("number"==typeof c){const e=t[l];return{type:"edit",date:r(c,f),user:e}}const d=t[a];if("number"==typeof d){const e=t[o];return{type:"create",date:r(d,f),user:e}}return null}function ie(e,t){const n=new Map;if(!e)return n;for(const r of e){if(!r.fieldName)continue;const e=M(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function oe(e){const t=[];if(!e)return t;const{fieldInfos:n,content:r}=e;return n&&t.push(...n),r&&Array.isArray(r)?(r.forEach(e=>{if("fields"===e.type){const n=e?.fieldInfos;n&&t.push(...n)}}),t):t}function ae(e){return e.replaceAll(F,e=>`&#${e.charCodeAt(0)};`)}function le(e){return"string"==typeof e?e.replaceAll(w,'<br class="esri-text-new-line" />'):e}function ue(e){const{value:t,fieldName:n,fieldInfos:r,fieldInfoMap:i,layer:o,graphic:a,timeZone:l}=e;if(null==t)return"";const s=ne({fieldName:n,value:t,graphic:a,layer:o});if(s)return s;const d=te({fieldName:n,graphic:a,layer:o});if(d)return d;if(i.get(n.toLowerCase()))return V(t,{fieldInfos:r||Array.from(i.values()),fieldName:n,layer:o,timeZone:l});const p=o?.fieldsIndex?.get(n);return p&&(c(p)||u(p))?f(t,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone}}):le(t)}function se({fieldInfos:e,attributes:t,layer:n,graphic:r,fieldInfoMap:i,relatedInfos:o,timeZone:a}){const l={};return o?.forEach(t=>ge({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:n,timeZone:a})),t&&Object.keys(t).forEach(o=>{const u=t[o];l[o]=ue({fieldName:o,fieldInfos:e,fieldInfoMap:i,layer:n,value:u,graphic:r,timeZone:a})}),l}async function fe(e,t){const{layer:n,graphic:r,outFields:i,objectIds:o,returnGeometry:a,spatialReference:l}=e,u=o[0];if("number"!=typeof u&&"string"!=typeof u){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:n,graphic:r,objectId:u,requiredFields:i};return m().warn(e,t),null}if(!s(n)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:n,graphic:r,requiredFields:i,returnGeometry:a};return m().warn(e,t),null}const f=n.createQuery();f.objectIds=o,f.outFields=i?.length?i:[n.objectIdField],f.returnGeometry=!!a,f.returnZ=!!a,f.returnM=!!a,f.outSpatialReference=l;return(await n.queryFeatures(f,t)).features[0]}async function ce(e){if(!e.expressionInfos?.length)return!1;const t=await d(),{arcadeUtils:{hasGeometryFunctions:n}}=t;return n(e)}async function de(e){if(!e.expressionInfos?.length)return!1;const t=await d(),{arcadeUtils:{requiresTrack:n}}=t;return n(e)}async function pe({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t)return;if("function"==typeof n.load&&await n.load(i),!e.attributes)return;const o=n.objectIdField,a=e.attributes[o];if(null==a)return;const u=[a],s=new Set(await t.getRequiredFields(n.fieldsIndex));null==n.timeInfo?.trackIdField||s.has(n.timeInfo.trackIdField)||await de(t)&&s.add(n.timeInfo.trackIdField);const f=l(e,s),c=f?[]:s.has(o)?[...s]:[...s,o],d=t.returnGeometry||await ce(t);if(f&&!d)return;const p=await fe({layer:n,graphic:e,outFields:c,objectIds:u,returnGeometry:d,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function ye(e=""){return!!e&&e.includes(j)}function me(e){return e?`${j}${e.layerId}/${e.fieldName}`:""}function be({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:o,timeZone:a}){e&&t&&n&&Object.keys(t.attributes).forEach(l=>{const u=me({layerId:n.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=ue({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:o,value:s,graphic:t,timeZone:a})})}function ge({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}){e&&t&&(t.relatedFeatures?.forEach(a=>be({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o})),t.relatedStatsFeatures?.forEach(a=>be({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o})))}const Ie=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},he=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=n.where?n.where:null,o=null!=n.geometry?n.geometry:null;Ie(r)||Ie(i)||"extent"===o?.type||"tile"===n.resultType||(n.cacheHint=!0)},we=({query:e,layer:t,method:n})=>{he({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Fe=({queryPayload:e,layer:t,method:n})=>{he({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Te(e,t,n){return e&&t&&n?"sublayer"===t.type?Ze({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||Ze({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):Ze({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||Ze({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function Ne(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(e=>e.isUtilityLayer(t)):null}function je(e,t){return e?.allTables.find(e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url)}function Ze({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(const o of i){if("map-image"===o.type){const n=Ze({layers:o.sublayers,map:e,relatedLayer:r,relationship:t})||Ze({layers:o.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!B(o))continue;if("sublayer"===r.type){if(o!==r&&o.id===n)return o.isTable?je(e,o):o;continue}const i="scene"===r.type&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if("sublayer"!==o.type){if(o!==r&&o.url===i&&o.layerId===n)return o}else if(o!==r&&o.layer?.url===i&&o.id===n)return o.isTable?je(e,o):o}return null}export{le as applyTextFormattingHTML,ie as createFieldInfoMap,Te as findRelatedLayer,Ne as findUtilityNetwork,Q as fixTokens,se as formatAttributes,re as formatEditInfo,V as formatValueToFieldInfo,oe as getAllFieldInfos,ee as getFieldInfo,v as getFieldInfoLabel,M as getFixedFieldName,k as getFixedFieldNames,L as getSourceLayer,q as graphicCallback,ae as htmlEntities,J as isAssociatedFeatureSupportedLayer,E as isExpressionField,H as isFeatureSupportedLayer,K as isGraphicForRelatableFeatureSupportedLayer,B as isRelatableFeatureSupportedLayer,W as isRelatableLayer,ye as isRelatedField,we as preLayerQueryCallback,Fe as preRequestCallback,fe as querySourceLayer,pe as queryUpdatedFeature,x as shouldOpenInNewTab,z as substituteAttributes,D as substituteFieldsInLinksAndAttributes};
5
+ import has from"../../../core/has.js";import e from"../../../core/Logger.js";import{replace as t}from"../../../core/string.js";import{convertDateFormatToIntlOptions as n,formatDate as r}from"../../../intl/date.js";import{convertNumberFieldFormatToIntlOptions as i,convertNumberFormatToIntlOptions as o,formatNumber as a}from"../../../intl/number.js";import{isRasterPixelValueField as l,featureHasFields as u,isTimeOnlyField as s}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as f,getEffectiveLayerCapabilities as d}from"../../../layers/support/layerUtils.js";import{formatAnyDate as c,isAnyDateField as p}from"../../../smartMapping/support/utils.js";import{loadArcade as y}from"../../../support/loadArcade.js";import{getTimeZoneFormattingOptions as m}from"../../../time/timeZoneUtils.js";const g="esri.widgets.Feature.support.featureUtils",I=()=>e.getLogger(g),b=/href=(""|'')/gi,h=/(\{([^{\r\n]+)\})/g,F=/'/g,w=/^\s*expression\//i,T=/(\n)/gi,N=/[\u00A0-\u9999<>&]/gim,A=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,j=/^(?:mailto:|tel:)/,C="relationships/",Z=n("short-date-short-time");function v(e){if(null!=e)return(e.sourceLayer||e.layer)??void 0}async function L({type:e,value:t,event:n}){try{return"function"==typeof t?t(n):await t}catch(r){return void I().error("error",`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t})}}function x(e=""){if(e)return!j.test(e.trim().toLowerCase())}function q(e){return!!e&&w.test(e)}function E(e,t){if(!t||!q(t)||!e)return;const n=t.replace(w,"").toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}function U({fieldInfo:e,isAggregate:t}){return!(!e?.fieldName||q(e.fieldName)||be(e.fieldName)||t)}function M({expressionInfos:e,fieldInfo:t,isAggregate:n,isContentFieldInfos:r,layer:i}){if(!t?.fieldName)return null;const o=E(e,t.fieldName);if(o)return o.title||null;if(f(i)&&U({fieldInfo:t,isAggregate:n})){const e=i.getFieldAlias(t.fieldName);return r?t.label||e||t.fieldName:e||t.fieldName}return t.label||t.fieldName}function k({fieldInfo:e,isContentFieldInfos:t,layer:n}){if(!e?.fieldName)return null;if(f(n)){const r=n?.getFieldConfiguration?.(e.fieldName)?.fieldFormat;return t&&e.fieldFormat||r}return null}function R(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}function $(e){return e.replaceAll(b,"")}function D(e,t){const n=O(t,e);return n?n.name:e}function z(e,t){return e&&e.map(e=>D(e,t))}function O(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function S(e){return`${e}`.trim()}function G({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:o}){return r?Q({formattedAttributes:t,template:B(r,{...t,...i,...e},n),fieldInfoMap:o}):""}function Q({formattedAttributes:e,template:n,fieldInfoMap:r}){return S($(t(t(n,e=>R(e,r)),e)))}function P(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",o=(n?encodeURIComponent(r):r).replaceAll(F,i);t[e]=o}}function _(e,t=!1){const n={...e};return Object.keys(n).forEach(e=>P(e,n,t)),n}function H(e,n,r){const i=(n=S(n))&&!n.startsWith("{");return t(e,_(r,i||!1))}function W(e,t){return e.replaceAll(h,(e,n,r)=>{const i=O(t,r);return i?`{${i.name}}`:n})}function B(e,t,n){const r=W(e,n);return r?r.replaceAll(A,(e,n,r)=>H(e,n||r,t)):r}function J(e,t){const n="number"===t?.fieldFormat?.type||t?.format&&null==t.format.dateFormat&&(null!=t.format.places||null!=t.format.digitSeparator);if("string"==typeof e&&n){const t=Number(e);if(!isNaN(t))return t}return e}function K(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function V(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function X(e){return K(e)&&V(e)}function Y(e){return!(!(e&&"object"==typeof e&&"createQuery"in e&&"getField"in e&&"queryFeatureCount"in e&&"queryFeatures"in e&&"queryObjectIds"in e&&"capabilities"in e&&"fields"in e&&"fieldsIndex"in e&&"type"in e)||"feature"!==e.type&&"subtype-group"!==e.type&&"subtype-sublayer"!==e.type&&"sublayer"!==e.type||!("when"in e))&&("subtype-sublayer"===e.type&&"parent"in e&&e.parent&&"object"==typeof e.parent?"globalIdField"in e.parent:"globalIdField"in e)}function ee(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&X(e.sourceLayer)}function te(e,t){const{fieldInfos:n,fieldName:r,layer:u,isContentFieldInfos:s,preventPlacesFormatting:d,timeZone:p,isAggregate:y}=t,m=ie(n,r),g=O(u,r),I=f(u)&&U({fieldInfo:m,isAggregate:y}),b=I?null:m?.format,h=I?k({fieldInfo:m,layer:u,isContentFieldInfos:s}):null,F="number"===h?.type;if(m&&!l(r)){const t=g?.type,n="date-time"===h?.type,r=m.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||n||r)return c(e,{format:n?void 0:r,fieldFormat:n?h:void 0,fieldType:t,timeZoneOptions:{layerTimeZone:u&&"preferredTimeZone"in u?u.preferredTimeZone:null,viewTimeZone:p,datesInUnknownTimezone:!(!u||!("datesInUnknownTimezone"in u))&&!!u.datesInUnknownTimezone}})}if("string"==typeof e&&l(r)&&b)return ne(e,b);if("string"==typeof(e=J(e,{format:F?void 0:b,fieldFormat:F?h:void 0}))||null==e||null==b&&null==h)return de(e);const w=F?i(h):b?o(b):void 0;return a(e,d?{...w,minimumFractionDigits:0,maximumFractionDigits:20}:w)}function ne(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?re(e,",",", ",t):e.includes(";")?re(e,";","; ",t):e.includes(" ")?re(e," "," ",t):a(Number(e),o(t))}function re(e,t,n,r){return e.trim().split(t).map(e=>a(Number(e),o(r))).join(n)}function ie(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function oe({fieldName:e,graphic:t,layer:n}){if(be(e))return null;if(!n||"function"!=typeof n.getFeatureType)return null;const{typeIdField:r}=n;if(!r||e!==r)return null;const i=n.getFeatureType(t);return i?i.name:null}function ae({fieldName:e,value:t,graphic:n,layer:r}){if(be(e))return null;if(!r||"function"!=typeof r.getFieldDomain)return null;const i=n&&r.getFieldDomain(e,{feature:n,excludeImpliedDomains:has("esri-widget-legacy-field-domain-calculation")});return i&&"coded-value"===i.type?i.getName(t):null}function le(e,t,n,i){const{creatorField:o,creationDateField:a,editorField:l,editDateField:u}=e;if(!t)return;const s=m(i&&"preferredTimeZone"in i?i.preferredTimeZone:null,!(!i||!("datesInUnknownTimezone"in i))&&!!i.datesInUnknownTimezone,n,Z,"date"),f={...Z,...s},d=t[u];if("number"==typeof d){const e=t[l];return{type:"edit",date:r(d,f),user:e}}const c=t[a];if("number"==typeof c){const e=t[o];return{type:"create",date:r(c,f),user:e}}return null}function ue(e,t){const n=new Map;if(!e)return n;for(const r of e){if(!r.fieldName)continue;const e=D(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function se(e){const t=[];if(!e)return t;const{fieldInfos:n,content:r}=e;return n&&t.push(...n),r&&Array.isArray(r)?(r.forEach(e=>{if("fields"===e.type){const n=e?.fieldInfos;n&&t.push(...n)}}),t):t}function fe(e){return e.replaceAll(N,e=>`&#${e.charCodeAt(0)};`)}function de(e){return"string"==typeof e?e.replaceAll(T,'<br class="esri-text-new-line" />'):e}function ce(e){const{fieldInfoMap:t,fieldInfos:n,fieldName:r,graphic:i,isAggregate:o,isContentFieldInfos:a,layer:l,timeZone:u,value:f}=e;if(null==f)return"";const d=ae({fieldName:r,value:f,graphic:i,layer:l});if(d)return d;const y=oe({fieldName:r,graphic:i,layer:l});if(y)return y;if(t.get(r.toLowerCase()))return te(f,{fieldInfos:n||Array.from(t.values()),fieldName:r,isAggregate:o,isContentFieldInfos:a,layer:l,timeZone:u});const m=l?.fieldsIndex?.get(r);return m&&(p(m)||s(m))?c(f,{fieldType:m.type,timeZoneOptions:{layerTimeZone:l&&"preferredTimeZone"in l?l.preferredTimeZone:null,viewTimeZone:u,datesInUnknownTimezone:!(!l||!("datesInUnknownTimezone"in l))&&!!l.datesInUnknownTimezone}}):de(f)}function pe({attributes:e,fieldInfoMap:t,fieldInfos:n,graphic:r,isAggregate:i,isContentFieldInfos:o,layer:a,relatedInfos:l,timeZone:u}){const s={};return l?.forEach(e=>we({attributes:s,relatedInfo:e,fieldInfoMap:t,fieldInfos:n,layer:a,timeZone:u})),e&&Object.keys(e).forEach(l=>{const f=e[l];s[l]=ce({fieldInfoMap:t,fieldInfos:n,fieldName:l,graphic:r,isAggregate:i,isContentFieldInfos:o,layer:a,timeZone:u,value:f})}),s}async function ye(e,t){const{layer:n,graphic:r,outFields:i,objectIds:o,returnGeometry:a,spatialReference:l}=e,u=o[0];if("number"!=typeof u&&"string"!=typeof u){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:n,graphic:r,objectId:u,requiredFields:i};return I().warn(e,t),null}if(!d(n)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:n,graphic:r,requiredFields:i,returnGeometry:a};return I().warn(e,t),null}const s=n.createQuery();s.objectIds=o,s.outFields=i?.length?i:[n.objectIdField],s.returnGeometry=!!a,s.returnZ=!!a,s.returnM=!!a,s.outSpatialReference=l;return(await n.queryFeatures(s,t)).features[0]}async function me(e){if(!e.expressionInfos?.length)return!1;const t=await y(),{arcadeUtils:{hasGeometryFunctions:n}}=t;return n(e)}async function ge(e){if(!e.expressionInfos?.length)return!1;const t=await y(),{arcadeUtils:{requiresTrack:n}}=t;return n(e)}async function Ie({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t)return;if("function"==typeof n.load&&await n.load(i),!e.attributes)return;const o=n.objectIdField,a=e.attributes[o];if(null==a)return;const l=[a],s=new Set(await t.getRequiredFields(n.fieldsIndex));null==n.timeInfo?.trackIdField||s.has(n.timeInfo.trackIdField)||await ge(t)&&s.add(n.timeInfo.trackIdField);const f=u(e,s),d=f?[]:s.has(o)?[...s]:[...s,o],c=t.returnGeometry||await me(t);if(f&&!c)return;const p=await ye({layer:n,graphic:e,outFields:d,objectIds:l,returnGeometry:c,spatialReference:r},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function be(e=""){return!!e&&e.includes(C)}function he(e){return e?`${C}${e.layerId}/${e.fieldName}`:""}function Fe({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:o,timeZone:a}){e&&t&&n&&Object.keys(t.attributes).forEach(l=>{const u=he({layerId:n.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=ce({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:o,value:s,graphic:t,timeZone:a})})}function we({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}){e&&t&&(t.relatedFeatures?.forEach(a=>Fe({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o})),t.relatedStatsFeatures?.forEach(a=>Fe({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o})))}const Te=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},Ne=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=n.where?n.where:null,o=null!=n.geometry?n.geometry:null;Te(r)||Te(i)||"extent"===o?.type||"tile"===n.resultType||(n.cacheHint=!0)},Ae=({query:e,layer:t,method:n})=>{Ne({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},je=({queryPayload:e,layer:t,method:n})=>{Ne({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Ce(e,t,n){return e&&t&&n?"sublayer"===t.type?Le({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||Le({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):Le({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||Le({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function Ze(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(e=>e.isUtilityLayer(t)):null}function ve(e,t){return e?.allTables.find(e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url)}function Le({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(const o of i){if("map-image"===o.type){const n=Le({layers:o.sublayers,map:e,relatedLayer:r,relationship:t})||Le({layers:o.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!X(o))continue;if("sublayer"===r.type){if(o!==r&&o.id===n)return o.isTable?ve(e,o):o;continue}const i="scene"===r.type&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if("sublayer"!==o.type){if(o!==r&&o.url===i&&o.layerId===n)return o}else if(o!==r&&o.layer?.url===i&&o.id===n)return o.isTable?ve(e,o):o}return null}export{de as applyTextFormattingHTML,ue as createFieldInfoMap,Ce as findRelatedLayer,Ze as findUtilityNetwork,W as fixTokens,pe as formatAttributes,le as formatEditInfo,te as formatValueToFieldInfo,se as getAllFieldInfos,k as getFieldFormat,ie as getFieldInfo,M as getFieldInfoLabel,D as getFixedFieldName,z as getFixedFieldNames,v as getSourceLayer,L as graphicCallback,fe as htmlEntities,Y as isAssociatedFeatureSupportedLayer,q as isExpressionField,K as isFeatureSupportedLayer,ee as isGraphicForRelatableFeatureSupportedLayer,X as isRelatableFeatureSupportedLayer,V as isRelatableLayer,be as isRelatedField,U as isSupportedContext,Ae as preLayerQueryCallback,je as preRequestCallback,ye as querySourceLayer,Ie as queryUpdatedFeature,x as shouldOpenInNewTab,Q as substituteAttributes,G as substituteFieldsInLinksAndAttributes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r],view:this.view})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};
5
+ import{__decorate as e}from"tslib";import"../intl.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Feature/FeatureAttachments.js";import d from"./Feature/FeatureContent.js";import a from"./Feature/FeatureExpression.js";import c from"./Feature/FeatureFields.js";import p from"./Feature/FeatureMedia.js";import u from"./Feature/FeatureRelationship.js";import m from"./Feature/FeatureUtilityNetworkAssociations.js";import h from"./Feature/FeatureViewModel.js";import{css as y}from"./Feature/resources.js";import{FeatureContentMixin as v}from"./Feature/support/FeatureContentMixin.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{tsx as M}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";import{substitute as E}from"../intl/substitute.js";const b={title:!0,content:!0,lastEditedInfo:!0};let F=class extends(v(r)){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...b},this.viewModel=new h}initialize(){this.addHandles(t(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),s))}loadDependencies(){return w({notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader")})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get isTable(){return this.viewModel.isFeatureFromTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...b,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=M("div",{class:y.container,key:"container"},this._renderTitle(),"error"===e?this._renderError():"loading"===e?this._renderLoading():this._renderContentContainer());return M("div",{class:this.classes(y.base,g.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:s}=this;return M("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},s.title?M("div",{key:"error-title",slot:"title"},e.errorMessage):null,M("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return M("div",{class:y.loadingSpinnerContainer,key:"loading-container"},M("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?M("div",{class:y.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?M(f,{class:y.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?M("div",{class:y.contentNode,key:`${t}-content-elements`},e.map(this._renderContentElement,this)):null;if("string"==typeof e){const e=this._contentWidgets[0];return!e||e.destroyed?null:M("div",{class:this.classes(y.contentNode,y.contentNodeText),key:`${t}-content`},e.render())}return this.renderNodeContent(e)}_renderContentElement(e,t){const{visibleElements:s}=this;if("boolean"!=typeof s.content&&!s.content?.[e.type])return null;switch(e.type){case"attachments":return this._renderAttachments(t);case"custom":return this._renderCustom(e,t);case"fields":return this._renderFields(t);case"media":return this._renderMedia(t);case"text":return this._renderText(e,t);case"expression":return this._renderExpression(t);case"relationship":return this._renderRelationship(t);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:s,attachmentInfos:i}=t.viewModel;return"loading"===s||i.length>0?M("div",{class:this.classes(y.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?M("div",{class:y.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?M("div",{class:y.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:s}=e,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:y.contentElement,key:this._buildKey("custom-element",t)},i.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:M("div",{class:y.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:s}=this.viewModel;if(!s||!e.lastEditedInfo)return null;const{date:i,user:n}=s,o="edit"===s.type?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,r=E(o,{date:i,user:n});return M("div",{class:this.classes(y.lastEditedInfo,y.contentElement),key:"edit-info-element"},r)}_renderText(e,t){const s=e.text,i=this._contentWidgets[t];return!i||i.destroyed?null:s?M("div",{class:this.classes(y.contentElement,y.text),key:this._buildKey("text-element",t)},i.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:s,viewModel:i}=this,n=i?.content,{contentViewModels:o}=i;if(Array.isArray(n))n.forEach((n,r)=>{if("attachments"===n.type&&(this._contentWidgets[r]=new l({displayType:n.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:o[r]})),"fields"===n.type&&(this._contentWidgets[r]=new c({viewModel:o[r]})),"media"===n.type&&(this._contentWidgets[r]=new p({viewModel:o[r]})),"text"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"custom"===n.type&&(this._contentWidgets[r]=new d({viewModel:o[r]})),"expression"===n.type&&(this._contentWidgets[r]=new a({viewModel:o[r]})),"relationship"===n.type){const e=new u({flowItems:s,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=e}if("utility-network-associations"===n.type){const e=async e=>{const{viewModel:n,listType:o,title:r}=e;if(!s)return;n.activeAssociationType=o;const{default:l}=await import("./Feature/FeatureUtilityNetworkAssociationList.js"),d=new l({viewModel:n,parentFeatureViewModel:i,listType:o,title:r,featureVisibleElements:t,description:i.title,flowItems:s});s.push(d)},n=new m({flowItems:s,onSelectAssociationType:e,parentFeatureViewModel:i,featureVisibleElements:t,viewModel:o[r]});this._contentWidgets[r]=n}},this);else{const e=o[0];e&&!e.destroyed&&(this._contentWidgets[0]=new d({viewModel:e}))}this.scheduleRender()}};e([i()],F.prototype,"flowType",void 0),e([i()],F.prototype,"graphic",null),e([i()],F.prototype,"defaultPopupTemplateEnabled",null),e([i()],F.prototype,"flowItems",void 0),e([i()],F.prototype,"headingLevel",void 0),e([i({readOnly:!0})],F.prototype,"isTable",null),e([i()],F.prototype,"icon",null),e([i()],F.prototype,"label",null),e([i()],F.prototype,"location",null),e([i(),_("esri/widgets/Feature/t9n/Feature")],F.prototype,"messages",void 0),e([i(),_("esri/t9n/common")],F.prototype,"messagesCommon",void 0),e([i()],F.prototype,"spatialReference",null),e([i()],F.prototype,"timeZone",null),e([i({readOnly:!0})],F.prototype,"title",null),e([i()],F.prototype,"visibleElements",void 0),e([n("visibleElements")],F.prototype,"castVisibleElements",null),e([i()],F.prototype,"map",null),e([i()],F.prototype,"view",null),e([i({type:h})],F.prototype,"viewModel",void 0),F=e([o("esri.widgets.Feature")],F);export{F as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{EventedAccessor as o}from"../../../core/Evented.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isGroupColumn as r}from"../support/columnUtils.js";import{uniqueColumnNames as s,isPageIndexValid as u}from"../support/tableUtils.js";let d=class extends o{constructor(t){super(t),this.actionColumnConfig=null,this.cellPartNameGenerator=(t,e)=>{let i="";e?.item&&this.rowHighlightIds.includes(e.item.objectId)&&(i+=" highlight");const o=this.findColumn(t?.path);return o?(o.invalid&&(i+=" invalid"),o.textWrap&&(i+=" text-wrap"),"editInfo"in o&&o.editInfo&&o.editInfo.rowData?.index===e.index&&(i+=" editing"),i):i},this.columnPerformanceModeEnabled=!0,this.columnReorderingEnabled=!0,this.columns=new e,this.dataProvider=async(t,e)=>{const{store:i}=this;if(!e)return;if(!i)return void(e&&e([]));e(await i.fetchItems(t))},this.editingEnabled=!1,this.maxSize=null,this.multipleSelectionEnabled=!0,this.multiSortEnabled=!1,this.multipleSortPriority="prepend",this.noDataMessage=null,this.paginationEnabled=!1,this.rowDetailsRenderer=null,this.store=null}get actionColumn(){return this.allColumns.find(t=>t.fieldName===s.action)}get allColumns(){return this.columns.toArray().flatMap(t=>[t,...r(t)&&t.columns?.length?t.columns:[]])}get allVisibleColumns(){return this.allColumns.filter(t=>!t.hidden)}get columnMenuIsOpen(){return this.allColumns.some(t=>t.menuIsOpen)}get editableColumns(){return this.allColumns.filter(t=>"editable"in t)}get effectiveSize(){const{filterBySelectionEnabled:t,highlightIds:e,objectIds:i,pageSize:o,size:n}=this;if(this.paginationEnabled){const l=this.pageCount===this.pageIndex+1?n%o:o;return t?Math.min(e.length,l):i.length?Math.min(i.length,l):l}return t?e.length:i.length?i.length:n}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(t){this._set("filterBySelectionEnabled",t)}get groupColumns(){return this.columns.toArray().filter(t=>r(t))}get hasInvalidColumnConfiguration(){return this.visibleColumns.every(t=>t.frozen||t.frozenToEnd)}get highlightIds(){return this._get("highlightIds")||new e}set highlightIds(t){const o=Array.isArray(t)?new e(t):t;this.multipleSelectionEnabled||o.splice(1,o.length-1),this._set("highlightIds",i(o,this._get("highlightIds"),e))}get isEditing(){return this.editableColumns.some(t=>t.editInfo)}get isQuerying(){return this.store?.isQuerying??!1}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing}get isSyncing(){return this.store?.isSyncing??!1}get objectIds(){return this._get("objectIds")??new e}set objectIds(t){this._set("objectIds",i(t,this._get("objectIds"),e))}get pageCount(){const{pageSize:t,size:e}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(t){const{pageCount:e}=this;u(t,e)&&this._set("pageIndex",t)}get pageSize(){return this._get("pageSize")??50}set pageSize(t){this.store?.set("pageSize",t),this._set("pageSize",t)}get rowHighlightIds(){return this._get("rowHighlightIds")||new e}set rowHighlightIds(t){this._set("rowHighlightIds",i(t,this._get("rowHighlightIds"),e))}get size(){const t=this.store?.count??0,{maxSize:e}=this;return null!=t&&null!=e?Math.min(e,t):t}get state(){return this.store?.state??"disabled"}get visibleColumns(){return this.columns.toArray().filter(t=>!t.hidden)}closeColumnMenus(){this.allColumns.forEach(t=>t.closeMenu())}sortColumn(t,e){if(!t)return;const i=this.findColumn(t);i&&(i.direction=e)}hideColumn(t){const e=this.findColumn(t);!1===e?.hidden&&(e.hidden=!0)}showColumn(t){const e=this.findColumn(t);e?.hidden&&(e.hidden=!1)}showAllColumns(){this.allColumns.forEach(t=>{t.hidden&&(t.hidden=!1)})}findColumn(t){return this.allColumns.find(e=>e.fieldName===t)}refresh(){this.store?.reset(),this.store?.load()}toggleColumnVisibility(t){const e=this.findColumn(t);e&&(e.hidden=!e.hidden)}};t([n()],d.prototype,"actionColumn",null),t([n()],d.prototype,"actionColumnConfig",void 0),t([n()],d.prototype,"allColumns",null),t([n()],d.prototype,"allVisibleColumns",null),t([n()],d.prototype,"cellPartNameGenerator",void 0),t([n()],d.prototype,"columnMenuIsOpen",null),t([n()],d.prototype,"columnPerformanceModeEnabled",void 0),t([n()],d.prototype,"columnReorderingEnabled",void 0),t([n()],d.prototype,"columns",void 0),t([n()],d.prototype,"dataProvider",void 0),t([n()],d.prototype,"editingEnabled",void 0),t([n()],d.prototype,"editableColumns",null),t([n()],d.prototype,"effectiveSize",null),t([n()],d.prototype,"filterBySelectionEnabled",null),t([n()],d.prototype,"groupColumns",null),t([n()],d.prototype,"hasInvalidColumnConfiguration",null),t([n()],d.prototype,"highlightIds",null),t([n()],d.prototype,"isEditing",null),t([n()],d.prototype,"isQuerying",null),t([n()],d.prototype,"isQueryingOrSyncing",null),t([n()],d.prototype,"isSyncing",null),t([n()],d.prototype,"maxSize",void 0),t([n()],d.prototype,"multipleSelectionEnabled",void 0),t([n()],d.prototype,"multiSortEnabled",void 0),t([n()],d.prototype,"multipleSortPriority",void 0),t([n()],d.prototype,"noDataMessage",void 0),t([n()],d.prototype,"objectIds",null),t([n()],d.prototype,"pageCount",null),t([n()],d.prototype,"pageIndex",null),t([n()],d.prototype,"pageSize",null),t([n()],d.prototype,"paginationEnabled",void 0),t([n()],d.prototype,"rowHighlightIds",null),t([n()],d.prototype,"rowDetailsRenderer",void 0),t([n({readOnly:!0})],d.prototype,"size",null),t([n()],d.prototype,"store",void 0),t([n({readOnly:!0})],d.prototype,"state",null),t([n()],d.prototype,"visibleColumns",null),d=t([l("esri.widgets.FeatureTable.Grid.GridViewModel")],d);const a=d;export{a as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{EventedAccessor as o}from"../../../core/Evented.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isGroupColumn as r}from"../support/columnUtils.js";import{uniqueColumnNames as s,isPageIndexValid as u}from"../support/tableUtils.js";let d=class extends o{constructor(t){super(t),this.actionColumnConfig=null,this.cellPartNameGenerator=(t,e)=>{let i="";e?.item&&this.rowHighlightIds.includes(e.item.objectId)&&(i+=" highlight");const o=this.findColumn(t?.path);return o?(o.invalid&&(i+=" invalid"),o.textWrap&&(i+=" text-wrap"),"editInfo"in o&&o.editInfo&&o.editInfo.rowData?.index===e.index&&(i+=" editing"),i):i},this.columnPerformanceModeEnabled=!0,this.columnReorderingEnabled=!0,this.columns=new e,this.dataProvider=async(t,e)=>{const{store:i}=this;if(!e)return;if(!i)return void(e&&e([]));e(await i.fetchItems(t))},this.editingEnabled=!1,this.maxSize=null,this.multipleSelectionEnabled=!0,this.multiSortEnabled=!1,this.multipleSortPriority="prepend",this.noDataMessage=null,this.paginationEnabled=!1,this.rowDetailsRenderer=null,this.store=null}get actionColumn(){return this.allColumns.find(t=>t.fieldName===s.action)}get allColumns(){return this.columns.toArray().flatMap(t=>[t,...r(t)&&t.columns?.length?t.columns:[]])}get allVisibleColumns(){return this.allColumns.filter(t=>!t.hidden)}get columnMenuIsOpen(){return this.allColumns.some(t=>t.menuIsOpen)}get editableColumns(){return this.allColumns.filter(t=>"editable"in t)}get effectiveSize(){const{filterBySelectionEnabled:t,highlightIds:e,objectIds:i,pageSize:o,size:n}=this;if(0===n)return 0;if(this.paginationEnabled){const l=this.pageCount===this.pageIndex+1&&n%o||o;return t?Math.min(e.length,l):i.length?Math.min(i.length,l):l}return t?e.length:i.length?i.length:n}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(t){this._set("filterBySelectionEnabled",t)}get groupColumns(){return this.columns.toArray().filter(t=>r(t))}get hasInvalidColumnConfiguration(){return this.visibleColumns.every(t=>t.frozen||t.frozenToEnd)}get highlightIds(){return this._get("highlightIds")||new e}set highlightIds(t){const o=Array.isArray(t)?new e(t):t;this.multipleSelectionEnabled||o.splice(1,o.length-1),this._set("highlightIds",i(o,this._get("highlightIds"),e))}get isEditing(){return this.editableColumns.some(t=>t.editInfo)}get isQuerying(){return this.store?.isQuerying??!1}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing}get isSyncing(){return this.store?.isSyncing??!1}get objectIds(){return this._get("objectIds")??new e}set objectIds(t){this._set("objectIds",i(t,this._get("objectIds"),e))}get pageCount(){const{pageSize:t,size:e}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(t){const{pageCount:e}=this;u(t,e)&&this._set("pageIndex",t)}get pageSize(){return this._get("pageSize")??50}set pageSize(t){this.store?.set("pageSize",t),this._set("pageSize",t)}get rowHighlightIds(){return this._get("rowHighlightIds")||new e}set rowHighlightIds(t){this._set("rowHighlightIds",i(t,this._get("rowHighlightIds"),e))}get size(){const t=this.store?.count??0,{maxSize:e}=this;return null!=t&&null!=e?Math.min(e,t):t}get state(){return this.store?.state??"disabled"}get visibleColumns(){return this.columns.toArray().filter(t=>!t.hidden)}closeColumnMenus(){this.allColumns.forEach(t=>t.closeMenu())}sortColumn(t,e){if(!t)return;const i=this.findColumn(t);i&&(i.direction=e)}hideColumn(t){const e=this.findColumn(t);!1===e?.hidden&&(e.hidden=!0)}showColumn(t){const e=this.findColumn(t);e?.hidden&&(e.hidden=!1)}showAllColumns(){this.allColumns.forEach(t=>{t.hidden&&(t.hidden=!1)})}findColumn(t){return this.allColumns.find(e=>e.fieldName===t)}refresh(){this.store?.reset(),this.store?.load()}toggleColumnVisibility(t){const e=this.findColumn(t);e&&(e.hidden=!e.hidden)}};t([n()],d.prototype,"actionColumn",null),t([n()],d.prototype,"actionColumnConfig",void 0),t([n()],d.prototype,"allColumns",null),t([n()],d.prototype,"allVisibleColumns",null),t([n()],d.prototype,"cellPartNameGenerator",void 0),t([n()],d.prototype,"columnMenuIsOpen",null),t([n()],d.prototype,"columnPerformanceModeEnabled",void 0),t([n()],d.prototype,"columnReorderingEnabled",void 0),t([n()],d.prototype,"columns",void 0),t([n()],d.prototype,"dataProvider",void 0),t([n()],d.prototype,"editingEnabled",void 0),t([n()],d.prototype,"editableColumns",null),t([n()],d.prototype,"effectiveSize",null),t([n()],d.prototype,"filterBySelectionEnabled",null),t([n()],d.prototype,"groupColumns",null),t([n()],d.prototype,"hasInvalidColumnConfiguration",null),t([n()],d.prototype,"highlightIds",null),t([n()],d.prototype,"isEditing",null),t([n()],d.prototype,"isQuerying",null),t([n()],d.prototype,"isQueryingOrSyncing",null),t([n()],d.prototype,"isSyncing",null),t([n()],d.prototype,"maxSize",void 0),t([n()],d.prototype,"multipleSelectionEnabled",void 0),t([n()],d.prototype,"multiSortEnabled",void 0),t([n()],d.prototype,"multipleSortPriority",void 0),t([n()],d.prototype,"noDataMessage",void 0),t([n()],d.prototype,"objectIds",null),t([n()],d.prototype,"pageCount",null),t([n()],d.prototype,"pageIndex",null),t([n()],d.prototype,"pageSize",null),t([n()],d.prototype,"paginationEnabled",void 0),t([n()],d.prototype,"rowHighlightIds",null),t([n()],d.prototype,"rowDetailsRenderer",void 0),t([n({readOnly:!0})],d.prototype,"size",null),t([n()],d.prototype,"store",void 0),t([n({readOnly:!0})],d.prototype,"state",null),t([n()],d.prototype,"visibleColumns",null),d=t([l("esri.widgets.FeatureTable.Grid.GridViewModel")],d);const a=d;export{a as default};