@arcgis/core 4.33.0-next.20250415 → 4.33.0-next.20250417

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 (447) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/analysis/DimensionAnalysis.js +1 -1
  4. package/analysis/DirectLineMeasurementAnalysis.js +1 -1
  5. package/analysis/LengthDimension.js +1 -1
  6. package/analysis/LineOfSightAnalysis.js +1 -1
  7. package/analysis/SliceAnalysis.js +1 -1
  8. package/analysis/Viewshed.js +1 -1
  9. package/analysis/ViewshedAnalysis.js +1 -1
  10. package/assets/components/assets/icon/browserJoin16.json +1 -0
  11. package/assets/components/assets/icon/browserJoin24.json +1 -0
  12. package/assets/components/assets/icon/browserJoin32.json +1 -0
  13. package/assets/components/assets/icon/browserPlus16.json +1 -0
  14. package/assets/components/assets/icon/browserPlus24.json +1 -0
  15. package/assets/components/assets/icon/browserPlus32.json +1 -0
  16. package/assets/components/assets/icon/check16.json +1 -1
  17. package/assets/components/assets/icon/check24.json +1 -1
  18. package/assets/components/assets/icon/check32.json +1 -1
  19. package/assets/components/assets/icon/classroomGis16.json +1 -0
  20. package/assets/components/assets/icon/classroomGis24.json +1 -0
  21. package/assets/components/assets/icon/classroomGis32.json +1 -0
  22. package/assets/components/assets/icon/documentLearning16.json +1 -0
  23. package/assets/components/assets/icon/documentLearning24.json +1 -0
  24. package/assets/components/assets/icon/documentLearning32.json +1 -0
  25. package/assets/components/assets/icon/doubleFloatSet16.json +1 -0
  26. package/assets/components/assets/icon/doubleFloatSet24.json +1 -0
  27. package/assets/components/assets/icon/doubleFloatSet32.json +1 -0
  28. package/assets/components/assets/icon/eLearningGis16.json +1 -0
  29. package/assets/components/assets/icon/eLearningGis24.json +1 -0
  30. package/assets/components/assets/icon/eLearningGis32.json +1 -0
  31. package/assets/components/assets/icon/language216.json +1 -0
  32. package/assets/components/assets/icon/language224.json +1 -0
  33. package/assets/components/assets/icon/language232.json +1 -0
  34. package/assets/components/assets/icon/layerSet16.json +1 -0
  35. package/assets/components/assets/icon/layerSet24.json +1 -0
  36. package/assets/components/assets/icon/layerSet32.json +1 -0
  37. package/assets/components/assets/icon/learningGisWorkflow16.json +1 -0
  38. package/assets/components/assets/icon/learningGisWorkflow24.json +1 -0
  39. package/assets/components/assets/icon/learningGisWorkflow32.json +1 -0
  40. package/assets/components/assets/icon/learningSteps16.json +1 -0
  41. package/assets/components/assets/icon/learningSteps24.json +1 -0
  42. package/assets/components/assets/icon/learningSteps32.json +1 -0
  43. package/assets/components/assets/icon/learningWebCourse16.json +1 -0
  44. package/assets/components/assets/icon/learningWebCourse24.json +1 -0
  45. package/assets/components/assets/icon/learningWebCourse32.json +1 -0
  46. package/assets/components/assets/icon/mapInformation16.json +1 -0
  47. package/assets/components/assets/icon/mapInformation24.json +1 -0
  48. package/assets/components/assets/icon/mapInformation32.json +1 -0
  49. package/assets/components/assets/icon/mooc16.json +1 -0
  50. package/assets/components/assets/icon/mooc24.json +1 -0
  51. package/assets/components/assets/icon/mooc32.json +1 -0
  52. package/assets/components/assets/icon/multipleVariablesSet16.json +1 -0
  53. package/assets/components/assets/icon/multipleVariablesSet24.json +1 -0
  54. package/assets/components/assets/icon/multipleVariablesSet32.json +1 -0
  55. package/assets/components/assets/icon/parameters16.json +1 -0
  56. package/assets/components/assets/icon/parameters24.json +1 -0
  57. package/assets/components/assets/icon/parameters32.json +1 -0
  58. package/assets/components/assets/icon/parametersGear16.json +1 -0
  59. package/assets/components/assets/icon/parametersGear24.json +1 -0
  60. package/assets/components/assets/icon/parametersGear32.json +1 -0
  61. package/assets/components/assets/icon/parametersPlus16.json +1 -0
  62. package/assets/components/assets/icon/parametersPlus24.json +1 -0
  63. package/assets/components/assets/icon/parametersPlus32.json +1 -0
  64. package/assets/components/assets/icon/storymapExperience16.json +1 -0
  65. package/assets/components/assets/icon/storymapExperience24.json +1 -0
  66. package/assets/components/assets/icon/storymapExperience32.json +1 -0
  67. package/assets/components/assets/icon/stringSet16.json +1 -0
  68. package/assets/components/assets/icon/stringSet24.json +1 -0
  69. package/assets/components/assets/icon/stringSet32.json +1 -0
  70. package/assets/components/assets/icon/tableSet16.json +1 -0
  71. package/assets/components/assets/icon/tableSet24.json +1 -0
  72. package/assets/components/assets/icon/tableSet32.json +1 -0
  73. package/assets/components/assets/icon/variablePlus16.json +1 -0
  74. package/assets/components/assets/icon/variablePlus24.json +1 -0
  75. package/assets/components/assets/icon/variablePlus32.json +1 -0
  76. package/assets/components/assets/icon/videoLearning16.json +1 -0
  77. package/assets/components/assets/icon/videoLearning24.json +1 -0
  78. package/assets/components/assets/icon/videoLearning32.json +1 -0
  79. package/assets/esri/core/workers/RemoteClient.js +1 -1
  80. package/assets/esri/core/workers/chunks/05cba30c0d3855de7a65.js +1 -0
  81. package/assets/esri/core/workers/chunks/{7ef9bcd58af499a14a08.js → 089a19381b66cd074425.js} +1 -1
  82. package/assets/esri/core/workers/chunks/0be7a0f4c4f4f91d1957.js +1 -0
  83. package/assets/esri/core/workers/chunks/0c6f2808c57ff820bfdd.js +2 -0
  84. package/assets/esri/core/workers/chunks/{baed733a29aa65efc2a0.js.LICENSE.txt → 0c6f2808c57ff820bfdd.js.LICENSE.txt} +7 -1
  85. package/assets/esri/core/workers/chunks/103c78c8bfdb56227bc0.js +1 -0
  86. package/assets/esri/core/workers/chunks/184d7c8ea818bec5c462.js +1 -0
  87. package/assets/esri/core/workers/chunks/{4523ba4a3c8987abca56.js → 1c75f7e4d2e9c8e377e7.js} +1 -1
  88. package/assets/esri/core/workers/chunks/1e1c3243ac82c969bb1f.js +1 -0
  89. package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +1 -0
  90. package/assets/esri/core/workers/chunks/25142d431dd1e5e82234.js +1 -0
  91. package/assets/esri/core/workers/chunks/25e19bd171eeb5634a4f.js +1 -0
  92. package/assets/esri/core/workers/chunks/26924d2f03b8a1b7a9b2.js +1 -0
  93. package/assets/esri/core/workers/chunks/27482132abb939a1cdb7.js +1 -0
  94. package/assets/esri/core/workers/chunks/2ae1dbdac9f24f4a3c84.js +1 -0
  95. package/assets/esri/core/workers/chunks/{984c5047ab1fa632ca09.js → 2db5dd5638c93b0af102.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ed517687b3728fd2eb64.js → 2fd5b48976cefe7cc0ab.js} +1 -1
  97. package/assets/esri/core/workers/chunks/31b2ceed80796c7f6c03.js +1 -0
  98. package/assets/esri/core/workers/chunks/3521a53f826f0ce6ac33.js +1 -0
  99. package/assets/esri/core/workers/chunks/3697ec74522cc5059098.js +1 -0
  100. package/assets/esri/core/workers/chunks/{60472225a228e499b1a2.js → 38557792ff9516fc991b.js} +1 -1
  101. package/assets/esri/core/workers/chunks/388a763da712ca71ccf4.js +1 -0
  102. package/assets/esri/core/workers/chunks/38f9ede26098eb03ca2d.js +2 -0
  103. package/assets/esri/core/workers/chunks/{239821543abbd63c5787.js.LICENSE.txt → 38f9ede26098eb03ca2d.js.LICENSE.txt} +3 -3
  104. package/assets/esri/core/workers/chunks/3b8eee013d7ca156ef2d.js +1 -0
  105. package/assets/esri/core/workers/chunks/{7f86c9ec45f4fae1fb49.js → 3ee505f9ddb671dcfa52.js} +1 -1
  106. package/assets/esri/core/workers/chunks/3f3a2c6ce48d832bf2f1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{82493f51a2182f76dd2f.js → 459e3e507e8ea3e7e6ab.js} +1 -1
  108. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +1 -0
  109. package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +1 -0
  110. package/assets/esri/core/workers/chunks/53eaad20c4f55dae21e0.js +1 -0
  111. package/assets/esri/core/workers/chunks/55eff05354069f34bb1d.js +1 -0
  112. package/assets/esri/core/workers/chunks/569e9ec636199d1f1744.js +1 -0
  113. package/assets/esri/core/workers/chunks/598fade09fa4da759ac2.js +1 -0
  114. package/assets/esri/core/workers/chunks/5ac3096139e3eafd0e1d.js +1 -0
  115. package/assets/esri/core/workers/chunks/{93d06a1a0b700ddb3807.js → 5bdd5ae2d2f23ef6b331.js} +1 -1
  116. package/assets/esri/core/workers/chunks/5db336767959507c07e5.js +2 -0
  117. package/assets/esri/core/workers/chunks/{c03bffa13841e4f80379.js.LICENSE.txt → 5db336767959507c07e5.js.LICENSE.txt} +2 -2
  118. package/assets/esri/core/workers/chunks/5e5225623977e61fd0ef.js +1 -0
  119. package/assets/esri/core/workers/chunks/642a595353a86f3717e3.js +1 -0
  120. package/assets/esri/core/workers/chunks/64640051f1fd787a3362.js +1 -0
  121. package/assets/esri/core/workers/chunks/6d230c55cde66ee905b3.js +1 -0
  122. package/assets/esri/core/workers/chunks/{c1bd47cde53918f454ca.js → 729407e372c8353cf871.js} +1 -1
  123. package/assets/esri/core/workers/chunks/{029705c229ccf2e6b78d.js → 736a11e64e5f03e3936b.js} +39 -38
  124. package/assets/esri/core/workers/chunks/769b66cca8347f0f84db.js +1 -0
  125. package/assets/esri/core/workers/chunks/7c4746f60332620f75c5.js +1 -0
  126. package/assets/esri/core/workers/chunks/{b6dd25bccb9f6e19c18e.js → 7c7ff11246479382974c.js} +1 -1
  127. package/assets/esri/core/workers/chunks/7fce62ef3f0b011e0d35.js +1 -0
  128. package/assets/esri/core/workers/chunks/814d72abbfdd4552e4ec.js +2 -0
  129. package/assets/esri/core/workers/chunks/{373782e9f5d61616fde4.js.LICENSE.txt → 814d72abbfdd4552e4ec.js.LICENSE.txt} +1 -6
  130. package/assets/esri/core/workers/chunks/{3a84ee5d0434362286a6.js → 873327fc41edd3830afa.js} +4 -4
  131. package/assets/esri/core/workers/chunks/8ea182c2fc20dba79ef2.js +1 -0
  132. package/assets/esri/core/workers/chunks/{d58fae2fc9d148e015ae.js → 90dc783a617ff053e862.js} +1 -1
  133. package/assets/esri/core/workers/chunks/93e9dfd1ba8f393c6c47.js +1 -0
  134. package/assets/esri/core/workers/chunks/93f792f5b94f3745b57d.js +2 -0
  135. package/assets/esri/core/workers/chunks/{3845e1d47bb51c06682e.js.LICENSE.txt → 93f792f5b94f3745b57d.js.LICENSE.txt} +1 -1
  136. package/assets/esri/core/workers/chunks/a197c86d42cc9ce21924.js +1 -0
  137. package/assets/esri/core/workers/chunks/a276980c06d5d311a37e.js +1 -0
  138. package/assets/esri/core/workers/chunks/a600194cfe26aedc21dd.js +1 -0
  139. package/assets/esri/core/workers/chunks/{a4239e301728d594afa5.js → a6b14665a46c2af5ac11.js} +1 -1
  140. package/assets/esri/core/workers/chunks/ae156b99e60a2bf940e4.js +1 -0
  141. package/assets/esri/core/workers/chunks/afcb12bf54a5656f641e.js +2 -0
  142. package/assets/esri/core/workers/chunks/{75e01c6404cbd51daabc.js.LICENSE.txt → afcb12bf54a5656f641e.js.LICENSE.txt} +1 -1
  143. package/assets/esri/core/workers/chunks/b2f1d1721a9dd88a1adf.js +1 -0
  144. package/assets/esri/core/workers/chunks/{4275dcec730a11173661.js → b7fc99ec15e2c86a6425.js} +1 -1
  145. package/assets/esri/core/workers/chunks/b8248939373e25a8d6db.js +1 -0
  146. package/assets/esri/core/workers/chunks/bbaadce582df7e20397b.js +1 -0
  147. package/assets/esri/core/workers/chunks/{18404cd87d29b2bdc7bf.js → c4dba6cf17aece714d22.js} +1 -1
  148. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js +2 -0
  149. package/assets/esri/core/workers/chunks/{e4d522ade82192f32d54.js.LICENSE.txt → c5d786166a5609b85276.js.LICENSE.txt} +1 -1
  150. package/assets/esri/core/workers/chunks/{f4111bb5e5a4910b684a.js → c616139a160eab9cd717.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{c589d32f8efcca6bf712.js → c6b08fdc0421258efcf5.js} +1 -1
  152. package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +1 -0
  153. package/assets/esri/core/workers/chunks/{eb61e484f090fca28937.js → cb2be1a81bdd3443f758.js} +1 -1
  154. package/assets/esri/core/workers/chunks/ccc50f28f217e50cc2c3.js +1 -0
  155. package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +1 -0
  156. package/assets/esri/core/workers/chunks/{df1225a3e751a662c182.js → d04efa51da9b4eb3a8a7.js} +1 -1
  157. package/assets/esri/core/workers/chunks/d434d44916d32d4b10d5.js +1 -0
  158. package/assets/esri/core/workers/chunks/{50c1753ee3dc0d28ffd7.js → d696abbb1b13ac1a689b.js} +1 -1
  159. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js +2 -0
  160. package/assets/esri/core/workers/chunks/dbaa4b8d37aab40d7bd1.js.LICENSE.txt +3 -0
  161. package/assets/esri/core/workers/chunks/{4a15308b54734247f38e.js → dd8e72d6784a8ebc115d.js} +1 -1
  162. package/assets/esri/core/workers/chunks/de0784474d2e9e504a91.js +1 -0
  163. package/assets/esri/core/workers/chunks/{aca3ccb9599bcc444617.js → e1472af8f5d64c057d04.js} +1 -1
  164. package/assets/esri/core/workers/chunks/e27fa1e84f16b7f19a90.js +1 -0
  165. package/assets/esri/core/workers/chunks/e2cd6038d9c7167b128e.js +1 -0
  166. package/assets/esri/core/workers/chunks/{d88544ac332be633e3fe.js → e64e0c3240f8e577a61c.js} +1 -1
  167. package/assets/esri/core/workers/chunks/e9fba86036b8fe700a41.js +1 -0
  168. package/assets/esri/core/workers/chunks/{0252d853419adc203f04.js → ef6e805c49e1afdf966b.js} +1 -1
  169. package/assets/esri/core/workers/chunks/f2bc75a718a10065011d.js +1 -0
  170. package/assets/esri/core/workers/chunks/{1263391920fbb8926ced.js → f34ce3c37a385b341631.js} +1 -1
  171. package/assets/esri/core/workers/chunks/{e3d25d027885eb1a415f.js → f458a40e1f8fce3ad23c.js} +1 -1
  172. package/assets/esri/core/workers/chunks/f65b720b750aebca1bcd.js +1 -0
  173. package/assets/esri/core/workers/chunks/fdcbd28f38bc485ac5e3.js +1 -0
  174. package/assets/esri/themes/dark/main.css +1 -1
  175. package/assets/esri/themes/light/main.css +1 -1
  176. package/assets/esri/themes/light/view.css +1 -1
  177. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ar.json +1 -1
  178. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bg.json +1 -1
  179. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_bs.json +1 -1
  180. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ca.json +1 -1
  181. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_cs.json +1 -1
  182. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_da.json +1 -1
  183. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_de.json +1 -1
  184. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_el.json +1 -1
  185. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_es.json +1 -1
  186. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_et.json +1 -1
  187. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fi.json +1 -1
  188. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_fr.json +1 -1
  189. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_he.json +1 -1
  190. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hr.json +1 -1
  191. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_hu.json +1 -1
  192. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_id.json +1 -1
  193. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_it.json +1 -1
  194. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ja.json +1 -1
  195. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ko.json +1 -1
  196. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lt.json +1 -1
  197. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_lv.json +1 -1
  198. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_nl.json +1 -1
  199. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_no.json +1 -1
  200. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pl.json +1 -1
  201. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-BR.json +1 -1
  202. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_pt-PT.json +1 -1
  203. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ro.json +1 -1
  204. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_ru.json +1 -1
  205. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sk.json +1 -1
  206. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sl.json +1 -1
  207. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sr.json +1 -1
  208. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_sv.json +1 -1
  209. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_th.json +1 -1
  210. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_tr.json +1 -1
  211. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_uk.json +1 -1
  212. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_vi.json +1 -1
  213. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-CN.json +1 -1
  214. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-HK.json +1 -1
  215. package/assets/esri/widgets/TimeSlider/t9n/TimeSlider_zh-TW.json +1 -1
  216. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ar.json +1 -0
  217. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bg.json +1 -0
  218. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_bs.json +1 -0
  219. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ca.json +1 -0
  220. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_cs.json +1 -0
  221. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_da.json +1 -0
  222. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_de.json +1 -0
  223. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_el.json +1 -0
  224. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_es.json +1 -0
  225. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_et.json +1 -0
  226. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fi.json +1 -0
  227. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_fr.json +1 -0
  228. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_he.json +1 -0
  229. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hr.json +1 -0
  230. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_hu.json +1 -0
  231. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_id.json +1 -0
  232. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_it.json +1 -0
  233. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ja.json +1 -0
  234. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ko.json +1 -0
  235. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lt.json +1 -0
  236. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_lv.json +1 -0
  237. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_nl.json +1 -0
  238. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_no.json +1 -0
  239. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pl.json +1 -0
  240. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-BR.json +1 -0
  241. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_pt-PT.json +1 -0
  242. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ro.json +1 -0
  243. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_ru.json +1 -0
  244. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sk.json +1 -0
  245. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sl.json +1 -0
  246. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sr.json +1 -0
  247. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_sv.json +1 -0
  248. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_th.json +1 -0
  249. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_tr.json +1 -0
  250. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_uk.json +1 -0
  251. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_vi.json +1 -0
  252. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-CN.json +1 -0
  253. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-HK.json +1 -0
  254. package/assets/esri/widgets/support/SelectionList/t9n/SelectionList_zh-TW.json +1 -0
  255. package/chunks/ComponentShader.glsl.js +14 -14
  256. package/chunks/DefaultMaterial.glsl.js +6 -6
  257. package/chunks/OITBlend.glsl.js +1 -0
  258. package/chunks/Path.glsl.js +3 -3
  259. package/chunks/RealisticTree.glsl.js +5 -5
  260. package/chunks/SSAO.glsl.js +5 -4
  261. package/chunks/Viewshed.glsl.js +1 -1
  262. package/core/promiseUtils.d.ts +1 -0
  263. package/core/urlUtils.d.ts +4 -0
  264. package/geometry/support/MeshTexture.js +1 -1
  265. package/identity/IdentityModal.js +1 -1
  266. package/interfaces.d.ts +290 -42
  267. package/intl/date.js +1 -1
  268. package/intl/messages.js +1 -1
  269. package/intl/number.js +1 -1
  270. package/layers/FeatureLayer.js +1 -1
  271. package/layers/ParquetLayer.js +1 -1
  272. package/layers/ViewshedLayer.js +1 -1
  273. package/layers/graphics/sources/ParquetSource.js +1 -1
  274. package/layers/save/featureLayerUtils.js +1 -1
  275. package/layers/support/ParquetEncodingBase.js +5 -0
  276. package/layers/support/ParquetEncodingLocation.js +5 -0
  277. package/layers/support/ParquetEncodingWkb.js +5 -0
  278. package/layers/support/layerUtils.js +1 -1
  279. package/layers/support/parquetUtils.js +5 -0
  280. package/libs/parquet/parquet.js +1 -1
  281. package/package.json +2 -2
  282. package/portal/PortalItem.js +1 -1
  283. package/portal/PortalUser.js +1 -1
  284. package/portal/support/portalItemUtils.js +1 -1
  285. package/rest/networks/trace.js +1 -1
  286. package/rest/print.js +1 -1
  287. package/support/TablesMixin.js +1 -1
  288. package/support/modeUtils.js +5 -0
  289. package/support/revision.js +1 -1
  290. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  291. package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +1 -1
  292. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  293. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  294. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  295. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  296. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  297. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  298. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  299. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  300. package/views/3d/interactive/Manipulator3D.js +1 -1
  301. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  302. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentMove.js +1 -1
  303. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  304. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  305. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  306. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  307. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  308. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  309. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  310. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +1 -1
  311. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  312. package/views/3d/layers/DrapedSubView3D.js +1 -1
  313. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  314. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  315. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  316. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  317. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  318. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  319. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  320. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  321. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  322. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  323. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  324. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  325. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  326. package/views/3d/layers/graphics/Labeler.js +1 -1
  327. package/views/3d/layers/graphics/MeshFastUpdateProcessor.js +1 -1
  328. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  329. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  330. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  331. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  332. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  333. package/views/3d/support/MemoryController.js +1 -1
  334. package/views/3d/support/engineContent/line.js +1 -1
  335. package/views/3d/terrain/OverlayRenderer.js +1 -1
  336. package/views/3d/webgl-engine/Stage.js +1 -1
  337. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  338. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  339. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +1 -1
  340. package/views/3d/webgl-engine/effects/bloom/BloomPresets.glsl.js +1 -1
  341. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  342. package/views/3d/webgl-engine/lib/ContentObjectType.js +1 -1
  343. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  344. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  345. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  346. package/views/3d/webgl-engine/lib/IntersectableGeometry.js +5 -0
  347. package/views/3d/webgl-engine/lib/Material.js +1 -1
  348. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  349. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  350. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  351. package/views/3d/webgl-engine/lib/RenderContext.js +1 -1
  352. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  353. package/views/3d/webgl-engine/lib/RendererBase.js +1 -1
  354. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  355. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  356. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  357. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  358. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  359. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  360. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  361. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  362. package/views/ToolViewManager.js +1 -1
  363. package/views/analysis/analysisViewUtils.js +1 -1
  364. package/views/draw/support/HighlightHelper.js +1 -1
  365. package/views/interactive/InteractiveToolBase.js +1 -1
  366. package/views/interactive/Tooltip.js +1 -1
  367. package/views/interactive/interactiveToolUtils.js +1 -1
  368. package/views/interactive/keybindings.js +1 -1
  369. package/views/support/Scheduler.js +1 -1
  370. package/views/ui/UI.js +1 -1
  371. package/webdoc/support/saveUtils.js +1 -1
  372. package/webdoc/support/webdocSaveUtils.js +1 -1
  373. package/webscene/Slide.js +1 -1
  374. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  375. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  376. package/widgets/Feature/FeatureMedia.js +1 -1
  377. package/widgets/Feature/support/featureUtils.js +1 -1
  378. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  379. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  380. package/widgets/FeatureTable.js +1 -1
  381. package/widgets/Features/FeaturesViewModel.js +1 -1
  382. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  383. package/widgets/TimeSlider.js +1 -1
  384. package/widgets/support/AnalysisViewModel.js +1 -1
  385. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  386. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  387. package/widgets/support/widget.js +1 -1
  388. package/assets/esri/core/workers/chunks/0297e55a49ca0d1231ef.js +0 -1
  389. package/assets/esri/core/workers/chunks/04008648c59031bca8ea.js +0 -1
  390. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +0 -1
  391. package/assets/esri/core/workers/chunks/0b4e63e705db09dbe171.js +0 -1
  392. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +0 -1
  393. package/assets/esri/core/workers/chunks/1b87fa15470cce26feea.js +0 -1
  394. package/assets/esri/core/workers/chunks/239821543abbd63c5787.js +0 -2
  395. package/assets/esri/core/workers/chunks/272a309760dacb13dee3.js +0 -1
  396. package/assets/esri/core/workers/chunks/2791f1f2791087d0217f.js +0 -1
  397. package/assets/esri/core/workers/chunks/35dccd3883d2e466c42e.js +0 -1
  398. package/assets/esri/core/workers/chunks/364860a42edc0c3b8d5b.js +0 -1
  399. package/assets/esri/core/workers/chunks/373782e9f5d61616fde4.js +0 -2
  400. package/assets/esri/core/workers/chunks/37e49d1a1407c193dcd0.js +0 -1
  401. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +0 -1
  402. package/assets/esri/core/workers/chunks/3845e1d47bb51c06682e.js +0 -2
  403. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +0 -1
  404. package/assets/esri/core/workers/chunks/4ba34124054752b363c0.js +0 -1
  405. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +0 -1
  406. package/assets/esri/core/workers/chunks/4e711f4fa1cbedf4dae5.js +0 -1
  407. package/assets/esri/core/workers/chunks/593396b4c210da77a131.js +0 -1
  408. package/assets/esri/core/workers/chunks/5b32c2a1b276352593dc.js +0 -1
  409. package/assets/esri/core/workers/chunks/5df4e73905c0ae75e37c.js +0 -1
  410. package/assets/esri/core/workers/chunks/5fb9bb3ac2f60dbd59c4.js +0 -1
  411. package/assets/esri/core/workers/chunks/66e90f7d473d1f688254.js +0 -1
  412. package/assets/esri/core/workers/chunks/68d7babbe7e0d934e056.js +0 -1
  413. package/assets/esri/core/workers/chunks/6e6b60779c11efc128af.js +0 -1
  414. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +0 -1
  415. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +0 -1
  416. package/assets/esri/core/workers/chunks/75e01c6404cbd51daabc.js +0 -2
  417. package/assets/esri/core/workers/chunks/77660e18ea793ae85f83.js +0 -1
  418. package/assets/esri/core/workers/chunks/879d672d12f9ef2e1b50.js +0 -1
  419. package/assets/esri/core/workers/chunks/90442f47c9f31f26b453.js +0 -1
  420. package/assets/esri/core/workers/chunks/91439b59260b0fb04be9.js +0 -1
  421. package/assets/esri/core/workers/chunks/96978d039f183565bffa.js +0 -1
  422. package/assets/esri/core/workers/chunks/999a4f7ca581f28cc1c4.js +0 -1
  423. package/assets/esri/core/workers/chunks/af41dcc8006cd0f451c2.js +0 -1
  424. package/assets/esri/core/workers/chunks/af9fda47d02c51a2c7da.js +0 -1
  425. package/assets/esri/core/workers/chunks/baed733a29aa65efc2a0.js +0 -2
  426. package/assets/esri/core/workers/chunks/c03bffa13841e4f80379.js +0 -2
  427. package/assets/esri/core/workers/chunks/c7ab674764312d65348f.js +0 -1
  428. package/assets/esri/core/workers/chunks/ca0572fe5614005acceb.js +0 -1
  429. package/assets/esri/core/workers/chunks/d2c7067bb6654c0e2793.js +0 -1
  430. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +0 -1
  431. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +0 -1
  432. package/assets/esri/core/workers/chunks/e13caf9691f556071e31.js +0 -1
  433. package/assets/esri/core/workers/chunks/e14449f07ed3386f4f2b.js +0 -1
  434. package/assets/esri/core/workers/chunks/e31bb256921807464715.js +0 -1
  435. package/assets/esri/core/workers/chunks/e4d522ade82192f32d54.js +0 -2
  436. package/assets/esri/core/workers/chunks/e5713b757f770a138b8c.js +0 -1
  437. package/assets/esri/core/workers/chunks/e6544e966f14fb410157.js +0 -1
  438. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +0 -1
  439. package/assets/esri/core/workers/chunks/e7cb4003c45e42b48ea6.js +0 -1
  440. package/assets/esri/core/workers/chunks/eb011e8b14db37ddb110.js +0 -1
  441. package/assets/esri/core/workers/chunks/f0c864425f000ab87a7b.js +0 -1
  442. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +0 -1
  443. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +0 -1
  444. package/assets/esri/core/workers/chunks/fa2d836d4a844b26b84e.js +0 -1
  445. package/layers/support/parquetLayerUtils.js +0 -5
  446. package/support/themeUtils.js +0 -5
  447. package/views/3d/webgl-engine/lib/MaterialCollection.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{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{handleKeys as c,UpdateRecordWorkflow as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as m,setUpGeometryUpdate as u,isTerminalUpdateEventType as w,updateGraphicSymbolWhenRequired as y,swapForEditingSession as f,cloneGraphicExceptMesh as g,canCreateInteractiveEditSession as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...c,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends p{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",(e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)})),s((()=>this._featureFormViewModel.feature?.sourceLayer),(e=>this._sketchGraphicClone.sourceLayer=e))])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:r}=t,a=s.feature,{view:l}=r,d=m(a),n=await u({feature:a,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&w(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,s=e.edits.feature,{capabilities:r,layer:a}=e.editorItem,{view:n}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!r.update.geometry||"3d"===n?.type&&d(a.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const h=new l({elevationInfo:a.elevationInfo,internal:!0,listMode:"hide"}),c=new _({allowDeleteKey:!1,layer:h,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:n});return this._sketchViewModel=c,n?.map.add(h),this.addHandles(i((()=>{n?.destroyed||n?.map.remove(h),h.destroy(),this._sketchViewModel=o(c)})),v.sketchViewModel),await y(t,this._webStyleCache,"2d"===n?.type?n.scale:null),this.addHandles([await f(c,s,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:c}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=g(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),k(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([r()],M.prototype,"_layerViewEditSession",void 0),e([r()],M.prototype,"_sketchGraphicClone",void 0),e([r()],M.prototype,"_sketchViewModel",void 0),M=V=e([a("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Error.js";import{makeHandle as i}from"../../core/handleUtils.js";import"../../core/has.js";import{destroyMaybe as o}from"../../core/maybe.js";import{watch as s}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import{hasEffectiveFeatureExpressionInfo as d}from"../../support/elevationInfoUtils.js";import{highlightsSupported as n}from"../../views/support/layerViewUtils.js";import h from"./UpdateFeatureWorkflowData.js";import{handleKeys as c,UpdateRecordWorkflow as p}from"./UpdateRecordWorkflow.js";import{getVisualVariableAttributes as w,setUpGeometryUpdate as m,isTerminalUpdateEventType as u,updateGraphicSymbolWhenRequired as y,swapForEditingSession as f,cloneGraphicExceptMesh as g,canCreateInteractiveEditSession as k}from"./workflowUtils.js";import _ from"../Sketch/SketchViewModel.js";var V;const v={...c,highlights:Symbol(),sketchGraphics:Symbol(),sketchViewModel:Symbol(),waitingForTool:Symbol()};let M=V=class extends p{constructor(e){super(e),this.type="update-feature",this._layerViewEditSession=null,this._sketchGraphicClone=null,this._sketchViewModel=null,this._webStyleCache=new Map}destroy(){this._layerViewEditSession?.rollback()}async commit(){this.removeHandles(v.sketchGraphics);try{const e=this.data.edits.stagedForDelete;await super.commit();const t=this._layerViewEditSession;e?t?.rollback():t?.commit()}catch(e){throw await this._configureSketchViewModel(),new t("editor-workflow:failed-to-commit","An error occurred when sending the updates to the service",{error:e})}}async start(){return await super.start(),await this._initializeSketchViewModel()}_initializeFeatureFormViewModel(){super._initializeFeatureFormViewModel(),this.addHandles([this._featureFormViewModel.on("value-change",(e=>{this._layerViewEditSession?.setAttribute(e.fieldName,e.value)})),s((()=>this._featureFormViewModel.feature?.sourceLayer),(e=>this._sketchGraphicClone.sourceLayer=e))])}_configureHighlight(){const{edits:e,layerView:t}=this.data;n(t)&&this.addHandles(t.highlight(e.feature),v.highlights)}async _configureSketchViewModel(){const e=this._sketchViewModel;if(!e)return;const{data:t,_featureFormViewModel:i,_sketchGraphicClone:o}=this,{edits:s,viewModel:a}=t,r=s.feature,{view:l}=a,d=w(r),n=await m({feature:r,featureClone:o,visualVariableAttributes:d,sketchViewModel:e,view:l,onUpdate:({geometry:e,attributes:t},o)=>{if(s.updateAttributes(t),s.updateGeometry(e),i.feature&&(i.feature.geometry=e),null!=d.rotation){const{field:e}=d.rotation;i.setValue(e,t[e])}if(null!=d.size){const{field:e}=d.size;i.setValue(e,t[e])}("undo"===o.type||"redo"===o.type||"update"===o.type&&null!=o.toolEventInfo&&u(o.toolEventInfo.type))&&i.notifyFeatureGeometryChanged()},addUpdatingPromise:e=>{this._updatingHandles.addPromise(e)},addHandle:e=>{this.addHandles(e,v.waitingForTool)},webStyleCache:this._webStyleCache});this.addHandles(n,v.sketchGraphics),e.addHandles(n)}async _initializeSketchViewModel(){const{data:e,_sketchGraphicClone:t}=this,s=e.edits.feature,{capabilities:a,layer:r}=e.editorItem,{view:n}=e.viewModel;if(this.removeHandles([v.highlights,v.sketchGraphics,v.sketchViewModel,v.waitingForTool]),!a.update.geometry||"3d"===n?.type&&d(r.elevationInfo))return{enter:async()=>{this.hasHandles(v.highlights)||this._configureHighlight()},exit:()=>this.removeHandles([v.highlights])};const h=new l({elevationInfo:r.elevationInfo,internal:!0,listMode:"hide"}),c=new _({allowDeleteKey:!1,layer:h,sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,view:n});return this._sketchViewModel=c,n?.map.add(h),await(n?.whenLayerView(h)),this.addHandles(i((()=>{n?.destroyed||n?.map.remove(h),h.destroy(),this._sketchViewModel=o(c)})),v.sketchViewModel),await y(t,this._webStyleCache,"2d"===n?.type?n.scale:null),this.addHandles([await f(c,s,t)]),{enter:async()=>{this.hasHandles(v.sketchGraphics)||await this._configureSketchViewModel()},exit:()=>this.removeHandles([v.sketchGraphics]),viewModel:c}}_onFullFeatureLoaded(e){super._onFullFeatureLoaded(e);const t=this._sketchGraphicClone=g(e),{edits:i,layerView:o}=this.data;i.updateGeometry(e.geometry),i.trackChanges(),k(o)&&(this._layerViewEditSession=o.createInteractiveEditSession(t))}static async create(e){const t=new V({data:await h.create(e),onCommit:this._onCommitFactory(e.applyEdits)});return t._set("steps",this._createWorkflowSteps(t)),t}get test(){}};e([a()],M.prototype,"_layerViewEditSession",void 0),e([a()],M.prototype,"_sketchGraphicClone",void 0),e([a()],M.prototype,"_sketchViewModel",void 0),M=V=e([r("esri.widgets.Editor.UpdateFeatureWorkflow")],M);export{M as UpdateFeatureWorkflow,v as handleKeys};
@@ -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{R as t,D as i}from"../../../chunks/ResponsiveTheme.js";import"../../../intl.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{signal as s}from"../../../core/signal.js";import{formatDecimal as a,unitName as l}from"../../../core/unitFormatUtils.js";import{convertUnit as r}from"../../../core/unitUtils.js";import{getEpsilon as d}from"../../../core/libs/gl-matrix-2/math/common.js";import{getConfig as c,notAvailable as p}from"./constants.js";import{getTranslatedLineTitle as m}from"./intlUtils.js";import{niceScale as u}from"./niceScale.js";import{binaryFindClosest as f}from"./profileUtils.js";import{c as x,N as g}from"../../../chunks/chartUtilsAm5.js";import{isRTL as h}from"../../support/widgetUtils.js";import{isDarkTheme as A}from"../../../support/themeUtils.js";import{X as v,V as b,A as y,a as T,b as L,L as M}from"../../../chunks/LineSeries.js";import{b as S,d as F,a as P,C as k}from"../../../chunks/Theme.js";import{T as X}from"../../../chunks/Tooltip.js";import{substitute as Y}from"../../../intl/substitute.js";import{formatNumber as z}from"../../../intl/number.js";const C="#f8f8f8",j="#a9a9a9",w="#323232",H="line",B="fill",U=15,D=12,R=.001,O=.1,W=.02,G={fontFamily:"Avenir Next",paddingBottom:D/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:j,axisTooltipFontSize:12,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,axisTooltipPaddingTop:Math.round(D/4),axisTooltipPaddingBottom:Math.round(D/4),axisTooltipPaddingHorizontal:Math.round(U/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(D/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(U/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:C,seriesTooltipLabelColor:w,seriesFillLighten:.9,seriesTooltipSpacing:D/2,seriesTooltipPaddingVertical:Math.round(U/4),seriesTooltipPaddingHorizontal:Math.round(U/4)},V={...G,axisGridStroke:w,axisLabelsColor:j,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:C,seriesFillLighten:-.75},E={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function I(o){const a=await x(o.container);n(o.abortOptions);const l=A(),r=l?V:G;a.setThemes(l?[t.new(a),i.new(a)]:[t.new(a)]);const d=h(o.container),c=a.container.children.push(v.new(a,{panX:!0,panY:!0,paddingTop:r.paddingTop,paddingBottom:r.paddingBottom,paddingLeft:d?r.paddingRight:r.paddingLeft,paddingRight:d?r.paddingLeft:r.paddingRight,maxTooltipDistance:-1}));c.zoomOutButton.set("forceHidden",!0);const p=c.xAxes.push(b.new(a,{renderer:y.new(a,{})})),m=c.yAxes.push(b.new(a,{renderer:T.new(a,{})})),u=s(null),f=s("loading"),g={params:o,chart:c,xAxis:p,yAxis:m,seriesInfos:new Map,messages:null,theme:r,pointerIsOver:!1,rtl:d,get state(){return f.value},get data(){return u.value},set data(t){u.value=t}};Z(g),q(g),N(g);const L=e([lt(g,o.onRangeChange),dt(g,o.onCursorPositionChange),yt(a.events.once("frameended",(()=>{f.value="ready"}))),yt(a)]);let M;return{destroy:()=>{L.remove(),f.value="destroyed"},update:t=>{t.data===g.data&&t.messages===g.messages||$(g)||J(g,t)},zoomOut:()=>K(g),test:M}}function $(t){return"destroyed"===t.state}function N({chart:t,xAxis:i,yAxis:e}){const o=L.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function Z(t){const{chart:i,xAxis:e,theme:o}=t;e.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),e.axisHeader.set("forceHidden",!0);const n=e.get("renderer");n.setAll({inside:!1,minGridDistance:o.xAxisMinGridDistance}),n.labels.template.setAll({centerX:S,centerY:S,fill:F(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.xAxisMaxLabelPosition,minPosition:o.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:o.xAxisLabelsSpacing});const s=e.set("tooltip",X.new(i.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));s.get("background")?.setAll({fill:F(o.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:F(o.axisTooltipLabelColor),fontFamily:o.fontFamily,fontSize:o.axisTooltipFontSize,paddingBottom:o.axisTooltipPaddingBottom,paddingLeft:o.axisTooltipPaddingHorizontal,paddingRight:o.axisTooltipPaddingHorizontal,paddingTop:o.axisTooltipPaddingTop,direction:t.rtl?"rtl":"ltr"}),n.grid.template.setAll({strokeOpacity:1,stroke:F(o.axisGridStroke)})}function q(t){const{yAxis:i,theme:e,rtl:o}=t;i.setAll({baseValue:c().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),i.axisHeader.set("visible",!1);const n=i.get("renderer");n.setAll({minGridDistance:e.yAxisMinGridDistance,opposite:o,inside:!0}),n.labels.template.setAll({centerX:S,centerY:P,fill:F(e.axisLabelsColor),fontFamily:e.fontFamily,fontSize:e.axisLabelsFontSize,fontWeight:e.axisLabelsFontWeight,maxPosition:e.yAxisMaxLabelPosition,minPosition:e.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:o?0:e.yAxisLabelSpacing,paddingRight:o?e.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),n.grid.template.setAll({strokeOpacity:1,stroke:F(e.axisGridStroke)})}function J(t,i){if($(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(Q(t),et(t)),a&&K(t),pt(t)}function K(t){$(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function Q(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=_({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function _({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return E;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return E;const d=Math.max(s-n,R);let p=Math.max(l-a,R);const m=t.effectiveUnits;if(t.dynamicElevationRange){const t=r(d,m.distance,m.elevation);p=Math.max(p,t/c().maxChartRatio)}return a-=W*p,l=a+p+O*p,[a,l]=u(a,l,10),p=l-a,t.uniformScaling?tt({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+d,minY:a,maxY:a+p}}function tt({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:d}=i;if(null==s||null==a||null==l||null==d)return E;const c=a-s,p=d-l,m=t.effectiveUnits,u=r(p,m.elevation,m.distance)/o/(c/e);return u>=1?[s,a]=it([s,a],u,n):[l,d]=it([l,d],1/u,n),{minX:s,maxX:a,minY:l,maxY:d}}function it([t,i],e,o){const n=(i-t)*e;if(o){const e=(t+i)/2-n/2;return[e,e+n]}return[t,t+n]}function et(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=nt(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),ot(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function ot({theme:t},i,e){const o=F(e.color.toCss()),n=e.samples??[],s=n.length>0,{line:a,fill:l}=i;a.set("visible",s),a.set("stroke",o),l?.set("visible",s),l?.set("fill",k.lighten(o,t.seriesFillLighten)),a.data.setAll(n),l?.data.setAll(n)}function nt(t,i){const{id:e}=i,o=st(t,`${H}-${e}`),n=at(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=st(t,`${B}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function st(t,i){return M.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function at({theme:t,chart:i,rtl:e}){const o=X.new(i.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=t.seriesTooltipPaddingHorizontal,s=t.seriesTooltipPaddingVertical;return o.label.setAll({fill:F(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:s,paddingLeft:n,paddingRight:n,paddingTop:s,textAlign:e?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:F(t.seriesTooltipBackgroundColor)}),o.adapters.add("dy",(i=>{const e=t.seriesTooltipSpacing,n=o.get("pointTo")?.y??0;return(i??0)+(o.y()>n?e:-e)})),o}function lt(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(rt(e),rt(o))},s=t=>[t.on("start",n),t.on("end",n)];return bt([...s(e),...s(o)])}function rt(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<d()?1:e}function dt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,pt(t)},r=()=>{l(!1),i(null,null)};return bt([s?.events.on("cursormoved",(()=>{if(!t.pointerIsOver)return;pt(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===rt(o)?(r=0,d=t):(r=At(o),d=vt(o)),e=ct(e,r,d,0,t)}if(null!=i&&null!=s){1===rt(n)?(r=i,d=s):(r=At(n),d=vt(n)),a=ct(a,r,d,i,s)}}i(e,a)})),a.on("pointerover",(()=>l(!0))),a.on("pointerout",r),a.on("blur",r)])}function ct(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function pt(t){const i=mt(t);if(!i)return void t.seriesInfos.forEach((t=>{t.line.get("tooltip")?.set("forceHidden",!0)}));t.seriesInfos.forEach((t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)}));t.xAxis.getTooltip().setAll({tooltipText:xt(t)})}function mt(t){const{data:i}=t,e=i?.lines.map((i=>({line:i,y:ht(t,i)?.elevation}))).sort(ut);return e&&0!==e.length&&null!=e[0].y?e.map((({y:i,line:e})=>ft(t,e,i))).join("\n"):null}function ut({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function ft(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,l=" ",r=c().formatPrecision,d=Y(n.chartTooltip,{name:m(i,n),elevation:null!=e?a(n,e,o.effectiveUnits.elevation,r):p});return t.rtl?d+l+s:s+l+d}function xt(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?ht(t,o):null,s=c().formatPrecision;return null!=n?a(e,n.distance,i.effectiveUnits.distance,s):"-"}function gt(t,i){const e=g.new(t.chart.root,{});return e.format=(e,o,n)=>{const{data:s,messages:a}=t;if(null==a||null==s||"string"==typeof e)return"";return`${z(e,{maximumFractionDigits:n})} ${l(a,s.effectiveUnits[i],"abbr")}`},e}function ht({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return f(o,l,(t=>t.distance))}function At(t){return t.positionToValue(t.get("start")??0)}function vt(t){return t.positionToValue(t.get("end")??1)}function bt(t){return e(t.map(yt))}function yt(t){return o((()=>{t?.dispose()}))}export{I as createChart,_ as getAdjustedBounds};
5
+ import{R as t,D as i}from"../../../chunks/ResponsiveTheme.js";import"../../../intl.js";import{handlesGroup as e,makeHandle as o}from"../../../core/handleUtils.js";import"../../../core/has.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{signal as s}from"../../../core/signal.js";import{formatDecimal as a,unitName as l}from"../../../core/unitFormatUtils.js";import{convertUnit as r}from"../../../core/unitUtils.js";import{getEpsilon as d}from"../../../core/libs/gl-matrix-2/math/common.js";import{getConfig as c,notAvailable as p}from"./constants.js";import{getTranslatedLineTitle as m}from"./intlUtils.js";import{niceScale as u}from"./niceScale.js";import{binaryFindClosest as f}from"./profileUtils.js";import{c as x,N as g}from"../../../chunks/chartUtilsAm5.js";import{isRTL as h}from"../../support/widgetUtils.js";import{isDarkMode as A}from"../../../support/modeUtils.js";import{X as v,V as b,A as y,a as T,b as L,L as M}from"../../../chunks/LineSeries.js";import{b as S,d as F,a as P,C as k}from"../../../chunks/Theme.js";import{T as X}from"../../../chunks/Tooltip.js";import{substitute as Y}from"../../../intl/substitute.js";import{formatNumber as z}from"../../../intl/number.js";const C="#f8f8f8",j="#a9a9a9",w="#323232",H="line",B="fill",U=15,D=12,R=.001,O=.1,W=.02,G={fontFamily:"Avenir Next",paddingBottom:D/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:j,axisTooltipFontSize:12,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,axisTooltipPaddingTop:Math.round(D/4),axisTooltipPaddingBottom:Math.round(D/4),axisTooltipPaddingHorizontal:Math.round(U/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(D/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(U/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:C,seriesTooltipLabelColor:w,seriesFillLighten:.9,seriesTooltipSpacing:D/2,seriesTooltipPaddingVertical:Math.round(U/4),seriesTooltipPaddingHorizontal:Math.round(U/4)},V={...G,axisGridStroke:w,axisLabelsColor:j,axisTooltipBackgroundColor:w,axisTooltipLabelColor:C,seriesTooltipBackgroundColor:w,seriesTooltipLabelColor:C,seriesFillLighten:-.75},E={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function I(o){const a=await x(o.container);n(o.abortOptions);const l=A(),r=l?V:G;a.setThemes(l?[t.new(a),i.new(a)]:[t.new(a)]);const d=h(o.container),c=a.container.children.push(v.new(a,{panX:!0,panY:!0,paddingTop:r.paddingTop,paddingBottom:r.paddingBottom,paddingLeft:d?r.paddingRight:r.paddingLeft,paddingRight:d?r.paddingLeft:r.paddingRight,maxTooltipDistance:-1}));c.zoomOutButton.set("forceHidden",!0);const p=c.xAxes.push(b.new(a,{renderer:y.new(a,{})})),m=c.yAxes.push(b.new(a,{renderer:T.new(a,{})})),u=s(null),f=s("loading"),g={params:o,chart:c,xAxis:p,yAxis:m,seriesInfos:new Map,messages:null,theme:r,pointerIsOver:!1,rtl:d,get state(){return f.value},get data(){return u.value},set data(t){u.value=t}};Z(g),q(g),N(g);const L=e([lt(g,o.onRangeChange),dt(g,o.onCursorPositionChange),yt(a.events.once("frameended",(()=>{f.value="ready"}))),yt(a)]);let M;return{destroy:()=>{L.remove(),f.value="destroyed"},update:t=>{t.data===g.data&&t.messages===g.messages||$(g)||J(g,t)},zoomOut:()=>K(g),test:M}}function $(t){return"destroyed"===t.state}function N({chart:t,xAxis:i,yAxis:e}){const o=L.new(t.root,{behavior:"none",xAxis:i,yAxis:e,snapToSeriesBy:"y"});o.lineY.set("visible",!1),t.set("cursor",o)}function Z(t){const{chart:i,xAxis:e,theme:o}=t;e.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),e.axisHeader.set("forceHidden",!0);const n=e.get("renderer");n.setAll({inside:!1,minGridDistance:o.xAxisMinGridDistance}),n.labels.template.setAll({centerX:S,centerY:S,fill:F(o.axisLabelsColor),fontFamily:o.fontFamily,fontSize:o.axisLabelsFontSize,fontWeight:o.axisLabelsFontWeight,maxPosition:o.xAxisMaxLabelPosition,minPosition:o.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:o.xAxisLabelsSpacing});const s=e.set("tooltip",X.new(i.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));s.get("background")?.setAll({fill:F(o.axisTooltipBackgroundColor),stroke:void 0}),s.label.setAll({fill:F(o.axisTooltipLabelColor),fontFamily:o.fontFamily,fontSize:o.axisTooltipFontSize,paddingBottom:o.axisTooltipPaddingBottom,paddingLeft:o.axisTooltipPaddingHorizontal,paddingRight:o.axisTooltipPaddingHorizontal,paddingTop:o.axisTooltipPaddingTop,direction:t.rtl?"rtl":"ltr"}),n.grid.template.setAll({strokeOpacity:1,stroke:F(o.axisGridStroke)})}function q(t){const{yAxis:i,theme:e,rtl:o}=t;i.setAll({baseValue:c().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:gt(t,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),i.axisHeader.set("visible",!1);const n=i.get("renderer");n.setAll({minGridDistance:e.yAxisMinGridDistance,opposite:o,inside:!0}),n.labels.template.setAll({centerX:S,centerY:P,fill:F(e.axisLabelsColor),fontFamily:e.fontFamily,fontSize:e.axisLabelsFontSize,fontWeight:e.axisLabelsFontWeight,maxPosition:e.yAxisMaxLabelPosition,minPosition:e.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:o?0:e.yAxisLabelSpacing,paddingRight:o?e.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),n.grid.template.setAll({strokeOpacity:1,stroke:F(e.axisGridStroke)})}function J(t,i){if($(t))return;const e=t.data??void 0,o=i.data??void 0;t.chart.get("cursor")?.set("forceHidden",!o?.refined);const n=e!==o,s=e?.effectiveUnits!==o?.effectiveUnits,a=e?.uniformScaling!==o?.uniformScaling;t.data=o,t.messages=i.messages,(n||s)&&(Q(t),et(t)),a&&K(t),pt(t)}function K(t){$(t)||(t.xAxis.zoom(0,1),t.yAxis.zoom(0,1))}function Q(t){const{chart:i,data:e,xAxis:o,yAxis:n}=t,{minX:s,maxX:a,minY:l,maxY:r}=_({data:e,pixelWidth:o.width(),pixelHeight:n.height()}),d=!!e?.uniformScaling,c=!!e?.refined;i.setAll({panX:!0,panY:d,pinchZoomX:c,pinchZoomY:c&&d,wheelX:"panX",wheelY:c?d?"zoomXY":"zoomX":"none"}),o.setAll({max:a,min:s,panX:!0,panY:!1,zoomX:!0,zoomY:d}),n.setAll({max:r,min:l,panX:!1,panY:d,zoomX:d,zoomY:d})}function _({data:t,pixelWidth:i,pixelHeight:e}){if(null==t)return E;const o=t.statistics,n=0,s=o?.maxDistance;let a=o?.minElevation,l=o?.maxElevation;if(null==s||null==a||null==l)return E;const d=Math.max(s-n,R);let p=Math.max(l-a,R);const m=t.effectiveUnits;if(t.dynamicElevationRange){const t=r(d,m.distance,m.elevation);p=Math.max(p,t/c().maxChartRatio)}return a-=W*p,l=a+p+O*p,[a,l]=u(a,l,10),p=l-a,t.uniformScaling?tt({data:t,bounds:{minX:n,maxX:s,minY:a,maxY:l},pixelWidth:i,pixelHeight:e,centered:!0}):{minX:n,maxX:n+d,minY:a,maxY:a+p}}function tt({data:t,bounds:i,pixelWidth:e,pixelHeight:o,centered:n}){if(null==t)return i;let{minX:s,maxX:a,minY:l,maxY:d}=i;if(null==s||null==a||null==l||null==d)return E;const c=a-s,p=d-l,m=t.effectiveUnits,u=r(p,m.elevation,m.distance)/o/(c/e);return u>=1?[s,a]=it([s,a],u,n):[l,d]=it([l,d],1/u,n),{minX:s,maxX:a,minY:l,maxY:d}}function it([t,i],e,o){const n=(i-t)*e;if(o){const e=(t+i)/2-n/2;return[e,e+n]}return[t,t+n]}function et(t){const{chart:i,data:e,seriesInfos:o,xAxis:n,yAxis:s}=t;if(null==e||0===e.lines.length)return void i.series.clear();const a=new Map,l=new Set(i.series.values),r=e.lines.length;for(let d=0;d<r;d++){const n=e.lines[d];let s=o.get(n.id);s?(s.fill&&l.delete(s.fill),l.delete(s.line)):(s=nt(t,n),s.fill&&i.series.push(s.fill),i.series.push(s.line)),a.set(s.id,s);const c=r-d-1;s.fill?.set("layer",c),s.line.set("layer",r+c),ot(t,s,n)}t.seriesInfos=a;for(const d of l)i.series.removeValue(d);n.set("layer",r+1),s.set("layer",r+2)}function ot({theme:t},i,e){const o=F(e.color.toCss()),n=e.samples??[],s=n.length>0,{line:a,fill:l}=i;a.set("visible",s),a.set("stroke",o),l?.set("visible",s),l?.set("fill",k.lighten(o,t.seriesFillLighten)),a.data.setAll(n),l?.data.setAll(n)}function nt(t,i){const{id:e}=i,o=st(t,`${H}-${e}`),n=at(t);o.setAll({dy:i.chartStrokeOffsetY,tooltip:n}),o.strokes.template.setAll({strokeWidth:i.chartStrokeWidth});let s=null;return i.chartFillEnabled&&(s=st(t,`${B}-${e}`),s.fills.template.setAll({fillOpacity:1,visible:!0})),{id:e,line:o,fill:s}}function st(t,i){return M.new(t.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:i,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:t.xAxis,yAxis:t.yAxis})}function at({theme:t,chart:i,rtl:e}){const o=X.new(i.root,{autoTextColor:!1,forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),n=t.seriesTooltipPaddingHorizontal,s=t.seriesTooltipPaddingVertical;return o.label.setAll({fill:F(t.seriesTooltipLabelColor),fontFamily:t.fontFamily,fontSize:t.seriesTooltipFontSize,paddingBottom:s,paddingLeft:n,paddingRight:n,paddingTop:s,textAlign:e?"end":"start",direction:"ltr"}),o.get("background")?.setAll({stroke:void 0,fill:F(t.seriesTooltipBackgroundColor)}),o.adapters.add("dy",(i=>{const e=t.seriesTooltipSpacing,n=o.get("pointTo")?.y??0;return(i??0)+(o.y()>n?e:-e)})),o}function lt(t,i){const{xAxis:e,yAxis:o}=t,n=()=>{i(rt(e),rt(o))},s=t=>[t.on("start",n),t.on("end",n)];return bt([...s(e),...s(o)])}function rt(t){const i=Math.abs((t.get("end")??0)-(t.get("start")??0)),e=0!==i?1/i:1;return Math.abs(1-e)<d()?1:e}function dt(t,i){const{chart:e,xAxis:o,yAxis:n}=t,s=e.get("cursor"),a=e.plotContainer.events,l=i=>{t.pointerIsOver=i,pt(t)},r=()=>{l(!1),i(null,null)};return bt([s?.events.on("cursormoved",(()=>{if(!t.pointerIsOver)return;pt(t);let e=s?.getPrivate("positionX")??0,a=s?.getPrivate("positionY")??0;const l=t.data;if(null!=l?.statistics){const{maxDistance:t,minElevation:i,maxElevation:s}=l.statistics;let r,d;if(null!=t){1===rt(o)?(r=0,d=t):(r=At(o),d=vt(o)),e=ct(e,r,d,0,t)}if(null!=i&&null!=s){1===rt(n)?(r=i,d=s):(r=At(n),d=vt(n)),a=ct(a,r,d,i,s)}}i(e,a)})),a.on("pointerover",(()=>l(!0))),a.on("pointerout",r),a.on("blur",r)])}function ct(t,i,e,o,n){return(i+t*(e-i)-o)/(n-o)}function pt(t){const i=mt(t);if(!i)return void t.seriesInfos.forEach((t=>{t.line.get("tooltip")?.set("forceHidden",!0)}));t.seriesInfos.forEach((t=>{const e=t.line.get("tooltip");e.set("forceHidden",!1),e.label.set("text",i)}));t.xAxis.getTooltip().setAll({tooltipText:xt(t)})}function mt(t){const{data:i}=t,e=i?.lines.map((i=>({line:i,y:ht(t,i)?.elevation}))).sort(ut);return e&&0!==e.length&&null!=e[0].y?e.map((({y:i,line:e})=>ft(t,e,i))).join("\n"):null}function ut({y:t},{y:i}){return null==t?1:null==i?-1:i-t}function ft(t,i,e){const{data:o,messages:n}=t;if(null==o||null==n)return"";const s=`[${i.color.toHex()}]●[/]`,l=" ",r=c().formatPrecision,d=Y(n.chartTooltip,{name:m(i,n),elevation:null!=e?a(n,e,o.effectiveUnits.elevation,r):p});return t.rtl?d+l+s:s+l+d}function xt(t){const{data:i,messages:e}=t;if(null==i||null==e)return"";const o=i.lines[0],n=o?ht(t,o):null,s=c().formatPrecision;return null!=n?a(e,n.distance,i.effectiveUnits.distance,s):"-"}function gt(t,i){const e=g.new(t.chart.root,{});return e.format=(e,o,n)=>{const{data:s,messages:a}=t;if(null==a||null==s||"string"==typeof e)return"";return`${z(e,{maximumFractionDigits:n})} ${l(a,s.effectiveUnits[i],"abbr")}`},e}function ht({chart:t,xAxis:i},e){const o=e.samples??[];if(0===o.length)return null;const n=t.get("cursor"),s=n?.getPrivate("positionX")??0,a=i.toAxisPosition(s),l=i.positionToValue(a);return f(o,l,(t=>t.distance))}function At(t){return t.positionToValue(t.get("start")??0)}function vt(t){return t.positionToValue(t.get("end")??1)}function bt(t){return e(t.map(yt))}function yt(t){return o((()=>{t?.dispose()}))}export{I as createChart,_ as getAdjustedBounds};
@@ -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{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as h}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkTheme as f}from"../../support/themeUtils.js";import{substitute as _}from"../../intl/substitute.js";const g="esri-feature-media",v={base:g,mediaContainer:`${g}__container`,mediaItemContainer:`${g}__item-container`,mediaItem:`${g}__item`,mediaItemText:`${g}__item-text`,mediaItemTitle:`${g}__item-title`,mediaItemCaption:`${g}__item-caption`,mediaNavigation:`${g}__item-navigation`,mediaPagination:`${g}__pagination`,mediaPaginationText:`${g}__pagination-text`,mediaPrevious:`${g}__previous`,mediaPreviousIconLTR:`${g}__previous-icon`,mediaPreviousIconRTL:`${g}__previous-icon--rtl`,mediaNext:`${g}__next`,mediaNextIconLTR:`${g}__next-icon`,mediaNextIconRTL:`${g}__next-icon--rtl`,mediaChart:`${g}__chart`,mediaPaginationButton:`${g}__pagination-button`,mediaPaginationIcon:`${g}__pagination-icon`,mediaChartRendered:`${g}__chart--rendered`},M=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new d,this.addHandles([i((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),r),i((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),r)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:v.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:v.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:v.mediaNavigation},i,e>1?u("div",{class:v.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:v.mediaPaginationText},_(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:v.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:v.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:v.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=a,p=m(c??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",f=o?t:null,_=f?f.timestamp:0,g=f?f.sourceURL:d,v=u("img",{alt:s||n,key:`media-${l}-${i}-${r}-${_}`,src:g??void 0});return(c?u("a",{href:c,rel:h,target:p,title:n},v):null)??v}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:v.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:v.mediaItemContainer,key:"media-container"},u("div",{class:v.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:v.mediaPaginationButton,key:a,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:v.mediaPaginationIcon,icon:r,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach((e=>{e.color&&i.set(e,t(e.color.toCss(!0)))})),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await s(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const p=[o.new(t),c];f()&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const h=await this._getRendererColors(),u=await this._getSeriesColors(r.series),_=l.new(t,{}),g=u.get(r.series[0]),v=g?{lineSettings:{stroke:g}}:void 0,M=r.series.map(((e,t)=>{const i=u.get(e)||h.get(e.fieldName)||_.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},...v}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,M):this._createXYChart(e,M)}_getDirection(){return p(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(r.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(s,{labelText:c}),h=m.series.push(a.new(s,{name:n,valueField:A,categoryField:w,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),h.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(v.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:v}));this._customizeChartTooltip(v),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:p(this.container)}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryY}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:_,yAxis:f,valueXField:A,categoryYField:w,tooltip:v}));this._customizeChartTooltip(v,"vertical"),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=i[0]?.lineSettings?.stroke,I=r.new(m,{getFillFromSprite:!v,labelText:g});v&&I.get("background")?.setAll({fill:v});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(I,"vertical"),h.series.length>M&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),C.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(v.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([a()],T.prototype,"_refreshIntervalInfo",void 0),e([a()],T.prototype,"attributes",null),e([a()],T.prototype,"activeMediaInfoIndex",null),e([a()],T.prototype,"description",null),e([a()],T.prototype,"fieldInfoMap",null),e([a()],T.prototype,"layer",null),e([a()],T.prototype,"mediaInfos",null),e([a()],T.prototype,"popupTemplate",null),e([a()],T.prototype,"relatedInfos",null),e([a()],T.prototype,"title",null),e([a({type:l})],T.prototype,"viewModel",void 0),e([a(),h("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);const b=T;export{b as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{prefersReducedMotion as t}from"../../core/a11yUtils.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{getColorsFromRenderer as s}from"../../renderers/support/utils.js";import n from"../Widget.js";import l from"./FeatureMedia/FeatureMediaViewModel.js";import d from"./support/FeatureElementInfo.js";import{shouldOpenInNewTab as m}from"./support/featureUtils.js";import{loadCalciteComponents as c}from"../support/componentsUtils.js";import{isRTL as p}from"../support/widgetUtils.js";import{messageBundle as h}from"../support/decorators/messageBundle.js";import{tsx as u}from"../support/jsxFactory.js";import{isDarkMode as f}from"../../support/modeUtils.js";import{substitute as _}from"../../intl/substitute.js";const g="esri-feature-media",v={base:g,mediaContainer:`${g}__container`,mediaItemContainer:`${g}__item-container`,mediaItem:`${g}__item`,mediaItemText:`${g}__item-text`,mediaItemTitle:`${g}__item-title`,mediaItemCaption:`${g}__item-caption`,mediaNavigation:`${g}__item-navigation`,mediaPagination:`${g}__pagination`,mediaPaginationText:`${g}__pagination-text`,mediaPrevious:`${g}__previous`,mediaPreviousIconLTR:`${g}__previous-icon`,mediaPreviousIconRTL:`${g}__previous-icon--rtl`,mediaNext:`${g}__next`,mediaNextIconLTR:`${g}__next-icon`,mediaNextIconRTL:`${g}__next-icon--rtl`,mediaChart:`${g}__chart`,mediaPaginationButton:`${g}__pagination-button`,mediaPaginationIcon:`${g}__pagination-icon`,mediaChartRendered:`${g}__chart--rendered`},M=15,w="category",A="value",I="rgba(50, 50, 50, 1)",C=250,y=500,x=200;let T=class extends n{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new l,this.messages=null,this._disposeChart=e=>{this._chartRootMap.get(e)?.dispose(),this._chartRootMap.delete(e)},this._createChart=async e=>{const{destroyed:t,viewModel:i}=this;if(t||!i||!e)return;const{createRoot:r}=await import("../support/chartUtilsAm5.js"),a=await r(e);this._chartRootMap.set(e,a),this._renderChart({mediaInfo:i.activeMediaInfo,root:a})}}initialize(){this._featureElementInfo=new d,this.addHandles([i((()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex]),(()=>this._setupMediaRefreshTimer()),r),i((()=>[this.viewModel?.description,this.viewModel?.title]),(()=>this._setupFeatureElementInfo()),r)])}loadDependencies(){return c({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo?.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){return u("div",{bind:this,class:v.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:v.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:v.mediaNavigation},i,e>1?u("div",{class:v.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:v.mediaPaginationText},_(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:v.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:v.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:v.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:r}=this.viewModel,{value:a,refreshInterval:o,altText:s,title:n,type:l}=e,{sourceURL:d,linkURL:c}=a,p=m(c??void 0)?"_blank":"_self",h="_blank"===p?"noreferrer":"",f=o?t:null,_=f?f.timestamp:0,g=f?f.sourceURL:d,v=u("img",{alt:s||n,key:`media-${l}-${i}-${r}-${_}`,src:g??void 0});return(c?u("a",{href:c,rel:h,target:p,title:n},v):null)??v}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:v.mediaChart,key:`media-${e.type}-${t}-${i}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?"image"===e.type?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:v.mediaItemContainer,key:"media-container"},u("div",{class:v.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t="previous"===e,i=t?this.messages.previous:this.messages.next,r=t?"chevron-left":"chevron-right",a=t?"media-previous":"media-next",o=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:v.mediaPaginationButton,key:a,onclick:o,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:v.mediaPaginationIcon,icon:r,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await import("./FeatureMedia/chartCommon.js"),i=new Map;return e.forEach((e=>{e.color&&i.set(e,t(e.color.toCss(!0)))})),i}async _getRendererColors(){const{colorAm5:e}=await import("./FeatureMedia/chartCommon.js"),t=new Map,i=this._getRenderer(),r="default";if(!i)return t;const a=await s(i);a.delete(r);return Array.from(a.values()).every((e=>1===e?.length))?(Array.from(a.keys()).forEach((i=>{const r=a.get(i)?.[0]?.toCss(!0);r&&t.set(i,e(r))})),t):t}_handleMediaKeyup(e){const{key:t}=e;"ArrowLeft"===t&&(e.stopPropagation(),this.viewModel.previous()),"ArrowRight"===t&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&(!!this.viewModel.abilities.chartAnimation&&!t())}_getChartAnimationMS(){return this._canAnimateChart()?C:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?y:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:r,type:a}=i,{ResponsiveThemeAm5:o,DarkThemeAm5:s,AnimatedThemeAm5:n,ColorSetAm5:l,ThemeAm5:d,esriChartColorSet:m}=await import("./FeatureMedia/chartCommon.js"),c=d.new(t);c.rule("ColorSet").set("colors",m),c.rule("ColorSet").set("reuse",!0);const p=[o.new(t),c];f()&&p.push(s.new(t)),this._canAnimateChart()&&p.push(n.new(t)),t.setThemes(p);const h=await this._getRendererColors(),u=await this._getSeriesColors(r.series),_=l.new(t,{}),g=u.get(r.series[0]),v=g?{lineSettings:{stroke:g}}:void 0,M=r.series.map(((e,t)=>{const i=u.get(e)||h.get(e.fieldName)||_.getIndex(t);return{[w]:e.tooltip,[A]:e.value,columnSettings:{fill:i,stroke:i},...v}})).filter((e=>"pie-chart"!==a||null!=e.value&&e.value>0));"pie-chart"===a?this._createPieChart(e,M):this._createXYChart(e,M)}_getDirection(){return p(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await import("./FeatureMedia/chartCommon.js");e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(I)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:x})}async _createPieChart(e,t){const{TooltipAm5:i}=await import("./FeatureMedia/chartCommon.js"),{PieChartAm5:r,PieSeriesAm5:a}=await import("./FeatureMedia/pieChart.js"),{mediaInfo:o,root:s}=e,{title:n}=o,l=5,d=o?.altText||o?.title||"",m=s.container.children.push(r.new(s,{ariaLabel:d,focusable:!0,paddingBottom:l,paddingTop:l,paddingLeft:l,paddingRight:l})),c="{category}: {valuePercentTotal.formatNumber('0.00')}%\n ({value})",p=i.new(s,{labelText:c}),h=m.series.push(a.new(s,{name:n,valueField:A,categoryField:w,tooltip:p}));h.ticks.template.set("forceHidden",!0),h.labels.template.set("forceHidden",!0),h.slices.template.states.create("active",{shiftRadius:l}),this._customizeChartTooltip(p),h.slices.template.setAll({ariaLabel:c,focusable:!0,templateField:"columnSettings"}),h.data.setAll(t),h.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(v.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach((e=>t=Math.min(e.value,t))),t}async _createColumnChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(c,{renderer:s.new(c,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(c,{renderer:l.new(c,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:v}));this._customizeChartTooltip(v),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarX",a.new(c,{orientation:"horizontal"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,ColumnSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{mediaInfo:m,root:c}=t,{value:h,title:u}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const f=e.yAxes.push(o.new(c,{renderer:l.new(c,{inversed:!0}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.xAxes.push(n.new(c,{renderer:s.new(c,{inside:!1,inversed:p(this.container)}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryY}",v=r.new(c,{labelText:g}),I=e.series.push(d.new(c,{name:u,xAxis:_,yAxis:f,valueXField:A,categoryYField:w,tooltip:v}));this._customizeChartTooltip(v,"vertical"),I.columns.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),h.series.length>M&&e.set("scrollbarY",a.new(c,{orientation:"vertical"})),f.data.setAll(i),I.data.setAll(i),I.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:r,ScrollbarAm5:a}=await import("./FeatureMedia/chartCommon.js"),{CategoryAxisAm5:o,AxisRendererXAm5:s,ValueAxisAm5:n,AxisRendererYAm5:l,LineSeriesAm5:d}=await import("./FeatureMedia/xyChart.js"),{root:m,mediaInfo:c}=t,{value:h,title:u}=c;e.setAll({wheelX:"panX",wheelY:"zoomX"});const f=e.xAxes.push(o.new(m,{renderer:s.new(m,{inversed:p(this.container)}),categoryField:w}));f.get("renderer").labels.template.setAll({forceHidden:!0});const _=e.yAxes.push(n.new(m,{renderer:l.new(m,{inside:!1}),min:this._getMinSeriesValue(h.series)}));_.get("renderer").labels.template.setAll({direction:this._getDirection()});const g="{categoryX}",v=i[0]?.lineSettings?.stroke,I=r.new(m,{getFillFromSprite:!v,labelText:g});v&&I.get("background")?.setAll({fill:v});const C=e.series.push(d.new(m,{name:u,xAxis:f,yAxis:_,valueYField:A,categoryXField:w,tooltip:I}));C.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(I,"vertical"),h.series.length>M&&e.set("scrollbarX",a.new(m,{orientation:"horizontal"})),f.data.setAll(i),C.data.setAll(i),C.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:r}=await import("./FeatureMedia/xyChart.js"),{root:a,mediaInfo:o}=e,{type:s}=o,n=o?.altText||o?.title||"",l=a.container.children.push(i.new(a,{ariaLabel:n,focusable:!0,panX:!0,panY:!0}));l.set("cursor",r.new(a,{})),"column-chart"===s&&await this._createColumnChart(l,e,t),"bar-chart"===s&&await this._createBarChart(l,e,t),"line-chart"===s&&await this._createLineChart(l,e,t),l.root.dom.classList.toggle(v.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;"image"===e?.type&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,r=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const a=setInterval((()=>{this._updateMediaInfoTimestamp(i.sourceURL)}),r);this._refreshTimer=a}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[r,a=""]=e.split("#");return`${r}${i}timestamp=${t}${a?"#":""}${a}`}};e([a()],T.prototype,"_refreshIntervalInfo",void 0),e([a()],T.prototype,"attributes",null),e([a()],T.prototype,"activeMediaInfoIndex",null),e([a()],T.prototype,"description",null),e([a()],T.prototype,"fieldInfoMap",null),e([a()],T.prototype,"layer",null),e([a()],T.prototype,"mediaInfos",null),e([a()],T.prototype,"popupTemplate",null),e([a()],T.prototype,"relatedInfos",null),e([a()],T.prototype,"title",null),e([a({type:l})],T.prototype,"viewModel",void 0),e([a(),h("esri/widgets/Feature/t9n/Feature")],T.prototype,"messages",void 0),T=e([o("esri.widgets.Feature.FeatureMedia")],T);const b=T;export{b 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/loadArcade.js";import{getTimeZoneFormattingOptions as p}from"../../../time/timeZoneUtils.js";const y="esri.widgets.Feature.support.featureUtils",m=()=>e.getLogger(y),b=/href=(""|'')/gi,g=/(\{([^{\r\n]+)\})/g,I=/'/g,h=/^\s*expression\//i,w=/(\n)/gi,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 A(e,t){const n=v(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function C(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}function U(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?z({formattedAttributes:t,template:P(r,{...t,...i,...e},n),fieldInfoMap:o}):""}function z({formattedAttributes:e,template:n,fieldInfoMap:r}){return k(U(t(t(n,(e=>C(e,r))),e)))}function O(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",o=(n?encodeURIComponent(r):r).replaceAll(I,i);t[e]=o}}function 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(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-group"===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?.allSublayers,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,A 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,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 r,formatDate as n}from"../../../intl/date.js";import{formatNumber as i,convertNumberFormatToIntlOptions as o}from"../../../intl/number.js";import{isRasterPixelValueField as a,featureHasFields as l,isTimeOnlyField as u}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as s}from"../../../layers/support/layerUtils.js";import{formatAnyDate as f,isAnyDateField as c}from"../../../smartMapping/support/utils.js";import{loadArcade as d}from"../../../support/loadArcade.js";import{getTimeZoneFormattingOptions as p}from"../../../time/timeZoneUtils.js";const y="esri.widgets.Feature.support.featureUtils",m=()=>e.getLogger(y),b=/href=(""|'')/gi,g=/(\{([^{\r\n]+)\})/g,h=/'/g,I=/^\s*expression\//i,w=/(\n)/gi,T=/[\u00A0-\u9999<>&]/gim,F=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,N=/^(?:mailto:|tel:)/,j="relationships/",Z=r("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:r}){try{return"function"==typeof t?t(r):await t}catch(n){return void m().error("error",`An error occurred when calling the "${e}" function`,{error:n,graphic:r.graphic,value:t})}}function x(e=""){if(e)return!N.test(e.trim().toLowerCase())}function E(e){return!!e&&I.test(e)}function v(e,t){if(!t||!E(t)||!e)return;const r=t.replace(I,"").toLowerCase();return e.find((({name:e})=>e.toLowerCase()===r))}function A(e,t){const r=v(t,e?.fieldName);return r?r.title||null:e?e.label||e.fieldName:null}function C(e,t){const r=t.get(e.toLowerCase());return`{${r?.fieldName||e}}`}function U(e){return e.replaceAll(b,"")}function M(e,t){const r=k(t,e);return r?r.name:e}function R(e,t){return e&&e.map((e=>M(e,t)))}function k(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function $(e){return`${e}`.trim()}function D({attributes:e,globalAttributes:t,layer:r,text:n,expressionAttributes:i,fieldInfoMap:o}){return n?z({formattedAttributes:t,template:P(n,{...t,...i,...e},r),fieldInfoMap:o}):""}function z({formattedAttributes:e,template:r,fieldInfoMap:n}){return $(U(t(t(r,(e=>C(e,n))),e)))}function O(e,t,r=!1){const n=t[e];if("string"==typeof n){const i="%27",o=(r?encodeURIComponent(n):n).replaceAll(h,i);t[e]=o}}function G(e,t=!1){const r={...e};return Object.keys(r).forEach((e=>O(e,r,t))),r}function S(e,r,n){const i=(r=$(r))&&"{"!==r[0];return t(e,G(n,i||!1))}function Q(e,t){return e.replaceAll(g,((e,r,n)=>{const i=k(t,n);return i?`{${i.name}}`:r}))}function P(e,t,r){const n=Q(e,r);return n?n.replaceAll(F,((e,r,n)=>S(e,r||n,t))):n}function _(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}function H(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function 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:r,fieldName:n,preventPlacesFormatting:l,layer:u,timeZone:s}=t,c=ee(r,n),d=k(u,n);if(c&&!a(n)){const t=d?.type,r=c.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||r)return f(e,{format:r,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(n)&&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,r,n){return e.trim().split(t).map((e=>i(Number(e),o(n)))).join(r)}function ee(e,t){if(e?.length&&t)return e.find((e=>e.fieldName?.toLowerCase()===t.toLowerCase()))}function te({fieldName:e,graphic:t,layer:r}){if(pe(e))return null;if(!r||"function"!=typeof r.getFeatureType)return null;const{typeIdField:n}=r;if(!n||e!==n)return null;const i=r.getFeatureType(t);return i?i.name:null}function re({fieldName:e,value:t,graphic:r,layer:n}){if(pe(e))return null;if(!n||"function"!=typeof n.getFieldDomain)return null;const i=r&&n.getFieldDomain(e,{feature:r,excludeImpliedDomains:has("esri-widget-legacy-field-domain-calculation")});return i&&"coded-value"===i.type?i.getName(t):null}function ne(e,t,r,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,r,Z,"date"),f={...Z,...s},c=t[u];if("number"==typeof c){const e=t[l];return{type:"edit",date:n(c,f),user:e}}const d=t[a];if("number"==typeof d){const e=t[o];return{type:"create",date:n(d,f),user:e}}return null}function ie(e,t){const r=new Map;if(!e)return r;for(const n of e){if(!n.fieldName)continue;const e=M(n.fieldName,t);n.fieldName=e,r.set(e.toLowerCase(),n)}return r}function oe(e){const t=[];if(!e)return t;const{fieldInfos:r,content:n}=e;return r&&t.push(...r),n&&Array.isArray(n)?(n.forEach((e=>{if("fields"===e.type){const r=e?.fieldInfos;r&&t.push(...r)}})),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:r,fieldInfos:n,fieldInfoMap:i,layer:o,graphic:a,timeZone:l}=e;if(null==t)return"";const s=re({fieldName:r,value:t,graphic:a,layer:o});if(s)return s;const d=te({fieldName:r,graphic:a,layer:o});if(d)return d;if(i.get(r.toLowerCase()))return W(t,{fieldInfos:n||Array.from(i.values()),fieldName:r,layer:o,timeZone:l});const p=o?.fieldsIndex?.get(r);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:r,graphic:n,fieldInfoMap:i,relatedInfos:o,timeZone:a}){const l={};return o?.forEach((t=>be({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:r,timeZone:a}))),t&&Object.keys(t).forEach((o=>{const u=t[o];l[o]=ue({fieldName:o,fieldInfos:e,fieldInfoMap:i,layer:r,value:u,graphic:n,timeZone:a})})),l}async function fe(e,t){const{layer:r,graphic:n,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:r,graphic:n,objectId:u,requiredFields:i};return m().warn(e,t),null}if(!s(r)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:r,graphic:n,requiredFields:i,returnGeometry:a};return m().warn(e,t),null}const f=r.createQuery();f.objectIds=o,f.outFields=i?.length?i:[r.objectIdField],f.returnGeometry=!!a,f.returnZ=!!a,f.returnM=!!a,f.outSpatialReference=l;return(await r.queryFeatures(f,t)).features[0]}async function ce(e){if(!e.expressionInfos?.length)return!1;const t=await d(),{arcadeUtils:{hasGeometryFunctions:r}}=t;return r(e)}async function de({graphic:e,popupTemplate:t,layer:r,spatialReference:n},i){if(!r||!t)return;if("function"==typeof r.load&&await r.load(i),!e.attributes)return;const o=r.objectIdField,a=e.attributes[o];if(null==a)return;const u=[a],s=await t.getRequiredFields(r.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:r,graphic:e,outFields:c,objectIds:u,returnGeometry:d,spatialReference:n},i);p&&(p.geometry&&(e.geometry=p.geometry),p.attributes&&(e.attributes={...e.attributes,...p.attributes}))}function pe(e=""){return!!e&&e.includes(j)}function ye(e){return`${j}${e.layerId}/${e.fieldName}`}function me({attributes:e,graphic:t,relatedInfo:r,fieldInfos:n,fieldInfoMap:i,layer:o,timeZone:a}){e&&t&&r&&Object.keys(t.attributes).forEach((l=>{const u=ye({layerId:r.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=ue({fieldName:u,fieldInfos:n,fieldInfoMap:i,layer:o,value:s,graphic:t,timeZone:a})}))}function be({attributes:e,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i,timeZone:o}){e&&t&&(t.relatedFeatures?.forEach((a=>me({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,layer:i,timeZone:o}))),t.relatedStatsFeatures?.forEach((a=>me({attributes:e,graphic:a,relatedInfo:t,fieldInfoMap:r,fieldInfos:n,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")},he=({layer:e,method:t,query:r,definitionExpression:n})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=r.where?r.where:null,o=null!=r.geometry?r.geometry:null;ge(n)||ge(i)||"extent"===o?.type||"tile"===r.resultType||(r.cacheHint=!0)},Ie=({query:e,layer:t,method:r})=>{he({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},we=({queryPayload:e,layer:t,method:r})=>{he({layer:t,method:r,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Te(e,t,r){return e&&t&&r?"sublayer"===t.type?je({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:r})||je({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:r}):je({layers:e.allLayers,map:e,relatedLayer:t,relationship:r})||je({layers:e.allTables,map:e,relatedLayer:t,relationship:r}):null}function Fe(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find((e=>e.isUtilityLayer(t))):null}function Ne(e,t){return e?.allTables.find((e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url))}function je({map:e,relationship:t,relationship:{relatedTableId:r},relatedLayer:n,layers:i}){if(!i)return null;for(const o of i){if("map-image"===o.type){const r=je({layers:o.sublayers,map:e,relatedLayer:n,relationship:t})||je({layers:o.subtables,map:e,relatedLayer:n,relationship:t});if(r)return r;continue}if(!J(o))continue;if("sublayer"===n.type){if(o!==n&&o.id===r)return o.isTable?Ne(e,o):o;continue}const i="scene"===n.type&&n.associatedLayer?n.associatedLayer.url:n.url;if(!i)return null;if("sublayer"!==o.type){if(o!==n&&o.url===i&&o.layerId===r)return o}else if(o!==n&&o.layer?.url===i&&o.id===r)return o.isTable?Ne(e,o):o}return null}export{le as applyTextFormattingHTML,ie as createFieldInfoMap,Te as findRelatedLayer,Fe as findUtilityNetwork,Q as fixTokens,se as formatAttributes,ne as formatEditInfo,W as formatValueToFieldInfo,oe as getAllFieldInfos,ee as getFieldInfo,A as getFieldInfoLabel,M as getFixedFieldName,R as getFixedFieldNames,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,Ie as preLayerQueryCallback,we as preRequestCallback,fe as querySourceLayer,de as queryUpdatedFeature,x as shouldOpenInNewTab,z 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"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as i}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as n,watch as o}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../Widget.js";import a from"./GridViewModel.js";import{globalCss as h}from"../../support/globalCss.js";import{renderingSanitizer as u}from"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as c}from"../../support/jsxFactory.js";const m="esri-grid",p="compact column-borders",_={base:m,content:`${m}__content`,grid:`${m}__grid`,noDataMessage:`${m}__no-data-message`},f={sort:["Enter"," "]};let v=class extends d{constructor(e,t){super(e,t),this._columnElements=[],this._grid=null,this._temporaryHighlightId=null,this.itemIdPath="objectId",this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new a,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on("before-changes",(()=>this.renderNow())),this.columns.on("change",(()=>this.onColumnChange())),n((()=>this.highlightIds),"before-add",(({target:e})=>{!this.multipleSelectionEnabled&&e.length&&e.removeAll()})),this.rowHighlightIds.on("change",(()=>this.generateCellPartNames())),o((()=>this.effectiveSize),(()=>this._updateGridSize())),o((()=>this.isEditing),(()=>{this.generateCellPartNames(),this.requestContentUpdate()})),o((()=>this.store?.state),((e,t)=>{"ready"!==e||"loaded"!==t&&"error"!==t||this.refreshPageCache()})),n((()=>this._table),"scroll",(()=>this.viewModel.closeColumnMenus())),n((()=>this._table),"scrollend",(()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex())})),o((()=>this.multipleSelectionEnabled),(e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()}))])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}get _columnRendering(){return this.columnPerformanceModeEnabled?"lazy":"eager"}get _selectedItems(){const{highlightIds:e,store:t}=this;return e.toArray().map((e=>t?.getItemByObjectId(e)??{objectId:e}))}get _noDataMessage(){return u.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this._temporaryHighlightId}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter((e=>!!e&&e.path)).map((({direction:e,path:t})=>({direction:e,path:t}))):[]}get store(){return this.viewModel.store}set store(e){this.viewModel.store=e}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange("sortOrders")}getColumnProps(e,t){const{id:i}=this,{autoWidth:r,direction:n,fieldName:o,flexGrow:l,frozen:s,frozenToEnd:d,hidden:a,label:h,resizable:u,textAlign:g,width:c}=e,m=`${i}_${o}_${t}`,{renderFunction:p,footerRenderFunction:_,headerRenderFunction:f}=e,v=_?(e,t)=>_({root:e,column:t}):void 0,y=f?(e,t)=>f({root:e,column:t}):void 0,C=p?(e,t,i)=>p({root:e,column:t,rowData:i}):void 0;let w="";return e.direction&&(w+=" direction"),e.invalid&&(w+=" invalid"),{footerRenderer:v,headerRenderer:y,renderer:C,autoWidth:r,direction:n,flexGrow:l,frozen:s,frozenToEnd:d,headerPartName:w,key:m,resizable:u,bind:this,"data-fieldName":o,header:h,hidden:this.hasInvalidColumnConfiguration||a,path:o,"text-align":g,width:"number"==typeof c?`${c}px`:c,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;if(this._grid){if(this._grid._sorters?.length&&(this._grid._sorters.forEach((e=>{e._order=null,e.direction=null})),e=!0),this.columns.length){this.columns.some((e=>!!e.direction))&&(this.columns.forEach((e=>e.direction=null)),e=!0)}e&&(this.notifyChange("sortOrders"),this.scheduleRender())}}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),await(this.store?.reset()),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this._temporaryHighlightId=null}requestContentUpdate(){this._grid?.requestContentUpdate(),this._temporaryHighlightId=null}selectRows(e){const{itemIdPath:t}=this,i=e?.filter((e=>!this.highlightIds.includes(e[t]))),r=i.map((e=>e[t]));r.length&&(this.multipleSelectionEnabled||(this.highlightIds.removeAll(),r.splice(1)),this.highlightIds.addMany(r))}deselectRows(e){const{itemIdPath:t}=this,i=e?.map((e=>e[t]))||[];i.length&&this.highlightIds.removeMany(i)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange("sortOrders")}scrollToIndex(e){0!==this.size&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this._temporaryHighlightId=null)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){const{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach((e=>{this._applyRenderersToColumnElement(e)})),this.requestContentUpdate()}render(){return c("div",{bind:this,class:this.classes(_.base,h.widget)},c("div",{bind:this,class:_.content},this._renderGrid()))}_renderGrid(){return c("vaadin-grid",{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:_.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,pageSize:this.pageSize,ref:"grid",rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return"disabled"!==this.state&&this.columns.length?[this._renderSelectionColumn(),this._renderColumns()]:null}_renderSelectionColumn(){return c("vaadin-grid-selection-column",{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:"center"})}_renderColumns(){return Array.from(this.columns,((e,t)=>"columns"in e?this._renderGroupColumn(e,t):c("vaadin-grid-column",{...this.getColumnProps(e,t)}))).filter(t)}_renderGroupColumn(e,t){const i=this.getColumnProps(e,t);if(i.hidden||!e.columns)return null;const r=e.columns.filter((({hidden:e})=>!e));return r.length?c("vaadin-grid-column-group",{...i},r.map((e=>c("vaadin-grid-column",{...this.getColumnProps(e,t)})))):null}_renderEmptyState(){const e=this.viewModel;if("loaded"===e.state&&!e.isQueryingOrSyncing)return c("div",{class:_.noDataMessage,slot:"empty-state"},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){const t=this._grid=e;t.setAttribute("theme",p),customElements.whenDefined("vaadin-grid").then((()=>{this._appendStyles(),this._addGridEventListeners()})),t.__updateSorter=(e,i,r)=>{const n=t._sorters,o=!n.includes(e);if(!e.direction&&o)return;e._order=null;const{multiSort:l,multiSortOnShiftClick:s,multiSortPriority:d}=t,a=n.filter((t=>t!==e));l&&(!s||!r)||s&&i?null!=e._initialOrder?(o?n[e._initialOrder]=e:n.splice(e._initialOrder,0,e),e._initialOrder=null):t._sorters="append"===d?[...a,e]:[e,...a]:(e.direction||s)&&(t._sorters=e.direction?[e]:[],a.forEach((e=>{e._order=null,e.direction=null})))},t.__removeSorters=e=>{if(0===e.length)return;const i=new Set(e.filter((e=>!e.direction)));t._sorters=t._sorters.filter((e=>!i.has(e))),t.__applySorters()}}_appendStyles(){const e=this._grid?.shadowRoot,t=document.createElement("style");e&&(t.textContent='\n #items [part~="row"][editing],\n #items [part~="row"][editing][selected] {\n z-index: 2;\n }\n\n #items [part~="editing"],\n #items [part~="editing"][selected] {\n z-index: 3;\n }\n\n [frozen], [frozen-to-end] {\n z-index: 4;\n }\n\n [last-frozen] {\n overflow: visible;\n }\n\n [part~=\'cell\'] ::slotted(vaadin-grid-cell-content) {\n align-items: center;\n box-sizing: border-box !important;\n height: 100%;\n line-height: 2em;\n min-height: 40px;\n }\n\n #items [part~="text-wrap"] {\n text-wrap: wrap;\n }\n ',e.appendChild(t))}_afterGridUpdate(e){this._grid||(this._grid=e)}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){const t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){const e=this._grid;r(e),this.addHandles([i(e,["click","dblclick","keydown","pointerover","pointerout"],(e=>this._onGridInteraction(e))),i(e,["pointerover","pointerout","cell-focus"],(e=>this._onTransientGridInteraction(e))),i(e,"selected-items-changed",this._onSelectedItemsChange),i(e,"sorter-changed",(()=>this.notifyChange("sortOrders"))),i(e,"column-resize",(e=>{const t=e.detail.resizedColumn,i=t.getAttribute("data-fieldName"),r=this.findColumn(i);r?.set({width:t.width})})),i(e,"column-reorder",(()=>this._onColumnOrderChange()))])}_onGridInteraction(e){const t=this._grid;if(r(t),("pointerover"===e.type||"pointerout"===e.type)&&e.relatedTarget!==t){const{target:t,relatedTarget:i}=e;if(!this._isGridCellContentNode(t)||!this._isGridCellContentNode(i))return}let i=null;try{i=t.getEventContext(e)}catch(a){}if(!i)return;const{column:n,index:o,item:l,section:s}=i;if(!s)return;if("header"===s&&"keydown"===e.type&&n?.path){const t=e.key;f.sort.includes(t)&&this.findColumn(n.path)?.sort()}const d=`cell-${e.type}`;this.emit(d,{type:d,context:i,index:o,item:l,native:e,path:n?.path??void 0})}_onTransientGridInteraction(e){if("pointerout"===e.type)return void(this._temporaryHighlightId=null);const t=this._grid;if(t)try{const{item:i}=t.getEventContext(e);this._temporaryHighlightId=i?.objectId}catch{this._temporaryHighlightId=null}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&"vaadin-grid-cell-content"===e.localName)}_onColumnOrderChange(){const e=this._grid;r(e);const t=e._getColumnsInOrder(0),i=[],n=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map((e=>e.getAttribute("data-fieldName")));t?.forEach((e=>{const t=e.getAttribute("data-fieldName");if(null!=t){const e=this.findColumn(t);i.push(t),e&&"columns"in e&&e.columns?.length&&e.columns.sort(((e,t)=>n.indexOf(e.fieldName)>n.indexOf(t.fieldName)?1:-1))}})),this.columns.sort(((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1)),this.notifyChange("sortOrders"),this.emit("column-reorder",{type:"column-reorder"})}_clearSelection(){this.highlightIds.removeAll(),this._temporaryHighlightId=null}_onSelectedItemsChange(e){const{highlightIds:t,itemIdPath:i}=this,r=e.detail.value.map((e=>e[i])),n=r.filter((e=>!t.includes(e)));if(!this.multipleSelectionEnabled&&n.length&&t.length)t.removeAll(),t.add(n[0]);else{const e=t.filter((e=>!r.includes(e)));t.removeMany(e),t.addMany(n)}}_applyRenderersToColumnElement(e){const t=e?.path,i=null!=t?this.findColumn(t):void 0;if(i)try{const{renderFunction:t,footerRenderFunction:r,headerRenderFunction:n}=i;t&&"renderer"in e&&(e.renderer=(e,i,r)=>t({root:e,column:i,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),n&&(e.headerRenderer=(e,t)=>n({root:e,column:t}))}catch(r){}}};e([l()],v.prototype,"_columnElements",void 0),e([l()],v.prototype,"_columnRendering",null),e([l()],v.prototype,"_selectedItems",null),e([l()],v.prototype,"_grid",void 0),e([l()],v.prototype,"_noDataMessage",null),e([l()],v.prototype,"_table",null),e([l()],v.prototype,"_temporaryHighlightId",void 0),e([l()],v.prototype,"cellPartNameGenerator",null),e([l()],v.prototype,"columns",null),e([l()],v.prototype,"columnPerformanceModeEnabled",null),e([l()],v.prototype,"columnReorderingEnabled",null),e([l()],v.prototype,"dataProvider",null),e([l()],v.prototype,"editingEnabled",null),e([l()],v.prototype,"effectiveSize",null),e([l()],v.prototype,"groupColumns",null),e([l()],v.prototype,"hasInvalidColumnConfiguration",null),e([l()],v.prototype,"highlightIds",null),e([l()],v.prototype,"temporaryHighlightId",null),e([l()],v.prototype,"isEditing",null),e([l()],v.prototype,"isReady",null),e([l()],v.prototype,"itemIdPath",void 0),e([l()],v.prototype,"label",null),e([l(),g("esri/widgets/FeatureTable/t9n/FeatureTable")],v.prototype,"messages",void 0),e([l()],v.prototype,"multipleSelectionEnabled",null),e([l()],v.prototype,"multiSortEnabled",null),e([l()],v.prototype,"noDataMessage",null),e([l()],v.prototype,"pageIndex",null),e([l()],v.prototype,"pageSize",null),e([l()],v.prototype,"paginationEnabled",null),e([l()],v.prototype,"rowDetailsRenderer",null),e([l()],v.prototype,"rowHighlightIds",null),e([l()],v.prototype,"selectionColumnEnabled",void 0),e([l()],v.prototype,"size",null),e([l({readOnly:!0})],v.prototype,"sortOrders",null),e([l()],v.prototype,"store",null),e([l()],v.prototype,"state",null),e([l()],v.prototype,"viewModel",void 0),v=e([s("esri.widgets.FeatureTable.Grid.Grid")],v);const y=v;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"@vaadin/grid/vaadin-grid.js";import"@vaadin/grid/vaadin-grid-column-group.js";import"@vaadin/grid/vaadin-grid-selection-column.js";import"@vaadin/grid/vaadin-grid-sorter.js";import{isSome as t}from"../../../core/arrayUtils.js";import{on as i}from"../../../core/events.js";import{assertIsSome as r}from"../../../core/maybe.js";import{on as n,watch as o}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import d from"../../Widget.js";import a from"./GridViewModel.js";import{globalCss as h}from"../../support/globalCss.js";import{renderingSanitizer as u}from"../../support/widgetUtils.js";import{messageBundle as g}from"../../support/decorators/messageBundle.js";import{tsx as m}from"../../support/jsxFactory.js";const c="esri-grid",p="compact column-borders",_={base:c,content:`${c}__content`,grid:`${c}__grid`,noDataMessage:`${c}__no-data-message`},f={sort:["Enter"," "]};let v=class extends d{constructor(e,t){super(e,t),this._columnElements=[],this._grid=null,this._temporaryHighlightId=null,this.itemIdPath="objectId",this.messages=null,this.selectionColumnEnabled=!0,this.viewModel=new a,this._onSelectedItemsChange=this._onSelectedItemsChange.bind(this)}initialize(){this.addHandles([this.columns.on("before-changes",(()=>this.renderNow())),this.columns.on("change",(()=>this.onColumnChange())),n((()=>this.highlightIds),"before-add",(({target:e})=>{!this.multipleSelectionEnabled&&e.length&&e.removeAll()})),this.rowHighlightIds.on("change",(()=>this.generateCellPartNames())),o((()=>this.effectiveSize),(()=>this._updateGridSize())),o((()=>this.isEditing),(()=>{this.generateCellPartNames(),this.requestContentUpdate()})),o((()=>this.store?.state),((e,t)=>{"ready"!==e||"loaded"!==t&&"error"!==t||this.refreshPageCache()})),n((()=>this._table),"scroll",(()=>this.viewModel.closeColumnMenus())),n((()=>this._table),"scrollend",(()=>{this.paginationEnabled||(this.pageIndex=this.getVirtualPageIndex())})),o((()=>this.multipleSelectionEnabled),(e=>{!e&&this.highlightIds.length>1&&this.highlightIds.removeAll()}))])}destroy(){this.resetColumns(),this.columns.destroyed||this.columns.destroy()}resetColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}get _columnRendering(){return this.columnPerformanceModeEnabled?"lazy":"eager"}get _selectedItems(){const{highlightIds:e,store:t}=this;return e.toArray().map((e=>t?.getItemByObjectId(e)??{objectId:e}))}get _noDataMessage(){return u.sanitize(this.noDataMessage)}get _table(){return this._grid?.$?.table}get cellPartNameGenerator(){return this.viewModel.cellPartNameGenerator}set cellPartNameGenerator(e){this.viewModel.cellPartNameGenerator=e}get columns(){return this.viewModel.columns}set columns(e){this.viewModel.columns=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get dataProvider(){return this.viewModel.dataProvider}set dataProvider(e){this.viewModel.dataProvider=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get groupColumns(){return this.viewModel.groupColumns}get hasInvalidColumnConfiguration(){return this.viewModel.hasInvalidColumnConfiguration}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get temporaryHighlightId(){return this._temporaryHighlightId}get isEditing(){return this.viewModel.isEditing}get isReady(){return!!this._grid}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get rowDetailsRenderer(){return this.viewModel.rowDetailsRenderer}set rowDetailsRenderer(e){this.viewModel.rowDetailsRenderer=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get size(){return this.viewModel.size}get sortOrders(){return this._grid?._sorters?this._grid._sorters.filter((e=>!!e&&e.path)).map((({direction:e,path:t})=>({direction:e,path:t}))):[]}get store(){return this.viewModel.store}set store(e){this.viewModel.store=e}get state(){return this.viewModel.state}addSorter(e){this._grid?.__updateSorter(e,!1,!1),this.notifyChange("sortOrders")}getColumnProps(e,t){const{id:i}=this,{autoWidth:r,direction:n,fieldName:o,flexGrow:l,frozen:s,frozenToEnd:d,hidden:a,label:h,resizable:u,textAlign:g,width:m}=e,c=`${i}_${o}_${t}`,{renderFunction:p,footerRenderFunction:_,headerRenderFunction:f}=e,v=_?(e,t)=>_({root:e,column:t}):void 0,y=f?(e,t)=>f({root:e,column:t}):void 0,C=p?(e,t,i)=>p({root:e,column:t,rowData:i}):void 0;let w="";return e.direction&&(w+=" direction"),e.invalid&&(w+=" invalid"),{footerRenderer:v,headerRenderer:y,renderer:C,autoWidth:r,direction:n,flexGrow:l,frozen:s,frozenToEnd:d,headerPartName:w,key:c,resizable:u,bind:this,"data-fieldName":o,header:h,hidden:this.hasInvalidColumnConfiguration||a,path:o,"text-align":g,width:"number"==typeof m?`${m}px`:m,afterCreate:this._afterColumnCreate,afterRemoved:this._afterColumnRemoved}}clearSelection(){this._clearSelection(),this.scheduleRender()}clearSort(){let e=!1;if(this._grid){if(this._grid._sorters?.length&&(this._grid._sorters.forEach((e=>{e._order=null,e.direction=null})),e=!0),this.columns.length){this.columns.some((e=>!!e.direction))&&(this.columns.forEach((e=>e.direction=null)),e=!0)}e&&(this.notifyChange("sortOrders"),this.scheduleRender())}}findColumn(e){return this.viewModel.findColumn(e)}generateCellPartNames(){this._grid?.generateCellPartNames()}getFirstVisibleRowIndex(){return this._grid?._firstVisibleIndex||0}getVirtualPageIndex(){return Math.floor(this.getFirstVisibleRowIndex()/this.pageSize)}getLastVisibleRowIndex(){return this._grid?._lastVisibleIndex||0}getVisibleItemsCount(){return this._grid?._visibleItemsCount||0}getRowContainingNode(e){try{return this._grid?._getRowContainingNode(e)}catch{return null}}getSlotElementByName(e){return this._grid?.shadowRoot?.querySelector(`slot[name='${e}']`)??null}hasSorter(e){return this._grid?._sorters?.includes(e)||!1}hideColumn(e){this.viewModel.hideColumn(e)}recalculateColumnWidths(){this._grid?.recalculateColumnWidths()}async reset(){this._clearSelection(),await(this.store?.reset()),this.scrollToTop()}refreshPageCache(){this._grid?.clearCache(),this._temporaryHighlightId=null}requestContentUpdate(){this._grid?.requestContentUpdate(),this._temporaryHighlightId=null}selectRows(e){const{itemIdPath:t}=this,i=e?.filter((e=>!this.highlightIds.includes(e[t]))),r=i.map((e=>e[t]));r.length&&(this.multipleSelectionEnabled||(this.highlightIds.removeAll(),r.splice(1)),this.highlightIds.addMany(r))}deselectRows(e){const{itemIdPath:t}=this,i=e?.map((e=>e[t]))||[];i.length&&this.highlightIds.removeMany(i)}showColumn(e){this.viewModel.showColumn(e)}sort({path:e,direction:t}){this.viewModel.sortColumn(e,t),this.notifyChange("sortOrders")}scrollToIndex(e){0!==this.size&&(this._grid?.isConnected&&this._grid?.scrollToIndex(e),this._temporaryHighlightId=null)}scrollToTop(){this.scrollToIndex(0)}scrollToBottom(){this.scrollToIndex(1/0)}scrollLeft(e){const{_table:t}=this;t&&(t.scrollLeft=e)}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}onColumnChange(){this._columnElements.forEach((e=>{this._applyRenderersToColumnElement(e)})),this.requestContentUpdate()}render(){return m("div",{bind:this,class:this.classes(_.base,h.widget)},m("div",{bind:this,class:_.content},this._renderGrid()))}_renderGrid(){return m("vaadin-grid",{afterCreate:this._afterGridCreate,afterUpdate:this._afterGridUpdate,bind:this,cellPartNameGenerator:this.cellPartNameGenerator,class:_.grid,columnRendering:this._columnRendering,columnReorderingAllowed:this.columnReorderingEnabled,dataProvider:this.dataProvider,id:`${this.id}_grid`,itemIdPath:this.itemIdPath,multiSort:this.multiSortEnabled,multiSortPriority:this.multipleSortPriority,pageSize:this.pageSize,ref:"grid",rowDetailsRenderer:this.rowDetailsRenderer,selectedItems:this._selectedItems,size:this.effectiveSize},this._renderAllColumns(),this._renderEmptyState())}_renderAllColumns(){return"disabled"!==this.state&&this.columns.length?[this._renderSelectionColumn(),this._renderColumns()]:null}_renderSelectionColumn(){return m("vaadin-grid-selection-column",{_selectAllHidden:!0,autoWidth:!1,bind:this,dragSelect:!0,frozen:!0,hidden:this.hasInvalidColumnConfiguration||!this.selectionColumnEnabled,selectAll:!1,sortable:!1,textAlign:"center"})}_renderColumns(){return Array.from(this.columns,((e,t)=>"columns"in e?this._renderGroupColumn(e,t):m("vaadin-grid-column",{...this.getColumnProps(e,t)}))).filter(t)}_renderGroupColumn(e,t){const i=this.getColumnProps(e,t);if(i.hidden||!e.columns)return null;const r=e.columns.filter((({hidden:e})=>!e));return r.length?m("vaadin-grid-column-group",{...i},r.map((e=>m("vaadin-grid-column",{...this.getColumnProps(e,t)})))):null}_renderEmptyState(){const e=this.viewModel;if("loaded"===e.state&&!e.isQueryingOrSyncing)return m("div",{class:_.noDataMessage,slot:"empty-state"},this._noDataMessage??this.messages.noDataFound)}_afterGridCreate(e){const t=this._grid=e;t.setAttribute("theme",p),customElements.whenDefined("vaadin-grid").then((()=>{this._appendStyles(),this._addGridEventListeners()})),t.__updateSorter=(e,i,r)=>{const n=t._sorters,o=!n.includes(e),{multiSort:l,multiSortOnShiftClick:s,multiSortPriority:d}=t,a=n.filter((t=>t!==e)),h=l&&(!s||!r)||s&&i;e._order=null,e.direction?h?null!=e._initialOrder?(o?n[e._initialOrder]=e:n.splice(e._initialOrder,0,e),e._initialOrder=null):"append"===d&&o?t._sorters=[...a,e]:"prepend"===d&&(t._sorters=[e,...a]):(e.direction||s)&&(t._sorters=e.direction?[e]:[],a.forEach((e=>{e._order=null,e.direction=null}))):o||(t._sorters=[...a])},t.__removeSorters=e=>{if(0===e.length)return;const i=new Set(e.filter((e=>!e.direction)));t._sorters=t._sorters.filter((e=>!i.has(e))),t.__applySorters()}}_appendStyles(){const e=this._grid?.shadowRoot,t=document.createElement("style");e&&(t.textContent='\n #items [part~="row"][editing],\n #items [part~="row"][editing][selected] {\n z-index: 2;\n }\n\n #items [part~="editing"],\n #items [part~="editing"][selected] {\n z-index: 3;\n }\n\n [frozen], [frozen-to-end] {\n z-index: 4;\n }\n\n [last-frozen] {\n overflow: visible;\n }\n\n [part~=\'cell\'] ::slotted(vaadin-grid-cell-content) {\n align-items: center;\n box-sizing: border-box !important;\n height: 100%;\n line-height: 2em;\n min-height: 40px;\n }\n\n #items [part~="text-wrap"] {\n text-wrap: wrap;\n }\n ',e.appendChild(t))}_afterGridUpdate(e){this._grid||(this._grid=e)}_afterColumnCreate(e){this._columnElements.push(e)}_afterColumnRemoved(e){const t=this._columnElements.indexOf(e,0);t>-1&&this._columnElements.splice(t,1)}_updateGridSize(){this._grid&&(this._grid.size=this.effectiveSize,this.scheduleRender())}_addGridEventListeners(){const e=this._grid;r(e),this.addHandles([i(e,["click","dblclick","keydown","pointerover","pointerout"],(e=>this._onGridInteraction(e))),i(e,["pointerover","pointerout","cell-focus"],(e=>this._onTransientGridInteraction(e))),i(e,"selected-items-changed",this._onSelectedItemsChange),i(e,"sorter-changed",(()=>this.notifyChange("sortOrders"))),i(e,"column-resize",(e=>{const t=e.detail.resizedColumn,i=t.getAttribute("data-fieldName"),r=this.findColumn(i);r?.set({width:t.width})})),i(e,"column-reorder",(()=>this._onColumnOrderChange()))])}_onGridInteraction(e){const t=this._grid;if(r(t),("pointerover"===e.type||"pointerout"===e.type)&&e.relatedTarget!==t){const{target:t,relatedTarget:i}=e;if(!this._isGridCellContentNode(t)||!this._isGridCellContentNode(i))return}let i=null;try{i=t.getEventContext(e)}catch(a){}if(!i)return;const{column:n,index:o,item:l,section:s}=i;if(!s)return;if("header"===s&&"keydown"===e.type&&n?.path){const t=e.key;f.sort.includes(t)&&this.findColumn(n.path)?.sort()}const d=`cell-${e.type}`;this.emit(d,{type:d,context:i,index:o,item:l,native:e,path:n?.path??void 0})}_onTransientGridInteraction(e){if("pointerout"===e.type)return void(this._temporaryHighlightId=null);const t=this._grid;if(t)try{const{item:i}=t.getEventContext(e);this._temporaryHighlightId=i?.objectId}catch{this._temporaryHighlightId=null}}_isGridCellContentNode(e){return!!(e&&e instanceof HTMLElement&&"vaadin-grid-cell-content"===e.localName)}_onColumnOrderChange(){const e=this._grid;r(e);const t=e._getColumnsInOrder(0),i=[],n=(this.viewModel.groupColumns.length?e._getColumnsInOrder(1):t).map((e=>e.getAttribute("data-fieldName")));t?.forEach((e=>{const t=e.getAttribute("data-fieldName");if(null!=t){const e=this.findColumn(t);i.push(t),e&&"columns"in e&&e.columns?.length&&e.columns.sort(((e,t)=>n.indexOf(e.fieldName)>n.indexOf(t.fieldName)?1:-1))}})),this.columns.sort(((e,t)=>i.indexOf(e.fieldName)>i.indexOf(t.fieldName)?1:-1)),this.notifyChange("sortOrders"),this.emit("column-reorder",{type:"column-reorder"})}_clearSelection(){this.highlightIds.removeAll(),this._temporaryHighlightId=null}_onSelectedItemsChange(e){const{highlightIds:t,itemIdPath:i}=this,r=e.detail.value.map((e=>e[i])),n=r.filter((e=>!t.includes(e)));if(!this.multipleSelectionEnabled&&n.length&&t.length)t.removeAll(),t.add(n[0]);else{const e=t.filter((e=>!r.includes(e)));t.removeMany(e),t.addMany(n)}}_applyRenderersToColumnElement(e){const t=e?.path,i=null!=t?this.findColumn(t):void 0;if(i)try{const{renderFunction:t,footerRenderFunction:r,headerRenderFunction:n}=i;t&&"renderer"in e&&(e.renderer=(e,i,r)=>t({root:e,column:i,rowData:r})),r&&(e.footerRenderer=(e,t)=>r({root:e,column:t})),n&&(e.headerRenderer=(e,t)=>n({root:e,column:t}))}catch(r){}}};e([l()],v.prototype,"_columnElements",void 0),e([l()],v.prototype,"_columnRendering",null),e([l()],v.prototype,"_selectedItems",null),e([l()],v.prototype,"_grid",void 0),e([l()],v.prototype,"_noDataMessage",null),e([l()],v.prototype,"_table",null),e([l()],v.prototype,"_temporaryHighlightId",void 0),e([l()],v.prototype,"cellPartNameGenerator",null),e([l()],v.prototype,"columns",null),e([l()],v.prototype,"columnPerformanceModeEnabled",null),e([l()],v.prototype,"columnReorderingEnabled",null),e([l()],v.prototype,"dataProvider",null),e([l()],v.prototype,"editingEnabled",null),e([l()],v.prototype,"effectiveSize",null),e([l()],v.prototype,"groupColumns",null),e([l()],v.prototype,"hasInvalidColumnConfiguration",null),e([l()],v.prototype,"highlightIds",null),e([l()],v.prototype,"temporaryHighlightId",null),e([l()],v.prototype,"isEditing",null),e([l()],v.prototype,"isReady",null),e([l()],v.prototype,"itemIdPath",void 0),e([l()],v.prototype,"label",null),e([l(),g("esri/widgets/FeatureTable/t9n/FeatureTable")],v.prototype,"messages",void 0),e([l()],v.prototype,"multipleSelectionEnabled",null),e([l()],v.prototype,"multiSortEnabled",null),e([l()],v.prototype,"noDataMessage",null),e([l()],v.prototype,"pageIndex",null),e([l()],v.prototype,"multipleSortPriority",null),e([l()],v.prototype,"pageSize",null),e([l()],v.prototype,"paginationEnabled",null),e([l()],v.prototype,"rowDetailsRenderer",null),e([l()],v.prototype,"rowHighlightIds",null),e([l()],v.prototype,"selectionColumnEnabled",void 0),e([l()],v.prototype,"size",null),e([l({readOnly:!0})],v.prototype,"sortOrders",null),e([l()],v.prototype,"store",null),e([l()],v.prototype,"state",null),e([l()],v.prototype,"viewModel",void 0),v=e([s("esri.widgets.FeatureTable.Grid.Grid")],v);const y=v;export{y 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 t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import o from"../../../core/Evented.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isGroupColumn as s,isFieldColumn as r,isRelationshipColumn as u}from"../support/columnUtils.js";import{uniqueColumnNames as d,isPageIndexValid as a}from"../support/tableUtils.js";let h=class extends o.EventedAccessor{constructor(t){super(t),this.actionColumnConfig=null,this.cellPartNameGenerator=(t,e)=>{let i="";e?.item&&this.rowHighlightIds.includes(e.item.objectId)&&(i+=" highlight");const o=this.findColumn(t?.path);return o?(o.invalid&&(i+=" invalid"),o.textWrap&&(i+=" text-wrap"),"editInfo"in o&&o.editInfo&&o.editInfo.rowData?.index===e.index&&(i+=" editing"),i):i},this.columnPerformanceModeEnabled=!0,this.columnReorderingEnabled=!0,this.columns=new e,this.dataProvider=async(t,e)=>{const{store:i}=this;if(!e)return;if(!i)return void(e&&e([]));e(await i.fetchItems(t))},this.editingEnabled=!1,this.maxSize=null,this.multipleSelectionEnabled=!0,this.multiSortEnabled=!1,this.noDataMessage=null,this.paginationEnabled=!1,this.rowDetailsRenderer=null,this.store=null}get actionColumn(){return this.allColumns.find((t=>t.fieldName===d.action))}get allColumns(){return this.columns.toArray().flatMap((t=>[t,...s(t)&&t.columns?.length?t.columns:[]]))}get allVisibleColumns(){return this.allColumns.filter((t=>!t.hidden))}get columnMenuIsOpen(){return this.allColumns.some((t=>t.menuIsOpen))}get editableColumns(){return this.allColumns.filter((t=>"editable"in t))}get effectiveSize(){const{filterBySelectionEnabled:t,highlightIds:e,objectIds:i,pageSize:o,size:n}=this;if(this.paginationEnabled){const l=this.pageCount===this.pageIndex+1?n%o:o;return t?Math.min(e.length,l):i.length?Math.min(i.length,l):l}return t?e.length:i.length?i.length:n}get fieldColumns(){return this.allColumns.filter((t=>r(t)))}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(t){this._set("filterBySelectionEnabled",t)}get groupColumns(){return this.columns.toArray().filter((t=>s(t)))}get hasInvalidColumnConfiguration(){return this.visibleColumns.every((t=>t.frozen||t.frozenToEnd))}get highlightIds(){return this._get("highlightIds")||new e}set highlightIds(t){const o=Array.isArray(t)?new e(t):t;this.multipleSelectionEnabled||o.splice(1,o.length-1),this._set("highlightIds",i(o,this._get("highlightIds"),e))}get isEditing(){return this.editableColumns.some((t=>t.editInfo))}get isQuerying(){return this.store?.isQuerying??!1}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing}get isSyncing(){return this.store?.isSyncing??!1}get objectIds(){return this._get("objectIds")??new e}set objectIds(t){this._set("objectIds",i(t,this._get("objectIds"),e))}get pageCount(){const{pageSize:t,size:e}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(t){const{pageCount:e}=this;a(t,e)&&this._set("pageIndex",t)}get pageSize(){return this._get("pageSize")??50}set pageSize(t){this.store?.set("pageSize",t),this._set("pageSize",t)}get relationshipColumns(){return this.allColumns.filter((t=>u(t)))}get rowHighlightIds(){return this._get("rowHighlightIds")||new e}set rowHighlightIds(t){this._set("rowHighlightIds",i(t,this._get("rowHighlightIds"),e))}get size(){const t=this.store?.count??0,{maxSize:e}=this;return null!=t&&null!=e?Math.min(e,t):t}get state(){return this.store?.state??"disabled"}get visibleColumns(){return this.columns.toArray().filter((t=>!t.hidden))}closeColumnMenus(){this.allColumns.forEach((t=>t.closeMenu()))}sortColumn(t,e){if(!t)return;const i=this.findColumn(t);i&&(i.direction=e)}hideColumn(t){const e=this.findColumn(t);!1===e?.hidden&&(e.hidden=!0)}showColumn(t){const e=this.findColumn(t);e?.hidden&&(e.hidden=!1)}showAllColumns(){this.allColumns.forEach((t=>{t.hidden&&(t.hidden=!1)}))}findColumn(t){return this.allColumns.find((e=>e.fieldName===t))}refresh(){this.store&&(this.store.reset(),this.store.load())}toggleColumnVisibility(t){const e=this.findColumn(t);e&&(e.hidden=!e.hidden)}};t([n()],h.prototype,"actionColumn",null),t([n()],h.prototype,"actionColumnConfig",void 0),t([n()],h.prototype,"allColumns",null),t([n()],h.prototype,"allVisibleColumns",null),t([n()],h.prototype,"cellPartNameGenerator",void 0),t([n()],h.prototype,"columnMenuIsOpen",null),t([n()],h.prototype,"columnPerformanceModeEnabled",void 0),t([n()],h.prototype,"columnReorderingEnabled",void 0),t([n()],h.prototype,"columns",void 0),t([n()],h.prototype,"dataProvider",void 0),t([n()],h.prototype,"editingEnabled",void 0),t([n()],h.prototype,"editableColumns",null),t([n()],h.prototype,"effectiveSize",null),t([n()],h.prototype,"fieldColumns",null),t([n()],h.prototype,"filterBySelectionEnabled",null),t([n()],h.prototype,"groupColumns",null),t([n()],h.prototype,"hasInvalidColumnConfiguration",null),t([n()],h.prototype,"highlightIds",null),t([n()],h.prototype,"isEditing",null),t([n()],h.prototype,"isQuerying",null),t([n()],h.prototype,"isQueryingOrSyncing",null),t([n()],h.prototype,"isSyncing",null),t([n()],h.prototype,"maxSize",void 0),t([n()],h.prototype,"multipleSelectionEnabled",void 0),t([n()],h.prototype,"multiSortEnabled",void 0),t([n()],h.prototype,"noDataMessage",void 0),t([n()],h.prototype,"objectIds",null),t([n()],h.prototype,"pageCount",null),t([n()],h.prototype,"pageIndex",null),t([n()],h.prototype,"pageSize",null),t([n()],h.prototype,"paginationEnabled",void 0),t([n()],h.prototype,"relationshipColumns",null),t([n()],h.prototype,"rowHighlightIds",null),t([n()],h.prototype,"rowDetailsRenderer",void 0),t([n({readOnly:!0})],h.prototype,"size",null),t([n()],h.prototype,"store",void 0),t([n({readOnly:!0})],h.prototype,"state",null),t([n()],h.prototype,"visibleColumns",null),h=t([l("esri.widgets.FeatureTable.Grid.GridViewModel")],h);const p=h;export{p as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import o from"../../../core/Evented.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isGroupColumn as s,isFieldColumn as r,isRelationshipColumn as u}from"../support/columnUtils.js";import{uniqueColumnNames as d,isPageIndexValid as a}from"../support/tableUtils.js";let h=class extends o.EventedAccessor{constructor(t){super(t),this.actionColumnConfig=null,this.cellPartNameGenerator=(t,e)=>{let i="";e?.item&&this.rowHighlightIds.includes(e.item.objectId)&&(i+=" highlight");const o=this.findColumn(t?.path);return o?(o.invalid&&(i+=" invalid"),o.textWrap&&(i+=" text-wrap"),"editInfo"in o&&o.editInfo&&o.editInfo.rowData?.index===e.index&&(i+=" editing"),i):i},this.columnPerformanceModeEnabled=!0,this.columnReorderingEnabled=!0,this.columns=new e,this.dataProvider=async(t,e)=>{const{store:i}=this;if(!e)return;if(!i)return void(e&&e([]));e(await i.fetchItems(t))},this.editingEnabled=!1,this.maxSize=null,this.multipleSelectionEnabled=!0,this.multiSortEnabled=!1,this.multipleSortPriority="prepend",this.noDataMessage=null,this.paginationEnabled=!1,this.rowDetailsRenderer=null,this.store=null}get actionColumn(){return this.allColumns.find((t=>t.fieldName===d.action))}get allColumns(){return this.columns.toArray().flatMap((t=>[t,...s(t)&&t.columns?.length?t.columns:[]]))}get allVisibleColumns(){return this.allColumns.filter((t=>!t.hidden))}get columnMenuIsOpen(){return this.allColumns.some((t=>t.menuIsOpen))}get editableColumns(){return this.allColumns.filter((t=>"editable"in t))}get effectiveSize(){const{filterBySelectionEnabled:t,highlightIds:e,objectIds:i,pageSize:o,size:n}=this;if(this.paginationEnabled){const l=this.pageCount===this.pageIndex+1?n%o:o;return t?Math.min(e.length,l):i.length?Math.min(i.length,l):l}return t?e.length:i.length?i.length:n}get fieldColumns(){return this.allColumns.filter((t=>r(t)))}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(t){this._set("filterBySelectionEnabled",t)}get groupColumns(){return this.columns.toArray().filter((t=>s(t)))}get hasInvalidColumnConfiguration(){return this.visibleColumns.every((t=>t.frozen||t.frozenToEnd))}get highlightIds(){return this._get("highlightIds")||new e}set highlightIds(t){const o=Array.isArray(t)?new e(t):t;this.multipleSelectionEnabled||o.splice(1,o.length-1),this._set("highlightIds",i(o,this._get("highlightIds"),e))}get isEditing(){return this.editableColumns.some((t=>t.editInfo))}get isQuerying(){return this.store?.isQuerying??!1}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing}get isSyncing(){return this.store?.isSyncing??!1}get objectIds(){return this._get("objectIds")??new e}set objectIds(t){this._set("objectIds",i(t,this._get("objectIds"),e))}get pageCount(){const{pageSize:t,size:e}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(t){const{pageCount:e}=this;a(t,e)&&this._set("pageIndex",t)}get pageSize(){return this._get("pageSize")??50}set pageSize(t){this.store?.set("pageSize",t),this._set("pageSize",t)}get relationshipColumns(){return this.allColumns.filter((t=>u(t)))}get rowHighlightIds(){return this._get("rowHighlightIds")||new e}set rowHighlightIds(t){this._set("rowHighlightIds",i(t,this._get("rowHighlightIds"),e))}get size(){const t=this.store?.count??0,{maxSize:e}=this;return null!=t&&null!=e?Math.min(e,t):t}get state(){return this.store?.state??"disabled"}get visibleColumns(){return this.columns.toArray().filter((t=>!t.hidden))}closeColumnMenus(){this.allColumns.forEach((t=>t.closeMenu()))}sortColumn(t,e){if(!t)return;const i=this.findColumn(t);i&&(i.direction=e)}hideColumn(t){const e=this.findColumn(t);!1===e?.hidden&&(e.hidden=!0)}showColumn(t){const e=this.findColumn(t);e?.hidden&&(e.hidden=!1)}showAllColumns(){this.allColumns.forEach((t=>{t.hidden&&(t.hidden=!1)}))}findColumn(t){return this.allColumns.find((e=>e.fieldName===t))}refresh(){this.store&&(this.store.reset(),this.store.load())}toggleColumnVisibility(t){const e=this.findColumn(t);e&&(e.hidden=!e.hidden)}};t([n()],h.prototype,"actionColumn",null),t([n()],h.prototype,"actionColumnConfig",void 0),t([n()],h.prototype,"allColumns",null),t([n()],h.prototype,"allVisibleColumns",null),t([n()],h.prototype,"cellPartNameGenerator",void 0),t([n()],h.prototype,"columnMenuIsOpen",null),t([n()],h.prototype,"columnPerformanceModeEnabled",void 0),t([n()],h.prototype,"columnReorderingEnabled",void 0),t([n()],h.prototype,"columns",void 0),t([n()],h.prototype,"dataProvider",void 0),t([n()],h.prototype,"editingEnabled",void 0),t([n()],h.prototype,"editableColumns",null),t([n()],h.prototype,"effectiveSize",null),t([n()],h.prototype,"fieldColumns",null),t([n()],h.prototype,"filterBySelectionEnabled",null),t([n()],h.prototype,"groupColumns",null),t([n()],h.prototype,"hasInvalidColumnConfiguration",null),t([n()],h.prototype,"highlightIds",null),t([n()],h.prototype,"isEditing",null),t([n()],h.prototype,"isQuerying",null),t([n()],h.prototype,"isQueryingOrSyncing",null),t([n()],h.prototype,"isSyncing",null),t([n()],h.prototype,"maxSize",void 0),t([n()],h.prototype,"multipleSelectionEnabled",void 0),t([n()],h.prototype,"multiSortEnabled",void 0),t([n()],h.prototype,"multipleSortPriority",void 0),t([n()],h.prototype,"noDataMessage",void 0),t([n()],h.prototype,"objectIds",null),t([n()],h.prototype,"pageCount",null),t([n()],h.prototype,"pageIndex",null),t([n()],h.prototype,"pageSize",null),t([n()],h.prototype,"paginationEnabled",void 0),t([n()],h.prototype,"relationshipColumns",null),t([n()],h.prototype,"rowHighlightIds",null),t([n()],h.prototype,"rowDetailsRenderer",void 0),t([n({readOnly:!0})],h.prototype,"size",null),t([n()],h.prototype,"store",void 0),t([n({readOnly:!0})],h.prototype,"state",null),t([n()],h.prototype,"visibleColumns",null),h=t([l("esri.widgets.FeatureTable.Grid.GridViewModel")],h);const p=h;export{p as default};