@arcgis/core 4.33.0-next.20250210 → 4.33.0-next.20250212

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 (562) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/ArcadeModuleResolver.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/support/FeatureSet.js +1 -1
  9. package/arcade/featureset/support/Guid.js +1 -1
  10. package/arcade/featureset/support/cache.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 1249fd2f83caeaefd8ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
  22. package/assets/esri/core/workers/chunks/{946a9890f3621d1dfbc5.js → 144e534d4ac1aafab60d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → 17213c3fc63f580e5b73.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
  28. package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
  29. package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
  30. package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
  31. package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
  33. package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
  36. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
  37. package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 37cfd102b6ab5b959f9d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
  41. package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +314 -0
  43. package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 3ebdd0701e77bb28c75d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
  49. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
  50. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
  52. package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
  53. package/assets/esri/core/workers/chunks/52f61e1f5972a72b6b54.js +1 -0
  54. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +1 -1
  60. package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → 6518954889df2e781c47.js} +2 -2
  65. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
  66. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
  67. package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 6fa1f1e431aae1794ce3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
  69. package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
  70. package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
  74. package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
  75. package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
  76. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
  77. package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
  78. package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
  79. package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
  80. package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
  81. package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
  82. package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
  83. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
  84. package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
  86. package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
  89. package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
  93. package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
  95. package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
  97. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
  99. package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → b83151b03bbeba466f82.js} +2 -2
  102. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
  103. package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → c061cad8323f0469e7e4.js} +1 -1
  105. package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
  106. package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
  107. package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
  108. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
  109. package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
  110. package/assets/esri/core/workers/chunks/cc8eb975a543556f88ae.js +1 -0
  111. package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
  112. package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
  113. package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
  114. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
  115. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
  116. package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d7b260d6187f29e0c136.js} +1 -1
  119. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
  120. package/assets/esri/core/workers/chunks/de87009542886fad9a2f.js +2 -0
  121. package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
  122. package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
  123. package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
  124. package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
  125. package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +1 -0
  126. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
  127. package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
  128. package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
  129. package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.js +1 -0
  132. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → f0d28fe4deb7cd894765.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
  136. package/assets/esri/core/workers/chunks/{140d0c4285c6978103ea.js → f5ce6af342c02a4b0d15.js} +7 -7
  137. package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
  138. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  139. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  140. package/assets/esri/themes/base/_core.scss +4 -0
  141. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
  142. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
  143. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
  144. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
  145. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
  146. package/assets/esri/themes/dark/main.css +1 -1
  147. package/assets/esri/themes/light/main.css +1 -1
  148. package/assets/esri/themes/light/view.css +1 -1
  149. package/chunks/Bufferer-B-V7yYm-.js +5 -0
  150. package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
  151. package/chunks/Envelope.js +1 -1
  152. package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
  153. package/chunks/Geometry.js +1 -1
  154. package/chunks/OperatorClip.js +1 -1
  155. package/chunks/OperatorCut.js +1 -1
  156. package/chunks/OperatorGeneralize.js +1 -1
  157. package/chunks/OperatorGeodesicBuffer.js +1 -1
  158. package/chunks/OperatorGeodeticArea.js +1 -1
  159. package/chunks/OperatorGeodeticDistance.js +1 -1
  160. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  161. package/chunks/OperatorProximity.js +1 -1
  162. package/chunks/OperatorProximityGeodesic.js +1 -1
  163. package/chunks/OperatorShapePreservingLength.js +1 -1
  164. package/chunks/OperatorShapePreservingProject.js +1 -1
  165. package/chunks/Point2D.js +1 -1
  166. package/chunks/ProjectionTransformation.js +1 -1
  167. package/chunks/QuadraticBezier.js +1 -1
  168. package/chunks/ShadowHighlight.glsl.js +2 -4
  169. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  170. package/chunks/disjointOperator.js +1 -1
  171. package/chunks/distanceOperator.js +1 -1
  172. package/chunks/lyr3DWorker.js +1 -1
  173. package/core/Accessor.js +1 -1
  174. package/core/Collection.js +1 -1
  175. package/core/Logger.js +1 -1
  176. package/core/ObjectPool.js +1 -1
  177. package/core/RandomLCG.js +1 -1
  178. package/core/XHRAdapter.js +1 -1
  179. package/core/accessorSupport/watch.js +1 -1
  180. package/core/pbf.js +1 -1
  181. package/core/sql/UnknownTimeZone.js +1 -1
  182. package/core/sql.js +1 -1
  183. package/core/workers/RemoteClient.js +1 -1
  184. package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
  185. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  186. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  187. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  189. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  190. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  191. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  192. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  193. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  194. package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
  195. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
  196. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
  197. package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
  198. package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
  199. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  200. package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
  201. package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
  202. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  203. package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
  204. package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
  205. package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
  206. package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
  207. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  208. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  209. package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
  210. package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
  211. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  212. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  213. package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
  214. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  215. package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
  216. package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
  217. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  218. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  219. package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
  220. package/editing/templateUtils.js +1 -1
  221. package/geometry/SpatialReference.js +1 -1
  222. package/geometry/operators/extendOperator.js +1 -1
  223. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  224. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  225. package/geometry/operators/gx/operatorBuffer.js +1 -1
  226. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  227. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  228. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  229. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  230. package/geometry/operators/gx/operatorOffset.js +1 -1
  231. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  232. package/geometry/operators/gx/operatorSimplify.js +1 -1
  233. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  234. package/geometry/operators/gx/operatorUnion.js +1 -1
  235. package/geometry/operators/isNearOperator.js +1 -1
  236. package/geometry/operators/json/disjointOperator.js +1 -1
  237. package/geometry/operators/projectOperator.js +1 -1
  238. package/geometry/operators/reshapeOperator.js +1 -1
  239. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  240. package/geometry/operators/support/apiConverter.js +1 -1
  241. package/geometry/operators/support/initNoPeFactory.js +1 -1
  242. package/geometry/operators/support/jsonConverter.js +1 -1
  243. package/geometry/support/DoubleArray.js +1 -1
  244. package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
  245. package/geometry/support/MeshTexture.js +1 -1
  246. package/geometry/support/MeshTransform.js +1 -1
  247. package/geometry/support/UCharArray.js +5 -0
  248. package/geometry/support/UShortArray.js +5 -0
  249. package/geometry/support/buffer/BufferPool.js +1 -1
  250. package/geometry/support/buffer/BufferView.js +1 -1
  251. package/geometry/support/buffer/internals/Mat3.js +1 -1
  252. package/geometry/support/buffer/internals/Mat4.js +1 -1
  253. package/geometry/support/buffer/internals/Scalar.js +1 -1
  254. package/geometry/support/buffer/internals/Vec2.js +1 -1
  255. package/geometry/support/buffer/internals/Vec3.js +1 -1
  256. package/geometry/support/buffer/internals/Vec4.js +1 -1
  257. package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
  258. package/identity/OAuthInfo.js +1 -1
  259. package/interfaces.d.ts +124 -68
  260. package/layers/VectorTileLayer.js +1 -1
  261. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  262. package/layers/mixins/EditBusLayer.js +1 -1
  263. package/layers/mixins/PublishableLayer.js +1 -1
  264. package/layers/mixins/operationalLayers.js +1 -1
  265. package/layers/save/featureLayerUtils.js +1 -1
  266. package/layers/save/utils.js +1 -1
  267. package/layers/support/AggregateField.js +1 -1
  268. package/layers/support/CodedValueDomain.js +1 -1
  269. package/layers/support/Field.js +1 -1
  270. package/layers/support/ImageElement.js +1 -1
  271. package/layers/support/InheritedDomain.js +1 -1
  272. package/layers/support/LOD.js +1 -1
  273. package/layers/support/LabelClass.js +1 -1
  274. package/layers/support/LabelExpressionInfo.js +1 -1
  275. package/layers/support/OrderByInfo.js +1 -1
  276. package/layers/support/PurgeOptions.js +1 -1
  277. package/layers/support/RangeDomain.js +1 -1
  278. package/layers/support/Sublayer.js +1 -1
  279. package/layers/support/SubtypeSublayer.js +1 -1
  280. package/layers/support/TileInfo.js +1 -1
  281. package/layers/support/TilemapCache.js +1 -1
  282. package/layers/support/VideoElement.js +1 -1
  283. package/layers/support/commonProperties.js +1 -1
  284. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  285. package/layers/support/source/DataLayerSource.js +1 -1
  286. package/layers/support/wmsUtils.js +1 -1
  287. package/networks/Network.js +1 -1
  288. package/networks/RulesTable.js +1 -1
  289. package/networks/UtilityNetwork.js +1 -1
  290. package/networks/support/typeUtils.js +1 -1
  291. package/package.json +3 -3
  292. package/portal/Portal.js +1 -1
  293. package/renderers/support/RasterSymbolizer.js +1 -1
  294. package/rest/print.js +1 -1
  295. package/rest/support/AttachmentQuery.js +1 -1
  296. package/rest/support/ClosestFacilityParameters.js +1 -1
  297. package/rest/support/DirectionLine.js +1 -1
  298. package/rest/support/DirectionPoint.js +1 -1
  299. package/rest/support/JobInfo.js +1 -1
  300. package/rest/support/NetworkFeatureSet.js +1 -1
  301. package/rest/support/PointBarrier.js +1 -1
  302. package/rest/support/PolygonBarrier.js +1 -1
  303. package/rest/support/PolylineBarrier.js +1 -1
  304. package/rest/support/Query.js +1 -1
  305. package/rest/support/RelationshipQuery.js +1 -1
  306. package/rest/support/RouteInfo.js +1 -1
  307. package/rest/support/RouteParameters.js +1 -1
  308. package/rest/support/ServiceAreaParameters.js +1 -1
  309. package/rest/support/Stop.js +1 -1
  310. package/rest/support/TopFeaturesQuery.js +1 -1
  311. package/support/revision.js +1 -1
  312. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  313. package/symbols/FillSymbol3DLayer.js +1 -1
  314. package/symbols/IconSymbol3DLayer.js +1 -1
  315. package/symbols/LineSymbol3DLayer.js +1 -1
  316. package/symbols/ObjectSymbol3DLayer.js +1 -1
  317. package/symbols/PathSymbol3DLayer.js +1 -1
  318. package/symbols/TextSymbol3DLayer.js +1 -1
  319. package/symbols/WaterSymbol3DLayer.js +1 -1
  320. package/symbols/cim/OverrideHelper.js +1 -1
  321. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  322. package/symbols/cim/effects/EffectArrow.js +1 -1
  323. package/symbols/cim/effects/EffectBuffer.js +1 -1
  324. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  325. package/symbols/cim/effects/EffectCut.js +1 -1
  326. package/symbols/cim/effects/EffectDashes.js +1 -1
  327. package/symbols/cim/effects/EffectDonut.js +1 -1
  328. package/symbols/cim/effects/EffectJog.js +1 -1
  329. package/symbols/cim/effects/EffectMove.js +1 -1
  330. package/symbols/cim/effects/EffectOffset.js +1 -1
  331. package/symbols/cim/effects/EffectReverse.js +1 -1
  332. package/symbols/cim/effects/EffectRotate.js +1 -1
  333. package/symbols/cim/effects/EffectScale.js +1 -1
  334. package/symbols/cim/effects/EffectWave.js +1 -1
  335. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  336. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  337. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  338. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  339. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  340. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  341. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  342. package/symbols/support/ElevationInfo.js +1 -1
  343. package/time/TimeExtent.js +1 -1
  344. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  345. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  346. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  347. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  348. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  349. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  350. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  351. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  352. package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
  353. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  354. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  355. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  356. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  361. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  362. package/views/2d/layers/LayerView2D.js +1 -1
  363. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  364. package/views/2d/layers/RouteLayerView2D.js +1 -1
  365. package/views/2d/layers/features/FeatureContainer.js +1 -1
  366. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  367. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  368. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  369. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  370. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  371. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  372. package/views/2d/layers/support/HighlightCounter.js +1 -1
  373. package/views/2d/tiling/TileCoverage.js +1 -1
  374. package/views/2d/tiling/TileKey.js +1 -1
  375. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  376. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  377. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  378. package/views/3d/layers/I3SMeshView3D.js +1 -1
  379. package/views/3d/layers/MediaLayerView3D.js +1 -1
  380. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  381. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  382. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  383. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  384. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  385. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  386. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  388. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  389. package/views/3d/layers/graphics/GraphicsCorePerformanceInfo.js +1 -1
  390. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  391. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  392. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  393. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  394. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  395. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  396. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  397. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  398. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  399. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  400. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  401. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  402. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  403. package/views/3d/state/Frustum.js +1 -1
  404. package/views/3d/support/DisplayQualityProfile.js +1 -1
  405. package/views/3d/support/QualitySettings.js +1 -1
  406. package/views/3d/terrain/OverlayManager.js +1 -1
  407. package/views/3d/terrain/TerrainSurface.js +1 -1
  408. package/views/3d/terrain/TextureFader.js +1 -1
  409. package/views/3d/terrain/TilingScheme.js +1 -1
  410. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  411. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  412. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  413. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  414. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  415. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  416. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  417. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  418. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  420. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  421. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  422. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  423. package/views/SceneView.js +1 -1
  424. package/views/View.js +1 -1
  425. package/views/View2D.js +1 -1
  426. package/views/draw/DrawAction.js +1 -1
  427. package/views/draw/drawSurfaces.js +1 -1
  428. package/views/input/BrowserEventSource.js +1 -1
  429. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  430. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  431. package/views/layers/LayerView.js +1 -1
  432. package/views/support/Scheduler.js +1 -1
  433. package/views/support/imageReprojection.js +1 -1
  434. package/views/webgl/FramebufferObject.js +1 -1
  435. package/views/webgl/Parameters.js +1 -1
  436. package/views/webgl/RenderingContext.js +1 -1
  437. package/views/webgl/ShaderBuilder.js +1 -1
  438. package/views/webgl/Texture.js +1 -1
  439. package/webscene/Environment.js +1 -1
  440. package/webscene/SunLighting.js +1 -1
  441. package/webscene/VirtualLighting.js +1 -1
  442. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  443. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  444. package/widgets/AreaMeasurement2D.js +1 -1
  445. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  446. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  447. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  448. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  449. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  450. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  451. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  452. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  453. package/widgets/BatchAttributeForm.js +1 -1
  454. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  455. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  456. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  457. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  458. package/widgets/DistanceMeasurement2D.js +1 -1
  459. package/widgets/Editor/AddAssociationWorkflow.js +5 -0
  460. package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
  461. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  462. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  463. package/widgets/Editor/EditorViewModel.js +1 -1
  464. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  465. package/widgets/Editor/UpdateWorkflow.js +1 -1
  466. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  467. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  468. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  469. package/widgets/Editor/modelUploadUtils.js +1 -1
  470. package/widgets/Editor/workflowUtils.js +1 -1
  471. package/widgets/Editor.js +1 -1
  472. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  473. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  474. package/widgets/Feature/FeatureViewModel.js +1 -1
  475. package/widgets/Feature/support/featureUtils.js +1 -1
  476. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  477. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
  478. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
  479. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  480. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
  481. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  482. package/widgets/FeatureForm.js +1 -1
  483. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  484. package/widgets/LayerList/LayerListItem.js +1 -1
  485. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  486. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  487. package/widgets/OrientedImageryViewer/constants.js +1 -1
  488. package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
  489. package/widgets/OrientedImageryViewer/utils.js +1 -1
  490. package/widgets/OrientedImageryViewer.js +1 -1
  491. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  492. package/widgets/Search/SearchViewModel.js +1 -1
  493. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  494. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  495. package/widgets/Sketch/support/sketchUtils.js +1 -1
  496. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
  497. package/widgets/Widget.js +1 -1
  498. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  499. package/widgets/support/FilterBuilder.js +1 -1
  500. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  501. package/widgets/support/FilterCondition.js +1 -1
  502. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
  503. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  504. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  505. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  506. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  507. package/assets/esri/core/workers/chunks/08c4b585290efc98ca5d.js +0 -1
  508. package/assets/esri/core/workers/chunks/117e7a12af77c761efb5.js +0 -1
  509. package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
  510. package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
  511. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  512. package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
  513. package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
  514. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  515. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
  516. package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
  517. package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
  518. package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
  519. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  520. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  521. package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
  522. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
  523. package/assets/esri/core/workers/chunks/5be7cf1564e756c24066.js +0 -1
  524. package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
  525. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  526. package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
  527. package/assets/esri/core/workers/chunks/6d79ec15d1858839f576.js +0 -1
  528. package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
  529. package/assets/esri/core/workers/chunks/7966c245a073c85f04b1.js +0 -1
  530. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  531. package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
  532. package/assets/esri/core/workers/chunks/8bd51b5b392dfacc922f.js +0 -1
  533. package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
  534. package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
  535. package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
  536. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  537. package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
  538. package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
  539. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
  540. package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
  541. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
  542. package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
  543. package/assets/esri/core/workers/chunks/c249ad935f54d3b49ae3.js +0 -1
  544. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  545. package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
  546. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  547. package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
  548. package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
  549. package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
  550. package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
  551. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  552. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  553. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
  554. package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
  555. package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
  556. package/assets/esri/core/workers/chunks/faf9063420262ea40fd8.js +0 -1
  557. package/chunks/Bufferer-DjC-SKTJ.js +0 -5
  558. package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
  559. package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
  560. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
  561. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
  562. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{substitute as e}from"../../../intl/substitute.js";import{loadFooterActionsComponents as t,FooterActions as o}from"./FooterActions.js";import{loadNoticesComponents as n,Notices as i}from"./Notices.js";import{loadPanelContentComponents as s,PanelContentSection as a,PanelContentSectionGroup as r,PanelContent as l}from"./PanelContent.js";import u from"./PendingFeatureList.js";import{Heading as d,incrementHeadingLevel as p}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as c,tsxFragment as m}from"../../support/jsxFactory.js";const f=()=>Promise.all([t(),n(),s()]);function h({editorViewModel:t,headingLevel:n,messages:s,messagesCommon:f,onDelete:h,onDeleteAssociation:y,onSave:g,renderAttachments:w,renderFeatureForm:b,renderSketchToolbar:k}){const{activeLeafWorkflow:v,activeWorkflow:F,featureFormViewModel:A,syncing:j}=t;if(!v||!F||!A)return null;const S=v.type.includes("update"),C=S&&!v.hasPendingEdits||j||A.updating,L=S?f.update:f.create,P="create-features"===v?.type?v.numPendingFeatures:0,D="create-features"!==v?.type||!!v.data.selectedPendingFeature,T=P>1?e(s.createFeaturesTemplate,{numFeatures:P}):L,H="shouldShowAttachments"in v&&v.shouldShowAttachments&&!A.activeRelationshipInput,x=A.inputs.every((e=>!e.visible))&&!H,B=x?c(a,null,"create-features"===v.type?c(u,{headingLevel:n,key:"pending-feature-list",workflow:v}):void 0):c(a,{key:"panel-content-section"},c(i,{messages:s,workflow:F}),c(r,null,D||"create-features"!==v.type?b():c(u,{headingLevel:n,key:"pending-feature-list",workflow:v}),H?c("div",{key:"attachments"},c(d,{level:p(n)},s.attachments),w()):null)),I={onClick:g,disabled:C,label:T,type:"button"},M={appearance:"outline",onClick:h,disabled:j,kind:"danger",label:f.delete,type:"button"},V={...M,onClick:y,label:s.deleteAssociationTitle,type:"button"},W={...M,primaryLabel:f.delete,primaryText:f.delete,dropdownItems:[{onClick:y,label:s.deleteAssociationTitle}],type:"split-button"};return c(m,null,x?k():void 0,c(l,{key:"attribute-panel-content"},B),c(o,{buttons:[I,t.shouldShowDeleteButton&&!t.featureFormHasAssociation?M:void 0,!t.shouldShowDeleteButton&&t.featureFormHasAssociation?V:void 0,t.shouldShowDeleteButton&&t.featureFormHasAssociation?W:void 0]}))}export{h as UpdateFeaturePanelContent,f as loadUpdateFeaturePanelContentComponents};
5
+ import{substitute as e}from"../../../intl/substitute.js";import{loadFooterActionsComponents as t,FooterActions as o}from"./FooterActions.js";import{loadNoticesComponents as a,Notices as n}from"./Notices.js";import{loadPanelContentComponents as i,PanelContentSection as s,PanelContentSectionGroup as l,PanelContent as r}from"./PanelContent.js";import u from"./PendingFeatureList.js";import{Heading as d,incrementHeadingLevel as c}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{tsx as p,tsxFragment as m}from"../../support/jsxFactory.js";const f=()=>Promise.all([t(),a(),i()]);function g({editorViewModel:t,headingLevel:a,messages:i,messagesCommon:f,onDelete:g,onDeleteAssociation:h,onSave:y,renderAttachments:w,renderFeatureForm:b,renderSketchToolbar:v}){const{activeLeafWorkflow:k,activeWorkflow:F,featureFormViewModel:A,syncing:j}=t;if(!k||!F||!A)return null;const C=k.type.includes("update"),S=C&&!k.hasPendingEdits||j||A.updating,L=C?f.update:f.create,P="create-features"===k?.type?k.numPendingFeatures:0,D="create-features"!==k?.type||!!k.data.selectedPendingFeature,T=P>1?e(i.createFeaturesTemplate,{numFeatures:P}):L,H="shouldShowAttachments"in k&&k.shouldShowAttachments&&!A.activeRelationshipInput,I=A.inputs.every((e=>!e.visible))&&!H,x=I?p(s,null,"create-features"===k.type?p(u,{headingLevel:a,key:"pending-feature-list",workflow:k}):void 0):p(s,{key:"panel-content-section"},p(n,{messages:i,workflow:F}),p(l,null,D||"create-features"!==k.type?b():p(u,{headingLevel:a,key:"pending-feature-list",workflow:k}),H?p("div",{key:"attachments"},p(d,{level:c(a)},i.attachments),w()):null)),B=()=>{const{featureFormViewModel:e}=t;null!=e?.associationId&&(e.associationId=null)},M={appearance:"solid",onClick:y,disabled:S,label:T,type:"button"},V={appearance:"outline",onClick:g,disabled:j,kind:"danger",label:f.delete,type:"button"},W={...V,onClick:h,label:i.deleteAssociationTitle,type:"button"},E={...V,primaryLabel:f.delete,primaryText:f.delete,dropdownItems:[{onClick:h,label:i.deleteAssociationTitle}],type:"split-button"},N={appearance:"outline",onClick:B,disabled:j,label:f.cancel,type:"button"},R="viewing-associated-features"===t.page||"viewing-associated-layers"===t.page?[N]:[M,t.shouldShowDeleteButton&&!t.featureFormHasAssociation?V:void 0,t.shouldShowDeleteButton&&t.featureFormHasAssociation?E:void 0,!t.shouldShowDeleteButton&&t.featureFormHasAssociation?W:void 0];return p(m,null,I?v():void 0,p(r,{key:"attribute-panel-content"},x),p(o,{buttons:R}))}export{g as UpdateFeaturePanelContent,f as loadUpdateFeaturePanelContentComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Graphic.js";import{makeHandle as r,handlesGroup as t}from"../../core/handleUtils.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../core/promiseUtils.js";import{watch as c}from"../../core/reactiveUtils.js";import{getCreationAttributes as n,showProgressCursor as s}from"./workflowUtils.js";async function i({view:i,data:m,signal:u,next:p,cancel:f}){const{creationInfo:y}=m;if(!y)return r();if(!l(y))return r();const{layer:d}=y,g=null!=y.geometryToPlace;if(y.geometryToPlace=null,g)return f(),r();const{Upload:h}=await import("./Upload.js");o(u);const j=new h;m.upload=j;let w=null;const T=()=>w?.remove(),U=t([c((()=>j.state),(r=>{switch(r){case"default":case"error":T();break;case"pending":T(),w=s(i);break;case"success":{y.maxFeatures=1;const{result:r}=j;"georeferenced"===r?.type||"georeferenced-reprojected"===r?.type?(y.geometryToPlace=r.mesh,y.initialFeature=new e({attributes:n(y),geometry:r.mesh,sourceLayer:d}),i.goTo(y.initialFeature,{animate:!1}).catch(a)):y.geometryToPlace=r?.mesh,T(),p();break}}})),r((()=>{j.cancel(),T()}))]);return j.uploadTo(d),U}function l(e){const r=e?.layer;return"scene"===r?.type}export{i as handleModelUpload,l as isModelUpload};
5
+ import e from"../../Graphic.js";import{makeHandle as r,handlesGroup as t}from"../../core/handleUtils.js";import{throwIfAborted as o,ignoreAbortErrors as a}from"../../core/promiseUtils.js";import{watch as c}from"../../core/reactiveUtils.js";import{getCreationAttributes as s,showProgressCursor as n}from"./workflowUtils.js";async function i({view:i,data:m,signal:u,next:p,cancel:f}){const{creationInfo:d}=m;if(!d)return r();if(!l(d))return r();const{layer:y}=d,g=null!=d.geometryToPlace;if(d.geometryToPlace=null,g)return f(),r();const{Upload:h}=await import("./Upload.js");o(u);const j=new h;m.upload=j;let w=null;const T=()=>w?.remove(),U=t([c((()=>j.state),(r=>{switch(r){case"default":case"error":T();break;case"pending":T(),w=n(i);break;case"success":{d.maxFeatures=1;const{result:r}=j;"georeferenced"===r?.type||"georeferenced-reprojected"===r?.type?(d.geometryToPlace=r.mesh,d.initialFeature=new e({attributes:s(m.fullTemplate,d.attributeOverrides),geometry:r.mesh,sourceLayer:y}),i.goTo(d.initialFeature,{animate:!1}).catch(a)):d.geometryToPlace=r?.mesh,T(),p();break}}})),r((()=>{j.cancel(),T()}))]);return j.uploadTo(y),U}function l(e){const r=e?.layer;return"scene"===r?.type}export{i as handleModelUpload,l as isModelUpload};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Graphic.js";import{addMany as t}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{makeHandle as n,handlesGroup as a,abortHandle as o}from"../../core/handleUtils.js";import{clone as l}from"../../core/lang.js";import{whenOrAbort as s,throwIfAborted as c,debounce as u}from"../../core/promiseUtils.js";import{watch as p,whenOnce as y}from"../../core/reactiveUtils.js";import{px2pt as d}from"../../core/screenUtils.js";import{diff as f}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as m,getAllStandardFeatureTemplatesForLayer as g}from"../../editing/templateUtils.js";import{featureHasFields as h,fixFields as b,getDisplayFieldName as w}from"../../layers/support/fieldUtils.js";import{calculateTolerance as v}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as S}from"../../renderers/support/lengthUtils.js";import{getTransformationType as j,TransformationType as I}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as U,getSize as V}from"../../renderers/visualVariables/support/visualVariableUtils.js";import{to3D as T}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as O}from"../../symbols/support/symbolUtils.js";import{GraphicState as z}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as F}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as L}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as x,filterGraphicHits as P}from"../../views/support/hitTestSelectUtils.js";function A(e){return"update"===e.type}function k(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!G(t.renderer))return{rotation:null,size:null};let r=null,i=null;const n=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=U(t,e)));1===n.length&&(r=R(n[0],t));const a=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&j(t)===I.RealWorldSize&&null!=V(t,e)));return 1===a.length&&(i=C(a[0],t)),{rotation:r,size:i}}function R(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,i=e.field,n=t.fields&&t.fields.filter((e=>e.name===i)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0};return{field:i,fieldType:a,getDefault:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,D((o.current+360)%360,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function E(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function M(e,t,r){if(null==t)return 0;const{symbol:i}=T(t);if(null==i||"web-style"===i.type||"cim"===i.type)return 0;const n=i.symbolLayers.at(0);if(!n)return 0;switch(n.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return n.size||Math.min(le.icon,(await e(n,le.icon))[0])||le.icon}case"text":return n.size||le.text;case"line":return n.size||le.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return E(await t(n,e.scale/le.viewScaleSizeFactor),r)}case"path":return(null!=n.width?n.width:n.height)||e.scale/le.viewScaleSizeFactor;case"extrude":return n.size||e.scale/le.viewScaleSizeFactor;default:return 0}}function C(e,t){const r=e.field,i=e.axis,n=t.fields&&t.fields.filter((e=>e.name===r)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0},l=S[e.valueUnit]??1;let s;return s="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:a,getDefault:async(e,t)=>D(s(await M(t,e,i)),a),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,D(o.current,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ue(e.valueUnit),axis:e.axis}}function D(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function G(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function Z(e,t,r){const i=await O(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=f(e.symbol,i)&&(e.symbol=i)}function q(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const i={mode:F,optionsPerTool:r};if(m(t)){switch(t.defaultTool){case"freehand":case"line":case"stream-line":return{tool:"polyline"===e?"freehandPolyline":"freehandPolygon",createOptions:i};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:i};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===e?"polygon":"polyline",createOptions:i};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:i};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:i};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:i};case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:i};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:i};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:i}}}else{const n=t.drawingTool;if("circle"===n||"ellipse"===n)return r.get("circle").preserveAspectRatio="circle"===n,{tool:"circle",createOptions:i};if("rectangle"===n)return{tool:"rectangle",createOptions:i};if("freehand"===n)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:i}}return{tool:e,createOptions:i}}async function Q(e,t,r){const i=r.layer,a=B(r);let o=null;const{view:l}=e,s="2d"===l?.type;if(await W(e,i,a,t,s?l.scale:null),s){const r=u((r=>W(e,i,a,t,r)));o=p((()=>l.scale),(e=>r(e)))}const{data:c,editing:y}=i.capabilities;e.layer.elevationInfo=i.elevationInfo;const d=q(i.geometryType,r.template);return e.defaultCreateOptions={graphicProperties:{attributes:a,sourceLayer:i},mode:d.createOptions.mode,optionsPerTool:d.createOptions.optionsPerTool,preserveAspectRatio:d.createOptions.preserveAspectRatio,hasZ:c.supportsZ,defaultZ:(s?y.zDefault:null)??e.defaultCreateOptions.defaultZ},null==r.geometryToPlace?await e.create(d.tool):await e.place(r.geometryToPlace,{graphicProperties:{attributes:a,sourceLayer:i}}),o??n()}function B(e){const{template:t}=e;if(t&&m(t))throw new i("Shared templates are not yet supported");return{...t?.prototype.attributes,...e.attributeOverrides}}async function W(t,r,i,n,a){const o=new e({sourceLayer:r,attributes:i}),{rotation:l,size:s}=k(o);let c=await O(o,{useSourceLayer:!0,webStyleCache:n,scale:a}),u=!1;for(const e of[s,l]){if(null==e)continue;null==i[e.field]&&(i[e.field]=await e.getDefault(c,t.view),u=!0)}switch(u&&(c=await O(o,{useSourceLayer:!0,webStyleCache:n,scale:a})),c?.type){case"simple-fill":case"polygon-3d":t.polygonSymbol=c;break;case"simple-line":case"line-3d":t.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":t.pointSymbol=c;break;case"mesh-3d":t.meshSymbol=c}H(t.tooltipOptions,s,l)}function H(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function J(e,t){return e?.find((e=>e.layer===t))}async function K(e,t,r,i){switch(t.type){case"3d":return N(e,t,r,i);case"2d":return X(e,t,r,i)}}async function N(e,r,i,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:o}=await i.async((async()=>{const{results:t}=await s(x(r,i),n),a=new Map,o=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};P(t).forEach((({graphic:e})=>o(e).push(e)));const l=e.filter((({capabilities:e,layer:t})=>e.update.enabled&&a.has(t)));return 0!==l.length&&i.stopPropagation(),{updatable:l,graphicsByLayer:a}}));return s(Promise.allSettled(a.map((async({layer:e})=>{const r=o.get(e),i=Y(e);if(r.every((e=>h(i,e))))return r;const a=[];for(const n of r){a.push(n.getObjectId());const e=Object.keys(n.attributes);t(i,e)}const l=e.createQuery();return l.returnGeometry=!1,l.objectIds=a,l.outFields=b(e.fieldsIndex,i),e.queryFeatures(l,{signal:n}).then((({features:e})=>e))}))),n)}async function X(e,t,r,i){if(0===e.length)return[];const{mapPoint:n}=r;if(null==n)return[];let a=null;const o=await r.async((async()=>{const{results:n}=await s(t.hitTest(r),i);if(0===n.length)return[];const o=new Set;a=P(n),a.forEach((({graphic:e})=>e&&o.add(e.layer)));const l=e.filter((e=>o.has(e.layer)&&e.supportsUpdateWorkflow));return l.length>0&&r.stopPropagation(),l}));return s(Promise.allSettled(o.map((async({layer:e})=>{const o=e.createQuery();o.returnGeometry=!1,o.outFields=Y(e);const l="renderer"in e?v({renderer:e.renderer,pointerType:r.pointerType}):0;o.geometry=L(n,l,t),o.outSpatialReference=t.spatialReference;const{features:s}=await e.queryFeatures(o,{signal:i});return a?.forEach((({graphic:t})=>{t.layer!==e||s.some((e=>e.getObjectId()===t.getObjectId()))||s.push(t)})),s}))),i)}function Y(e){return b(e.fieldsIndex,[e.objectIdField,w({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function $(e,t,r){const{sourceLayer:i}=e,n=i.createQuery();n.objectIds=[e.getAttribute(i.objectIdField)],n.outFields=["*"],n.returnM=i.capabilities.data.supportsM,n.returnZ=i.capabilities.data.supportsZ,"scene"===i.type&&null!=i.infoFor3D||(n.outSpatialReference=t);const a=await i.queryFeatures(n,{signal:r});c(r);return a.features[0]}async function _(e){const{graphic:t,sketchViewModel:r,sourceLayer:i,visualVariables:n,webStyleCache:a}=e;let o=!1;const{rotation:l,size:s}=n;if([l,s].forEach((async e=>{if(null==e)return;const i=t.getAttribute(e.field);if(null!=i)e.setInitialValue(i);else{const i=await e.getDefault(t.symbol,r.view);e.setInitialValue(i),t.setAttribute(e.field,i),o=!0}})),o){const e="2d"===r.view?.type?r.view.scale:null;await Z(t,a,e)}const c={multipleSelectionEnabled:!1};return"point"===i.geometryType&&(c.enableRotation=null!=l,c.enableScaling=null!=s),H(r.tooltipOptions,s,l),r.layer.elevationInfo=i.elevationInfo,r.update(t,c)}function ee(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function te(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function re(e,t,r,i,n){if(null==t.geometry||"point"!==t.geometry?.type)return;const a=i.rotation,o=ee(r.toolEventInfo);if(null!=a&&null!=o){const{field:r,getValue:i}=a;"rotate-stop"===o.type?(a.isUpdatingInteractively=!1,a.setInitialValue(t.getAttribute(r))):(a.isUpdatingInteractively=!0,t.setAttribute(r,i(o.angle,e)))}const l=i.size,s=te(r.toolEventInfo);if(null!=l&&null!=s){const{field:r,getValue:i}=l;"scale-stop"===s.type?(l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r))):(l.isUpdatingInteractively=!0,t.setAttribute(r,i(s.xScale,e)))}await Z(t,n,"2d"===e.type?e.scale:null)}async function ie({feature:e,featureClone:t,visualVariableAttributes:r,sketchViewModel:i,view:l,onUpdate:s,webStyleCache:c,addUpdatingPromise:d,addHandle:f}){await Z(t,c,"2d"===l.type?l.scale:null);let m=null;if("2d"===i?.view?.type){const e=u((e=>Z(t,c,e)));m=p((()=>i?.view?.scale),(t=>e(t)))}const g=t.sourceLayer,h=de(l,g);await _({graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c});let b=null;h.then((e=>b=e)).catch((()=>{}));const w=r.size,v=r.rotation,S=p((()=>e.attributes),(async e=>{let r=!1;for(const i in e){const n=e[i];n!==t.getAttribute(i)&&(t.setAttribute(i,n),null==w||w.isUpdatingInteractively||w.field!==i||w.setInitialValue(n),null==v||v.isUpdatingInteractively||v.field!==i||v.setInitialValue(n),(null==b||b.requiredFields.includes(i))&&(r=!0))}r&&await Z(t,c,"2d"===l.type?l.scale:null)})),j=i.on("update",(async e=>{const t=e.graphics[0],n={graphic:t,sketchViewModel:i,sourceLayer:g,visualVariables:r,webStyleCache:c};if("complete"===e.state){if(null===l.activeTool)return _(n);const e=new AbortController,t=o(e);return f(t),d(y((()=>null===l.activeTool),e.signal).then((()=>(e.abort(),_(n)))))}await re(l,t,e,r,c),s(me(t),e)})),I=i.on(["undo","redo"],(async e=>{s(me(e.graphics[0]),e)}));return a([I,j,n((()=>i.cancel())),S,m])}async function ne(e,t,i){const o=e.view;e.layer.add(i);const l=t.sourceLayer,s=t.layer,u=t.getAttribute(s.objectIdField);let p=null;function d(e){p?.abort(),p=r((async t=>{const r=await de(o,l);c(t),r.setVisibility?.(u,e)}))}return await oe(o,i),d(!1),a([ae(o,i,(e=>d(!e))),n((async()=>{d(!0);try{const e=await de(o,l);await y((()=>!e.updating))}finally{e.layer.remove(i)}}))])}function ae(e,t,r){if("3d"===e.type){const i=new z({graphic:t});return a([e.trackGraphicState(i),p((()=>i.displaying),r)])}return p((()=>t.visible),r)}async function oe(e,t){if("3d"===e.type){const r=new z({graphic:t}),i=e.trackGraphicState(r);await y((()=>r.displaying||r.error)),i.remove()}else await y((()=>t.visible))}const le={icon:d(24),text:d(12),line:d(1),viewScaleSizeFactor:100};function se(e,t,r){let i=!1;return e.filter((e=>!!i||(i=e===t,i))).map((e=>r[e]()))}function ce(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const e=r.layer,i=g(e);1===i.length&&"scene"!==e.type&&(r.template=i[0],t.shift())}return t}function ue(e){return"unknown"===e?null:e}function pe(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const ye=e=>/-stop/.test(e)||/vertex-/.test(e),de=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function fe(e){return"createInteractiveEditSession"in e}function me(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=l(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function ge(e){const t=e.cursor;return e.cursor="progress",n((()=>e.cursor=t))}export{ce as avoidFeatureTemplateSelectionWithOnlyOneItem,fe as canCreateInteractiveEditSession,me as cloneGraphicExceptMesh,se as createWorkflowSteps,K as fetchCandidates,$ as fetchFullFeature,J as findLayerInfo,B as getCreationAttributes,k as getVisualVariableAttributes,ye as isTerminalUpdateEventType,A as isUpdateWorkflow,pe as prepareAttachmentsForCreateFeaturesWorkflow,ie as setUpGeometryUpdate,ge as showProgressCursor,le as sizeDefaults,ue as sizeVariableUnitToLengthUnit,Q as startCreatingNewFeature,_ as startUpdatingFeatureGeometry,ne as swapForEditingSession,Z as updateGraphicSymbolWhenRequired,re as visualVariableInteractiveUpdate,de as whenEditorLayerView,oe as whenGraphicDisplayed};
5
+ import e from"../../Color.js";import t from"../../Graphic.js";import{addMany as r,equals as i}from"../../core/arrayUtils.js";import{createTask as n}from"../../core/asyncUtils.js";import"../../core/has.js";import a from"../../core/Error.js";import{handlesGroup as o,makeHandle as l,abortHandle as s}from"../../core/handleUtils.js";import{clone as c}from"../../core/lang.js";import u from"../../core/Logger.js";import{getOrCreateMapValue as p}from"../../core/MapUtils.js";import{whenOrAbort as d,throwIfAborted as y,debounce as f,isPromiseLike as m}from"../../core/promiseUtils.js";import{watch as g,on as h,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as b}from"../../core/screenUtils.js";import{diff as v}from"../../core/accessorSupport/diffUtils.js";import{isSharedGroupTemplate as S,isSharedPresetTemplate as j,isStandardFeatureTemplate as I,isSharedFeatureTemplate as T,getAllStandardFeatureTemplatesForLayer as U,isSharedTemplate as V,isSharedTemplateOrMetadata as L}from"../../editing/templateUtils.js";import k from"../../editing/sharedTemplates/SharedTemplate.js";import{getSharedTemplateProvider as O}from"../../editing/sharedTemplates/SharedTemplateProvider.js";import F from"../../layers/GraphicsLayer.js";import{featureHasFields as x,fixFields as z,getDisplayFieldName as A}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as M}from"../../layers/support/layerUtils.js";import{calculateTolerance as P}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as C}from"../../renderers/support/lengthUtils.js";import{getTransformationType as E,TransformationType as R}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import{getRotationAngle as G,getSize as D}from"../../renderers/visualVariables/support/visualVariableUtils.js";import Z from"../../symbols/SimpleFillSymbol.js";import q from"../../symbols/SimpleLineSymbol.js";import B from"../../symbols/SimpleMarkerSymbol.js";import{to3D as N}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as Q}from"../../symbols/support/symbolUtils.js";import{getServices as J}from"../../undoredo/support/Services.js";import{GraphicState as W}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as H}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as K}from"../../views/support/drapedUtils.js";import{hitTestSelectSimilarDistance as X,filterGraphicHits as Y}from"../../views/support/hitTestSelectUtils.js";import{isDrawGraphicTool as $}from"../Sketch/support/sketchUtils.js";const _=()=>u.getLogger("esri.widgets.Editor.workflowUtils");function ee(e){return"update"===e.type}function te(e){const t=e.sourceLayer;if(!t||"feature"!==t.type||!le(t.renderer))return{rotation:null,size:null};let r=null,i=null;const n=t.renderer.getVisualVariablesForType("rotation").filter((t=>(!t.axis||"heading"===t.axis)&&t.field&&!t.valueExpression&&null!=G(t,e)));1===n.length&&(r=re(n[0],t));const a=t.renderer.getVisualVariablesForType("size").filter((t=>t.field&&!t.useSymbolValue&&!t.valueExpression&&E(t)===R.RealWorldSize&&null!=D(t,e)));return 1===a.length&&(i=ae(a[0],t)),{rotation:r,size:i}}function re(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,i=e.field,n=t.fields&&t.fields.filter((e=>e.name===i)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0};return{field:i,fieldType:a,getDefault:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,oe((o.current+360)%360,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function ie(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ne(e,t,r){if(null==t)return 0;const{symbol:i}=N(t);if(null==i||"web-style"===i.type||"cim"===i.type)return 0;const n=i.symbolLayers.at(0);if(!n)return 0;switch(n.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return n.size||Math.min(Me.icon,(await e(n,Me.icon))[0])||Me.icon}case"text":return n.size||Me.text;case"line":return n.size||Me.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return ie(await t(n,e.scale/Me.viewScaleSizeFactor),r)}case"path":return(null!=n.width?n.width:n.height)||e.scale/Me.viewScaleSizeFactor;case"extrude":return n.size||e.scale/Me.viewScaleSizeFactor;default:return 0}}function ae(e,t){const r=e.field,i=e.axis,n=t.fields&&t.fields.filter((e=>e.name===r)),a=n&&1===n.length?n[0].type:"double",o={initial:0,current:0},l=C[e.valueUnit]??1;let s;return s="area"===e.valueRepresentation?e=>(e*l/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*l/2:e=>e*l,{field:r,fieldType:a,getDefault:async(e,t)=>oe(s(await ne(t,e,i)),a),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,oe(o.current,a)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:Ee(e.valueUnit),axis:e.axis}}function oe(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function le(e){switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function se(e,t,r){const i=await Q(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=v(e.symbol,i)&&(e.symbol=i)}function ce(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const i={mode:H,optionsPerTool:r};if(L(t)){const n=t.defaultTool,a=S(t)?t.definition?.inputGeometryType??e:e;switch(n){case"freehand":case"stream-line":return{tool:"polyline"===a?"freehandPolyline":"freehandPolygon",createOptions:i};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:i};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===a?"polygon":"polyline",createOptions:i};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:i};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:i};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:i};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:i};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:i};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:i}}}else{const n=t.drawingTool;if("circle"===n||"ellipse"===n)return r.get("circle").preserveAspectRatio="circle"===n,{tool:"circle",createOptions:i};if("rectangle"===n)return{tool:"rectangle",createOptions:i};if("freehand"===n)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:i}}return{tool:e,createOptions:i}}async function ue(e,t,r){const{creationInfo:i,fullTemplate:n}=t;if(!i)throw new a("No creation info provided.");const o=i.layer,l=he(n,i.attributeOverrides),{view:s}=e,c="2d"===s?.type;S(n)||j(n)||await we(e,o,l,r,c?s.scale:null);const{capabilities:u}=o;e.layer.elevationInfo=o.elevationInfo;const p=ce(o.geometryType,n);return e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:o},mode:p.createOptions.mode,optionsPerTool:p.createOptions.optionsPerTool,preserveAspectRatio:p.createOptions.preserveAspectRatio,hasZ:u.data.supportsZ,defaultZ:(c?u.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==i.geometryToPlace?await e.create(p.tool):await e.place(i.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:o}}),pe({creationAttributes:l,data:t,sketchViewModel:e,view:s,webStyleCache:r})}async function pe(e){return o([await de(e),await ye(e)])}async function de({creationAttributes:e,data:t,sketchViewModel:r,view:i,webStyleCache:n}){const{creationInfo:a}=t,{fullTemplate:o}=t;if(!a||"2d"!==i?.type||S(o)||j(o))return null;const l=f((t=>we(r,a.layer,e,n,t)));return g((()=>i.scale),(e=>l(e)))}async function ye({data:t,sketchViewModel:r,view:i}){const{templateExecutorInfo:n}=t;if(!n)return null;const s=r.activeComponent;if(!i||!$(s))return _().error(new a("Failed to set up template feedback.")),null;const c=new F({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});i.map?.add(c);const{executor:u,serviceLayersById:p}=n,d=i.theme?.accentColor??new e([255,165,0,1]);return o([h((()=>s),["cursor-update","vertex-add"],(()=>{c.removeAll();const e=s.graphic?.geometry;if(!e||!fe(e))return;const t=u(e,"digitizing");if(!m(t))for(const r of t.edits){const e=p.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=me(e,d);t&&c.add(t)}}})),l((()=>{i.map.remove(c),c.destroy()}))])}function fe(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":return e.paths[0].length>1;case"polygon":{const t=e.rings[0];return i(t.at(0),t.at(-1))?t.length>2:t.length>1}default:return!1}}function me(e,r){let i=null;switch(e.geometry?.type){case"point":case"multipoint":i=new B({angle:0,color:r,outline:new q({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":i=new Z({color:r,outline:new q({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":i=new q({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:i,attributes:{...e.attributes}})}async function ge(e,t){const r=await J(t).load(),i=M(e)?e.parent:e,n=r.tablesAndLayersLookup.get(i);if(!n)return new Map;const a=new Map;for(const o of n.layersAndTables)p(a,o.layerId,(()=>[])).push(o);return a}function he(e,t={}){return S(e)||j(e)?{}:I(e)?{...e.prototype.attributes,...t}:T(e)?{...e.definition?.defaultValues,...t}:{...t}}async function we(e,r,i,n,a){const o=new t({sourceLayer:r,attributes:i}),{rotation:l,size:s}=te(o);let c=await Q(o,{useSourceLayer:!0,webStyleCache:n,scale:a}),u=!1;for(const t of[s,l]){if(null==t)continue;null==i[t.field]&&(i[t.field]=await t.getDefault(c,e.view),u=!0)}switch(u&&(c=await Q(o,{useSourceLayer:!0,webStyleCache:n,scale:a})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}be(e.tooltipOptions,s,l)}function be(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function ve(e,t){return e?.find((e=>e.layer===t))}async function Se(e,t,r,i){switch(t.type){case"3d":return je(e,t,r,i);case"2d":return Ie(e,t,r,i)}}async function je(e,t,i,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:o}=await i.async((async()=>{const{results:r}=await d(X(t,i),n),a=new Map,o=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};Y(r).forEach((({graphic:e})=>o(e).push(e)));const l=e.filter((({capabilities:e,layer:t})=>e.update.enabled&&a.has(t)));return 0!==l.length&&i.stopPropagation(),{updatable:l,graphicsByLayer:a}}));return d(Promise.allSettled(a.map((async({layer:e})=>{const t=o.get(e),i=Te(e);if(t.every((e=>x(i,e))))return t;const a=[];for(const n of t){a.push(n.getObjectId());const e=Object.keys(n.attributes);r(i,e)}const l=e.createQuery();return l.returnGeometry=!1,l.objectIds=a,l.outFields=z(e.fieldsIndex,i),e.queryFeatures(l,{signal:n}).then((({features:e})=>e))}))),n)}async function Ie(e,t,r,i){if(0===e.length)return[];const{mapPoint:n}=r;if(null==n)return[];let a=null;const o=await r.async((async()=>{const{results:n}=await d(t.hitTest(r),i);if(0===n.length)return[];const o=new Set;a=Y(n),a.forEach((({graphic:e})=>e&&o.add(e.layer)));const l=e.filter((e=>o.has(e.layer)&&e.supportsUpdateWorkflow));return l.length>0&&r.stopPropagation(),l}));return d(Promise.allSettled(o.map((async({layer:e})=>{const o=e.createQuery();o.returnGeometry=!1,o.outFields=Te(e);const l="renderer"in e?P({renderer:e.renderer,pointerType:r.pointerType}):0;o.geometry=K(n,l,t),o.outSpatialReference=t.spatialReference;const{features:s}=await e.queryFeatures(o,{signal:i});return a?.forEach((({graphic:t})=>{t.layer!==e||s.some((e=>e.getObjectId()===t.getObjectId()))||s.push(t)})),s}))),i)}function Te(e){return z(e.fieldsIndex,[e.objectIdField,A({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function Ue(e,t,r){const{sourceLayer:i}=e,n=i.createQuery();n.objectIds=[e.getAttribute(i.objectIdField)],n.outFields=["*"],n.returnM=i.capabilities.data.supportsM,n.returnZ=i.capabilities.data.supportsZ,"scene"===i.type&&null!=i.infoFor3D||(n.outSpatialReference=t);const a=await i.queryFeatures(n,{signal:r});y(r);return a.features[0]}async function Ve(e){const{graphic:t,sketchViewModel:r,sourceLayer:i,visualVariables:n,webStyleCache:a}=e;let o=!1;const{rotation:l,size:s}=n;if([l,s].forEach((async e=>{if(null==e)return;const i=t.getAttribute(e.field);if(null!=i)e.setInitialValue(i);else{const i=await e.getDefault(t.symbol,r.view);e.setInitialValue(i),t.setAttribute(e.field,i),o=!0}})),o){const e="2d"===r.view?.type?r.view.scale:null;await se(t,a,e)}const c={multipleSelectionEnabled:!1};return"point"===i.geometryType&&(c.enableRotation=null!=l,c.enableScaling=null!=s),be(r.tooltipOptions,s,l),r.layer.elevationInfo=i.elevationInfo,r.update(t,c)}function Le(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function ke(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}async function Oe(e,t,r,i,n){if(null==t.geometry||"point"!==t.geometry?.type)return;const a=i.rotation,o=Le(r.toolEventInfo);if(null!=a&&null!=o){const{field:r,getValue:i}=a;"rotate-stop"===o.type?(a.isUpdatingInteractively=!1,a.setInitialValue(t.getAttribute(r))):(a.isUpdatingInteractively=!0,t.setAttribute(r,i(o.angle,e)))}const l=i.size,s=ke(r.toolEventInfo);if(null!=l&&null!=s){const{field:r,getValue:i}=l;"scale-stop"===s.type?(l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r))):(l.isUpdatingInteractively=!0,t.setAttribute(r,i(s.xScale,e)))}await se(t,n,"2d"===e.type?e.scale:null)}async function Fe({feature:e,featureClone:t,visualVariableAttributes:r,sketchViewModel:i,view:n,onUpdate:a,webStyleCache:c,addUpdatingPromise:u,addHandle:p}){await se(t,c,"2d"===n.type?n.scale:null);let d=null;if("2d"===i?.view?.type){const e=f((e=>se(t,c,e)));d=g((()=>i?.view?.scale),(t=>e(t)))}const y=t.sourceLayer,m=De(n,y);await Ve({graphic:t,sketchViewModel:i,sourceLayer:y,visualVariables:r,webStyleCache:c});let h=null;m.then((e=>h=e)).catch((()=>{}));const b=r.size,v=r.rotation,S=g((()=>e.attributes),(async e=>{let r=!1;for(const i in e){const n=e[i];n!==t.getAttribute(i)&&(t.setAttribute(i,n),null==b||b.isUpdatingInteractively||b.field!==i||b.setInitialValue(n),null==v||v.isUpdatingInteractively||v.field!==i||v.setInitialValue(n),(null==h||h.requiredFields.includes(i))&&(r=!0))}r&&await se(t,c,"2d"===n.type?n.scale:null)})),j=i.on("update",(async e=>{const t=e.graphics[0],o={graphic:t,sketchViewModel:i,sourceLayer:y,visualVariables:r,webStyleCache:c};if("complete"===e.state){if(null===n.activeTool)return Ve(o);const e=new AbortController,t=s(e);return p(t),u(w((()=>null===n.activeTool),e.signal).then((()=>(e.abort(),Ve(o)))))}await Oe(n,t,e,r,c),a(qe(t),e)})),I=i.on(["undo","redo"],(async e=>{a(qe(e.graphics[0]),e)}));return o([I,j,l((()=>i.cancel())),S,d])}async function xe(e,t,r){const i=e.view;e.layer.add(r);const a=t.sourceLayer,s=t.layer,c=t.getAttribute(s.objectIdField);let u=null;function p(e){u?.abort(),u=n((async t=>{const r=await De(i,a);y(t),r.setVisibility?.(c,e)}))}return await Ae(i,r),p(!1),o([ze(i,r,(e=>p(!e))),l((async()=>{p(!0);try{const e=await De(i,a);await w((()=>!e.updating))}finally{e.layer.remove(r)}}))])}function ze(e,t,r){if("3d"===e.type){const i=new W({graphic:t});return o([e.trackGraphicState(i),g((()=>i.displaying),r)])}return g((()=>t.visible),r)}async function Ae(e,t){if("3d"===e.type){const r=new W({graphic:t}),i=e.trackGraphicState(r);await w((()=>r.displaying||r.error)),i.remove()}else await w((()=>t.visible))}const Me={icon:b(24),text:b(12),line:b(1),viewScaleSizeFactor:100};function Pe(e,t,r){let i=!1;return e.filter((e=>!!i||(i=e===t,i))).map((e=>r[e]()))}function Ce(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const e=r.layer,i=U(e);1===i.length&&"scene"!==e.type&&(r.template=i[0],t.shift())}return t}function Ee(e){return"unknown"===e?null:e}function Re(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const Ge=e=>/-stop/.test(e)||/vertex-/.test(e),De=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function Ze(e){return"createInteractiveEditSession"in e}function qe(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=c(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function Be(e){const t=e.cursor;return e.cursor="progress",l((()=>e.cursor=t))}async function Ne(e,t){const{template:r}=e;if(null==r)return null;if(V(r))return r.load();if(L(r)){const e=O(t,{makeSharedTemplateFromJSON:Qe}),i=await e.getTemplates({templateIds:[r.templateId],featureService:r.featureService});if(0===i.length)throw new a("editor:failed-to-load-template","Unable to load the provided template");return i[0].load()}return r}const Qe=e=>k.fromJSON(e);export{Ce as avoidFeatureTemplateSelectionWithOnlyOneItem,Ze as canCreateInteractiveEditSession,qe as cloneGraphicExceptMesh,Pe as createWorkflowSteps,Se as fetchCandidates,Ue as fetchFullFeature,ve as findLayerInfo,he as getCreationAttributes,Ne as getFullTemplateForCreationInfo,ge as getServiceLayersById,te as getVisualVariableAttributes,Ge as isTerminalUpdateEventType,ee as isUpdateWorkflow,Re as prepareAttachmentsForCreateFeaturesWorkflow,Fe as setUpGeometryUpdate,pe as setUpSketchCreateWatchers,Be as showProgressCursor,Me as sizeDefaults,Ee as sizeVariableUnitToLengthUnit,ue as startCreatingNewFeature,Ve as startUpdatingFeatureGeometry,xe as swapForEditingSession,se as updateGraphicSymbolWhenRequired,Oe as visualVariableInteractiveUpdate,De as whenEditorLayerView,Ae as whenGraphicDisplayed};
package/widgets/Editor.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{destroyMaybe as t,mappedFind as s,abortMaybe as o}from"../core/maybe.js";import{createResolver as i}from"../core/promiseUtils.js";import{watch as r,initial as a,on as n,when as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import m from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Attachments.js";import p from"./FeatureForm.js";import u from"./FeatureTemplates.js";import g from"./Spinner.js";import w from"./Widget.js";import{css as v}from"./Editor/css.js";import _ from"./Editor/EditorViewModel.js";import{isModelUpload as f}from"./Editor/modelUploadUtils.js";import k from"./Editor/VisibleElements.js";import{loadCreateFeaturesPanelContentComponents as y,CreateFeaturesPanelContent as b}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as F,FeatureList as M}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as A,FooterActions as T}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as C,Notice as E}from"./Editor/components/Notices.js";import{loadPanelContentComponents as P,PanelContent as W,PanelContentSection as L,PanelContentMessage as j}from"./Editor/components/PanelContent.js";import{PanelToolbar as S,loadPanelToolbarComponents as I}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as U,Prompt as D}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as O,UpdateFeaturePanelContent as V}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as x,UploadDetails as B}from"./Editor/components/UploadDetails.js";import{VisibleElements as z,CreateToolVisibilityMap as R}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as G}from"./support/componentsUtils.js";import{globalCss as H}from"./support/globalCss.js";import{incrementHeadingLevel as q,Heading as N}from"./support/Heading.js";import{renderItem as Z}from"./support/ItemList.js";import{connectDelayedLoading as K}from"./support/loaderUtils.js";import"./support/widgetUtils.js";import{messageBundle as $}from"./support/decorators/messageBundle.js";import{vmEvent as J}from"./support/decorators/vmEvent.js";import{tsx as Q}from"./support/jsxFactory.js";import{substitute as X}from"../intl/substitute.js";const Y=Symbol("sketch-setup-handles");let ee=class extends w{constructor(e,t){super(e,t),this._featureForm=new p,this._sketchToolbar=null,this._attachments=new h({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._featureTemplates=new u({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?Q("calcite-icon",{class:v.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new g,this._loading=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new _,this.visibleElements=new k,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSketch=()=>this._sketchToolbar?Q("div",{class:v.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>Q("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:s},...o)=>{const{visibleElements:i}=this;return Q("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:s,onCalciteFlowItemBack:this._onBack},i.zoomToButton&&this.viewModel.canZoomTo?Q("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>this.viewModel.zoomTo(),slot:"header-actions-end",text:this.messages.zoomTo}):null,i.settingsMenu?Q(S,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...o)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,s={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&f(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&t.activeFeatureFormViewModel?.activeAssociation?this._showPromptAndWait({...s,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(s)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then((()=>e.back())))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then((()=>e.back())))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([r((()=>q(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),a),n((()=>this.viewModel.activeWorkflow),"cancel-request",(({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then((t=>t?e.allow():e.deny()))})),l((()=>this.viewModel.featureFormViewModel),(e=>{this._featureForm.viewModel=e}),a),r((()=>this.viewModel),(e=>{this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt}),a),r((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),a),r((()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel]),(([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))}),a),l((()=>this._attachments?.error),(e=>this._onAttachmentsError(e))),l((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:o,cancel:i}]=e;this._showPrompt({title:t.errorWarningTitle,message:X(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{i(),this._clearPrompt()}}}})})),r((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}})),r((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),r((()=>this.visibleElements.sketch),(()=>this._setupSketch()),a),K({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._sketchToolbar=t(this._sketchToolbar)}loadDependencies(){return Promise.all([G({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),y(),F(),A(),C(),P(),I(),U(),O(),x()])}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get activeWorkflow(){return this.viewModel.activeWorkflow}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,s=this.classes(v.base,H.widget,H.panel);if(!t)return Q("div",{class:s,key:"empty"});const{pageStack:o}=t,i=o.length-1,r=o.map(((e,t)=>this._renderPage(e,t===i)));return Q("div",{class:s,key:"base"},e.flow?Q("calcite-flow",{key:"flow"},r):r,this._prompt?Q(D,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const s={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(s);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(s);case"creating-features-upload-details":return this._renderUploadDetails(s);case"creating-features":return this._renderCreatingFeatures(s);case"editing-existing-feature":case"editing-attributes":return this._renderUpdateFeature(s);case"awaiting-update-feature-candidate":return this._renderFeatureList(s);case"adding-attachment":return this._renderAttachmentAdding(s);case"editing-attachment":return this._renderAttachmentEditing(s);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(s)}return Q("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:s}=this;return Q(t,{heading:s.selectTemplate,key:"templates-panel",...e},Q(W,{key:"feature-templates"},Q(L,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:s,messages:o}=this;if("create-features"!==s?.type)return null;const i=s.data.upload;return i?Q(t,{heading:o.createFeatures,key:"upload-details-panel",...e},Q(B,{helpMessage:this._helpMessage,messages:o,upload:i})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:s,messages:o,messagesCommon:i,headingLevel:r,viewModel:a}=this;if(!s)return null;const n="create-features"===s.type&&s.numPendingFeatures>0||"update"===s.type&&"create-features"===s?.activeWorkflow?.type&&s.activeWorkflow?.numPendingFeatures>0;return Q(t,{heading:o.createFeatures,key:"create-features-panel",...e},n?Q(V,{editorViewModel:a,headingLevel:r,messages:o,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):Q(b,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this;return Q(t,{heading:s.editFeature,key:"update-feature-panel",...e},Q(V,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_getAssociationTypeTitle(e){if(!e)return null;if(e.title)return e.title;const{messagesFeature:t}=this;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:r}=this,a=r.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(a)??s.editFeature;return Q(t,{heading:n,key:"viewing-associated-layers-panel",...e},Q(V,{editorViewModel:r,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:o}=this,i=s(e.group.items,(e=>o.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0));return i?Q(E,{kind:"warning",message:i}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:s,messages:o,messagesCommon:i}=this;return Q(t,{heading:o.addAttachment,key:"attachment-adding-panel",...e},Q(W,{key:"attachments"},this._renderAttachments()),Q(T,{buttons:[{label:s.submitting?i.cancel:i.add,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:s,activeWorkflow:o,messages:i,messagesCommon:r}=this;return o?Q(t,{heading:i.editAttachment,key:"attachment-editing-panel",...e},Q(W,{key:"attachments"},this._renderAttachments()),o.shouldAllowAttachmentEditing?Q(T,{buttons:[{label:r.update,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:s.submitting,label:r.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:s,viewModel:o,visibleElements:i}=this,r=this._helpMessage;return Q(t,{heading:s.widgetLabel,key:"landing-panel",...e},Q(W,{key:"landing-content"},o.editorItems.length?[i.editFeaturesSection?Q(L,{key:"edit-actions"},this._renderUpdateActions()):null,i.createFeaturesSection&&o.canCreateVisible?Q(L,{key:"create-actions"},this._renderCreateActions()):null]:Q(j,{key:"no-content"},s.noEditableLayers)),r?Q("div",{class:v.helpMessage,key:"footer-actions",slot:"footer"},r):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:s}=this,o=e?.helpMessage;return o?t["3d"===s?.type?"helpMessages3d":"helpMessages2d"]?.[o]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:s}=this,o={id:"select",label:t.select};return Q("div",{class:v.updateActions,key:"update-actions"},Q(N,{level:q(this.headingLevel)},e.editFeatures),Q("calcite-list",{class:v.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},Z({disabled:!s.canUpdateVisible,grouped:!1,item:o,selectedItem:"awaiting-feature-to-update"===s.activeWorkflow?.stepId?o:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return Q("div",{key:"create-actions"},Q(N,{level:q(this.headingLevel)},this.messages.createFeatures),Q("div",{class:v.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:s}=this,{activeWorkflow:o}=s;if("update"!==o?.type)return null;const i=o.data.candidates,r=X(this.messages.multipleFeaturesTemplate,{total:i.length});return Q(t,{heading:r,key:"feature-list",...e},Q(M,{editorItems:s.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:o,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>s.selectFeature(e,t),onZoomTo:e=>s.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:s,noLabel:o}){const r=i(),{view:a}=this,n=a?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:s,action:()=>r.resolve(!0)},secondary:{label:o,action:()=>r.resolve(!1)}}}),r.promise.finally((()=>{this._clearPrompt(),n&&a?.focus()}))}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=t(this._sketchToolbar),void this.removeHandles(Y);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const s=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new s.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new z({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new R({freehandPolygon:!0,freehandPolyline:!0})})}),this.addHandles([r((()=>this.viewModel.activeLeafWorkflow?.availableCreateTools),(e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)}),a),r((()=>this.visibleElements.undoRedoButtons),(e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)}),a),l((()=>this.viewModel?.sketchViewModel),(e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)}),a)],Y)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar}}};e([c()],ee.prototype,"_featureForm",void 0),e([c()],ee.prototype,"_sketchToolbar",void 0),e([c()],ee.prototype,"_attachments",void 0),e([c()],ee.prototype,"_featureTemplates",void 0),e([c()],ee.prototype,"_filterText",void 0),e([c()],ee.prototype,"_prompt",void 0),e([c()],ee.prototype,"_spinner",void 0),e([c()],ee.prototype,"_deleteButtonCommonInfo",null),e([c()],ee.prototype,"_loading",void 0),e([c({readOnly:!0})],ee.prototype,"activeWorkflow",null),e([c()],ee.prototype,"headingLevel",void 0),e([c()],ee.prototype,"hideTemplatesForInactiveLayers",null),e([c()],ee.prototype,"icon",null),e([c()],ee.prototype,"label",null),e([c()],ee.prototype,"labelOptions",null),e([c()],ee.prototype,"layerInfos",null),e([c(),$("esri/widgets/Editor/t9n/Editor")],ee.prototype,"messages",void 0),e([c(),$("esri/t9n/common")],ee.prototype,"messagesCommon",void 0),e([c(),$("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],ee.prototype,"messagesTemplates",void 0),e([c(),$("esri/widgets/Feature/t9n/Feature")],ee.prototype,"messagesFeature",void 0),e([c()],ee.prototype,"snappingOptions",null),e([c()],ee.prototype,"tooltipOptions",null),e([c()],ee.prototype,"supportingWidgetDefaults",void 0),e([c({type:m,nonNullable:!0})],ee.prototype,"valueOptions",null),e([c()],ee.prototype,"view",null),e([c(),J(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],ee.prototype,"viewModel",void 0),e([c({type:k,nonNullable:!0})],ee.prototype,"visibleElements",void 0),e([c()],ee.prototype,"_helpMessage",null),ee=e([d("esri.widgets.Editor")],ee);const te=ee;export{te as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{destroyMaybe as t,mappedFind as s,abortMaybe as o}from"../core/maybe.js";import{createResolver as i}from"../core/promiseUtils.js";import{watch as a,initial as r,on as n,when as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import m from"../views/interactive/sketch/SketchValueOptions.js";import h from"./Attachments.js";import p from"./FeatureForm.js";import u from"./FeatureTemplates.js";import g from"./Spinner.js";import w from"./Widget.js";import{css as _}from"./Editor/css.js";import v from"./Editor/EditorViewModel.js";import{isModelUpload as f}from"./Editor/modelUploadUtils.js";import y from"./Editor/VisibleElements.js";import{loadCreateFeaturesPanelContentComponents as k,CreateFeaturesPanelContent as b}from"./Editor/components/CreateFeaturesPanelContent.js";import{loadFeatureListComponents as A,FeatureList as F}from"./Editor/components/FeatureList.js";import{loadFooterActionsComponents as M,FooterActions as T}from"./Editor/components/FooterActions.js";import{loadNoticesComponents as C,Notice as W}from"./Editor/components/Notices.js";import{loadPanelContentComponents as E,PanelContent as P,PanelContentSection as L,PanelContentMessage as S}from"./Editor/components/PanelContent.js";import{PanelToolbar as I,loadPanelToolbarComponents as j}from"./Editor/components/PanelToolbar.js";import{loadPromptComponents as U,Prompt as D}from"./Editor/components/Prompt.js";import{loadUpdateFeaturePanelContentComponents as V,UpdateFeaturePanelContent as O}from"./Editor/components/UpdateFeaturePanelContent.js";import{loadUploadDetailsComponents as x,UploadDetails as B}from"./Editor/components/UploadDetails.js";import N from"./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js";import z from"./FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js";import{VisibleElements as R,CreateToolVisibilityMap as G}from"./Sketch/VisibleElements.js";import{loadCalciteComponents as H}from"./support/componentsUtils.js";import{globalCss as q}from"./support/globalCss.js";import{incrementHeadingLevel as Z,Heading as K}from"./support/Heading.js";import{renderItem as $}from"./support/ItemList.js";import{connectDelayedLoading as J}from"./support/loaderUtils.js";import"./support/widgetUtils.js";import{messageBundle as Q}from"./support/decorators/messageBundle.js";import{vmEvent as X}from"./support/decorators/vmEvent.js";import{tsx as Y}from"./support/jsxFactory.js";import{substitute as ee}from"../intl/substitute.js";const te=Symbol("sketch-setup-handles");let se=class extends w{constructor(e,t){super(e,t),this._featureForm=new p,this._sketchToolbar=null,this._attachments=new h({visibleElements:{addSubmitButton:!1,cancelAddButton:!1,cancelUpdateButton:!1,deleteButton:!1,errorMessage:!1,progressBar:!1,updateButton:!1}}),this._associationItemList=new N,this._associationSettings=new z,this._featureTemplates=new u({enableListScroll:!1,renderItemContentEnd:e=>e.supportsUpload?Y("calcite-icon",{class:_.templateItemContentEnd,icon:"upload-to",key:"upload-icon"}):null,renderItemLabel:e=>e.label,renderCustomGroupContent:e=>this._renderCustomTemplateGroupContent(e)}),this._filterText="",this._prompt=null,this._spinner=new g,this._loading=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.messagesTemplates=null,this.messagesFeature=null,this.supportingWidgetDefaults=null,this.viewModel=new v,this.visibleElements=new y,this._renderAttachments=()=>this._attachments.render(),this._renderFeatureForm=()=>this._featureForm.render(),this._renderAssociationItemList=()=>this._associationItemList.render(),this._renderAssociationSettings=()=>this._associationSettings.render(),this._renderFeatureTemplates=()=>this._featureTemplates.render(),this._renderSketch=()=>this._sketchToolbar?Y("div",{class:_.sketchContainer,key:"editor-sketch-container"},this._sketchToolbar?.render()):void 0,this._renderSelectIcon=()=>Y("calcite-icon",{icon:"cursor",slot:"content-start"}),this.EditorPanel=({heading:e,key:t,selected:s},...o)=>{const{visibleElements:i}=this;return Y("calcite-flow-item",{closable:!1,heading:e,headingLevel:this.headingLevel,key:t,loading:this._loading,selected:s,onCalciteFlowItemBack:this._onBack},i.zoomToButton&&this.viewModel.canZoomTo?Y("calcite-action",{alignment:"center",appearance:"transparent",icon:"zoom-to-object",key:"zoom-to-button",onclick:()=>this.viewModel.zoomTo(),slot:"header-actions-end",text:this.messages.zoomTo}):null,i.settingsMenu?Y(I,{editorViewModel:this.viewModel,messagesCommon:this.messagesCommon,visibleElements:i}):null,...o)},this._showDiscardEditsPrompt=()=>{const{messages:e,activeWorkflow:t}=this,s={title:e.cancelEditTitle,message:e.cancelEditWarningMessage,yesLabel:e.discardEdits,noLabel:e.continueEditing};return"create-features"===t?.type&&f(t.data.creationInfo)?this._showPromptAndWait("success"===t.data.upload?.state?e.modelUploads.cancelPlacementPrompt:e.modelUploads.cancelUploadPrompt):"update"===t?.type&&t.activeFeatureFormViewModel?.activeAssociation?this._showPromptAndWait({...s,message:e.cancelAssociationEditWarning}):this._showPromptAndWait(s)},this._showGenericCancelPrompt=()=>{const{messages:e,messagesCommon:t}=this;return this._showPromptAndWait({title:e.cancelRequestTitle,message:e.cancelRequestWarningMessage,yesLabel:t.form.yes,noLabel:t.form.no})},this._showPrompt=e=>{this._prompt?.cancel?.(),this._prompt=e},this._clearPrompt=()=>{this._prompt=null},this._onSave=()=>{this.viewModel.saveWorkflow()},this._onDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteWarningTitle,message:e.deleteWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteFeatureFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepFeature,action:this._clearPrompt}}})},this._onDeleteAssociation=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAssociationTitle,message:e.deleteAssociationMessage,context:"danger",actions:{primary:{label:t.delete,action:()=>{this.deleteAssociationFromWorkflow(),this._clearPrompt()}},secondary:{label:e.keepAssociation,action:this._clearPrompt}}})},this._onToggleUpdateWorkflow=()=>this.viewModel.toggleUpdateWorkflow(),this._onBack=e=>(e?.stopPropagation(),this.viewModel.back()),this._onAttachmentAdd=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type||"update"===e.type&&"create-features"===e.activeWorkflow?.type?(this._attachments.addFile(),e.back()):this._attachments.addAttachment().then((()=>e.back())))},this._onAttachmentUpdate=()=>{const{activeWorkflow:e}=this.viewModel;e&&("create-features"===e.type?(this._attachments.updateFile(),e.back()):this._attachments.updateAttachment().then((()=>e.back())))},this._onAttachmentDelete=()=>{const{messages:e,messagesCommon:t}=this;this._showPrompt({title:e.deleteAttachmentWarningTitle,message:e.deleteAttachmentWarningMessage,context:"danger",actions:{primary:{label:t.delete,action:this._onAttachmentDeleteConfirm},secondary:{label:e.keepAttachment,action:this._clearPrompt}}})},this._onAttachmentDeleteConfirm=async()=>{const e=this._attachments,{activeWorkflow:t}=this.viewModel;t&&("create-features"===t.type?e.deleteFile():(await e.deleteAttachment(e.viewModel.activeAttachmentInfo),this._clearPrompt()),await t.back(),this._clearPrompt())},this._onAttachmentsError=e=>{this._showPrompt({title:this.messages.errorWarningTitle,message:e.message,context:"warning",actions:{primary:{label:this.messagesCommon.form.ok,action:this._clearPrompt}}})}}initialize(){this._featureForm.showPrompt=this._showPrompt,this._featureForm.clearPrompt=this._clearPrompt,this.addHandles([a((()=>Z(this.headingLevel)),(e=>{this._featureForm.headingLevel=e,this._featureTemplates.headingLevel=e}),r),n((()=>this.viewModel.activeWorkflow),"cancel-request",(({controller:e})=>{(this.viewModel.hasPendingEdits?this._showDiscardEditsPrompt():this._showGenericCancelPrompt()).then((t=>t?e.allow():e.deny()))})),l((()=>this.viewModel.featureFormViewModel),(e=>{this._featureForm.viewModel=e}),r),l((()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel),(e=>{this._associationItemList.viewModel=e}),r),l((()=>this.viewModel.utilityNetworkAssociationAddAssociationViewModel?.association),(()=>{this._setUpAssociationSettings()})),a((()=>this.viewModel),(e=>{this._attachments.viewModel=e?.attachmentsViewModel??null,this._featureTemplates.viewModel=e?.featureTemplatesViewModel??null,this._spinner.viewModel=e?.spinnerViewModel??null,e.showDiscardEditsPrompt=this._showDiscardEditsPrompt}),r),a((()=>this.view),((e,t)=>{const s=`editor-${this.id}-spinner`;t?.ui.remove(this._spinner,s),e?.ui.add(this._spinner,{key:s,position:"manual"})}),r),a((()=>[this.supportingWidgetDefaults,this.viewModel.sketchViewModel]),(([e])=>{e&&(this._featureForm.set(e.featureForm),this._attachments.set(e.attachments),this._featureTemplates.set(e.featureTemplates),this.viewModel.sketchViewModel?.set(e.sketch))}),r),l((()=>this._attachments?.error),(e=>this._onAttachmentsError(e))),l((()=>this.viewModel?.failures),(e=>{const{messages:t}=this,[{error:s,retry:o,cancel:i}]=e;this._showPrompt({title:t.errorWarningTitle,message:ee(t.errorWarningMessageTemplate,{errorMessage:s.message}),context:"warning",actions:{primary:{label:t.retry,action:()=>{o(),this._clearPrompt()}},secondary:{label:t.ignore,action:()=>{i(),this._clearPrompt()}}}})})),a((()=>this.viewModel?.state),(e=>{switch(e){case"awaiting-feature-to-update":case"ready":case"disabled":this._filterText="",this._featureTemplates.filterText=""}})),a((()=>this.viewModel.featureFormDisabled),(e=>this._featureForm.disabled=e)),a((()=>this.visibleElements.sketch),(()=>this._setupSketch()),r),J({getLoading:()=>{const{viewModel:e}=this;return e.syncing||e.updating||this._attachments.submitting},setEffectiveLoading:e=>{this._loading=e}})])}destroy(){this._associationItemList.destroy(),this._associationSettings.destroy(),this._attachments.destroy(),this._featureForm.destroy(),this._featureTemplates.destroy(),this._sketchToolbar=t(this._sketchToolbar)}loadDependencies(){return Promise.all([H({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")}),k(),A(),M(),C(),E(),j(),U(),V(),x()])}get _deleteButtonCommonInfo(){return{appearance:"outline",kind:"danger"}}get activeWorkflow(){return this.viewModel.activeWorkflow}get hideTemplatesForInactiveLayers(){return this.viewModel.hideTemplatesForInactiveLayers}set hideTemplatesForInactiveLayers(e){this.viewModel.hideTemplatesForInactiveLayers=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.viewModel.startCreateFeaturesWorkflowAtFeatureTypeSelection()}startCreateFeaturesWorkflowAtFeatureCreation(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureCreation(e)}startCreateFeaturesWorkflowAtFeatureEdit(e){return this.viewModel.startCreateFeaturesWorkflowAtFeatureEdit(e)}startUpdateWorkflowAtFeatureSelection(){return this.viewModel.startUpdateWorkflowAtFeatureSelection()}startUpdateWorkflowAtMultipleFeatureSelection(e){return this.viewModel.startUpdateWorkflowAtMultipleFeatureSelection(e)}startUpdateWorkflowAtFeatureEdit(e){return this.viewModel.startUpdateWorkflowAtFeatureEdit(e)}deleteFeatureFromWorkflow(){return this.viewModel.deleteFeatureFromWorkflow()}deleteAssociationFromWorkflow(){return this.viewModel.deleteAssociationFromWorkflow()}cancelWorkflow(e){return this.viewModel.cancelWorkflow(e)}render(){const{visibleElements:e,viewModel:t}=this,s=this.classes(_.base,q.widget,q.panel);if(!t)return Y("div",{class:s,key:"empty"});const{pageStack:o}=t,i=o.length-1,a=o.map(((e,t)=>this._renderPage(e,t===i)));return Y("div",{class:s,key:"base"},e.flow?Y("calcite-flow",{key:"flow"},a):a,this._prompt?Y(D,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderPage(e,t){const s={selected:t};switch(e){case"disabled":break;case"ready":return this._renderReady(s);case"awaiting-feature-creation-info":return this._renderAwaitingFeatureCreationInfo(s);case"creating-features-upload-details":return this._renderUploadDetails(s);case"creating-features":return this._renderCreatingFeatures(s);case"editing-existing-feature":case"editing-attributes":return this._renderUpdateFeature(s);case"awaiting-update-feature-candidate":return this._renderFeatureList(s);case"adding-attachment":return this._renderAttachmentAdding(s);case"editing-attachment":return this._renderAttachmentEditing(s);case"viewing-associated-layers":case"viewing-associated-features":return this._renderViewAssociatedLayers(s);case"add-association-select-layer":case"add-association-select-feature":return this._renderSelectFeature(s);case"add-association-create-association":return this._renderAddAssociation(s)}return Y("div",{key:"empty-page"})}_renderAwaitingFeatureCreationInfo(e){const{EditorPanel:t,messages:s}=this;return Y(t,{heading:s.selectTemplate,key:"templates-panel",...e},Y(P,{key:"feature-templates"},Y(L,null,this._renderFeatureTemplates())))}_renderUploadDetails(e){const{EditorPanel:t,activeWorkflow:s,messages:o}=this;if("create-features"!==s?.type)return null;const i=s.data.upload;return i?Y(t,{heading:o.createFeatures,key:"upload-details-panel",...e},Y(B,{helpMessage:this._helpMessage,messages:o,upload:i})):null}_renderCreatingFeatures(e){const{EditorPanel:t,activeWorkflow:s,messages:o,messagesCommon:i,headingLevel:a,viewModel:r}=this;if(!s)return null;const n="create-features"===s.type&&s.numPendingFeatures>0||"update"===s.type&&"create-features"===s?.activeWorkflow?.type&&s.activeWorkflow?.numPendingFeatures>0;return Y(t,{heading:o.createFeatures,key:"create-features-panel",...e},n?Y(O,{editorViewModel:r,headingLevel:a,messages:o,messagesCommon:i,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}):Y(b,{helpMessage:this._helpMessage,renderSketchToolbar:this._renderSketch}))}_renderUpdateFeature(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:a}=this;return Y(t,{heading:s.editFeature,key:"update-feature-panel",...e},Y(O,{editorViewModel:a,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_getAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.editFeature;if(e.title)return e.title;const{messagesFeature:s}=this;switch(e.type){case"attachment":return s.associationsAttachments;case"connectivity":return s.associationsConnectivity;case"structure":return s.associationsStructure;case"content":return s.associationsContents;case"container":return s.associationsContainer}}_getAddAssociationTypeTitle(e){const{messages:t}=this;if(!e)return t.editFeature;const s=t.associations;switch(e.type){case"attachment":return s.addAttachment;case"connectivity":return s.addConnectivity;case"structure":return s.addStructure;case"content":return s.addContent;case"container":return s.addContainer}}_renderViewAssociatedLayers(e){const{EditorPanel:t,messages:s,messagesCommon:o,headingLevel:i,viewModel:a}=this,r=a.featureFormViewModel?.activeAssociationInput?.activeAssociationType,n=this._getAssociationTypeTitle(r);return Y(t,{heading:n,key:"viewing-associated-layers-panel",...e},Y(O,{editorViewModel:a,headingLevel:i,messages:s,messagesCommon:o,renderAttachments:this._renderAttachments,renderFeatureForm:this._renderFeatureForm,renderSketchToolbar:this._renderSketch,onDelete:this._onDelete,onDeleteAssociation:this._onDeleteAssociation,onSave:this._onSave}))}_renderSelectFeature(e){const{_associationItemList:t,EditorPanel:s,viewModel:o,messagesCommon:i}=this,a=o.utilityNetworkAssociationAddAssociationViewModel,r=this._getAddAssociationTypeTitle(a?.associationType),n="ready"!==a?.state;return Y(s,{heading:r,key:"add-association-select-feature",...e},Y(P,{key:"select-feature"},Y(L,null,this._renderAssociationItemList())),Y(T,{buttons:[t.filterOptionsVisible?{appearance:"solid",label:i.apply,disabled:n,onClick:()=>t.applyFilterOptions(),type:"button"}:void 0,{appearance:"outline",label:i.cancel,disabled:n,onClick:()=>{"update"===o.activeWorkflow?.type&&o.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_setUpAssociationSettings(){const{viewModel:e,_associationSettings:t}=this,s=e.utilityNetworkAssociationAddAssociationViewModel,o="update"===e.activeWorkflow?.type?e.activeWorkflow:null,i=o?o.activeWorkflow:null,a="add-association"===i?.type?i.fullFeature:null,r=s?.selectedFeature,n=s?.association;a&&r&&n&&(t.sourceFeature=a,t.targetFeature=r,t.association=n)}_renderAddAssociation(e){const{EditorPanel:t,viewModel:s,messagesCommon:o}=this,i=s.utilityNetworkAssociationAddAssociationViewModel,a=this._getAddAssociationTypeTitle(i?.associationType),r="ready"!==i?.state;return Y(t,{heading:a,key:"add-association",...e},Y(P,{key:"add-association-content"},Y(L,null,this._renderAssociationSettings())),Y(T,{buttons:[{label:o.add,disabled:r||!i.canAddAssociation,onClick:()=>this._onSave(),type:"button"},{appearance:"outline",label:o.cancel,disabled:r,onClick:()=>{"update"===s.activeWorkflow?.type&&s.activeWorkflow.cancelActiveWorkflow()},type:"button"}]}))}_renderCustomTemplateGroupContent(e){const{messages:t,viewModel:o}=this,i=s(e.group.items,(e=>o.itemHasInvalidFormTemplate(e)?t.formFieldCreateError:void 0));return i?Y(W,{kind:"warning",message:i}):null}_renderAttachmentAdding(e){const{EditorPanel:t,_attachments:s,messages:o,messagesCommon:i}=this;return Y(t,{heading:o.addAttachment,key:"attachment-adding-panel",...e},Y(P,{key:"attachments"},this._renderAttachments()),Y(T,{buttons:[{label:s.submitting?i.cancel:i.add,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentAdd,type:"button"}]}))}_renderAttachmentEditing(e){const{EditorPanel:t,_attachments:s,activeWorkflow:o,messages:i,messagesCommon:a}=this;return o?Y(t,{heading:i.editAttachment,key:"attachment-editing-panel",...e},Y(P,{key:"attachments"},this._renderAttachments()),o.shouldAllowAttachmentEditing?Y(T,{buttons:[{label:a.update,disabled:s.submitting||!s.selectedFile,onClick:this._onAttachmentUpdate,type:"button"},{...this._deleteButtonCommonInfo,onClick:this._onAttachmentDelete,disabled:s.submitting,label:a.delete,type:"button"}]}):void 0):null}_renderReady(e){const{EditorPanel:t,messages:s,viewModel:o,visibleElements:i}=this,a=this._helpMessage;return Y(t,{heading:s.widgetLabel,key:"landing-panel",...e},Y(P,{key:"landing-content"},o.editorItems.length?[i.editFeaturesSection?Y(L,{key:"edit-actions"},this._renderUpdateActions()):null,i.createFeaturesSection&&o.canCreateVisible?Y(L,{key:"create-actions"},this._renderCreateActions()):null]:Y(S,{key:"no-content"},s.noEditableLayers)),a?Y("div",{class:_.helpMessage,key:"footer-actions",slot:"footer"},a):void 0)}get _helpMessage(){const{activeWorkflow:e,messages:t,view:s}=this,o=e?.helpMessage;return o?t["3d"===s?.type?"helpMessages3d":"helpMessages2d"]?.[o]:void 0}_renderUpdateActions(){const{messages:e,messagesCommon:t,viewModel:s}=this,o={id:"select",label:t.select};return Y("div",{class:_.updateActions,key:"update-actions"},Y(K,{level:Z(this.headingLevel)},e.editFeatures),Y("calcite-list",{class:_.updateActionsList,label:e.editFeaturesList,selectionAppearance:"border",selectionMode:"single"},$({disabled:!s.canUpdateVisible,grouped:!1,item:o,selectedItem:"awaiting-feature-to-update"===s.activeWorkflow?.stepId?o:void 0,renderIcon:this._renderSelectIcon,onItemSelect:this._onToggleUpdateWorkflow})))}_renderCreateActions(){return Y("div",{key:"create-actions"},Y(K,{level:Z(this.headingLevel)},this.messages.createFeatures),Y("div",{class:_.featureTemplatesContainer,key:"templates"},this._renderFeatureTemplates()))}_renderFeatureList(e){const{EditorPanel:t,viewModel:s}=this,{activeWorkflow:o}=s;if("update"!==o?.type)return null;const i=o.data.candidates,a=ee(this.messages.multipleFeaturesTemplate,{total:i.length});return Y(t,{heading:a,key:"feature-list",...e},Y(F,{editorItems:s.editorItems,editorMessages:this.messages,filterText:this._filterText,id:this.id,messagesTemplates:this.messagesTemplates,workflow:o,onFilterTextChange:e=>this._filterText=e,onSelectFeature:(e,t)=>s.selectFeature(e,t),onZoomTo:e=>s.zoomTo(e)}))}_showPromptAndWait({title:e,message:t,yesLabel:s,noLabel:o}){const a=i(),{view:r}=this,n=r?.focused;return this._showPrompt({title:e,message:t,context:"danger",actions:{primary:{label:s,action:()=>a.resolve(!0)},secondary:{label:o,action:()=>a.resolve(!1)}}}),a.promise.finally((()=>{this._clearPrompt(),n&&r?.focus()}))}async _setupSketch(){if(!!!this.visibleElements.sketch)return this._sketchImportAbortController=o(this._sketchImportAbortController),this._sketchToolbar=t(this._sketchToolbar),void this.removeHandles(te);if(this._sketchImportAbortController)return;const e=new AbortController;this._sketchImportAbortController=e;const s=await import("./Sketch.js");if(!e.signal.aborted)try{this._sketchToolbar=new s.default({toolbarKind:"docked",contextualToolLocation:"inline-end",scale:"s",visibleElements:new R({deleteButton:!1,settingsMenu:!1,directionModePicker:!1,selectionCountLabel:!1,duplicateButton:!1,createTools:new G({freehandPolygon:!0,freehandPolyline:!0})})}),this.addHandles([a((()=>this.viewModel.activeLeafWorkflow?.availableCreateTools),(e=>{this._sketchToolbar&&(this._sketchToolbar.availableCreateTools=e)}),r),a((()=>this.visibleElements.undoRedoButtons),(e=>{this._sketchToolbar&&(this._sketchToolbar.visibleElements.undoRedoMenu=e)}),r),l((()=>this.viewModel?.sketchViewModel),(e=>{this._sketchToolbar&&(this._sketchToolbar.viewModel=e)}),r)],te)}finally{this._sketchImportAbortController=null}}get test(){return{sketch:this._sketchToolbar}}};e([c()],se.prototype,"_featureForm",void 0),e([c()],se.prototype,"_sketchToolbar",void 0),e([c()],se.prototype,"_attachments",void 0),e([c()],se.prototype,"_associationItemList",void 0),e([c()],se.prototype,"_associationSettings",void 0),e([c()],se.prototype,"_featureTemplates",void 0),e([c()],se.prototype,"_filterText",void 0),e([c()],se.prototype,"_prompt",void 0),e([c()],se.prototype,"_spinner",void 0),e([c()],se.prototype,"_deleteButtonCommonInfo",null),e([c()],se.prototype,"_loading",void 0),e([c({readOnly:!0})],se.prototype,"activeWorkflow",null),e([c()],se.prototype,"headingLevel",void 0),e([c()],se.prototype,"hideTemplatesForInactiveLayers",null),e([c()],se.prototype,"icon",null),e([c()],se.prototype,"label",null),e([c()],se.prototype,"labelOptions",null),e([c()],se.prototype,"layerInfos",null),e([c(),Q("esri/widgets/Editor/t9n/Editor")],se.prototype,"messages",void 0),e([c(),Q("esri/t9n/common")],se.prototype,"messagesCommon",void 0),e([c(),Q("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],se.prototype,"messagesTemplates",void 0),e([c(),Q("esri/widgets/Feature/t9n/Feature")],se.prototype,"messagesFeature",void 0),e([c()],se.prototype,"snappingOptions",null),e([c()],se.prototype,"tooltipOptions",null),e([c()],se.prototype,"supportingWidgetDefaults",void 0),e([c({type:m,nonNullable:!0})],se.prototype,"valueOptions",null),e([c()],se.prototype,"view",null),e([c(),X(["sketch-create","sketch-delete","sketch-update","workflow-cancel","workflow-commit"])],se.prototype,"viewModel",void 0),e([c({type:y,nonNullable:!0})],se.prototype,"visibleElements",void 0),e([c()],se.prototype,"_helpMessage",null),se=e([d("esri.widgets.Editor")],se);const oe=se;export{oe 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{getFeaturePopupTitle as s}from"../../support/popupUtils.js";import o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import c from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import{isConnectivity as p,isConnectivityMidspan as u,formatPercentAlong as m}from"../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends c{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new d,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),(t=>this._renderTypeList(t,e.get(t))))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter((e=>s(e.featureViewModel).toLowerCase().includes(this.filterText))).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return p(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=s(t),o="loading"===t.state,l=this._findFlowItem(t),r=l<0&&this._isParentFeature(t),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,t)},p(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,u(e.association)?n("calcite-chip",{label:m(e.association),scale:"s",slot:"content-end"},m(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}));else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex((t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)}))??-1}_renderTooltips(e){return e.toArray().map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.toArray().map((e=>this._renderAssociatedFeature(e)))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{key:"show-all",label:e.title,open:!0,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"actions-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([t()],v.prototype,"description",void 0),e([t()],v.prototype,"featureVisibleElements",void 0),e([t()],v.prototype,"flowItems",void 0),e([t()],v.prototype,"flowType",void 0),e([t()],v.prototype,"listType",void 0),e([t()],v.prototype,"parentFeatureViewModel",void 0),e([t()],v.prototype,"title",void 0),e([t({type:d})],v.prototype,"viewModel",void 0),e([t({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([i("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{getFeaturePopupTitle as s}from"../../support/popupUtils.js";import o from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import{loadCalciteComponents as l}from"../support/componentsUtils.js";import{globalCss as r}from"../support/globalCss.js";import"../support/widgetUtils.js";import{tsx as n,tsxFragment as a}from"../support/jsxFactory.js";import c from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import d from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as p,isConnectivityMidspan as u,formatPercentAlong as m}from"../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as h}from"../../intl/substitute.js";var w;const y="esri-feature-utility-network-associations",f={base:y,listItemHidden:`${y}__list-item--hidden`},b="nested";let v=w=class extends d{constructor(e,t){super(e,t),this.description=null,this.flowItems=null,this.flowType="feature-utility-network-association-type",this.listType=null,this.parentFeatureViewModel=null,this.title=null,this.viewModel=new c,this.visibleElements=new o}initialize(){this.setUpObserver()}loadDependencies(){return l({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this.tooltipReferenceMap.clear()}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:s}=this.parentFeatureViewModel??{};return n("div",{class:this.classes(f.base,r.widget)},"loading"===t||"querying"===t||"loading"===s?this.renderLoading():n("calcite-list",{displayMode:b,label:this.selectedLayer?.title??this.messagesCommon.untitled},i&&this.selectedLayer?n(a,null,this.renderFilter(),this.renderFeatureCountWarning(),this._renderAssociatedFeatureListPage(),this.renderFeatureObserver()):Array.from(e.keys(),(t=>this._renderTypeList(t,e.get(t))))))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:s}=this;if(!t||!e)return;i.showAllEnabled=!0;const l=new w({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:s,visibleElements:new o({title:!1,description:!1}),viewModel:i});t.push(l)}_renderAssociatedFeatureListPage(){const e=this.viewModel.associationViewModels.get(this.selectedLayer).filter((e=>s(e.featureViewModel).toLowerCase().includes(this.filterText))).slice(0,this.endIndex);return[...this._renderTooltips(e),...this._renderAssociatedFeatureList(e)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this;return p(e.association)?n("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.featureViewModel.uid)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=s(t),o="loading"===t.state,l=this._findFlowItem(t),r=l<0&&this._isParentFeature(t),a=r||l>=0;return n("calcite-list-item",{class:o?f.listItemHidden:void 0,description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(r,l,t)},p(e.association)?this.renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,u(e.association)?n("calcite-chip",{label:m(e.association),scale:"s",slot:"content-end"},m(e.association)):null,this._renderChevronIconNode(a))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:s}=await import("../Feature.js");t.push(new s({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain((e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()}));else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const e=this.flowItems.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,s=i?.layer;let o=null;"subtype-sublayer"===s?.type&&s.parent?o=s.parent.globalIdField??null:s&&"globalIdField"in s&&(o=s.globalIdField);const l=o?i?.attributes[o]:null,r=t.graphic,n=r?.layer;let a=null;"subtype-sublayer"===n?.type&&n.parent?a=n.parent.globalIdField??null:n&&"globalIdField"in n&&(a=n.globalIdField);const c=a?r?.attributes[a]:null;return l&&c&&l===c}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex((t=>{if("feature-association"!==t.flowType)return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)}))??-1}_renderTooltips(e){return e.toArray().map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.toArray().map((e=>this._renderAssociatedFeature(e)))}_renderChevronIconNode(e){return n("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messagesFeature:i}=this,{displayCount:s}=this.viewModel,o=t.slice(0,s),l=o.length<t.length;return n("calcite-list-item",{key:"show-all",label:e.title,open:!0,value:e.id},n("calcite-chip",{label:String(t.length),scale:"s",slot:"actions-end"},t.length),n("calcite-list",{group:e.id,label:e.title??""},[this._renderTooltips(o),this._renderAssociatedFeatureList(o)],l?n("calcite-list-item",{description:h(i?.numberRecords,{number:t.length.toString()}),key:"show-all-item",label:i.showAll,onCalciteListItemSelect:()=>this._showAllAssociations(e)},n("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};e([t()],v.prototype,"description",void 0),e([t()],v.prototype,"featureVisibleElements",void 0),e([t()],v.prototype,"flowItems",void 0),e([t()],v.prototype,"flowType",void 0),e([t()],v.prototype,"listType",void 0),e([t()],v.prototype,"parentFeatureViewModel",void 0),e([t()],v.prototype,"title",void 0),e([t({type:c})],v.prototype,"viewModel",void 0),e([t({type:o,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=w=e([i("esri.widgets.Feature.FeatureUtilityNetworkAssociationList")],v);const g=v;export{g 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import a from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import l from"./support/FeatureElementInfo.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as d}from"../support/decorators/messageBundle.js";import{tsx as m}from"../support/jsxFactory.js";import u from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";const h="esri-feature-utility-network-associations",y=`${h}__loading-container`,g={base:h,listContainer:`${h}__list`,loadingContainer:y,loadingContainerSticky:`${y}--sticky`};let v=class extends r{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements=new a}initialize(){this._featureElementInfo=new l,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),o)])}loadDependencies(){return c({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(g.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?m("div",{class:g.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return m("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return m("div",{class:g.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return m("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},m("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e),o=this.viewModel.getFeatureCountForAssociationType(e.type);return m("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:i,value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},m("calcite-chip",{label:e.type,scale:"s",slot:"content-end"},o),m("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){return this.viewModel.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return m("div",{class:g.listContainer,key:"list-container"},"ready"===i?m("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map((e=>this._renderAssociations(e)))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([s({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([s()],v.prototype,"flowType",void 0),e([s()],v.prototype,"flowItems",void 0),e([s()],v.prototype,"parentFeatureViewModel",void 0),e([s()],v.prototype,"featureVisibleElements",void 0),e([s()],v.prototype,"description",null),e([s()],v.prototype,"headingLevel",void 0),e([s()],v.prototype,"title",null),e([s({type:u})],v.prototype,"viewModel",void 0),e([s(),d("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([s(),d("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s({type:a,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([n("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);const f=v;export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,initial as o}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import r from"../Widget.js";import a from"./FeatureUtilityNetworkAssociations/VisibleElements.js";import l from"./support/FeatureElementInfo.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{globalCss as p}from"../support/globalCss.js";import"../support/widgetUtils.js";import{messageBundle as d}from"../support/decorators/messageBundle.js";import{tsx as m}from"../support/jsxFactory.js";import u from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";const h="esri-feature-utility-network-associations",y=`${h}__loading-container`,g={base:h,listContainer:`${h}__list`,loadingContainer:y,loadingContainerSticky:`${y}--sticky`};let v=class extends r{constructor(e,t){super(e,t),this._featureElementInfo=null,this.onSelectAssociationType=()=>{},this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=5,this.viewModel=new u,this.messages=null,this.messagesCommon=null,this.visibleElements=new a}initialize(){this._featureElementInfo=new l,this.addHandles([i((()=>[this.viewModel.description,this.viewModel.title,this.headingLevel]),(()=>this._setupFeatureElementInfo()),o)])}loadDependencies(){return c({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}destroy(){this._featureElementInfo=t(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return m("div",{class:this.classes(g.base,p.widget)},this._featureElementInfo?.render(),"loading"===e?this._renderLoading():"disabled"===e?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return"querying"===this.viewModel.state?m("div",{class:g.loadingContainerSticky,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return m("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderLoading(){return m("div",{class:g.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return m("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},m("div",{slot:"message"},this.messages?.noAssociations))}_renderAssociationType(e){const{viewModel:t}=this,i=this._getAssociationTypeTitle(e),o=this.viewModel.getFeatureCountForAssociationType(e.type);return m("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:i,value:e.type,onCalciteListItemSelect:()=>this.onSelectAssociationType({viewModel:t,listType:e,title:i})},m("calcite-chip",{label:e.type,scale:"s",slot:"content-end"},o),m("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderAssociations(e){const{viewModel:t}=this;return"featureForm"===t.source||t.getFeatureCountForAssociationType(e.type)>0?this._renderAssociationType(e):void 0}_renderContent(){const{messages:e,viewModel:t}=this,{state:i,associationTypes:o}=t;return m("div",{class:g.listContainer,key:"list-container"},"ready"===i?m("div",null,m("calcite-list",{displayMode:"flat",label:e?.associationsList},o.map((e=>this._renderAssociations(e))))):null,this._renderStickyLoading())}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}};e([s({constructOnly:!0})],v.prototype,"onSelectAssociationType",void 0),e([s()],v.prototype,"flowType",void 0),e([s()],v.prototype,"flowItems",void 0),e([s()],v.prototype,"parentFeatureViewModel",void 0),e([s()],v.prototype,"featureVisibleElements",void 0),e([s()],v.prototype,"description",null),e([s()],v.prototype,"headingLevel",void 0),e([s()],v.prototype,"title",null),e([s({type:u})],v.prototype,"viewModel",void 0),e([s(),d("esri/widgets/Feature/t9n/Feature")],v.prototype,"messages",void 0),e([s(),d("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([s({type:a,nonNullable:!0})],v.prototype,"visibleElements",void 0),v=e([n("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],v);const f=v;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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";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 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,on as m,whenOnce as _,initial as y}from"../../core/reactiveUtils.js";import{throttle as g}from"../../core/throttle.js";import{property as b}from"../../core/accessorSupport/decorators/property.js";import{cast as w}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import A from"../../geometry/Point.js";import I from"../../geometry/SpatialReference.js";import M from"../../popup/content/TextContent.js";import{getFeaturePopupTitle as x}from"../../support/popupUtils.js";import{system as T}from"../../time/timeZoneUtils.js";import C from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import E from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import V from"./FeatureFields/FeatureFieldsViewModel.js";import j from"./FeatureMedia/FeatureMediaViewModel.js";import k from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as P,formatArcadeValue as R}from"./support/arcadeFeatureUtils.js";import{createFieldInfoMap as L,getAllFieldInfos as O,getSourceLayer as U,querySourceLayer as Z,isRelatableFeatureSupportedLayer as N,isAssociatedFeatureSupportedLayer as B,substituteFieldsInLinksAndAttributes as S,isExpressionField as H,isRelatedField as D,formatEditInfo as G,graphicCallback as q,formatAttributes as z,preLayerQueryCallback as Q,preRequestCallback as J,queryUpdatedFeature as K}from"./support/featureUtils.js";import{queryLayerInfos as W,queryRelatedFeatures as X,setRelatedFeatures as Y,getRelatedFieldInfo as $,createRelatedInfo as ee,updateRelatedInfo as te}from"./support/relatedFeatureUtils.js";import ie from"../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";var se;const oe=1,re="content-view-models",ae="relationship-view-models",ne="association-view-models",le={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let pe=se=class extends(n.IdentifiableMixin(s)){constructor(e){super(e),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._associationVMAbortController=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...le},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=g(this._graphicChanged,(()=>this.notifyChange("waitingForContent")),oe,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=g(this._evaluateExpressionAttributes,(()=>this.notifyChange("waitingForContent")),oe,this),this.addHandles([u((()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone]),(()=>this._graphicChangedThrottled()),y),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()}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return L(O(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return U(this.graphic)}castAbilities(e){return{...le,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??T}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 j&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof j&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof j&&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 Z({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 K({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}),P(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 M({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(ae),this.removeHandles(re),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 se({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(!N(n))return;const c=new k({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(m((()=>c.relatedFeatures),"change",(()=>this._setRelatedFeaturesViewModels(c))),ae),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,s=t?.association.globalId;return null!=i&&null!=s&&i===s}async _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=>{l.some((t=>this._matchesGlobalFeature(t,e)))||l.add({association:e.association,featureViewModel:new se({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:e.feature}),terminalName:e.terminalName})})),e.set(n,l)}));const n=new AbortController;this._associationVMAbortController=n,await this._sortListObjectsByTitle(e,{signal:n.signal}),this._associationVMAbortController===n&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const e=i.map((e=>_((()=>"ready"===e.featureViewModel.state),t?.signal)));await Promise.all(e),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=x(e.featureViewModel),s=x(t.featureViewModel);return i.localeCompare(s,void 0,{numeric:!0})}_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 ie({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)))],ne),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:se.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u((()=>l.contentElementViewModel),(()=>this._setExpressionContentVM(l,t)),y),re),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r}=e;return this.contentViewModels[t]=new C({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 E({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:S({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:S({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&&(H(e)||D(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 V(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 j(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=S({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 E(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?G(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 S({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?q({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?q({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:se.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then((e=>[t,R(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&&D(e.fieldName)));if(!a?.length)return;t.forEach((e=>this._configureRelatedInfo(e,r)));const n=await W({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 X({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach((e=>{Y(l[e]?.value,s.get(e.toString()))}))}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=$(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||ee(o,t);a&&(te({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};pe.interceptor=new i(Q,J),e([b()],pe.prototype,"_error",void 0),e([b()],pe.prototype,"_graphicChangedTask",void 0),e([b()],pe.prototype,"_evaluateExpressionAttributesTask",void 0),e([b()],pe.prototype,"_associationVMAbortController",void 0),e([b({readOnly:!0})],pe.prototype,"_effectivePopupTemplate",null),e([b({readOnly:!0})],pe.prototype,"_fieldInfoMap",null),e([b({readOnly:!0})],pe.prototype,"_sourceLayer",null),e([b()],pe.prototype,"abilities",void 0),e([w("abilities")],pe.prototype,"castAbilities",null),e([b({readOnly:!0})],pe.prototype,"content",void 0),e([b({readOnly:!0})],pe.prototype,"contentViewModels",void 0),e([b()],pe.prototype,"description",void 0),e([b({type:Boolean})],pe.prototype,"defaultPopupTemplateEnabled",void 0),e([b({readOnly:!0})],pe.prototype,"isTable",null),e([b({readOnly:!0})],pe.prototype,"state",null),e([b({readOnly:!0})],pe.prototype,"formattedAttributes",void 0),e([b({type:t,value:null})],pe.prototype,"graphic",null),e([b({readOnly:!0})],pe.prototype,"lastEditInfo",void 0),e([b({type:A})],pe.prototype,"location",void 0),e([b({readOnly:!0})],pe.prototype,"relatedInfos",void 0),e([b({type:I})],pe.prototype,"spatialReference",null),e([b()],pe.prototype,"timeZone",null),e([b({readOnly:!0})],pe.prototype,"title",void 0),e([b()],pe.prototype,"map",null),e([b({readOnly:!0})],pe.prototype,"waitingForContent",null),e([b()],pe.prototype,"view",void 0),pe=se=e([v("esri.widgets.Feature.FeatureViewModel")],pe);const ce=pe;export{ce as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";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 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,on as m,whenOnce as _,initial as y}from"../../core/reactiveUtils.js";import{throttle as g}from"../../core/throttle.js";import{property as b}from"../../core/accessorSupport/decorators/property.js";import{cast as w}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import A from"../../geometry/Point.js";import I from"../../geometry/SpatialReference.js";import M from"../../popup/content/TextContent.js";import{getFeaturePopupTitle as x}from"../../support/popupUtils.js";import{system as T}from"../../time/timeZoneUtils.js";import C from"./FeatureAttachments/FeatureAttachmentsViewModel.js";import E from"./FeatureContent/FeatureContentViewModel.js";import F from"./FeatureExpression/FeatureExpressionViewModel.js";import V from"./FeatureFields/FeatureFieldsViewModel.js";import j from"./FeatureMedia/FeatureMediaViewModel.js";import k from"./FeatureRelationship/FeatureRelationshipViewModel.js";import{compileExpressionInfos as P,formatArcadeValue as R}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as L,preRequestCallback as O,createFieldInfoMap as U,getAllFieldInfos as Z,getSourceLayer as N,querySourceLayer as B,isRelatableFeatureSupportedLayer as S,isAssociatedFeatureSupportedLayer as H,substituteFieldsInLinksAndAttributes as D,isExpressionField as G,isRelatedField as q,formatEditInfo as z,graphicCallback as Q,formatAttributes as J,queryUpdatedFeature as K}from"./support/featureUtils.js";import{queryLayerInfos as W,queryRelatedFeatures as X,setRelatedFeatures as Y,getRelatedFieldInfo as $,createRelatedInfo as ee,updateRelatedInfo as te}from"./support/relatedFeatureUtils.js";import ie from"../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";var se;const oe=1,re="content-view-models",ae="relationship-view-models",ne="association-view-models",le={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let pe=class extends(n.IdentifiableMixin(s)){static{se=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={...le},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=g(this._graphicChanged,(()=>this.notifyChange("waitingForContent")),oe,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=g(this._evaluateExpressionAttributes,(()=>this.notifyChange("waitingForContent")),oe,this),this.addHandles([u((()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone]),(()=>this._graphicChangedThrottled()),y),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(L,O)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return U(Z(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return N(this.graphic)}castAbilities(e){return{...le,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??T}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 j&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof j&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof j&&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 B({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 K({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}),P(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 M({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(ae),this.removeHandles(re),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 se({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 k({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(m((()=>c.relatedFeatures),"change",(()=>this._setRelatedFeaturesViewModels(c))),ae),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,s=t?.association.globalId;return null!=i&&null!=s&&i===s}async _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=>{l.some((t=>this._matchesGlobalFeature(t,e)))||l.add({association:e.association,featureViewModel:new se({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:s,spatialReference:o,timeZone:r,graphic:e.feature}),terminalName:e.terminalName})})),e.set(n,l)}));const n=new AbortController;this._associationVMAbortController=n,await this._sortListObjectsByTitle(e,{signal:n.signal}),this._associationVMAbortController===n&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const e=i.map((e=>_((()=>"ready"===e.featureViewModel.state),t?.signal)));await Promise.all(e),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=x(e.featureViewModel),s=x(t.featureViewModel);return i.localeCompare(s,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{displayCount:i,title:s,description:o,associationTypes:r}=e,{_sourceLayer:a,graphic:n,map:l}=this;if(!H(a))return;const p=new ie({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)))],ne),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:se.interceptor,map:o,spatialReference:r,view:a,location:n});return this.contentViewModels[t]=l,this.addHandles(u((()=>l.contentElementViewModel),(()=>this._setExpressionContentVM(l,t)),y),re),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:o,orderByFields:r}=e;return this.contentViewModels[t]=new C({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 E({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:D({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:s,text:e}),description:D({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&&(G(e)||q(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 V(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 j(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=D({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 E(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?z(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 D({attributes:r,fieldInfoMap:t,globalAttributes:a,expressionAttributes:o,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?Q({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?Q({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:se.interceptor,location:p,map:r,options:{signal:s},spatialReference:n,view:a}).then((e=>[t,R(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]=J({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]=J({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:J({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,Z(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&&q(e.fieldName)));if(!a?.length)return;t.forEach((e=>this._configureRelatedInfo(e,r)));const n=await W({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 X({graphic:e,relatedInfos:s,layer:r},i);Object.keys(l).forEach((e=>{Y(l[e]?.value,s.get(e.toString()))}))}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=$(e.fieldName||"");if(!s)return;const{layerId:o,fieldName:r}=s;if(!o)return;const a=i.get(o.toString())||ee(o,t);a&&(te({relatedInfo:a,fieldName:r,fieldInfo:e}),this.relatedInfos.set(o,a))}};e([b()],pe.prototype,"_error",void 0),e([b()],pe.prototype,"_graphicChangedTask",void 0),e([b()],pe.prototype,"_evaluateExpressionAttributesTask",void 0),e([b()],pe.prototype,"_associationVMAbortController",void 0),e([b({readOnly:!0})],pe.prototype,"_effectivePopupTemplate",null),e([b({readOnly:!0})],pe.prototype,"_fieldInfoMap",null),e([b({readOnly:!0})],pe.prototype,"_sourceLayer",null),e([b()],pe.prototype,"abilities",void 0),e([w("abilities")],pe.prototype,"castAbilities",null),e([b({readOnly:!0})],pe.prototype,"content",void 0),e([b({readOnly:!0})],pe.prototype,"contentViewModels",void 0),e([b()],pe.prototype,"description",void 0),e([b({type:Boolean})],pe.prototype,"defaultPopupTemplateEnabled",void 0),e([b({readOnly:!0})],pe.prototype,"isTable",null),e([b({readOnly:!0})],pe.prototype,"state",null),e([b({readOnly:!0})],pe.prototype,"formattedAttributes",void 0),e([b({type:t,value:null})],pe.prototype,"graphic",null),e([b({readOnly:!0})],pe.prototype,"lastEditInfo",void 0),e([b({type:A})],pe.prototype,"location",void 0),e([b({readOnly:!0})],pe.prototype,"relatedInfos",void 0),e([b({type:I})],pe.prototype,"spatialReference",null),e([b()],pe.prototype,"timeZone",null),e([b({readOnly:!0})],pe.prototype,"title",void 0),e([b()],pe.prototype,"map",null),e([b({readOnly:!0})],pe.prototype,"waitingForContent",null),e([b()],pe.prototype,"view",void 0),pe=se=e([v("esri.widgets.Feature.FeatureViewModel")],pe);const ce=pe;export{ce 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/4.33/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/arcadeOnDemand.js";import{getTimeZoneFormattingOptions as p}from"../../../time/timeZoneUtils.js";const y="esri.widgets.Feature.support.featureUtils",m=()=>e.getLogger(y),g=/href=(""|'')/gi,b=/(\{([^{\r\n]+)\})/g,h=/'/g,I=/^\s*expression\//i,T=/(\n)/gi,w=/[\u00A0-\u9999<>&]/gim,F=/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 E({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 v(e=""){if(e)return!N.test(e.trim().toLowerCase())}function x(e){return!!e&&I.test(e)}function C(e,t){if(!t||!x(t)||!e)return;const n=t.replace(I,"").toLowerCase();return e.find((({name:e})=>e.toLowerCase()===n))}function U(e,t){const n=C(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function q(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}function A(e){return e.replaceAll(g,"")}function M(e,t){const n=$(t,e);return n?n.name:e}function R(e,t){return e&&e.map((e=>M(e,t)))}function $(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function k(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 k(A(t(t(n,(e=>q(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(h,i);t[e]=o}}function G(e,t=!1){const n={...e};return Object.keys(n).forEach((e=>O(e,n,t))),n}function S(e,n,r){const i=(n=k(n))&&"{"!==n[0];return t(e,G(r,i||!1))}function Q(e,t){return e.replaceAll(b,((e,n,r)=>{const i=$(t,r);return i?`{${i.name}}`:n}))}function P(e,t,n){const r=Q(e,n);return r?r.replaceAll(F,((e,n,r)=>S(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-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function B(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 J(e){return!!(e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"type"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 H(e)&&B(e)}function V(e){return H(e)&&J(e)}function W(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&K(e.sourceLayer)}function X(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:l,layer:u,timeZone:s}=t,c=te(n,r),d=$(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?Y(e,p):"string"==typeof(e=_(e,p))||null==e||null==p?ue(e):i(e,l?{...o(p),minimumFractionDigits:0,maximumFractionDigits:20}:o(p))}function Y(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?ee(e,",",", ",t):e.includes(";")?ee(e,";","; ",t):e.includes(" ")?ee(e," "," ",t):i(Number(e),o(t))}function ee(e,t,n,r){return e.trim().split(t).map((e=>i(Number(e),o(r)))).join(n)}function te(e,t){if(e?.length&&t)return e.find((e=>e.fieldName?.toLowerCase()===t.toLowerCase()))}function ne({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 re({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 ie(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 oe(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 ae(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 le(e){return e.replaceAll(w,(e=>`&#${e.charCodeAt(0)};`))}function ue(e){return"string"==typeof e?e.replaceAll(T,'<br class="esri-text-new-line" />'):e}function se(e){const{value:t,fieldName:n,fieldInfos:r,fieldInfoMap:i,layer:o,graphic:a,timeZone:l}=e;if(null==t)return"";const s=re({fieldName:n,value:t,graphic:a,layer:o});if(s)return s;const d=ne({fieldName:n,graphic:a,layer:o});if(d)return d;if(i.get(n.toLowerCase()))return X(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}}):ue(t)}function fe({fieldInfos:e,attributes:t,layer:n,graphic:r,fieldInfoMap:i,relatedInfos:o,timeZone:a}){const l={};return o?.forEach((t=>be({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:n,timeZone:a}))),t&&Object.keys(t).forEach((o=>{const u=t[o];l[o]=se({fieldName:o,fieldInfos:e,fieldInfoMap:i,layer:n,value:u,graphic:r,timeZone:a})})),l}async function ce(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 de(e){if(!e.expressionInfos?.length)return!1;const t=await d(),{arcadeUtils:{hasGeometryFunctions: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=await t.getRequiredFields(n.fieldsIndex),f=l(s,e),c=f?[]:s.includes(o)?s:[...s,o],d=t.returnGeometry||await de(t);if(f&&!d)return;const p=await ce({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`${j}${e.layerId}/${e.fieldName}`}function ge({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]=se({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:o,value:s,graphic:t,timeZone:a})}))}function be({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}){e&&t&&(t.relatedFeatures?.forEach((a=>ge({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}))),t.relatedStatsFeatures?.forEach((a=>ge({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}))))}const he=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},Ie=({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;he(r)||he(i)||"extent"===o?.type||"tile"===n.resultType||(n.cacheHint=!0)},Te=({query:e,layer:t,method:n})=>{Ie({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},we=({queryPayload:e,layer:t,method:n})=>{Ie({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Fe(e,t,n){return e&&t&&n?"sublayer"===t.type?Ze({layers:t.layer?.sublayers,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(!K(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}function Le(e){const t=e.getObjectId();return null!=t?`oid:${t}`:`uid:${e.uid}`}export{ue as applyTextFormattingHTML,oe as createFieldInfoMap,Fe as findRelatedLayer,Ne as findUtilityNetwork,Q as fixTokens,fe as formatAttributes,ie as formatEditInfo,X as formatValueToFieldInfo,ae as getAllFieldInfos,te as getFieldInfo,U as getFieldInfoLabel,M as getFixedFieldName,R as getFixedFieldNames,Le as getHighlightKeyForFeature,L as getSourceLayer,E as graphicCallback,le as htmlEntities,V as isAssociatedFeatureSupportedLayer,J as isAssociatedLayer,x as isExpressionField,H as isFeatureSupportedLayer,W as isGraphicForRelatableFeatureSupportedLayer,K as isRelatableFeatureSupportedLayer,B as isRelatableLayer,ye as isRelatedField,Te as preLayerQueryCallback,we as preRequestCallback,ce as querySourceLayer,pe as queryUpdatedFeature,v 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{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/arcadeOnDemand.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,T=/[\u00A0-\u9999<>&]/gim,F=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,j=/^(?:mailto:|tel:)/,N="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!j.test(e.trim().toLowerCase())}function E(e){return!!e&&h.test(e)}function v(e,t){if(!t||!E(t)||!e)return;const n=t.replace(h,"").toLowerCase();return e.find((({name:e})=>e.toLowerCase()===n))}function C(e,t){const n=v(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function U(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}function A(e){return e.replaceAll(b,"")}function M(e,t){const n=$(t,e);return n?n.name:e}function R(e,t){return e&&e.map((e=>M(e,t)))}function $(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function k(e){return`${e}`.trim()}function D({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:o}){return r?O({formattedAttributes:t,template:P(r,{...t,...i,...e},n),fieldInfoMap:o}):""}function O({formattedAttributes:e,template:n,fieldInfoMap:r}){return k(A(t(t(n,(e=>U(e,r))),e)))}function z(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 G(e,t=!1){const n={...e};return Object.keys(n).forEach((e=>z(e,n,t))),n}function S(e,n,r){const i=(n=k(n))&&"{"!==n[0];return t(e,G(r,i||!1))}function Q(e,t){return e.replaceAll(g,((e,n,r)=>{const i=$(t,r);return i?`{${i.name}}`:n}))}function P(e,t,n){const r=Q(e,n);return r?r.replaceAll(F,((e,n,r)=>S(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-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function B(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 J(e){return H(e)&&B(e)}function K(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 V(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&J(e.sourceLayer)}function W(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:l,layer:u,timeZone:s}=t,c=ee(n,r),d=$(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(pe(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(pe(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(T,(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 W(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=>be({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({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=await t.getRequiredFields(n.fieldsIndex),f=l(s,e),c=f?[]:s.includes(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 pe(e=""){return!!e&&e.includes(N)}function ye(e){return`${N}${e.layerId}/${e.fieldName}`}function me({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=ye({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 be({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}){e&&t&&(t.relatedFeatures?.forEach((a=>me({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}))),t.relatedStatsFeatures?.forEach((a=>me({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:o}))))}const ge=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},Ie=({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;ge(r)||ge(i)||"extent"===o?.type||"tile"===n.resultType||(n.cacheHint=!0)},he=({query:e,layer:t,method:n})=>{Ie({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},we=({queryPayload:e,layer:t,method:n})=>{Ie({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Te(e,t,n){return e&&t&&n?"sublayer"===t.type?Ne({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:n})||Ne({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):Ne({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||Ne({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function Fe(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 Ne({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=Ne({layers:o.sublayers,map:e,relatedLayer:r,relationship:t})||Ne({layers:o.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!J(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}function Ze(e){const t=e.getObjectId();return null!=t?`oid:${t}`:`uid:${e.uid}`}export{le as applyTextFormattingHTML,ie as createFieldInfoMap,Te as findRelatedLayer,Fe as findUtilityNetwork,Q as fixTokens,se as formatAttributes,re as formatEditInfo,W as formatValueToFieldInfo,oe as getAllFieldInfos,ee as getFieldInfo,C as getFieldInfoLabel,M as getFixedFieldName,R as getFixedFieldNames,Ze as getHighlightKeyForFeature,L as getSourceLayer,q as graphicCallback,ae as htmlEntities,K as isAssociatedFeatureSupportedLayer,E as isExpressionField,H as isFeatureSupportedLayer,V as isGraphicForRelatableFeatureSupportedLayer,J as isRelatableFeatureSupportedLayer,B as isRelatableLayer,pe as isRelatedField,he as preLayerQueryCallback,we as preRequestCallback,fe as querySourceLayer,de as queryUpdatedFeature,x as shouldOpenInNewTab,O as substituteAttributes,D 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/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{getFeatureFormTitle as i}from"../featureFormUtils.js";import o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{globalCss as n}from"../../support/globalCss.js";import{Heading as c}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as l}from"../../support/decorators/messageBundle.js";import{tsx as p,tsxFragment as d}from"../../support/jsxFactory.js";import u from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import m from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js";import{isConnectivity as h,isConnectivityMidspan as y,formatPercentAlong as g}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as F}from"../../../intl/substitute.js";const f="esri-feature-form-utility-network-association-list",_={base:f,header:`${f}__header`,headingContent:`${f}__heading-content`,listContainer:`${f}__list-container`};let L=class extends u{constructor(e,t){super(e,t),this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=()=>{},this.viewModel=new m}initialize(){this.setUpObserver()}loadDependencies(){return a({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:e}=this;if(!e)return 0;const{associatedFeatureInfos:t,associatedLayer:s}=e,i=s?t.get(s):null;return i?i.length:0}render(){const{associationInput:e}=this;if(!e)return p("div",{class:this.classes(_.base,n.widget)});const{associatedLayer:t}=e,{state:s}=this.viewModel;return p("div",{class:this.classes(_.base,n.widget)},"loading"===s||"querying"===s||"refreshing"===s?this.renderLoading():t?this._renderFeatureList(e,t):this._renderLayerList(e))}_renderLayerList(e){const{associatedFeatureInfos:t}=e;return p("div",{class:_.listContainer},p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(t.keys(),(t=>this._renderLayerItem(e,t)))))}_renderFeatureList(e,t){return p(d,null,this._renderHeader(e,t),p("div",{class:_.listContainer},this.renderFeatureCountWarning(),p("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(e,t),this.renderFeatureObserver())))}_renderLayerTitle(e){return e.title?p(c,{key:"title",level:this.headingLevel},p("div",{class:_.headingContent},p("calcite-icon",{icon:"layer"}),e.title)):null}_renderTotal(e,t){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=e,o=i.get(t),r=F(s?.numberRecords,{number:o?.length??"0"});return p("div",{key:t.id},r)}_renderHeader(e,t){const{messagesFeatureForm:s}=this,{activeAssociationType:i,feature:o}=e;return p("div",{class:_.header,key:"filter"},p(r,{associationType:i?.type,feature:o,messages:s.associations}),this._renderLayerTitle(t),this.renderFilter(),this._renderTotal(e,t))}_renderAssociatedFeatureListPage(e,t){const{filterText:s,endIndex:o}=this,r=e.associatedFeatureInfos.get(t)?.filter((e=>i(e).toLowerCase().includes(s))).slice(0,o).toArray()??[];return[...this._renderTooltips(r),...this._renderAssociatedFeatureList(r)]}_renderItemTooltip(e){const{tooltipReferenceMap:t}=this,s=e.feature.uid.toString();return h(e.association)?p("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:t.get(s)},this.getConnectivityTooltip(e.association.associationType)):null}_renderAssociatedFeature(e){const t=i(e),s=e.feature.uid.toString();return p("calcite-list-item",{description:e.terminalName??"",key:`associated-feature-type-${s}`,label:t,onCalciteListItemSelect:()=>this._selectAssociation(e)},h(e.association)?this.renderConnectivityIcon(e.association.associationType,s):null,y(e.association)?p("calcite-chip",{label:g(e.association),scale:"s",slot:"content-end"},g(e.association)):null,p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(e){return e.map((e=>this._renderItemTooltip(e)))}_renderAssociatedFeatureList(e){return e.map((e=>this._renderAssociatedFeature(e)))}_renderLayerItem(e,t){const{associatedFeatureInfos:s}=e,i=s.get(t)?.length??0;return p("calcite-list-item",{key:`${t.id}-show-all`,label:t.title??this.messagesCommon.untitled,open:!0,value:t.id,onCalciteListItemSelect:()=>this._showAllAssociations(t)},p("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),p("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_selectAssociation(e){this.onSelectFeature({feature:e.feature,association:e.association})}_showAllAssociations(e){this.onSelectLayer({layer:e,associationInput:this.associationInput})}};e([t()],L.prototype,"associatedFeatureCount",null),e([t({type:o})],L.prototype,"associationInput",void 0),e([t()],L.prototype,"headingLevel",void 0),e([t(),l("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),e([t({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),e([t({type:m})],L.prototype,"viewModel",void 0),L=e([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const v=L;export{v as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../intl.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{getFeatureFormTitle as i}from"../featureFormUtils.js";import o from"../UtilityNetworkAssociationInput.js";import{AssociationDetails as r}from"./AssociationDetails.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{globalCss as n}from"../../support/globalCss.js";import{Heading as c}from"../../support/Heading.js";import"../../support/widgetUtils.js";import{messageBundle as l}from"../../support/decorators/messageBundle.js";import{tsx as d,tsxFragment as p}from"../../support/jsxFactory.js";import u from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";import m from"../../support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js";import{isConnectivity as h,isConnectivityMidspan as y,formatPercentAlong as g}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";import{substitute as F}from"../../../intl/substitute.js";const f="esri-feature-form-utility-network-association-list",_={base:f,header:`${f}__header`,headingContent:`${f}__heading-content`,listContainer:`${f}__list-container`};let L=class extends m{constructor(t,e){super(t,e),this._isLoadingSelectFeature=!1,this.associationInput=null,this.headingLevel=5,this.messagesFeatureForm=null,this.onSelectLayer=()=>{},this.onSelectFeature=async()=>{},this.onAddAssociation=()=>{},this.viewModel=new u}initialize(){this.setUpObserver()}loadDependencies(){return a({chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get associatedFeatureCount(){const{associationInput:t}=this;if(!t)return 0;const{associatedFeatureInfos:e,associatedLayer:s}=t,i=s?e.get(s):null;return i?i.length:0}render(){const{associationInput:t}=this;if(!t)return d("div",{class:this.classes(_.base,n.widget)});const{associatedLayer:e}=t,{state:s}=this.viewModel;return d("div",{class:this.classes(_.base,n.widget)},"loading"===s||"querying"===s?this.renderLoading():e?this._renderFeatureList(t,e):this._renderLayerList(t))}_renderLayerList(t){const{associatedFeatureInfos:e}=t;return d("div",{class:_.listContainer},d("calcite-list",{label:this.messagesFeatureForm?.associations.associatedLayers},Array.from(e.keys(),(e=>this._renderLayerItem(t,e)))),d("calcite-fab",{appearance:"outline-fill",icon:"plus",key:`${t.uid}-add-button`,kind:"neutral",onclick:()=>this.onAddAssociation({feature:t.feature,associationType:t.activeAssociationType,utilityNetwork:t.utilityNetwork}),text:this.messagesCommon.add,textEnabled:!0}))}_renderFeatureList(t,e){return d(p,null,this._renderHeader(t,e),d("div",{class:_.listContainer},this.renderFeatureCountWarning(),d("calcite-list",{label:this.messagesFeatureForm?.associations.associatedFeatures},this._renderAssociatedFeatureListPage(t,e),this.renderFeatureObserver())))}_renderLayerTitle(t){return t.title?d(c,{key:"title",level:this.headingLevel},d("div",{class:_.headingContent},d("calcite-icon",{icon:"layer"}),t.title)):null}_renderTotal(t,e){const{messagesFeature:s}=this,{associatedFeatureInfos:i}=t,o=i.get(e),r=F(s?.numberRecords,{number:o?.length??"0"});return d("div",{key:e.id},r)}_renderHeader(t,e){const{messagesFeatureForm:s}=this,{activeAssociationType:i,feature:o}=t;return d("div",{class:_.header,key:"filter"},d(r,{associationType:i?.type,feature:o,messages:s.associations}),this._renderLayerTitle(e),this.renderFilter(),this._renderTotal(t,e))}_renderAssociatedFeatureListPage(t,e){const{filterText:s,endIndex:o}=this,r=t.associatedFeatureInfos.get(e)?.filter((t=>i(t).toLowerCase().includes(s))).slice(0,o).toArray()??[];return[...this._renderTooltips(r),...this._renderAssociatedFeatureList(r)]}_renderItemTooltip(t){const{tooltipReferenceMap:e}=this,s=t.feature.uid.toString();return h(t.association)?d("calcite-tooltip",{key:`tooltip-${s}`,overlayPositioning:"fixed",referenceElement:e.get(s)},this.getConnectivityTooltip(t.association.associationType)):null}_renderAssociatedFeature(t){const e=i(t),s=t.feature.uid.toString();return d("calcite-list-item",{description:t.terminalName??"",key:`associated-feature-type-${s}`,label:e,onCalciteListItemSelect:()=>this._selectAssociation(t)},h(t.association)?this.renderConnectivityIcon(t.association.associationType,s):null,y(t.association)?d("calcite-chip",{label:g(t.association),scale:"s",slot:"content-end"},g(t.association)):null,d("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderTooltips(t){return t.map((t=>this._renderItemTooltip(t)))}_renderAssociatedFeatureList(t){return t.map((t=>this._renderAssociatedFeature(t)))}_renderLayerItem(t,e){const{associatedFeatureInfos:s}=t,i=s.get(e)?.length??0;return d("calcite-list-item",{key:`${e.id}-show-all`,label:e.title??this.messagesCommon.untitled,open:!0,value:e.id,onCalciteListItemSelect:()=>this._showAllAssociations(e)},d("calcite-chip",{label:i.toString(),scale:"s",slot:"content-end"},i),d("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async _selectAssociation(t){this._isLoadingSelectFeature||(this._isLoadingSelectFeature=!0,await this.onSelectFeature({feature:t.feature,association:t.association}),this._isLoadingSelectFeature=!1)}_showAllAssociations(t){this.onSelectLayer({layer:t,associationInput:this.associationInput})}};t([e()],L.prototype,"associatedFeatureCount",null),t([e({type:o})],L.prototype,"associationInput",void 0),t([e()],L.prototype,"headingLevel",void 0),t([e(),l("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),t([e({constructOnly:!0})],L.prototype,"onSelectLayer",void 0),t([e({constructOnly:!0})],L.prototype,"onSelectFeature",void 0),t([e({constructOnly:!0})],L.prototype,"onAddAssociation",void 0),t([e({type:u})],L.prototype,"viewModel",void 0),L=t([s("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationList")],L);const v=L;export{v as default};