@arcgis/core 5.2.0-next.111 → 5.2.0-next.113

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 (644) hide show
  1. package/Ground.d.ts +4 -5
  2. package/Ground.js +1 -1
  3. package/arcgisGlobal.d.ts +5 -0
  4. package/assets/components/assets/icon/alignBottom16.json +1 -0
  5. package/assets/components/assets/icon/alignBottom24.json +1 -0
  6. package/assets/components/assets/icon/alignBottom32.json +1 -0
  7. package/assets/components/assets/icon/alignCenterHorizontal16.json +1 -0
  8. package/assets/components/assets/icon/alignCenterHorizontal24.json +1 -0
  9. package/assets/components/assets/icon/alignCenterHorizontal32.json +1 -0
  10. package/assets/components/assets/icon/alignCenterVertical16.json +1 -0
  11. package/assets/components/assets/icon/alignCenterVertical24.json +1 -0
  12. package/assets/components/assets/icon/alignCenterVertical32.json +1 -0
  13. package/assets/components/assets/icon/alignLeft16.json +1 -0
  14. package/assets/components/assets/icon/alignLeft24.json +1 -0
  15. package/assets/components/assets/icon/alignLeft32.json +1 -0
  16. package/assets/components/assets/icon/alignRight16.json +1 -0
  17. package/assets/components/assets/icon/alignRight24.json +1 -0
  18. package/assets/components/assets/icon/alignRight32.json +1 -0
  19. package/assets/components/assets/icon/alignTop16.json +1 -0
  20. package/assets/components/assets/icon/alignTop24.json +1 -0
  21. package/assets/components/assets/icon/alignTop32.json +1 -0
  22. package/assets/components/assets/icon/columnGroup16.json +1 -0
  23. package/assets/components/assets/icon/columnGroup24.json +1 -0
  24. package/assets/components/assets/icon/columnGroup32.json +1 -0
  25. package/assets/components/assets/icon/columnRemove16.json +1 -0
  26. package/assets/components/assets/icon/columnRemove24.json +1 -0
  27. package/assets/components/assets/icon/columnRemove32.json +1 -0
  28. package/assets/components/assets/icon/columnUngroup16.json +1 -0
  29. package/assets/components/assets/icon/columnUngroup24.json +1 -0
  30. package/assets/components/assets/icon/columnUngroup32.json +1 -0
  31. package/assets/components/assets/icon/envelopeOpen16.json +1 -0
  32. package/assets/components/assets/icon/envelopeOpen24.json +1 -0
  33. package/assets/components/assets/icon/envelopeOpen32.json +1 -0
  34. package/assets/components/assets/icon/handDraw16.json +1 -0
  35. package/assets/components/assets/icon/handDraw24.json +1 -0
  36. package/assets/components/assets/icon/handDraw32.json +1 -0
  37. package/assets/components/assets/icon/monitorShare16.json +1 -0
  38. package/assets/components/assets/icon/monitorShare24.json +1 -0
  39. package/assets/components/assets/icon/monitorShare32.json +1 -0
  40. package/assets/components/assets/icon/pi16.json +1 -0
  41. package/assets/components/assets/icon/pi24.json +1 -0
  42. package/assets/components/assets/icon/pi32.json +1 -0
  43. package/assets/components/assets/icon/rowGroup16.json +1 -0
  44. package/assets/components/assets/icon/rowGroup24.json +1 -0
  45. package/assets/components/assets/icon/rowGroup32.json +1 -0
  46. package/assets/components/assets/icon/rowRemove16.json +1 -0
  47. package/assets/components/assets/icon/rowRemove24.json +1 -0
  48. package/assets/components/assets/icon/rowRemove32.json +1 -0
  49. package/assets/components/assets/icon/rowUngroup16.json +1 -0
  50. package/assets/components/assets/icon/rowUngroup24.json +1 -0
  51. package/assets/components/assets/icon/rowUngroup32.json +1 -0
  52. package/assets/components/assets/icon/sdCard16.json +1 -0
  53. package/assets/components/assets/icon/sdCard24.json +1 -0
  54. package/assets/components/assets/icon/sdCard32.json +1 -0
  55. package/assets/components/assets/icon/spaceAroundHorizontal16.json +1 -0
  56. package/assets/components/assets/icon/spaceAroundHorizontal24.json +1 -0
  57. package/assets/components/assets/icon/spaceAroundHorizontal32.json +1 -0
  58. package/assets/components/assets/icon/spaceAroundVertical16.json +1 -0
  59. package/assets/components/assets/icon/spaceAroundVertical24.json +1 -0
  60. package/assets/components/assets/icon/spaceAroundVertical32.json +1 -0
  61. package/assets/components/assets/icon/spaceBetweenHorizontal16.json +1 -0
  62. package/assets/components/assets/icon/spaceBetweenHorizontal24.json +1 -0
  63. package/assets/components/assets/icon/spaceBetweenHorizontal32.json +1 -0
  64. package/assets/components/assets/icon/spaceBetweenVertical16.json +1 -0
  65. package/assets/components/assets/icon/spaceBetweenVertical24.json +1 -0
  66. package/assets/components/assets/icon/spaceBetweenVertical32.json +1 -0
  67. package/assets/components/assets/icon/spacedEvenlyHorizontal16.json +1 -0
  68. package/assets/components/assets/icon/spacedEvenlyHorizontal24.json +1 -0
  69. package/assets/components/assets/icon/spacedEvenlyHorizontal32.json +1 -0
  70. package/assets/components/assets/icon/spacedEvenlyVertical16.json +1 -0
  71. package/assets/components/assets/icon/spacedEvenlyVertical24.json +1 -0
  72. package/assets/components/assets/icon/spacedEvenlyVertical32.json +1 -0
  73. package/assets/components/assets/icon/stretchHorizontal16.json +1 -0
  74. package/assets/components/assets/icon/stretchHorizontal24.json +1 -0
  75. package/assets/components/assets/icon/stretchHorizontal32.json +1 -0
  76. package/assets/components/assets/icon/stretchVertical16.json +1 -0
  77. package/assets/components/assets/icon/stretchVertical24.json +1 -0
  78. package/assets/components/assets/icon/stretchVertical32.json +1 -0
  79. package/assets/components/assets/icon/swatchPalette16.json +1 -0
  80. package/assets/components/assets/icon/swatchPalette24.json +1 -0
  81. package/assets/components/assets/icon/swatchPalette32.json +1 -0
  82. package/assets/components/assets/icon/thermometer16.json +1 -0
  83. package/assets/components/assets/icon/thermometer24.json +1 -0
  84. package/assets/components/assets/icon/thermometer32.json +1 -0
  85. package/assets/components/assets/icon/webCamera16.json +1 -0
  86. package/assets/components/assets/icon/webCamera24.json +1 -0
  87. package/assets/components/assets/icon/webCamera32.json +1 -0
  88. package/assets/esri/core/workers/RemoteClient.js +1 -1
  89. package/assets/esri/core/workers/chunks/01ca17092545d72be7b6.js +1 -0
  90. package/assets/esri/core/workers/chunks/{f5a988bb850f7a7af143.js → 05b373a663cb5d4d722f.js} +1 -1
  91. package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +1 -0
  92. package/assets/esri/core/workers/chunks/{36f8caeb574dcd5c0ed5.js → 0b727d7bf3e36e146725.js} +1 -1
  93. package/assets/esri/core/workers/chunks/0c65862e3dd810015491.js +1 -0
  94. package/assets/esri/core/workers/chunks/0e3e58ba8e2d358121a5.js +1 -0
  95. package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +1 -0
  96. package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +1 -0
  97. package/assets/esri/core/workers/chunks/184942ea601237c8241a.js +1 -0
  98. package/assets/esri/core/workers/chunks/20de0ea9fa08a6545978.js +1 -0
  99. package/assets/esri/core/workers/chunks/214d63813d268afc265d.js +1 -0
  100. package/assets/esri/core/workers/chunks/21c0743b2f612e7e7de3.js +1 -0
  101. package/assets/esri/core/workers/chunks/22e85819e23202a8ba90.js +1 -0
  102. package/assets/esri/core/workers/chunks/{6e677505d257e0848075.js → 23f9ab77e4e263f82636.js} +1 -1
  103. package/assets/esri/core/workers/chunks/25cc6d7178a52f2f46b7.js +1 -0
  104. package/assets/esri/core/workers/chunks/28a04887ecaee5445d14.js +1 -0
  105. package/assets/esri/core/workers/chunks/{2fc5c1504691badc7792.js → 2ac2d0a7623dd060c144.js} +1 -1
  106. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +1 -0
  107. package/assets/esri/core/workers/chunks/{4c9df8ae9238454969b8.js → 2c21f4744e19b925a6ae.js} +1 -1
  108. package/assets/esri/core/workers/chunks/32fc7d1db4b311f6b880.js +1 -0
  109. package/assets/esri/core/workers/chunks/36792b8a85e88044cb49.js +1 -0
  110. package/assets/esri/core/workers/chunks/36a7e19f43517aa94577.js +1 -0
  111. package/assets/esri/core/workers/chunks/{6e6cdff4bbe1ff2f44ac.js → 3ab25279aaa30f035038.js} +1 -1
  112. package/assets/esri/core/workers/chunks/3acc1299c1382c3b034d.js +1 -0
  113. package/assets/esri/core/workers/chunks/{abcda435bc83ef4240f9.js → 3b499cfc89c8f87cdb20.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{c2684fcde2923c9830e0.js → 42c4d0c1c08bf111e5a4.js} +1 -1
  115. package/assets/esri/core/workers/chunks/430802108b63194b7ddd.js +2 -0
  116. package/assets/esri/core/workers/chunks/445b0ca1b70730c9a2e6.js +1 -0
  117. package/assets/esri/core/workers/chunks/49c6dc487714f9cd55c7.js +1 -0
  118. package/assets/esri/core/workers/chunks/{70e0ead69a722fd964b8.js → 49e8ff5ed079a9e3be4b.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 4bf2cc4d092601ff2b86.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{72be81c1394285b51ed3.js → 4bfd63f3cf9208eb839b.js} +225 -229
  121. package/assets/esri/core/workers/chunks/501df20cdd09384f6ee2.js +1 -0
  122. package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +1 -0
  123. package/assets/esri/core/workers/chunks/{89a785f8b61263e2d592.js → 552c92b01a5f02a115c5.js} +1 -1
  124. package/assets/esri/core/workers/chunks/564fdf0d663b773806cc.js +1 -0
  125. package/assets/esri/core/workers/chunks/{d9270f4935eb0d044db3.js → 57328c206f1e699ac06f.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{50951fb13013b11b8a24.js → 58e62c8ce1292f4d3b06.js} +1 -1
  127. package/assets/esri/core/workers/chunks/{434c5b54e89ace974cbd.js → 5965a947f68b707eaa6b.js} +2 -2
  128. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +1 -0
  129. package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +1 -0
  130. package/assets/esri/core/workers/chunks/5f79ba5639067f734791.js +1 -0
  131. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 60c61f34733063730386.js} +1 -1
  132. package/assets/esri/core/workers/chunks/62b1f94f4fa978d4da48.js +1 -0
  133. package/assets/esri/core/workers/chunks/6b264006b96cbf93d8ed.js +1 -0
  134. package/assets/esri/core/workers/chunks/6b9d29ca568590358478.js +1 -0
  135. package/assets/esri/core/workers/chunks/6c25c929bcde7e3a2af1.js +1 -0
  136. package/assets/esri/core/workers/chunks/{7c5310e0104c22da0261.js → 6c7cb7974969e3167f2b.js} +1 -1
  137. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +1 -0
  138. package/assets/esri/core/workers/chunks/{e98b785e8f4edc8bd3ff.js → 6eceeca33fac8e900d9d.js} +1 -1
  139. package/assets/esri/core/workers/chunks/7232fc11b23777b6be94.js +1 -0
  140. package/assets/esri/core/workers/chunks/726ca458b98bb4334431.js +1 -0
  141. package/assets/esri/core/workers/chunks/785206da3962ba23de16.js +1 -0
  142. package/assets/esri/core/workers/chunks/{1c70620f40be02f532b5.js → 7b169eabafcc03bfaee6.js} +1 -1
  143. package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +1 -0
  144. package/assets/esri/core/workers/chunks/{082069f80eee0407b828.js → 7edf57e31ff07af9032b.js} +1 -1
  145. package/assets/esri/core/workers/chunks/7f2ac03efaa4a4898ba2.js +2 -0
  146. package/assets/esri/core/workers/chunks/83ed38468e316302b157.js +1 -0
  147. package/assets/esri/core/workers/chunks/85c876ee9e63d5732937.js +1 -0
  148. package/assets/esri/core/workers/chunks/8f0ecf4d06ec7b67d4ed.js +1 -0
  149. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +1 -0
  150. package/assets/esri/core/workers/chunks/{a1916bca1af5c65be4b0.js → 90ab3c47138875070a53.js} +1 -1
  151. package/assets/esri/core/workers/chunks/{10389c87d9c6a43363ce.js → 917dec9c004218c58950.js} +1 -1
  152. package/assets/esri/core/workers/chunks/91f451b98e0f696043df.js +1 -0
  153. package/assets/esri/core/workers/chunks/943d0026ca4d49eb3ac2.js +1 -0
  154. package/assets/esri/core/workers/chunks/982a396bd4fffa62e911.js +1 -0
  155. package/assets/esri/core/workers/chunks/98a5327fd96d9542b39f.js +1 -0
  156. package/assets/esri/core/workers/chunks/9b9a60f1e0c48aa701f0.js +1 -0
  157. package/assets/esri/core/workers/chunks/9d92e6f0beed9a8580fa.js +1 -0
  158. package/assets/esri/core/workers/chunks/9df379041e8860fe7f01.js +1 -0
  159. package/assets/esri/core/workers/chunks/{847781aefed049493444.js → 9f760dc4492a03e0504c.js} +1 -1
  160. package/assets/esri/core/workers/chunks/{013c9cc198736a72f7f2.js → 9fb46ccd4be4c3b61c31.js} +1 -1
  161. package/assets/esri/core/workers/chunks/{1e8ceb4a4b28625236e3.js → a42505b978d54d36d3b6.js} +1 -1
  162. package/assets/esri/core/workers/chunks/{bfbe6ff786435fe1e7cf.js → a86a4e550a92f770d6d5.js} +1 -1
  163. package/assets/esri/core/workers/chunks/{a34eee4c9d4c1c2b8c49.js → ab60f3bc18b5ea504f70.js} +1 -1
  164. package/assets/esri/core/workers/chunks/{18b9ec6ba7a6c0fa2ac6.js → b1880d9f5eafd50ce84b.js} +1 -1
  165. package/assets/esri/core/workers/chunks/{777fc163530448eea13e.js → b4222152efaf73b37b53.js} +1 -1
  166. package/assets/esri/core/workers/chunks/b6ca73c1384f07b30b74.js +1 -0
  167. package/assets/esri/core/workers/chunks/bb4cbf6b7c35e8c78cc7.js +1 -0
  168. package/assets/esri/core/workers/chunks/bb831d23422acfb00ae2.js +1 -0
  169. package/assets/esri/core/workers/chunks/bdcca906fdfb8e179abb.js +2 -0
  170. package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +1 -0
  171. package/assets/esri/core/workers/chunks/c5ceceb0683671f92efa.js +1 -0
  172. package/assets/esri/core/workers/chunks/c5e288d57bacb8451e2d.js +2 -0
  173. package/assets/esri/core/workers/chunks/{a0f742fd947104662d37.js → c6277236ec47586dca00.js} +1 -1
  174. package/assets/esri/core/workers/chunks/{3be33a129d3ae7dc4f06.js → caf38cf4d8542fb11c46.js} +1 -1
  175. package/assets/esri/core/workers/chunks/{10d33b4f248864225f85.js → cd0f5cd0fefe7f49e3d8.js} +1 -1
  176. package/assets/esri/core/workers/chunks/{b92b7d6c1e693c97a3eb.js → d1f54b0079fb71a15612.js} +1 -1
  177. package/assets/esri/core/workers/chunks/{48a53bfeef11c32dadcc.js → d25fb32a233d2128afbe.js} +1 -1
  178. package/assets/esri/core/workers/chunks/d5e3f8e5b8d2576d3cb3.js +2 -0
  179. package/assets/esri/core/workers/chunks/d629708bf23da24ee523.js +1 -0
  180. package/assets/esri/core/workers/chunks/{21d4219844ae5654618b.js → d926bffc3ff9f87e9081.js} +1 -1
  181. package/assets/esri/core/workers/chunks/db141122060d8d9b38da.js +1 -0
  182. package/assets/esri/core/workers/chunks/dc1944a7601b518a9c48.js +1 -0
  183. package/assets/esri/core/workers/chunks/{573ee2e59d26bc75201e.js → dc8670f32bb0b93c1473.js} +1 -1
  184. package/assets/esri/core/workers/chunks/e1f2b07be33e33117313.js +1 -0
  185. package/assets/esri/core/workers/chunks/e52f30dfb7c82491a7f2.js +1 -0
  186. package/assets/esri/core/workers/chunks/e5906b28b981199fd489.js +1 -0
  187. package/assets/esri/core/workers/chunks/{b3293ee9f221423a6825.js → e611e452f04a9ce64cf8.js} +1 -1
  188. package/assets/esri/core/workers/chunks/e755075ac2e02e881fad.js +1 -0
  189. package/assets/esri/core/workers/chunks/{058d4c927486a361e633.js → ea9e770efc85594e4dd2.js} +1 -1
  190. package/assets/esri/core/workers/chunks/{0f20c458f873564faff2.js → ec4f887153c24ab83f2c.js} +1 -1
  191. package/assets/esri/core/workers/chunks/{707b4ae689c4329cad3b.js → f40ceb5e03c699605302.js} +1 -1
  192. package/assets/esri/core/workers/chunks/{547a073c789fdfb78310.js → f42243c62dd0b6993816.js} +1 -1
  193. package/assets/esri/core/workers/chunks/{a49147203e55609630cc.js → f453dc4a075d2f900c7d.js} +1 -1
  194. package/assets/esri/core/workers/chunks/f465fb26541372fdc908.js +2 -0
  195. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +1 -0
  196. package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +1 -0
  197. package/assets/esri/core/workers/chunks/fdf5ceffec9d5185953d.js +1 -0
  198. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +1 -0
  199. package/assets/esri/themes/base/widgets/_Bookmarks.scss +1 -0
  200. package/assets/esri/themes/dark/main.css +1 -1
  201. package/assets/esri/themes/light/main.css +1 -1
  202. package/assets/esri/themes/light/view.css +1 -1
  203. package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
  204. package/chunks/ChapmanAtmosphere.glsl.js +1 -1
  205. package/chunks/Component.glsl.js +57 -56
  206. package/chunks/DeepSky.glsl.js +1 -1
  207. package/chunks/DefaultMaterial.glsl.js +19 -23
  208. package/chunks/FocusArea.glsl.js +1 -1
  209. package/chunks/GaussianSplat.glsl.js +13 -11
  210. package/chunks/GaussianSplatDepth.glsl.js +3 -3
  211. package/chunks/GlobalIllumination.glsl.js +1 -1
  212. package/chunks/Haze.glsl.js +1 -1
  213. package/chunks/Path.glsl.js +21 -24
  214. package/chunks/RealisticTree.glsl.js +42 -41
  215. package/chunks/RibbonLine.glsl.js +72 -61
  216. package/chunks/SimpleAtmosphere.glsl.js +1 -1
  217. package/chunks/Terrain.glsl.js +25 -25
  218. package/chunks/Water.glsl.js +4 -4
  219. package/config.js +1 -1
  220. package/core/units.js +1 -1
  221. package/geometry/Extent.js +1 -1
  222. package/geometry/operators/affineTransformOperator.d.ts +9 -3
  223. package/geometry/operators/affineTransformOperator.js +1 -1
  224. package/geometry/operators/alphaShapeOperator.d.ts +14 -4
  225. package/geometry/operators/alphaShapeOperator.js +1 -1
  226. package/geometry/operators/areaOperator.d.ts +11 -3
  227. package/geometry/operators/areaOperator.js +1 -1
  228. package/geometry/operators/autoCompleteOperator.d.ts +6 -2
  229. package/geometry/operators/autoCompleteOperator.js +1 -1
  230. package/geometry/operators/boundaryOperator.d.ts +9 -3
  231. package/geometry/operators/boundaryOperator.js +1 -1
  232. package/geometry/operators/bufferOperator.d.ts +19 -5
  233. package/geometry/operators/bufferOperator.js +1 -1
  234. package/geometry/operators/centroidOperator.d.ts +6 -2
  235. package/geometry/operators/centroidOperator.js +1 -1
  236. package/geometry/operators/clipOperator.d.ts +9 -3
  237. package/geometry/operators/clipOperator.js +1 -1
  238. package/geometry/operators/containsOperator.d.ts +9 -3
  239. package/geometry/operators/containsOperator.js +1 -1
  240. package/geometry/operators/convexHullOperator.d.ts +17 -5
  241. package/geometry/operators/convexHullOperator.js +1 -1
  242. package/geometry/operators/crossesOperator.d.ts +9 -3
  243. package/geometry/operators/crossesOperator.js +1 -1
  244. package/geometry/operators/cutOperator.d.ts +6 -2
  245. package/geometry/operators/cutOperator.js +1 -1
  246. package/geometry/operators/densifyOperator.d.ts +14 -4
  247. package/geometry/operators/densifyOperator.js +1 -1
  248. package/geometry/operators/differenceOperator.d.ts +9 -3
  249. package/geometry/operators/differenceOperator.js +1 -1
  250. package/geometry/operators/disjointOperator.d.ts +9 -3
  251. package/geometry/operators/disjointOperator.js +1 -1
  252. package/geometry/operators/distanceOperator.d.ts +11 -3
  253. package/geometry/operators/distanceOperator.js +1 -1
  254. package/geometry/operators/equalsOperator.d.ts +9 -3
  255. package/geometry/operators/equalsOperator.js +1 -1
  256. package/geometry/operators/extendOperator.d.ts +11 -3
  257. package/geometry/operators/extendOperator.js +1 -1
  258. package/geometry/operators/generalizeOperator.d.ts +14 -4
  259. package/geometry/operators/generalizeOperator.js +1 -1
  260. package/geometry/operators/geodesicBufferOperator.d.ts +25 -7
  261. package/geometry/operators/geodesicBufferOperator.js +1 -1
  262. package/geometry/operators/geodesicProximityOperator.d.ts +28 -8
  263. package/geometry/operators/geodesicProximityOperator.js +1 -1
  264. package/geometry/operators/geodeticAreaOperator.d.ts +17 -5
  265. package/geometry/operators/geodeticAreaOperator.js +1 -1
  266. package/geometry/operators/geodeticDensifyOperator.d.ts +20 -6
  267. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  268. package/geometry/operators/geodeticDistanceOperator.d.ts +17 -5
  269. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  270. package/geometry/operators/geodeticLengthOperator.d.ts +17 -5
  271. package/geometry/operators/geodeticLengthOperator.js +1 -1
  272. package/geometry/operators/geodeticUtilsOperator.d.ts +17 -5
  273. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  274. package/geometry/operators/graphicBufferOperator.d.ts +11 -3
  275. package/geometry/operators/graphicBufferOperator.js +1 -1
  276. package/geometry/operators/integrateOperator.d.ts +6 -2
  277. package/geometry/operators/integrateOperator.js +1 -1
  278. package/geometry/operators/intersectionOperator.d.ts +12 -4
  279. package/geometry/operators/intersectionOperator.js +1 -1
  280. package/geometry/operators/intersectsOperator.d.ts +9 -3
  281. package/geometry/operators/intersectsOperator.js +1 -1
  282. package/geometry/operators/isNearOperator.d.ts +11 -3
  283. package/geometry/operators/isNearOperator.js +1 -1
  284. package/geometry/operators/json/bufferOperator.js +1 -1
  285. package/geometry/operators/json/containsOperator.js +1 -1
  286. package/geometry/operators/json/convexHullOperator.js +1 -1
  287. package/geometry/operators/json/crossesOperator.js +1 -1
  288. package/geometry/operators/json/disjointOperator.js +1 -1
  289. package/geometry/operators/json/generalizeOperator.js +1 -1
  290. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  291. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  292. package/geometry/operators/json/intersectionOperator.js +1 -1
  293. package/geometry/operators/json/intersectsOperator.js +1 -1
  294. package/geometry/operators/json/lengthOperator.js +1 -1
  295. package/geometry/operators/json/offsetOperator.js +1 -1
  296. package/geometry/operators/json/overlapsOperator.js +1 -1
  297. package/geometry/operators/json/projectOperator.js +1 -1
  298. package/geometry/operators/json/simplifyOperator.js +1 -1
  299. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  300. package/geometry/operators/json/touchesOperator.js +1 -1
  301. package/geometry/operators/json/unionOperator.js +1 -1
  302. package/geometry/operators/json/withinOperator.js +1 -1
  303. package/geometry/operators/labelPointOperator.d.ts +9 -3
  304. package/geometry/operators/labelPointOperator.js +1 -1
  305. package/geometry/operators/lengthOperator.d.ts +11 -3
  306. package/geometry/operators/lengthOperator.js +1 -1
  307. package/geometry/operators/linesToPolygonsOperator.d.ts +6 -2
  308. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  309. package/geometry/operators/locateBetweenOperator.d.ts +6 -2
  310. package/geometry/operators/locateBetweenOperator.js +1 -1
  311. package/geometry/operators/minimumBoundingCircleOperator.d.ts +14 -4
  312. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  313. package/geometry/operators/multiPartToSinglePartOperator.d.ts +11 -3
  314. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  315. package/geometry/operators/offsetOperator.d.ts +14 -4
  316. package/geometry/operators/offsetOperator.js +1 -1
  317. package/geometry/operators/overlapsOperator.d.ts +9 -3
  318. package/geometry/operators/overlapsOperator.js +1 -1
  319. package/geometry/operators/polygonOverlayOperator.d.ts +11 -3
  320. package/geometry/operators/polygonOverlayOperator.js +1 -1
  321. package/geometry/operators/polygonSlicerOperator.d.ts +22 -6
  322. package/geometry/operators/polygonSlicerOperator.js +1 -1
  323. package/geometry/operators/projectOperator.d.ts +15 -5
  324. package/geometry/operators/projectOperator.js +1 -1
  325. package/geometry/operators/proximityOperator.d.ts +22 -6
  326. package/geometry/operators/proximityOperator.js +1 -1
  327. package/geometry/operators/relateOperator.d.ts +12 -4
  328. package/geometry/operators/relateOperator.js +1 -1
  329. package/geometry/operators/reshapeOperator.d.ts +6 -2
  330. package/geometry/operators/reshapeOperator.js +1 -1
  331. package/geometry/operators/shapePreservingProjectOperator.d.ts +20 -6
  332. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  333. package/geometry/operators/simplifyOGCOperator.d.ts +3 -1
  334. package/geometry/operators/simplifyOGCOperator.js +1 -1
  335. package/geometry/operators/simplifyOperator.d.ts +12 -4
  336. package/geometry/operators/simplifyOperator.js +1 -1
  337. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  338. package/geometry/operators/support/deprecatedOperator.js +2 -0
  339. package/geometry/operators/symmetricDifferenceOperator.d.ts +9 -3
  340. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  341. package/geometry/operators/touchesOperator.d.ts +9 -3
  342. package/geometry/operators/touchesOperator.js +1 -1
  343. package/geometry/operators/unionOperator.d.ts +9 -3
  344. package/geometry/operators/unionOperator.js +1 -1
  345. package/geometry/operators/withinOperator.d.ts +9 -3
  346. package/geometry/operators/withinOperator.js +1 -1
  347. package/geometry/support/heightModelInfoUtils.js +1 -1
  348. package/geometry/support/intersectsBase.js +1 -1
  349. package/geometry/support/normalizeUtils.js +1 -1
  350. package/kernel.js +1 -1
  351. package/layers/GaussianSplatLayer.js +1 -1
  352. package/layers/ImageryTileLayer.js +1 -1
  353. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  354. package/layers/IntegratedMeshLayer.js +1 -1
  355. package/layers/SceneLayer.js +1 -1
  356. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  357. package/layers/list/BasemapItemCollection.d.ts +40 -14
  358. package/layers/list/BasemapItemCollection.js +1 -1
  359. package/layers/list/CatalogItemCollection.d.ts +29 -11
  360. package/layers/list/CatalogItemCollection.js +1 -1
  361. package/layers/list/Item.d.ts +66 -122
  362. package/layers/list/Item.js +1 -1
  363. package/layers/list/ItemPanel.d.ts +23 -34
  364. package/layers/list/LayerItemCollection.d.ts +33 -43
  365. package/layers/list/LayerItemCollection.js +1 -1
  366. package/layers/list/TableItem.d.ts +42 -53
  367. package/layers/list/TableItem.js +1 -1
  368. package/layers/list/TableItemCollection.d.ts +25 -55
  369. package/layers/list/TableItemCollection.js +1 -1
  370. package/layers/list/TableItemPanel.d.ts +25 -23
  371. package/layers/list/support/layerListUtils.js +1 -1
  372. package/layers/list/types.d.ts +158 -37
  373. package/layers/mixins/TiledImagery.d.ts +6 -0
  374. package/layers/mixins/TiledImagery.js +1 -1
  375. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  376. package/layers/raster/datasets/RasterFactory.js +1 -1
  377. package/layers/support/ElevationQuery.js +1 -1
  378. package/layers/support/FeatureFilter.d.ts +2 -1
  379. package/layers/support/FeatureFilter.js +1 -1
  380. package/layers/support/domainUtils.d.ts +2 -0
  381. package/layers/support/domainUtils.js +1 -1
  382. package/layers/support/fieldUtils.d.ts +10 -0
  383. package/layers/support/fieldUtils.js +1 -1
  384. package/package.json +6 -6
  385. package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.d.ts +0 -1
  386. package/support/revision.js +1 -1
  387. package/symbols/LineStyleMarker3D.d.ts +3 -4
  388. package/symbols/LineSymbol3D.d.ts +19 -2
  389. package/symbols/LineSymbol3D.js +1 -1
  390. package/symbols/LineSymbol3DLayer.d.ts +22 -9
  391. package/symbols/Symbol3DLayer.d.ts +1 -1
  392. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  393. package/symbols/cim/CIMSymbolHelper.js +1 -1
  394. package/symbols/cim/OverrideHelper.js +1 -1
  395. package/symbols/cim/Rasterizer.js +1 -1
  396. package/symbols/cim/cimAnalyzer.js +1 -1
  397. package/symbols/cim/dashUtils.js +2 -0
  398. package/symbols/cim/effects/EffectDashes.js +1 -1
  399. package/symbols/cim/fromCIMFontStyle.js +2 -0
  400. package/symbols/cim/richTextUtils.js +1 -1
  401. package/symbols/cim/utils.js +1 -1
  402. package/symbols/patterns/LinePattern3D.d.ts +10 -4
  403. package/symbols/patterns/LinePattern3D.js +1 -1
  404. package/symbols/patterns/LineTemplatePattern3D.d.ts +48 -0
  405. package/symbols/patterns/LineTemplatePattern3D.js +2 -0
  406. package/symbols/patterns/utils.js +1 -1
  407. package/symbols/support/Symbol3DOutline.js +1 -1
  408. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  409. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  410. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  411. package/views/2d/engine/webgl/GlyphWorker.js +1 -1
  412. package/views/2d/engine/webgl/TextureManager.js +1 -1
  413. package/views/2d/engine/webgl/decorGlyphRect.js +2 -0
  414. package/views/2d/engine/webgl/definitions.js +1 -1
  415. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  416. package/views/2d/engine/webgl/effects/highlight/MultiHighlightGradient.js +1 -1
  417. package/views/2d/engine/webgl/hashMosaic.js +2 -0
  418. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  419. package/views/2d/engine/webgl/shaderGraph/techniques/animated/clipping.js +2 -0
  420. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  421. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  422. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHighlight.js +1 -1
  423. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  424. package/views/2d/input/MapViewInputManager.js +1 -1
  425. package/views/2d/input/handlers/KeyPan.js +1 -1
  426. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  427. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  428. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  429. package/views/2d/layers/LayerView2D.js +1 -1
  430. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  431. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  432. package/views/2d/layers/RouteLayerView2D.js +1 -1
  433. package/views/2d/layers/TileLayerView2D.js +1 -1
  434. package/views/2d/layers/features/FeatureContainer.js +1 -1
  435. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  436. package/views/2d/layers/features/Processor.js +1 -1
  437. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  438. package/views/2d/layers/features/processor/AggregateStrategy.js +1 -1
  439. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  440. package/views/2d/layers/features/processor/bins/BinLevelState.js +1 -1
  441. package/views/2d/layers/features/processor/clusters/ClusterLevelState.js +1 -1
  442. package/views/2d/layers/features/processor/tracks/TrackLevelState.js +1 -1
  443. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  444. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  445. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  446. package/views/2d/layers/graphics/AGraphicContainer.js +1 -1
  447. package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
  448. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  449. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  450. package/views/2d/layers/support/FilterSchema.js +2 -0
  451. package/views/2d/layers/support/HighlightRegistry.js +2 -0
  452. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  453. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  454. package/views/2d/layers/support/util.js +1 -1
  455. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  456. package/views/3d/input/SceneInputManager.js +1 -1
  457. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  458. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  459. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  460. package/views/3d/layers/I3SMeshView3D.js +1 -1
  461. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  462. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  463. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  464. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  465. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  466. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  467. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  468. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  469. package/views/3d/navigation/Navigation3D.d.ts +16 -0
  470. package/views/3d/navigation/Navigation3D.js +2 -0
  471. package/views/3d/navigation/modes/DefaultNavigationMode3D.d.ts +4 -0
  472. package/views/3d/navigation/modes/DefaultNavigationMode3D.js +2 -0
  473. package/views/3d/navigation/modes/GroundNavigationMode3D.d.ts +4 -0
  474. package/views/3d/navigation/modes/GroundNavigationMode3D.js +2 -0
  475. package/views/3d/navigation/modes/NavigationMode3D.d.ts +4 -0
  476. package/views/3d/navigation/modes/NavigationMode3D.js +2 -0
  477. package/views/3d/navigation/modes/NavigationMode3DUnion.d.ts +5 -0
  478. package/views/3d/state/ConstraintsManager.js +1 -1
  479. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  480. package/views/3d/support/MemoryController.js +1 -1
  481. package/views/3d/support/QualityProfile.js +1 -1
  482. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  483. package/views/3d/support/hitTest.js +1 -1
  484. package/views/3d/terrain/ExtentHelper.js +1 -1
  485. package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
  486. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  487. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  488. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -3
  489. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +3 -3
  490. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +4 -4
  491. package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
  492. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +57 -58
  493. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +5 -3
  494. package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
  495. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +7 -6
  496. package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +3 -3
  497. package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +5 -10
  498. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +10 -48
  499. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +16 -22
  500. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
  501. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +5 -3
  502. package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrGlobals.glsl.js +19 -0
  503. package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrShadingInfo.glsl.js +24 -0
  504. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
  505. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +2 -2
  506. package/views/3d/webgl-engine/effects/AmbientIllumination.js +2 -0
  507. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  508. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  509. package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
  510. package/views/3d/webgl-engine/effects/snowcover/SnowCover.glsl.js +4 -4
  511. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  512. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  513. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  514. package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
  515. package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
  516. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  517. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  518. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  519. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  520. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  521. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  522. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  523. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  524. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  525. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  526. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  527. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  528. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  529. package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
  530. package/views/3d/webgl-engine/materials/lineStippleUtils.js +1 -1
  531. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  532. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  533. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  534. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +23 -22
  535. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  536. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  537. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  538. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  539. package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechniqueConfiguration.js +1 -1
  540. package/views/MapView.d.ts +1 -0
  541. package/views/PopupView.js +1 -1
  542. package/views/SceneView.d.ts +1 -0
  543. package/views/SceneView.js +1 -1
  544. package/views/View.js +1 -1
  545. package/views/layers/FeatureLikeLayerView.js +1 -1
  546. package/views/support/DefaultsFromMap.js +1 -1
  547. package/widgets/BasemapLayerList.js +1 -1
  548. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
  549. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  550. package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.js +1 -1
  551. package/widgets/BatchAttributeForm.js +1 -1
  552. package/widgets/Bookmarks.js +1 -1
  553. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  554. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  555. package/widgets/LayerList/LayerListViewModel.d.ts +1 -0
  556. package/widgets/LayerList/LayerListViewModel.js +1 -1
  557. package/widgets/LayerList/ListItem.d.ts +4 -0
  558. package/widgets/LayerList/ListItemPanel.d.ts +3 -0
  559. package/widgets/OrientedImageryViewer/types.d.ts +2 -2
  560. package/widgets/OrientedImageryViewer.d.ts +20 -1
  561. package/widgets/OrientedImageryViewer.js +1 -1
  562. package/widgets/Search/LocatorSearchSource.d.ts +4 -3
  563. package/widgets/Sketch/SketchViewModel.js +1 -1
  564. package/widgets/support/forms/formUtils.d.ts +5 -0
  565. package/widgets/support/forms/formUtils.js +1 -1
  566. package/widgets/support/forms/types.d.ts +7 -1
  567. package/widgets/support/iconUtils.js +1 -1
  568. package/assets/esri/core/workers/chunks/03601be8b0763f82e88f.js +0 -1
  569. package/assets/esri/core/workers/chunks/075eb62465edb9cbf907.js +0 -1
  570. package/assets/esri/core/workers/chunks/0bff8d589312be6588fe.js +0 -1
  571. package/assets/esri/core/workers/chunks/0de90b1ad8118457fd5a.js +0 -1
  572. package/assets/esri/core/workers/chunks/0e1a067ab243900d0371.js +0 -1
  573. package/assets/esri/core/workers/chunks/0ee6109e6578395a7900.js +0 -1
  574. package/assets/esri/core/workers/chunks/0ee7376c29e0fd8f676c.js +0 -1
  575. package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +0 -1
  576. package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +0 -2
  577. package/assets/esri/core/workers/chunks/13551987fbeaae154df8.js +0 -1
  578. package/assets/esri/core/workers/chunks/19ac6f4664f97fb3821c.js +0 -1
  579. package/assets/esri/core/workers/chunks/1ec01fd6330d011c76d6.js +0 -1
  580. package/assets/esri/core/workers/chunks/262052dfaec3af8a58b9.js +0 -1
  581. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +0 -1
  582. package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +0 -2
  583. package/assets/esri/core/workers/chunks/307297e025eed110095f.js +0 -1
  584. package/assets/esri/core/workers/chunks/33422dca6f4bcaa0ea74.js +0 -1
  585. package/assets/esri/core/workers/chunks/33e583166ab3943ecf0e.js +0 -1
  586. package/assets/esri/core/workers/chunks/349e9f3d3e3267d02988.js +0 -1
  587. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +0 -1
  588. package/assets/esri/core/workers/chunks/3daddcb106a7009c5a70.js +0 -1
  589. package/assets/esri/core/workers/chunks/3de6e54b6ed0feae1940.js +0 -1
  590. package/assets/esri/core/workers/chunks/3ffc852db1a820ed143b.js +0 -1
  591. package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +0 -2
  592. package/assets/esri/core/workers/chunks/4490dd8bae0dd2769d99.js +0 -1
  593. package/assets/esri/core/workers/chunks/476535cfb06ced74d611.js +0 -2
  594. package/assets/esri/core/workers/chunks/4c088c26d5d546c95c90.js +0 -1
  595. package/assets/esri/core/workers/chunks/54bb3678570ca032f051.js +0 -1
  596. package/assets/esri/core/workers/chunks/56163189fbe63aa11e94.js +0 -1
  597. package/assets/esri/core/workers/chunks/571cf99c3eab8e517542.js +0 -1
  598. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +0 -1
  599. package/assets/esri/core/workers/chunks/58e4aecabca047f1d229.js +0 -1
  600. package/assets/esri/core/workers/chunks/5c8f423812a23c02c1fd.js +0 -1
  601. package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +0 -1
  602. package/assets/esri/core/workers/chunks/5eb726317b6602f1e206.js +0 -1
  603. package/assets/esri/core/workers/chunks/6010799e05d239073de0.js +0 -1
  604. package/assets/esri/core/workers/chunks/69921d068add041b5dcb.js +0 -1
  605. package/assets/esri/core/workers/chunks/6df29716f75696434807.js +0 -1
  606. package/assets/esri/core/workers/chunks/6e2075bd4832ff0db68c.js +0 -1
  607. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +0 -1
  608. package/assets/esri/core/workers/chunks/7737ab739eba6d81282d.js +0 -1
  609. package/assets/esri/core/workers/chunks/7d9468e38f3bf006f86e.js +0 -1
  610. package/assets/esri/core/workers/chunks/7efc51324cfc8e08c756.js +0 -1
  611. package/assets/esri/core/workers/chunks/84dc2afd89263a311b81.js +0 -1
  612. package/assets/esri/core/workers/chunks/852649460d664b0a1a1d.js +0 -1
  613. package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +0 -1
  614. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +0 -1
  615. package/assets/esri/core/workers/chunks/b7809ef3e1dabd921339.js +0 -1
  616. package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +0 -2
  617. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +0 -1
  618. package/assets/esri/core/workers/chunks/be69e2dda75b079362b2.js +0 -1
  619. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +0 -1
  620. package/assets/esri/core/workers/chunks/c18de0f6cbeecee4ce34.js +0 -1
  621. package/assets/esri/core/workers/chunks/c7b762bae945f383c723.js +0 -1
  622. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +0 -1
  623. package/assets/esri/core/workers/chunks/d33d08cb6856cd2eb35e.js +0 -1
  624. package/assets/esri/core/workers/chunks/e688e6e816824b53a25e.js +0 -1
  625. package/assets/esri/core/workers/chunks/ea068c797e3e462f4518.js +0 -1
  626. package/assets/esri/core/workers/chunks/eaf1d38f09744b7e84f5.js +0 -1
  627. package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +0 -2
  628. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +0 -1
  629. package/assets/esri/core/workers/chunks/f5e8ccbd6b4c0a386903.js +0 -1
  630. package/assets/esri/core/workers/chunks/f60d5ce49c173d5381ec.js +0 -1
  631. package/assets/esri/core/workers/chunks/f834aa732c3f06525089.js +0 -1
  632. package/assets/esri/core/workers/chunks/f9e5740b05de24ba81be.js +0 -1
  633. package/assets/esri/core/workers/chunks/fae14e30fa7d81bf706e.js +0 -1
  634. package/assets/esri/core/workers/chunks/fb6f1b562ee0983c8c6e.js +0 -1
  635. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +0 -1
  636. package/assets/esri/core/workers/chunks/fc622f9e33e3b48113c8.js +0 -1
  637. package/views/2d/engine/webgl/Utils.js +0 -2
  638. package/views/2d/layers/support/HighlightCounter.js +0 -2
  639. /package/assets/esri/core/workers/chunks/{476535cfb06ced74d611.js.LICENSE.txt → 430802108b63194b7ddd.js.LICENSE.txt} +0 -0
  640. /package/assets/esri/core/workers/chunks/{b82b523b6837ed1f28d3.js.LICENSE.txt → 7f2ac03efaa4a4898ba2.js.LICENSE.txt} +0 -0
  641. /package/assets/esri/core/workers/chunks/{ef24fd6c0322e5de9fdf.js.LICENSE.txt → bdcca906fdfb8e179abb.js.LICENSE.txt} +0 -0
  642. /package/assets/esri/core/workers/chunks/{1082bb0858585bd4fa21.js.LICENSE.txt → c5e288d57bacb8451e2d.js.LICENSE.txt} +0 -0
  643. /package/assets/esri/core/workers/chunks/{2e2349387a2b9903f13c.js.LICENSE.txt → d5e3f8e5b8d2576d3cb3.js.LICENSE.txt} +0 -0
  644. /package/assets/esri/core/workers/chunks/{411bbdecba340df11d95.js.LICENSE.txt → f465fb26541372fdc908.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{isSome as o}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as s,drainHandles as n,destroyHandle as p}from"../../core/handleUtils.js";import"../../core/has.js";import l from"../../core/Logger.js";import{destroyMaybe as h,abortMaybe as d}from"../../core/maybe.js";import{createAbortError as c,ignoreAbortErrors as u,whenOrAbort as m}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as y,on as v,when as f,whenOnce as _}from"../../core/reactiveUtils.js";import{property as b,subclass as w}from"../../core/accessorSupport/decorators.js";import{trackAccess as T}from"../../core/accessorSupport/tracking.js";import{SimpleObservable as G}from"../../core/accessorSupport/tracking/SimpleObservable.js";import{UpdatingHandles as O}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as S}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C,isLoaded as A,load as E,project as M}from"../../geometry/projectionUtils.js";import{geometryToCoordinates as H}from"../../geometry/support/coordsUtils.js";import{equals as k}from"../../geometry/support/spatialReferenceUtils.js";import P from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as D}from"../../layers/support/layerUtils.js";import{getEffectiveElevationInfo as I}from"../../support/elevationInfoUtils.js";import U from"../../symbols/FillSymbol3DLayer.js";import j from"../../symbols/MeshSymbol3D.js";import R from"../../symbols/SimpleFillSymbol.js";import x from"../../symbols/SimpleLineSymbol.js";import L from"../../symbols/SimpleMarkerSymbol.js";import F from"../../symbols/TextSymbol.js";import{symbolTypes as V}from"../../symbols/support/typeUtils.js";import{isSupportedObjectResultMessage as W}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as K}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as Z}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as q}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as N}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as z}from"../../views/input/InputManager.js";import{sketchKeys as B}from"../../views/interactive/keybindings.js";import $ from"../../views/interactive/sketch/SketchLabelOptions.js";import Y from"../../views/interactive/sketch/SketchOptions.js";import J from"../../views/interactive/sketch/SketchTooltipOptions.js";import Q from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as X}from"../../views/interactive/snapping/SnappingManager.js";import ee from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as te}from"../../views/interactive/snapping/snappingUtils.js";import{GeometryWorkerHandle as oe}from"../../views/support/GeometryWorkerHandle.js";import{defaultHighlightName as ie}from"../../views/support/HighlightDefaults.js";import{findFirstGraphicHit as ae}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as re}from"../../views/support/screenUtils.js";import se from"./adapters/layer/GraphicsLayerAdapter.js";import ne from"./adapters/layer/MapNotesLayerAdapter.js";import{CreateOperationHandle as pe,DrawToolOperationHandle as le,UpdateOperationHandle as he}from"./support/OperationHandle.js";import{PluginManager as de}from"./support/PluginManager.js";import{SettingsManager as ce}from"./support/SettingsManager.js";import{getLegacyTool as ue,isCompletelyDegenerate as me,graphicsHaveTooFewVerticesForBox as ge,getModeFromCreateOptions as ye,getDrawToolGeometryTypeFromCreateTool as ve}from"./support/sketchUtils.js";const fe={defaultZ:0},_e={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move",enableCreateCurveFromStraightEdge:!0},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0,name:ie},tool:"transform"},be=Symbol(),we=Symbol();let Te=class extends r{constructor(e){super(e),this._defaultSnappingManager=null,this._internalGraphicsLayer=new P({listMode:"hide",internal:!0,title:"SVM Internal"}),this._pluginManager=new de({sketchViewModel:this}),this.settingsManager=new ce({availablePlugins:()=>this.pluginManager.visiblePluginsFlat}),this._operationHandle=null,this._updatingHandles=new O,this._toolTransitionHandles=new O,this._drawToolSimplifyAbortController=null,this._geometryWorkerHandle=new oe,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.activeUpdateOptions=null,this.layer=null,this.pointSymbol=new L({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new R({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new x({color:[130,130,130,1],width:2}),this.meshSymbol=new j({symbolLayers:new i([new U])}),this.updateGraphics=new i,this.updateOnGraphicClick=!0,this.cancelUpdateOnClickAway=!0,this.creationMode="single",this.vertexSymbol=new L({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new Y,this.useLegacyCreateTools=!0,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._sketchContinuationFlag=!1,this._onLayerAdapterChange=async()=>{const{_layerAdapter:e}=this;if(this.removeHandles(we),!e)return;const t=[e.onGraphicsChange(e=>this._onLayerGraphicsChangeCallback(e)),g(()=>e.elevationInfo,e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer&&(this._internalGraphicsLayer.elevationInfo=e))},y)].filter(o);this.addHandles(t,we)},this._originalPopupEnabled=null,this.defaultCreateOptions=fe,this.defaultUpdateOptions=_e,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new ee,this.textSymbol=new F({text:"text"})}initialize(){this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe()),this.addHandles([v(()=>this.view?.map?.layers,"change",e=>{this.layer&&e.removed.includes(this.layer)&&this.cancel()}),g(()=>this._layerAdapter,()=>this._onLayerAdapterChange(),y),g(()=>this.view,e=>{this._defaultSnappingManager=h(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new X({view:e,options:this.snappingOptions})),"2d"===e.type?(import("../../views/2d/interactive/editingTools.js"),this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe())):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))},y),g(()=>this.view?.spatialReference,(e,t)=>{e&&t&&!e.equals(t)&&this.cancel()})]),te(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=h(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this._toolTransitionHandles.destroy(),this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),this._geometryWorkerHandle.destroy(),this._pluginManager?.destroy(),this.emit("destroy")}get _layerAdapter(){const{layer:e}=this;switch(e?.type){case"graphics":return new se(e);case"map-notes":return new ne(e);default:return null}}get activeTool(){return this._operationHandle?.tool??null}get geometrySimplificationInProgress(){return!!this._drawToolSimplifyAbortController}get activeCreateToolDrawMode(){const e=this._operationHandle;if("create"===e?.type&&e.activeComponent&&"mode"in e.activeComponent)return e.activeComponent.mode;if("draw-2.0"===e?.activeComponent?.type){const t=e.activeComponent.pluginStack.map(e=>e.configuration).filter(o).toArray();if(t.length>0)return this._pluginManager?.getDrawingModeEquivalentToPluginStack(t)}return null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...fe,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{..._e,...e,reshapeOptions:{..._e.reshapeOptions,...e?.reshapeOptions},highlightOptions:{..._e.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get textSymbol(){return this._get("textSymbol")}set textSymbol(e){this._set("textSymbol",e)}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=h(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new X({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get toolTransitionInProgress(){return this._toolTransitionHandles.updating||!!this.drawTool?.lifecycleManager.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get updating(){return this.toolTransitionInProgress||this.activeComponent&&"updating"in this.activeComponent&&this.activeComponent.updating||!!(this._updatingHandles.updating||this._drawToolSimplifyAbortController||this.snappingManager?.updating||this.drawTool?.updating)}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&this._clearCursor(),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(f(()=>e.ready,t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)},y),o),this._set("view",e),this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe())}get isUsingLegacyCreateTools(){return this.useLegacyCreateTools||"2d"!==this.view?.type}get pluginManager(){return this._pluginManager}get drawTool(){return"draw-2.0"!==this.activeComponent?.type?null:this.activeComponent}get rootPlugins(){return this._pluginManager?.availablePlugins}set rootPlugins(e){this._overrideIfSome("rootPlugins",e)}get effectiveAvailablePlugins(){if(this.isUsingLegacyCreateTools)return null;const e=this.view?.type??"2d",{firstPluginWithSwappableLeaf:t}=this;return t?t.availableDownstreamPlugins.filter(t=>!t.excludedViews?.includes(e)):this.rootPlugins?.filter(t=>!t.excludedViews?.includes(e)).filter(o)??[]}get firstPluginWithSwappableLeaf(){const e=this.view?.type??"2d",t=this.drawTool?.pluginStack.toArray().map(e=>e.configuration).findLast(t=>null!=t&&!t.hidden&&t.availableDownstreamPlugins&&t.availableDownstreamPlugins.filter(t=>!t.excludedViews?.includes(e))?.length>1);return t}get multiplePluginsActive(){return!!this.drawTool&&this.drawTool.pluginStack.length>1}addGraphic(e){this._layerAdapter?.add(e)}addGraphics(e){this._layerAdapter?.addMany(e)}hasGraphic(e){return!!this._layerAdapter?.has(e)}removeGraphic(e){this._layerAdapter?.remove(e)}removeGraphics(e){this._layerAdapter?.removeMany(e)}removeAllGraphics(){this._layerAdapter?.removeAll()}cancel(){this._moduleLoaderAbortController=d(this._moduleLoaderAbortController),this._viewReadyAbortController=d(this._viewReadyAbortController),this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),this._sketchContinuationFlag=!0,this._operationHandle?.cancel()}complete(){this._operationHandle?.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e}=this,o=t.toArray();this.removeGraphics(o),this.cancel(),this._emitDeleteEvent({graphics:o,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map(e=>e.clone()).toArray();return this.addGraphics(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){return this._toolTransitionHandles.addPromise(this._create(e,t))}async _create(e,t){this.cancel(),await this._updatingHandles.addPromise(this._waitViewReady());const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),c();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");N(o,this._internalGraphicsLayer);const a=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==a||this.destroyed)return void o.map?.remove(this._internalGraphicsLayer);const r=ue(e),s=()=>{if(a===this._operationHandle){const o=this.createGraphic,i=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map?.remove(this._internalGraphicsLayer),a.cancelled||null==o||this.addGraphic(o),this._sketchContinuationFlag=!1,this.emit("create",{graphic:o,state:i?"cancel":"complete",tool:r??"point",toolEventInfo:null,type:"create"}),i||this._sketchContinuationFlag)return;const{creationMode:s}=this;if("continuous"===s){if(t?.geometryToPlace)return;this._updatingHandles.consumePromise(u(this.create(e,t)))}else"update"===s&&o&&this._updatingHandles.consumePromise(u(this.update([o])))}};a.on("complete",s),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return await e.load(),this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){return this._toolTransitionHandles.addPromise(this._update(e,t))}async _update(e,t){this.cancel(),await this._updatingHandles.addPromise(this._waitViewReady());const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),c();null!=i.activeTool&&(i.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some(e=>this.hasGraphic(e)?null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0):(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0)))return;const s=await this._updatingHandles.addPromise(this._setupUpdateOperation(r,t));this.destroyed||null==s||Pe(s)||(N(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||k(o.geometry.spatialReference,t.spatialReference)||(C(o.geometry.spatialReference,t.spatialReference)||A()||await E(),o.geometry=M(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._updatingHandles.consumePromise(this._operationHandle?.toggleTool())}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const i=await t.hitTest(e,{exclude:o});return ae(i.results)}const o=[t.map.ground];t.map.allLayers.forEach(e=>{D(e)&&o.push(e)});const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?S(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))},z.WIDGET)]}async _handleImmediateClick(e){const t=await e.defer(()=>this._getFirstHit(re(e)));let o=null;if(null!=t){const i=t.graphic;this.updateGraphics.includes(i)||this.hasGraphic(i)?(e.stopPropagation(),o=i):"2d"!==this.view?.type||this._isComponentGraphic(i)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancelUpdateOnClickAway&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a="string"==typeof e?this.pluginManager?.getPluginsEquivalentToCreateTool(e,i.mode):e,r=ue(e);if(a&&!this.isUsingLegacyCreateTools){const e=await this._setupDrawTool(a,i,r??"polyline");if(e)return this._setupDrawToolOperationHandle(e,r??"point")}if(!r)return null;const s=await this._setupDrawGraphicTool(r,o,i);return null==s?null:(o.tools.add(s),o.activeTool=s,this._setupCreateOperationHandle(s,r))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=ye(p,e),d=ve(e),c=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=c?.preserveAspectRatio??l??"rectangle"!==e,m={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:i,defaultZ:a,forceUniformSize:u,graphicProperties:{...n,attributes:{...n?.attributes}},geometryToPlace:s,geometryType:d,mode:h,graphicSymbol:o.graphicSymbol??this._getGraphicSymbolFromTool(e),hasZ:r,snappingManager:this.snappingManager,snapToScene:!1,view:t,...c};return"2d"===t.type?this._makeDrawGraphicTool2D(m):this._makeDrawGraphicTool3D(m)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return Pe(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:Se(e.geometryType)?this.activeFillSymbol:null,toolOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));return Pe(t)||this.destroyed?null:new t.module.DrawGraphicTool3D({...e,elevationInfo:this._layerAdapter?.elevationInfo,snapToScene:!0,toolOptions:this.sketchOptions})}_setupCreateOperationHandle(e,t){const o=this.view;if(!o)return this._logMissingView(),null;let i=null;const a=e.forceUniformSize,r=e.centered,p=new G,l=[s(()=>p.destroy()),o.on("key-down",t=>{if(t.key===B.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===B.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==B.vertexAdd||t.repeat)t.key===B.undo?(t.stopPropagation(),h.undo()):t.key===B.redo?(t.stopPropagation(),h.redo()):t.key!==B.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===B.center&&(t.repeat||(e.centered=!r,t.stopPropagation())):(e.forceUniformSize=!a,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}},z.WIDGET),o.on("key-up",t=>{t.key===B.pan?e.enabled=!0:t.key!==B.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===B.center&&(e.centered=r,t.stopPropagation()):(e.forceUniformSize=a,t.stopPropagation())},z.WIDGET),e.on("vertex-update",()=>{p.notify()}),e.on("vertex-add",t=>{switch(p.notify(),i=null==i?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:i,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("cursor-update",t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("vertex-remove",t=>{switch(p.notify(),t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("complete",e=>{this._set("createGraphic",e.graphic),i="complete",e.aborted?h&&h.cancel():h&&h.complete()}),g(()=>this._getGraphicSymbolFromTool(t),t=>{e.graphicSymbol=t})],h=new pe({activeComponent:e,type:"create",onEnd:()=>{n(l),o.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>(T(p),e.canUndo),canRedo:()=>(T(p),e.canRedo)});return h}_setupDrawToolOperationHandle(e,t){const i=this.view;if(!i)return this._logMissingView(),null;let a=null;const r=[i.on("key-down",t=>{t.key===B.pan&&(t.stopPropagation(),t.repeat||(e.editable=!1))},z.WIDGET),i.on("key-up",t=>{t.key===B.pan&&(e.editable=!0)},z.WIDGET),e.on("before-vertex-add",t=>{const o=e.mostUpstreamPlugin?.configuration;if(o&&"legacyCreateTool"in o&&("point"===o?.legacyCreateTool||"text"===o.legacyCreateTool)){const e=t.detail.originalEvent;return void(e&&"key"in e&&e.key===B.vertexAdd&&t.preventDefault())}}),e.on("before-complete",t=>{const o=e.getGeometryIfCompleted();(!o||me(o))&&t.preventDefault()}),e.on(["vertex-add","vertex-remove"],i=>{switch(this.createGraphic&&(this.createGraphic.geometry=e.getGeometryIfCompleted()),a=null==a&&"vertex-remove"!==i.type?"start":"active",i.operation){case"apply":this.emit("create",{graphic:this.createGraphic,state:a,tool:this.activeTool,toolEventInfo:i,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[this.createGraphic].filter(o),tool:t});break;case"redo":this._emitRedoEvent({graphics:[this.createGraphic].filter(o),tool:t})}}),e.on("cursor-update",t=>{this.createGraphic&&(this.createGraphic.geometry=e.unprocessedGeometry),(t.vertices[0]?.vertexIndex>0||t.vertices[0]?.componentIndex>0)&&this.emit("create",{graphic:this.createGraphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("complete",async({geometry:t,isSimple:o})=>{const i=this.createGraphic,a=!!t&&"mesh"!==t.type&&"extent"!==t.type&&!o;if(i&&(i.geometry=o?t:e.unprocessedGeometry??t),a&&i){this._internalGraphicsLayer.add(this.createGraphic);const e=new AbortController;this._drawToolSimplifyAbortController?.abort(),this._drawToolSimplifyAbortController=e,await this._updatingHandles.addPromise(u(this._finalizeDrawToolCompletion({abortController:e,geometry:t,graphic:i,handle:s})))}else s.complete()})],s=new le({activeComponent:e,type:"create",onEnd:()=>{n(r),i.tools.remove(e)},undo:()=>e.undo(),redo:()=>e.redo(),canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return r.push(e.on("cancel",()=>{this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),s.cancel()})),s}async _finalizeDrawToolCompletion({abortController:e,geometry:t,graphic:o,handle:i}){const a=this.view?.acquireCursor("progress","high");a&&this.addHandles(a);const r=()=>!!e.signal.aborted&&(o&&(this._layerAdapter?.remove(o),this._internalGraphicsLayer?.remove(o)),this._set("createGraphic",null),!0);try{const a=await this._geometryWorkerHandle.simplify(t,e.signal);if(r())return;o.geometry=a??t,this._internalGraphicsLayer?.remove(o),i.complete()}finally{a?.remove(),this._drawToolSimplifyAbortController===e&&(this._drawToolSimplifyAbortController=null)}}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol;case"text":return this.textSymbol}}async _setupUpdateOperation(e,t){const{view:o}=this;if(!o)return this._logMissingView(),null;const i={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};this.activeUpdateOptions=i;let a=i.tool??_e.tool;if(this.removeGraphics(e),this.addGraphics(e),"3d"===o.type){if(0===e.length)return null;switch(a){case"move":return this._setupMove3DOperation(e,i,o,a);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],i,o);case"transform":return this._setupGraphicTransform3DOperation(e,i,o)}}switch(a){case"move":return this._setupMove2DOperation(e,i,o);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,a,i,o);case"transform":return ge(e)&&(a="reshape"),this._setupTransformOrReshape2DOperation(e,a,i,o)}}async _setupMove3DOperation(e,t,o,i,a=!1){const r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(r))return r;const{ManipulatedObject3DGraphic:s,MoveTool3D:p}=r.module,l=new Map,h=()=>{l.forEach(e=>e.destroy()),l.clear()};for(const n of e){const e=new s({view:o,graphic:n}),t=K(e);if(0!==t)return h(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${W(t)}).`),null;l.set(n,e)}const d=new p({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(d),d.objects.addMany(Array.from(l.values())),a||this.updateGraphics.addMany(e);const c=[],u=new he({activeComponent:d,tool:i,type:"update",onEnd:()=>{n(c),ke(o,d),h()},undo:()=>{Me(this.view,d),Ce(u,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{Ae(u,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.push(e);const t=new s({view:o,graphic:e});l.set(e,t),d.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);if(u.history.undo.forEach(e=>e.updates.splice(t,1)),u.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void u.complete();const o=l.get(e);o&&(d.objects.remove(o),o.destroy(),l.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0),a=await this._updatingHandles.addPromise(this._setupReshape3DOperation(e,t,o,!0));a&&!Pe(a)&&(u.onEnd(),u.destroy(),this._setUpdateOperationHandle(a,t))}});return c.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(u,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(u,e)},z.WIDGET)),u}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&0===q(e[0])){const a=e[0],r=a.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:a,enableScaling:r,enableZ:s}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,d=new h({graphic:e,view:o}),c=new l({object:d,view:o,enableRotation:a,enableScaling:r,enableZ:s,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(c),this.updateGraphics.add(e);const u=[],m=new he({activeComponent:c,tool:i,type:"update",onEnd:()=>{n(u),ke(o,c),d.destroy()},undo:()=>{Me(this.view,c),Ce(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{Ae(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:async()=>{}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},z.WIDGET)),m}async _setupPolyTransform3DOperation(e,t,o,i=!1){const a="transform",{enableRotation:r,enableScaling:s,enableZ:p,preserveAspectRatio:l}=t,h=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(h))return h;const{ManipulatedObject3DGraphic:d,ExtentTransformTool:c}=h.module,u=this.view?.inputManager?.isModifierKeyDown(B.constraint),m=new d({view:o,graphic:e}),g=new c({object:m,view:o,enableRotation:r,enableScaling:s,enableZ:p,preserveAspectRatio:!!l!=!!u,toolOptions:this.sketchOptions});o.tools.add(g),i||this.updateGraphics.add(e);const y=[],v=new he({activeComponent:g,tool:a,type:"update",onEnd:()=>{n(y),ke(o,g),m.destroy()},canUndo:()=>!g.destroyed&&g.canUndo,undo:()=>{g.destroyed||(g.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},canRedo:()=>!g.destroyed&&g.canRedo,redo:()=>{g.destroyed||(g.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),v.onEnd(),v.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),v.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const i=await this._updatingHandles.addPromise(this._setupReshape3DOperation(e,t,o,!0));i&&!Pe(i)&&(v.onEnd(),v.destroy(),this._setUpdateOperationHandle(i,t))}});return y.push(...this._getHandlesForComponent(v,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(v,e,t),z.WIDGET),o.on("key-down",e=>this._getCommonUpdateOperationKeyDownHandlers(v,e),z.WIDGET),o.on("key-down",e=>{e.key!==B.constraint||e.repeat||(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},z.WIDGET),o.on("key-up",e=>{e.key===B.constraint&&(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},z.WIDGET)),v}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const a=await this._updatingHandles.addPromise(this._getGraphicMover(e,t,o));if(Pe(a))return a;const r=new he({activeComponent:a,tool:i,type:"update",onEnd:()=>{this._clearCursor(),n(l),n(p),a.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();Ce(r,e),r.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();Ae(r,e),r.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),a.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach(e=>e.updates.splice(t,1)),r.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?a.graphics=o:r.complete()}});let s=!1;const p=[o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(r,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key!==B.constraint||e.repeat||(s=!0,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)},z.WIDGET),o.on("key-up",e=>{e.key===B.constraint&&s&&(s=!1,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)},z.WIDGET)],l=this._getHandlesForComponent(r,t);return r}async _setupReshape3DOperation(e,t,o,i=!1){const a="reshape",r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(r))return r;const{ManipulatedObject3DGraphic:s,ReshapeTool3D:p}=r.module,l=new s({view:o,graphic:e}),h=Z(l);if(0!==h)return l.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${W(h)}).`),null;const d=t.reshapeOptions,c=new p({view:o,object:l,enableZVertex:t.enableZ&&"move"===d?.vertexOperation,enableZShape:t.enableZ&&"move"===d?.shapeOperation,enableMoveObject:"move"===d?.shapeOperation||"move-xy"===d?.shapeOperation,enableMidpoints:"split"===d?.edgeOperation,enableEdgeOffset:"offset"===d?.edgeOperation,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(c),i||this.updateGraphics.add(l.graphic);const u=[],m=new he({activeComponent:c,tool:a,type:"update",onEnd:()=>{n(u),ke(o,c),l.destroy()},canUndo:()=>!c.destroyed&&c.canUndo,undo:()=>{c.destroyed||(c.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},canRedo:()=>!c.destroyed&&c.canRedo,redo:()=>{c.destroyed||(c.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;m.onEnd(),m.destroy();const e=await this._updatingHandles.addPromise(this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0));Pe(e)||this._setUpdateOperationHandle(e,t)}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},z.WIDGET)),m}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const a=await this._updatingHandles.addPromise("transform"===t?this._getBox(e,o,i):this._getReshape(e,o,i));if(Pe(a))return a;const r=new he({activeComponent:a,type:"update",onEnd:()=>{n(p),n(s),r.activeComponent&&!r.activeComponent.destroyed&&r.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{Ce(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},redo:()=>{Ae(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},addToSelection:async e=>{let t=r.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),r.onEnd(),r.destroy();const a=await this._updatingHandles.addPromise(this._setupTransformOrReshape2DOperation(t,"transform",o,i));if(Pe(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),r.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach(e=>e.updates.splice(t,1)),r.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();0===o.length?r.complete():ge(o)?await r.toggleTool():r.activeComponent.graphics=o,this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===r.tool&&"point"===t.type||"transform"===r.tool&&"extent"===t.type))return;let a=null;const s={...this.defaultUpdateOptions,...o,...this.activeUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...o?.reshapeOptions,...this.activeUpdateOptions?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...o?.highlightOptions,...this.activeUpdateOptions?.highlightOptions}};"transform"===r.tool?a=await this._updatingHandles.addPromise(this._getReshape([e],s,i)):"reshape"===r.tool&&(a=await this._updatingHandles.addPromise(this._getBox([e],s,i))),Pe(a)||(r.activeComponent?.destroy(),r.activeComponent=a,r.activeComponent&&(n(p),p=this._getHandlesForComponent(r,s)))}}),s=[i.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(r,e,o),z.WIDGET),i.on("key-down",e=>{if(this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key===B.constraint&&!e.repeat&&r){const e=r.activeComponent;"box"===e?.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},z.WIDGET),i.on("key-up",e=>{if(e.key===B.constraint&&r){const e=r.activeComponent;"box"===e?.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},z.WIDGET)];let p=this._getHandlesForComponent(r,o);return r}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return Pe(r)?r:new r.module.default({enableMoveAllGraphics:i,highlightName:a?.name,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayCursor("grabbing"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayCursor("pointer"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayCursor("move"),onGraphicPointerOut:()=>this._clearCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:r,preserveAspectRatio:s}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(Pe(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(B.constraint),l=new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightName:r?.name,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!p,layer:this._internalGraphicsLayer,view:o,toolOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}});return l.addHandles(g(()=>[this.activeUpdateOptions?.enableRotation,this.activeUpdateOptions?.enableScaling],([e,o])=>{l.enableRotation=e??t.enableRotation??!0,l.enableScaling=o??t.enableScaling??!0,l.refresh()},y)),l}async _getReshape(e,t,o){const{highlightOptions:i,reshapeOptions:a}=t,r="split"===a?.edgeOperation,s="move"===a?.shapeOperation,n=!!a?.enableCreateCurveFromStraightEdge,p=await this._requireModule(import("../../views/draw/support/Reshape.js"));return Pe(p)?p:new p.module.default({enableMidpoints:r,enableMovement:s,enableCurveOnMidpoint:n,graphic:e[0],highlightName:i?.name,highlightsEnabled:!!i?.enabled,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,toolOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map(e=>H(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map(e=>H(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",({graphic:o,viewEvent:i})=>{i.native?.shiftKey&&t.multipleSelectionEnabled&&(i.stopPropagation(),this._updatingHandles.consumePromise(e.removeFromSelection(o)))}),o.on("graphic-move-start",t=>e.addToHistory(He(t.allGraphics)))];case"box":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(He(t.graphics))),o.on("rotate-start",t=>e.addToHistory(He(t.graphics))),o.on("scale-start",t=>e.addToHistory(He(t.graphics)))];case"reshape":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(He([t.mover]))),o.on("reshape-start",t=>e.addToHistory(He([t.graphic]))),o.on("vertex-add",t=>e.addToHistory(He([t.oldGraphic]))),o.on("vertex-remove",t=>e.addToHistory(He([t.oldGraphic])))];case"move-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("move-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})}),o.events.on("move-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})];case"transform-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("translate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})}),o.events.on("translate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})}),o.events.on("rotate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})}),o.events.on("rotate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})}),o.events.on("scale-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})}),o.events.on("scale-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})}),o.events.on("translate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})}),o.events.on("rotate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})}),o.events.on("scale",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})];case"reshape-3d":return[o.events.on("reshape",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("vertex-add",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("vertex-remove",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;if(a.native?.shiftKey&&this.hasGraphic(i))return a.stopPropagation(),void this._updatingHandles.consumePromise(e.removeFromSelection(i));t.toggleToolOnClick&&(a.stopPropagation(),this._updatingHandles.consumePromise(e.toggleTool()))}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}_getCommonUpdateOperationClickHandlers(e,t,o){return this._updatingHandles.addPromise(this._handleCommonUpdateOperationClick(e,t,o))}async _handleCommonUpdateOperationClick(e,t,o){const i=re(t),a=await t.defer(()=>this._getFirstHit(i));if(null==a)return void(this.cancelUpdateOnClickAway&&e.complete());const r=t.native.shiftKey?this._toggleSelection([a.graphic],e,o):null;if(r)return t.stopPropagation(),void await r;this.updateGraphics.includes(a.graphic)?this._shouldTemporarilyDisablePopup(o)&&t.stopPropagation():e.complete()}async _toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;for(const a of e)if(null!=a&&i&&this.hasGraphic(a))return this.updateGraphics.includes(a)?await t.removeFromSelection(a):await t.addToSelection(a)}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===B.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===B.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===B.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&B.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){this._operationHandle&&"update"===this._operationHandle.type&&null!=this.activeComponent&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=h(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_clearCursor(){this.removeHandles(be)}_displayCursor(e){this.removeHandles(be),this.view?.container&&null!=e&&this.addHandles(this.view.acquireCursor(e,"high"),be)}_logError(e,t,o){l.getLogger(this).error(new a(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}_onLayerGraphicsChangeCallback(e){if(null!=this._operationHandle){const{updateGraphics:t}=this;for(const o of e.removed)if(t.includes(o)){if(!(t.length>1)){this._operationHandle.cancel();break}this._updatingHandles.consumePromise(this._operationHandle.removeFromSelection(o))}}}async _setupAdvancedDrawToolIntegrationMaybe(){this.isUsingLegacyCreateTools||this.pluginManager.loaded||await this.pluginManager.loadPlugins()}async _setupDrawTool(e,o,i){if(this.isUsingLegacyCreateTools||!this._pluginManager)return null;const a=this.view,r=await(import("../../views/draw/DrawTool.js"));await this.pluginManager.loadPlugins();const s=await this.pluginManager.makeRenderer({customSymbol:o.graphicSymbol,useTextSymbol:"text"===i}),n=new r.DrawTool({view:a,elevationInfo:this._layerAdapter?.elevationInfo??I("3d"===a.type),hasZ:!!o.hasZ,toolOptions:this.sketchOptions,renderer:s,defaultZ:o.defaultZ??0,directionOptions:o.directionOptions,snappingManager:this.snappingManager,enableVertexVisuals:"rectangle"!==i&&"circle"!==i,readPluginSetting:(e,t)=>this.settingsManager.getValue(t)});n.addHandles(p(s));const l=new t({...o.graphicProperties,attributes:{...o.graphicProperties?.attributes},symbol:o.graphicSymbol??this._getGraphicSymbolFromTool(i)});return o.graphicSymbol||n.addHandles(g(()=>this._getGraphicSymbolFromTool(i),e=>l.symbol=e)),this._set("createGraphic",l),a.addAndActivateTool(n),n.begin(e),n}get test(){}wait(){return _(()=>!this.updating)}_shouldTemporarilyDisablePopup(e){return this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._shouldTemporarilyDisablePopup(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._shouldTemporarilyDisablePopup(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(d(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await m(_(()=>e?.ready),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",Oe("view"))}_logMissingLayer(){this._logError(Ge,Oe("layer"))}};e([b()],Te.prototype,"_defaultSnappingManager",void 0),e([b()],Te.prototype,"_layerAdapter",null),e([b()],Te.prototype,"_pluginManager",void 0),e([b({readOnly:!0})],Te.prototype,"settingsManager",void 0),e([b()],Te.prototype,"_operationHandle",void 0),e([b({readOnly:!0})],Te.prototype,"_updatingHandles",void 0),e([b({readOnly:!0})],Te.prototype,"_toolTransitionHandles",void 0),e([b()],Te.prototype,"_drawToolSimplifyAbortController",void 0),e([b({readOnly:!0})],Te.prototype,"activeTool",null),e([b()],Te.prototype,"geometrySimplificationInProgress",null),e([b({readOnly:!0})],Te.prototype,"activeCreateToolDrawMode",null),e([b()],Te.prototype,"activeTooltip",null),e([b({types:V})],Te.prototype,"activeFillSymbol",void 0),e([b()],Te.prototype,"activeLineSymbol",void 0),e([b()],Te.prototype,"activeVertexSymbol",void 0),e([b()],Te.prototype,"allowDeleteKey",void 0),e([b({readOnly:!0})],Te.prototype,"createGraphic",null),e([b()],Te.prototype,"defaultCreateOptions",null),e([b()],Te.prototype,"defaultUpdateOptions",null),e([b()],Te.prototype,"activeUpdateOptions",void 0),e([b({type:$,nonNullable:!0})],Te.prototype,"labelOptions",null),e([b()],Te.prototype,"layer",void 0),e([b({types:V})],Te.prototype,"pointSymbol",void 0),e([b({types:V})],Te.prototype,"polygonSymbol",void 0),e([b({types:V})],Te.prototype,"polylineSymbol",void 0),e([b()],Te.prototype,"meshSymbol",void 0),e([b({type:F})],Te.prototype,"textSymbol",null),e([b({type:ee,nonNullable:!0})],Te.prototype,"snappingOptions",null),e([b()],Te.prototype,"snappingManager",null),e([b({readOnly:!0})],Te.prototype,"state",null),e([b()],Te.prototype,"toolTransitionInProgress",null),e([b({type:J,nonNullable:!0})],Te.prototype,"tooltipOptions",null),e([b({readOnly:!0})],Te.prototype,"updateGraphics",void 0),e([b()],Te.prototype,"updateOnGraphicClick",void 0),e([b()],Te.prototype,"cancelUpdateOnClickAway",void 0),e([b()],Te.prototype,"updating",null),e([b()],Te.prototype,"creationMode",void 0),e([b({type:Q,nonNullable:!0})],Te.prototype,"valueOptions",null),e([b({types:V})],Te.prototype,"vertexSymbol",void 0),e([b({value:null})],Te.prototype,"view",null),e([b({constructOnly:!0,type:Y})],Te.prototype,"sketchOptions",void 0),e([b()],Te.prototype,"useLegacyCreateTools",void 0),e([b()],Te.prototype,"isUsingLegacyCreateTools",null),e([b()],Te.prototype,"pluginManager",null),e([b()],Te.prototype,"drawTool",null),e([b()],Te.prototype,"rootPlugins",null),e([b()],Te.prototype,"effectiveAvailablePlugins",null),e([b()],Te.prototype,"firstPluginWithSwappableLeaf",null),e([b()],Te.prototype,"multiplePluginsActive",null),Te=e([w("esri.widgets.Sketch.SketchViewModel")],Te);const Ge="sketch:missing-property",Oe=e=>`Property '${e}' is missing on SketchViewModel.`;function Se(e){return"polygon"===e||"rectangle"===e||"circle"===e}function Ce(e,t){Ee("undo",e.history.undo,e.history.redo,t)}function Ae(e,t){Ee("redo",e.history.redo,e.history.undo,t)}function Ee(e,t,o,i){const a=t.pop();if(!a)return;const r=a.updates,s=[];i.forEach((t,o)=>{const i=r[o];null!=i&&("geometry"in i&&null!=i.geometry&&(s.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(s.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(s.push(i),i[e](t)))}),o.push({updates:s})}function Me(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function He(e){return{updates:e.map(({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e})}}function ke(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function Pe(e){return"requireError"in e&&"aborted"===e.requireError}export{Te as default};
2
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{isSome as o}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as r}from"../../core/Evented.js";import{makeHandle as s,drainHandles as n,destroyHandle as p}from"../../core/handleUtils.js";import has from"../../core/has.js";import l from"../../core/Logger.js";import{destroyMaybe as h,abortMaybe as d}from"../../core/maybe.js";import{createAbortError as c,ignoreAbortErrors as u,whenOrAbort as m}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as y,on as v,when as f,whenOnce as _}from"../../core/reactiveUtils.js";import{property as b,subclass as w}from"../../core/accessorSupport/decorators.js";import{trackAccess as G}from"../../core/accessorSupport/tracking.js";import{SimpleObservable as T}from"../../core/accessorSupport/tracking/SimpleObservable.js";import{UpdatingHandles as O}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as S}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as C,isLoaded as A,load as E,project as M}from"../../geometry/projectionUtils.js";import{geometryToCoordinates as H}from"../../geometry/support/coordsUtils.js";import{equals as k}from"../../geometry/support/spatialReferenceUtils.js";import P from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as D}from"../../layers/support/layerUtils.js";import{getEffectiveElevationInfo as I}from"../../support/elevationInfoUtils.js";import U from"../../symbols/FillSymbol3DLayer.js";import j from"../../symbols/MeshSymbol3D.js";import R from"../../symbols/SimpleFillSymbol.js";import x from"../../symbols/SimpleLineSymbol.js";import L from"../../symbols/SimpleMarkerSymbol.js";import F from"../../symbols/TextSymbol.js";import{symbolTypes as V}from"../../symbols/support/typeUtils.js";import{isSupportedObjectResultMessage as W}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as K}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as Z}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as q}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as N}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as z}from"../../views/input/InputManager.js";import{sketchKeys as B}from"../../views/interactive/keybindings.js";import $ from"../../views/interactive/sketch/SketchLabelOptions.js";import Y from"../../views/interactive/sketch/SketchOptions.js";import J from"../../views/interactive/sketch/SketchTooltipOptions.js";import Q from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as X}from"../../views/interactive/snapping/SnappingManager.js";import ee from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as te}from"../../views/interactive/snapping/snappingUtils.js";import{GeometryWorkerHandle as oe}from"../../views/support/GeometryWorkerHandle.js";import{defaultHighlightName as ie}from"../../views/support/HighlightDefaults.js";import{findFirstGraphicHit as ae}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as re}from"../../views/support/screenUtils.js";import se from"./adapters/layer/GraphicsLayerAdapter.js";import ne from"./adapters/layer/MapNotesLayerAdapter.js";import{CreateOperationHandle as pe,DrawToolOperationHandle as le,UpdateOperationHandle as he}from"./support/OperationHandle.js";import{PluginManager as de}from"./support/PluginManager.js";import{SettingsManager as ce}from"./support/SettingsManager.js";import{getLegacyTool as ue,isCompletelyDegenerate as me,graphicsHaveTooFewVerticesForBox as ge,getModeFromCreateOptions as ye,getDrawToolGeometryTypeFromCreateTool as ve}from"./support/sketchUtils.js";const fe={defaultZ:0},_e={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move",enableCreateCurveFromStraightEdge:!0},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0,name:ie},tool:"transform"},be=Symbol(),we=Symbol();let Ge=class extends r{constructor(e){super(e),this._defaultSnappingManager=null,this._internalGraphicsLayer=new P({listMode:"hide",internal:!0,title:"SVM Internal"}),this._pluginManager=new de({sketchViewModel:this}),this.settingsManager=new ce({availablePlugins:()=>this.pluginManager.visiblePluginsFlat}),this._operationHandle=null,this._updatingHandles=new O,this._toolTransitionHandles=new O,this._drawToolSimplifyAbortController=null,this._geometryWorkerHandle=new oe,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.activeUpdateOptions=null,this.layer=null,this.pointSymbol=new L({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new R({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new x({color:[130,130,130,1],width:2}),this.meshSymbol=new j({symbolLayers:new i([new U])}),this.updateGraphics=new i,this.updateOnGraphicClick=!0,this.cancelUpdateOnClickAway=!0,this.creationMode="single",this.vertexSymbol=new L({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new Y,this.useLegacyCreateTools=!0,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._sketchContinuationFlag=!1,this._onLayerAdapterChange=async()=>{const{_layerAdapter:e}=this;if(this.removeHandles(we),!e)return;const t=[e.onGraphicsChange(e=>this._onLayerGraphicsChangeCallback(e)),g(()=>e.elevationInfo,e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer&&(this._internalGraphicsLayer.elevationInfo=e))},y)].filter(o);this.addHandles(t,we)},this._originalPopupEnabled=null,this.defaultCreateOptions=fe,this.defaultUpdateOptions=_e,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new ee,this.textSymbol=new F({text:"text"})}initialize(){this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe()),this.addHandles([v(()=>this.view?.map?.layers,"change",e=>{this.layer&&e.removed.includes(this.layer)&&this.cancel()}),g(()=>this._layerAdapter,()=>this._onLayerAdapterChange(),y),g(()=>this.view,e=>{this._defaultSnappingManager=h(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new X({view:e,options:this.snappingOptions})),"2d"===e.type?(import("../../views/2d/interactive/editingTools.js"),this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe())):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))},y),g(()=>this.view?.spatialReference,(e,t)=>{e&&t&&!e.equals(t)&&this.cancel()})]),te(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=h(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this._toolTransitionHandles.destroy(),this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),this._geometryWorkerHandle.destroy(),this._pluginManager?.destroy(),this.emit("destroy")}get _layerAdapter(){const{layer:e}=this;switch(e?.type){case"graphics":return new se(e);case"map-notes":return new ne(e);default:return null}}get activeTool(){return this._operationHandle?.tool??null}get geometrySimplificationInProgress(){return!!this._drawToolSimplifyAbortController}get activeCreateToolDrawMode(){const e=this._operationHandle;if("create"===e?.type&&e.activeComponent&&"mode"in e.activeComponent)return e.activeComponent.mode;if("draw-2.0"===e?.activeComponent?.type){const t=e.activeComponent.pluginStack.map(e=>e.configuration).filter(o).toArray();if(t.length>0)return this._pluginManager?.getDrawingModeEquivalentToPluginStack(t)}return null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...fe,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{..._e,...e,reshapeOptions:{..._e.reshapeOptions,...e?.reshapeOptions},highlightOptions:{..._e.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get textSymbol(){return this._get("textSymbol")}set textSymbol(e){this._set("textSymbol",e)}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=h(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new X({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get toolTransitionInProgress(){return this._toolTransitionHandles.updating||!!this.drawTool?.lifecycleManager.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get updating(){return this.toolTransitionInProgress||this.activeComponent&&"updating"in this.activeComponent&&this.activeComponent.updating||!!(this._updatingHandles.updating||this._drawToolSimplifyAbortController||this.snappingManager?.updating||this.drawTool?.updating)}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&this._clearCursor(),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(f(()=>e.ready,t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)},y),o),this._set("view",e),this._updatingHandles.consumePromise(this._setupAdvancedDrawToolIntegrationMaybe())}get isUsingLegacyCreateTools(){return this.useLegacyCreateTools||"2d"!==this.view?.type}get pluginManager(){return this._pluginManager}get drawTool(){return"draw-2.0"!==this.activeComponent?.type?null:this.activeComponent}get rootPlugins(){return this._pluginManager?.availablePlugins}set rootPlugins(e){this._overrideIfSome("rootPlugins",e)}get effectiveAvailablePlugins(){if(this.isUsingLegacyCreateTools)return null;const e=this.view?.type??"2d",{firstPluginWithSwappableLeaf:t}=this;return t?t.availableDownstreamPlugins.filter(t=>!t.excludedViews?.includes(e)):this.rootPlugins?.filter(t=>!t.excludedViews?.includes(e)).filter(o)??[]}get firstPluginWithSwappableLeaf(){const e=this.view?.type??"2d",t=this.drawTool?.pluginStack.toArray().map(e=>e.configuration).findLast(t=>null!=t&&!t.hidden&&t.availableDownstreamPlugins&&t.availableDownstreamPlugins.filter(t=>!t.excludedViews?.includes(e))?.length>1);return t}get multiplePluginsActive(){return!!this.drawTool&&this.drawTool.pluginStack.length>1}addGraphic(e){this._layerAdapter?.add(e)}addGraphics(e){this._layerAdapter?.addMany(e)}hasGraphic(e){return!!this._layerAdapter?.has(e)}removeGraphic(e){this._layerAdapter?.remove(e)}removeGraphics(e){this._layerAdapter?.removeMany(e)}removeAllGraphics(){this._layerAdapter?.removeAll()}cancel(){this._moduleLoaderAbortController=d(this._moduleLoaderAbortController),this._viewReadyAbortController=d(this._viewReadyAbortController),this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),this._sketchContinuationFlag=!0,this._operationHandle?.cancel()}complete(){this._operationHandle?.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e}=this,o=t.toArray();this.removeGraphics(o),this.cancel(),this._emitDeleteEvent({graphics:o,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map(e=>e.clone()).toArray();return this.addGraphics(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){return this._toolTransitionHandles.addPromise(this._create(e,t))}async _create(e,t){this.cancel(),await this._updatingHandles.addPromise(this._waitViewReady());const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),c();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");N(o,this._internalGraphicsLayer);const a=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==a||this.destroyed)return void o.map?.remove(this._internalGraphicsLayer);const r=ue(e),s=()=>{if(a===this._operationHandle){const o=this.createGraphic,i=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map?.remove(this._internalGraphicsLayer),a.cancelled||null==o||this.addGraphic(o),this._sketchContinuationFlag=!1,this.emit("create",{graphic:o,state:i?"cancel":"complete",tool:r??"point",toolEventInfo:null,type:"create"}),i||this._sketchContinuationFlag)return;const{creationMode:s}=this;if("continuous"===s){if(t?.geometryToPlace)return;this._updatingHandles.consumePromise(u(this.create(e,t)))}else"update"===s&&o&&this._updatingHandles.consumePromise(u(this.update([o])))}};a.on("complete",s),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return await e.load(),this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){return this._toolTransitionHandles.addPromise(this._update(e,t))}async _update(e,t){this.cancel(),await this._updatingHandles.addPromise(this._waitViewReady());const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),c();null!=i.activeTool&&(i.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some(e=>this.hasGraphic(e)?null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0):(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0)))return;const s=await this._updatingHandles.addPromise(this._setupUpdateOperation(r,t));this.destroyed||null==s||Pe(s)||(N(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||k(o.geometry.spatialReference,t.spatialReference)||(C(o.geometry.spatialReference,t.spatialReference)||A()||await E(),o.geometry=M(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._updatingHandles.consumePromise(this._operationHandle?.toggleTool())}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach(e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)});const i=await t.hitTest(e,{exclude:o});return ae(i.results)}const o=[t.map.ground];t.map.allLayers.forEach(e=>{!D(e)||has("enable-feature:im-as-ground")&&!e.isUsedAsGroundLayer||o.push(e)});const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?S(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))},z.WIDGET)]}async _handleImmediateClick(e){const t=await e.defer(()=>this._getFirstHit(re(e)));let o=null;if(null!=t){const i=t.graphic;this.updateGraphics.includes(i)||this.hasGraphic(i)?(e.stopPropagation(),o=i):"2d"!==this.view?.type||this._isComponentGraphic(i)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancelUpdateOnClickAway&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a="string"==typeof e?this.pluginManager?.getPluginsEquivalentToCreateTool(e,i.mode):e,r=ue(e);if(a&&!this.isUsingLegacyCreateTools){const e=await this._setupDrawTool(a,i,r??"polyline");if(e)return this._setupDrawToolOperationHandle(e,r??"point")}if(!r)return null;const s=await this._setupDrawGraphicTool(r,o,i);return null==s?null:(o.tools.add(s),o.activeTool=s,this._setupCreateOperationHandle(s,r))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=ye(p,e),d=ve(e),c=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=c?.preserveAspectRatio??l??"rectangle"!==e,m={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:i,defaultZ:a,forceUniformSize:u,graphicProperties:{...n,attributes:{...n?.attributes}},geometryToPlace:s,geometryType:d,mode:h,graphicSymbol:o.graphicSymbol??this._getGraphicSymbolFromTool(e),hasZ:r,snappingManager:this.snappingManager,snapToScene:!1,view:t,...c};return"2d"===t.type?this._makeDrawGraphicTool2D(m):this._makeDrawGraphicTool3D(m)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return Pe(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:Se(e.geometryType)?this.activeFillSymbol:null,toolOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));return Pe(t)||this.destroyed?null:new t.module.DrawGraphicTool3D({...e,elevationInfo:this._layerAdapter?.elevationInfo,snapToScene:!0,toolOptions:this.sketchOptions})}_setupCreateOperationHandle(e,t){const o=this.view;if(!o)return this._logMissingView(),null;let i=null;const a=e.forceUniformSize,r=e.centered,p=new T,l=[s(()=>p.destroy()),o.on("key-down",t=>{if(t.key===B.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===B.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==B.vertexAdd||t.repeat)t.key===B.undo?(t.stopPropagation(),h.undo()):t.key===B.redo?(t.stopPropagation(),h.redo()):t.key!==B.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===B.center&&(t.repeat||(e.centered=!r,t.stopPropagation())):(e.forceUniformSize=!a,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}},z.WIDGET),o.on("key-up",t=>{t.key===B.pan?e.enabled=!0:t.key!==B.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===B.center&&(e.centered=r,t.stopPropagation()):(e.forceUniformSize=a,t.stopPropagation())},z.WIDGET),e.on("vertex-update",()=>{p.notify()}),e.on("vertex-add",t=>{switch(p.notify(),i=null==i?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:i,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("cursor-update",t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("vertex-remove",t=>{switch(p.notify(),t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("complete",e=>{this._set("createGraphic",e.graphic),i="complete",e.aborted?h&&h.cancel():h&&h.complete()}),g(()=>this._getGraphicSymbolFromTool(t),t=>{e.graphicSymbol=t})],h=new pe({activeComponent:e,type:"create",onEnd:()=>{n(l),o.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>(G(p),e.canUndo),canRedo:()=>(G(p),e.canRedo)});return h}_setupDrawToolOperationHandle(e,t){const i=this.view;if(!i)return this._logMissingView(),null;let a=null;const r=[i.on("key-down",t=>{t.key===B.pan&&(t.stopPropagation(),t.repeat||(e.editable=!1))},z.WIDGET),i.on("key-up",t=>{t.key===B.pan&&(e.editable=!0)},z.WIDGET),e.on("before-vertex-add",t=>{const o=e.mostUpstreamPlugin?.configuration;if(o&&"legacyCreateTool"in o&&("point"===o?.legacyCreateTool||"text"===o.legacyCreateTool)){const e=t.detail.originalEvent;return void(e&&"key"in e&&e.key===B.vertexAdd&&t.preventDefault())}}),e.on("before-complete",t=>{const o=e.getGeometryIfCompleted();(!o||me(o))&&t.preventDefault()}),e.on(["vertex-add","vertex-remove"],i=>{switch(this.createGraphic&&(this.createGraphic.geometry=e.getGeometryIfCompleted()),a=null==a&&"vertex-remove"!==i.type?"start":"active",i.operation){case"apply":this.emit("create",{graphic:this.createGraphic,state:a,tool:this.activeTool,toolEventInfo:i,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[this.createGraphic].filter(o),tool:t});break;case"redo":this._emitRedoEvent({graphics:[this.createGraphic].filter(o),tool:t})}}),e.on("cursor-update",t=>{this.createGraphic&&(this.createGraphic.geometry=e.unprocessedGeometry),(t.vertices[0]?.vertexIndex>0||t.vertices[0]?.componentIndex>0)&&this.emit("create",{graphic:this.createGraphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("complete",async({geometry:t,isSimple:o})=>{const i=this.createGraphic,a=!!t&&"mesh"!==t.type&&"extent"!==t.type&&!o;if(i&&(i.geometry=o?t:e.unprocessedGeometry??t),a&&i){this._internalGraphicsLayer.add(this.createGraphic);const e=new AbortController;this._drawToolSimplifyAbortController?.abort(),this._drawToolSimplifyAbortController=e,await this._updatingHandles.addPromise(u(this._finalizeDrawToolCompletion({abortController:e,geometry:t,graphic:i,handle:s})))}else s.complete()})],s=new le({activeComponent:e,type:"create",onEnd:()=>{n(r),i.tools.remove(e)},undo:()=>e.undo(),redo:()=>e.redo(),canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return r.push(e.on("cancel",()=>{this._drawToolSimplifyAbortController=d(this._drawToolSimplifyAbortController),s.cancel()})),s}async _finalizeDrawToolCompletion({abortController:e,geometry:t,graphic:o,handle:i}){const a=this.view?.acquireCursor("progress","high");a&&this.addHandles(a);const r=()=>!!e.signal.aborted&&(o&&(this._layerAdapter?.remove(o),this._internalGraphicsLayer?.remove(o)),this._set("createGraphic",null),!0);try{const a=await this._geometryWorkerHandle.simplify(t,e.signal);if(r())return;o.geometry=a??t,this._internalGraphicsLayer?.remove(o),i.complete()}finally{a?.remove(),this._drawToolSimplifyAbortController===e&&(this._drawToolSimplifyAbortController=null)}}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol;case"text":return this.textSymbol}}async _setupUpdateOperation(e,t){const{view:o}=this;if(!o)return this._logMissingView(),null;const i={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};this.activeUpdateOptions=i;let a=i.tool??_e.tool;if(this.removeGraphics(e),this.addGraphics(e),"3d"===o.type){if(0===e.length)return null;switch(a){case"move":return this._setupMove3DOperation(e,i,o,a);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],i,o);case"transform":return this._setupGraphicTransform3DOperation(e,i,o)}}switch(a){case"move":return this._setupMove2DOperation(e,i,o);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,a,i,o);case"transform":return ge(e)&&(a="reshape"),this._setupTransformOrReshape2DOperation(e,a,i,o)}}async _setupMove3DOperation(e,t,o,i,a=!1){const r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(r))return r;const{ManipulatedObject3DGraphic:s,MoveTool3D:p}=r.module,l=new Map,h=()=>{l.forEach(e=>e.destroy()),l.clear()};for(const n of e){const e=new s({view:o,graphic:n}),t=K(e);if(0!==t)return h(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${W(t)}).`),null;l.set(n,e)}const d=new p({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(d),d.objects.addMany(Array.from(l.values())),a||this.updateGraphics.addMany(e);const c=[],u=new he({activeComponent:d,tool:i,type:"update",onEnd:()=>{n(c),ke(o,d),h()},undo:()=>{Me(this.view,d),Ce(u,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{Ae(u,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.push(e);const t=new s({view:o,graphic:e});l.set(e,t),d.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);if(u.history.undo.forEach(e=>e.updates.splice(t,1)),u.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void u.complete();const o=l.get(e);o&&(d.objects.remove(o),o.destroy(),l.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0),a=await this._updatingHandles.addPromise(this._setupReshape3DOperation(e,t,o,!0));a&&!Pe(a)&&(u.onEnd(),u.destroy(),this._setUpdateOperationHandle(a,t))}});return c.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(u,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(u,e)},z.WIDGET)),u}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&0===q(e[0])){const a=e[0],r=a.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:a,enableScaling:r,enableZ:s}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,d=new h({graphic:e,view:o}),c=new l({object:d,view:o,enableRotation:a,enableScaling:r,enableZ:s,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(c),this.updateGraphics.add(e);const u=[],m=new he({activeComponent:c,tool:i,type:"update",onEnd:()=>{n(u),ke(o,c),d.destroy()},undo:()=>{Me(this.view,c),Ce(m,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{Ae(m,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:async()=>{}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},z.WIDGET)),m}async _setupPolyTransform3DOperation(e,t,o,i=!1){const a="transform",{enableRotation:r,enableScaling:s,enableZ:p,preserveAspectRatio:l}=t,h=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(h))return h;const{ManipulatedObject3DGraphic:d,ExtentTransformTool:c}=h.module,u=this.view?.inputManager?.isModifierKeyDown(B.constraint),m=new d({view:o,graphic:e}),g=new c({object:m,view:o,enableRotation:r,enableScaling:s,enableZ:p,preserveAspectRatio:!!l!=!!u,toolOptions:this.sketchOptions});o.tools.add(g),i||this.updateGraphics.add(e);const y=[],v=new he({activeComponent:g,tool:a,type:"update",onEnd:()=>{n(y),ke(o,g),m.destroy()},canUndo:()=>!g.destroyed&&g.canUndo,undo:()=>{g.destroyed||(g.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},canRedo:()=>!g.destroyed&&g.canRedo,redo:()=>{g.destroyed||(g.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),v.onEnd(),v.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),v.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const i=await this._updatingHandles.addPromise(this._setupReshape3DOperation(e,t,o,!0));i&&!Pe(i)&&(v.onEnd(),v.destroy(),this._setUpdateOperationHandle(i,t))}});return y.push(...this._getHandlesForComponent(v,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(v,e,t),z.WIDGET),o.on("key-down",e=>this._getCommonUpdateOperationKeyDownHandlers(v,e),z.WIDGET),o.on("key-down",e=>{e.key!==B.constraint||e.repeat||(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},z.WIDGET),o.on("key-up",e=>{e.key===B.constraint&&(g.preserveAspectRatio=!g.preserveAspectRatio,e.stopPropagation())},z.WIDGET)),v}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const a=await this._updatingHandles.addPromise(this._getGraphicMover(e,t,o));if(Pe(a))return a;const r=new he({activeComponent:a,tool:i,type:"update",onEnd:()=>{this._clearCursor(),n(l),n(p),a.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();Ce(r,e),r.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();Ae(r,e),r.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),a.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach(e=>e.updates.splice(t,1)),r.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?a.graphics=o:r.complete()}});let s=!1;const p=[o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(r,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key!==B.constraint||e.repeat||(s=!0,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)},z.WIDGET),o.on("key-up",e=>{e.key===B.constraint&&s&&(s=!1,a.enableMoveAllGraphics=!a.enableMoveAllGraphics)},z.WIDGET)],l=this._getHandlesForComponent(r,t);return r}async _setupReshape3DOperation(e,t,o,i=!1){const a="reshape",r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(Pe(r))return r;const{ManipulatedObject3DGraphic:s,ReshapeTool3D:p}=r.module,l=new s({view:o,graphic:e}),h=Z(l);if(0!==h)return l.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${W(h)}).`),null;const d=t.reshapeOptions,c=new p({view:o,object:l,enableZVertex:t.enableZ&&"move"===d?.vertexOperation,enableZShape:t.enableZ&&"move"===d?.shapeOperation,enableMoveObject:"move"===d?.shapeOperation||"move-xy"===d?.shapeOperation,enableMidpoints:"split"===d?.edgeOperation,enableEdgeOffset:"offset"===d?.edgeOperation,snappingManager:this.snappingManager,toolOptions:this.sketchOptions});o.tools.add(c),i||this.updateGraphics.add(l.graphic);const u=[],m=new he({activeComponent:c,tool:a,type:"update",onEnd:()=>{n(u),ke(o,c),l.destroy()},canUndo:()=>!c.destroyed&&c.canUndo,undo:()=>{c.destroyed||(c.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},canRedo:()=>!c.destroyed&&c.canRedo,redo:()=>{c.destroyed||(c.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:a}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),m.onEnd(),m.destroy();const i=await this._updatingHandles.addPromise(this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0));Pe(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:async e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),m.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;m.onEnd(),m.destroy();const e=await this._updatingHandles.addPromise(this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0));Pe(e)||this._setUpdateOperationHandle(e,t)}});return u.push(...this._getHandlesForComponent(m,t),o.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(m,e,t),z.WIDGET),o.on("key-down",e=>{this._getCommonUpdateOperationKeyDownHandlers(m,e)},z.WIDGET)),m}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const a=await this._updatingHandles.addPromise("transform"===t?this._getBox(e,o,i):this._getReshape(e,o,i));if(Pe(a))return a;const r=new he({activeComponent:a,type:"update",onEnd:()=>{n(p),n(s),r.activeComponent&&!r.activeComponent.destroyed&&r.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{Ce(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},redo:()=>{Ae(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},addToSelection:async e=>{let t=r.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),r.onEnd(),r.destroy();const a=await this._updatingHandles.addPromise(this._setupTransformOrReshape2DOperation(t,"transform",o,i));if(Pe(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),r.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach(e=>e.updates.splice(t,1)),r.history.redo.forEach(e=>e.updates.splice(t,1)),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();0===o.length?r.complete():ge(o)?await r.toggleTool():r.activeComponent.graphics=o,this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===r.tool&&"point"===t.type||"transform"===r.tool&&"extent"===t.type))return;let a=null;const s={...this.defaultUpdateOptions,...o,...this.activeUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...o?.reshapeOptions,...this.activeUpdateOptions?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...o?.highlightOptions,...this.activeUpdateOptions?.highlightOptions}};"transform"===r.tool?a=await this._updatingHandles.addPromise(this._getReshape([e],s,i)):"reshape"===r.tool&&(a=await this._updatingHandles.addPromise(this._getBox([e],s,i))),Pe(a)||(r.activeComponent?.destroy(),r.activeComponent=a,r.activeComponent&&(n(p),p=this._getHandlesForComponent(r,s)))}}),s=[i.on("immediate-click",e=>this._getCommonUpdateOperationClickHandlers(r,e,o),z.WIDGET),i.on("key-down",e=>{if(this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key===B.constraint&&!e.repeat&&r){const e=r.activeComponent;"box"===e?.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},z.WIDGET),i.on("key-up",e=>{if(e.key===B.constraint&&r){const e=r.activeComponent;"box"===e?.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}},z.WIDGET)];let p=this._getHandlesForComponent(r,o);return r}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return Pe(r)?r:new r.module.default({enableMoveAllGraphics:i,highlightName:a?.name,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayCursor("grabbing"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayCursor("pointer"),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayCursor("move"),onGraphicPointerOut:()=>this._clearCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:r,preserveAspectRatio:s}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(Pe(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(B.constraint),l=new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightName:r?.name,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!p,layer:this._internalGraphicsLayer,view:o,toolOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}});return l.addHandles(g(()=>[this.activeUpdateOptions?.enableRotation,this.activeUpdateOptions?.enableScaling],([e,o])=>{l.enableRotation=e??t.enableRotation??!0,l.enableScaling=o??t.enableScaling??!0,l.refresh()},y)),l}async _getReshape(e,t,o){const{highlightOptions:i,reshapeOptions:a}=t,r="split"===a?.edgeOperation,s="move"===a?.shapeOperation,n=!!a?.enableCreateCurveFromStraightEdge,p=await this._requireModule(import("../../views/draw/support/Reshape.js"));return Pe(p)?p:new p.module.default({enableMidpoints:r,enableMovement:s,enableCurveOnMidpoint:n,graphic:e[0],highlightName:i?.name,highlightsEnabled:!!i?.enabled,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,toolOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map(e=>H(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map(e=>H(e.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",({graphic:o,viewEvent:i})=>{i.native?.shiftKey&&t.multipleSelectionEnabled&&(i.stopPropagation(),this._updatingHandles.consumePromise(e.removeFromSelection(o)))}),o.on("graphic-move-start",t=>e.addToHistory(He(t.allGraphics)))];case"box":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(He(t.graphics))),o.on("rotate-start",t=>e.addToHistory(He(t.graphics))),o.on("scale-start",t=>e.addToHistory(He(t.graphics)))];case"reshape":return[o.on("graphic-click",o=>this._onTransformOrReshape2DGraphicClick(e,t,o)),o.on("move-start",t=>e.addToHistory(He([t.mover]))),o.on("reshape-start",t=>e.addToHistory(He([t.graphic]))),o.on("vertex-add",t=>e.addToHistory(He([t.oldGraphic]))),o.on("vertex-remove",t=>e.addToHistory(He([t.oldGraphic])))];case"move-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("move-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})}),o.events.on("move-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})];case"transform-3d":return[o.events.on("record-undo",({updates:t})=>{e.addToHistory({updates:t})}),o.events.on("translate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})}),o.events.on("translate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})}),o.events.on("rotate-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})}),o.events.on("rotate-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})}),o.events.on("scale-start",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})}),o.events.on("scale-stop",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})}),o.events.on("translate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})}),o.events.on("rotate",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})}),o.events.on("scale",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})];case"reshape-3d":return[o.events.on("reshape",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("move",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})}),o.events.on("vertex-add",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("vertex-remove",e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})}),o.events.on("immediate-click",o=>{this._updatingHandles.consumePromise(o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool())})]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;if(a.native?.shiftKey&&this.hasGraphic(i))return a.stopPropagation(),void this._updatingHandles.consumePromise(e.removeFromSelection(i));t.toggleToolOnClick&&(a.stopPropagation(),this._updatingHandles.consumePromise(e.toggleTool()))}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}_getCommonUpdateOperationClickHandlers(e,t,o){return this._updatingHandles.addPromise(this._handleCommonUpdateOperationClick(e,t,o))}async _handleCommonUpdateOperationClick(e,t,o){const i=re(t),a=await t.defer(()=>this._getFirstHit(i));if(null==a)return void(this.cancelUpdateOnClickAway&&e.complete());const r=t.native.shiftKey?this._toggleSelection([a.graphic],e,o):null;if(r)return t.stopPropagation(),void await r;this.updateGraphics.includes(a.graphic)?this._shouldTemporarilyDisablePopup(o)&&t.stopPropagation():e.complete()}async _toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;for(const a of e)if(null!=a&&i&&this.hasGraphic(a))return this.updateGraphics.includes(a)?await t.removeFromSelection(a):await t.addToSelection(a)}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===B.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===B.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===B.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&B.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){this._operationHandle&&"update"===this._operationHandle.type&&null!=this.activeComponent&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=h(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_clearCursor(){this.removeHandles(be)}_displayCursor(e){this.removeHandles(be),this.view?.container&&null!=e&&this.addHandles(this.view.acquireCursor(e,"high"),be)}_logError(e,t,o){l.getLogger(this).error(new a(e,t,o))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}_onLayerGraphicsChangeCallback(e){if(null!=this._operationHandle){const{updateGraphics:t}=this;for(const o of e.removed)if(t.includes(o)){if(!(t.length>1)){this._operationHandle.cancel();break}this._updatingHandles.consumePromise(this._operationHandle.removeFromSelection(o))}}}async _setupAdvancedDrawToolIntegrationMaybe(){this.isUsingLegacyCreateTools||this.pluginManager.loaded||await this.pluginManager.loadPlugins()}async _setupDrawTool(e,o,i){if(this.isUsingLegacyCreateTools||!this._pluginManager)return null;const a=this.view,r=await(import("../../views/draw/DrawTool.js"));await this.pluginManager.loadPlugins();const s=await this.pluginManager.makeRenderer({customSymbol:o.graphicSymbol,useTextSymbol:"text"===i}),n=new r.DrawTool({view:a,elevationInfo:this._layerAdapter?.elevationInfo??I("3d"===a.type),hasZ:!!o.hasZ,toolOptions:this.sketchOptions,renderer:s,defaultZ:o.defaultZ??0,directionOptions:o.directionOptions,snappingManager:this.snappingManager,enableVertexVisuals:"rectangle"!==i&&"circle"!==i,readPluginSetting:(e,t)=>this.settingsManager.getValue(t)});n.addHandles(p(s));const l=new t({...o.graphicProperties,attributes:{...o.graphicProperties?.attributes},symbol:o.graphicSymbol??this._getGraphicSymbolFromTool(i)});return o.graphicSymbol||n.addHandles(g(()=>this._getGraphicSymbolFromTool(i),e=>l.symbol=e)),this._set("createGraphic",l),a.addAndActivateTool(n),n.begin(e),n}get test(){}wait(){return _(()=>!this.updating)}_shouldTemporarilyDisablePopup(e){return this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._shouldTemporarilyDisablePopup(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._shouldTemporarilyDisablePopup(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(d(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await m(_(()=>e?.ready),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",Oe("view"))}_logMissingLayer(){this._logError(Te,Oe("layer"))}};e([b()],Ge.prototype,"_defaultSnappingManager",void 0),e([b()],Ge.prototype,"_layerAdapter",null),e([b()],Ge.prototype,"_pluginManager",void 0),e([b({readOnly:!0})],Ge.prototype,"settingsManager",void 0),e([b()],Ge.prototype,"_operationHandle",void 0),e([b({readOnly:!0})],Ge.prototype,"_updatingHandles",void 0),e([b({readOnly:!0})],Ge.prototype,"_toolTransitionHandles",void 0),e([b()],Ge.prototype,"_drawToolSimplifyAbortController",void 0),e([b({readOnly:!0})],Ge.prototype,"activeTool",null),e([b()],Ge.prototype,"geometrySimplificationInProgress",null),e([b({readOnly:!0})],Ge.prototype,"activeCreateToolDrawMode",null),e([b()],Ge.prototype,"activeTooltip",null),e([b({types:V})],Ge.prototype,"activeFillSymbol",void 0),e([b()],Ge.prototype,"activeLineSymbol",void 0),e([b()],Ge.prototype,"activeVertexSymbol",void 0),e([b()],Ge.prototype,"allowDeleteKey",void 0),e([b({readOnly:!0})],Ge.prototype,"createGraphic",null),e([b()],Ge.prototype,"defaultCreateOptions",null),e([b()],Ge.prototype,"defaultUpdateOptions",null),e([b()],Ge.prototype,"activeUpdateOptions",void 0),e([b({type:$,nonNullable:!0})],Ge.prototype,"labelOptions",null),e([b()],Ge.prototype,"layer",void 0),e([b({types:V})],Ge.prototype,"pointSymbol",void 0),e([b({types:V})],Ge.prototype,"polygonSymbol",void 0),e([b({types:V})],Ge.prototype,"polylineSymbol",void 0),e([b()],Ge.prototype,"meshSymbol",void 0),e([b({type:F})],Ge.prototype,"textSymbol",null),e([b({type:ee,nonNullable:!0})],Ge.prototype,"snappingOptions",null),e([b()],Ge.prototype,"snappingManager",null),e([b({readOnly:!0})],Ge.prototype,"state",null),e([b()],Ge.prototype,"toolTransitionInProgress",null),e([b({type:J,nonNullable:!0})],Ge.prototype,"tooltipOptions",null),e([b({readOnly:!0})],Ge.prototype,"updateGraphics",void 0),e([b()],Ge.prototype,"updateOnGraphicClick",void 0),e([b()],Ge.prototype,"cancelUpdateOnClickAway",void 0),e([b()],Ge.prototype,"updating",null),e([b()],Ge.prototype,"creationMode",void 0),e([b({type:Q,nonNullable:!0})],Ge.prototype,"valueOptions",null),e([b({types:V})],Ge.prototype,"vertexSymbol",void 0),e([b({value:null})],Ge.prototype,"view",null),e([b({constructOnly:!0,type:Y})],Ge.prototype,"sketchOptions",void 0),e([b()],Ge.prototype,"useLegacyCreateTools",void 0),e([b()],Ge.prototype,"isUsingLegacyCreateTools",null),e([b()],Ge.prototype,"pluginManager",null),e([b()],Ge.prototype,"drawTool",null),e([b()],Ge.prototype,"rootPlugins",null),e([b()],Ge.prototype,"effectiveAvailablePlugins",null),e([b()],Ge.prototype,"firstPluginWithSwappableLeaf",null),e([b()],Ge.prototype,"multiplePluginsActive",null),Ge=e([w("esri.widgets.Sketch.SketchViewModel")],Ge);const Te="sketch:missing-property",Oe=e=>`Property '${e}' is missing on SketchViewModel.`;function Se(e){return"polygon"===e||"rectangle"===e||"circle"===e}function Ce(e,t){Ee("undo",e.history.undo,e.history.redo,t)}function Ae(e,t){Ee("redo",e.history.redo,e.history.undo,t)}function Ee(e,t,o,i){const a=t.pop();if(!a)return;const r=a.updates,s=[];i.forEach((t,o)=>{const i=r[o];null!=i&&("geometry"in i&&null!=i.geometry&&(s.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(s.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(s.push(i),i[e](t)))}),o.push({updates:s})}function Me(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function He(e){return{updates:e.map(({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e})}}function ke(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function Pe(e){return"requireError"in e&&"aborted"===e.requireError}export{Ge as default};
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export type InputValidationError = "input-validation-error::cannot-be-empty" | "length-validation-error::too-short" | "length-validation-error::too-long" | "multiple-choice-validation-error::too-few-selected-choices" | "multiple-choice-validation-error::too-many-selected-choices";
3
+
4
+ /** @internal */
5
+ export type ContingentValuesValidationError = "contingent-values-validation-error::contingency-violation-warning" | "contingent-values-validation-error::contingency-violation-error";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=i;if(null==t)return f?"text"===o&&c?"multiple-choice-validation-error::too-few-selected-choices":"input-validation-error::cannot-be-empty":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||r({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!!(l(t)&&l(e)||Number.isNaN(t)&&Number.isNaN(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;const o=c(n.length);if(!r||!t(r))return o;const u=c(r.maxLength);return u===i?o:o===i?u:Math.min(o,u)}function s({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;if(!r||!t(r))return i;const o=c(r.minLength);if(o<0)return i;const u=c(n.length);return u>i&&u<o?i:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{i as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};
2
+ import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as n}from"../../../layers/support/domainUtils.js";import{NumericRangeValidationError as e,validateFieldValue as i}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const o={CANNOT_BE_EMPTY:"input-validation-error::cannot-be-empty",TOO_SHORT:"length-validation-error::too-short",TOO_LONG:"length-validation-error::too-long",TOO_FEW_SELECTED_CHOICES:"multiple-choice-validation-error::too-few-selected-choices",TOO_MANY_SELECTED_CHOICES:"multiple-choice-validation-error::too-many-selected-choices"},u={CONTINGENCY_VIOLATION_WARNING:"contingent-values-validation-error::contingency-violation-warning",CONTINGENCY_VIOLATION_ERROR:"contingent-values-validation-error::contingency-violation-error"},a=(t,n)=>{if(!t)return!0;const{operations:e}=t;switch(n){case"INSERT":return e.supportsAdd;case"UPDATE":case"DELETE":return e.supportsUpdate;default:return!0}};function l(t,u){const{dataType:a,domain:l,field:s,maxLength:c,minLength:m,multipleChoice:O,range:f,required:p}=u;if(null==t)return p?"text"===a&&O?o.TOO_FEW_SELECTED_CHOICES:o.CANNOT_BE_EMPTY:null;if("text"===a&&"string"==typeof t){if(m>-1&&t.length<m)return o.TOO_SHORT;if(c>-1&&t.length>c)return o.TOO_LONG;if(O){const n=_(t,O.choiceDelimiter);if(null!=O.maximumChoices&&n>O.maximumChoices)return o.TOO_MANY_SELECTED_CHOICES;if(null!=O.minimumChoices&&n<O.minimumChoices)return o.TOO_FEW_SELECTED_CHOICES}}return"date"!==a||r({type:s.type,range:f,value:t})?l?n(s,t,l):i(s,t):e.OUT_OF_RANGE}function s(t,n){return!!(c(t)&&c(n)||Number.isNaN(t)&&Number.isNaN(n))||t===n}function c(t){return null==t||""===t}function m({dataType:n,field:e,input:i}){const r=-1;if("date"===n)return r;const o=f(e.length);if(!i||!t(i))return o;const u=f(i.maxLength);return u===r?o:o===r?u:Math.min(o,u)}function O({dataType:n,field:e,input:i}){const r=-1;if("date"===n)return r;if(!i||!t(i))return r;const o=f(i.minLength);if(o<0)return r;const u=f(e.length);return u>r&&u<o?r:o}function f(t){return"number"==typeof t&&t>-1?t:-1}const p={type:"number"},E={type:"number",intlOptions:{notation:"scientific"}};function T(t){return t>=1e7||t<=-1e7}function d(t,n){return null!=t.max&&null!=t.min?n.outsideRange:null!=t.max?n.outsideRangeMax:n.outsideRangeMin}const N=t=>t&&!Number.isNaN(t.valueOf());function _(t,n){return""===t?0:t.split(n).map(t=>t.trim()).filter(t=>""!==t).length}export{u as ContingentValuesValidationError,o as InputValidationError,a as capabilitiesAllowEditType,N as dateIsValid,f as ensureMinOrMaxLength,m as getMaxLength,O as getMinLength,d as getRangeErrorMessage,c as isEmptyValue,p as numberFormatOptions,E as scientificNumberFormatOptions,T as shouldUseScientificNotation,l as validateFormValue,s as valuesAreEquivalent};
@@ -1,5 +1,11 @@
1
+ import type { FieldValueValidationError } from "../../../layers/support/fieldUtils.js";
2
+ import type { ContingentValuesValidationError, InputValidationError } from "./formUtils.js";
3
+
1
4
  /** @since 5.0 */
2
5
  export type FieldInputDataTypes = "text" | "number" | "date" | "unsupported";
3
6
 
4
7
  /** @since 5.0 */
5
- export type EditType = "INSERT" | "UPDATE" | "DELETE" | "NA";
8
+ export type EditType = "INSERT" | "UPDATE" | "DELETE" | "NA";
9
+
10
+ /** @internal */
11
+ export type FormValidationError = FieldValueValidationError | InputValidationError | ContingentValuesValidationError;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e={danger:"exclamation-mark-circle",info:"information",neutral:void 0,success:"check",warning:"exclamation-mark-triangle",brand:void 0};function r(e){if(null==e||"object"!=typeof e)return"layer";if("isTable"in e&&e.isTable)return"table";if("type"in e){if("feature"===e.type)return"feature-layer";if("group"===e.type)return"layers";if("subtype-group"===e.type)return"subtype";if("knowledge-graph"===e.type)return"knowledge-layer";if("link-chart"===e.type)return"knowledge-graph";if("graphics"===e.type)return"layer-graphics"}return"layer"}const t=e=>{const r=e.layer,t=r&&"geometryType"in r?r.geometryType:void 0,n=e.geometry?.type;return"polyline"===n||"polyline"===t?"line":"mesh"===n||"mesh"===t||"multipatch"===t?"cube":"multipoint"===n||"multipoint"===t?"point":n||t||"table"};export{t as getIconForFeature,r as getIconForLayer,e as iconByKind};
2
+ const e={danger:"exclamation-mark-circle",info:"information",neutral:void 0,success:"check",warning:"exclamation-mark-triangle",brand:void 0};function r(e){if(null==e||"object"!=typeof e)return"layer";if("isTable"in e&&e.isTable)return"table";if(!("type"in e))return"layer";switch(e.type){case"feature":return"feature-layer";case"graphics":return"layer-graphics";case"group":return"layers";case"subtype-group":return"subtype";case"csv":return"layer-csv";case"geojson":return"layer-geojson";case"map-notes":return"layer-map-notes";case"knowledge-graph":return"knowledge-layer";case"link-chart":return"knowledge-graph";case"annotation-feature":return"layer-annotation";case"dimension-feature":return"layer-dimension";case"wfs":return"layer-wfs";default:return"layer"}}function n(e){const r=e.layer,n=r&&"geometryType"in r?r.geometryType:void 0,a=e.geometry?.type;return"polyline"===a||"polyline"===n?"line":"mesh"===a||"mesh"===n||"multipatch"===n?"cube":"multipoint"===a||"multipoint"===n?"point":a||n||"table"}export{n as getIconForFeature,r as getIconForLayer,e as iconByKind};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4708],{69052(e,t,n){n.d(t,{hr:()=>r});var s=n(34727);class r{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return o(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,s.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+i(this.range,e-t,n)}minimalMonotonic(e,t,n){return o(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,s=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(s)?n:s}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function o(e,t,n,s,r=0,o=!1){return(s-=r)<t?s+=i(e,t-s):s>n&&(s-=i(e,s-n)),o&&s===n&&(s=t),s+r}function i(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const a=new r(0,2*Math.PI),c=(new r(-Math.PI,Math.PI),new r(0,360));n.d(t,["ie",0,c,"uC",0,a])},18370(e,t,n){n.d(t,{z:()=>r});class s{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function r(e){return new s(e)}},52039(e,t,n){n.d(t,{O7:()=>h,el:()=>c});var s=n(69052),r=(n(49186),n(18370)),o=n(17676),i=(n(5443),n(39829),n(82799),n(16930)),a=(n(80754),n(21325));async function c(e,t,n){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(n=t);let s=null;for(const t of e)s??=t?.spatialReference;if(!s)return e;const r=(0,a.Vp)(s);if(!r)return e;const[i,c]=r.valid;let h=!1;for(const t of e){if(!t)continue;if("point"===t.type){h||=t.x>=c,h||=t.x<=i;continue}const{extent:e}=t;if(null==e){h=!0;break}h||=e.xmin>=c,h||=e.xmin<=i,h||=e.xmax>=c,h||=e.xmax<=i}if(!h)return e;const[{foldInto360Range:f},d]=await(0,o.qr)(Promise.all([u.getImportPromise(),l.getImportPromise()]),n),g=d.fromSpatialReference(s);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=d.fromGeometry(e),n=d.toGeometry(f(t,g),s);return"extent"===e.type&&1===n?.rings.length?n.extent:n})}const u=(0,r.z)(()=>n.e(4144).then(()=>n(4144)).then(e=>e.load().then(()=>e))),l=(0,r.z)(()=>Promise.all([n.e(9187),n.e(8885),n.e(9117),n.e(3299),n.e(1550)]).then(()=>n(78125)));function h(e,t,n){const s=(0,a.Vp)(n);if(null==s)return e;const[r,o]=s.valid,i=2*o;let c=0,u=0;t>o?c=Math.ceil(Math.abs(t-o)/i):t<r&&(c=-Math.ceil(Math.abs(t-r)/i)),e>o?u=Math.ceil(Math.abs(e-o)/i):e<r&&(u=-Math.ceil(Math.abs(e-r)/i));let l=e+(c-u)*i;const h=l-t;return h>o?l-=i:h<r&&(l+=i),l}function f(e){const t=(0,a.Vp)(e);if(null==t)return null;const[n,r]=t.valid;return new s.hr(n,r)}const d=f(i.A.WGS84);f(i.A.WebMercator),n.d(t,["Y_",0,d])},80754(e,t,n){n.d(t,{kS:()=>u,kd:()=>c});var s=n(82799),r=n(16930),o=n(60408),i=n(52006);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new s.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator}),minus180Line:new s.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new s.A({paths:[[[180,-180],[180,180]]],spatialReference:r.A.WGS84}),minus180Line:new s.A({paths:[[[-180,-180],[-180,180]]],spatialReference:r.A.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){if((0,i.Ed)(e))for(const n of function(e){return(0,o.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of n){if((0,i.aO)(e)){const[n,s]=e.c;n[0]+=t,s[0]+=t;continue}if((0,i.FG)(e)){const[n,s]=e.a;n[0]+=t,s[0]+=t;continue}if((0,i.n1)(e)){const[n,s,r]=e.b;n[0]+=t,s[0]+=t,r[0]+=t;continue}e[0]+=t}for(const n of function(e){return(0,o.Bi)(e)?e.rings:e.paths}(e))for(const e of n)e[0]+=t;return e}n.d(t,["j7",0,a])},31464(e,t,n){n.d(t,{Cv:()=>d,Nk:()=>f,lK:()=>m});var s=n(4576),r=n(99917),o=n(60408),i=n(21325),a=n(28735);const c=[0,0];function u(e,t){const n=(0,i.K8)(e)?a.je:a.tD;if((0,o.fT)(t)){const e={x:0,y:0};return[e.x,e.y]=n(t.x,t.y,c),null!=t.z&&(e.z=t.z),null!=t.m&&(e.m=t.m),e}if((0,o.ZC)(t)){const e={xmin:0,ymin:0,xmax:0,ymax:0};return[e.xmin,e.ymin]=n(t.xmin,t.ymin,c),[e.xmax,e.ymax]=n(t.xmax,t.ymax,c),t.hasZ&&(e.zmin=t.zmin,e.zmax=t.zmax,e.hasZ=!0),t.hasM&&(e.mmin=t.mmin,e.mmax=t.mmax,e.hasM=!0),e}if((0,o.Bi)(t))return{rings:l(t.rings,n),hasM:t.hasM,hasZ:t.hasZ};if((0,o.Rg)(t))return{paths:l(t.paths,n),hasM:t.hasM,hasZ:t.hasZ};if((0,o.U9)(t))return{points:h(t.points,n),hasM:t.hasM,hasZ:t.hasZ};throw new Error}function l(e,t){const n=[];for(const s of e)n.push(h(s,t));return n}function h(e,t){const n=[];for(const s of e){const e=t(s[0],s[1],[0,0]);n.push(e),s.length>2&&e.push(s[2]),s.length>3&&e.push(s[3])}return n}async function f(e,t){if(!e||!t)return;const n=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(s.Ru):[e];await(0,r.initializeProjection)(n.map(e=>({source:e,dest:t})))}function d(e,t,n,s){if(!e)return null;if(n||(n=t,t=e.spatialReference),!(0,i.fn)(t)||!(0,i.fn)(n)||(0,i.aI)(t,n))return e;if((0,a.y7)(t,n)){const t=u(n,e);return t.spatialReference=n,t}return(0,r.projectMany)([e],t,n,s)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,n,s){if(!e?.length||!t||!n||(0,i.aI)(t,n))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:n,options:s,resolve:Promise.withResolvers()};return this._jobs.push(r),this._timer??=setTimeout(this._process,10),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:n,outSpatialReference:s,resolve:o,options:i}=e,c=t.filter(e=>null!=e);let l;l=(0,a.y7)(n,s)&&null==i?.extendedParams?c.map(e=>u(s,e)):(0,r.projectMany)(c,n,s,i);let h=0;const f=t.map(e=>null==e?null:l[h++]);o.resolve(f),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function m(e,t,n,s){return g.push(e,t,n,s)}},60986(e,t,n){n.r(t),n.d(t,{createConnection:()=>C});var s=n(56507),r=n(49186),o=n(31464),i=n(9916),a=n(32198),c=n(65529),u=n(91429);let l=class extends c.nJ{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new r.A("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,a.Cg)([(0,u.MZ)({readOnly:!0})],l.prototype,"connectionError",null),l=(0,a.Cg)([(0,u.$K)("esri.layers.support.StreamConnection")],l);class h extends l{constructor(e,t){super(),this._config=e,this._outSpatialReference=t,this.connectionStatus="connected",this.errorString=null,this._isPolling=!1,this._lastIngestedAt=null,this._pollTimer=null,this._pollRecentData=async()=>{if(!this.destroyed&&!this._isPolling){this._isPolling=!0;try{const e=await this._queryChanges(this._lastIngestedAt);if(this.destroyed)return;this._handleResult(e)}catch(e){this.errorString=e instanceof Error?e.message:"Failed to fetch"}finally{this._isPolling=!1}}},this._initialize()}destroy(){super.destroy(),this._pollTimer&&(clearInterval(this._pollTimer),this._pollTimer=null)}sendMessageToSocket(e){throw new r.A("kusto:unsupported","sendMessageToSocket not supported for Kusto connections")}sendMessageToClient(e){throw new r.A("kusto:unsupported","sendMessageToClient not supported for Kusto connections")}updateCustomParameters(e){throw new r.A("kusto:unsupported","updateCustomParameters not supported for Kusto connections")}async _initialize(){await(0,o.Nk)(this._config.sourceSpatialReference,this._outSpatialReference);try{const e=await this._queryInitial();this._handleResult(e),this._pollTimer=setInterval(this._pollRecentData,6e4*this._config.refreshInterval)}catch{throw new r.A("kusto:connection","Failed to query KQL database")}}async _queryInitial(){const{trackIdField:e}=this._config,t=f(await this._executeQuery(`${(0,i.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | summarize arg_max(IngestedAt, *) by ${(0,i.xw)(e)}`));if(!t)throw new r.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(t),table:t}}async _queryChanges(e=null){const t=e??"1970-01-01T00:00:00Z",n=f(await this._executeQuery(`${(0,i.xw)(this._config.table)} | extend IngestedAt = ingestion_time() | where IngestedAt > todatetime('${(0,i.iD)(t)}') | order by IngestedAt asc`));if(!n)throw new r.A("kusto:connection","Unable to find primaryTable");return{ingestedAt:d(n),table:n}}async _executeQuery(e){const t=this._config.database,n=t.properties.queryServiceUri,{data:r}=await(0,s.A)(`${n}/v2/rest/query`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:t.displayName,csl:e})});return r}_handleResult(e){this._lastIngestedAt=e.ingestedAt;const t=this._createFeatures(e.table);if(null!=t){this.onMessage(t);for(const e of t)this.onFeature(e)}}_createFeatures(e){if(null==e||0===e.Rows.length)return null;const{xField:t,yField:n}=this._config.geometryEncoding,s=e.Columns.findIndex(e=>e.ColumnName===t),r=e.Columns.findIndex(e=>e.ColumnName===n);return e.Rows.map(t=>this._createFeature(e.Columns,s,r,t))}_createFeature(e,t,n,s){const{xField:r,yField:i}=this._config.geometryEncoding,a={};for(let t=0;t<e.length;t++){const n=e[t],o=s[t]??null;n.ColumnName!==i&&n.ColumnName!==r&&(a[n.ColumnName]=o)}let c=null;const u=s[t],l=s[n];return null!=l&&null!=u&&(c=(0,o.Cv)({x:u,y:l},this._config.sourceSpatialReference,this._outSpatialReference)),{attributes:a,geometry:c}}}function f(e){return e.find(e=>"DataTable"===e.FrameType&&"PrimaryResult"===e.TableKind)??null}function d(e){const t=e.Columns.findIndex(e=>"IngestedAt"===e.ColumnName);if(t<0)return null;let n=null;for(const s of e.Rows){const e=s[t];"string"==typeof e&&(null==n||e>n)&&(n=e)}return n}var g=n(53966),m=n(84952),p=n(16930),y=n(65864),_=n(17676),w=n(62815);function b(e,t){if(null==e&&null==t)return null;const n={};return null!=t&&(n.geometry=t),null!=e&&(n.where=e),n}let S=class extends l{constructor(e,t){super({}),this._outSpatialReference=t,this._outstandingMessages=[],this.errorString=null;const{geometryType:n,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=(0,w.N)(n,s,this._outSpatialReference),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.url.path,t=1e3,n=0){try{if(this.destroyed)return;const t=(0,m.a6)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(s){const o=t/1e3;return this._config.maxReconnectionAttempts&&n>=this._config.maxReconnectionAttempts?(g.A.getLogger(this).error(new r.A("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(g.A.getLogger(this).error(new r.A("websocket-connection",`Failed to connect. Attempting to reconnect in ${o}s`,s)),await(0,_.Pl)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),n+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void g.A.getLogger(this).error(new r.A("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise((t,n)=>{const s=new WebSocket(e);s.onopen=()=>{if(s.onopen=null,this.destroyed)return s.onclose=null,void s.close();s.onclose=e=>this._onClose(e),s.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(s),t(s)},s.onclose=e=>{s.onopen=s.onclose=null,n(e)}})}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const n=Promise.withResolvers(),s=t.onmessage,o=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:i}=this._config,a=setTimeout(()=>n.reject(),e),c=()=>{clearTimeout(a),n.reject()};return t.onmessage=e=>{let u=null;try{u=JSON.parse(e.data)}catch(e){}u&&"object"==typeof u||(g.A.getLogger(this).error(new r.A("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),c(),this.destroy()),u.spatialReference?.wkid!==this._outSpatialReference?.wkid&&(g.A.getLogger(this).error(new r.A("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${this._outSpatialReference.wkid}`,e.data)),c(),this.destroy()),"json"!==u.format&&(g.A.getLogger(this).error(new r.A("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),c(),this.destroy()),o&&u.filter!==o&&g.A.getLogger(this).error(new r.A("websocket-connection","Tried to set filter, but server doesn't support it")),i&&u.outFields!==i&&g.A.getLogger(this).error(new r.A("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=s;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],clearTimeout(a),n.resolve()},t.send(JSON.stringify({filter:o,outFields:i,format:"json",spatialReference:{wkid:this._outSpatialReference.wkid}})),n.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),g.A.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&g.A.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,a.Cg)([(0,u.MZ)()],S.prototype,"connectionStatus",null),(0,a.Cg)([(0,u.MZ)()],S.prototype,"errorString",void 0),S=(0,a.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.WebSocketConnection")],S);var k=n(80893),A=n(97552);const v={maxQueryDepth:5,maxRecordCountFactor:3};let x=class extends S{constructor(e,t){super({...v,...e},t),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.url);e.timeInfo.trackIdField||g.A.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._outSpatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const n=b(this._config.definitionExpression,this._config.geometryDefinition),{outFields:s}=this._config;this.destroyed||this._setFilter(n,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void g.A.getLogger(this).error(new r.A("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},n=(0,s.A)(e.path,{query:t,responseType:"json"}),r=(await n).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const n=e[0],{urls:s,token:r}=n,o=this._inferWebSocketBaseUrl(s);return(0,m.a6)(`${o}/subscribe`,{outSR:""+t.wkid,token:r})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return g.A.getLogger(this).error(new r.A("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const n=this._websocket;if(null==n||null==e&&null==t)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const i=Promise.withResolvers();return n.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(g.A.getLogger(this).error(new r.A("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),i.reject(t.error)),this._setWebSocketJSONParseHandler(n),o=!0,i.resolve())},n.send(s),setTimeout(()=>{o||(this.destroyed||this._websocket!==n||g.A.getLogger(this).error(new r.A("geoevent-connection","Server timed out when setting filter")),i.reject())},1e4),i.promise}_serializeFilter(e,t){const n={};if(null==e&&null==t)return n;if(e?.geometry)try{const t=(0,y.rS)(e.geometry);if("extent"!==t.type)throw new r.A("geoevent-connection",`Expected extent but found type ${t.type}`);n.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){g.A.getLogger(this).error(new r.A("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(n.where=e.where),null!=t&&(n.outFields=t.join(",")),n}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,n=e.attributes[t],s=this._relatedFeatures.get(n);if(!s)return g.A.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:i}=s;for(const t in o)e.attributes[t]=o[t];return i&&(e.geometry=i),e.geometry||e.centroid||g.A.getLogger(this).error(new r.A("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,n=this._queryRelatedFeatures(e),s=this._queryArchive(t);await n;const r=await s;if(!r)return;for(const e of r.features)this.onFeature(this._enrich(e))}catch(e){g.A.getLogger(this).error(new r.A("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([n.e(5620),n.e(8278),n.e(7865),n.e(9953),n.e(6554),n.e(564),n.e(2869),n.e(3910),n.e(1214),n.e(2889),n.e(1017),n.e(9789),n.e(4674),n.e(2718),n.e(8589),n.e(812),n.e(3470),n.e(3331)]).then(()=>n(18589))).default)({url:e}),{capabilities:s}=await t.load(),r=s.query.supportsMaxRecordCountFactor,o=s.query.supportsPagination,i=s.query.supportsCentroid,a=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,u=r?c*a:c,l=new A.A;if(l.outFields=this._config.outFields??["*"],l.where=this._config.definitionExpression??"1=1",l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=p.A.fromJSON(this._outSpatialReference),i&&(l.returnCentroid=!0),r&&(l.maxRecordCountFactor=a),o)return l.num=u,t.destroy(),this._queryPages(e,l);const h=await(0,k.eW)(e,l,this._config.sourceSpatialReference);return t.destroy(),h}async _queryPages(e,t,n=[],s=0){t.start=null!=t.num?s*t.num:null;const r=await(0,k.eW)(e,t,this._config.sourceSpatialReference);return r.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(r.features.forEach(e=>n.push(e)),this._queryPages(e,t,n,s+1)):(n.forEach(e=>r.features.push(e)),r)}_addRelatedFeatures(e){const t=new Map,n=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const e of n){const n=e.attributes[s];t.set(n,e)}this._relatedFeatures=t}};x=(0,a.Cg)([(0,u.$K)("esri.layers.graphics.sources.connections.GeoEventConnection")],x);var R=n(64108);let M=class extends l{constructor(e,t){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:n,sourceSpatialReference:s}=e;this._featureZScaler=(0,w.N)(n,s,t)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function C(e,t){const n=t.toJSON();switch(e.type){case"client":return new M(e,n);case"custom":return new S(e,n);case"geoevent":return new x(e,n);case"kusto":return new h(e,n)}}(0,a.Cg)([(0,u.MZ)()],M.prototype,"connectionStatus",void 0),(0,a.Cg)([(0,u.MZ)()],M.prototype,"errorString",void 0),M=(0,a.Cg)([(0,R.$)("esri.layers.support.ClientSideConnection")],M)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9933],{39933(e,t,l){l.r(t),l.d(t,{build:()=>s.b}),l(32680),l(34711),l(76597),l(72722),l(96336),l(53466),l(54154),l(9169),l(12696),l(72233),l(42594),l(98619),l(22393),l(59469),l(32482),l(51406),l(91899),l(58614),l(20693),l(33079),l(31821),l(63761),l(27832),l(47630),l(14113);var s=l(57323)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7262],{38969(t,e,r){r.d(e,{i:()=>a});var n=r(37955);function a(t,e){return new Promise((r,a)=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(e((0,n.Oo)(t,"canplay",r)),e((0,n.Oo)(t,"error",a)))})}},31217(t,e,r){r.d(e,{D:()=>a});var n=r(56507);async function a(t,e){return(await(0,n.A)(t,{responseType:"image",...e})).data}},46859(t,e,r){r.d(e,{h:()=>V});var n=r(49186),a=r(65529),i=r(97768),s=r(17676),o=r(34275),l=r(24326),u=r(84952),m=r(38969),h=r(31217),c=r(95117),d=r(53966),p=r(2741);let _;var g=r(63907),f=r(25530),T=r(42293);const x=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.BasisUtil");let w=null,C=null;async function E(){return null==C&&(_??=(async()=>{const t=await r.e(9321).then(()=>r(49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),C=_,w=await C),C}function M(t,e,r,n,a){const i=(0,T.MW)(e?g.CQ.COMPRESSED_RGBA8_ETC2_EAC:g.CQ.COMPRESSED_RGB8_ETC2),s=a&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(r*n*i*s)}function y(t){return t.getNumImages()>=1&&!t.isUASTC()}function A(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function F(t,e,r,n,a,i,s,o,l=!1){const{compressedTextureETC:u,compressedTextureS3TC:m}=t.capabilities,{basisFormat:h,internalFormat:c}=function(t,e,r,n){return t?r?{basisFormat:1,internalFormat:n?g.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:g.CQ.COMPRESSED_RGBA8_ETC2_EAC}:{basisFormat:0,internalFormat:n?g.CQ.COMPRESSED_SRGB8_ETC2:g.CQ.COMPRESSED_RGB8_ETC2}:e?r?{basisFormat:3,internalFormat:g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{basisFormat:2,internalFormat:g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT}:{basisFormat:13,internalFormat:n?g.H0.SRGB8_ALPHA8:6408}}(null!=u,null!=m,n,l),d=e.hasMipmap?r:Math.min(1,r),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(s(t,h))),o(t,h,p[t]);return e.internalFormat=c,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=a,e.height=i,new f.A(t,e,{type:"compressed",levels:p})}function v(t,e){const r=new Uint32Array(t.buffer,t.byteOffset,16);if(1481919403!==r[0]||3140563232!==r[1]||169478669!==r[2])return x().error("Invalid magic number in KTX1 header"),null;if(67305985!==r[3]||1!==r[5]||r[7]!==g.CQ.COMPRESSED_RGB8_ETC2||6407!==r[8])return x().error("Unsupported KTX1 image"),null;const n=r[7];let a=1,i=r[9],s=r[10];if(3&i||3&s)return null;const o=i,l=s;let u,m;!1!==e&&(a=Math.max(1,r[14]));let h=t.byteOffset+64;const c=[];for(let e=0;e<a;++e)m=(t[h]|t[h+1]<<8|t[h+2]<<16|t[h+3]<<24)>>>0,h+=4,u=new Uint8Array(t.buffer,h,m),c.push(u),h+=m,i=Math.max(1,i>>1),s=Math.max(1,s>>1);return{textureData:{type:"compressed",levels:c},internalFormat:n,width:o,height:l}}const D=()=>d.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function b(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const S=b("DXT1"),R=b("DXT3"),I=b("DXT5");function P(t,e){const r=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==r[0])return D().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return D().error("Unsupported format, must contain a FourCC code"),null;const n=r[21];let a,i;switch(n){case S:a=8,i=g.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case R:a=16,i=g.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case I:a=16,i=g.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return D().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(n)),null}let s=1,o=r[4],l=r[3];(3&o||3&l)&&(D().warn("Rounding up compressed texture size to nearest multiple of 4."),o=o+3&-4,l=l+3&-4);const u=o,m=l;let h,c;131072&r[2]&&!1!==e&&(s=Math.max(1,r[7]));let d=t.byteOffset+r[1]+4;const p=[];for(let e=0;e<s;++e)c=(o+3>>2)*(l+3>>2)*a,h=new Uint8Array(t.buffer,d,c),p.push(h),d+=c,o=Math.max(1,o>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:i,width:u,height:m}}function H(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function L(t,e){const[r,n]=function({width:t,height:e},{maxPreferredTexturePixels:r,maxTextureSize:n}){const a=Math.max(t,e),i=t*e;if(a<=n&&i<=r)return[t,e];const s=Math.min(Math.sqrt(r/i),n/a);return[H(Math.round(t*s),n),H(Math.round(e*s),n)]}(t,e);return t.width===r&&t.height===n?t:U(t,r,n)}function U(t,e,r){if(t instanceof ImageData)return U(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");if(null==r)throw new n.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(t,0,0),e}(t),e,r);const a=document.createElement("canvas");return a.width=e,a.height=r,a.getContext("2d").drawImage(t,0,0,a.width,a.height),a}var O=r(620),B=r(67171),X=r(12541);class V{constructor(t,e){this._data=t,this.id=(0,l.c)(),this.events=new a.bk,this._parameters={...Q,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,u.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,m.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,u.DB)(t.src)||(0,u.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new B.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e.isImmutable=!0===this._parameters.immutable&&function(t){return null!=t&&((0,X.tl)(t)||(0,X.tr)(t)||(0,X.CR)(t)||(0,X.QJ)(t))}(this._parameters.internalFormat),e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,o.mw)(t)||(0,o.mg)(t))return"image/ktx2"===e.encoding?function(t,e){if(null==w)return t.byteLength;const r=new w.KTX2File(new Uint8Array(t)),n=A(r)?M(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),e):0;return r.close(),r.delete(),n}(t,!!e.mipmap):"image/x.basis"===e.encoding?function(t,e){if(null==w)return t.byteLength;const r=new w.BasisFile(new Uint8Array(t)),n=y(r)?M(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),e):0;return r.close(),r.delete(),n}(t,!!e.mipmap):t.byteLength;const{width:r,height:n}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?k(t):e,a=e.pixelFormat??6408,i=(0,T.wH)(a);return(e.mipmap?4/3:1)*r*n*i||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new f.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,o.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,o.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):(0,o.mg)(e)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(t,e):(0,o.mw)(e)&&"image/ktx"===this._parameters.encoding?this._loadFromKTX1(t,new Uint8Array(e)):((0,o.mw)(e)||(0,o.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,o.mw)(e)||(0,o.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,o.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,o.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,r){const n=P(r,e.hasMipmap??!1);if(null==n)throw new Error("DDS texture data is null");const{textureData:a,internalFormat:i,width:s,height:o}=n;return e.samplingMode=a.levels.length>1?9987:9729,e.hasMipmap=a.levels.length>1,e.internalFormat=i,e.width=s,e.height=o,new f.A(t,e,a)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX1(t,e){return this._texture=function(t,e,r){const n=v(r,e.hasMipmap??!1);if(null==n)throw new Error("KTX1 texture data is null");const{textureData:a,internalFormat:i,width:s,height:o}=n;return e.samplingMode=a.levels.length>1?9987:9729,e.hasMipmap=a.levels.length>1,e.internalFormat=i,e.width=s,e.height=o,new f.A(t,e,a)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,r,n=!1){null==w&&(w=await E());const a=new w.KTX2File(new Uint8Array(r));if(!A(a))return null;const i=n&&2===a.getDFDTransferFunc();a.startTranscoding();const s=F(t,e,a.getLevels(),a.getHasAlpha(),a.getWidth(),a.getHeight(),(t,e)=>a.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,r)=>a.transcodeImage(r,t,0,0,e,0,-1,-1),i);return a.close(),a.delete(),s}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,r){null==w&&(w=await E());const n=new w.BasisFile(new Uint8Array(r));if(!y(n))return null;n.startTranscoding();const a=F(t,e,n.getNumLevels(0),n.getHasAlpha(),n.getImageWidth(0,0),n.getImageHeight(0,0),(t,e)=>n.getImageTranscodedSizeInBytes(0,t,e),(t,e,r)=>n.transcodeImage(r,0,t,e,0,0));return n.close(),n.delete(),a}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,O.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(t);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new f.A(t,r,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async r=>{const n=await(0,h.D)(e,{signal:r});return(0,s.Te)(r),this._loadFromImage(t,n)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async r=>{const n=await(0,c.y)(e,e.src,!1,r);return(0,s.Te)(r),this._loadFromImage(t,n)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(r=>new Promise((a,o)=>{const l=()=>{e.removeEventListener("loadeddata",u),e.removeEventListener("error",m),(0,i.xt)(h)},u=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(l(),a(this._loadFromImage(t,e)))},m=t=>{l(),o(t||new n.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",u),e.addEventListener("error",m);const h=(0,s.u7)(r,()=>m((0,s.NK)()))}))}_loadFromImage(t,e){let r=e;r instanceof HTMLVideoElement||(r=L(r,t.parameters));const n=k(r);this._parameters.width=n.width,this._parameters.height=n.height;const a=this._createDescriptor(t);return a.width=n.width,a.height=n.height,a.compress=this._parameters.compressionOptions,this._texture=new f.A(t,a,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const r=t(e.signal);this._loadingPromise=r;const n=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(n,n),r}unload(){if(this._texture=(0,i.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function k(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const Q={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},58682(t,e,r){r.d(e,{Uy:()=>l,h7:()=>c});var n=r(35522),a=r(51850),i=r(70328);class s{constructor(t=0,e=!1,r=!0){this.tolerance=t,this.isVerticalRay=e,this.normalRequired=r}}const o=(0,i.vt)();function l(t,e,r,a,i,o){if(!t.visible)return;const l=(0,n.jb)(E,a,r),{tolerance:u}=e,h=new s(u,!1,e.options.normalRequired);if(t.boundingInfo)m(t.readPrimitivePosition,t.boundingInfo,r,l,u,i,h,o);else{const e=t.readPrimitivePosition;!function(t,e,r,a,i,s,o,l){const u=e,m=M,h=Math.abs(u[0]),c=Math.abs(u[1]),d=Math.abs(u[2]),f=h>=c?h>=d?0:2:c>=d?1:2,x=f,w=u[x]<0?2:1,C=(f+w)%3,E=(f+(3-w))%3,y=u[C]/u[x],A=u[E]/u[x],F=1/u[x],v=p,D=_,b=g,{normalRequired:S}=o;for(let e=r;e<a;++e){const r=3*e;i(m[0],r),i(m[1],r+1),i(m[2],r+2),s&&(s.applyToVertex(m[0],m[0][0],m[0][1],m[0][2],e),s.applyToVertex(m[1],m[1][0],m[1][1],m[1][2],e),s.applyToVertex(m[2],m[2][0],m[2][1],m[2][2],e)),(0,n.jb)(v,m[0],t),(0,n.jb)(D,m[1],t),(0,n.jb)(b,m[2],t);const a=v[C]-y*v[x],o=v[E]-A*v[x],u=D[C]-y*D[x],h=D[E]-A*D[x],c=b[C]-y*b[x],d=b[E]-A*b[x],p=c*h-d*u,_=a*d-o*c,g=u*o-h*a;if((p<0||_<0||g<0)&&(p>0||_>0||g>0))continue;const f=p+_+g;if(0===f)continue;const w=p*(F*v[x])+_*(F*D[x])+g*(F*b[x]);if(w*Math.sign(f)<0)continue;const M=w/f;M>=0&&l(M,M,S?T(m):null,e)}}(r,l,0,t.faceCount,e,i,h,o)}}const u=(0,a.vt)();function m(t,e,r,a,s,l,h,c){if(null==e)return;const p=function(t,e){return(0,n.hZ)(e,1/t[0],1/t[1],1/t[2])}(a,u);if((0,i.C)(o,e.box),null!=l&&l.applyToAabb(o),function(t,e,r,n){return function(t,e,r,n){const a=(t[0]-n-e[0])*r[0],i=(t[3]+n-e[0])*r[0];let s=Math.min(a,i),o=Math.max(a,i);const l=(t[1]-n-e[1])*r[1],u=(t[4]+n-e[1])*r[1];if(o=Math.min(o,Math.max(l,u)),o<0)return!1;if(s=Math.max(s,Math.min(l,u)),s>o)return!1;const m=(t[2]-n-e[2])*r[2],h=(t[5]+n-e[2])*r[2];return o=Math.min(o,Math.max(m,h)),!(o<0)&&(s=Math.max(s,Math.min(m,h)),!(s>o)&&s<1/0)}(t,e,r,n)}(o,r,p,s)){const{primitiveIndices:n}=e,i=n.length;if(i>1e3){const n=e.children;if(void 0!==n){for(const e of n)m(t,e,r,a,s,l,h,c);return}}d(r,a,0,i,t,n,l,h,c)}}const h=(0,a.vt)();function c(t,e,r,n,a,i,s,o,l,u=null,m=0){const c=t[0],d=t[1],p=t[2],_=e[0],g=e[1],T=e[2];for(let t=r;t<n;++t){const e=m+(u?.[t]??t),r=3*e,n=s*a[r],x=i[n],w=i[n+1],E=i[n+2],M=s*a[r+1],y=i[M],A=i[M+1],F=i[M+2],v=s*a[r+2],D=y-x,b=A-w,S=F-E,R=i[v]-x,I=i[v+1]-w,P=i[v+2]-E,H=g*P-I*T,L=T*R-P*_,U=_*I-R*g,O=D*H+b*L+S*U,B=O*O;if(B<=C)continue;const X=c-x,V=d-w,k=p-E,Q=(X*H+V*L+k*U)*O;if(Q<0||Q>B)continue;const G=V*S-b*k,K=k*D-S*X,N=X*b-D*V,W=(_*G+g*K+T*N)*O;if(W<0||Q+W>B)continue;const j=(R*G+I*K+P*N)/O;j>=0&&l(j,j,o?f(D,b,S,R,I,P,h):null,e)}}function d(t,e,r,n,a,i,s,o,l){const u=t[0],m=t[1],c=t[2],d=e[0],p=e[1],_=e[2],{normalRequired:g}=o;for(let t=r;t<n;++t){const e=i[t],r=3*e;let[n,o,T]=a(A,r),[x,w,E]=a(A,r+1),[M,F,v]=a(A,r+2);null!=s&&([n,o,T]=s.applyToVertex(y,n,o,T,t),[x,w,E]=s.applyToVertex(y,x,w,E,t),[M,F,v]=s.applyToVertex(y,M,F,v,t));const D=x-n,b=w-o,S=E-T,R=M-n,I=F-o,P=v-T,H=p*P-I*_,L=_*R-P*d,U=d*I-R*p,O=D*H+b*L+S*U,B=O*O;if(B<=C)continue;const X=u-n,V=m-o,k=c-T,Q=(X*H+V*L+k*U)*O;if(Q<0||Q>B)continue;const G=V*S-b*k,K=k*D-S*X,N=X*b-D*V,W=(d*G+p*K+_*N)*O;if(W<0||Q+W>B)continue;const j=(R*G+I*K+P*N)/O;j>=0&&l(j,j,g?f(D,b,S,R,I,P,h):null,e)}}const p=(0,a.vt)(),_=(0,a.vt)(),g=(0,a.vt)();function f(t,e,r,a,i,s,o){return(0,n.hZ)(x,t,e,r),(0,n.hZ)(w,a,i,s),(0,n.$A)(o,x,w),(0,n.S8)(o,o),o}function T(t){return(0,n.jb)(x,t[1],t[0]),(0,n.jb)(w,t[2],t[0]),(0,n.$A)(h,x,w),(0,n.S8)(h,h),h}const x=(0,a.vt)(),w=(0,a.vt)(),C=1e-7*1e-7,E=(0,a.vt)(),M=[(0,a.vt)(),(0,a.vt)(),(0,a.vt)()],y=(0,a.vt)(),A=(0,a.vt)()},74810(t,e,r){r.d(e,{Jr:()=>i});var n=r(35522),a=r(51850);function i({normalTexture:t,metallicRoughnessTexture:e,metallicFactor:r,roughnessFactor:i,emissiveTexture:s,emissiveFactor:o,occlusionTexture:l}){return null==t&&null==e&&null==s&&(null==o||(0,n.t2)(o,a.uY))&&null==l&&(null==i||1===i)&&(null==r||1===r)}const s=(0,a.CN)(1,1,.5),o=(0,a.CN)(0,.6,.2),l=(0,a.CN)(0,1,.2);r.d(e,["Bt",0,o,"SY",0,l,"mb",0,s])},49788(t,e,r){const n=1/255.5,a=1-n;r.d(e,["Q",0,n,"v",0,a])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4575,6956],{69052(e,t,n){n.d(t,{hr:()=>r});var i=n(34727);class r{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return s(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+o(this.range,e-t,n)}minimalMonotonic(e,t,n){return s(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(i)?n:i}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function s(e,t,n,i,r=0,s=!1){return(i-=r)<t?i+=o(e,t-i):i>n&&(i-=o(e,i-n)),s&&i===n&&(i=t),i+r}function o(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const a=new r(0,2*Math.PI),l=(new r(-Math.PI,Math.PI),new r(0,360));n.d(t,["ie",0,l,"uC",0,a])},18370(e,t,n){n.d(t,{z:()=>r});class i{constructor(e){this._import=e,this.module=null,this._promise=null}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(async e=>(this.module=e,e))),this._promise}}function r(e){return new i(e)}},52039(e,t,n){n.d(t,{O7:()=>c,el:()=>l});var i=n(69052),r=(n(49186),n(18370)),s=n(17676),o=(n(5443),n(39829),n(82799),n(16930)),a=(n(80754),n(21325));async function l(e,t,n){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(n=t);let i=null;for(const t of e)i??=t?.spatialReference;if(!i)return e;const r=(0,a.Vp)(i);if(!r)return e;const[o,l]=r.valid;let c=!1;for(const t of e){if(!t)continue;if("point"===t.type){c||=t.x>=l,c||=t.x<=o;continue}const{extent:e}=t;if(null==e){c=!0;break}c||=e.xmin>=l,c||=e.xmin<=o,c||=e.xmax>=l,c||=e.xmax<=o}if(!c)return e;const[{foldInto360Range:m},d]=await(0,s.qr)(Promise.all([u.getImportPromise(),p.getImportPromise()]),n),y=d.fromSpatialReference(i);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=d.fromGeometry(e),n=d.toGeometry(m(t,y),i);return"extent"===e.type&&1===n?.rings.length?n.extent:n})}const u=(0,r.z)(()=>n.e(4144).then(()=>n(4144)).then(e=>e.load().then(()=>e))),p=(0,r.z)(()=>Promise.all([n.e(9187),n.e(8885),n.e(9117),n.e(3299),n.e(1550)]).then(()=>n(78125)));function c(e,t,n){const i=(0,a.Vp)(n);if(null==i)return e;const[r,s]=i.valid,o=2*s;let l=0,u=0;t>s?l=Math.ceil(Math.abs(t-s)/o):t<r&&(l=-Math.ceil(Math.abs(t-r)/o)),e>s?u=Math.ceil(Math.abs(e-s)/o):e<r&&(u=-Math.ceil(Math.abs(e-r)/o));let p=e+(l-u)*o;const c=p-t;return c>s?p-=o:c<r&&(p+=o),p}function m(e){const t=(0,a.Vp)(e);if(null==t)return null;const[n,r]=t.valid;return new i.hr(n,r)}const d=m(o.A.WGS84);m(o.A.WebMercator),n.d(t,["Y_",0,d])},80754(e,t,n){n.d(t,{kS:()=>u,kd:()=>l});var i=n(82799),r=n(16930),s=n(60408),o=n(52006);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:r.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:r.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:r.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){if((0,o.Ed)(e))for(const n of function(e){return(0,s.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of n){if((0,o.aO)(e)){const[n,i]=e.c;n[0]+=t,i[0]+=t;continue}if((0,o.FG)(e)){const[n,i]=e.a;n[0]+=t,i[0]+=t;continue}if((0,o.n1)(e)){const[n,i,r]=e.b;n[0]+=t,i[0]+=t,r[0]+=t;continue}e[0]+=t}for(const n of function(e){return(0,s.Bi)(e)?e.rings:e.paths}(e))for(const e of n)e[0]+=t;return e}n.d(t,["j7",0,a])},31464(e,t,n){n.d(t,{Cv:()=>d,Nk:()=>m,lK:()=>h});var i=n(4576),r=n(99917),s=n(60408),o=n(21325),a=n(28735);const l=[0,0];function u(e,t){const n=(0,o.K8)(e)?a.je:a.tD;if((0,s.fT)(t)){const e={x:0,y:0};return[e.x,e.y]=n(t.x,t.y,l),null!=t.z&&(e.z=t.z),null!=t.m&&(e.m=t.m),e}if((0,s.ZC)(t)){const e={xmin:0,ymin:0,xmax:0,ymax:0};return[e.xmin,e.ymin]=n(t.xmin,t.ymin,l),[e.xmax,e.ymax]=n(t.xmax,t.ymax,l),t.hasZ&&(e.zmin=t.zmin,e.zmax=t.zmax,e.hasZ=!0),t.hasM&&(e.mmin=t.mmin,e.mmax=t.mmax,e.hasM=!0),e}if((0,s.Bi)(t))return{rings:p(t.rings,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.Rg)(t))return{paths:p(t.paths,n),hasM:t.hasM,hasZ:t.hasZ};if((0,s.U9)(t))return{points:c(t.points,n),hasM:t.hasM,hasZ:t.hasZ};throw new Error}function p(e,t){const n=[];for(const i of e)n.push(c(i,t));return n}function c(e,t){const n=[];for(const i of e){const e=t(i[0],i[1],[0,0]);n.push(e),i.length>2&&e.push(i[2]),i.length>3&&e.push(i[3])}return n}async function m(e,t){if(!e||!t)return;const n=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(i.Ru):[e];await(0,r.initializeProjection)(n.map(e=>({source:e,dest:t})))}function d(e,t,n,i){if(!e)return null;if(n||(n=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(n)||(0,o.aI)(t,n))return e;if((0,a.y7)(t,n)){const t=u(n,e);return t.spatialReference=n,t}return(0,r.projectMany)([e],t,n,i)[0]}const y=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,n,i){if(!e?.length||!t||!n||(0,o.aI)(t,n))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:n,options:i,resolve:Promise.withResolvers()};return this._jobs.push(r),this._timer??=setTimeout(this._process,10),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:n,outSpatialReference:i,resolve:s,options:o}=e,l=t.filter(e=>null!=e);let p;p=(0,a.y7)(n,i)&&null==o?.extendedParams?l.map(e=>u(i,e)):(0,r.projectMany)(l,n,i,o);let c=0;const m=t.map(e=>null==e?null:p[c++]);s.resolve(m),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function h(e,t,n,i){return y.push(e,t,n,i)}},58727(e,t,n){n.d(t,{GC:()=>g,T2:()=>v,dO:()=>M,iJ:()=>f});var i=n(49186),r=n(66552),s=n(86211),o=n(39829),a=n(99917),l=n(90634),u=n(60408),p=n(65864),c=n(52039),m=n(21325),d=n(31464);const y=new r.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),h=Object.freeze({});async function f(e,t,n){const i=e.bin;return i.onField&&(i.onField=i.onField.trim()),i.onExpression?.value&&(i.onExpression.value=i.onExpression.value.trim()),i.splitBy&&(i.splitBy.value&&(i.splitBy.value=i.splitBy.value.trim()),i.splitBy.outAlias&&(i.splitBy.outAlias=i.splitBy.outAlias.trim())),i.stackBy&&(i.stackBy.value&&(i.stackBy.value=i.stackBy.value.trim()),i.stackBy.outAlias&&(i.stackBy.outAlias=i.stackBy.outAlias.trim())),"normalizationField"in i.parameters&&i.parameters.normalizationField&&(i.parameters.normalizationField=i.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:"frequency"}]),g(e,t,n)}async function g(e,t,n){const{outFields:i,orderByFields:r,groupByFieldsForStatistics:s,outStatistics:o}=e;if(i)for(let e=0;e<i.length;e++)i[e]=i[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(o)for(let e=0;e<o.length;e++)o[e].onStatisticField&&(o[e].onStatisticField=o[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),v(e,t,n)}async function v(e,t,n){if(!e)return null;let{where:i}=e;if(e.where=i=i?.trim(),(!i||/^1 *= *1$/.test(i)||t&&t===i)&&(e.where=null),!e.geometry)return e;let r=await w(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;r=(0,l.HA)(r),r.spatialReference=t}if(!r)return e;await(0,d.Nk)(r.spatialReference,n);let[s]=await(0,c.el)((0,p.rS)(r));if(null==s)throw h;let y=!1;((0,u.ZC)(s)||(0,u.Bi)(s)||(0,u.Rg)(s))&&(y=!(0,m.aI)(s.spatialReference,n)&&!(0,a.canProjectWithoutEngine)(s.spatialReference,n)),y&&(0,u.ZC)(s)&&(s=o.A.fromExtent(s));const f="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,g=y&&f?{extendedParams:{densificationStep:8*f}}:void 0,v=s.toJSON(),M=(0,d.Cv)(v,v.spatialReference,n,g);if(!M)throw h;return M.spatialReference=n,e.geometry=M,e}async function w(e){const{distance:t,units:r}=e,o=e.geometry;if(!t||"vertexAttributes"in o)return o;const a=o.spatialReference,l=r?y.fromJSON(r):(0,s.Ij)(a),p=a&&((0,m.EA)(a)||(0,m.K8)(a))?o:await(0,d.Nk)(a,m.KK).then(()=>(0,d.Cv)(o,m.KK)),{geodesicBufferExecute:c,geodesicBufferLoad:h}=await n.e(9159).then(()=>n(49159));await h();const f=c(p,t||1,{unit:l})??void 0;if(!f||!(0,u.Bi)(f)||0===f.rings.length)throw new i.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return f}function M(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}n.d(t,["VY",0,y,"v8",0,h])},14575(e,t,n){n.d(t,{default:()=>Z});var i=n(32198),r=n(69540),s=n(66552),o=n(25482),a=n(53966),l=n(91429),u=n(78888),p=n(16930),c=n(65864),m=n(50498),d=n(58727),y=n(5834),h=n(41266),f=n(59977),g=n(11440),v=n(60909),w=n(58174),M=n(7562),x=n(79677),C=n(56400),B=n(93223);const S=new s.J({asc:"ascending",desc:"descending"}),A={base:h.A,key:"type",typeMap:{"auto-interval":y.A,date:f.A,"fixed-boundaries":g.A,"fixed-interval":v.A}};let Z=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!(0,C.wr)(e)&&a.A.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};(0,i.Cg)([(0,l.MZ)({types:A,json:{name:"bin",write:!0}})],Z.prototype,"binParameters",void 0),(0,i.Cg)([(0,B.e)(S)],Z.prototype,"binOrder",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],Z.prototype,"cacheHint",void 0),(0,i.Cg)([(0,l.MZ)({json:{write:!0}})],Z.prototype,"datumTransformation",void 0),(0,i.Cg)([(0,l.MZ)({type:p.A,json:{name:"defaultSR",write:!0}})],Z.prototype,"defaultSpatialReference",void 0),(0,i.Cg)([(0,l.MZ)({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],Z.prototype,"distance",void 0),(0,i.Cg)([(0,l.MZ)({types:m.yR,json:{read:c.rS,write:!0}})],Z.prototype,"geometry",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],Z.prototype,"lowerBoundaryAlias",void 0),(0,i.Cg)([(0,l.MZ)({type:p.A,json:{name:"outSR",write:!0}})],Z.prototype,"outSpatialReference",void 0),(0,i.Cg)([(0,l.MZ)({type:[M.A],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],Z.prototype,"outStatistics",void 0),(0,i.Cg)([(0,l.MZ)({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,n)=>{e&&(t[n]={ianaTimeZone:e})}}}})],Z.prototype,"outTimeZone",null),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy:e=>({enabled:null!=e})}}})],Z.prototype,"returnAggregateIds",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],Z.prototype,"returnDistinctValues",void 0),(0,i.Cg)([(0,B.e)(w.x,{name:"spatialRel"})],Z.prototype,"spatialRelationship",void 0),(0,i.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],Z.prototype,"timeExtent",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],Z.prototype,"upperBoundaryAlias",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{read:d.VY.read,write:{writer:d.VY.write,overridePolicy(e){return{enabled:null!=e&&!!this.distance}}}}})],Z.prototype,"units",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],Z.prototype,"where",void 0),Z=(0,i.Cg)([(0,l.$K)("esri.rest.support.AttributeBinsQuery")],Z),Z.from=(0,u.dp)(Z)},5834(e,t,n){n.d(t,{A:()=>c});var i=n(32198),r=n(93637),s=n(91429),o=n(78888),a=n(41266),l=n(41366),u=n(93223);function p(e,t,n){(0,r.sM)(n,e instanceof Date?e.getTime():e,t)}let c=class extends((0,l.K)(a.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],c.prototype,"numBins",void 0),(0,i.Cg)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:p}}})],c.prototype,"end",void 0),(0,i.Cg)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:p}}})],c.prototype,"start",void 0),(0,i.Cg)([(0,u.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,i.Cg)([(0,s.$K)("esri.rest.support.AutoIntervalBinParameters")],c),c.from=(0,o.dp)(c)},41266(e,t,n){n.d(t,{A:()=>h});var i=n(32198),r=n(69540),s=n(66552),o=n(25482),a=n(91429),l=n(78888),u=n(93223);const p=new s.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let c=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,i.Cg)([(0,a.MZ)({type:String,json:{name:"outAlias",write:!0}})],c.prototype,"alias",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],c.prototype,"responseType",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"type",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"value",void 0),(0,i.Cg)([(0,u.e)(p)],c.prototype,"valueType",void 0),c=(0,i.Cg)([(0,a.$K)("esri.rest.support.AttributeBinsGrouping")],c);const m=c;c.from=(0,l.dp)(c);const d=new s.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),y=new s.J({naturalLog:"natural-log",squareRoot:"square-root"});let h=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,i.Cg)([(0,a.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],h.prototype,"expression",void 0),(0,i.Cg)([(0,u.e)(d,{name:"onExpression.valueType"})],h.prototype,"expressionValueType",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{name:"onField",write:!0}})],h.prototype,"field",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],h.prototype,"firstDayOfWeek",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"hideUpperBound",void 0),(0,i.Cg)([(0,a.MZ)({type:m,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],h.prototype,"splitBy",void 0),(0,i.Cg)([(0,a.MZ)({type:m,json:{write:{target:{stackBy:{type:m},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>m.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],h.prototype,"stackBy",void 0),(0,i.Cg)([(0,u.e)(y)],h.prototype,"transformation",void 0),h=(0,i.Cg)([(0,a.$K)("esri.rest.support.BinParametersBase")],h)},59977(e,t,n){n.d(t,{A:()=>f});var i=n(32198),r=n(93637),s=n(91429),o=n(78888),a=n(41266),l=n(69540),u=n(25482),p=n(57231),c=n(93223);let m=class extends((0,l.OU)(u.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),(0,i.Cg)([(0,c.e)(p.g)],m.prototype,"unit",void 0),m=(0,i.Cg)([(0,s.$K)("esri.rest.support.DateBinTimeInterval")],m);const d=m;function y(e,t,n){(0,r.sM)(n,"string"==typeof e?e:e?.getTime(),t)}function h(e,t){const n=e.parameters[t];return n?"string"==typeof n?n:new Date(n):null}m.from=(0,o.dp)(m);let f=class extends a.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};(0,i.Cg)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>h(t,"end")},write:{writer:y}}})],f.prototype,"end",void 0),(0,i.Cg)([(0,s.MZ)({type:d,json:{name:"parameters",write:!0}})],f.prototype,"interval",void 0),(0,i.Cg)([(0,s.MZ)({type:d,json:{name:"parameters.offset",write:!0}})],f.prototype,"offset",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],f.prototype,"returnFullIntervalBin",void 0),(0,i.Cg)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>h(t,"start")},write:{writer:y}}})],f.prototype,"start",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],f.prototype,"snapToData",void 0),(0,i.Cg)([(0,c.e)({dateBin:"date"},{readOnly:!0})],f.prototype,"type",void 0),f=(0,i.Cg)([(0,s.$K)("esri.rest.support.DateBinParameters")],f),f.from=(0,o.dp)(f)},57231(e,t,n){const i=(0,n(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});n.d(t,["g",0,i])},11440(e,t,n){n.d(t,{A:()=>u});var i=n(32198),r=n(93637),s=n(91429),o=n(78888),a=n(41266),l=n(93223);let u=class extends a.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,i.Cg)([(0,s.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,n){(0,r.sM)(n,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],u.prototype,"boundaries",void 0),(0,i.Cg)([(0,l.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],u.prototype,"type",void 0),u=(0,i.Cg)([(0,s.$K)("esri.rest.support.FixedBoundariesBinParameters")],u),u.from=(0,o.dp)(u)},60909(e,t,n){n.d(t,{A:()=>c});var i=n(32198),r=n(93637),s=n(91429),o=n(78888),a=n(41266),l=n(41366),u=n(93223);function p(e,t,n){(0,r.sM)(n,e instanceof Date?e.getTime():e,t)}let c=class extends((0,l.K)(a.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,i.Cg)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:p}}})],c.prototype,"end",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],c.prototype,"interval",void 0),(0,i.Cg)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:p}}})],c.prototype,"start",void 0),(0,i.Cg)([(0,u.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,i.Cg)([(0,s.$K)("esri.rest.support.FixedIntervalBinParameters")],c),c.from=(0,o.dp)(c)}}]);