@arcgis/core 5.0.0-next.60 → 5.0.0-next.62

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 (662) hide show
  1. package/Graphic.d.ts +1 -1
  2. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  3. package/applications/Components/previewSymbol2D.d.ts +1 -1
  4. package/applications/Components/webStyleSymbolUtils.d.ts +1 -1
  5. package/assets/components/assets/combobox/t9n/messages.ar.json +1 -1
  6. package/assets/components/assets/combobox/t9n/messages.bg.json +1 -1
  7. package/assets/components/assets/combobox/t9n/messages.bs.json +1 -1
  8. package/assets/components/assets/combobox/t9n/messages.ca.json +1 -1
  9. package/assets/components/assets/combobox/t9n/messages.cs.json +1 -1
  10. package/assets/components/assets/combobox/t9n/messages.da.json +1 -1
  11. package/assets/components/assets/combobox/t9n/messages.de.json +1 -1
  12. package/assets/components/assets/combobox/t9n/messages.el.json +1 -1
  13. package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
  14. package/assets/components/assets/combobox/t9n/messages.es.json +1 -1
  15. package/assets/components/assets/combobox/t9n/messages.et.json +1 -1
  16. package/assets/components/assets/combobox/t9n/messages.fi.json +1 -1
  17. package/assets/components/assets/combobox/t9n/messages.fr.json +1 -1
  18. package/assets/components/assets/combobox/t9n/messages.he.json +1 -1
  19. package/assets/components/assets/combobox/t9n/messages.hr.json +1 -1
  20. package/assets/components/assets/combobox/t9n/messages.hu.json +1 -1
  21. package/assets/components/assets/combobox/t9n/messages.id.json +1 -1
  22. package/assets/components/assets/combobox/t9n/messages.it.json +1 -1
  23. package/assets/components/assets/combobox/t9n/messages.ja.json +1 -1
  24. package/assets/components/assets/combobox/t9n/messages.json +1 -1
  25. package/assets/components/assets/combobox/t9n/messages.ko.json +1 -1
  26. package/assets/components/assets/combobox/t9n/messages.lt.json +1 -1
  27. package/assets/components/assets/combobox/t9n/messages.lv.json +1 -1
  28. package/assets/components/assets/combobox/t9n/messages.nl.json +1 -1
  29. package/assets/components/assets/combobox/t9n/messages.no.json +1 -1
  30. package/assets/components/assets/combobox/t9n/messages.pl.json +1 -1
  31. package/assets/components/assets/combobox/t9n/messages.pt-BR.json +1 -1
  32. package/assets/components/assets/combobox/t9n/messages.pt-PT.json +1 -1
  33. package/assets/components/assets/combobox/t9n/messages.ro.json +1 -1
  34. package/assets/components/assets/combobox/t9n/messages.ru.json +1 -1
  35. package/assets/components/assets/combobox/t9n/messages.sk.json +1 -1
  36. package/assets/components/assets/combobox/t9n/messages.sl.json +1 -1
  37. package/assets/components/assets/combobox/t9n/messages.sr.json +1 -1
  38. package/assets/components/assets/combobox/t9n/messages.sv.json +1 -1
  39. package/assets/components/assets/combobox/t9n/messages.th.json +1 -1
  40. package/assets/components/assets/combobox/t9n/messages.tr.json +1 -1
  41. package/assets/components/assets/combobox/t9n/messages.uk.json +1 -1
  42. package/assets/components/assets/combobox/t9n/messages.vi.json +1 -1
  43. package/assets/components/assets/combobox/t9n/messages.zh-CN.json +1 -1
  44. package/assets/components/assets/combobox/t9n/messages.zh-HK.json +1 -1
  45. package/assets/components/assets/combobox/t9n/messages.zh-TW.json +1 -1
  46. package/assets/components/assets/date-picker/nls/fr-CA.json +1 -0
  47. package/assets/components/assets/icon/arcgisLivingAtlas16.json +1 -0
  48. package/assets/components/assets/icon/arcgisLivingAtlas24.json +1 -0
  49. package/assets/components/assets/icon/arcgisLivingAtlas32.json +1 -0
  50. package/assets/components/assets/icon/arcgisSolutions16.json +1 -0
  51. package/assets/components/assets/icon/arcgisSolutions24.json +1 -0
  52. package/assets/components/assets/icon/arcgisSolutions32.json +1 -0
  53. package/assets/components/assets/icon/cameraSensorMap24.json +1 -1
  54. package/assets/components/assets/icon/contingentValuesRetire16.json +1 -0
  55. package/assets/components/assets/icon/contingentValuesRetire24.json +1 -0
  56. package/assets/components/assets/icon/contingentValuesRetire32.json +1 -0
  57. package/assets/components/assets/icon/domain16.json +1 -1
  58. package/assets/components/assets/icon/domain24.json +1 -1
  59. package/assets/components/assets/icon/domain32.json +1 -1
  60. package/assets/components/assets/icon/duplicateValues16.json +1 -0
  61. package/assets/components/assets/icon/duplicateValues24.json +1 -0
  62. package/assets/components/assets/icon/duplicateValues32.json +1 -0
  63. package/assets/components/assets/icon/envelope32F.json +1 -1
  64. package/assets/components/assets/icon/fieldGroups16.json +1 -0
  65. package/assets/components/assets/icon/fieldGroups24.json +1 -0
  66. package/assets/components/assets/icon/fieldGroups32.json +1 -0
  67. package/assets/components/assets/icon/groupContent16.json +1 -0
  68. package/assets/components/assets/icon/groupContent24.json +1 -0
  69. package/assets/components/assets/icon/groupContent32.json +1 -0
  70. package/assets/components/assets/icon/groupTemplate16.json +1 -0
  71. package/assets/components/assets/icon/groupTemplate24.json +1 -0
  72. package/assets/components/assets/icon/groupTemplate32.json +1 -0
  73. package/assets/components/assets/icon/integerSet16.json +1 -0
  74. package/assets/components/assets/icon/integerSet24.json +1 -0
  75. package/assets/components/assets/icon/integerSet32.json +1 -0
  76. package/assets/components/assets/icon/intersection16.json +1 -1
  77. package/assets/components/assets/icon/lineIntersection16.json +1 -1
  78. package/assets/components/assets/icon/linkChartCentrality16.json +1 -1
  79. package/assets/components/assets/icon/locationReferencingDataset16.json +1 -1
  80. package/assets/components/assets/icon/locationReferencingDataset24.json +1 -1
  81. package/assets/components/assets/icon/locationReferencingDataset32.json +1 -1
  82. package/assets/components/assets/icon/metadata16.json +1 -0
  83. package/assets/components/assets/icon/metadata24.json +1 -0
  84. package/assets/components/assets/icon/metadata32.json +1 -0
  85. package/assets/components/assets/icon/missionSystemMessage16.json +1 -0
  86. package/assets/components/assets/icon/missionSystemMessage24.json +1 -0
  87. package/assets/components/assets/icon/missionSystemMessage32.json +1 -0
  88. package/assets/components/assets/icon/newCompletePart16.json +1 -1
  89. package/assets/components/assets/icon/newCompletePart24.json +1 -1
  90. package/assets/components/assets/icon/newCompletePart32.json +1 -1
  91. package/assets/components/assets/icon/numberSet16.json +1 -0
  92. package/assets/components/assets/icon/numberSet24.json +1 -0
  93. package/assets/components/assets/icon/numberSet32.json +1 -0
  94. package/assets/components/assets/icon/openData16.json +1 -0
  95. package/assets/components/assets/icon/openData24.json +1 -0
  96. package/assets/components/assets/icon/openData32.json +1 -0
  97. package/assets/components/assets/icon/organizeTemplate16.json +1 -0
  98. package/assets/components/assets/icon/organizeTemplate24.json +1 -0
  99. package/assets/components/assets/icon/organizeTemplate32.json +1 -0
  100. package/assets/components/assets/icon/partneredCollaboration16.json +1 -0
  101. package/assets/components/assets/icon/partneredCollaboration24.json +1 -0
  102. package/assets/components/assets/icon/partneredCollaboration32.json +1 -0
  103. package/assets/components/assets/icon/personMagnifyingGlass16.json +1 -1
  104. package/assets/components/assets/icon/personMagnifyingGlass24.json +1 -1
  105. package/assets/components/assets/icon/pieChartSectionHashFilled16.json +1 -1
  106. package/assets/components/assets/icon/relativeDirectionArrows16.json +1 -0
  107. package/assets/components/assets/icon/relativeDirectionArrows24.json +1 -0
  108. package/assets/components/assets/icon/relativeDirectionArrows32.json +1 -0
  109. package/assets/components/assets/icon/signalHealth16.json +1 -0
  110. package/assets/components/assets/icon/signalHealth24.json +1 -0
  111. package/assets/components/assets/icon/signalHealth32.json +1 -0
  112. package/assets/components/assets/icon/sortAscendingView16.json +1 -0
  113. package/assets/components/assets/icon/sortAscendingView24.json +1 -0
  114. package/assets/components/assets/icon/sortAscendingView32.json +1 -0
  115. package/assets/components/assets/icon/sortDescendingView16.json +1 -0
  116. package/assets/components/assets/icon/sortDescendingView24.json +1 -0
  117. package/assets/components/assets/icon/sortDescendingView32.json +1 -0
  118. package/assets/components/assets/icon/starValues16.json +1 -0
  119. package/assets/components/assets/icon/starValues24.json +1 -0
  120. package/assets/components/assets/icon/starValues32.json +1 -0
  121. package/assets/components/assets/icon/updateTable16.json +1 -0
  122. package/assets/components/assets/icon/updateTable24.json +1 -0
  123. package/assets/components/assets/icon/updateTable32.json +1 -0
  124. package/assets/esri/core/workers/RemoteClient.js +1 -1
  125. package/assets/esri/core/workers/chunks/{94929cf2b9fc66a93882.js → 02cf735176f286a48dd2.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{f3437ae6bba846b524d3.js → 095c1b88cdcb91ab837e.js} +1 -1
  127. package/assets/esri/core/workers/chunks/{b7f2fb6684cf684b0bce.js → 0dc3a04ce717b7ddd957.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{297344c2c1119159d143.js → 10373885604655f673df.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{8208c073e606973ea1ad.js → 12f700b932a241e59071.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{1e8ceed33a3657ac02b3.js → 153ff2ceefccd946498b.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{ca761dc5f45cafef313e.js → 17dea03fc4eb414f0022.js} +1 -1
  132. package/assets/esri/core/workers/chunks/1800994523d7cdfb73af.js +1 -0
  133. package/assets/esri/core/workers/chunks/{ec5f83aa752c39a96609.js → 19db60a3b4b09d445bd1.js} +1 -1
  134. package/assets/esri/core/workers/chunks/{7147fc7502b385b302b2.js → 23b623637126f8411a30.js} +1 -1
  135. package/assets/esri/core/workers/chunks/{a7aa87e2c4197ba595ef.js → 2abc205f81f26fc4852b.js} +2 -2
  136. package/assets/esri/core/workers/chunks/37002a46f03a9fc5f644.js +2 -0
  137. package/assets/esri/core/workers/chunks/{78fc9a55e620602db1ff.js.LICENSE.txt → 37002a46f03a9fc5f644.js.LICENSE.txt} +1 -1
  138. package/assets/esri/core/workers/chunks/{b4a59dd11d75df7bd510.js → 3cce8e894bf37c3e598e.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{492d575894c7905bb70c.js → 3d49c6427120edc8eac9.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{23a9dd9454d5249bbd59.js → 3da53c017f9c5d2d778a.js} +1 -1
  141. package/assets/esri/core/workers/chunks/43e2c1d72cd9c8beed2f.js +2 -0
  142. package/assets/esri/core/workers/chunks/{3266c3392c24ce6cdd83.js.LICENSE.txt → 43e2c1d72cd9c8beed2f.js.LICENSE.txt} +1 -1
  143. package/assets/esri/core/workers/chunks/{3d1a5a3467f3a6585b3e.js → 4f03d19a70dca6c507be.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{24c35a46cf8ed11b774d.js → 5180b15f1a865756a02e.js} +1 -1
  145. package/assets/esri/core/workers/chunks/57302b92e9899cce4ba3.js +1 -0
  146. package/assets/esri/core/workers/chunks/5909a0e763fddc3542e7.js +2 -0
  147. package/assets/esri/core/workers/chunks/{6f3ffc04086bca30e55d.js.LICENSE.txt → 5909a0e763fddc3542e7.js.LICENSE.txt} +2 -2
  148. package/assets/esri/core/workers/chunks/{d9736c783513e9c9b22f.js → 5a2933ae19345b7d5aa7.js} +1 -1
  149. package/assets/esri/core/workers/chunks/{5d31fbabaa875f8627c0.js → 631a11a2b2001c708527.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{fa95c9248fbfab338f2e.js → 63b8cd7d5cafbaeed894.js} +1 -1
  151. package/assets/esri/core/workers/chunks/6b4a24248182245167ca.js +1 -0
  152. package/assets/esri/core/workers/chunks/6be530ab81291745485b.js +2 -0
  153. package/assets/esri/core/workers/chunks/{70e2804d3710c6af468e.js.LICENSE.txt → 6be530ab81291745485b.js.LICENSE.txt} +1 -1
  154. package/assets/esri/core/workers/chunks/{ef9a23d41acb5ad36426.js → 6cb44cd319cb6c2539c8.js} +1 -1
  155. package/assets/esri/core/workers/chunks/73c416ae0ec5a1815591.js +2 -0
  156. package/assets/esri/core/workers/chunks/{be631029691d9a320cb5.js.LICENSE.txt → 73c416ae0ec5a1815591.js.LICENSE.txt} +1 -7
  157. package/assets/esri/core/workers/chunks/{352c674730c7b7258ae3.js → 76086517591d0eb35156.js} +1 -1
  158. package/assets/esri/core/workers/chunks/{436f206898306df019ac.js → 7c47fefbf4c93b63200f.js} +1 -1
  159. package/assets/esri/core/workers/chunks/7e8573749a02e1f54fb1.js +1 -0
  160. package/assets/esri/core/workers/chunks/{9ff8ee6ed6b98c03ae7e.js → 9ccabf8142fb5de4d3e2.js} +2 -2
  161. package/assets/esri/core/workers/chunks/{9ff8ee6ed6b98c03ae7e.js.LICENSE.txt → 9ccabf8142fb5de4d3e2.js.LICENSE.txt} +1 -1
  162. package/assets/esri/core/workers/chunks/ab71865b94022e78035c.js +1 -0
  163. package/assets/esri/core/workers/chunks/{424daef7b5dec1b99aba.js → af3e93a4ac3ff2addc90.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{bf82bb1cdd8b31e7f2aa.js → bb08359610a41e304b55.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{495b11fdecc3ba90d454.js → bfc063d4431bfa162160.js} +1 -1
  166. package/assets/esri/core/workers/chunks/c2aeecd27e004c6cd7e1.js +2 -0
  167. package/assets/esri/core/workers/chunks/c2aeecd27e004c6cd7e1.js.LICENSE.txt +9 -0
  168. package/assets/esri/core/workers/chunks/{60362c5651ef41fa7e5f.js → c2bab829d6f6e05bbd81.js} +1 -1
  169. package/assets/esri/core/workers/chunks/{fa0bbf0d7eadb924c473.js → cc50f96321a7c12f300b.js} +1 -1
  170. package/assets/esri/core/workers/chunks/{62752cd6821959cf6751.js → cfbe9993263fa6f69363.js} +1 -1
  171. package/assets/esri/core/workers/chunks/cfe1506a443fc84a0b91.js +1 -0
  172. package/assets/esri/core/workers/chunks/d13b2ce8a89938b0472b.js +1 -0
  173. package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +1 -0
  174. package/assets/esri/core/workers/chunks/{2d8dca9a4a58469ddd05.js → e705d041f6c1632bfbcc.js} +1 -1
  175. package/assets/esri/core/workers/chunks/{0483a2cfdb8c7158e73a.js → e85da52d9cc7d9396872.js} +1 -1
  176. package/assets/esri/core/workers/chunks/e95821a199e10b389e29.js +2 -0
  177. package/assets/esri/core/workers/chunks/{69278d08a7d64917f826.js.LICENSE.txt → e95821a199e10b389e29.js.LICENSE.txt} +1 -1
  178. package/assets/esri/core/workers/chunks/f25bebd2b6eb0d0f6626.js +2 -0
  179. package/assets/esri/core/workers/chunks/{d9251c3c85c3ddd242c8.js.LICENSE.txt → f25bebd2b6eb0d0f6626.js.LICENSE.txt} +1 -1
  180. package/assets/esri/core/workers/chunks/f32d4813b450a3eb4262.js +1 -0
  181. package/assets/esri/core/workers/chunks/{1ced78750c61600b2d4e.js → f351007cdcd0938d3b6c.js} +1 -1
  182. package/assets/esri/core/workers/chunks/{4b088260252787734c00.js → f5f584d325f8f2ea825f.js} +1 -1
  183. package/assets/esri/core/workers/chunks/{3405a23973f9e701a4d6.js → f7d93aae350796b88562.js} +1 -1
  184. package/assets/esri/core/workers/chunks/f9bddbf5dbc91897cb04.js +1 -0
  185. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  186. package/assets/esri/themes/base/_core.scss +1 -1
  187. package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +1 -3
  188. package/assets/esri/themes/base/widgets/_FeatureTable.scss +4 -4
  189. package/assets/esri/themes/base/widgets/_Grid.scss +6 -5
  190. package/assets/esri/themes/base/widgets/_Sketch.scss +0 -3
  191. package/assets/esri/themes/base/widgets/_Tooltip.scss +6 -6
  192. package/assets/esri/themes/dark/main.css +1 -1
  193. package/assets/esri/themes/light/main.css +1 -1
  194. package/assets/esri/themes/light/view.css +1 -1
  195. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ar.json +1 -1
  196. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bg.json +1 -1
  197. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_bs.json +1 -1
  198. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ca.json +1 -1
  199. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_cs.json +1 -1
  200. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_da.json +1 -1
  201. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_de.json +1 -1
  202. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_el.json +1 -1
  203. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_es.json +1 -1
  204. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_et.json +1 -1
  205. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fi.json +1 -1
  206. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_fr.json +1 -1
  207. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_he.json +1 -1
  208. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hr.json +1 -1
  209. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_hu.json +1 -1
  210. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_id.json +1 -1
  211. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_it.json +1 -1
  212. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ja.json +1 -1
  213. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ko.json +1 -1
  214. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lt.json +1 -1
  215. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_lv.json +1 -1
  216. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_nl.json +1 -1
  217. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_no.json +1 -1
  218. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pl.json +1 -1
  219. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-BR.json +1 -1
  220. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_pt-PT.json +1 -1
  221. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ro.json +1 -1
  222. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_ru.json +1 -1
  223. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sk.json +1 -1
  224. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sl.json +1 -1
  225. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sr.json +1 -1
  226. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_sv.json +1 -1
  227. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_th.json +1 -1
  228. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_tr.json +1 -1
  229. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_uk.json +1 -1
  230. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_vi.json +1 -1
  231. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-CN.json +1 -1
  232. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-HK.json +1 -1
  233. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/UtilityNetworkValidateTopology_zh-TW.json +1 -1
  234. package/chunks/CutFillDepth.glsl.js +13 -10
  235. package/chunks/CutFillReduction.glsl.js +14 -8
  236. package/chunks/GaussianSplat.glsl.js +1 -1
  237. package/chunks/Laserlines.glsl.js +2 -2
  238. package/chunks/boundedPlane.js +1 -1
  239. package/chunks/cameraUtilsSpherical.js +1 -1
  240. package/chunks/vec32.js +1 -1
  241. package/config.js +1 -1
  242. package/core/Loadable.d.ts +8 -2
  243. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  244. package/core/reactiveUtils.d.ts +1 -1
  245. package/effects/FocusAreas.d.ts +1 -1
  246. package/form/FormTemplate.d.ts +2 -2
  247. package/form/elements/AttachmentElement.d.ts +2 -2
  248. package/form/elements/GroupElement.d.ts +2 -2
  249. package/form/elements/inputs/attachments/AttachmentInput.d.ts +9 -2
  250. package/form/elements/inputs/attachments/AudioInput.d.ts +10 -1
  251. package/form/elements/inputs/attachments/DocumentInput.d.ts +9 -1
  252. package/form/elements/inputs/attachments/ImageInput.d.ts +10 -1
  253. package/form/elements/inputs/attachments/Input.d.ts +19 -1
  254. package/form/elements/inputs/attachments/SignatureInput.d.ts +5 -0
  255. package/form/elements/inputs/attachments/VideoInput.d.ts +10 -1
  256. package/form/elements/inputs/attachments/types.d.ts +15 -0
  257. package/form/elements.d.ts +0 -9
  258. package/form/types.d.ts +17 -0
  259. package/geometry/support/lineSegment.js +1 -1
  260. package/geometry/support/meshUtils/merge.js +1 -1
  261. package/geometry/support/sphere.js +1 -1
  262. package/interfaces.d.ts +74 -212
  263. package/intl/substitute.d.ts +1 -1
  264. package/intl.d.ts +5 -5
  265. package/kernel.js +1 -1
  266. package/layers/VoxelWasmPerSceneView.js +1 -1
  267. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  268. package/layers/knowledgeGraph/layerUtils.js +1 -1
  269. package/layers/ogc/types.d.ts +1 -1
  270. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  271. package/layers/support/FieldsIndex.d.ts +2 -1
  272. package/layers/support/RouteStopSymbols.d.ts +1 -1
  273. package/layers/support/RouteSymbols.d.ts +1 -1
  274. package/layers/support/tiles3DUtils.js +1 -1
  275. package/layers/voxel/VoxelVolume.js +1 -1
  276. package/networks/UtilityNetwork.js +1 -1
  277. package/networks/support/Circuit.d.ts +2 -2
  278. package/networks/support/CircuitLocation.d.ts +3 -3
  279. package/networks/support/CircuitLocation.js +1 -1
  280. package/networks/support/CircuitPathConnectivityElement.js +1 -1
  281. package/networks/support/CircuitSection.d.ts +2 -2
  282. package/networks/support/jsonTypes.d.ts +2 -2
  283. package/networks/support/networkFieldUtils.js +1 -1
  284. package/package.json +3 -3
  285. package/portal/PortalUser.d.ts +2 -2
  286. package/renderers/ClassBreaksRenderer.d.ts +2 -2
  287. package/renderers/SimpleRenderer.d.ts +1 -1
  288. package/renderers/UniqueValueRenderer.d.ts +1 -1
  289. package/renderers/support/ClassBreakInfo.d.ts +1 -1
  290. package/renderers/support/RendererLegendOptions.d.ts +2 -1
  291. package/renderers/support/UniqueValueClass.d.ts +1 -1
  292. package/renderers/support/UniqueValueInfo.d.ts +1 -1
  293. package/renderers/types.d.ts +1 -1
  294. package/rest/networks/circuits/alterCircuit.js +1 -1
  295. package/rest/networks/circuits/createCircuit.js +1 -1
  296. package/rest/networks/circuits/deleteCircuits.js +1 -1
  297. package/rest/networks/circuits/exportCircuits.js +1 -1
  298. package/rest/networks/circuits/queryCircuits.js +1 -1
  299. package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
  300. package/rest/networks/circuits/verifyCircuits.js +1 -1
  301. package/rest/networks/support/Association.js +1 -1
  302. package/rest/networks/support/TelecomNetworkElement.d.ts +6 -5
  303. package/rest/networks/support/TelecomNetworkElement.js +1 -1
  304. package/rest/networks/support/TraceLocation.d.ts +10 -8
  305. package/rest/networks/support/TraceLocation.js +1 -1
  306. package/rest/networks/support/TraceResult.js +1 -1
  307. package/rest/networks/unitIdentifiers/insertGap.js +1 -1
  308. package/rest/networks/unitIdentifiers/queryUnitIdentifiers.js +1 -1
  309. package/rest/networks/unitIdentifiers/reset.js +1 -1
  310. package/rest/networks/unitIdentifiers/resize.js +1 -1
  311. package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
  312. package/rest/places.d.ts +0 -4
  313. package/rest/support/AttributeBinsQuery.d.ts +1 -14
  314. package/rest/symbolService.d.ts +2 -2
  315. package/smartMapping/raster/renderers/vectorField.d.ts +0 -1
  316. package/smartMapping/renderers/opacity.d.ts +1 -1
  317. package/smartMapping/renderers/support/spikeUtils.d.ts +2 -2
  318. package/smartMapping/renderers/type.d.ts +1 -1
  319. package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
  320. package/smartMapping/statistics/types.d.ts +2 -2
  321. package/support/actions/actionUtils.js +1 -1
  322. package/support/revision.js +1 -1
  323. package/symbols/CIMSymbol.d.ts +29 -29
  324. package/symbols/Font.d.ts +1 -1
  325. package/symbols/IconSymbol3DLayer.d.ts +3 -4
  326. package/symbols/ObjectSymbol3DLayer.d.ts +3 -4
  327. package/symbols/Symbol.d.ts +2 -5
  328. package/symbols/Symbol3DLayer.d.ts +2 -3
  329. package/symbols/TextSymbol.d.ts +3 -3
  330. package/symbols/TextSymbol3DLayer.d.ts +3 -3
  331. package/symbols/WaterSymbol3DLayer.d.ts +4 -7
  332. package/symbols/WebStyleSymbol.d.ts +5 -5
  333. package/symbols/cim/cimAnalyzer.js +1 -1
  334. package/symbols/cim/defaultCIMValues.js +1 -1
  335. package/symbols/cim/{CIMTypes.d.ts → types.d.ts} +216 -167
  336. package/symbols/cim/types.js +5 -0
  337. package/symbols/support/IconSymbol3DLayerResource.d.ts +2 -3
  338. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +2 -3
  339. package/symbols/support/Symbol3DFillMaterial.d.ts +2 -2
  340. package/symbols/support/cimConversionUtils.d.ts +1 -1
  341. package/symbols/support/cimSymbolUtils.d.ts +4 -4
  342. package/symbols/support/jsonUtils.d.ts +1 -1
  343. package/symbols/support/symbolUtils.d.ts +66 -4
  344. package/symbols/support/types.d.ts +3 -62
  345. package/symbols/types.d.ts +113 -1
  346. package/unionTypes.d.ts +61 -14
  347. package/views/2d/engine/flow/dataUtils.js +1 -1
  348. package/views/2d/engine/flow/utils.js +1 -1
  349. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  350. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  351. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientSizeHelper.js +1 -1
  352. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  353. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  354. package/views/2d/interactive/SegmentLabels2D.js +1 -1
  355. package/views/2d/layers/BaseLayerViewGL2D.d.ts +6 -6
  356. package/views/2d/layers/RouteLayerView2D.js +1 -1
  357. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  358. package/views/2d/layers/support/RouteLayerInteractiveOptions.js +5 -0
  359. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  360. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  361. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  362. package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
  363. package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
  364. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  365. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  366. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  367. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  368. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  369. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  370. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  371. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  372. package/views/3d/camera/constraintUtils/distance.js +1 -1
  373. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  374. package/views/3d/environment/ChapmanApproximation.glsl.js +1 -1
  375. package/views/3d/environment/CloudsParameters.js +1 -1
  376. package/views/3d/environment/EnvironmentManager.js +1 -1
  377. package/views/3d/environment/MarsAtmosphere.js +1 -1
  378. package/views/3d/interactive/SegmentLabels3D.js +1 -1
  379. package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
  380. package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
  381. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  382. package/views/3d/interactive/visualElements/LabelVisualElement.js +1 -1
  383. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  384. package/views/3d/layers/FlowSubView3D.js +1 -1
  385. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  386. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  388. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  389. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  390. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  391. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  392. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  393. package/views/3d/state/Frustum.js +1 -1
  394. package/views/3d/state/controllers/FovController.js +1 -1
  395. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  396. package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
  397. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  398. package/views/3d/support/cameraUtils.js +1 -1
  399. package/views/3d/support/engineContent/line.js +1 -1
  400. package/views/3d/support/flow/FlowWorker.js +1 -1
  401. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  402. package/views/3d/support/flow/constants.js +1 -1
  403. package/views/3d/support/flow/geometryUtils.js +1 -1
  404. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  405. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  406. package/views/3d/support/intersectionUtils.js +1 -1
  407. package/views/3d/support/orientedBoundingBox.js +1 -1
  408. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  409. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  410. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  411. package/views/3d/support/viewpointUtils.js +1 -1
  412. package/views/3d/terrain/OverlayManager.js +1 -1
  413. package/views/3d/terrain/OverlayRenderer.js +1 -1
  414. package/views/3d/terrain/PatchRenderData.js +1 -1
  415. package/views/3d/terrain/SphericalPatch.js +1 -1
  416. package/views/3d/terrain/Tile.js +1 -1
  417. package/views/3d/webgl/RenderCamera.js +1 -1
  418. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  419. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  420. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  421. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  422. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  423. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  424. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  425. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  426. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  427. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  428. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  429. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  430. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  431. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  432. package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
  433. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  434. package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
  435. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  436. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  437. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  438. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  439. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  440. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +13 -12
  441. package/views/3d/webgl-engine/shaders/CutFillDepthTechniqueConfiguration.js +5 -0
  442. package/views/3d/webgl-engine/shaders/CutFillReductionTechniqueConfiguration.js +5 -0
  443. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  444. package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
  445. package/views/interactive/GraphicManipulator.js +1 -1
  446. package/views/interactive/coordinateHelper.js +1 -1
  447. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  448. package/views/interactive/sketch/constraints.js +1 -1
  449. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  450. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  451. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  452. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  453. package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
  454. package/views/support/Scheduler.js +1 -1
  455. package/views/support/euclideanAreaMeasurementUtils.js +1 -1
  456. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  457. package/views/support/geometry3dUtils.js +1 -1
  458. package/webdoc/widgets/FloorFilter.js +1 -1
  459. package/widgets/BasemapLayerList.js +1 -1
  460. package/widgets/BatchAttributeForm.js +1 -1
  461. package/widgets/Bookmarks.js +1 -1
  462. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  463. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  464. package/widgets/CatalogLayerList.js +1 -1
  465. package/widgets/Directions/DirectionsViewModel.js +1 -1
  466. package/widgets/Directions.js +1 -1
  467. package/widgets/Editor/components/FeatureList.js +1 -1
  468. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  469. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  470. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  471. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  472. package/widgets/ElevationProfile.js +1 -1
  473. package/widgets/Expand/ExpandViewModel.d.ts +1 -0
  474. package/widgets/Expand/ExpandViewModel.js +1 -1
  475. package/widgets/Expand.js +1 -1
  476. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  477. package/widgets/FeatureForm.js +1 -1
  478. package/widgets/FeatureTable/Grid/Column.js +1 -1
  479. package/widgets/FeatureTable/RelationshipColumn.js +1 -1
  480. package/widgets/FeatureTable.js +1 -1
  481. package/widgets/Features/FeaturesDrillIn.js +1 -1
  482. package/widgets/Features.js +1 -1
  483. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  484. package/widgets/LayerList/LayerListItem.js +1 -1
  485. package/widgets/LayerList.js +1 -1
  486. package/widgets/Legend/LegendViewModel.js +1 -1
  487. package/widgets/Print.js +1 -1
  488. package/widgets/Search/SearchSource.d.ts +1 -1
  489. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  490. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  491. package/widgets/Sketch/support/ResponsiveToolbar/responsiveToolbarUtils.js +1 -1
  492. package/widgets/Sketch/types.d.ts +1 -1
  493. package/widgets/Sketch.js +1 -1
  494. package/widgets/Slice.js +1 -1
  495. package/widgets/TableList/types.d.ts +2 -3
  496. package/widgets/TableList.d.ts +1 -1
  497. package/widgets/TableList.js +1 -1
  498. package/widgets/TimeZoneLabel.js +1 -1
  499. package/widgets/UtilityNetworkAssociations.js +1 -1
  500. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  501. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  502. package/widgets/UtilityNetworkTrace.js +1 -1
  503. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  504. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  505. package/widgets/support/GeolocationPositioning.js +1 -1
  506. package/widgets/support/SelectionList.js +1 -1
  507. package/widgets/support/iconUtils.js +1 -1
  508. package/widgets/types.d.ts +2 -2
  509. package/assets/components/assets/modal/t9n/messages.ar.json +0 -1
  510. package/assets/components/assets/modal/t9n/messages.bg.json +0 -1
  511. package/assets/components/assets/modal/t9n/messages.bs.json +0 -1
  512. package/assets/components/assets/modal/t9n/messages.ca.json +0 -1
  513. package/assets/components/assets/modal/t9n/messages.cs.json +0 -1
  514. package/assets/components/assets/modal/t9n/messages.da.json +0 -1
  515. package/assets/components/assets/modal/t9n/messages.de.json +0 -1
  516. package/assets/components/assets/modal/t9n/messages.el.json +0 -1
  517. package/assets/components/assets/modal/t9n/messages.en.json +0 -1
  518. package/assets/components/assets/modal/t9n/messages.es.json +0 -1
  519. package/assets/components/assets/modal/t9n/messages.et.json +0 -1
  520. package/assets/components/assets/modal/t9n/messages.fi.json +0 -1
  521. package/assets/components/assets/modal/t9n/messages.fr.json +0 -1
  522. package/assets/components/assets/modal/t9n/messages.he.json +0 -1
  523. package/assets/components/assets/modal/t9n/messages.hr.json +0 -1
  524. package/assets/components/assets/modal/t9n/messages.hu.json +0 -1
  525. package/assets/components/assets/modal/t9n/messages.id.json +0 -1
  526. package/assets/components/assets/modal/t9n/messages.it.json +0 -1
  527. package/assets/components/assets/modal/t9n/messages.ja.json +0 -1
  528. package/assets/components/assets/modal/t9n/messages.json +0 -1
  529. package/assets/components/assets/modal/t9n/messages.ko.json +0 -1
  530. package/assets/components/assets/modal/t9n/messages.lt.json +0 -1
  531. package/assets/components/assets/modal/t9n/messages.lv.json +0 -1
  532. package/assets/components/assets/modal/t9n/messages.nl.json +0 -1
  533. package/assets/components/assets/modal/t9n/messages.no.json +0 -1
  534. package/assets/components/assets/modal/t9n/messages.pl.json +0 -1
  535. package/assets/components/assets/modal/t9n/messages.pt-BR.json +0 -1
  536. package/assets/components/assets/modal/t9n/messages.pt-PT.json +0 -1
  537. package/assets/components/assets/modal/t9n/messages.ro.json +0 -1
  538. package/assets/components/assets/modal/t9n/messages.ru.json +0 -1
  539. package/assets/components/assets/modal/t9n/messages.sk.json +0 -1
  540. package/assets/components/assets/modal/t9n/messages.sl.json +0 -1
  541. package/assets/components/assets/modal/t9n/messages.sr.json +0 -1
  542. package/assets/components/assets/modal/t9n/messages.sv.json +0 -1
  543. package/assets/components/assets/modal/t9n/messages.th.json +0 -1
  544. package/assets/components/assets/modal/t9n/messages.tr.json +0 -1
  545. package/assets/components/assets/modal/t9n/messages.uk.json +0 -1
  546. package/assets/components/assets/modal/t9n/messages.vi.json +0 -1
  547. package/assets/components/assets/modal/t9n/messages.zh-CN.json +0 -1
  548. package/assets/components/assets/modal/t9n/messages.zh-HK.json +0 -1
  549. package/assets/components/assets/modal/t9n/messages.zh-TW.json +0 -1
  550. package/assets/components/assets/tip/t9n/messages.ar.json +0 -1
  551. package/assets/components/assets/tip/t9n/messages.bg.json +0 -1
  552. package/assets/components/assets/tip/t9n/messages.bs.json +0 -1
  553. package/assets/components/assets/tip/t9n/messages.ca.json +0 -1
  554. package/assets/components/assets/tip/t9n/messages.cs.json +0 -1
  555. package/assets/components/assets/tip/t9n/messages.da.json +0 -1
  556. package/assets/components/assets/tip/t9n/messages.de.json +0 -1
  557. package/assets/components/assets/tip/t9n/messages.el.json +0 -1
  558. package/assets/components/assets/tip/t9n/messages.en.json +0 -1
  559. package/assets/components/assets/tip/t9n/messages.es.json +0 -1
  560. package/assets/components/assets/tip/t9n/messages.et.json +0 -1
  561. package/assets/components/assets/tip/t9n/messages.fi.json +0 -1
  562. package/assets/components/assets/tip/t9n/messages.fr.json +0 -1
  563. package/assets/components/assets/tip/t9n/messages.he.json +0 -1
  564. package/assets/components/assets/tip/t9n/messages.hr.json +0 -1
  565. package/assets/components/assets/tip/t9n/messages.hu.json +0 -1
  566. package/assets/components/assets/tip/t9n/messages.id.json +0 -1
  567. package/assets/components/assets/tip/t9n/messages.it.json +0 -1
  568. package/assets/components/assets/tip/t9n/messages.ja.json +0 -1
  569. package/assets/components/assets/tip/t9n/messages.json +0 -1
  570. package/assets/components/assets/tip/t9n/messages.ko.json +0 -1
  571. package/assets/components/assets/tip/t9n/messages.lt.json +0 -1
  572. package/assets/components/assets/tip/t9n/messages.lv.json +0 -1
  573. package/assets/components/assets/tip/t9n/messages.nl.json +0 -1
  574. package/assets/components/assets/tip/t9n/messages.no.json +0 -1
  575. package/assets/components/assets/tip/t9n/messages.pl.json +0 -1
  576. package/assets/components/assets/tip/t9n/messages.pt-BR.json +0 -1
  577. package/assets/components/assets/tip/t9n/messages.pt-PT.json +0 -1
  578. package/assets/components/assets/tip/t9n/messages.ro.json +0 -1
  579. package/assets/components/assets/tip/t9n/messages.ru.json +0 -1
  580. package/assets/components/assets/tip/t9n/messages.sk.json +0 -1
  581. package/assets/components/assets/tip/t9n/messages.sl.json +0 -1
  582. package/assets/components/assets/tip/t9n/messages.sr.json +0 -1
  583. package/assets/components/assets/tip/t9n/messages.sv.json +0 -1
  584. package/assets/components/assets/tip/t9n/messages.th.json +0 -1
  585. package/assets/components/assets/tip/t9n/messages.tr.json +0 -1
  586. package/assets/components/assets/tip/t9n/messages.uk.json +0 -1
  587. package/assets/components/assets/tip/t9n/messages.vi.json +0 -1
  588. package/assets/components/assets/tip/t9n/messages.zh-CN.json +0 -1
  589. package/assets/components/assets/tip/t9n/messages.zh-HK.json +0 -1
  590. package/assets/components/assets/tip/t9n/messages.zh-TW.json +0 -1
  591. package/assets/components/assets/tip-manager/t9n/messages.ar.json +0 -1
  592. package/assets/components/assets/tip-manager/t9n/messages.bg.json +0 -1
  593. package/assets/components/assets/tip-manager/t9n/messages.bs.json +0 -1
  594. package/assets/components/assets/tip-manager/t9n/messages.ca.json +0 -1
  595. package/assets/components/assets/tip-manager/t9n/messages.cs.json +0 -1
  596. package/assets/components/assets/tip-manager/t9n/messages.da.json +0 -1
  597. package/assets/components/assets/tip-manager/t9n/messages.de.json +0 -1
  598. package/assets/components/assets/tip-manager/t9n/messages.el.json +0 -1
  599. package/assets/components/assets/tip-manager/t9n/messages.en.json +0 -1
  600. package/assets/components/assets/tip-manager/t9n/messages.es.json +0 -1
  601. package/assets/components/assets/tip-manager/t9n/messages.et.json +0 -1
  602. package/assets/components/assets/tip-manager/t9n/messages.fi.json +0 -1
  603. package/assets/components/assets/tip-manager/t9n/messages.fr.json +0 -1
  604. package/assets/components/assets/tip-manager/t9n/messages.he.json +0 -1
  605. package/assets/components/assets/tip-manager/t9n/messages.hr.json +0 -1
  606. package/assets/components/assets/tip-manager/t9n/messages.hu.json +0 -1
  607. package/assets/components/assets/tip-manager/t9n/messages.id.json +0 -1
  608. package/assets/components/assets/tip-manager/t9n/messages.it.json +0 -1
  609. package/assets/components/assets/tip-manager/t9n/messages.ja.json +0 -1
  610. package/assets/components/assets/tip-manager/t9n/messages.json +0 -1
  611. package/assets/components/assets/tip-manager/t9n/messages.ko.json +0 -1
  612. package/assets/components/assets/tip-manager/t9n/messages.lt.json +0 -1
  613. package/assets/components/assets/tip-manager/t9n/messages.lv.json +0 -1
  614. package/assets/components/assets/tip-manager/t9n/messages.nl.json +0 -1
  615. package/assets/components/assets/tip-manager/t9n/messages.no.json +0 -1
  616. package/assets/components/assets/tip-manager/t9n/messages.pl.json +0 -1
  617. package/assets/components/assets/tip-manager/t9n/messages.pt-BR.json +0 -1
  618. package/assets/components/assets/tip-manager/t9n/messages.pt-PT.json +0 -1
  619. package/assets/components/assets/tip-manager/t9n/messages.ro.json +0 -1
  620. package/assets/components/assets/tip-manager/t9n/messages.ru.json +0 -1
  621. package/assets/components/assets/tip-manager/t9n/messages.sk.json +0 -1
  622. package/assets/components/assets/tip-manager/t9n/messages.sl.json +0 -1
  623. package/assets/components/assets/tip-manager/t9n/messages.sr.json +0 -1
  624. package/assets/components/assets/tip-manager/t9n/messages.sv.json +0 -1
  625. package/assets/components/assets/tip-manager/t9n/messages.th.json +0 -1
  626. package/assets/components/assets/tip-manager/t9n/messages.tr.json +0 -1
  627. package/assets/components/assets/tip-manager/t9n/messages.uk.json +0 -1
  628. package/assets/components/assets/tip-manager/t9n/messages.vi.json +0 -1
  629. package/assets/components/assets/tip-manager/t9n/messages.zh-CN.json +0 -1
  630. package/assets/components/assets/tip-manager/t9n/messages.zh-HK.json +0 -1
  631. package/assets/components/assets/tip-manager/t9n/messages.zh-TW.json +0 -1
  632. package/assets/esri/core/workers/chunks/1e17ad6cdffa5016a3db.js +0 -1
  633. package/assets/esri/core/workers/chunks/211837df0edada4414c5.js +0 -1
  634. package/assets/esri/core/workers/chunks/21ebd234cf32ae52b3ea.js +0 -1
  635. package/assets/esri/core/workers/chunks/262c5794650853457acc.js +0 -1
  636. package/assets/esri/core/workers/chunks/3266c3392c24ce6cdd83.js +0 -2
  637. package/assets/esri/core/workers/chunks/509065a27bd07bd32475.js +0 -1
  638. package/assets/esri/core/workers/chunks/69278d08a7d64917f826.js +0 -2
  639. package/assets/esri/core/workers/chunks/6f3ffc04086bca30e55d.js +0 -2
  640. package/assets/esri/core/workers/chunks/70e2804d3710c6af468e.js +0 -2
  641. package/assets/esri/core/workers/chunks/78fc9a55e620602db1ff.js +0 -2
  642. package/assets/esri/core/workers/chunks/a67c3958d76d10c04fa6.js +0 -2
  643. package/assets/esri/core/workers/chunks/a67c3958d76d10c04fa6.js.LICENSE.txt +0 -3
  644. package/assets/esri/core/workers/chunks/a94dd0f5839b6e2bb2d2.js +0 -1
  645. package/assets/esri/core/workers/chunks/b7bcff9a64f41a0a0b6a.js +0 -1
  646. package/assets/esri/core/workers/chunks/be631029691d9a320cb5.js +0 -2
  647. package/assets/esri/core/workers/chunks/c7802c144959d60e774a.js +0 -1
  648. package/assets/esri/core/workers/chunks/d9251c3c85c3ddd242c8.js +0 -2
  649. package/assets/esri/core/workers/chunks/edd3cf415955309b4ca4.js +0 -1
  650. package/assets/esri/core/workers/chunks/fbd577f56529063ce491.js +0 -1
  651. package/form/elements/inputs/attachments/support/inputs.d.ts +0 -10
  652. package/form/support/formUtils.d.ts +0 -4
  653. package/symbols/cim/enums.d.ts +0 -50
  654. package/symbols/cim/enums.js +0 -5
  655. package/symbols/support/OccludedVisibility.d.ts +0 -2
  656. package/symbols/support/materialUtils.d.ts +0 -2
  657. package/symbols/support/textUtils.d.ts +0 -10
  658. package/symbols/support/typeUtils.d.ts +0 -86
  659. package/symbols/support/webStyleAcceptedFormats.d.ts +0 -2
  660. package/symbols.d.ts +0 -439
  661. package/symbols.js +0 -5
  662. /package/effects/{FocusAreaStyle.d.ts → types.d.ts} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as a}from"../core/reactiveUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{tsx as F,messageBundle as M,vmEvent as O}from"./support/widget.js";import{setFocus as T}from"./support/widgetUtils.js";const P=t.ofType(y),A="nested";let D=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const a=_(t),r=L(t),n=_(i),d=L(i),p=!!r&&!!d&&r===d,c={selected:l,from:a,to:n},m=t.group,h=i.group,y=a?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(p.item));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),a),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return F("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const a=i.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?F("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return F("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return F("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},F("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:a,minFilterItems:r,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:a,minFilterItems:r,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return F("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return F("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),F("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,T(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,T(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,T(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:a,collapseButton:r,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[F("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:a,closed:!e,collapsed:t,collapsible:r,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),F("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map(e=>this._renderItem(e)),s?F("div",{class:p.filterNoResults,slot:"filter-no-results"},F("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?F("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return F(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),a=_(t);this.viewModel.moveListItem(s,a,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_activeItem",void 0),e([r()],D.prototype,"_tooltipReferenceMap",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_focusLayerFlowItem",void 0),e([r()],D.prototype,"_layerListMap",void 0),e([r()],D.prototype,"_totalItems",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_renderedOpenLayerFlowItems",null),e([r({readOnly:!0})],D.prototype,"catalogLayerList",void 0),e([r()],D.prototype,"catalogOptions",void 0),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"knowledgeGraphOptions",void 0),e([r()],D.prototype,"label",null),e([r()],D.prototype,"layerTablesEnabled",void 0),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"mapImageOptions",void 0),e([r(),M("esri/widgets/LayerList/t9n/LayerList")],D.prototype,"messages",void 0),e([r(),M("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({readOnly:!0})],D.prototype,"openedLayers",void 0),e([r({readOnly:!0})],D.prototype,"openedLayerLists",void 0),e([r()],D.prototype,"operationalItems",null),e([r()],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableList",void 0),e([r()],D.prototype,"tileOptions",void 0),e([r()],D.prototype,"view",null),e([O("trigger-action"),r({type:m})],D.prototype,"viewModel",void 0),e([r()],D.prototype,"visibilityAppearance",void 0),e([r({type:h,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.LayerList")],D);const R=D;export{R as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as a}from"../core/reactiveUtils.js";import{property as r,subclass as n}from"../core/accessorSupport/decorators.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{tsx as F,messageBundle as M,vmEvent as O}from"./support/widget.js";import{setFocus as T}from"./support/widgetUtils.js";const P=t.ofType(y),A="nested";let D=class extends(i(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const a=_(t),r=L(t),n=_(i),d=L(i),p=!!r&&!!d&&r===d,c={selected:l,from:a,to:n},m=t.group,h=i.group,y=a?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(p.item));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o)){if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o===i){const e=Array.from(o.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);return void this._sortLayers(o,e)}this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l})}}}initialize(){this.addHandles([s(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),a),s(()=>this.viewModel.operationalItems,"change",()=>f(this.selectedItems),a),l(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten(e=>e.children.filter(e=>"catalog-dynamic-group"!==e.layer?.type)).length}get _visibleItems(){return this.operationalItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,i)=>this._renderLayerFlowItem(t,i===e.length-1))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return F("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;i.removeAll(),i.addMany(l);const a=i.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?F("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return F("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return F("div",{class:p.itemMessage,key:"esri-layer-list__no-items"},F("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:a,minFilterItems:r,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:a,minFilterItems:r,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return F("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return F("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),F("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-start",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,T(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,T(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,T(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:a,collapseButton:r,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[F("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:a,closed:!e,collapsed:t,collapsible:r,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),F("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map(e=>this._renderItem(e)),s?F("div",{class:p.filterNoResults,slot:"filter-no-results"},F("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?F("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return F(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),a=_(t);this.viewModel.moveListItem(s,a,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map(e=>_(e)).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_activeItem",void 0),e([r()],D.prototype,"_tooltipReferenceMap",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_focusLayerFlowItem",void 0),e([r()],D.prototype,"_layerListMap",void 0),e([r()],D.prototype,"_totalItems",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_renderedOpenLayerFlowItems",null),e([r({readOnly:!0})],D.prototype,"catalogLayerList",void 0),e([r()],D.prototype,"catalogOptions",void 0),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"knowledgeGraphOptions",void 0),e([r()],D.prototype,"label",null),e([r()],D.prototype,"layerTablesEnabled",void 0),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"mapImageOptions",void 0),e([r(),M("esri/widgets/LayerList/t9n/LayerList")],D.prototype,"messages",void 0),e([r(),M("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({readOnly:!0})],D.prototype,"openedLayers",void 0),e([r({readOnly:!0})],D.prototype,"openedLayerLists",void 0),e([r()],D.prototype,"operationalItems",null),e([r()],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableList",void 0),e([r()],D.prototype,"tileOptions",void 0),e([r()],D.prototype,"view",null),e([O("trigger-action"),r({type:m})],D.prototype,"viewModel",void 0),e([r()],D.prototype,"visibilityAppearance",void 0),e([r({type:h,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.LayerList")],D);const R=D;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{onLocaleChange as i}from"../../intl.js";import r from"../../core/Accessor.js";import t from"../../core/Collection.js";import{watch as s,initial as a,when as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{get as y}from"../../core/accessorSupport/get.js";import{getEffectiveFeatureReduction as d}from"../../views/2d/layers/features/layerAdapters/featureReductionUtils.js";import h from"./support/ActiveLayerInfo.js";const c={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},L=t.ofType(h),f=new Set(["esri.layers.BuildingSceneLayer","esri.layers.CatalogLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.OrientedImageryLayer","esri.layers.ParquetLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer","esri.layers.LinkChartLayer","esri.layers.catalog.CatalogFootprintLayer","esri.layers.catalog.CatalogDynamicGroupLayer","esri.layers.knowledgeGraph.KnowledgeGraphSublayer","esri.layers.KnowledgeGraphLayer"]),u="view.basemapView.baseLayerViews",p="view.groundView.layerViews",v="view.basemapView.referenceLayerViews",w=[u,p,"view.layerViews",v];let _=class extends r{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new t,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new L,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this.addHandles(s(()=>this.view,()=>this._viewHandles(),a),c.view),this.addHandles(i(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?"ready":"disabled"}_viewHandles(){this.removeHandles(c.state),this.view&&this.addHandles(s(()=>this.state,()=>this._stateHandles(),a),c.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([c.allLayerViews,c.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);const i=this._activeLayerInfosByLayerViewId[e];i&&this._activeLayerInfosPromises.delete(i),delete this._activeLayerInfosByLayerViewId[e],i?.parent?.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{view:e}=this;if(!e)return;const{allLayerViews:i}=e;i.length&&this._refresh(),this.addHandles(i.on("change",e=>this._allLayerViewsChangeHandle(e)),c.allLayerViews),this.addHandles(s(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),c.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length)return this._destroyViewActiveLayerInfos(),void this._refresh();if(e.removed.length){for(const{uid:i}of e.removed)this._destroyViewActiveLayerInfo(i);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;const{baseLayerViews:i,groundLayerViews:r,referenceLayerViews:t}=this.view.basemapView,s=!this.basemapLegendVisible&&(i?.includes(e)||t?.includes(e)),a=!this.groundLegendVisible&&r?.includes(e);return!s&&!a}_sortActiveLayerInfos(e){const i=this.view;if(e.length<2||!i)return;const r=[];e.forEach(i=>{if(!i.parent){const t=i.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(r.push(i),i.parent=a,a.children.add(i),this._sortActiveLayerInfos(a.children))}}),e.removeMany(r);const t={};i.allLayerViews.forEach((e,i)=>t[e.layer.uid]=i),e.sort((e,i)=>{const r=t[e.layer.uid]||0;return(t[i.layer.uid]||0)-r})}_generateLayerViews(){const e=[];return w.filter(this._filterLayerViews,this).map(e=>y(this,e)).filter(e=>null!=e).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===u||e===v),r=!this.groundLegendVisible&&e===p;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach(t=>{i.push(t),r(t[e])}),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some(i=>this._hasLayerInfo(i,e))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some(e=>this._isLayerUIDMatching(e,i))}_isLayerViewSupported(e){return!!f.has(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this.removeHandles(e.uid),this.addHandles(s(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let s=this._activeLayerInfosByLayerViewId[r];s||(s=new h({layer:i,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[r]=s);const a=void 0!==t?.title&&t.layer.uid===i.uid;s.title=a?t.title:i.title,s.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,s.respectLayerVisibility=this.respectLayerVisibility,s.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,s.keepCacheOnDestroy=this.keepCacheOnDestroy,s.sublayerIds=t?.sublayerIds||[];const n=i.parent&&"uid"in i.parent?this._layerViewByLayerId[i.parent?.uid]:null;s.parent=this._activeLayerInfosByLayerViewId[n?.uid],this._addActiveLayerInfo(s),this._constructLegendElements(s),this._attachHandlesToActiveLayerInfo(s)}_attachHandlesToActiveLayerInfo(e){const{layer:i,layerView:r}=e,t=r.uid;this.removeHandles(t),this.addHandles([s(()=>i.title,i=>this._titleHandle(i,e)),s(()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol,"effect"in i&&i.effect,"featureReduction"in i&&d(i,r.view),this.view?.timeZone],()=>this._constructLegendElements(e)),s(()=>"filter"in r&&r.filter,()=>{null!=d(r.layer,r.view)&&this._constructLegendElements(e)}),n(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),s(()=>e.loading,()=>this.notifyChange("loading"),a)],t),this.respectLayerVisibility&&this.addHandles([s(()=>i.legendEnabled,i=>this._legendEnabledHandle(i,e)),s(()=>r.legendEnabled,i=>{this.view?.suspended||this._legendEnabledHandle(i,e)})],t),this.respectLayerDefinitionExpression&&"definitionExpression"in i&&this.addHandles(s(()=>i.definitionExpression,()=>this._constructLegendElements(e)),t)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some(e=>e.layer.uid===r.uid),t=r.parent;(t&&"uid"in t?this._layerViewByLayerId[t.uid]:null)&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach(i=>{const r=i.layer.parent,t=r&&"uid"in r?this._layerViewByLayerId[r?.uid]:null,s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){const{layer:i}=e;if("featureCollections"in i&&i.featureCollections)return e.buildLegendElementsForFeatureCollections(i.featureCollections);if("featureReduction"in i&&i.featureReduction&&"renderer"in i.featureReduction&&("binning"===i.featureReduction.type||"cluster"===i.featureReduction.type)&&(!this.view||i.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(i.featureReduction);if("renderer"in i&&i.renderer&&!("sublayers"in i))return e.buildLegendElementsForRenderer(i.renderer);if("url"in i&&i.url&&"catalog"!==i.type&&"knowledge-graph"!==i.type)return e.buildLegendElementsForTools();const r=e.children.map(e=>this._constructLegendElements(e));return Promise.all(r).then(()=>{})}async _constructLegendElements(e){const i=this._activeLayerInfosPromises.get(e);i&&await i.catch(()=>{});const r=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,r),r.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([o({type:L})],_.prototype,"activeLayerInfos",void 0),e([o()],_.prototype,"basemapLegendVisible",void 0),e([o()],_.prototype,"groundLegendVisible",void 0),e([o()],_.prototype,"hideLayersNotInCurrentView",void 0),e([o()],_.prototype,"keepCacheOnDestroy",void 0),e([o({readOnly:!0})],_.prototype,"loading",null),e([o()],_.prototype,"respectLayerDefinitionExpression",void 0),e([o()],_.prototype,"respectLayerVisibility",void 0),e([o()],_.prototype,"layerInfos",void 0),e([o({readOnly:!0})],_.prototype,"state",null),e([o()],_.prototype,"view",void 0),_=e([l("esri.widgets.Legend.LegendViewModel")],_);export{_ as default};
5
+ import{__decorate as e}from"tslib";import{onLocaleChange as i}from"../../intl.js";import r from"../../core/Accessor.js";import t from"../../core/Collection.js";import{watch as s,initial as a,when as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{get as y}from"../../core/accessorSupport/get.js";import{getEffectiveFeatureReduction as d}from"../../views/2d/layers/features/layerAdapters/featureReductionUtils.js";import h from"./support/ActiveLayerInfo.js";const c={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},L=t.ofType(h),f=new Set(["esri.layers.BuildingSceneLayer","esri.layers.CatalogLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.OrientedImageryLayer","esri.layers.ParquetLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer","esri.layers.LinkChartLayer","esri.layers.catalog.CatalogFootprintLayer","esri.layers.catalog.CatalogDynamicGroupLayer","esri.layers.knowledgeGraph.KnowledgeGraphSublayer","esri.layers.KnowledgeGraphLayer"]),u="view.basemapView.baseLayerViews",p="view.groundView.layerViews",v="view.basemapView.referenceLayerViews",w=[u,p,"view.layerViews",v];let _=class extends r{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new t,this._activeLayerInfosPromises=new WeakMap,this.activeLayerInfos=new L,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerDefinitionExpression=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this.addHandles(s(()=>this.view,()=>this._viewHandles(),a),c.view),this.addHandles(i(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get loading(){return this.activeLayerInfos.some(e=>e.loading)}get state(){return this.view?.ready?"ready":"disabled"}_viewHandles(){this.removeHandles(c.state),this.view&&this.addHandles(s(()=>this.state,()=>this._stateHandles(),a),c.state)}_stateHandles(){this._resetAll(),"ready"===this.state&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([c.allLayerViews,c.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);const i=this._activeLayerInfosByLayerViewId[e];i&&this._activeLayerInfosPromises.delete(i),delete this._activeLayerInfosByLayerViewId[e],i?.parent?.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{view:e}=this;if(!e)return;const{allLayerViews:i}=e;i.length&&this._refresh(),this.addHandles(i.on("change",e=>this._allLayerViewsChangeHandle(e)),c.allLayerViews),this.addHandles(s(()=>[this.basemapLegendVisible,this.groundLegendVisible,this.hideLayersNotInCurrentView,this.keepCacheOnDestroy,this.layerInfos,this.respectLayerDefinitionExpression,this.respectLayerVisibility],()=>this._refresh()),c.legendProperties)}_allLayerViewsChangeHandle(e){if(e.added.length&&this._generateActiveLayerInfosForLayerViews(e.added),e.moved.length)return this._destroyViewActiveLayerInfos(),void this._refresh();if(e.removed.length){for(const{uid:i}of e.removed)this._destroyViewActiveLayerInfo(i);this._refresh()}}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.drain(e=>this._activeLayerInfosPromises.delete(e)),this._generateActiveLayerInfosForLayerViews(this._generateLayerViews())}_generateActiveLayerInfosForLayerViews(e){e.filter(this._filterBasemapLayerViews,this).filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this)}_filterBasemapLayerViews(e){if(!this.view?.basemapView)return!0;const{baseLayerViews:i,groundLayerViews:r,referenceLayerViews:t}=this.view.basemapView,s=i.some(i=>{const r="layerViews"in i?i.layerViews:null;return r?r.includes(e):i===e}),a=!this.basemapLegendVisible&&(s||t?.includes(e)),n=!this.groundLegendVisible&&r?.includes(e);return!a&&!n}_sortActiveLayerInfos(e){const i=this.view;if(e.length<2||!i)return;const r=[];e.forEach(i=>{if(!i.parent){const t=i.layer.parent,s=t&&"uid"in t&&this._layerViewByLayerId[t.uid],a=s&&this._activeLayerInfosByLayerViewId[s.uid];a&&e.includes(a)&&(r.push(i),i.parent=a,a.children.add(i),this._sortActiveLayerInfos(a.children))}}),e.removeMany(r);const t={};i.allLayerViews.forEach((e,i)=>t[e.layer.uid]=i),e.sort((e,i)=>{const r=t[e.layer.uid]||0;return(t[i.layer.uid]||0)-r})}_generateLayerViews(){const e=[];return w.filter(this._filterLayerViews,this).map(e=>y(this,e)).filter(e=>null!=e).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===u||e===v),r=!this.groundLegendVisible&&e===p;return!i&&!r}_collectLayerViews(e,i){const r=t=>(t&&t.forEach(t=>{i.push(t),r(t[e])}),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some(i=>this._hasLayerInfo(i,e))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some(e=>this._isLayerUIDMatching(e,i))}_isLayerViewSupported(e){return!!f.has(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this.removeHandles(e.uid),this.addHandles(s(()=>[e.legendEnabled,e.layer?.legendEnabled],()=>this._layerActiveHandle(e)),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){return!this.respectLayerVisibility||e.legendEnabled&&e.layer?.legendEnabled}async _buildActiveLayerInfo(e){const i=e.layer,r=e.uid,t=this._layerInfosByLayerViewId[r];let s=this._activeLayerInfosByLayerViewId[r];s||(s=new h({layer:i,layerView:e,view:this.view??void 0}),this._activeLayerInfosByLayerViewId[r]=s);const a=void 0!==t?.title&&t.layer.uid===i.uid;s.title=a?t.title:i.title,s.respectLayerDefinitionExpression=this.respectLayerDefinitionExpression,s.respectLayerVisibility=this.respectLayerVisibility,s.hideLayersNotInCurrentView=this.hideLayersNotInCurrentView,s.keepCacheOnDestroy=this.keepCacheOnDestroy,s.sublayerIds=t?.sublayerIds||[];const n=i.parent&&"uid"in i.parent?this._layerViewByLayerId[i.parent?.uid]:null;s.parent=this._activeLayerInfosByLayerViewId[n?.uid],this._addActiveLayerInfo(s),this._constructLegendElements(s),this._attachHandlesToActiveLayerInfo(s)}_attachHandlesToActiveLayerInfo(e){const{layer:i,layerView:r}=e,t=r.uid;this.removeHandles(t),this.addHandles([s(()=>i.title,i=>this._titleHandle(i,e)),s(()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol,"effect"in i&&i.effect,"featureReduction"in i&&d(i,r.view),this.view?.timeZone],()=>this._constructLegendElements(e)),s(()=>"filter"in r&&r.filter,()=>{null!=d(r.layer,r.view)&&this._constructLegendElements(e)}),n(()=>!!this.view?.stationary,()=>this._scaleHandle(e)),s(()=>e.loading,()=>this.notifyChange("loading"),a)],t),this.respectLayerVisibility&&this.addHandles([s(()=>i.legendEnabled,i=>this._legendEnabledHandle(i,e)),s(()=>r.legendEnabled,i=>{this.view?.suspended||this._legendEnabledHandle(i,e)})],t),this.respectLayerDefinitionExpression&&"definitionExpression"in i&&this.addHandles(s(()=>i.definitionExpression,()=>this._constructLegendElements(e)),t)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const i=e.parent;if(i)i.children.includes(e)||i.children.push(e),this._sortActiveLayerInfos(i.children);else{const i=this.layerInfos?.some(e=>e.layer.uid===r.uid),t=r.parent;(t&&"uid"in t?this._layerViewByLayerId[t.uid]:null)&&!i?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const e=[];this._activeLayerInfosWithNoParent.forEach(i=>{const r=i.layer.parent,t=r&&"uid"in r?this._layerViewByLayerId[r?.uid]:null,s=this._activeLayerInfosByLayerViewId[t?.uid];s&&(e.push(i),i.parent=s)}),e.length&&(this._activeLayerInfosWithNoParent.removeMany(e),e.forEach(e=>this._addActiveLayerInfo(e)))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}async _getBuildLegendPromise(e){const{layer:i}=e;if("featureCollections"in i&&i.featureCollections)return e.buildLegendElementsForFeatureCollections(i.featureCollections);if("featureReduction"in i&&i.featureReduction&&"renderer"in i.featureReduction&&("binning"===i.featureReduction.type||"cluster"===i.featureReduction.type)&&(!this.view||i.featureReduction.maxScale<=this.view.scale))return e.buildLegendElementsForFeatureReduction(i.featureReduction);if("renderer"in i&&i.renderer&&!("sublayers"in i))return e.buildLegendElementsForRenderer(i.renderer);if("url"in i&&i.url&&"catalog"!==i.type&&"knowledge-graph"!==i.type)return e.buildLegendElementsForTools();const r=e.children.map(e=>this._constructLegendElements(e));return Promise.all(r).then(()=>{})}async _constructLegendElements(e){const i=this._activeLayerInfosPromises.get(e);i&&await i.catch(()=>{});const r=this._getBuildLegendPromise(e);this._activeLayerInfosPromises.set(e,r),r.finally(()=>{this._activeLayerInfosPromises.delete(e)})}};e([o({type:L})],_.prototype,"activeLayerInfos",void 0),e([o()],_.prototype,"basemapLegendVisible",void 0),e([o()],_.prototype,"groundLegendVisible",void 0),e([o()],_.prototype,"hideLayersNotInCurrentView",void 0),e([o()],_.prototype,"keepCacheOnDestroy",void 0),e([o({readOnly:!0})],_.prototype,"loading",null),e([o()],_.prototype,"respectLayerDefinitionExpression",void 0),e([o()],_.prototype,"respectLayerVisibility",void 0),e([o()],_.prototype,"layerInfos",void 0),e([o({readOnly:!0})],_.prototype,"state",null),e([o()],_.prototype,"view",void 0),_=e([l("esri.widgets.Legend.LegendViewModel")],_);export{_ as default};
package/widgets/Print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as E,tsx as L,isRTL as $,tsxFragment as F,isActivationKey as M}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function B(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function N(e){return e?.toLowerCase()===P}function V(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.fileFormatTitle,L("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>L("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e}))))),x=L("calcite-label",{layout:"inline"},L("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=L("div",null,L("div",{class:R.formSectionContainer},L("calcite-label",null,e.template,L("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},L("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,L("calcite-icon",{class:R.templateSelectArrow,icon:$()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),E=L("div",{class:R.formSectionContainer},L("calcite-label",null,e.dpi,L("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=L("div",{class:R.formSectionContainer},L("calcite-label",null,L("div",{class:R.srLabel},e.outSpatialReference,L("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),L("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:L("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),M=L("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),L("div",{class:R.scaleInputContainer},L("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),L("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},M,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?L("div",{class:R.formSectionContainer,key:"author-info"},L("calcite-label",null,e.author,L("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?L("div",{class:R.formSectionContainer,key:"copyright-text"},L("calcite-label",null,e.copyright,L("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,E,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?L("div",{class:R.formSectionContainer,key:"legend-info"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?L("div",{class:R.formSectionContainer,key:"north-arrow"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?L("div",{class:R.formSectionContainer,key:"scale-bar"},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=L("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},M,E,F,L("div",{class:R.formSectionContainer},L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),B=this.exportedLinks.toArray(),N=this._renderExportedLinkItems(B),V={[R.exportSectionCentered]:!B.length},D="layoutTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},L("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?w:null,C,"layoutTab"===this._selectedTab?k:null,L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?L("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},L("div",{class:R.panelContainer},w,k,L("div",null,L("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},L("calcite-label",null,e.width,L("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("calcite-label",null,e.height,L("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),L("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),onclick:this._switchInput,type:"button"})),x),L("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):L("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},L("div",{class:R.panelContainer},L("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===B.length?L("div",{class:R.exportedFilesEmpty},L("calcite-icon",{icon:"file",scale:"l"}),L("div",null,L(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),L("div",null,e.exportHint))):N))),U="2d"!==a?.type,H=L("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=B.some(({state:e})=>"pending"===e),W=L("div",{class:R.content,key:"panel"},L("div",null,L("ul",{bind:this,class:R.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),L("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?L("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?L("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?L("calcite-label",{layout:"inline"},L("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,L("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=L("calcite-flow",{key:"root-flow"},L("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},L("div",{class:R.printWidgetContainer},this.headerVisible?L("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return L("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=D.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l}=e,o=a&&!l&&this.messages[a]?this.messages[a]:null;if(o)return o;const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!!t?.id):[]}_getDefaultTemplates(){return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!t?.id):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!N(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>L("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},L("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?L("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?L("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?L("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?L("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return L("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},L("div",{class:R.templateSelectFlowItemContainer},L("div",{class:R.templateSelectFlowItemContent},n?null:s,L("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?L("div",{key:"my-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?L("div",{key:"org-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?L("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?L("div",{key:"default-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?L("div",{key:"service-templates"},L("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),L("div",{class:R.templateButtonContainer},L("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?L("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:L("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,L("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return L("div",{class:R.formSectionContainer,key:l},L("calcite-label",null,l,L("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return L("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!B(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?L("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},L("calcite-list",{label:""},e.portalItem?L("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},L("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):L("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},L("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),L("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},L("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return L("div",{class:R.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},L("div",null,L("div",{class:R.exportedFileLinkTitle},o),L("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?L("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?L("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):L("calcite-icon",{icon:V(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?L("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,onclick:a?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return L(F,null,L("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return L("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(M(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),E("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),E("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),E("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H as default};
5
+ import{__decorate as e}from"tslib";import{formatNumber as t}from"../intl.js";import i from"../core/Collection.js";import{deprecateWidget as a}from"../core/deprecate.js";import{JSONMap as l}from"../core/jsonMap.js";import o from"../core/Logger.js";import{watch as n,on as s,whenOnce as r}from"../core/reactiveUtils.js";import{unitName as c}from"../core/unitFormatUtils.js";import{addProxy as p,hasSameOrigin as d}from"../core/urlUtils.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureInteger as h}from"../core/accessorSupport/ensureType.js";import b from"../geometry/SpatialReference.js";import{isValid as _}from"../geometry/support/spatialReferenceUtils.js";import v from"../portal/Portal.js";import{reArcGISOnlineDomain as g}from"../portal/support/urlUtils.js";import{findToken as f}from"../rest/utils.js";import{formatJsonMap as y}from"../rest/support/fileFormat.js";import T from"./Widget.js";import w from"./Print/FileLink.js";import k from"./Print/PrintViewModel.js";import x from"./Print/TemplateOptions.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{globalCss as S}from"./support/globalCss.js";import{Heading as I}from"./support/Heading.js";import{legacyIcon as O}from"./support/legacyIcon.js";import{messageBundle as E,tsx as $,isRTL as L,tsxFragment as F,isActivationKey as M}from"./support/widget.js";const P="map-only",A="esri-print",R={base:A,headerTitle:`${A}__header-title`,layoutTabList:`${A}__layout-tab-list`,layoutTab:`${A}__layout-tab`,layoutSection:`${A}__layout-section`,mapOnlySection:`${A}__map-only-section`,panelItemsCentered:`${A}__panel-items--centered`,loader:`${A}__loader`,swapButton:`${A}__swap-button`,printButton:`${A}__export-button`,printButtonSection:`${A}__export-button-section`,printButtonSectionDivider:`${A}__export-button-section--divider`,templateSelectContainer:`${A}__template-select-container`,templateSelectIcon:`${A}__template-select-icon`,templateSelectError:`${A}__template-select-error`,templateSelectArrow:`${A}__template-select-arrow`,formSectionContainer:`${A}__form-section-container`,advancedOptionsSection:`${A}__advanced-options-section`,advancedOptionsContainer:`${A}__advanced-options-container`,browseTemplateButtonContainer:`${A}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${A}__browse-template-button-container-filter`,exportedFilesContainer:`${A}__export-panel-container`,exportedFilesTitle:`${A}__export-title`,exportedFile:`${A}__exported-file`,exportedFileLinkTitle:`${A}__exported-file-link-title`,exportedFileLinkDescription:`${A}__exported-file-link-description`,exportedFilesEmpty:`${A}__exported-files-empty`,printWidgetContainer:`${A}__container`,content:`${A}__content`,panelContainer:`${A}__panel-container`,scaleInfoContainer:`${A}__scale-info-container`,scaleInputContainer:`${A}__scale-input-container`,scaleInput:`${A}__scale-input`,sizeContainer:`${A}__size-container`,panelError:`${A}__panel--error`,exportedFileLoader:`${A}__exported-file--loader`,exportSection:`${A}__export-section`,exportSectionCentered:`${A}__export-section--centered`,templateButtonContainer:`${A}__template-button-container`,templateDoneButton:`${A}__template-done-button`,templateSelectFlowItemContainer:`${A}__template-select-flow-item-container`,templateSelectFlowItemContent:`${A}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${A}__template-select-flow-item-list-heading`,srLabel:`${A}__sr-label`,invalidWkidText:`${A}__invalid-wkid-text`};function B(e){return!isNaN(e)&&e>0&&Number.isFinite(e)}function N(e){return e?.toLowerCase()===P}function V(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const D=new l({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let U=class extends T{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab="layoutTab",this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new k,this._onInput=e=>{"layoutTab"===this._selectedTab?this.templateOptions.title=e.currentTarget.value:"mapOnlyTab"===this._selectedTab&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=f(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},a(o.getLogger(this),"Print","arcgis-print",{version:"4.33"}),this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([n(()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format],()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=y.apiValues;this._formats=e.format.choiceList.map(e=>{const i=t.find(t=>new RegExp(`\\b${t}\\b`,"i").test(e))??e;return{value:i,label:e===i?e.toUpperCase():e}}).sort((e,t)=>e.label.localeCompare(t.label))}const t=this._formats.some(({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format));if(e.format.defaultValue&&!t){const t=this._formats.find(({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue))?.value;return void(t&&(this.templateOptions.format=t))}}),n(()=>[this.templateOptions.id,this.viewModel.loaded],()=>{const{layout:e}=this.templateOptions;this._selectedTab=N(e)?"mapOnlyTab":"layoutTab","layoutTab"===this._selectedTab&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))}),n(()=>this.templateOptions.dpi,e=>{e<=0&&(this.templateOptions.dpi=1)}),n(()=>this.viewModel.view?.scale,e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}),s(()=>this.viewModel,"submit",e=>this.emit("submit",e)),s(()=>this.viewModel,"complete",e=>this.emit("complete",e))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout(()=>{this._awaitingServerResponse=!0,this.scheduleRender()},500);this.viewModel.load().then(()=>{clearTimeout(i),this._awaitingServerResponse=!1})}loadDependencies(){return C({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get saveExportEnabled(){return this.viewModel.saveExportEnabled}set saveExportEnabled(e){this.viewModel.saveExportEnabled=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:c,layout:p,layoutItem:d,legendEnabled:m,northArrowEnabled:u,scaleBarEnabled:v,scaleEnabled:g,scale:f,width:y}=t,T="ready"!==i.state||this._awaitingServerResponse||!(p||d),w=this._renderTitleOrFileNameSection(),k=$("div",{class:R.formSectionContainer},$("calcite-label",null,e.fileFormatTitle,$("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map(({value:e,label:t},i)=>$("calcite-combobox-item",{heading:t,key:`file-format-${i}`,selected:e===this.templateOptions.format,value:e}))))),x=$("calcite-label",{layout:"inline"},$("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),C=$("div",null,$("div",{class:R.formSectionContainer},$("calcite-label",null,e.template,$("calcite-block",{class:R.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",label:e.template,loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},$("calcite-icon",{class:R.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?$("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,$("calcite-icon",{class:R.templateSelectArrow,icon:L()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),x),E=$("div",{class:R.formSectionContainer},$("calcite-label",null,e.dpi,$("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._updateNumberInputValue}))),F=$("div",{class:R.formSectionContainer},$("calcite-label",null,$("div",{class:R.srLabel},e.outSpatialReference,$("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),$("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=h(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new b({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||_(i.outSpatialReference)}}),this._isValidSpatialReference?null:$("div",{class:R.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),M=$("div",{class:this.classes(R.scaleInfoContainer,R.formSectionContainer)},$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),$("div",{class:R.scaleInputContainer},$("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:R.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),$("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),P=$("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:R.advancedOptionsContainer,key:"advanced-section-for-layout"},M,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?$("div",{class:R.formSectionContainer,key:"author-info"},$("calcite-label",null,e.author,$("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?$("div",{class:R.formSectionContainer,key:"copyright-text"},$("calcite-label",null,e.copyright,$("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,E,F,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?$("div",{class:R.formSectionContainer,key:"legend-info"},$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:!!m,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?$("div",{class:R.formSectionContainer,key:"north-arrow"},$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:!!u,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?$("div",{class:R.formSectionContainer,key:"scale-bar"},$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),A=$("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:R.advancedOptionsContainer},M,E,F,$("div",{class:R.formSectionContainer},$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),B=this.exportedLinks.toArray(),N=this._renderExportedLinkItems(B),V={[R.exportSectionCentered]:!B.length},D="layoutTab"===this._selectedTab?$("section",{"aria-labelledby":`${this.id}__layoutTab`,class:R.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},$("div",{class:R.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?w:null,C,"layoutTab"===this._selectedTab?k:null,$("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,disabled:!(p||d?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},P))):"mapOnlyTab"===this._selectedTab?$("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:R.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},$("div",{class:R.panelContainer},w,k,$("div",null,$("div",{class:this.classes(R.sizeContainer,R.formSectionContainer)},$("calcite-label",null,e.width,$("calcite-input-number",{bind:this,"data-input-name":"width",value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue})),$("calcite-label",null,e.height,$("calcite-input-number",{bind:this,"data-input-name":"height",value:`${c}`,onCalciteInputNumberInput:this._updateNumberInputValue})),$("button",{"aria-label":e.swap,bind:this,class:this.classes(S.widgetButton,R.swapButton,O.swap),onclick:this._switchInput,type:"button"})),x),$("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(R.panelContainer,R.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},A))):$("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(R.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},$("div",{class:R.panelContainer},$("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:R.exportedFilesContainer},0===B.length?$("div",{class:R.exportedFilesEmpty},$("calcite-icon",{icon:"file",scale:"l"}),$("div",null,$(I,{class:R.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),$("div",null,e.exportHint))):N))),U="2d"!==a?.type,H=$("div",{class:R.panelError},a?U?e.sceneViewError:e.serviceError:e.noViewError),z=B.some(({state:e})=>"pending"===e),W=$("div",{class:R.content,key:"panel"},$("div",null,$("ul",{bind:this,class:R.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},$("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"layoutTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"layoutTab",id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),$("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"mapOnlyTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"mapOnlyTab",id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),$("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${"exportTab"===this._selectedTab}`,class:R.layoutTab,"data-tab-id":"exportTab",id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},z?$("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),D),"exportTab"!==this._selectedTab?$("div",{class:this.classes(R.printButtonSection,!this.saveExportHidden&&this.portal?R.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?$("calcite-label",{layout:"inline"},$("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,$("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(R.printButton),disabled:T||!(p||d?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),q=$("calcite-flow",{key:"root-flow"},$("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},$("div",{class:R.printWidgetContainer},this.headerVisible?$("header",{class:R.headerTitle},e.export):null,this.error||U||!a?H:W)),this._renderChooseTemplateFlowItem()),K="initializing"===i.state,J=K?this._renderLoader():q,G={[R.panelItemsCentered]:K};return $("div",{bind:this,class:this.classes(R.base,S.widget,S.panel,G)},J)}_getPageSizeLabel(e){if(!e)return;const i=e.layoutTemplateInfo;if(!i)return;const a=D.fromJSON(i.pageUnits.toLowerCase());return`${t(i.pageSize[0])} × ${t(i.pageSize[1])} ${c(this.messagesUnits,a,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l}=e,o=a&&!l&&this.messages[a]?this.messages[a]:null;if(o)return o;const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!!t?.id):[]}_getDefaultTemplates(){return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter(({layout:e,layoutItem:t})=>!N(e)&&!t?.id):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter(({layout:e})=>!N(e))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort((e,t)=>(e.label??"")>(t.label??"")?1:-1),e.map(e=>$("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},$("calcite-icon",{icon:(e.layout?j.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?$("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?$("calcite-icon",{class:R.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?$("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=g.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?$("calcite-button",{appearance:"outline",class:n?R.browseTemplateButtonContainerFilter:R.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return $("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},$("div",{class:R.templateSelectFlowItemContainer},$("div",{class:R.templateSelectFlowItemContent},n?null:s,$("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?$("div",{key:"my-templates"},$("div",{class:R.templateSelectFlowItemListHeading},e.myTemplates,t?$("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?$("div",{key:"org-templates"},$("div",{class:R.templateSelectFlowItemListHeading},e.organizationTemplates,t?$("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?$("div",{key:"default-templates"},$("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?$("div",{key:"service-templates"},$("div",{class:R.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),$("div",{class:R.templateButtonContainer},$("calcite-button",{class:R.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?$("div",{class:R.formSectionContainer,key:"custom-text-elements"},e.map((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:$("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,$("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))})):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l="layoutTab"===this._selectedTab?e:t,o="layoutTab"===this._selectedTab?i:a,n="layoutTab"===this._selectedTab?this.templateOptions.title:this.templateOptions.fileName;return $("div",{class:R.formSectionContainer,key:l},$("calcite-label",null,l,$("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&"layoutTab"===this._selectedTab||"mapOnlyTab"===t&&"mapOnlyTab"===this._selectedTab||"exportTab"===t&&"exportTab"===this._selectedTab)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[R.loader]:this._awaitingServerResponse};return $("div",{class:this.classes(e),key:"loader"})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find(e=>{const[i]=Object.entries(e)[0];return i===t})[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(!B(l)){const e=a[i];return void(t.value=`${e}`)}a[i]=l}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e}=this,t="layoutTab"===this._selectedTab?e.title:e.fileName,{promise:i}=this.viewModel.export(t||this.messages.untitled);this._selectedTab="exportTab",i.then(()=>this.scheduleRender())}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,l=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&l?$("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},$("calcite-list",{label:""},e.portalItem?$("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},$("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):$("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(r(()=>e.portalItem).then(e=>{e.itemPageUrl&&this.scheduleRender()}),await this.saveAsButtonCallback(e))}},$("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),$("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},$("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e){const t=this.messages,{url:i,state:a,error:l}=e,o=e.formattedName??"";let n=i||null;n&&(n=p(n));const s=d(n,location.href),r="error"===a?"print-task:cim-symbol-unsupported"===l?.name?t.exportWebMapCIMError:t.exportWebMapError:null;return $("div",{class:R.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},$("div",null,$("div",{class:R.exportedFileLinkTitle},o),$("div",{class:R.exportedFileLinkDescription},"pending"===a?t.generatingExport:r||(s?t.ready:t.linkReady))),"ready"===a?$("calcite-icon",{"aria-label":`${o}. ${t.linkReady}`,icon:s?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?$("calcite-loader",{class:R.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):$("calcite-icon",{icon:V(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e){const{state:t}=e,i=e.formattedName??"",a=this.saveAsButtonCallback&&"error"!==t&&this._isFormatAllowedForSaving(e.extension);return"pending"!==t?$("calcite-action",{icon:a?"ellipsis":"x",id:a?`${i}-popover-button`:void 0,key:a?`${i}-saveAs-action`:`${i}-action`,onclick:a?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:a?this.messagesCommon.options:this.messagesCommon.remove}):null}_renderExportedLinkItem(e){const t=e.formattedName??"";return $(F,null,$("calcite-list-item",{key:t,label:t},this._renderExportedLinkItemContent(e),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return $("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList,selectionMode:"none"},e.map(this._renderExportedLinkItem.bind(this)))}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,"mapOnlyTab"===this._selectedTab)this.viewModel.applyTemplate(P);else if("layoutTab"===this._selectedTab){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(M(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case"layoutTab":this._toggleTab("ArrowLeft"===t?"exportTab":"mapOnlyTab");break;case"mapOnlyTab":this._toggleTab("ArrowLeft"===t?"layoutTab":"exportTab");break;case"exportTab":this._toggleTab("ArrowLeft"===t?"mapOnlyTab":"layoutTab")}e.preventDefault(),e.stopPropagation()}}};e([m()],U.prototype,"_showTemplates",void 0),e([m()],U.prototype,"_isValidSpatialReference",void 0),e([m()],U.prototype,"allowedFormats",null),e([m()],U.prototype,"allowedFormatsForSaving",void 0),e([m()],U.prototype,"allowedLayouts",null),e([m()],U.prototype,"browseTemplateButtonOnClick",void 0),e([m()],U.prototype,"error",null),e([m({type:i.ofType(w)})],U.prototype,"exportedLinks",null),e([m()],U.prototype,"extraParameters",null),e([m()],U.prototype,"headerVisible",void 0),e([m()],U.prototype,"headingLevel",void 0),e([m()],U.prototype,"icon",null),e([m()],U.prototype,"includeDefaultTemplates",null),e([m()],U.prototype,"includeOrganizationTemplates",void 0),e([m()],U.prototype,"label",null),e([m(),E("esri/widgets/Print/t9n/Print")],U.prototype,"messages",void 0),e([m(),E("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([m(),E("esri/core/t9n/Units")],U.prototype,"messagesUnits",void 0),e([m({type:b})],U.prototype,"outSpatialReference",null),e([m({type:v})],U.prototype,"portal",null),e([m()],U.prototype,"saveExportEnabled",null),e([m()],U.prototype,"saveExportHidden",void 0),e([m()],U.prototype,"showPrintAreaEnabled",null),e([m()],U.prototype,"printServiceUrl",null),e([m()],U.prototype,"saveAsButtonCallback",void 0),e([m()],U.prototype,"templateCustomTextElements",null),e([m({type:x})],U.prototype,"templateOptions",null),e([m()],U.prototype,"view",null),e([m({type:k})],U.prototype,"viewModel",void 0),U=e([u("esri.widgets.Print")],U);const H=U;export{H as default};
@@ -1,7 +1,7 @@
1
1
  import type PopupTemplate from "../../PopupTemplate.js";
2
2
  import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
3
3
  import type { JSONSupport, JSONSupportMixinProperties } from "../../core/JSONSupport.js";
4
- import type { SymbolUnion } from "../../symbols/support/typeUtils.js";
4
+ import type { SymbolUnion } from "../../symbols/types.js";
5
5
  import type { GetResultsCallback, GetSuggestionsCallback, SearchFilter } from "./types.js";
6
6
  import type { PopupTemplateProperties } from "../../PopupTemplate.js";
7
7
 
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../core/accessorSupport/decorators.js";import i from"../../../Widget.js";import{WellKnownSizes as n,Icons as r}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as l}from"../../../support/componentsUtils.js";import{tsx as a,tsxFragment as c,messageBundle as p}from"../../../support/widget.js";let m=class extends(s(i)){constructor(t){super(t),this.allowCollapse=!0,this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const{actionChildren:t,scale:o}=this;return t.length?this.allowCollapse?n.groupSeparator+n.action[o]*Math.min(t.length,2):n.groupSeparator+n.action[o]*t.length:0}get lengthOptions(){const{actionChildren:t,scale:o,minimumLength:e,allowCollapse:i,priority:r}=this,s=[e];if(t.length<=2||!i||r<1)return s;for(let l=1;l<t.length-1;l++)s.push(e+n.action[o]*l);return s}render(){if(!this.actionChildren.length)return a(c,null,void 0);const{budgetedLength:t,actionChildren:o,activeChildElement:e,layout:i,slot:s,scale:l}=this,p=Math.floor(t/n.action[l]),m=[],u=[];if(p>=o.length)m.push(...o);else{const t=e??m.at(0);if(m.push(...o.slice(0,p-1)),u.push(...o.slice(p-1)),t&&u.includes(t)){const[o]=u.splice(u.indexOf(t),1),e=m.pop();m.push(o),e&&u.unshift(e)}}return a("calcite-action-group",{key:"overflow-button-group",layout:i,onclick:t=>this._handleClick(t.target),slot:s},m.map(t=>this._renderManagedAction(t)),u.length>0?a("calcite-action-menu",{key:"split-button-dropdown",label:this.messagesCommon.more,overlayPositioning:"fixed"},a("calcite-action",{icon:r.overflow,key:"split-button-dropdown-trigger",scale:l,slot:"trigger",text:this.messagesCommon.more}),u.map(t=>this._renderManagedAction(t))):void 0)}_renderManagedAction(t){return a("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],m.prototype,"allowCollapse",void 0),t([o()],m.prototype,"minimumLength",null),t([o(),p("esri/t9n/common")],m.prototype,"messagesCommon",void 0),t([o()],m.prototype,"lengthOptions",null),m=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.OverflowGroup")],m);export{m as default};
5
+ import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../core/accessorSupport/decorators.js";import i from"../../../Widget.js";import{WellKnownSizes as n,Icons as r}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as l}from"../../../support/componentsUtils.js";import{tsx as a,tsxFragment as c,messageBundle as p}from"../../../support/widget.js";let m=class extends(s(i)){constructor(t){super(t),this.allowCollapse=!0,this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const{actionChildren:t,scale:o}=this;return t.length?this.allowCollapse?n.groupSeparator+n.groupPadding[o]+n.action[o]*Math.min(t.length,2):n.groupSeparator+n.groupPadding[o]+n.action[o]*t.length:0}get lengthOptions(){const{actionChildren:t,scale:o,minimumLength:e,allowCollapse:i,priority:r}=this,s=[e];if(t.length<=2||!i||r<1)return s;for(let l=1;l<t.length-1;l++)s.push(e+n.action[o]*l+n.groupPadding[o]);return s}render(){if(!this.actionChildren.length)return a(c,null,void 0);const{budgetedLength:t,actionChildren:o,activeChildElement:e,layout:i,slot:s,scale:l}=this,p=Math.floor((t-n.groupPadding[l])/n.action[l]),m=[],u=[];if(p>=o.length)m.push(...o);else{const t=e??m.at(0);if(m.push(...o.slice(0,p-1)),u.push(...o.slice(p-1)),t&&u.includes(t)){const[o]=u.splice(u.indexOf(t),1),e=m.pop();m.push(o),e&&u.unshift(e)}}return a("calcite-action-group",{key:"overflow-button-group",layout:i,onclick:t=>this._handleClick(t.target),slot:s},m.map(t=>this._renderManagedAction(t)),u.length>0?a("calcite-action-menu",{key:"split-button-dropdown",label:this.messagesCommon.more,overlayPositioning:"fixed"},a("calcite-action",{icon:r.overflow,key:"split-button-dropdown-trigger",scale:l,slot:"trigger",text:this.messagesCommon.more}),u.map(t=>this._renderManagedAction(t))):void 0)}_renderManagedAction(t){return a("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],m.prototype,"allowCollapse",void 0),t([o()],m.prototype,"minimumLength",null),t([o(),p("esri/t9n/common")],m.prototype,"messagesCommon",void 0),t([o()],m.prototype,"lengthOptions",null),m=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.OverflowGroup")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../core/accessorSupport/decorators.js";import i from"../../../Widget.js";import{WellKnownSizes as n,Icons as r}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as l}from"../../../support/componentsUtils.js";import{tsx as a,tsxFragment as c,messageBundle as p}from"../../../support/widget.js";const m={splitButtonBase:`${"esri-split-button"}--split-part`};let u=class extends(s(i)){constructor(t){super(t),this.allowCollapse=!0,this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const t=this.actionChildren;return t.length?1===t.length?n.action[this.scale]+n.groupSeparator:this.allowCollapse?n.action[this.scale]+n.splitButtonPart[this.layout][this.scale]+n.groupSeparator:n.action[this.scale]*t.length+n.groupSeparator:0}get lengthOptions(){const{actionChildren:t,minimumLength:o,layout:e,scale:i,priority:r,allowCollapse:s}=this;if(t.length<2||r<0||!s)return[o];const l=n.groupSeparator+n.action[i]*t.length;return[n.groupSeparator+n.action[i]+n.splitButtonPart[e][i],l]}render(){if(!this.actionChildren.length)return a(c,null,void 0);const{actionChildren:t,minimumLength:o,budgetedLength:e,layout:i,slot:n,allowCollapse:r}=this,s=!r||t.length<2||e>o;return a("calcite-action-group",{key:"split-button-group",layout:i,onclick:t=>this._handleClick(t.target),slot:n},s?this._renderUnSplit():this._renderSplit())}_renderSplit(){const{activeChildElement:t,layout:o,actionChildren:e,scale:i,messagesCommon:n}=this,s=t??e.at(0);if(!s)return;const l=e.filter(t=>t!==s);return[this._renderManagedAction(s),a("calcite-action-menu",{key:"split-button-dropdown",label:n.more,overlayPositioning:"fixed",placement:"horizontal"===o?"bottom-end":"right-end"},a("calcite-action",{class:`${m.splitButtonBase}--${o}--${this.scale}`,compact:"horizontal"===o,icon:r.splitButton[o],key:"split-button-dropdown-trigger",scale:i,slot:"trigger",text:n.more}),l?.map(t=>this._renderManagedAction(t)))]}_renderUnSplit(){return this.actionChildren.map(t=>this._renderManagedAction(t))}_renderManagedAction(t){return a("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],u.prototype,"minimumLength",null),t([o()],u.prototype,"allowCollapse",void 0),t([o()],u.prototype,"lengthOptions",null),t([o(),p("esri/t9n/common")],u.prototype,"messagesCommon",void 0),u=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.SplitButton")],u);export{u as SplitButton};
5
+ import{__decorate as t}from"tslib";import{property as o,subclass as e}from"../../../../core/accessorSupport/decorators.js";import i from"../../../Widget.js";import{WellKnownSizes as n,Icons as r}from"./responsiveToolbarUtils.js";import{ToolbarGroupBase as s}from"./ToolbarGroupBase.js";import{loadCalciteComponents as a}from"../../../support/componentsUtils.js";import{tsx as l,tsxFragment as p,messageBundle as c}from"../../../support/widget.js";const u={splitButtonBase:`${"esri-split-button"}--split-part`};let m=class extends(s(i)){constructor(t){super(t),this.allowCollapse=!0,this.messagesCommon=null}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu")})}static{this.vnodeSelector="calcite-action-group"}get minimumLength(){const t=this.actionChildren;if(!t.length)return 0;const{scale:o}=this;return 1===t.length?n.action[o]+n.groupSeparator+n.groupPadding[o]:this.allowCollapse?n.action[o]+n.groupPadding[o]+n.splitButtonPart[this.layout][o]+n.groupSeparator:n.action[o]*t.length+n.groupSeparator+n.groupPadding[o]}get lengthOptions(){const{actionChildren:t,minimumLength:o,layout:e,scale:i,priority:r,allowCollapse:s}=this;if(t.length<2||r<0||!s)return[o];const a=n.groupSeparator+n.groupPadding[i]+n.action[i]*t.length;return[n.groupSeparator+n.groupPadding[i]+n.action[i]+n.splitButtonPart[e][i],a]}render(){if(!this.actionChildren.length)return l(p,null,void 0);const{actionChildren:t,minimumLength:o,budgetedLength:e,layout:i,slot:n,allowCollapse:r}=this,s=!r||t.length<2||e>o;return l("calcite-action-group",{key:"split-button-group",layout:i,onclick:t=>this._handleClick(t.target),slot:n},s?this._renderUnSplit():this._renderSplit())}_renderSplit(){const{activeChildElement:t,layout:o,actionChildren:e,scale:i,messagesCommon:n}=this,s=t??e.at(0);if(!s)return;const a=e.filter(t=>t!==s);return[this._renderManagedAction(s),l("calcite-action-menu",{key:"split-button-dropdown",label:n.more,overlayPositioning:"fixed",placement:"horizontal"===o?"bottom-end":"right-end"},l("calcite-action",{class:`${u.splitButtonBase}--${o}--${this.scale}`,compact:"horizontal"===o,icon:r.splitButton[o],key:"split-button-dropdown-trigger",scale:i,slot:"trigger",text:n.more}),a?.map(t=>this._renderManagedAction(t)))]}_renderUnSplit(){return this.actionChildren.map(t=>this._renderManagedAction(t))}_renderManagedAction(t){return l("calcite-action",{...t?.properties,"data-action-key":t?.properties?.key,text:t?.properties?.text??""})}};t([o()],m.prototype,"minimumLength",null),t([o()],m.prototype,"allowCollapse",void 0),t([o()],m.prototype,"lengthOptions",null),t([o(),c("esri/t9n/common")],m.prototype,"messagesCommon",void 0),m=t([e("esri.widgets.Sketch.support.ResponsiveToolbar.SplitButton")],m);export{m as SplitButton};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const t={groupSeparator:1,action:{s:32,m:48,l:64},splitButtonPart:{horizontal:{s:16,m:16,l:24},vertical:{s:16,m:24,l:40}}},o={splitButton:{horizontal:"chevron-down",vertical:"ellipsis"},overflow:"ellipsis"};function l(t,o){return t.vnodeSelector===o?[t]:t.children?.flatMap(t=>l(t,o))??[]}export{o as Icons,t as WellKnownSizes,l as findMatchingChildren};
5
+ const o={groupSeparator:1,groupPadding:{s:8,m:12,l:16},action:{s:24,m:32,l:44},splitButtonPart:{horizontal:{s:16,m:16,l:24},vertical:{s:16,m:24,l:40}}},t={splitButton:{horizontal:"chevron-down",vertical:"ellipsis"},overflow:"ellipsis"};function l(o,t){return o.vnodeSelector===t?[o]:o.children?.flatMap(o=>l(o,t))??[]}export{t as Icons,o as WellKnownSizes,l as findMatchingChildren};
@@ -10,7 +10,7 @@ import type SimpleMarkerSymbol from "../../symbols/SimpleMarkerSymbol.js";
10
10
  import type TextSymbol from "../../symbols/TextSymbol.js";
11
11
  import type WebStyleSymbol from "../../symbols/WebStyleSymbol.js";
12
12
  import type { Icon } from "@esri/calcite-components/components/calcite-icon";
13
- import type { SymbolUnion } from "../../symbols/support/typeUtils.js";
13
+ import type { SymbolUnion } from "../../symbols/types.js";
14
14
  import type { DrawingMode } from "../../views/draw/types.js";
15
15
 
16
16
  export type State = "disabled" | "ready" | "active";
package/widgets/Sketch.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import{handlesGroup as i}from"../core/handleUtils.js";import l from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as n}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as a,when as p,syncAndInitial as c}from"../core/reactiveUtils.js";import{property as d,subclass as h}from"../core/accessorSupport/decorators.js";import{symbolTypes as u}from"../symbols/support/typeUtils.js";import v from"../views/interactive/sketch/SketchLabelOptions.js";import m from"../views/interactive/sketch/SketchTooltipOptions.js";import g from"../views/interactive/sketch/SketchValueOptions.js";import y from"./Widget.js";import f from"./Sketch/SketchViewModel.js";import{VisibleElements as b}from"./Sketch/VisibleElements.js";import _ from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import T from"./support/SelectionToolbar.js";import M from"./support/SketchTooltipControls.js";import C from"./support/SnappingControls.js";import{tsx as O,messageBundle as S,vmEvent as k}from"./support/widget.js";import P from"./support/SelectionToolbar/VisibleElements.js";import x from"./support/SketchTooltipControls/VisibleElements.js";const E="esri-sketch",I={base:E,vertical:`${E}--vertical`,docked:`${E}-bar`,floating:`${E}-pad`,chipHorizontal:`${E}__selection-count-chip--horizontal`,chipVertical:`${E}__selection-count-chip--vertical`,chipVerticalSmall:`${E}__selection-count-chip--vertical--s`,popoverWrapper:`${E}__popover-wrapper`},R={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand",text:"add-text"};let G=class extends y{constructor(e,t){super(e,t),this._selectionToolbar=null,this._viewModelHandlesGroup=null,this._popoverElement=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.groupAllowCollapseOptions=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new b,this._defaultViewModel=null,this._activeCustomToolOptions=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new f({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,o="2d"===t?.type,l=new T({persistSelection:!1,visibleElements:new P({chip:!1,lassoTool:o,operationTypeControls:!1,pan:!1,pointTool:!1,rectangleTool:o}),view:t,sources:e?[e]:null,scale:this.scale});this.addHandles([a(()=>this.viewModel,e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=i([e.on("create",()=>this.scheduleRender()),e.on("update",()=>this.scheduleRender()),e.on("delete",e=>this.emit("delete",e)),e.on("undo",()=>this.scheduleRender()),e.on("redo",()=>this.scheduleRender()),a(()=>e.layer,e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)}),a(()=>e.view,e=>{this._selectionToolbar&&(this._selectionToolbar.view=e)}),a(()=>e.state,()=>this.notifyChange("state"))]))},c),p(()=>l.activeOperation,()=>{this.viewModel.cancel(),this._activeCustomToolOptions=null}),l.on("complete",e=>this._onSelectionOperationComplete(e)),a(()=>{const{view:e,visibleElements:{selectionTools:t}}=this;return{lassoTool:"3d"!==e?.type&&!!t?.["lasso-selection"],rectangleTool:"3d"!==e?.type&&!!t?.["rectangle-selection"]}},e=>{Object.assign(l.visibleElements,e)},c)]),this._selectionToolbar=l}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeOperation;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}get pointSymbol(){return this.viewModel.pointSymbol}set pointSymbol(e){this.viewModel.pointSymbol=e}get polygonSymbol(){return this.viewModel.polygonSymbol}set polygonSymbol(e){this.viewModel.polygonSymbol=e}get polylineSymbol(){return this.viewModel.polylineSymbol}set polylineSymbol(e){this.viewModel.polylineSymbol=e}get textSymbol(){return this.viewModel.textSymbol}set textSymbol(e){this.viewModel.textSymbol=e}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeOperation?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&n(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter(e=>!!o.createTools?.[e]);return"3d"===t?.type?i?.filter(e=>"multipoint"!==e):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter(e=>"selection-toolbar"===e.position);return O("div",null,O("div",{classes:{[I.base]:!0,[I.floating]:"floating"===e,[I.docked]:"docked"===e,[I.vertical]:"vertical"===t}},O(_,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionTools")??!0,"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??0},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map(e=>this._renderToolbarItem(e))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:l}=this;if(!this._calcitePopoverReferenceElement)return;const s={directionModePicker:l.directionModePicker,labelsToggle:l.labelsToggle,tooltipsToggle:l.tooltipsToggle},n="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return O("calcite-popover",{afterCreate:e=>this._popoverElement=e,closable:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:n,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:e=>this._beforePopoverClose(e.target),onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:e=>this._refocusOnView(e.target)},O("div",{class:I.popoverWrapper},Object.values(s).includes(!0)?O(M,{sketchOptions:i.sketchOptions,visibleElements:new x(s)}):void 0,l.snappingControls&&o&&t?O(C,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:l.snappingControlsElements}):void 0))}_beforePopoverClose(e){e===this._popoverElement&&(this._popoverOpen=!1)}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?O(_,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("undoRedo")??!0,"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??10,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],t=[];this.customActions?.forEach(o=>{"settings-before"===o.position?t.push(o):"settings-after"===o.position&&e.push(o)});const i=[...t.map(e=>this._renderToolbarItem(e)),this._renderSettingsMenuButton(),...e.map(e=>this._renderToolbarItem(e))].filter(o);if(i.length)return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("settings")??!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??1e3,slot:"actions-end"},i)}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter(e=>"before-selection-set"===e.position),o=this.customActions?.filter(e=>"after-selection-set"===e.position),i=this.groupCollapsePriorities?.get("selectionSet")??100;return[O("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionSet")??!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:i,slot:e},t?.map(e=>this._renderToolbarItem(e)),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map(e=>this._renderToolbarItem(e)))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap(e=>this._renderBuiltInCreateToolItem(e))??[],t=this.customToolOptions?.flatMap(e=>this._renderCustomToolItem(e))??[];return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("createTools")??!0,"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??100},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:R[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:o,scale:i,id:l,updateGraphics:{length:s}}=this,n=t(o.selectedCount,{count:s}),r="s"===i?99:999,a=s>r?t(o.selectedCountTruncated,{truncated:r}):s,p="s"===i&&"vertical"===e,c=p?`${l}-selection-chip-small`:`${l}-selection-chip`;return[p?O("span",{classes:{[I.chipVertical]:!0,[I.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:n},a):O("calcite-chip",{appearance:"outline",class:"horizontal"===e?I.chipHorizontal:I.chipVertical,id:c,kind:"brand",label:n,scale:"l"===i?"m":"s",tabIndex:0,title:"vertical"===e?n:void 0},"vertical"===e?a:n)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:l,active:s,flipRTL:n,afterCreate:r,afterUpdate:a,afterRemoved:p}){const c=`${this.id}-${e}`;return[O("calcite-action",{active:s,afterCreate:r,afterRemoved:p,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:n??!1,id:c,key:e,onclick:l,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const l=this._calcitePopoverReferenceElement;if(!l)return;const{bottom:s,top:n}=l.getBoundingClientRect();if("horizontal"===this.layout){const e=s<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",s-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-n+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const r=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${r}px`)}catch(t){l.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(e){this.activeTool&&e===this._popoverElement&&this.view?.focus()}};e([d()],G.prototype,"activeTool",null),e([d({readOnly:!0})],G.prototype,"activeTooltip",null),e([d({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh","text"]);return e.filter(e=>t.has(e))}})],G.prototype,"availableCreateTools",void 0),e([d({readOnly:!0})],G.prototype,"createGraphic",null),e([d()],G.prototype,"creationMode",null),e([d()],G.prototype,"customToolOptions",void 0),e([d()],G.prototype,"customActions",void 0),e([d()],G.prototype,"defaultCreateOptions",null),e([d()],G.prototype,"defaultUpdateOptions",null),e([d()],G.prototype,"icon",null),e([d()],G.prototype,"label",null),e([d({type:v})],G.prototype,"labelOptions",null),e([d()],G.prototype,"layer",null),e([d({type:["horizontal","vertical"],value:"horizontal"})],G.prototype,"layout",null),e([d({types:u})],G.prototype,"pointSymbol",null),e([d({types:u})],G.prototype,"polygonSymbol",null),e([d({types:u})],G.prototype,"polylineSymbol",null),e([d()],G.prototype,"textSymbol",null),e([d({value:"m"})],G.prototype,"scale",null),e([d()],G.prototype,"toolbarKind",void 0),e([d()],G.prototype,"contextualToolLocation",void 0),e([d()],G.prototype,"groupCollapsePriorities",void 0),e([d()],G.prototype,"groupAllowCollapseOptions",void 0),e([d(),S("esri/widgets/Sketch/t9n/Sketch")],G.prototype,"messages",void 0),e([d(),S("esri/t9n/common")],G.prototype,"messagesCommon",void 0),e([d()],G.prototype,"snappingOptions",null),e([d()],G.prototype,"state",null),e([d({type:m})],G.prototype,"tooltipOptions",null),e([d({readOnly:!0})],G.prototype,"updateGraphics",null),e([d({type:g,nonNullable:!0})],G.prototype,"valueOptions",null),e([d()],G.prototype,"view",null),e([d({type:f}),k(["create","update","undo","redo"])],G.prototype,"viewModel",null),e([d({type:b,nonNullable:!0})],G.prototype,"visibleElements",void 0),e([d()],G.prototype,"_effectiveAvailableCreateTools",null),e([d()],G.prototype,"_defaultViewModel",void 0),e([d()],G.prototype,"_activeCustomToolOptions",void 0),e([d()],G.prototype,"_calcitePopoverReferenceElement",void 0),e([d()],G.prototype,"_relativeLocation",void 0),e([d()],G.prototype,"_popoverOpen",void 0),G=e([h("esri.widgets.Sketch")],G);const j=G;export{j as default};
5
+ import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import{handlesGroup as i}from"../core/handleUtils.js";import l from"../core/Logger.js";import{removeMaybe as s,destroyMaybe as n}from"../core/maybe.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{watch as a,when as p,syncAndInitial as c}from"../core/reactiveUtils.js";import{property as d,subclass as h}from"../core/accessorSupport/decorators.js";import{symbolTypes as u}from"../symbols/support/typeUtils.js";import v from"../views/interactive/sketch/SketchLabelOptions.js";import m from"../views/interactive/sketch/SketchTooltipOptions.js";import g from"../views/interactive/sketch/SketchValueOptions.js";import y from"./Widget.js";import f from"./Sketch/SketchViewModel.js";import{VisibleElements as b}from"./Sketch/VisibleElements.js";import _ from"./Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js";import{loadCalciteComponents as w}from"./support/componentsUtils.js";import T from"./support/SelectionToolbar.js";import M from"./support/SketchTooltipControls.js";import C from"./support/SnappingControls.js";import{tsx as O,messageBundle as S,vmEvent as k}from"./support/widget.js";import P from"./support/SelectionToolbar/VisibleElements.js";import x from"./support/SketchTooltipControls/VisibleElements.js";const E="esri-sketch",I={base:E,vertical:`${E}--vertical`,docked:`${E}-bar`,floating:`${E}-pad`,chipHorizontal:`${E}__selection-count-chip--horizontal`,chipVertical:`${E}__selection-count-chip--vertical`,chipVerticalSmall:`${E}__selection-count-chip--vertical--s`,popoverWrapper:`${E}__popover-wrapper`},R={point:"pin",polyline:"line",polygon:"polygon",rectangle:"rectangle",circle:"circle",multipoint:"pins",mesh:"i3d-building",freehandPolygon:"freehand-area",freehandPolyline:"freehand",text:"add-text"};let G=class extends y{constructor(e,t){super(e,t),this._selectionToolbar=null,this._viewModelHandlesGroup=null,this._popoverElement=null,this.availableCreateTools=["point","polyline","polygon","rectangle","circle"],this.customToolOptions=null,this.customActions=null,this.toolbarKind="floating",this.contextualToolLocation="separate",this.groupCollapsePriorities=null,this.groupAllowCollapseOptions=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new b,this._defaultViewModel=null,this._activeCustomToolOptions=null,this._calcitePopoverReferenceElement=null,this._relativeLocation="top",this._popoverOpen=!1,this._activateCreateTool=this._activateCreateTool.bind(this),this.viewModel=e?.viewModel||(this._defaultViewModel=new f({creationMode:e?.creationMode??"continuous"}))}initialize(){const{layer:e,view:t}=this,o="2d"===t?.type,l=new T({persistSelection:!1,visibleElements:new P({chip:!1,lassoTool:o,operationTypeControls:!1,pan:!1,pointTool:!1,rectangleTool:o}),view:t,sources:e?[e]:null,scale:this.scale});this.addHandles([a(()=>this.viewModel,e=>{this._viewModelHandlesGroup=s(this._viewModelHandlesGroup),e&&(this._viewModelHandlesGroup=i([e.on("create",()=>this.scheduleRender()),e.on("update",()=>this.scheduleRender()),e.on("delete",e=>this.emit("delete",e)),e.on("undo",()=>this.scheduleRender()),e.on("redo",()=>this.scheduleRender()),a(()=>e.layer,e=>{this._selectionToolbar&&(this._selectionToolbar.sources=e?[e]:null)}),a(()=>e.view,e=>{this._selectionToolbar&&(this._selectionToolbar.view=e)}),a(()=>e.state,()=>this.notifyChange("state"))]))},c),p(()=>l.activeOperation,()=>{this.viewModel.cancel(),this._activeCustomToolOptions=null}),l.on("complete",e=>this._onSelectionOperationComplete(e)),a(()=>{const{view:e,visibleElements:{selectionTools:t}}=this;return{lassoTool:"3d"!==e?.type&&!!t?.["lasso-selection"],rectangleTool:"3d"!==e?.type&&!!t?.["rectangle-selection"]}},e=>{Object.assign(l.visibleElements,e)},c)]),this._selectionToolbar=l}loadDependencies(){return w({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover")})}destroy(){this._selectionToolbar?.destroy(),this._viewModelHandlesGroup=s(this._viewModelHandlesGroup)}get activeTool(){const e=this._selectionToolbar?.activeOperation;if(e)switch(e.toolName){case"lasso":return"lasso-selection";case"rectangle":return"rectangle-selection";case"default":return"custom-selection"}const t=this._effectiveAvailableCreateTools,{activeTool:o,activeCreateToolDrawMode:i}=this.viewModel;return"polygon"===o&&"freehand"===i&&t?.includes("freehandPolygon")?"freehandPolygon":"polyline"===o&&"freehand"===i&&t?.includes("freehandPolyline")?"freehandPolyline":this.viewModel.activeTool}get activeTooltip(){return this.viewModel.activeTooltip}get createGraphic(){return this.viewModel.createGraphic}get creationMode(){return this.viewModel.creationMode}set creationMode(e){this.viewModel.creationMode=e}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(e){this.viewModel.defaultUpdateOptions=e}get icon(){return"pencil"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(e){this.viewModel.labelOptions=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}set layout(e){this._set("layout",e),this._selectionToolbar&&(this._selectionToolbar.layout=e)}get pointSymbol(){return this.viewModel.pointSymbol}set pointSymbol(e){this.viewModel.pointSymbol=e}get polygonSymbol(){return this.viewModel.polygonSymbol}set polygonSymbol(e){this.viewModel.polygonSymbol=e}get polylineSymbol(){return this.viewModel.polylineSymbol}set polylineSymbol(e){this.viewModel.polylineSymbol=e}get textSymbol(){return this.viewModel.textSymbol}set textSymbol(e){this.viewModel.textSymbol=e}set scale(e){this._set("scale",e),this._selectionToolbar&&(this._selectionToolbar.scale=e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get state(){return this._selectionToolbar?.activeOperation?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(e){this.viewModel.tooltipOptions=e}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(e){this.viewModel.valueOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set viewModel(e){const t=this._get("viewModel");e!==t&&(t&&t===this._defaultViewModel&&n(t),this._set("viewModel",e))}get _effectiveAvailableCreateTools(){const{availableCreateTools:e,view:t,visibleElements:o}=this,i=e?.filter(e=>!!o.createTools?.[e]);return"3d"===t?.type?i?.filter(e=>"multipoint"!==e):i}create(e,t,o){const i=o?.createOptions??t;return this._activeCustomToolOptions=o,r(this.viewModel.create(e,i))}update(e,t){return r(this.viewModel.update(e,t))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel(),this.viewModel.cancel(),this._activeCustomToolOptions=null}undo(){this.viewModel.undo(),this.view?.focus()}redo(){this.viewModel.redo(),this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}dismissFloatingElements(){this._popoverOpen=!1}render(){const{toolbarKind:e,layout:t,scale:o}=this,i=this.customActions?.filter(e=>"selection-toolbar"===e.position);return O("div",null,O("div",{classes:{[I.base]:!0,[I.floating]:"floating"===e,[I.docked]:"docked"===e,[I.vertical]:"vertical"===t}},O(_,{barStyle:e,layout:t,scale:o},this._renderSelectionSetItemGroupInline(),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionTools")??!0,"group-kind":"split-button",key:"selection-split-button",priority:this.groupCollapsePriorities?.get("selectionTools")??0},this._renderDefaultSelectionButton(),this._selectionToolbar?.render(),i?.map(e=>this._renderToolbarItem(e))),this._renderCreateToolActionGroup(),this._renderUndoRedoMenuItemGroup(),this._renderSettingsMenuItemGroup()),this._renderSelectionSetToolbar(),this._renderSettingsMenuPopover()))}_renderSettingsMenuPopover(){const{messagesCommon:e,snappingOptions:t,view:o,viewModel:i,visibleElements:l}=this;if(!this._calcitePopoverReferenceElement)return;const s={directionModePicker:l.directionModePicker,labelsToggle:l.labelsToggle,tooltipsToggle:l.tooltipsToggle},n="horizontal"===this.layout?"top"===this._relativeLocation?"bottom-end":"top-end":"right-end";return O("calcite-popover",{afterCreate:e=>this._popoverElement=e,closable:!0,heading:e.settings,label:e.settings,open:this._popoverOpen,overlayPositioning:"fixed",placement:n,referenceElement:this._calcitePopoverReferenceElement,scale:this.scale,onCalcitePopoverBeforeClose:e=>this._beforePopoverClose(e.target),onCalcitePopoverBeforeOpen:e=>this._remeasurePopoverSizes(e.currentTarget),onCalcitePopoverClose:e=>this._refocusOnView(e.target)},O("div",{class:I.popoverWrapper},Object.values(s).includes(!0)?O(M,{sketchOptions:i.sketchOptions,visibleElements:new x(s)}):void 0,l.snappingControls&&o&&t?O(C,{snappingManager:this.viewModel.snappingManager,snappingOptions:t,view:o,visibleElements:l.snappingControlsElements}):void 0))}_beforePopoverClose(e){e===this._popoverElement&&(this._popoverOpen=!1)}_renderSelectionSetToolbar(){if("separate"!==this.contextualToolLocation)return;const e=this._renderSelectionSetItemGroup();return e?.length?O(_,{barStyle:this.toolbarKind,layout:this.layout,scale:this.scale},e):void 0}_renderSelectionSetItemGroupInline(){return"separate"===this.contextualToolLocation?[]:this._renderSelectionSetItemGroup()}_renderUndoRedoMenuItemGroup(){return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("undoRedo")??!0,"group-kind":"split-button",key:"undo-redo-menu",priority:this.groupCollapsePriorities?.get("undoRedo")??10,slot:"actions-end"},this._renderUndoButton(),this._renderRedoButton())}_renderSettingsMenuItemGroup(){const e=[],t=[];this.customActions?.forEach(o=>{"settings-before"===o.position?t.push(o):"settings-after"===o.position&&e.push(o)});const i=[...t.map(e=>this._renderToolbarItem(e)),this._renderSettingsMenuButton(),...e.map(e=>this._renderToolbarItem(e))].filter(o);if(i.length)return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("settings")??!1,"group-kind":"overflow-group",key:"settings-menu",priority:this.groupCollapsePriorities?.get("settings")??1e3,slot:"actions-end"},i)}_renderSelectionSetItemGroup(){if(!this.updateGraphics.length)return[];const e="inline-end"===this.contextualToolLocation?"actions-end":void 0,t=this.customActions?.filter(e=>"before-selection-set"===e.position),o=this.customActions?.filter(e=>"after-selection-set"===e.position),i=this.groupCollapsePriorities?.get("selectionSet")??100;return[O("div",{"group-kind":"measured-content",key:"selection-count-chip-group",priority:i,slot:e},this._renderFeatureCountChip()),O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("selectionSet")??!1,"group-kind":"overflow-group",key:"selection-set-tool-group",priority:i,slot:e},t?.map(e=>this._renderToolbarItem(e)),this._renderDuplicateButton(),this._renderDeleteButton(),o?.map(e=>this._renderToolbarItem(e)))]}_renderDefaultSelectionButton(){if(!this.viewModel.updateOnGraphicClick)return[];const{messages:e,state:t}=this;return this._renderToolbarItem({id:"pointer-select",text:e.selectFeature,icon:"cursor",onclick:this._activateDefaultSelectTool,active:"ready"===t})}_renderCreateToolActionGroup(){const e=this._effectiveAvailableCreateTools?.flatMap(e=>this._renderBuiltInCreateToolItem(e))??[],t=this.customToolOptions?.flatMap(e=>this._renderCustomToolItem(e))??[];return O("div",{"allow-collapse":this.groupAllowCollapseOptions?.get("createTools")??!0,"group-kind":"overflow-group",key:"create-tools-group",priority:this.groupCollapsePriorities?.get("createTools")??100},e,t)}_renderBuiltInCreateToolItem(e){return this._renderToolbarItem({id:`${e}-button`,text:this.messages.draw[e],icon:R[e],onclick:()=>this._activateCreateTool(e),active:this.activeTool===e&&!this._activeCustomToolOptions})}_renderCustomToolItem(e){const{toolKey:t}=e;return this._renderToolbarItem({id:`custom-${e.toolKey}`,text:e.label,icon:e.icon,onclick:()=>this._activateCreateTool(e.toolName,null,e),active:this._activeCustomToolOptions?.toolKey===t})}_renderUndoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"undo-button",text:this.messages.undo,icon:"undo",disabled:!this.viewModel.canUndo(),onclick:this.undo,flipRTL:!0}):[]}_renderRedoButton(){return this.visibleElements.undoRedoMenu?this._renderToolbarItem({id:"redo-button",text:this.messages.redo,icon:"redo",disabled:!this.viewModel.canRedo(),onclick:this.redo,flipRTL:!0}):[]}_renderSettingsMenuButton(){return this.visibleElements.settingsMenu?this._renderToolbarItem({id:"settings-menu-action",text:this.messagesCommon.settings,icon:"gear",active:this._popoverOpen,onclick:()=>this._popoverOpen=!this._popoverOpen,afterCreate:e=>this._calcitePopoverReferenceElement=e,afterUpdate:e=>this._calcitePopoverReferenceElement=e,afterRemoved:()=>this._calcitePopoverReferenceElement=null}):[]}_renderFeatureCountChip(){if(!this.visibleElements.selectionCountLabel)return[];const{layout:e,messages:o,scale:i,id:l,updateGraphics:{length:s}}=this,n=t(o.selectedCount,{count:s}),r="l"===i?999:99,a=s>r?t(o.selectedCountTruncated,{truncated:r}):s,p="l"!==i&&"vertical"===e,c=p?`${l}-selection-chip-small`:`${l}-selection-chip`;return[p?O("span",{classes:{[I.chipVertical]:!0,[I.chipVerticalSmall]:"s"===this.scale},id:c,tabIndex:0,title:n},a):O("calcite-chip",{appearance:"outline",class:"horizontal"===e?I.chipHorizontal:I.chipVertical,id:c,kind:"brand",label:n,scale:"l"===i?"m":"s",tabIndex:0,title:"vertical"===e?n:void 0},"vertical"===e?a:n)]}_renderDuplicateButton(){if(!this.visibleElements.duplicateButton)return[];const{messages:e}=this;return this._renderToolbarItem({id:"duplicate",text:this.updateGraphics.length>1?e.duplicateFeatures:e.duplicateFeature,icon:"copy",onclick:this._onDuplicateSelect})}_renderDeleteButton(){if(!this.visibleElements.deleteButton)return[];const{messages:e}=this,t=this.updateGraphics.length>1?e.deleteFeatures:e.deleteFeature;return this._renderToolbarItem({id:"delete",text:t,icon:"trash",onclick:this.delete})}_renderToolbarItem({id:e,text:t,icon:o,disabled:i,onclick:l,active:s,flipRTL:n,afterCreate:r,afterUpdate:a,afterRemoved:p}){const c=`${this.id}-${e}`;return[O("calcite-action",{active:s,afterCreate:r,afterRemoved:p,afterUpdate:a,bind:this,"data-testid":e,disabled:i||"disabled"===this.state,icon:o,iconFlipRtl:n??!1,id:c,key:e,onclick:l,scale:this.scale,text:t,title:t})]}_remeasurePopoverSizes(e){try{const t=e.parentElement,o=this?.view?.container?.getBoundingClientRect(),i=t?.style;if(!(t&&o&&i&&this.view?.container?.contains(t)))return;const l=this._calcitePopoverReferenceElement;if(!l)return;const{bottom:s,top:n}=l.getBoundingClientRect();if("horizontal"===this.layout){const e=s<o.height/2;e!==("top"===this._relativeLocation)&&(this._relativeLocation=e?"top":"bottom"),e?(i?.setProperty("--sketch-view-height-offset",s-o.top+"px"),i?.setProperty("--sketch-view-margin-offset","30px")):(i?.setProperty("--sketch-view-height-offset",o.bottom-n+"px"),i?.setProperty("--sketch-view-margin-offset","15px"))}else"vertical"===this.layout&&(i.setProperty("--sketch-view-height-offset","15px"),i.setProperty("--sketch-view-margin-offset","15px"));const r=e.shadowRoot?.querySelector("div.header")?.getBoundingClientRect().height;i.setProperty("--sketch-popover-header-offset",`${r}px`)}catch(t){l.getLogger(this.declaredClass).warnOnce("Sketch failed to lay out settings menu.",t)}}_activateCreateTool(e,t,o){const i=this._activeCustomToolOptions;if(o||i){if(o?.toolKey===i?.toolKey)return void this.cancel()}else if(this.activeTool===e)return void this.cancel();this._selectionToolbar?.cancel(),this.create(e,t,o)}_onDuplicateSelect(){const e=this.duplicate(),t=this.viewModel.activeTool;"transform"!==t&&"reshape"!==t||this.update(e,{tool:t})}_onSelectionOperationComplete(e){const{viewModel:{defaultUpdateOptions:t}}=this,{selection:o}=e;if(!e.aborted&&o.length){const e=t.tool,i=o.length>1&&"reshape"===e?"transform":e;this.update(o,{...t,tool:i})}this.notifyChange("state")}_activateDefaultSelectTool(){this.cancel(),this.view?.focus()}_refocusOnView(e){this.activeTool&&e===this._popoverElement&&this.view?.focus()}};e([d()],G.prototype,"activeTool",null),e([d({readOnly:!0})],G.prototype,"activeTooltip",null),e([d({cast:e=>{if(!e?.length)return null;const t=new Set(["point","polyline","polygon","rectangle","circle","multipoint","freehandPolyline","freehandPolygon","mesh","text"]);return e.filter(e=>t.has(e))}})],G.prototype,"availableCreateTools",void 0),e([d({readOnly:!0})],G.prototype,"createGraphic",null),e([d()],G.prototype,"creationMode",null),e([d()],G.prototype,"customToolOptions",void 0),e([d()],G.prototype,"customActions",void 0),e([d()],G.prototype,"defaultCreateOptions",null),e([d()],G.prototype,"defaultUpdateOptions",null),e([d()],G.prototype,"icon",null),e([d()],G.prototype,"label",null),e([d({type:v})],G.prototype,"labelOptions",null),e([d()],G.prototype,"layer",null),e([d({type:["horizontal","vertical"],value:"horizontal"})],G.prototype,"layout",null),e([d({types:u})],G.prototype,"pointSymbol",null),e([d({types:u})],G.prototype,"polygonSymbol",null),e([d({types:u})],G.prototype,"polylineSymbol",null),e([d()],G.prototype,"textSymbol",null),e([d({value:"m"})],G.prototype,"scale",null),e([d()],G.prototype,"toolbarKind",void 0),e([d()],G.prototype,"contextualToolLocation",void 0),e([d()],G.prototype,"groupCollapsePriorities",void 0),e([d()],G.prototype,"groupAllowCollapseOptions",void 0),e([d(),S("esri/widgets/Sketch/t9n/Sketch")],G.prototype,"messages",void 0),e([d(),S("esri/t9n/common")],G.prototype,"messagesCommon",void 0),e([d()],G.prototype,"snappingOptions",null),e([d()],G.prototype,"state",null),e([d({type:m})],G.prototype,"tooltipOptions",null),e([d({readOnly:!0})],G.prototype,"updateGraphics",null),e([d({type:g,nonNullable:!0})],G.prototype,"valueOptions",null),e([d()],G.prototype,"view",null),e([d({type:f}),k(["create","update","undo","redo"])],G.prototype,"viewModel",null),e([d({type:b,nonNullable:!0})],G.prototype,"visibleElements",void 0),e([d()],G.prototype,"_effectiveAvailableCreateTools",null),e([d()],G.prototype,"_defaultViewModel",void 0),e([d()],G.prototype,"_activeCustomToolOptions",void 0),e([d()],G.prototype,"_calcitePopoverReferenceElement",void 0),e([d()],G.prototype,"_relativeLocation",void 0),e([d()],G.prototype,"_popoverOpen",void 0),G=e([h("esri.widgets.Sketch")],G);const j=G;export{j as default};
package/widgets/Slice.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../analysis/SliceAnalysis.js";import{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as l}from"../core/promiseUtils.js";import{property as o,subclass as r}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import c from"./Slice/SliceViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u}from"./support/Heading.js";import{messageBundle as p,tsx as m}from"./support/widget.js";const y="esri-slice",h={base:y,actions:`${y}__actions`,cancelButton:`${y}__cancel-button`,container:`${y}__container`,error:`${y}__error`,excludeButton:`${y}__exclude-button`,hint:`${y}__hint`,hintText:`${y}__hint-text`,layerItem:`${y}__layer-item`,layerList:`${y}__layer-list`,layerListHeading:`${y}__layer-list-title`,newSliceButton:`${y}__clear-button`};let v=class extends n{constructor(e,t){super(e,t),this.headingLevel=3,this.messages=null,this.viewModel=new c({isDefaultViewModel:!0}),this._onNewSliceClick=()=>{l(this.viewModel.start())},i(s.getLogger(this),"Slice","arcgis-slice",{version:"4.33"})}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(e){this.viewModel.excludedLayers=e}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(e){this.viewModel.excludeGroundSurface=e}get icon(){return"slice"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get hasVoxelLayers(){const e=this.viewModel?.view;return null!=e&&e.allLayerViews.some(e=>"voxel-3d"===e.type)}render(){return m("div",{class:this.classes(h.base,d.widget,d.panel),role:"presentation"},this.visible?m("div",{class:h.container},this.viewModel.supported?[this._renderHint(),this._renderLayerList(),this._renderActions()]:this._renderUnsupported()):null)}_renderUnsupported(){return m("div",{class:h.error,key:"unsupported"},m("p",null,this.messages.unsupported))}_renderHint(){const{hasVoxelLayers:e,messages:t,viewModel:i}=this,{active:s,mode:l,state:o}=i;let r=null;return s&&("exclude"===l?r=t.excludeHint:"ready"===o&&(r=e?t.voxelHint:t.hint)),r?m("div",{class:h.hint,key:"hint"},m("p",{class:h.hintText},r),m("p",{class:h.hintText},t.verticalHint)):null}_renderLayerList(){const{excludedLayers:e,excludeGroundSurface:t,headingLevel:i,messages:s,viewModel:l}=this,{mode:o,state:r}=l,n="slicing"===r||"sliced"===r,c=e?e.toArray().map(e=>this._renderLayerItem({uid:e.uid,title:e.title,onClick:()=>(this.excludedLayers.remove(e),!1)})):[];return t&&c.push(this._renderLayerItem({uid:"ground",title:s.ground,onClick:()=>(this.excludeGroundSurface=!1,!1)})),"exclude"!==o&&n&&0!==c.length?m("div",{class:h.layerList,key:"settings"},m(u,{class:h.layerListHeading,level:i},s.excludedLayers),m("calcite-list",{label:s.excludedLayers,selectionMode:"none"},c)):null}_renderActions(){const{messages:e,viewModel:t}=this,{active:i,state:s}=t,l="disabled"===s,o="slicing"===s||"sliced"===s,r="exclude"===t.mode,n=[];return i&&!o||r||n.push(m("calcite-button",{class:h.newSliceButton,disabled:l,key:"new-slice",onclick:this._onNewSliceClick},e.newSlice)),o&&!r&&n.push(m("calcite-button",{appearance:"outline-fill",class:h.excludeButton,disabled:l,key:"exclude",onclick:()=>t.enterExcludeLayerMode()},e.excludeLayer)),i&&r&&n.push(m("calcite-button",{appearance:"outline-fill",class:h.cancelButton,disabled:l,key:"cancel-exclude",onclick:()=>t.exitExcludeLayerMode()},e.cancel)),0===n.length?null:m("div",{class:h.actions},n)}_renderLayerItem(e){const t=this.messages.includeLayer;return m("calcite-list-item",{class:h.layerItem,"data-testid":`list-item-${e.uid}`,key:e.uid,label:e.title??""},m("calcite-action",{icon:"x",onclick:e.onClick,scale:"s",slot:"actions-end",text:t,title:t}))}};e([o()],v.prototype,"active",null),e([o({type:t,nonNullable:!0})],v.prototype,"analysis",null),e([o()],v.prototype,"excludedLayers",null),e([o()],v.prototype,"excludeGroundSurface",null),e([o()],v.prototype,"headingLevel",void 0),e([o()],v.prototype,"icon",null),e([o()],v.prototype,"label",null),e([o(),p("esri/widgets/Slice/t9n/Slice")],v.prototype,"messages",void 0),e([o()],v.prototype,"view",null),e([o({type:c})],v.prototype,"viewModel",void 0),e([o()],v.prototype,"visible",null),e([o()],v.prototype,"hasVoxelLayers",null),v=e([r("esri.widgets.Slice")],v);const g=v;export{g as default};
5
+ import{__decorate as e}from"tslib";import t from"../analysis/SliceAnalysis.js";import{deprecateWidget as i}from"../core/deprecate.js";import s from"../core/Logger.js";import{ignoreAbortErrors as l}from"../core/promiseUtils.js";import{property as o,subclass as r}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import c from"./Slice/SliceViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import{Heading as u}from"./support/Heading.js";import{messageBundle as p,tsx as m}from"./support/widget.js";const y="esri-slice",h={base:y,actions:`${y}__actions`,cancelButton:`${y}__cancel-button`,container:`${y}__container`,error:`${y}__error`,excludeButton:`${y}__exclude-button`,hint:`${y}__hint`,hintText:`${y}__hint-text`,layerItem:`${y}__layer-item`,layerList:`${y}__layer-list`,layerListHeading:`${y}__layer-list-title`,newSliceButton:`${y}__clear-button`};let v=class extends n{constructor(e,t){super(e,t),this.headingLevel=3,this.messages=null,this.viewModel=new c({isDefaultViewModel:!0}),this._onNewSliceClick=()=>{l(this.viewModel.start())},i(s.getLogger(this),"Slice","arcgis-slice",{version:"4.33"})}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list")})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(e){this.viewModel.excludedLayers=e}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(e){this.viewModel.excludeGroundSurface=e}get icon(){return"slice"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get hasVoxelLayers(){const e=this.viewModel?.view;return null!=e&&e.allLayerViews.some(e=>"voxel-3d"===e.type)}render(){return m("div",{class:this.classes(h.base,d.widget,d.panel),role:"presentation"},this.visible?m("div",{class:h.container},this.viewModel.supported?[this._renderHint(),this._renderLayerList(),this._renderActions()]:this._renderUnsupported()):null)}_renderUnsupported(){return m("div",{class:h.error,key:"unsupported"},m("p",null,this.messages.unsupported))}_renderHint(){const{hasVoxelLayers:e,messages:t,viewModel:i}=this,{active:s,mode:l,state:o}=i;let r=null;return s&&("exclude"===l?r=t.excludeHint:"ready"===o&&(r=e?t.voxelHint:t.hint)),r?m("div",{class:h.hint,key:"hint"},m("p",{class:h.hintText},r),m("p",{class:h.hintText},t.verticalHint)):null}_renderLayerList(){const{excludedLayers:e,excludeGroundSurface:t,headingLevel:i,messages:s,viewModel:l}=this,{mode:o,state:r}=l,n="slicing"===r||"sliced"===r,c=e?e.toArray().map(e=>this._renderLayerItem({uid:e.uid,title:e.title,onClick:()=>(this.excludedLayers.remove(e),!1)})):[];return t&&c.push(this._renderLayerItem({uid:"ground",title:s.ground,onClick:()=>(this.excludeGroundSurface=!1,!1)})),"exclude"!==o&&n&&0!==c.length?m("div",{class:h.layerList,key:"settings"},m(u,{class:h.layerListHeading,level:i},s.excludedLayers),m("calcite-list",{label:s.excludedLayers,selectionMode:"none"},c)):null}_renderActions(){const{messages:e,viewModel:t}=this,{active:i,state:s}=t,l="disabled"===s,o="slicing"===s||"sliced"===s,r="exclude"===t.mode,n=[];return i&&!o||r||n.push(m("calcite-button",{class:h.newSliceButton,disabled:l,key:"new-slice",onclick:this._onNewSliceClick},e.newSlice)),o&&!r&&n.push(m("calcite-button",{appearance:"outline-fill",class:h.excludeButton,disabled:l,key:"exclude",onclick:()=>t.enterExcludeLayerMode()},e.excludeLayer)),i&&r&&n.push(m("calcite-button",{appearance:"outline-fill",class:h.cancelButton,disabled:l,key:"cancel-exclude",onclick:()=>t.exitExcludeLayerMode()},e.cancel)),0===n.length?null:m("div",{class:h.actions},n)}_renderLayerItem(e){const t=this.messages.includeLayer;return m("calcite-list-item",{class:h.layerItem,"data-testid":`list-item-${e.uid}`,key:e.uid,label:e.title??""},m("calcite-action",{icon:"x",onclick:e.onClick,slot:"actions-end",text:t,title:t}))}};e([o()],v.prototype,"active",null),e([o({type:t,nonNullable:!0})],v.prototype,"analysis",null),e([o()],v.prototype,"excludedLayers",null),e([o()],v.prototype,"excludeGroundSurface",null),e([o()],v.prototype,"headingLevel",void 0),e([o()],v.prototype,"icon",null),e([o()],v.prototype,"label",null),e([o(),p("esri/widgets/Slice/t9n/Slice")],v.prototype,"messages",void 0),e([o()],v.prototype,"view",null),e([o({type:c})],v.prototype,"viewModel",void 0),e([o()],v.prototype,"visible",null),e([o()],v.prototype,"hasVoxelLayers",null),v=e([r("esri.widgets.Slice")],v);const g=v;export{g as default};
@@ -1,9 +1,8 @@
1
1
  import type ListItem from "./ListItem.js";
2
2
 
3
3
  /**
4
- * Function definition for the [LayerList#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#listItemCreatedFunction), {@link widgets/LayerList/interfaces#baseListItemCreatedFunction},
5
- * and {@link widgets/LayerList/interfaces#referenceListItemCreatedFunction} properties.
6
- * See the example snippets in the documentations for those properties for more details.
4
+ * Function definition for the [TableListViewModel#listItemCreatedFunction](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-TableListViewModel.html#listItemCreatedFunction) property.
5
+ * See the example snippets in the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html) documentation for more details.
7
6
  *
8
7
  * @param event - An object containing a list item created by the [TableList](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList.html).
9
8
  */
@@ -175,7 +175,7 @@ export default class TableList extends TableListSuperclass {
175
175
  */
176
176
  accessor filterText: string;
177
177
  /**
178
- * Indicates the heading level to use for the {@link widgets/TableList#title} of the widget.
178
+ * Indicates the heading level to use for the [TableListVisibleElements#heading](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-TableList-TableListVisibleElements.html#heading).
179
179
  * By default, the title is rendered
180
180
  * as a level 2 heading (e.g. `<h2>Table List</h2>`). Depending on the widget's placement
181
181
  * in your app, you may need to adjust this heading for proper semantics. This is