@arcgis/core 5.2.0-next.128 → 5.2.0-next.129

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 (300) hide show
  1. package/applications/Components/imageryUtils.js +1 -1
  2. package/arcade/batchExec.js +1 -1
  3. package/arcade/geometry/adapters/dehydrated.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/06da350b4ea25732f52b.js +1 -0
  6. package/assets/esri/core/workers/chunks/{67dcf9b873cb037b2647.js → 081c9ccaa5884c730a91.js} +1 -1
  7. package/assets/esri/core/workers/chunks/094102031cc77b20db74.js +1 -0
  8. package/assets/esri/core/workers/chunks/0b85c844af97b2fb0ba8.js +1 -0
  9. package/assets/esri/core/workers/chunks/{86d7a3ae672a51b75fcc.js → 0d44f793d3b0d33153ac.js} +1 -1
  10. package/assets/esri/core/workers/chunks/0de140199161fcd15a0c.js +1 -0
  11. package/assets/esri/core/workers/chunks/0deceece4b465f653f58.js +1 -0
  12. package/assets/esri/core/workers/chunks/111dc5653daa7f3e1001.js +1 -0
  13. package/assets/esri/core/workers/chunks/139e3da8ea081e21539e.js +1 -0
  14. package/assets/esri/core/workers/chunks/142bedebd37d747f84ba.js +1 -0
  15. package/assets/esri/core/workers/chunks/15dc28b4fa5b5110472b.js +1 -0
  16. package/assets/esri/core/workers/chunks/{dd02cc18ebebb90778c6.js → 17e2bfc7468c23e43bef.js} +1 -1
  17. package/assets/esri/core/workers/chunks/196d33f4d8e3a256ad94.js +1 -0
  18. package/assets/esri/core/workers/chunks/1a02c68de65a67ab6a67.js +1 -0
  19. package/assets/esri/core/workers/chunks/{4165eb86471ea3bbf364.js → 1aecf7106a21320e054e.js} +1 -1
  20. package/assets/esri/core/workers/chunks/1bc03b8065cbbbb06c87.js +1 -0
  21. package/assets/esri/core/workers/chunks/1beb32170d659bc43977.js +1 -0
  22. package/assets/esri/core/workers/chunks/20ee32fee219afbcfee3.js +1 -0
  23. package/assets/esri/core/workers/chunks/{9467744cb7d094a5067a.js → 21d2f5324db0b199060c.js} +1 -1
  24. package/assets/esri/core/workers/chunks/22abb9a74f6594f9db2a.js +1 -0
  25. package/assets/esri/core/workers/chunks/237795866c075880531b.js +1 -0
  26. package/assets/esri/core/workers/chunks/25e4da9c6837ab0fa585.js +1 -0
  27. package/assets/esri/core/workers/chunks/2a5fde737dc99627142e.js +1 -0
  28. package/assets/esri/core/workers/chunks/3412050ae63ff7dcaf36.js +1 -0
  29. package/assets/esri/core/workers/chunks/35316724c8d3cc39cf80.js +1 -0
  30. package/assets/esri/core/workers/chunks/354cc6cd2a56937f1747.js +1 -0
  31. package/assets/esri/core/workers/chunks/365ae479765ca9e47de4.js +1 -0
  32. package/assets/esri/core/workers/chunks/{8190fcb1dd10ad20feed.js → 36ef86701883a20dd6f6.js} +1 -1
  33. package/assets/esri/core/workers/chunks/3759e272a1d43534a190.js +1 -0
  34. package/assets/esri/core/workers/chunks/397ddcf0b8e858a17b70.js +1 -0
  35. package/assets/esri/core/workers/chunks/3a7a558e30b5cb81c801.js +1 -0
  36. package/assets/esri/core/workers/chunks/3c9405d310a1b08c901e.js +1 -0
  37. package/assets/esri/core/workers/chunks/{e10fe4c77b8dc4492092.js → 3ce53562926b05e71af5.js} +1 -1
  38. package/assets/esri/core/workers/chunks/3d174a84b785fc633a5a.js +1 -0
  39. package/assets/esri/core/workers/chunks/3d67fed3e53993c38b58.js +1 -0
  40. package/assets/esri/core/workers/chunks/42bdeeff55fb1a3f735f.js +1 -0
  41. package/assets/esri/core/workers/chunks/48f1532520b76fa7f0c2.js +1 -0
  42. package/assets/esri/core/workers/chunks/{00d9e41deecf5828975c.js → 4adc3822ed9f498f5653.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{d5f0fed415b5b155d57c.js → 51741ef8225d470716fe.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5191e481d0e19a7f3888.js +1 -0
  45. package/assets/esri/core/workers/chunks/{7fcee3a1b900ddc9a5e3.js → 540acf6abdee9dbd453e.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d9b63cf111035b05cd2e.js → 5484b89adc53430226d5.js} +1 -1
  47. package/assets/esri/core/workers/chunks/55361b50ecfc98db2ffb.js +1 -0
  48. package/assets/esri/core/workers/chunks/58da7c41c1bcef2f4141.js +1 -0
  49. package/assets/esri/core/workers/chunks/5979bbefb09d132c008f.js +1 -0
  50. package/assets/esri/core/workers/chunks/{84db05e872dbf35c80a2.js → 5982c6a8459c1237b298.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{0a20f84b5f004a77a9f9.js → 5abfc4f447b01d6bf287.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4c0dba437de0969a5b63.js → 5b9f88194433410bad5b.js} +1 -1
  53. package/assets/esri/core/workers/chunks/5f794f4e0113d5dd50ba.js +1 -0
  54. package/assets/esri/core/workers/chunks/62a30692e2a7612bafc1.js +1 -0
  55. package/assets/esri/core/workers/chunks/62aa7daad4ca7332854e.js +1 -0
  56. package/assets/esri/core/workers/chunks/66926c3686d5ef2d4692.js +29 -0
  57. package/assets/esri/core/workers/chunks/6994ba168465b77a36af.js +1 -0
  58. package/assets/esri/core/workers/chunks/6d0c6fda9100fe89f3cb.js +1 -0
  59. package/assets/esri/core/workers/chunks/72a898894438f177cd62.js +1 -0
  60. package/assets/esri/core/workers/chunks/78d4455237120103f639.js +1 -0
  61. package/assets/esri/core/workers/chunks/7fccf53aa751cd9dae57.js +1 -0
  62. package/assets/esri/core/workers/chunks/{6267a1fe1603daa399b4.js → 81327e10200065a0ccef.js} +1 -1
  63. package/assets/esri/core/workers/chunks/84a3fbe5d85a357f4e82.js +1 -0
  64. package/assets/esri/core/workers/chunks/862479729f2d036f606b.js +1 -0
  65. package/assets/esri/core/workers/chunks/8a9aa6db11d0f643961c.js +1 -0
  66. package/assets/esri/core/workers/chunks/8dfea65341991e13ab71.js +1 -0
  67. package/assets/esri/core/workers/chunks/8e92925043dc49ed1018.js +1 -0
  68. package/assets/esri/core/workers/chunks/8f0b2b0ca239b01f44d0.js +1 -0
  69. package/assets/esri/core/workers/chunks/93a89168c18db88f60e7.js +1 -0
  70. package/assets/esri/core/workers/chunks/991c854a4459c82d4d93.js +1 -0
  71. package/assets/esri/core/workers/chunks/{f90cad9f007a11154c0d.js → 9b080d07699b56f06c5f.js} +1 -1
  72. package/assets/esri/core/workers/chunks/9cd69aa3880838a834f8.js +1 -0
  73. package/assets/esri/core/workers/chunks/{2ca49fb4590cc34a02bd.js → 9d87f38b16dda1ff7978.js} +1 -1
  74. package/assets/esri/core/workers/chunks/9fd1e5a2c0a261ed2a33.js +1 -0
  75. package/assets/esri/core/workers/chunks/a189e520da39919cdcca.js +1 -0
  76. package/assets/esri/core/workers/chunks/a3a5cb664bdb1db190dd.js +1 -0
  77. package/assets/esri/core/workers/chunks/a63c456ecf018ec06778.js +1 -0
  78. package/assets/esri/core/workers/chunks/{842f993fa60b410cb613.js → a8322a978e33c7349fdf.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{f479b4a4cee4bb2e046c.js → aa96eea0899757ab38c7.js} +1 -1
  80. package/assets/esri/core/workers/chunks/ab0b2a76247dfd56b92d.js +1 -0
  81. package/assets/esri/core/workers/chunks/ab7337b076d152a8eb9e.js +1 -0
  82. package/assets/esri/core/workers/chunks/ac0de274853a42d518a1.js +1 -0
  83. package/assets/esri/core/workers/chunks/ad372e399e20d5a3262d.js +1 -0
  84. package/assets/esri/core/workers/chunks/ae75b3e5320d03dff64c.js +1 -0
  85. package/assets/esri/core/workers/chunks/ae98530d5816306216b3.js +1 -0
  86. package/assets/esri/core/workers/chunks/afc94c4b9bc007fe310f.js +1 -0
  87. package/assets/esri/core/workers/chunks/afe54923339e957b71b9.js +1 -0
  88. package/assets/esri/core/workers/chunks/bbcac00362fef5e3956d.js +1 -0
  89. package/assets/esri/core/workers/chunks/{1302bf9718747cd9fdd9.js → bcee161dd1c4781d1998.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{d1f54b0079fb71a15612.js → bd231bc0624eb889ac14.js} +1 -1
  91. package/assets/esri/core/workers/chunks/c0075715fbe7bec10fc3.js +1 -0
  92. package/assets/esri/core/workers/chunks/c4e1e864fb8c119b2520.js +1 -0
  93. package/assets/esri/core/workers/chunks/c93cedf9e53da5aaa35b.js +1 -0
  94. package/assets/esri/core/workers/chunks/{2d592c935571de80a2e2.js → c9690810b198a97bc16d.js} +1 -1
  95. package/assets/esri/core/workers/chunks/cada517cc25fa37f778c.js +1 -0
  96. package/assets/esri/core/workers/chunks/cd1821bf601949674e02.js +1 -0
  97. package/assets/esri/core/workers/chunks/{1b42d163ef22e3565bb7.js → cf7b7e54cd87422ca62a.js} +1 -1
  98. package/assets/esri/core/workers/chunks/d195c57fc6de3560653d.js +1 -0
  99. package/assets/esri/core/workers/chunks/d7f830a06ded11f2fc80.js +1 -0
  100. package/assets/esri/core/workers/chunks/d877783815afd21dbe98.js +1 -0
  101. package/assets/esri/core/workers/chunks/db5181fcea96cc2ede3e.js +1 -0
  102. package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js → de28a86775235bd5d3c4.js} +2 -2
  103. package/assets/esri/core/workers/chunks/df6992416cba9539f1ed.js +1 -0
  104. package/assets/esri/core/workers/chunks/e4005d95a396e1af9ac2.js +1 -0
  105. package/assets/esri/core/workers/chunks/{668ec0bdfb2095e90c9e.js → e495697860f7207da4c7.js} +1 -1
  106. package/assets/esri/core/workers/chunks/f163502c513205c892e7.js +1 -0
  107. package/assets/esri/core/workers/chunks/f287ec0fcb611f82ebb0.js +1 -0
  108. package/assets/esri/core/workers/chunks/{37ae52c71bf9c70fbb92.js → f2d45d15d0ba2537a4eb.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{d507d7d7a7282fc38e8d.js → f652d1db26fbdea1a79b.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f6b38ed75baae198c19b.js +1 -0
  111. package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js → f6cfc901267a229de7a1.js} +2 -2
  112. package/assets/esri/core/workers/chunks/f6d04d14323b926f1025.js +1 -0
  113. package/assets/esri/core/workers/chunks/f7ab606be37373312ebe.js +1 -0
  114. package/assets/esri/core/workers/chunks/{3b7dff15a0058ea29886.js → f92178ac6dc9abff304f.js} +1 -1
  115. package/assets/esri/core/workers/chunks/fc39593febef74a036f1.js +1 -0
  116. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  117. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
  118. package/assets/esri/themes/dark/main.css +1 -1
  119. package/assets/esri/themes/light/main.css +1 -1
  120. package/assets/esri/themes/light/view.css +1 -1
  121. package/assets/esri/views/interactive/tooltip/t9n/messages.ar.json +1 -1
  122. package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
  123. package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
  124. package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
  125. package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
  126. package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
  127. package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
  128. package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
  129. package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
  130. package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
  131. package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
  132. package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
  133. package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
  134. package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
  135. package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
  136. package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
  137. package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
  138. package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
  139. package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
  140. package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
  141. package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
  142. package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
  143. package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
  144. package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
  145. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
  146. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
  147. package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
  148. package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
  149. package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
  150. package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
  151. package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
  152. package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
  153. package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
  154. package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
  155. package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
  156. package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
  157. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
  158. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
  159. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
  160. package/chunks/batchExec.js +2 -0
  161. package/config.js +1 -1
  162. package/geometry/support/intersects.js +1 -1
  163. package/geometry/support/intersectsBase.js +1 -1
  164. package/kernel.js +1 -1
  165. package/layers/GeospatialPDFLayer.js +1 -1
  166. package/layers/ImageryTileLayer.js +1 -1
  167. package/layers/graphics/hydrateGeometryJSON.js +2 -0
  168. package/layers/graphics/hydratedFeatures.js +1 -1
  169. package/layers/graphics/hydratedSpatialReference.js +2 -0
  170. package/layers/raster/datasets/DBFParser.js +1 -1
  171. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  172. package/layers/raster/datasets/TIFFRaster.js +1 -1
  173. package/layers/raster/formats/JpgPlus.js +1 -1
  174. package/layers/raster/formats/RasterCodec.js +1 -1
  175. package/layers/raster/formats/Raw.js +1 -1
  176. package/layers/support/arcadeUtils.js +1 -1
  177. package/package.json +3 -3
  178. package/popup/FeatureContent.js +1 -1
  179. package/popup/FeatureContentCollection.d.ts +2 -0
  180. package/popup/FeatureContentCollection.js +1 -1
  181. package/popup/support/featureUtils.js +1 -1
  182. package/rest/imageService.js +1 -1
  183. package/support/arcadeUtils.js +1 -1
  184. package/support/loadArcade.js +1 -1
  185. package/support/revision.js +1 -1
  186. package/symbols/cim/cimAnalyzer.js +1 -1
  187. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  188. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  189. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  190. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  191. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  192. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  193. package/views/2d/layerViewModuleImportUtils.js +1 -1
  194. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  195. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  196. package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
  197. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  198. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  199. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  200. package/views/2d/support/hitTestUtils.js +1 -1
  201. package/views/3d/interactive/Manipulator3D.js +1 -1
  202. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  203. package/views/3d/terrain/TileCompositor.js +1 -1
  204. package/views/DOMContainer.d.ts +18 -8
  205. package/views/VideoView.d.ts +38 -0
  206. package/views/VideoView.js +1 -1
  207. package/views/View.d.ts +20 -2
  208. package/views/View.js +1 -1
  209. package/views/input/types.d.ts +19 -6
  210. package/views/interactive/dragEventPipeline.js +1 -1
  211. package/views/layers/ImageryTileLayerView.js +1 -1
  212. package/widgets/Search/SearchViewModel.js +1 -1
  213. package/widgets/Search/support/layerSearchUtils.js +1 -1
  214. package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +0 -1
  215. package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +0 -1
  216. package/assets/esri/core/workers/chunks/038d2b80d96237c25b6f.js +0 -1
  217. package/assets/esri/core/workers/chunks/04d4cd66485b622403d0.js +0 -1
  218. package/assets/esri/core/workers/chunks/05afa8c2b5929ce0545a.js +0 -1
  219. package/assets/esri/core/workers/chunks/09676cfa99b90fe0cc63.js +0 -1
  220. package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +0 -1
  221. package/assets/esri/core/workers/chunks/0ccd4200c5a2a5de6e16.js +0 -1
  222. package/assets/esri/core/workers/chunks/1262918b2161d79851c0.js +0 -1
  223. package/assets/esri/core/workers/chunks/1406a884241809b62bff.js +0 -1
  224. package/assets/esri/core/workers/chunks/1c33aa349beea9a3792f.js +0 -1
  225. package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +0 -1
  226. package/assets/esri/core/workers/chunks/24014f3701c31ee74bc2.js +0 -1
  227. package/assets/esri/core/workers/chunks/25a2e02677a74834c8b5.js +0 -1
  228. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +0 -1
  229. package/assets/esri/core/workers/chunks/2c7bb5c9751524687002.js +0 -1
  230. package/assets/esri/core/workers/chunks/2ebad7e588b26e74cefe.js +0 -1
  231. package/assets/esri/core/workers/chunks/319434415d2c0561bc59.js +0 -1
  232. package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +0 -1
  233. package/assets/esri/core/workers/chunks/3aceedec9abfb2fdfa18.js +0 -1
  234. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +0 -1
  235. package/assets/esri/core/workers/chunks/3f045f09ac95e7f22a97.js +0 -1
  236. package/assets/esri/core/workers/chunks/4327d2c39a660bd89da7.js +0 -1
  237. package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +0 -1
  238. package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +0 -1
  239. package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +0 -1
  240. package/assets/esri/core/workers/chunks/4a73f73f1698fad2df20.js +0 -1
  241. package/assets/esri/core/workers/chunks/4f464047c6f6c9486efd.js +0 -1
  242. package/assets/esri/core/workers/chunks/500f6d6f0ffa235cae85.js +0 -1
  243. package/assets/esri/core/workers/chunks/526cc64ae46dec3fbeda.js +0 -1
  244. package/assets/esri/core/workers/chunks/550d4df0732352fa48b5.js +0 -1
  245. package/assets/esri/core/workers/chunks/581285e4d7bbe1b7c27a.js +0 -1
  246. package/assets/esri/core/workers/chunks/58fb92775d668cfd295c.js +0 -1
  247. package/assets/esri/core/workers/chunks/5adf2792416b22cd602f.js +0 -1
  248. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +0 -1
  249. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +0 -1
  250. package/assets/esri/core/workers/chunks/606cca69eaea84bfcdc6.js +0 -1
  251. package/assets/esri/core/workers/chunks/64ee22134fda2f09c094.js +0 -1
  252. package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +0 -1
  253. package/assets/esri/core/workers/chunks/67678054342178b601cf.js +0 -1
  254. package/assets/esri/core/workers/chunks/67fd2cdb2e6834bfa710.js +0 -1
  255. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +0 -1
  256. package/assets/esri/core/workers/chunks/75294f515c7f8393181c.js +0 -1
  257. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +0 -1
  258. package/assets/esri/core/workers/chunks/761ea719ec1b4d562db2.js +0 -1
  259. package/assets/esri/core/workers/chunks/78085f804969c9282700.js +0 -1
  260. package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +0 -1
  261. package/assets/esri/core/workers/chunks/80f16f5f15518013f7d0.js +0 -1
  262. package/assets/esri/core/workers/chunks/8465e2c7221125fd3cc4.js +0 -1
  263. package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +0 -1
  264. package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +0 -1
  265. package/assets/esri/core/workers/chunks/8a842cde240aef12e417.js +0 -1
  266. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +0 -1
  267. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +0 -1
  268. package/assets/esri/core/workers/chunks/92509dd25996c6390a31.js +0 -1
  269. package/assets/esri/core/workers/chunks/9ccc2c8f7416943cc373.js +0 -29
  270. package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +0 -1
  271. package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +0 -1
  272. package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +0 -1
  273. package/assets/esri/core/workers/chunks/a3a33ffa34f4d645ddfe.js +0 -1
  274. package/assets/esri/core/workers/chunks/b396c4b4bb144200acc7.js +0 -1
  275. package/assets/esri/core/workers/chunks/b9c834e3c0701e9b14a2.js +0 -1
  276. package/assets/esri/core/workers/chunks/bbfb80a6983574007ce5.js +0 -1
  277. package/assets/esri/core/workers/chunks/bcf2e5cf6b9c6d0442bb.js +0 -1
  278. package/assets/esri/core/workers/chunks/c35e9dee87937f483a3d.js +0 -1
  279. package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +0 -1
  280. package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +0 -1
  281. package/assets/esri/core/workers/chunks/ccaeabc3be07f3c96f50.js +0 -1
  282. package/assets/esri/core/workers/chunks/d25fb32a233d2128afbe.js +0 -1
  283. package/assets/esri/core/workers/chunks/d5ef269ab0ee3744b05d.js +0 -1
  284. package/assets/esri/core/workers/chunks/d94a2b3b2ef49af9c2e3.js +0 -1
  285. package/assets/esri/core/workers/chunks/dc92710a8fdfb9135e55.js +0 -1
  286. package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +0 -1
  287. package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +0 -1
  288. package/assets/esri/core/workers/chunks/e4016ae9cb8f16e3efc3.js +0 -1
  289. package/assets/esri/core/workers/chunks/e6a4cef0af9be30ffe3d.js +0 -1
  290. package/assets/esri/core/workers/chunks/eaa7cb3ffa8c11706a09.js +0 -1
  291. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +0 -1
  292. package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +0 -1
  293. package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +0 -1
  294. package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +0 -1
  295. package/assets/esri/core/workers/chunks/f71ec8a260405ed07958.js +0 -1
  296. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +0 -1
  297. package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +0 -1
  298. package/assets/esri/core/workers/chunks/ff0e9f8d323eb1729650.js +0 -1
  299. /package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js.LICENSE.txt → de28a86775235bd5d3c4.js.LICENSE.txt} +0 -0
  300. /package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js.LICENSE.txt → f6cfc901267a229de7a1.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4907],{26887(e,t,i){function n(){return[1,0,0,1,0,0]}function r(e,t,i,n,r,o){return[e,t,i,n,r,o]}i.d(t,{fA:()=>r,vt:()=>n});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:n,fromValues:r},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>l,execute:()=>c,executeMany:()=>u,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>p,isLoaded:()=>s,load:()=>a,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var n=i(76061),r=i(83290);let o;function s(){return!!o&&(0,r.i)()}async function a(){if(!s()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorProject,t(r.p)}}function l(e,t,i){return o.clipToSpatialReference(e,t,null,i)}function c(e,t){return o.execute(e,t,null)}function u(e,t){const i=o.executeMany(new n.S(e),t,null);return Array.from(i)}function h(e,t){return o.foldInto360Range(e,t)}function p(e,t,i){return o.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return o.normalizeGeometry(e,t,i)}function f(){return o.supportsCurves()}function g(e,t,i,n,r){return o.transform(e,t,i,n,r)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>p});var n=i(4144),r=i(85036),o=i(17499);let s,a,l,c,u,h,p;function d(){return!!s&&(0,n.isLoaded)()}function f(){return(0,r.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,n.load)()]);s=e.fromGeometry,a=e.fromSpatialReference,l=e.getSpatialReference,c=e.toGeometry,u=t.createProjectionTransformation,h=(0,n.supportsCurves)(),p=h}}function m(){return(0,r.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){const r=l(e),h=u(a(r),a(t),i),p=c((0,n.execute)(s(e),h),t);return!i?.zConversionDisabled&&p?.hasZ&&(0,o.g)([p],r,t),p}function y(e,t,i){return(0,r.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){const r=e.map(s),h=l(e),p=u(a(h),a(t),i),d=(0,n.executeMany)(r,p).map(e=>c(e,t));return!i?.zConversionDisabled&&d&&(0,o.g)(d,h,t),d}function x(e,t,i){return(0,r.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>o});var n=i(60408),r=i(62815);function o(e,t,i){let o;for(const s of e)if(s&&(0,n.Pv)(s)&&!("vertexAttributes"in s)){if(!o){const e="type"in s?s.type:(0,n.$B)(s);if(o=(0,r.N)(e,t,i),!o)return}o(s)}}},62815(e,t,i){i.d(t,{N:()=>a,d:()=>l});var n=i(86211),r=i(73941),o=i(21325),s=i(52006);function a(e,t,i){const n=l(t,i);if(1!==n)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,n);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(const i of e.curvePaths)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(const i of e.curveRings)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,n);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,n);default:return}}function l(e,t){return null==e||null==t||(0,o.aI)(e,t)||(0,r.xP)(e)||(0,r.xP)(t)?1:(0,n.G9)(e)/(0,n.G9)(t)}},44907(e,t,i){i.r(t),i.d(t,{default:()=>Pe});var n=i(32198),r=i(49186),o=i(53966),s=i(25728),a=i(17676),l=i(91429),c=i(16930),u=i(21325),h=i(4146),p=i(63074),d=i(8303),f=i(72545),g=i(25036),m=i(86738),_=i(92474),y=i(83027),w=i(48163),x=i(37585),P=i(5443),A=i(39829),M=i(88411),v=i(83276);class R{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){const e=[];for(const[t,i]of this.outerMediaBox){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){const e=[];for(const[t,i]of this.pairedNeatline){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,a.Te)(i);const n=e;if(n.spatialReference.equals(t))return n;if(!n||!n.extent)throw new r.A("geospatial-pdf-layer:load","Could not project neatline");const o=Math.max(n.extent.width,n.extent.height)/256,s=(0,M.densifyExecute)(n,o);return(0,v.projectExecute)(s,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(let o=0;o<e.length;o++){const s=T(this.ctm,e[o][0],e[o][1]);t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),r=Math.max(r,s[1])}return new P.A({xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:this.spatialReference})}}function T(e,t,i){const[n,r,o,s,a,l]=e,c=(0,w.vt)();return(0,x.hZ)(c,n*t+o*i+a,r*t+s*i+l),c}i(44208);var C=i(26887),F=i(48237);function S(e,t,i,n){const r=Math.min(e.length,t.length,3),o=e.slice(0,r).map((e,n)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new m.A({x:t[n][0],y:t[n][1],spatialReference:i})}));return new F.A({controlPoints:o,width:n.xmax-n.xmin,height:n.ymax-n.ymin})}function E(e){if(!e?.transform||e.transform.length<6)throw new r.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function b(e){return(0,C.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function D(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class G{constructor(e){const t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=D(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:t,registration:i,projection:n,display:o,neatline:s,mediaBox:a}=e;if(t&&6!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!s||s.length<4||s.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,C.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:n,display:o,neatline:s,mediaBox:a}}outputValidation(){if(6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){const e=[],t=[];for(const i of this._registration)i.length<4||(e.push((0,w.fA)(i[0],i[1])),t.push((0,w.fA)(i[2],i[3])));const i=this._getSourceRect();return b(E(S(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,n=-1/0,o=-1/0;for(let r=0;r<e.length;r++){const s=e[r];t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),o=Math.max(o,s[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(o)))throw new r.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:n,ymax:o}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);const e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new r.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){const[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){const e=[];for(let t=0;t<this._neatline.length;t+=2){const i=this._neatline[t],n=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(n)&&e.push([i,n])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const N={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},j=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,O=/^(?:WGS84|WGS 84|WGE)$/i;function I(e){const t=function(e){return function(e){const t=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),i=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);let n;if(i||(n="Projection is missing or has unsupported ProjectionType"),t||(n="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(n="Projection is missing a Datum"),n)throw new r.A("geospatial-pdf-layer:invalid-projection",n);return z(e,i),{kind:"projected",dictionaryType:t,projectionType:i,datum:e.Datum}}(e)}(e);if("projected"===t.kind){const{projectionType:i,datum:n}=t;return"SPCS"===i?function(e,t){const i=B(t);if(2800===e.Zone&&i&&Z(i))return new c.A({wkid:32110});throw new r.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,n):new c.A({wkt:$(e,i,n)})}}function z(e,t){const i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(const n of i){const i=e[N[n]];if(void 0===i||""===i)throw new r.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${n}.`)}}function $(e,t,i){const n=function(e,t,i){const n=function(e){const t=B(e);return t?Z(t)?"NAD_1983":H(t)?"NAD_1927":k(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${n}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${n}_GeospatialPDF_Polyconic`;case"UT":return`${n}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${n}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${n}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),o=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),s=function(e){if("definition"===e.kind){const t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new r.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");const i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;const t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new r.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),n=e.name??"GeospatialPDF_Datum",o=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,s=e.to_WGS84;return`DATUM["${n}",${o}${s?`,TOWGS84[${s.dx??0},${s.dy??0},${s.dz??0},${s.rx??0},${s.ry??0},${s.rz??0},${s.sf??0}]`:""}]`}if(e.name){const t=e.name.toUpperCase();if(Z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(H(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(k(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new r.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),a=function(e){const t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),l=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new r.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");const t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${n}",GEOGCS["${function(e){const t=B(e);return t?Z(t)?"GCS_North_American_1983":H(t)?"GCS_North_American_1927":k(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${s},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${o}"],${l.join(",\n ")},${a}]`}function B(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function Z(e){return j.test(e)}function H(e){return L.test(e)}function k(e){return O.test(e)}class V{constructor(e){const{bbox:t,bounds:i,gpts:n,lpts:r,gcs:o,mediaBox:s}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=n,this._lpts=r,this._gcs=o,this.outerExtentMediaBox=D(s),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);const a=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=a.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const l=E(this._georeference);this.ctm=b(l),this.outputValidation()}toSpatialReference(){return new c.A({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:t,bounds:i,gpts:n,lpts:o,gcs:s,mediaBox:a}=e;if(!t||4!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!n||n.length<6||n.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!o||o.length<6||o.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(o.length!==n.length)throw new r.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!s?.WKT)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:n,lpts:o,gcs:{WKT:s.WKT},mediaBox:a}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){const e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return S(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;const e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){const e=this._getBoundsPolygonLocal();return e?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){const e=[];for(let t=0;t<this._lpts.length;t+=2){const i=this._lpts[t],n=this._lpts[t+1];e.push(this._localToPage(i,n))}return e}_getProjectedGeoControlPoints(){const e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){const n=this._gpts[i],r=this._gpts[i+1],o=new m.A({x:r,y:n}),s=(0,v.projectExecute)(o,e);t.push((0,w.fA)(s.x,s.y))}return t}_getViewportRect(){const[e,t,i,n]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,n),xmax:Math.max(e,i),ymax:Math.max(t,n)}}_localToPage(e,t){const[i,n,r,o]=this._bbox;return(0,w.fA)(i+e*(r-i),n+t*(o-n))}}function J(e){const t=oe(e,"LGIDict map frame must be an object.");return{CTM:Y(t.CTM),Registration:ee(t.Registration),Neatline:Y(t.Neatline),Projection:K(t.Projection),Display:K(t.Display)}}function U(e){const t=oe(e,"Viewport frame must be an object."),i=function(e){if(re(e))return{Bounds:Y(e.Bounds),GPTS:Y(e.GPTS),LPTS:Y(e.LPTS),GCS:W(e.GCS)}}(t.Measure);return{BBox:Y(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function W(e){if(re(e))return{WKT:te(e.WKT)}}function K(e){if(re(e))return{Type:ie(e.Type),Units:ie(e.Units),Datum:q(e.Datum),Projection_Type:ie(e.ProjectionType),Central_Meridian:ne(e.CentralMeridian),False_Easting:ne(e.FalseEasting),False_Northing:ne(e.FalseNorthing),Height:ne(e.Height),Hemisphere:ie(e.Hemisphere),Latitude_One:ne(e.LatitudeOne),Latitude_Two:ne(e.LatitudeTwo),Latitude_Of_True_Scale:ne(e.LatitudeOfTrueScale),Longitude_One:ne(e.LongitudeOne),Longitude_Two:ne(e.LongitudeTwo),Longitude_Down_From_Pole:ne(e.LongitudeDownFromPole),Orientation:ie(e.Orientation),Origin_Height:ne(e.OriginHeight),Origin_Latitude:ne(e.OriginLatitude),Origin_Longitude:ne(e.OriginLongitude),Scale_Factor:ne(e.ScaleFactor),Standard_Parallel:ne(e.StandardParallel),Standard_Parallel_One:ne(e.StandardParallelOne),Standard_Parallel_Two:ne(e.StandardParallelTwo),Zone:ne(e.Zone),Description:ie(e.Description),raw:e}}function q(e){return null==e?null:"string"==typeof e?{kind:"name",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}:re(e)?{kind:"definition",name:ie(e.Description),ellipsoid:Q(e.Ellipsoid),to_WGS84:X(e.ToWGS84),raw:e}:{kind:"unknown",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}}function Q(e){if(re(e))return{semi_Major_Axis:ne(e.SemiMajorAxis),inverse_Flattening:ne(e.InvFlattening),semi_Minor_Axis:ne(e.SemiMinorAxis),description:ie(e.Description)}}function X(e){if(re(e))return{dx:ne(e.dx)??0,dy:ne(e.dy)??0,dz:ne(e.dz)??0,rx:ne(e.rx)??0,ry:ne(e.ry)??0,rz:ne(e.rz)??0,sf:ne(e.sf)??0}}function Y(e){if(!Array.isArray(e))return;const t=[];for(const i of e){const e=ne(i);if(void 0===e)return;t.push(e)}return t}function ee(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>ne(e)).filter(e=>void 0!==e))}function te(e){if(null!=e)return"string"==typeof e?e:String(e)}function ie(e){const t=te(e);if(void 0!==t)return t.trim()}function ne(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;const t=e.trim();if(""===t)return;const i=Number(t);return Number.isFinite(i)?i:void 0}function re(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function oe(e,t){if(!re(e))throw new r.A("geospatial-pdf-layer:parse",t);return e}let se=class extends _.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){const t=(0,y.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);const{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),n=function(e,t=0){const i={mediaBox:Y(e.MediaBox),rotate:ne(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},n=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>J(e)):[J(e)]}(e)[t]}(e.LGIDict,t);if(n){if(!n.Projection)throw new r.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");const t=I(n.Projection);let o;try{o=n.Display?I(n.Display):void 0}catch{o=t}return{result:i,lgiDictFrame:new G({ctm:n.CTM,registration:n.Registration,projection:t,display:o,neatline:n.Neatline,mediaBox:Y(e.MediaBox)})}}const o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new V({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Y(e.MediaBox)})}:{result:i}}(i,0),o=n.lgiDictFrame??n.vpFrame;if(!o)throw new r.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");const s=new R(o),a=s.spatialReference.toJSON();return{frame:s,sourceSpatialReference:a,fullExtent:s.toExtent()}}async render(e,t,i,n,r,o){const s={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:n,currentRing:r};return this._workerHandler.renderPDF(s,o)}};se=(0,n.Cg)([(0,l.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],se);var ae=i(49859),le=i(14140),ce=i(87186);let ue=class extends ae.A{constructor(){super(...arguments),this._workerClient=new se,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,n={}){const r=this._extent,o=this._ctm,s=this.getTileExtentPDF(e,t,i);return s.intersects(r)?function(e){return new le.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(s,this._tileSize,this._tileSize,o,this._neatlineRing,n)):null}async _open(e){if(!this.url)throw new r.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;const i=this.frame.outerExtentMediabox;if(!i)throw new r.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const n=function(e,t){const[i,n,o,s]=e,a=i*s-n*o;if(!Number.isFinite(a)||0===a)throw new r.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");const l=10*Math.hypot(s,n)/Math.abs(a),c=10*Math.hypot(o,i)/Math.abs(a),u=Math.max(1,Math.ceil(t.width*l)),h=Math.max(1,Math.ceil(t.height*c));if(!Number.isFinite(u)||!Number.isFinite(h))throw new r.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[u,h]}(this.frame.ctm,this._extent);this._width=n[0],this._height=n[1];const o={x:i.width/this._width,y:i.height/this._height},s=new ce.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:o,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(s,this._tileSize,this._tileSize),this._set("rasterInfo",s),this.updateTileInfo()}getTileExtentPDF(e,t,i){const n=this._extent,r=2**e,o=n.width/this._width*r,s=n.height/this._height*r,a=new m.A({x:n.xmin,y:n.ymax});return this.getTileExtent({x:o,y:s},t,i,a,n.spatialReference,[512,512])}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,l.MZ)({constructOnly:!0})],ue.prototype,"page",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ue.prototype,"tileType",void 0),ue=(0,n.Cg)([(0,l.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],ue);var he=i(34930),pe=i(60694),de=i(13868),fe=i(87045),ge=i(36280),me=i(12711),_e=i(85676),ye=i(93223);let we=class extends((0,p.dM)((0,g.j)((0,d.A)((0,f.G)((0,s.M)(h.A)))))){constructor(e){super(e),this.interpolation="bilinear",this.renderer=null,this.serviceRasterInfo=null,this.symbolizer=null,this._frame=null,this.clippedToNeatline=!0,this.neatlineVisible=!0,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["PDF"],supportsData:!1},e).catch(a.QP).then(()=>this._openRaster(e?.signal))),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy()}get fullExtent(){return this.serviceRasterInfo?.extent}set url(e){this._set("url",(0,pe.Jf)(e,o.A.getLogger(this)))}async fetchImageBitmapTile(){throw new r.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,n={}){return xe(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),n)}async fetchTile(e,t,i,n={}){if(xe(this),n.requestAsImageElement)throw new r.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();const o=await this.raster.fetchTile(e,t,i,n);return this.clippedToNeatline&&o.pixelBlock&&this._frame&&o.srcExtent&&(o.pixelBlock=await(0,he.$Q)(o.pixelBlock,o.srcExtent,this._frame.sourceNeatlinePolygon)),o}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,u.Vp)(e);return fe.A.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return xe(this),[0,1,2]}_configDefaultSettings(){this._configPDFSymbolizer()}_configPDFSymbolizer(){xe(this);const{rasterInfo:e}=this.raster,t=new ge.A({stretchType:"none",useGamma:!1}),i=(0,me.$P)(t.toJSON());this._set("renderer",t),this.symbolizer?(this.symbolizer.rendererJSON=i,this.symbolizer.rasterInfo=e):this.symbolizer=new _e.A({rendererJSON:i,rasterInfo:e});const n=this.symbolizer.bind();n.success||o.A.getLogger(this).warn("geospatial-pdf-layer",n.error||"The fixed GeospatialPDFLayer renderer is not supported.")}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(xe(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}async _openRaster(e){const t=new ue({url:this.url});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r.A("geospatialpdf-layer:load","cannot load resources on "+this.url);const{rasterInfo:i}=t;this._set("serviceRasterInfo",i),this.setAtOrigin("spatialReference",i.spatialReference,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service"),this._frame=t.frame,this.raster=t,this._configDefaultSettings()}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}};function xe(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}(0,n.Cg)([(0,ye.e)(de.SZ)],we.prototype,"interpolation",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,clonable:!1,json:{read:!1}})],we.prototype,"renderer",void 0),(0,n.Cg)([(0,l.MZ)()],we.prototype,"serviceRasterInfo",void 0),(0,n.Cg)([(0,l.MZ)({clonable:!1})],we.prototype,"symbolizer",void 0),(0,n.Cg)([(0,l.MZ)({clonable:!1})],we.prototype,"_compatibleFullExtent",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],we.prototype,"clippedToNeatline",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1}})],we.prototype,"fullExtent",null),(0,n.Cg)([(0,l.MZ)({type:Boolean})],we.prototype,"neatlineVisible",void 0),(0,n.Cg)([(0,l.MZ)()],we.prototype,"raster",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,type:c.A,json:{read:!1}})],we.prototype,"spatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:fe.A})],we.prototype,"tileInfo",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,value:"geospatial-pdf"})],we.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)()],we.prototype,"url",null),we=(0,n.Cg)([(0,l.$K)("esri.layers.GeospatialPDFLayer")],we);const Pe=we},91806(e,t,i){i.d(t,{A:()=>l});var n,r=i(32198),o=i(25482),s=i(91429),a=i(78888);let l=class extends o.o{static{n=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new n({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,r.Cg)([(0,s.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=n=(0,r.Cg)([(0,s.$K)("esri.layers.support.LOD")],l)},87045(e,t,i){i.d(t,{A:()=>w});var n,r=i(32198),o=i(66552),s=i(25482),a=i(86211),l=i(91429),c=i(78888),u=i(86738),h=i(16930),p=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new o.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends s.o{static{n=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:o=h.A.WebMercator,numLODs:s=24}=e;if(!(0,p.fn)(o)){const e=[];if(i)for(let t=0;t<i.length;t++){const n=i[t];e.push(new f.A({level:t,scale:n,resolution:n}))}else{let t=5e-4;for(let i=s-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new n({dpi:96,lods:e,origin:new u.A(0,0,o),size:[r,r],spatialReference:o})}const l=(0,p.Vp)(o),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:o}):new u.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),d=1/(39.37*(0,a.GA)(o)*96),g=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],n=t*d;g.push(new f.A({level:e,scale:t,resolution:n}))}else{let e=(0,p.EA)(o)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(s/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let n=1;n<i;n++){const i=e/2**t,r=i*d;g.push(new f.A({level:n,scale:i,resolution:r})),e=i}}return new n({dpi:96,lods:g,origin:c,size:[r,r],spatialReference:o})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const n=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{n.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",n),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),n=i+1;return t[i]/(t[i]/t[n])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let n=0;for(;n<i;n++){const i=t[n],r=t[n+1];if(i<=e)return n;if(r===e)return n+1;if(i>e&&r<e)return n+Math.log(i/e)/Math.log(i/r)}return n}tileAt(e,t,i,n){const r=this.lodAt(e);if(!r)return null;let o,s;if("number"==typeof t)o=t,s=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))o=t.x,s=t.y,n=i;else{const e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;o=e.x,s=e.y,n=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return n??=new g.U(0,0,0),n.level=e,n.row=Math.floor((this.origin.y-s)/l+.001),n.col=Math.floor((o-this.origin.x)/a+.001),this.updateTileInfo(n),n}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:n}=i,r=n*this.size[0],o=n*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*o,e[2]=e[0]+r,e[3]=e[1]+o,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return n.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const n=e+t,{scale:r,resolution:o}=n>=0?this.lods[n]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:r,resolution:o}))}return new n({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const n=e[i];this._upsampleLevels[n.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/n.resolution:0},t=n}}};(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,r.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,r.Cg)([(0,l.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,r.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,r.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,r.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,r.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,r.Cg)([(0,_.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,r.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=n=(0,r.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>r});var n=i(19419);class r{constructor(e,t,i,r=(0,n.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4907],{26887(e,t,i){function n(){return[1,0,0,1,0,0]}function r(e,t,i,n,r,o){return[e,t,i,n,r,o]}i.d(t,{fA:()=>r,vt:()=>n});Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:[1,0,0,1,0,0],clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]},create:n,fromValues:r},Symbol.toStringTag,{value:"Module"}))},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>l,execute:()=>c,executeMany:()=>u,foldInto360Range:()=>h,foldInto360RangeGeodetic:()=>p,isLoaded:()=>s,load:()=>a,normalizeGeometry:()=>d,supportsCurves:()=>f,transform:()=>g});var n=i(76061),r=i(83290);let o;function s(){return!!o&&(0,r.i)()}async function a(){if(!s()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,r.l)()]);o=new e.OperatorProject,t(r.p)}}function l(e,t,i){return o.clipToSpatialReference(e,t,null,i)}function c(e,t){return o.execute(e,t,null)}function u(e,t){const i=o.executeMany(new n.S(e),t,null);return Array.from(i)}function h(e,t){return o.foldInto360Range(e,t)}function p(e,t,i){return o.foldInto360RangeGeodetic(e,t,i)}function d(e,t,i){return o.normalizeGeometry(e,t,i)}function f(){return o.supportsCurves()}function g(e,t,i,n,r){return o.transform(e,t,i,n,r)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>y,executeMany:()=>x,isLoaded:()=>f,load:()=>m,projectExecute:()=>_,projectExecuteMany:()=>w,projectIsLoaded:()=>d,projectLoad:()=>g,projectSupportsCurves:()=>h,supportsCurves:()=>p});var n=i(4144),r=i(85036),o=i(17499);let s,a,l,c,u,h,p;function d(){return!!s&&(0,n.isLoaded)()}function f(){return(0,r.Q)("projectOperator","isLoaded","projectIsLoaded"),d()}async function g(){if(!d()){const[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,n.load)()]);s=e.fromGeometry,a=e.fromSpatialReference,l=e.getSpatialReference,c=e.toGeometry,u=t.createProjectionTransformation,h=(0,n.supportsCurves)(),p=h}}function m(){return(0,r.Q)("projectOperator","load","projectLoad"),g()}function _(e,t,i){const r=l(e),h=u(a(r),a(t),i),p=c((0,n.execute)(s(e),h),t);return!i?.zConversionDisabled&&p?.hasZ&&(0,o.g)([p],r,t),p}function y(e,t,i){return(0,r.Q)("projectOperator","execute","projectExecute"),_(e,t,i)}function w(e,t,i){const r=e.map(s),h=l(e),p=u(a(h),a(t),i),d=(0,n.executeMany)(r,p).map(e=>c(e,t));return!i?.zConversionDisabled&&d&&(0,o.g)(d,h,t),d}function x(e,t,i){return(0,r.Q)("projectOperator","executeMany","projectExecuteMany"),w(e,t,i)}},17499(e,t,i){i.d(t,{g:()=>o});var n=i(60408),r=i(62815);function o(e,t,i){let o;for(const s of e)if(s&&(0,n.Pv)(s)&&!("vertexAttributes"in s)){if(!o){const e="type"in s?s.type:(0,n.$B)(s);if(o=(0,r.N)(e,t,i),!o)return}o(s)}}},62815(e,t,i){i.d(t,{N:()=>a,d:()=>l});var n=i(86211),r=i(73941),o=i(21325),s=i(52006);function a(e,t,i){const n=l(t,i);if(1!==n)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,n);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(const i of e.curvePaths)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(const i of e.curveRings)for(const e of i){const i=(0,s.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}}(e,n);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,n);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,n);default:return}}function l(e,t){return null==e||null==t||(0,o.aI)(e,t)||(0,r.xP)(e)||(0,r.xP)(t)?1:(0,n.G9)(e)/(0,n.G9)(t)}},44907(e,t,i){i.r(t),i.d(t,{default:()=>ye});var n=i(32198),r=i(49186),o=i(53966),s=i(25728),a=i(17676),l=i(91429),c=i(16930),u=i(21325),h=i(4146),p=i(63074),d=i(8303),f=i(72545),g=i(25036),m=i(86738),_=i(92474),y=i(83027),w=i(48163),x=i(37585),P=i(5443),A=i(39829),M=i(88411),v=i(83276);class R{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){const e=[];for(const[t,i]of this.outerMediaBox){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){const e=[];for(const[t,i]of this.pairedNeatline){const n=T(this.ctm,t,i);e.push([n[0],n[1]])}return new A.A({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(e,t,i){(0,a.Te)(i);const n=e;if(n.spatialReference.equals(t))return n;if(!n||!n.extent)throw new r.A("geospatial-pdf-layer:load","Could not project neatline");const o=Math.max(n.extent.width,n.extent.height)/256,s=(0,M.densifyExecute)(n,o);return(0,v.projectExecute)(s,t)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,i=1/0,n=-1/0,r=-1/0;for(let o=0;o<e.length;o++){const s=T(this.ctm,e[o][0],e[o][1]);t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),r=Math.max(r,s[1])}return new P.A({xmin:t,ymin:i,xmax:n,ymax:r,spatialReference:this.spatialReference})}}function T(e,t,i){const[n,r,o,s,a,l]=e,c=(0,w.vt)();return(0,x.hZ)(c,n*t+o*i+a,r*t+s*i+l),c}i(44208);var C=i(26887),F=i(48237);function E(e,t,i,n){const r=Math.min(e.length,t.length,3),o=e.slice(0,r).map((e,n)=>({sourcePoint:{x:e[0],y:e[1]},mapPoint:new m.A({x:t[n][0],y:t[n][1],spatialReference:i})}));return new F.A({controlPoints:o,width:n.xmax-n.xmin,height:n.ymax-n.ymin})}function S(e){if(!e?.transform||e.transform.length<6)throw new r.A("geospatial-pdf-layer:georefrencer","created georeferencer does not have valid transform");return e.transform}function b(e){return(0,C.fA)(e[0],-e[1],-e[3],e[4],e[2],e[5])}function D(e){return[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]}class j{constructor(e){const t=this.inputValidation(e);this._registration=t.registration,this._projection=t.projection,this._neatline=t.neatline,this.pairedNeatline=this._pairNeatline(),this.outerExtentMediaBox=D(t.mediaBox),this.geoControlPoints=this._getRegistrationPoints("geo"),this.ctm=t.ctm??this._buildCTMFromRegistration(),this.outputValidation()}inputValidation(e){const{ctm:t,registration:i,projection:n,display:o,neatline:s,mediaBox:a}=e;if(t&&6!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict has invalid CTM.");if(!t&&(!i||i.length<3))throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing CTM and minimum registration points");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid MediaBox.");if(!s||s.length<4||s.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid amount of neatline points");return{ctm:t?(0,C.fA)(t[0],t[1],t[2],t[3],t[4],t[5]):void 0,registration:i??[],projection:n,display:o,neatline:s,mediaBox:a}}outputValidation(){if(6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","LGIDict missing or invalid CTM");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outerextent from mediaBox.");if(!this.ctm&&this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints if defaulting.")}toSpatialReference(){return this._projection}_buildCTMFromRegistration(){const e=[],t=[];for(const i of this._registration)i.length<4||(e.push((0,w.fA)(i[0],i[1])),t.push((0,w.fA)(i[2],i[3])));const i=this._getSourceRect();return b(S(E(e,t,this.toSpatialReference(),i)))}_extentFromArray(e){let t=1/0,i=1/0,n=-1/0,o=-1/0;for(let r=0;r<e.length;r++){const s=e[r];t=Math.min(t,s[0]),i=Math.min(i,s[1]),n=Math.max(n,s[0]),o=Math.max(o,s[1])}if(!(Number.isFinite(t)&&Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(o)))throw new r.A("geospatial-pdf-layer: invalid-frame","Failed to compute extent from registration.");return{xmin:t,ymin:i,xmax:n,ymax:o}}_getSourceRect(){if(4===this.outerExtentMediaBox?.length)return this._extentFromArray(this.outerExtentMediaBox);if(this._neatline.length>=6)return this._extentFromArray(this.pairedNeatline);const e=this._getRegistrationPoints("page");if(e.length>=2)return this._extentFromArray(e);throw new r.A("geospatial-pdf-layer: invalid-frame","Cannot build source rectangle from Neatline or Registration points.")}_getRegistrationPoints(e){const[t,i]="page"===e?[0,1]:[2,3];return this._registration.filter(e=>e.length>i).map(e=>[e[t],e[i]])}_pairNeatline(){const e=[];for(let t=0;t<this._neatline.length;t+=2){const i=this._neatline[t],n=this._neatline[t+1];Number.isFinite(i)&&Number.isFinite(n)&&e.push([i,n])}return 2===e.length&&(e.splice(1,0,[e[1][0],e[0][1]]),e.push([e[0][0],e[2][1]])),e}}const G={OriginLatitude:"Origin_Latitude",CentralMeridian:"Central_Meridian",ScaleFactor:"Scale_Factor",FalseEasting:"False_Easting",FalseNorthing:"False_Northing",Zone:"Zone",Hemisphere:"Hemisphere",StandardParallelOne:"Standard_Parallel_One",StandardParallelTwo:"Standard_Parallel_Two"},N=/^(?:NAD83|NORTH AMERICAN 1983|NAR(?:-[A-Z])?)$/i,L=/^(?:NAD27|NORTH AMERICAN 1927|NAS(?:-[A-Z])?)$/i,O=/^(?:WGS84|WGS 84|WGE)$/i;function I(e){const t=function(e){return function(e){const t=function(e){switch(e){case"Projection":case"Display":return e;default:return}}(e.Type),i=function(e){switch(e){case"TC":case"PH":case"UT":case"AC":case"LE":case"SPCS":return e;default:return}}(e.Projection_Type);let n;if(i||(n="Projection is missing or has unsupported ProjectionType"),t||(n="Projection dictionary is missing or has invalid Type. Expected Projection or Display."),e.Datum||(n="Projection is missing a Datum"),n)throw new r.A("geospatial-pdf-layer:invalid-projection",n);return $(e,i),{kind:"projected",dictionaryType:t,projectionType:i,datum:e.Datum}}(e)}(e);if("projected"===t.kind){const{projectionType:i,datum:n}=t;return"SPCS"===i?function(e,t){const i=B(t);if(2800===e.Zone&&i&&Z(i))return new c.A({wkid:32110});throw new r.A("geospatial-pdf-layer:invalid-projection",`Unsupported State Plane projection: datum ${t.name}, zone ${e.Zone}`)}(e,n):new c.A({wkt:z(e,i,n)})}}function $(e,t){const i=function(e){switch(e){case"TC":return["OriginLatitude","CentralMeridian","ScaleFactor","FalseEasting","FalseNorthing"];case"PH":return["OriginLatitude","CentralMeridian","FalseEasting","FalseNorthing"];case"UT":return["Zone","Hemisphere"];case"AC":case"LE":return["OriginLatitude","CentralMeridian","StandardParallelOne","StandardParallelTwo","FalseEasting","FalseNorthing"];case"SPCS":return["Zone"]}}(t);for(const n of i){const i=e[G[n]];if(void 0===i||""===i)throw new r.A("geospatial-pdf-layer:invalid-projection",`Projection ${t} missing required parameter ${n}.`)}}function z(e,t,i){const n=function(e,t,i){const n=function(e){const t=B(e);return t?Z(t)?"NAD_1983":H(t)?"NAD_1927":k(t)?"WGS_1984":"geospatialPDF":"geospatialPDF"}(i);switch(t){case"TC":return`${n}_GeospatialPDF_Transverse_Mercator`;case"PH":return`${n}_GeospatialPDF_Polyconic`;case"UT":return`${n}_GeospatialPDF_UTM_Zone_${e.Zone}_${e.Hemisphere}`;case"AC":return`${n}_GeospatialPDF_Albers_Equal_Area`;case"LE":return`${n}_GeospatialPDF_Lambert_Conformal_Conic`}}(e,t,i),o=function(e){switch(e){case"TC":case"UT":return"Transverse_Mercator";case"PH":return"Polyconic";case"AC":return"Albers";case"LE":return"Lambert_Conformal_Conic"}}(t),s=function(e){if("definition"===e.kind){const t=e.ellipsoid;if(!t?.semi_Major_Axis)throw new r.A("geospatial-pdf-layer:invalid-Datum","Datum definition requires semi-major axis");const i=function(e){if(null!=e.inverse_Flattening)return e.inverse_Flattening;const t=e.semi_Major_Axis,i=e.semi_Minor_Axis;if(null==t||null==i)throw new r.A("geospatial-pdf-layer:invalid-Datum","Ellipsoid definition missing InvFlattening or SemiMinorAxis.");return t===i?0:t/(t-i)}(t),n=e.name??"GeospatialPDF_Datum",o=`SPHEROID["${t.description??"GeospatialPDF_Spheroid"}",${t.semi_Major_Axis},${i}]`,s=e.to_WGS84;return`DATUM["${n}",${o}${s?`,TOWGS84[${s.dx??0},${s.dy??0},${s.dz??0},${s.rx??0},${s.ry??0},${s.rz??0},${s.sf??0}]`:""}]`}if(e.name){const t=e.name.toUpperCase();if(Z(t))return'DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]]';if(H(t))return'DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]]';if(k(t))return'DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]]'}throw new r.A("geospatial-pdf-layer:invalid-Datum","Unsupported datum "+e.name)}(i),a=function(e){const t=e.toLowerCase();return["m","meter","meters","metre","metres"].includes(t)?'UNIT["Meter",1.0]':["ft","foot","feet"].includes(t)?'UNIT["Foot",0.3048]':`UNIT["${e}",1.0]`}(e.Units??"M"),l=function(e,t){switch(t){case"TC":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Scale_Factor",${e.Scale_Factor}]`];case"PH":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`];case"AC":case"LE":return[`PARAMETER["False_Easting",${e.False_Easting}]`,`PARAMETER["False_Northing",${e.False_Northing}]`,`PARAMETER["Central_Meridian",${e.Central_Meridian}]`,`PARAMETER["Latitude_Of_Origin",${e.Origin_Latitude}]`,`PARAMETER["Standard_Parallel_1",${e.Standard_Parallel_One}]`,`PARAMETER["Standard_Parallel_2",${e.Standard_Parallel_Two}]`];case"UT":return function(e){if(!e.Zone)throw new r.A("geospatial-pdf-layer:invalid-projection","No zone found for projection code UT");const t=6*e.Zone-183;return['PARAMETER["False_Easting",500000]',`PARAMETER["False_Northing",${/^s/i.test(e.Hemisphere??"")?1e7:0}]`,`PARAMETER["Central_Meridian",${t}]`,'PARAMETER["Latitude_Of_Origin",0]','PARAMETER["Scale_Factor",0.9996]']}(e)}}(e,t);return`PROJCS["${n}",GEOGCS["${function(e){const t=B(e);return t?Z(t)?"GCS_North_American_1983":H(t)?"GCS_North_American_1927":k(t)?"GCS_WGS_1984":"GCS_GeospatialPDF":"GCS_GeospatialPDF"}(i)}",${s},PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]],PROJECTION["${o}"],${l.join(",\n ")},${a}]`}function B(e){return e.name?function(e){return e.trim().toUpperCase().replace(/_/g," ").replace(/\s+/g," ")}(e.name):null}function Z(e){return N.test(e)}function H(e){return L.test(e)}function k(e){return O.test(e)}class V{constructor(e){const{bbox:t,bounds:i,gpts:n,lpts:r,gcs:o,mediaBox:s}=this.inputValidation(e);this._bbox=t,this._bounds=i,this._gpts=n,this._lpts=r,this._gcs=o,this.outerExtentMediaBox=D(s),this.geoControlPoints=this._getProjectedGeoControlPoints().map(e=>[e[0],e[1]]);const a=this._getBoundsPolygonPage()??this._getPageControlPoints();this.pairedNeatline=a.map(e=>[e[0],e[1]]),this.neatLine=this.pairedNeatline.flat(),this._georeference=this._createControlPointsGeoreference();const l=S(this._georeference);this.ctm=b(l),this.outputValidation()}toSpatialReference(){return new c.A({wkt:this._gcs.WKT})}inputValidation(e){const{bbox:t,bounds:i,gpts:n,lpts:o,gcs:s,mediaBox:a}=e;if(!t||4!==t.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid BBox.");if(!a||4!==a.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Viewport missing or invalid MediaBox.");if(!n||n.length<6||n.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid GPTS.");if(!o||o.length<6||o.length%2!=0)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid LPTS.");if(o.length!==n.length)throw new r.A("geospatial-pdf-layer: invalid-frame","MeasureFrame LPTS and GPTS must be same length");if(!s?.WKT)throw new r.A("geospatial-pdf-layer:invalid-frame","MeasureFrame missing or invalid WKT.");return{bbox:t,bounds:i,gpts:n,lpts:o,gcs:{WKT:s.WKT},mediaBox:a}}outputValidation(){if(4!==this.outerExtentMediaBox.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Failed to generate outer extent from mediaBox.");if(this.geoControlPoints.length<2)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 2 geoControlPoints.");if(this.pairedNeatline.length<4)throw new r.A("geospatial-pdf-layer:invalid-frame","Map Frame should have at least 4 neatline points.");if(!this.ctm||6!==this.ctm.length)throw new r.A("geospatial-pdf-layer:invalid-frame","Missing or invalid Map Frame CTM")}_createControlPointsGeoreference(){const e=this._getPageControlPoints(),t=this._getProjectedGeoControlPoints(),i=this._getViewportRect();return E(e,t,this.toSpatialReference(),i)}_getBoundsPolygonLocal(){if(!this._bounds||this._bounds.length<8||this._bounds.length%2!=0)return null;const e=[];for(let t=0;t<this._bounds.length;t+=2)e.push({u:this._bounds[t],v:this._bounds[t+1]});return e}_getBoundsPolygonPage(){const e=this._getBoundsPolygonLocal();return e?.map(e=>this._localToPage(e.u,e.v))??null}_getPageControlPoints(){const e=[];for(let t=0;t<this._lpts.length;t+=2){const i=this._lpts[t],n=this._lpts[t+1];e.push(this._localToPage(i,n))}return e}_getProjectedGeoControlPoints(){const e=this.toSpatialReference(),t=[];for(let i=0;i<this._gpts.length;i+=2){const n=this._gpts[i],r=this._gpts[i+1],o=new m.A({x:r,y:n}),s=(0,v.projectExecute)(o,e);t.push((0,w.fA)(s.x,s.y))}return t}_getViewportRect(){const[e,t,i,n]=this._bbox;return{xmin:Math.min(e,i),ymin:Math.min(t,n),xmax:Math.max(e,i),ymax:Math.max(t,n)}}_localToPage(e,t){const[i,n,r,o]=this._bbox;return(0,w.fA)(i+e*(r-i),n+t*(o-n))}}function U(e){const t=oe(e,"LGIDict map frame must be an object.");return{CTM:Y(t.CTM),Registration:ee(t.Registration),Neatline:Y(t.Neatline),Projection:K(t.Projection),Display:K(t.Display)}}function W(e){const t=oe(e,"Viewport frame must be an object."),i=function(e){if(re(e))return{Bounds:Y(e.Bounds),GPTS:Y(e.GPTS),LPTS:Y(e.LPTS),GCS:J(e.GCS)}}(t.Measure);return{BBox:Y(t.BBox),Measure_Raw:t.Measure,Measure:i,Raw:t}}function J(e){if(re(e))return{WKT:te(e.WKT)}}function K(e){if(re(e))return{Type:ie(e.Type),Units:ie(e.Units),Datum:q(e.Datum),Projection_Type:ie(e.ProjectionType),Central_Meridian:ne(e.CentralMeridian),False_Easting:ne(e.FalseEasting),False_Northing:ne(e.FalseNorthing),Height:ne(e.Height),Hemisphere:ie(e.Hemisphere),Latitude_One:ne(e.LatitudeOne),Latitude_Two:ne(e.LatitudeTwo),Latitude_Of_True_Scale:ne(e.LatitudeOfTrueScale),Longitude_One:ne(e.LongitudeOne),Longitude_Two:ne(e.LongitudeTwo),Longitude_Down_From_Pole:ne(e.LongitudeDownFromPole),Orientation:ie(e.Orientation),Origin_Height:ne(e.OriginHeight),Origin_Latitude:ne(e.OriginLatitude),Origin_Longitude:ne(e.OriginLongitude),Scale_Factor:ne(e.ScaleFactor),Standard_Parallel:ne(e.StandardParallel),Standard_Parallel_One:ne(e.StandardParallelOne),Standard_Parallel_Two:ne(e.StandardParallelTwo),Zone:ne(e.Zone),Description:ie(e.Description),raw:e}}function q(e){return null==e?null:"string"==typeof e?{kind:"name",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}:re(e)?{kind:"definition",name:ie(e.Description),ellipsoid:Q(e.Ellipsoid),to_WGS84:X(e.ToWGS84),raw:e}:{kind:"unknown",name:ie(e),ellipsoid:null,to_WGS84:null,raw:e}}function Q(e){if(re(e))return{semi_Major_Axis:ne(e.SemiMajorAxis),inverse_Flattening:ne(e.InvFlattening),semi_Minor_Axis:ne(e.SemiMinorAxis),description:ie(e.Description)}}function X(e){if(re(e))return{dx:ne(e.dx)??0,dy:ne(e.dy)??0,dz:ne(e.dz)??0,rx:ne(e.rx)??0,ry:ne(e.ry)??0,rz:ne(e.rz)??0,sf:ne(e.sf)??0}}function Y(e){if(!Array.isArray(e))return;const t=[];for(const i of e){const e=ne(i);if(void 0===e)return;t.push(e)}return t}function ee(e){if(Array.isArray(e))return e.filter(e=>Array.isArray(e)).map(e=>e.map(e=>ne(e)).filter(e=>void 0!==e))}function te(e){if(null!=e)return"string"==typeof e?e:String(e)}function ie(e){const t=te(e);if(void 0!==t)return t.trim()}function ne(e){if(null==e)return;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"!=typeof e)return;const t=e.trim();if(""===t)return;const i=Number(t);return Number.isFinite(i)?i:void 0}function re(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function oe(e,t){if(!re(e))throw new r.A("geospatial-pdf-layer:parse",t);return e}let se=class extends _.x_{constructor(){super(...arguments),this._connection=null,this._workerHandler=null}load(e){const t=(0,y.h)("GeospatialPDFLayerWorker",{...e,strategy:"dedicated",registryTarget:this}).then(e=>{this._connection=e,this._workerHandler=this._connection.createInvokeProxy()});return this.addResolvingPromise(t),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null,super.destroy()}async loadPDF(e,t={}){await this.load(t);const{geospatialMetadata:i}=await this._workerHandler.loadPDF(e,t),n=function(e,t=0){const i={mediaBox:Y(e.MediaBox),rotate:ne(e.Rotate),hasLGIDict:null!=e.LGIDict,hasVP:null!=e.VP},n=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>U(e)):[U(e)]}(e)[t]}(e.LGIDict,t);if(n){if(!n.Projection)throw new r.A("geospatial-pdf-layer:parse","LGIDict map frame missing Projection.");const t=I(n.Projection);let o;try{o=n.Display?I(n.Display):void 0}catch{o=t}return{result:i,lgiDictFrame:new j({ctm:n.CTM,registration:n.Registration,projection:t,display:o,neatline:n.Neatline,mediaBox:Y(e.MediaBox)})}}const o=function(e,t){return function(e){return null==e?[]:Array.isArray(e)?e.map(e=>W(e)):[W(e)]}(e)[t]}(e.VP,t);return o?{result:i,vpFrame:new V({bbox:o.BBox,bounds:o.Measure?.Bounds,gpts:o.Measure?.GPTS,lpts:o.Measure?.LPTS,gcs:o.Measure?.GCS,mediaBox:Y(e.MediaBox)})}:{result:i}}(i,0),o=n.lgiDictFrame??n.vpFrame;if(!o)throw new r.A("geospatial-pdf-layer:load","pdf does not contain supported LGIDict or VP/Measure.");const s=new R(o),a=s.spatialReference.toJSON();return{frame:s,sourceSpatialReference:a,fullExtent:s.toExtent()}}async render(e,t,i,n,r,o){const s={sourceExtentAsJSON:e.toJSON(),width:t,height:i,ctm:n,currentRing:r};return this._workerHandler.renderPDF(s,o)}};se=(0,n.Cg)([(0,l.$K)("esri.layers.geospatialPDF.GeospatialPDFWorkerClient")],se);var ae=i(49859),le=i(14140),ce=i(87186);let ue=class extends ae.A{constructor(){super(...arguments),this._workerClient=new se,this._extent=null,this._ctm=null,this._neatlineRing=[],this._width=0,this._height=0,this._tileSize=512,this.datasetFormat="PDF",this.frame=null,this.neatlineExtent=null,this.page=1,this.tileType="Raster"}destroy(){this._workerClient.destroy(),this.neatlineExtent=null,this._extent=null,this._ctm=null,this._neatlineRing=[]}async fetchRawTile(e,t,i,n={}){const r=this._extent,o=this._ctm,s=this.getTileExtentPDF(e,t,i);return s.intersects(r)?function(e){return new le.A({width:e.width,height:e.height,pixelType:"u8",pixels:[e.red,e.green,e.blue],mask:e.mask})}(await this._workerClient.render(s,this._tileSize,this._tileSize,o,this._neatlineRing,n)):null}async _open(e){if(!this.url)throw new r.A("geospatial-pdf-raster:open","GeospatialPDFRaster requires a url.");const t=await this._workerClient.loadPDF({url:this.url,page:this.page},e);this.frame=t.frame;const i=this.frame.outerExtentMediabox;if(!i)throw new r.A("geospatial-pdf-raster:open","Failed to compute Geospatial PDF extent.");this.neatlineExtent=t.fullExtent,this._extent=i,this._ctm=this.frame.ctm,this._neatlineRing=this.frame.sourceMediaBoxPolygon.rings[0];const n=function(e,t){const[i,n,o,s]=e,a=i*s-n*o;if(!Number.isFinite(a)||0===a)throw new r.A("geospatial-pdf-raster:open","Failed to derive raster dimensions from an invalid PDF CTM.");const l=10*Math.hypot(s,n)/Math.abs(a),c=10*Math.hypot(o,i)/Math.abs(a),u=Math.max(1,Math.ceil(t.width*l)),h=Math.max(1,Math.ceil(t.height*c));if(!Number.isFinite(u)||!Number.isFinite(h))throw new r.A("geospatial-pdf-raster:open","PDF CTM produced invalid raster dimensions.");return[u,h]}(this.frame.ctm,this._extent);this._width=n[0],this._height=n[1];const o={x:i.width/this._width,y:i.height/this._height},s=new ce.A({width:this._width,height:this._height,pixelType:"u8",extent:i,pixelSize:o,spatialReference:i.spatialReference,bandCount:3,keyProperties:{DataType:"Processed"}});this.createRemoteDatasetStorageInfo(s,this._tileSize,this._tileSize),this._set("rasterInfo",s),this.updateTileInfo()}getTileExtentPDF(e,t,i){const n=this._extent,r=2**e,o=n.width/this._width*r,s=n.height/this._height*r,a=new m.A({x:n.xmin,y:n.ymax});return this.getTileExtent({x:o,y:s},t,i,a,n.spatialReference,[512,512])}};(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,l.MZ)({constructOnly:!0})],ue.prototype,"page",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0})],ue.prototype,"tileType",void 0),ue=(0,n.Cg)([(0,l.$K)("esri.layers.raster.datasets.GeospatialPDFRaster")],ue);var he=i(34930),pe=i(60694),de=i(13868),fe=i(87045),ge=i(93223);let me=class extends((0,p.dM)((0,g.j)((0,d.A)((0,f.G)((0,s.M)(h.A)))))){constructor(e){super(e),this.interpolation="bilinear",this.serviceRasterInfo=null,this._frame=null,this.clippedToNeatline=!0,this.neatlineVisible=!0,this.raster=null,this.spatialReference=null,this.type="geospatial-pdf"}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["PDF"],supportsData:!1},e).catch(a.QP).then(()=>this._openRaster(e?.signal))),Promise.resolve(this)}destroy(){this._shutdownJobHandler(),this.raster?.destroy()}get fullExtent(){return this.serviceRasterInfo?.extent}set url(e){this._set("url",(0,pe.Jf)(e,o.A.getLogger(this)))}async fetchImageBitmapTile(){throw new r.A("geospatial-pdf-layer:fetch-image-bitmap-tile","GeospatialPDFLayer does not expose pre-rendered image tile URLs.")}async fetchPixels(e,t,i,n={}){return _e(this),await this._initJobHandler(),this.raster.fetchPixels(e,Math.round(t),Math.round(i),n)}async fetchTile(e,t,i,n={}){if(_e(this),n.requestAsImageElement)throw new r.A("geospatial-pdf-layer:fetch-tile","GeospatialPDFLayer does not support requestAsImageElement.");await this._initJobHandler();const o=await this.raster.fetchTile(e,t,i,n);return this.clippedToNeatline&&o.pixelBlock&&this._frame&&o.srcExtent&&(o.pixelBlock=await(0,he.$Q)(o.pixelBlock,o.srcExtent,this._frame.sourceNeatlinePolygon)),o}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,u.Vp)(e);return fe.A.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getRawDisplayBandIds(){return _e(this),[0,1,2]}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(()=>{this._rasterJobHandler&&(_e(this),this.raster.rasterJobHandler=this._rasterJobHandler)}).catch(()=>{})}async _openRaster(e){const t=new ue({url:this.url});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r.A("geospatialpdf-layer:load","cannot load resources on "+this.url);const{rasterInfo:i}=t;this._set("serviceRasterInfo",i),this.setAtOrigin("spatialReference",i.spatialReference,"service"),this.setAtOrigin("tileInfo",t.rasterInfo.storageInfo.tileInfo,"service"),this._frame=t.frame,this.raster=t}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}};function _e(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}(0,n.Cg)([(0,ge.e)(de.SZ)],me.prototype,"interpolation",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"serviceRasterInfo",void 0),(0,n.Cg)([(0,l.MZ)({clonable:!1})],me.prototype,"_compatibleFullExtent",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean})],me.prototype,"clippedToNeatline",void 0),(0,n.Cg)([(0,l.MZ)({json:{read:!1}})],me.prototype,"fullExtent",null),(0,n.Cg)([(0,l.MZ)({type:Boolean})],me.prototype,"neatlineVisible",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"raster",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,type:c.A,json:{read:!1}})],me.prototype,"spatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:fe.A})],me.prototype,"tileInfo",void 0),(0,n.Cg)([(0,l.MZ)({readOnly:!0,value:"geospatial-pdf"})],me.prototype,"type",void 0),(0,n.Cg)([(0,l.MZ)()],me.prototype,"url",null),me=(0,n.Cg)([(0,l.$K)("esri.layers.GeospatialPDFLayer")],me);const ye=me},91806(e,t,i){i.d(t,{A:()=>l});var n,r=i(32198),o=i(25482),s=i(91429),a=i(78888);let l=class extends o.o{static{n=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new n({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,r.Cg)([(0,s.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,r.Cg)([(0,s.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=n=(0,r.Cg)([(0,s.$K)("esri.layers.support.LOD")],l)},87045(e,t,i){i.d(t,{A:()=>w});var n,r=i(32198),o=i(66552),s=i(25482),a=i(86211),l=i(91429),c=i(78888),u=i(86738),h=i(16930),p=i(21325),d=i(28735),f=i(91806),g=i(72802),m=i(36005),_=i(43937);const y=new o.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let w=class extends s.o{static{n=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:o=h.A.WebMercator,numLODs:s=24}=e;if(!(0,p.fn)(o)){const e=[];if(i)for(let t=0;t<i.length;t++){const n=i[t];e.push(new f.A({level:t,scale:n,resolution:n}))}else{let t=5e-4;for(let i=s-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new n({dpi:96,lods:e,origin:new u.A(0,0,o),size:[r,r],spatialReference:o})}const l=(0,p.Vp)(o),c=e.origin?new u.A({x:e.origin.x,y:e.origin.y,spatialReference:o}):new u.A(l?{x:l.origin[0],y:l.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),d=1/(39.37*(0,a.GA)(o)*96),g=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],n=t*d;g.push(new f.A({level:e,scale:t,resolution:n}))}else{let e=(0,p.EA)(o)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(s/t);g.push(new f.A({level:0,scale:e,resolution:e*d}));for(let n=1;n<i;n++){const i=e/2**t,r=i*d;g.push(new f.A({level:n,scale:i,resolution:r})),e=i}}return new n({dpi:96,lods:g,origin:c,size:[r,r],spatialReference:o})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,p.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return u.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const n=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{n.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",n),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),n=i+1;return t[i]/(t[i]/t[n])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let n=0;for(;n<i;n++){const i=t[n],r=t[n+1];if(i<=e)return n;if(r===e)return n+1;if(i>e&&r<e)return n+Math.log(i/e)/Math.log(i/r)}return n}tileAt(e,t,i,n){const r=this.lodAt(e);if(!r)return null;let o,s;if("number"==typeof t)o=t,s=i;else if((0,p.aI)(t.spatialReference,this.spatialReference))o=t.x,s=t.y,n=i;else{const e=(0,d.Cv)(t,this.spatialReference);if(null==e)return null;o=e.x,s=e.y,n=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return n??=new g.U(0,0,0),n.level=e,n.row=Math.floor((this.origin.y-s)/l+.001),n.col=Math.floor((o-this.origin.x)/a+.001),this.updateTileInfo(n),n}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:n}=i,r=n*this.size[0],o=n*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*o,e[2]=e[0]+r,e[3]=e[1]+o,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return n.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const n=e+t,{scale:r,resolution:o}=n>=0?this.lods[n]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:r,resolution:o}))}return new n({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const n=e[i];this._upsampleLevels[n.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/n.resolution:0},t=n}}};(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],w.prototype,"dpi",void 0),(0,r.Cg)([(0,l.MZ)({type:String,json:{read:y.read,write:y.write,origins:{"web-scene":{read:!1,write:!1}}}})],w.prototype,"format",void 0),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"isWrappable",null),(0,r.Cg)([(0,l.MZ)({type:u.A,json:{write:!0}})],w.prototype,"origin",void 0),(0,r.Cg)([(0,m.w)("origin")],w.prototype,"readOrigin",null),(0,r.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],w.prototype,"lods",null),(0,r.Cg)([(0,l.MZ)({readOnly:!0})],w.prototype,"scales",void 0),(0,r.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],w.prototype,"size",void 0),(0,r.Cg)([(0,m.w)("size",["rows","cols"])],w.prototype,"readSize",null),(0,r.Cg)([(0,_.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],w.prototype,"writeSize",null),(0,r.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],w.prototype,"spatialReference",void 0),w=n=(0,r.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],w)},72802(e,t,i){i.d(t,{U:()=>r});var n=i(19419);class r{constructor(e,t,i,r=(0,n.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2100],{52106(e,t,r){r.d(t,{A:()=>w});var i,s,n=r(32198),o=r(37838),l=r(69540),a=r(51447),u=r(25482),p=r(53966),c=r(36708),g=r(24326),h=r(91429),f=r(12195),y=r(65864),d=r(50498),m=r(55156),b=r(60950),v=r(54339),x=r(94128),M=r(33910);const _=Symbol("meshGeometryHandles");function I(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let w=class extends((0,l.OU)(u.o)){static{i=x.Z}static{s=this}constructor(e){super(e),this[i]=!0,this.distance=null,this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this.statisticsAggregatedIds=void 0,this._version=0,Object.defineProperty(this,"uid",{value:(0,g.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(p.A.getLogger(this),"Graphic",{version:"4.30"})}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),this._watchMeshGeometryChanges(),this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new s({aggregateGeometries:this.aggregateGeometries,statisticsAggregatedIds:this.statisticsAggregatedIds,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,b.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const r=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[r,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,m.I)(this.origin);if(e)return(0,v.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,v.r)(this,t):null}getGlobalId(){const e=(0,m.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){const e={aggregateGeometries:I(this.aggregateGeometries),geometry:this.geometry?.toJSON()??null,symbol:this.symbol?.toJSON()??null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null};return this.statisticsAggregatedIds?.length&&(e.aggregateIds=[...this.statisticsAggregatedIds]),null!=this.distance&&(e.distance=this.distance),e}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(s.action=i),"attributes"===e&&(s.attributeName=i),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.removeHandles(_);const e=this.geometry;"mesh"===e?.type&&this.addHandles([(0,c.z7)(()=>e.vertexSpace.origin?{localMatrix:e.transform?.localMatrix,origin:e.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>({vertexAttributes:e.vertexAttributes}),()=>{e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",e,e)},{equals:(e,t)=>e===t,sync:!0})],_)}};(0,n.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,y.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],w.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,h.MZ)({value:null})],w.prototype,"attributes",null),(0,n.Cg)([(0,h.MZ)({value:null,types:d.yR,json:{read:y.rS}})],w.prototype,"geometry",null),(0,n.Cg)([(0,h.MZ)()],w.prototype,"distance",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean})],w.prototype,"isAggregate",void 0),(0,n.Cg)([(0,h.MZ)({clonable:!1})],w.prototype,"layer",void 0),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],w.prototype,"origin",void 0),(0,n.Cg)([(0,h.MZ)({type:o.A,value:null})],w.prototype,"popupTemplate",null),(0,n.Cg)([(0,h.MZ)({clonable:"reference"})],w.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,h.MZ)({json:{name:"aggregateIds",read:e=>e?.map(e=>Array.isArray(e)?JSON.stringify(e):e)}})],w.prototype,"statisticsAggregatedIds",void 0),(0,n.Cg)([(0,h.MZ)({value:null,types:M.Es})],w.prototype,"symbol",null),(0,n.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],w.prototype,"_version",void 0),(0,n.Cg)([(0,h.MZ)({type:Boolean,value:!0})],w.prototype,"visible",null),w=s=(0,n.Cg)([(0,h.$K)("esri.Graphic")],w)},19334(e,t,r){r.d(t,{e:()=>o});var i=r(54639),s=r(14112);class n{constructor(e){this._geometry=e}toJsonGeometry(){return this._geometry.toJSON()}toAccessorGeometry(e){return this._geometry}toGxGeometry(e){return e.fromAccessorGeometry(this._geometry)}}function o(e){if(null==e)return null;switch(e.type){case"point":if((0,s.e6)(e))return null;break;case"polygon":if((0,s.Wq)(e))return null;break;case"polyline":if((0,s.IY)(e))return null;break;case"multipoint":if((0,s.DG)(e))return null;break;case"extent":if((0,s.As)(e))return null;break;default:return null}const t=i.R.of(e.type,e.spatialReference,e.hasZ,e.hasM,new n(e));return t.asAccessorGeometry(),t}},36983(e,t,r){r.d(t,{R:()=>u,p:()=>p});var i=r(54639),s=r(14112),n=r(16930),o=r(60408),l=r(65864);class a{constructor(e){this._geometry=e}toJsonGeometry(){return this._geometry}toAccessorGeometry(e){const t=(0,l.rS)(this._geometry);return t.spatialReference=e,t}toGxGeometry(e){return e.fromJsonGeometry(this._geometry)}}function u(e,t){if(null==e||"object"!=typeof e)return null;let r=t;if("spatialReference"in e&&(e.spatialReference instanceof n.A?r=e.spatialReference:"object"==typeof e.spatialReference&&null!=e.spatialReference&&(r=new n.A,r.read(e.spatialReference))),null==r)throw new Error("Spatial reference required");return(0,o.fT)(e)?p("point",e,r):(0,o.Rg)(e)?p("polyline",e,r):(0,o.Bi)(e)?p("polygon",e,r):(0,o.U9)(e)?p("multipoint",e,r):(0,o.ZC)(e)?p("extent",e,r):null}function p(e,t,r){if(null==t)return null;let n=!1,o=!1;switch(e){case"point":if((0,s.e6)(t))return null;n=void 0!==t.z,o=void 0!==t.m;break;case"polygon":if((0,s.Wq)(t))return null;n=!0===t.hasZ,o=!0===t.hasM;break;case"polyline":if((0,s.IY)(t))return null;n=!0===t.hasZ,o=!0===t.hasM;break;case"multipoint":if((0,s.DG)(t))return null;n=!0===t.hasZ,o=!0===t.hasM;break;case"extent":if((0,s.As)(t))return null;n=null!=t.zmin&&null!=t.zmax,o=null!=t.mmin&&null!=t.mmax;break;default:throw new Error("Unsupported geometry type: "+t.type)}return i.R.of(e,r,n,o,new a(t))}},14112(e,t,r){function i(e){return"NaN"===e.x||null===e.x||isNaN(e.x)}function s(e){if(0===(e.curveRings??e.rings).length)return!0;for(const t of e.curveRings??e.rings)if(t.length>0)return!1;return!0}function n(e){if(0===(e.curvePaths??e.paths).length)return!0;for(const t of e.curvePaths??e.paths)if(t.length>0)return!1;return!0}function o(e){return 0===e.points.length}function l(e){return"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)}r.d(t,{As:()=>l,DG:()=>o,IY:()=>n,Wq:()=>s,e6:()=>i})},13069(e,t,r){r.d(t,{AG:()=>l,lk:()=>s,vD:()=>o,yS:()=>n});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${s().toUpperCase()}}`}function o(){return`{${s()}}`}function l(e){const t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},83027(e,t,r){const i=r(29953).ho;r.d(t,["h",0,i])},55156(e,t,r){r.d(t,{I:()=>s});const i=Symbol("idFieldsProviderSymbol");function s(e){return(t=e)&&i in t?e[i]:void 0;var t}r.d(t,["e",0,i])},54339(e,t,r){function i(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const r=[];for(const i of t.fieldNames)r.push(e.attributes[i]??null);return JSON.stringify(r)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>i,r:()=>s})},69208(e,t,r){var i=r(32198),s=r(91429);r.d(t,["d",0,e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.CustomParametersMixin")],r),r}])},10497(e,t,r){r.d(t,{z:()=>f});var i=r(32198),s=r(91429),n=r(89317),o=r(69540),l=r(25482);let a=class extends((0,o.OU)(l.o)){constructor(e){super(e),this.name=null,this.type=null,this.title=null}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({type:["change-from-first","change-from-previous","percent-change-from-first","percent-change-from-previous"],json:{write:{isRequired:!0}}})],a.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],a.prototype,"title",void 0),a=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesCalculation")],a);const u=a;let p=class extends((0,o.OU)(l.o)){constructor(e){super(e),this.fieldName=null,this.timeValue=null}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"fieldName",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],p.prototype,"timeValue",void 0),p=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesFieldTimeMapping")],p);const c=p;var g=r(79677);let h=class extends((0,o.OU)(l.o)){constructor(e){super(e),this.name=null,this.fieldTimeMappings=null,this.timeExtent=null,this.timeInterval=null,this.timeIntervalUnits=null,this.timeValueUnits=null,this.title=null,this.calculationMethods=null,this.type="time-series-fields"}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"name",void 0),(0,i.Cg)([(0,s.MZ)({type:[c],json:{write:{isRequired:!0}}})],h.prototype,"fieldTimeMappings",void 0),(0,i.Cg)([(0,s.MZ)({type:g.A,json:{write:!0}})],h.prototype,"timeExtent",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,json:{write:{isRequired:!0}}})],h.prototype,"timeInterval",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"timeIntervalUnits",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{isRequired:!0}}})],h.prototype,"timeValueUnits",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({type:[u],json:{write:!0}})],h.prototype,"calculationMethods",void 0),(0,i.Cg)([(0,s.MZ)({type:String,readOnly:!0,json:{write:{isRequired:!0}}})],h.prototype,"type",void 0),h=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeSeriesInfo")],h);const f=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.dataSeriesInfos=null}};return(0,i.Cg)([(0,s.MZ)({type:[h],json:{read:{source:["layerDefinition.dataSeriesInfos","dataSeriesInfos"],reader:(e,t,r)=>{const i=t?.layerDefinition?.dataSeriesInfos??t.dataSeriesInfos;return i?.filter(e=>"time-series-fields"===e.type).map(e=>h.fromJSON(e,r))}},write:{target:"layerDefinition.dataSeriesInfos",enabled:!0,allowNull:!0,layerContainerTypes:n.K},origins:{"web-scene":{write:!1,read:!1}}}})],r.prototype,"dataSeriesInfos",void 0),r=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.DataSeriesLayer")],r),r}},17036(e,t,r){r.d(t,{p:()=>a});var i=r(44208),s=r(53966),n=r(20437),o=r(95466),l=r(30524);function a(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,i.A)("big-integer-warning-enabled")){const t=e.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(t.length){const e=t.map(e=>`'${e.name}'`).join(", ");s.A.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.A.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},32730(e,t,r){r.d(t,{BI:()=>h,D3:()=>c,XJ:()=>g,lc:()=>p,mX:()=>y,rU:()=>f,tH:()=>x,zA:()=>_});var i=r(799);const s="__begin__",n="__end__",o=new RegExp(s,"ig"),l=new RegExp(n,"ig"),a=new RegExp("^"+s,"i"),u=new RegExp(n+"$","i");function p(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function c(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function g(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=p(e.labelExpression),t.type="conventional"),t}function h(e){const t=g(e);if(!t)return null;switch(t.type){case"conventional":return y(t.expression);case"arcade":return t.expression}return null}function f(e){const t=g(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(d);return t?.[1].trim()||null}(t.expression);case"arcade":return x(t.expression)}return null}function y(e){let t;return e?(t=(0,i.HC)(e,e=>s+'$feature["'+e+'"]'+n),t=a.test(t)?t.replace(a,""):'"'+t,t=u.test(t)?t.replace(u,""):t+'"',t=t.replaceAll(o,'" + ').replaceAll(l,' + "')):t='""',t}const d=/^\s*\{([^}]+)\}\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,v=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function x(e){if(!e)return null;let t=m.exec(e)||b.exec(e);return t?t[1]||t[3]:(t=v.exec(e),t?t[2]:null)}const M=Symbol("LabelClassInstance");function _(e){return null!=e&&"object"==typeof e&&M in e}r.d(t,["vK",0,M])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5752],{69052(e,t,i){i.d(t,{hr:()=>s});var n=i(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return r(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+a(this.range,e-t,i)}minimalMonotonic(e,t,i){return r(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(n)?i:n}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function r(e,t,i,n,s=0,r=!1){return(n-=s)<t?n+=a(e,t-n):n>i&&(n-=a(e,n-i)),r&&n===i&&(n=t),n+s}function a(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const o=new s(0,2*Math.PI),l=(new s(-Math.PI,Math.PI),new s(0,360));i.d(t,["ie",0,l,"uC",0,o])},18370(e,t,i){i.d(t,{z:()=>s});class n{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 s(e){return new n(e)}},44123(e,t,i){i.d(t,{WhereClauseCache:()=>r});var n=i(66344),s=i(89696);class r{constructor(e,t){this._cache=new n.q(e),this._invalidCache=new n.q(t)}get(e,t){const i=`${t?.uid}:${e}`,n=this._cache.get(i);if(n)return n;if(null!=this._invalidCache.get(i))return null;try{const n=s.A.create(e,{fieldsIndex:t});return this._cache.put(i,n),n}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t?.uid}:${e}`;return this._invalidCache.get(i)??null}}},46329(e,t,i){i.d(t,{y:()=>d});var n=i(49186),s=i(4305),r=i(513),a=i(50954),o=i(52006),l=i(49663),u=i(46068),c=i(59803);function d(e,t,i){if((0,o.Xq)(t))return(0,c.T)(e,t,i);if((0,o.n1)(t)){const r=(0,s.m_)(e,t,i)[0];if(null==r)throw new n.A("closestPointOnCurve:unexpected-error","Failed to find close point on bezier curve");return r}if((0,o.aO)(t)){const n=(0,a.pM)(e,t);return(0,r.fM)(n,i)}if((0,o.DA)(t)){const n=(0,l.io)(e,t);return(0,r.fM)(n,i)}const d=(0,u.SW)(e,t);return(0,u.pb)(d,i)}},52039(e,t,i){i.d(t,{O7:()=>p,el:()=>u});var n=i(69052),s=(i(49186),i(18370)),r=i(17676),a=(i(5443),i(39829)),o=(i(82799),i(16930)),l=(i(80754),i(21325));async function u(e,t,i){Array.isArray(e)||(e=[e]),null!=t&&"object"==typeof t&&"authMode"in t&&(i=t);let n=null;for(const t of e)n??=t?.spatialReference;if(!n)return e;const s=(0,l.Vp)(n);if(!s)return e;if(1===e.length&&"extent"===e[0]?.type){const t=e[0].clone().normalizeAsSingleGeometry(s);return["xmin"in t?t:new a.A(t)]}const[o,u]=s.valid;let p=!1;for(const t of e){if(!t)continue;if("point"===t.type){p||=t.x>=u,p||=t.x<=o;continue}const{extent:e}=t;if(null==e){p=!0;break}p||=e.xmin>=u,p||=e.xmin<=o,p||=e.xmax>=u,p||=e.xmax<=o}if(!p)return e;const[{foldInto360Range:f},m]=await(0,r.qr)(Promise.all([c.getImportPromise(),d.getImportPromise()]),i),h=m.fromSpatialReference(n);return e.map(e=>{if(null==e||"mesh"===e.type)return e;const t=m.fromGeometry(e),i=m.toGeometry(f(t,h),n);return"extent"===e.type&&1===i?.rings.length?i.extent:i})}const c=(0,s.z)(()=>i.e(4144).then(()=>i(4144)).then(e=>e.load().then(()=>e))),d=(0,s.z)(()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(1550)]).then(()=>i(78125)));function p(e,t,i){const n=(0,l.Vp)(i);if(null==n)return e;const[s,r]=n.valid,a=2*r;let o=0,u=0;t>r?o=Math.ceil(Math.abs(t-r)/a):t<s&&(o=-Math.ceil(Math.abs(t-s)/a)),e>r?u=Math.ceil(Math.abs(e-r)/a):e<s&&(u=-Math.ceil(Math.abs(e-s)/a));let c=e+(o-u)*a;const d=c-t;return d>r?c-=a:d<s&&(c+=a),c}function f(e){const t=(0,l.Vp)(e);if(null==t)return null;const[i,s]=t.valid;return new n.hr(i,s)}const m=f(o.A.WGS84);f(o.A.WebMercator),i.d(t,["Y_",0,m])},80754(e,t,i){i.d(t,{kS:()=>u,kd:()=>l});var n=i(82799),s=i(16930),r=i(60408),a=i(52006);const o={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function l(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){if((0,a.Ed)(e))for(const i of function(e){return(0,r.Bi)(e)?e.curveRings:e.curvePaths}(e))for(const e of i){if((0,a.aO)(e)){const[i,n]=e.c;i[0]+=t,n[0]+=t;continue}if((0,a.FG)(e)){const[i,n]=e.a;i[0]+=t,n[0]+=t;continue}if((0,a.n1)(e)){const[i,n,s]=e.b;i[0]+=t,n[0]+=t,s[0]+=t;continue}e[0]+=t}for(const i of function(e){return(0,r.Bi)(e)?e.rings:e.paths}(e))for(const e of i)e[0]+=t;return e}i.d(t,["j7",0,o])},62577(e,t,i){function n(e){return e?{originPosition:"upper-left"===e.originPosition?"upperLeft":"lower-left"===e.originPosition?"lowerLeft":e.originPosition,scale:e.tolerance?[e.tolerance,e.tolerance,1,1]:[1,1,1,1],translate:null!=e.extent?[e.extent.xmin,e.extent.ymax,e.extent.zmin??0,e.extent.mmin??0]:[0,0,0,0]}:null}function s(e){if(function(e){return"lowerLeft"===e.originPosition&&4===e.scale.length&&4===e.translate.length}(e))return e;const{originPosition:t,scale:i,translate:n}=e,s=i[0]??1,r=i[1]??1;return{originPosition:"lowerLeft",scale:[s,"lowerLeft"===t?r:-r,i[2]??1,i[3]??1],translate:[n[0]??0,n[1]??0,n[2]??0,n[3]??0]}}function r({scale:e,translate:t},i){return Math.round((i-t[0])/e[0])}function a({scale:e,translate:t},i){return Math.round((i-t[1])/e[1])}function o({scale:e,translate:t},i){return i*e[0]+t[0]}function l({scale:e,translate:t},i){return i*e[1]+t[1]}function u({scale:e,translate:t},i){return(i??0)*e[2]+t[2]}function c({scale:e,translate:t},i){return i?i*e[3]+t[3]:0}function d(e,t){return e&&t?h:e&&!t?f:!e&&t?m:p}i.d(t,{$X:()=>T,B2:()=>a,Gy:()=>g,IE:()=>r,P5:()=>v,Q1:()=>s,SW:()=>x,Tr:()=>_,VV:()=>n});const p=(e,t)=>{const i=new Array(t.length);if(!t.length)return i;const n=t[0];let s=o(e,n[0]),r=l(e,n[1]);i[0]=[s,r];const{scale:a,originPosition:u}=e,c=a[0],d="lowerLeft"===u?a[1]:-a[1];for(let e=1;e<t.length;e++){const[n,a]=t[e];s+=c*n,r+=d*a,i[e]=[s,r]}return i},f=(e,t)=>{const i=new Array(t.length);if(!t.length)return i;const n=t[0];let s=o(e,n[0]),r=l(e,n[1]);i[0]=[s,r,u(e,n[2])];const{scale:a,originPosition:c}=e,d=a[0],p="lowerLeft"===c?a[1]:-a[1];for(let n=1;n<t.length;n++){const[a,o,l]=t[n];s+=d*a,r+=p*o,i[n]=[s,r,u(e,l)]}return i},m=(e,t)=>{const i=new Array(t.length);if(!t.length)return i;const n=t[0];let s=o(e,n[0]),r=l(e,n[1]);i[0]=[s,r,c(e,n[2])];const{scale:a,originPosition:u}=e,d=a[0],p="lowerLeft"===u?a[1]:-a[1];for(let n=1;n<t.length;n++){const[a,o,l]=t[n];s+=d*a,r+=p*o,i[n]=[s,r,c(e,l)]}return i},h=(e,t)=>{const i=new Array(t.length);if(!t.length)return i;const n=t[0];let s=o(e,n[0]),r=l(e,n[1]);i[0]=[s,r,u(e,n[2]),c(e,n[3])];const{scale:a,originPosition:d}=e,p=a[0],f="lowerLeft"===d?a[1]:-a[1];for(let n=1;n<t.length;n++){const[a,o,l,d]=t[n];s+=p*a,r+=f*o,i[n]=[s,r,u(e,l),c(e,d)]}return i};function y(e,t,i){const n=new Array(i.length);for(let s=0;s<i.length;s++)n[s]=t(e,i[s]);return n}function g(e,t,i){const n=s(e);return t.x=r(n,i.x),t.y=a(n,i.y),null!=i.z&&(t.z=function({scale:e,translate:t},i){return Math.round(((i??0)-t[2])/e[2])}(n,i.z)),null!=i.m&&(t.m=function({scale:e,translate:t},i){return i?Math.round((i-t[3])/e[3]):0}(n,i.m)),t}function x(e,t,i,n=i?.hasZ??!1,r=i?.hasM??!1){if(null!=i){const a=s(e);t.points=d(n,r)(a,i.points),t.hasZ=n,t.hasM=r}return t}function _(e,t,i,n=null!=i?.z,r=null!=i?.m){if(null==i)return t;const a=s(e);return t.x=o(a,i.x),t.y=l(a,i.y),n&&(t.z=u(a,i.z)),r&&(t.m=c(a,i.m)),t}function T(e,t,i,n=i?.hasZ??!1,r=i?.hasM??!1){if(null!=i){const a=s(e);t.rings=y(a,d(n,r),i.rings),t.hasZ=n,t.hasM=r}return t}function v(e,t,i,n=i?.hasZ??!1,r=i?.hasM??!1){if(null!=i){const a=s(e);t.paths=y(a,d(n,r),i.paths),t.hasZ=n,t.hasM=r}return t}},75752(e,t,i){i.d(t,{do:()=>G,qo:()=>L,Wc:()=>q});var n=i(4576),s=i(21818),r=i(49186),a=(i(44208),i(4718)),o=i(97768),l=i(17676),u=i(86211),c=i(12195),d=i(99917),p=i(70328),f=i(19419),m=i(537),h=i(60408),y=i(65864),g=i(52039),x=i(21325),_=i(90708),T=i(29441),v=i(51441),S=i(31464);class I{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,n]of this._storage){if(!(n.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new E(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let F=0;class E{constructor(e){this.items=e,this.time=performance.now(),this.id=F++}}var R=i(99352),w=i(8384),A=i(58727),b=i(62660),M=i(43668);const C="unsupported-query";async function O(e,{fieldsIndex:t,geometryType:i,spatialReference:n,availableFields:s}){if(null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.A(C,"Unsupported query options",{query:e});return N(t,s,e),function(e,t,i){const{outStatistics:n,groupByFieldsForStatistics:s,having:a}=i,o=s?.length,l=n?.length;if(a){if(!o||!l)throw new r.A(C,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,T.eD)(e,t,a,n,i)}if(l){if(!(0,T._d)(n))return;const a=(0,T.g9)(e,n,s);(0,T.MG)(e,t,a,{expressionName:"statistics",query:i});for(const s of n){const{onStatisticField:n,statisticType:a}=s;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in s))e.get(n)&&"count"!==a&&"min"!==a&&"max"!==a&&(0,T.MG)(e,t,[n],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:V,query:i});else{const{statisticParameters:e}=s;if(!e)throw new r.A(C,"statisticParameters should be set for percentile type",{definition:s,query:i})}}}}(t,s,e),Promise.all([(0,b.c0)(e,i,n),(0,S.Nk)(n,e.outSR)]).then(()=>e)}function N(e,t,i){const{returnDistinctValues:n,outStatistics:s}=i,a=s?s.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in i&&i.orderByFields&&i.orderByFields.length>0){const n=" asc",s=" desc",r=i.orderByFields.map(e=>{const t=e.toLowerCase();return t.includes(n)?t.split(n)[0]:t.includes(s)?t.split(s)[0]:e}).filter(e=>!a.includes(e));(0,T.MG)(e,t,r,{expressionName:"orderByFields",query:i})}if("outFields"in i)if(i.outFields?.length)(0,T.MG)(e,t,i.outFields,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(n)throw new r.A(C,"outFields should be specified for returnDistinctValues",{query:i});(0,T.SN)(e,t,i.where,i)}const V=new Set([...T.vl,...T.VW]);async function z(e,t,i,n){let s=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,M.l)();s=e.extractFieldNames(i.valueExpression)}if(i.field&&s.push(i.field),i.field2&&s.push(i.field2),i.field3&&s.push(i.field3),i.normalizationField&&s.push(i.normalizationField),!s.length&&!i.valueExpression)throw new r.A(C,"field or valueExpression is required",{params:i});(0,T.MG)(e,t,s,{expressionName:"statistics",query:n})}var D=i(86420),B=i(95466),P=i(92359);class G{constructor(e){this._changeHandle=null,this.capabilities={query:R.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new I,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,this._changeHandle=this.featureStore.events.on("changed",()=>this._clearCache()),this.fieldsIndex=(0,c.W)(e.fieldsIndex)?e.fieldsIndex:B.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map(e=>e.name)):this.availableFields=new Set(e.availableFields.map(e=>this.fieldsIndex.get(e)?.name).filter(e=>null!=e)),e.scheduler&&e.priority?this._frameTask=e.scheduler.registerTask(e.priority):this._frameTask=P.nu}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}async executeQuery(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryFeatureSet(e),i)}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForCount(e),i)}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForExtent(e),i)}async executeQueryForIds(e,t){return Array.from(await this.executeQueryForIdSet(e,t))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForIdSet(e),i)}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});return await this._frameTask.scheduleGenerator(()=>this._executeQueryForLatestObservations(e),i)}async executeQueryForOpaqueFeatures(e,t){const i=(0,l.Mq)(t);return(await this._frameTask.scheduleGenerator(()=>this._executeQuery(e,{}),i)).items}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);return e=(0,a.o8)(e),await this._frameTask.scheduleGenerator(()=>this._executeAttributeBinsQuery(e),i)}async executeQueryForSummaryStatistics(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSummaryStatistics(e,t),n)}async executeQueryForUniqueValues(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForUniqueValues(e,t),n)}async executeQueryForClassBreaks(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForClassBreaks(e,t),n)}async executeQueryForHistogram(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForHistogram(e,t),n)}async executeQueryForSnapping(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSnapping(e,i),i)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,D.W)(this.timeInfo,this.featureStore);const[i,n]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:n}}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async*_executeQueryFeatureSet(e){try{const t=yield*this._executeQuery(e,{});return yield,await t.createQueryResponse()}catch(t){if(t!==A.v8)throw t;return await new w.G([],e,this).createQueryResponse()}}async*_executeQueryForCount(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null});return yield,t.createQueryResponseForCount()}catch(e){if(e!==A.v8)throw e;return 0}}async*_executeQueryForExtent(e){const t=e.outSR;try{const i=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const n=i.size;if(!n)return{count:0,extent:null};const s=await this._getBounds(i.items,i.spatialReference,t??this.spatialReference);return yield,{count:n,extent:s}}catch(e){if(e===A.v8)return{count:0,extent:null};throw e}}async*_executeQueryForIdSet(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const i=t.items,n=new Set;for(const e of i)n.add(t.featureAdapter.getObjectId(e));return n}catch(e){if(e===A.v8)return new Set;throw e}}async*_executeQueryForLatestObservations(e){try{const t=yield*this._executeQuery(e,{});return yield,this._filterLatest(t),yield,await t.createQueryResponse()}catch(t){if(t!==A.v8)throw t;return await new w.G([],e,this).createQueryResponse()}}async*_executeAttributeBinsQuery(e){let t;try{e=await(0,A.iJ)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t){const i=e.bin;if(!i.onField&&!i.onExpression?.value||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new r.A(C,"Unsupported query options",{query:e});return O(e,t)}(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield,t=yield*this._executeGeometryQuery(e,i),yield,this._executeAggregateIdsQuery(t),yield,this._executeObjectIdsQuery(t),yield,this._executeTimeQuery(t),yield,this._executeAttributesQuery(t),yield}catch(i){if(i!==A.v8)throw i;t=new w.G([],e,this)}return await t.createQueryBinsResponse(e)}async*_executeQueryForSummaryStatistics(e={},t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createSummaryStatisticsResponse(t)}async*_executeQueryForUniqueValues(e={},t){const{field:i,field2:n,field3:s,valueExpression:r}=t,a=yield*this._executeQueryForStatistics(e,{field:i,field2:n,field3:s,valueExpression:r});return yield,await a.createUniqueValuesResponse(t)}async*_executeQueryForClassBreaks(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createClassBreaksResponse(t)}async*_executeQueryForHistogram(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createHistogramResponse(t)}async*_executeQueryForSnapping(e,t){const{point:i,distance:n,returnEdge:s,vertexMode:r}=e;if(!s&&"none"===r)return{candidates:[]};let o=(0,a.o8)(e.query);o=await(0,A.T2)(o,this.definitionExpression,this.spatialReference),yield,o=await O(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const l=!(0,x.aI)(i.spatialReference,this.spatialReference);l&&(await(0,S.Nk)(i.spatialReference,this.spatialReference),yield);const u="number"==typeof n?n:n.x,c="number"==typeof n?n:n.y,d={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},p=l?(0,S.Cv)(d,this.spatialReference):d;if(!p)return{candidates:[]};const[f]=await(0,g.el)((0,y.rS)(i),{signal:t});yield;const[m]=await(0,g.el)((0,y.rS)(p),{signal:t});if(yield,null==f||null==m)return{candidates:[]};const h=await this._searchFeatures(L(m.toJSON()));yield;const _=new w.G(h,o,this);this._executeObjectIdsQuery(_),yield,this._executeTimeQuery(_),yield,this._executeAttributesQuery(_),yield,yield*this._executeGeometryQueryForSnapping(_),yield;const T=f.toJSON(),v=l?(0,S.Cv)(T,this.spatialReference):T,I=l?Math.max(p.xmax-p.xmin,p.ymax-p.ymin)/2:n;return _.createSnappingResponse({...e,point:v,distance:I},o.returnZ,i.spatialReference)}async _getBounds(e,t,i){const n=(0,p.hZ)((0,p.vt)(),p.qv);return await this.featureStore.forEachBounds(e,e=>(0,p.RF)(n,e)),q(n,t,i,this.spatialReference,this.hasZ)}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _getAllFeaturesQueryEngineResult(e){return new w.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach(t=>e.push(t)))().then(()=>(0,s.z)(e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async*_executeQuery(e,t){e=(0,a.o8)(e),e=await(0,A.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await O(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield,e={...e,...t};const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),n}async*_executeSceneFilterQuery(e){if(null==e.sceneFilter)return null;const{outSR:t,returnGeometry:i,returnCentroid:n}=e,s=this.featureStore.featureSpatialReference,r=e.sceneFilter.geometry,a=null==s||(0,x.aI)(s,r.spatialReference)?r:(0,S.Cv)(r,s);if(!a)return null;const o=i||n,l=(0,x.fn)(t)&&!(0,x.aI)(this.spatialReference,t)&&o?async e=>this._project(e,t):e=>e;yield;const u=this.featureAdapter,c=await this._searchFeatures(L(a));if(yield,"disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const t=new Set;for(const e of c)t.add(u.getObjectId(e));const i=await this._getAllFeatures();yield;const n=await(0,b.xt)("esriSpatialRelDisjoint",a,this.geometryType);yield;const s=e=>!t.has(u.getObjectId(e))||n(u.getGeometry(e)),r=yield*this._runSpatialFilter(i,s);yield;const o=new w.G(r,e,this);return await l(o)}if(!c.length)return new w.G([],e,this);if(this._canExecuteSinglePass(a,e))return await l(new w.G(c,e,this));const d=await(0,b.xt)("esriSpatialRelContains",a,this.geometryType);yield;const p=yield*this._runSpatialFilter(c,e=>d(u.getGeometry(e)));return yield,await l(new w.G(p,e,this))}async*_executeGeometryQuery(e,t){if(null!=t&&0===t.items.length)return t;const{geometry:i,outSR:s,returnGeometry:r,returnCentroid:a}=e,o=t?null:this._getCacheKey(e),l=o?this._cache.get(o):null;if(l)return new w.G(l,e,this);const u=(0,x.fn)(s)&&!(0,x.aI)(this.spatialReference,s),c=r||a,d=async e=>(u&&c&&await this._project(e,s),o&&this._cache.put(o,e.items),e),p=this.featureStore.featureSpatialReference,f=!i||null==p||(0,x.aI)(p,i.spatialReference)?i:(0,S.Cv)(i,p);if(!f)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));yield;const m=this.featureAdapter;let h=await this._searchFeatures(L(i));yield;const y=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===y){if(!h.length)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of h)i.add(m.getObjectId(e));let n;null!=t?n=t.items:(yield,n=await this._getAllFeatures(),yield);const s=await(0,b.xt)(y,f,this.geometryType);yield;const r=e=>!i.has(m.getObjectId(e))||s(m.getGeometry(e)),a=yield*this._runSpatialFilter(n,r);yield;const o=new w.G(a,e,this);return await d(o)}if(null!=t){const e=new n.vW;h=h.filter(i=>(0,n.qh)(t.items,i,t.items.length,e)>=0)}if(!h.length){const t=new w.G([],e,this);return o&&this._cache.put(o,t.items),t}if(this._canExecuteSinglePass(f,e))return await d(new w.G(h,e,this));const g=await(0,b.xt)(y,f,this.geometryType);yield;const _=yield*this._runSpatialFilter(h,e=>g(m.getGeometry(e)));return yield,await d(new w.G(_,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(e=>t.add(e));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,D.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,T.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(e=>t.testFeature(e,this.featureAdapter))}}async*_executeGeometryQueryForSnapping(e){const{query:t}=e,{spatialRel:i}=t;if(!e?.items?.length||!t.geometry||!i)return;const n=await(0,b.xt)(i,t.geometry,this.geometryType);yield;const s=this.featureAdapter,r=yield*this._runSpatialFilter(e.items,e=>n(s.getGeometry(e)));e.items=r}*_runSpatialFilter(e,t){if(!t)return e;if(null==this._frameTask)return e.filter(e=>t(e));let i=yield;const n=new Array;for(const s of e)t(s)&&n.push(s),i.madeProgress(),i.done&&(i=yield);return n}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:n}=this.timeInfo,s=n||i,r=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),n=a(i,s),o=r.get(e);(!o||n>a(o,s))&&r.set(e,i)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:n,returnCentroid:s,outSR:r,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=n||s;return(0,x.fn)(r)&&!(0,x.aI)(this.spatialReference,r)&&l?JSON.stringify([t,i,r]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,b.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,x.aI)(this.spatialReference,t))return e;const i=this.featureAdapter,n=(0,d.isLoaded)()?await this._getFullExtent():void 0,r=await(0,S.lK)(e.items.map(e=>(0,v.pL)(this.geometryType,i.getGeometry(e))),this.spatialReference,t,{areaOfInterestExtent:n});return e.items=(0,s.z)(r.map((t,n)=>i.cloneWithGeometry(e.items[n],(0,_.Ux)(t,this.hasZ,this.hasM),this.geometryType))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(e=>this.featureStore.forEachInBounds(e,e=>t.add(e))));const i=Array.from(t.values());return t.clear(),i}async*_executeQueryForStatistics(e,t){e=(0,a.o8)(e);try{e=await(0,A.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t,{fieldsIndex:i,geometryType:n,spatialReference:s,availableFields:a}){if(null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.A(C,"Unsupported query options",{query:e});return N(i,a,e),Promise.all([z(i,a,t,e),(0,b.c0)(e,n,s),(0,S.Nk)(s,e.outSR)]).then(()=>e)}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),yield,n}catch(t){if(t!==A.v8)throw t;return new w.G([],e,this)}}get test(){}}function L(e){if((0,b.tC)(e)){if((0,h.ZC)(e))return[(0,f.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,h.Bi)(e))return e.rings.map(e=>(0,f.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[(0,m.Rg)((0,f.vt)(),e)]}function q(e,t,i,n,s){const r={xmin:e[0],ymin:e[1],xmax:e[3],ymax:e[4],spatialReference:n};s&&isFinite(e[2])&&isFinite(e[5])&&(r.zmin=e[2],r.zmax=e[5],r.hasZ=!0);const a=(0,S.Cv)(r,t,i);if(a.spatialReference=i,a.xmax-a.xmin===0){const e=(0,u.GA)(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=(0,u.GA)(a.spatialReference);a.ymin-=e,a.ymax+=e}if(s&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=(0,u.GA)(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}},99352(e,t,i){i.d(t,["F",0,{supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:{envelope:!0,centroid:!0,convexHull:!0},supportsStatisticsAggregatedIds:!0,supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:0,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},"P",0,{supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}])},8384(e,t,i){i.d(t,{G:()=>N});var n=i(4576),s=i(18370),r=i(4718),a=i(16930),o=i(12359),l=i(90634),u=i(62577),c=i(21325),d=i(46329),p=i(52006),f=i(88930),m=i(29441),h=i(51441),y=i(30524),g=i(1873),x=i(43668);class _{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let e=0;for(const t of n){const n=(0,m.Wq)(t),s=this.fieldsIndex.get(n),r=s?null:(0,m.j4)(n,i),a=s?s.name:(0,m.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:r})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){if(i)return this.featureAdapter.getAttribute(e,i.name);const n=t;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:i||(s=(0,m.j4)(t,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),s?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const n=t.normalizationType,s=t.normalizationTotal,r=this.fieldsIndex.get(t.field),a=(0,y.zD)(r)||(0,y.Ah)(r),o=(0,y.OH)(r);return e.map(e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(r=`${(0,g.gJ)(r)}${t.fieldDelimiter}${(0,g.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,g.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof r&&i&&(a?r=r?new Date(r).getTime():null:o&&(r=r?(0,f.rb)(r):null)),n&&Number.isFinite(r)){const i="field"===n&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,g.zS)(r,n,i,s)}return r})}async getExpressionValues(e,t,i,n,s){const{arcadeUtils:r}=await(0,x.l)(),a=r.hasGeometryOperations(t);a&&await r.enableGeometryOperations();const o=r.createFunction(t),l=r.getViewInfo(i),u={fields:this.fieldsIndex.fields};return e.map(e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:u,geometry:a?{...(0,h.pL)(n.geometryType,this.featureAdapter.getGeometry(e)),spatialReference:i.spatialReference}:null},c=r.createExecContext(t,l,s);return r.executeFunction(o,c)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,m.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,m.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const n of t){const{alias:t,clause:s}=this._fieldDataCache.get(n);i[t]=s?s.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const n of t){const{alias:t}=this._fieldDataCache.get(n);i.push(e[t])}else for(const t in e)i.push(e[t]);const n=`${(t||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}}var T=i(31464),v=i(58727);class S{constructor(e,t,i){this.objectId=e,this.target=t,this.distance=i}}class I extends S{constructor(e,t,i){super(e,t,i),this.type="vertex"}}class F extends S{constructor(e,t,i,n,s,r=!1,a=null){super(e,t,i),this.start=n,this.end=s,this.draped=r,this.curve=a,this.type="edge"}}var E=i(5834),R=i(59977),w=i(57231),A=i(11440),b=i(60909),M=(i(98623),i(34747));const C="bin",O=(0,s.z)(()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(6491)]).then(()=>i(55666)));class N{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasZ=!!t.returnZ&&i.hasZ,this.hasM=!!t.returnM&&i.hasM,this.fieldsIndex=i.fieldsIndex,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter,this.featureIdInfo=i.featureIdInfo}get size(){return this.items.length}createQueryResponseForCount(){const e=new _(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:n}=this.query,s=t?.length;if(!s)return 1;const r=new Map,a=new Map,o=new Set;for(const s of n){const{statisticType:n}=s,l="exceedslimit"!==n?s.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const n of t){const t=this._getAttributeValues(e,n,this.items,r);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:n,items:s}=u[t],r=n.join(",");i&&!e.validateItems(s,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,c.fn)(this.query.outSR)&&!(0,c.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,h.ag)({spatialReference:this.query.outSR,...(0,T.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,h.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const n=this.featureAdapter,{point:s}=e,r="number"==typeof e.distance?e.distance:e.distance.x,a="number"==typeof e.distance?e.distance:e.distance.y;function o(e,t){const i=(e-s.x)/r,n=(t-s.y)/a;return i*i+n*n}const l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,f=this._getPointCreator(t,this.spatialReference,i),m=new D(null,0),h=new D(null,0),y={x:0,y:0,z:0};for(const e of this.items){const t=n.getObjectId(e),i=n.getGeometryWithCurves?.(e);if(null!=i){x(i,t);continue}const s=n.getGeometry(e);null==s||g(s,t)}return l.candidates.sort((e,t)=>e.distance-t.distance),l;function g(t,i){const{coords:n,stride:r}=t,a=t.isPoint?B:t.lengths;if(m.coords=n,h.coords=n,e.returnEdge){let e=0;for(let t=0;t<a.length;t++){const n=a[t],c=e;for(let t=0;t<n;t++,e+=r){if(!u&&t===n-1)continue;if(m.coordsIndex=e,h.coordsIndex=t===n-1?c:e+r,!z(y,s,m,h))continue;const a=o(y.x,y.y);a<=1&&l.candidates.push(new F(i,f(y),Math.sqrt(a),f(m),f(h)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<a.length;t++){const n=a[t],s=e,c=h;c.coordsIndex=s;for(let t=0;t<n;t++,e+=r){if(m.coordsIndex=e,u&&t===n-1&&m.x===c.x&&m.y===c.y)continue;const s=o(m.x,m.y);s<=1&&l.candidates.push(new I(i,f(m),Math.sqrt(s)))}}}else if(c&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<a.length;i++){t.push(e);const n=a[i];e+=n*r,n>1&&t.push(e-r)}for(const e of t){m.coordsIndex=e;const t=o(m.x,m.y);t<=1&&l.candidates.push(new I(i,f(m),Math.sqrt(t)))}}}function x(t,i){const{candidates:n}=l,r={x:0,y:0,z:0};if(e.returnEdge){const e=[s.x,s.y],a=new D(e,0),l=new D(e,0);for(const{segments:s}of t.parts)for(const{start:t,curve:u}of s){const{curvePoint:s}=(0,d.y)(t,u,e),c=o(...s);if(c>1)continue;[r.x,r.y]=s,a.coords=t,l.coords=(0,p.yP)(u);const m=(0,p.Xq)(u)?null:(0,p.tk)(u);n.push(new F(i,f(r),Math.sqrt(c),f(a),f(l),!1,m))}}function a(e){r.x=t.vertexXY[2*e],r.y=t.vertexXY[2*e+1];const s=o(r.x,r.y);s>1||(r.z=t.vertexZ?.[e]??0,n.push(new I(i,f(r),Math.sqrt(s))))}if("all"===e.vertexMode){const{vertexCount:e}=t;for(let t=0;t<e;++t)a(t);return}if("ends"===e.vertexMode)switch(t.type){case"point":a(0);break;case"polyline":for(let e=0;e<t.partCount;++e){const i=t.partOffsets[e],n=t.partOffsets[e+1]-1;a(i),n!==i&&a(n)}}}}_getPointCreator(e,t,i){const n=null==i||(0,c.aI)(t,i)?e=>e:e=>(0,T.Cv)(e,t,i),{hasZ:s}=this;return s&&e?({x:e,y:t,z:i})=>n({x:e,y:t,z:i}):({x:e,y:t})=>n({x:e,y:t,z:0})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,d=this.fieldsIndex.get(t),p=(0,y.vE)(d)||(0,y.zD)(d)||(0,y.Ah)(d),f=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:l,timeZone:u},this.items),m=(0,g.Vb)({normalizationType:s,normalizationField:n,minValue:a,maxValue:o}),h={value:.5,fieldType:d?.type},x=(0,y.yM)(d)?(0,g.z9)({values:f,supportsNullCount:m,percentileParams:h,outStatisticTypes:c}):(0,g.G_)({values:f,minValue:a,maxValue:o,useSampleStdDev:!s,supportsNullCount:m,percentileParams:h,outStatisticTypes:c});return(0,g.oZ)(x,c,p)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:n,returnAllCodedValues:s,scale:r,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:a},this.items,!1),l=(0,g.b3)(o);return(0,g.lv)(l,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:p}=e,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:p},this.items),m=(0,g.Rw)(f,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,g.jM)(m,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:p}=e,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:p},this.items);return(0,g.$y)(f,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const n of t.slice().reverse()){const{compare:t,fieldOrExpression:s,fieldInfo:r}=P(n,this.fieldsIndex);e.sort((e,n)=>t(i(e,s,r),i(n,s,r)))}}_topNFeatures(e,t,i,s){if(e.length>1&&t?.length){const r=t.map(e=>{const{compare:t,fieldOrExpression:i,fieldInfo:n}=P(e,this.fieldsIndex);return(e,r)=>t(s(e,i,n),s(r,i,n))}).reduceRight((e,t)=>(i,n)=>{const s=t(i,n);return 0===s||Number.isNaN(s)?e(i,n):s}),a=[];for(const t of e)(0,n.HX)(a,t,i,r);return a}return e.slice(0,i)}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:n,hasZ:s,featureIdInfo:r,spatialReference:a}=this,{outFields:o,outSR:l,quantizationParameters:c,resultRecordCount:d,resultOffset:p,returnZ:f,returnM:m}=e,y=null!=d&&t.length>(p||0)+d,g=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:n&&m,hasZ:s&&f,objectIdFieldName:"object-id"===r.type?r.fieldName:null,spatialReference:(0,h.ag)(l||a),transform:c&&(0,u.VV)(c)||null}}_createFeatures(e,t){const i=new _(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:r,quantizationParameters:a,returnGeometry:o,returnCentroid:l,maxAllowableOffset:c,resultOffset:d,resultRecordCount:p,returnZ:f=!1,returnM:m=!1}=e,y=s&&f,g=n&&m;let x;const T=d||0,v=null!=p?T+p:null;null!=v&&v<=5e3&&v<t.length?x=this._topNFeatures(t,r,v,(e,t,n)=>i.getFieldValue(e,t,n)):(x=[...t],this._sortFeatures(x,r,(e,t,n)=>i.getFieldValue(e,t,n))),(T>0||null!=v)&&(x=x.slice(T,v??void 0));const S=[];let I=0;if(this.geometryType&&(o||l)){const e=(0,u.VV)(a)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(o&&!l)for(const n of x){const s=this.featureAdapter.getGeometry(n),r=this._addFeatureJSONMetadata(n,{attributes:i.getAttributes(n),geometry:(0,h.pL)(this.geometryType,s,c,e,y,g)});t&&s&&!r.geometry&&(r.centroid=(0,h.LQ)(this,this.featureAdapter.getCentroid(n,this),e)),S[I++]=r}else if(!o&&l)for(const t of x)S[I++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,h.LQ)(this,this.featureAdapter.getCentroid(t,this),e)});else for(const t of x)S[I++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,h.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,h.pL)(this.geometryType,this.featureAdapter.getGeometry(t),c,e,y,g)})}else for(const e of x){const t=i.getAttributes(e);t&&(S[I++]=this._addFeatureJSONMetadata(e,{attributes:t}))}return S}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,n=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}return e="esriGeometryPoint"===this.geometryType?this.items.length>t:this.items.length>i||this.items.reduce((e,t)=>{const i=this.featureAdapter.getGeometry(t);return e+(i?.size??0)},0)>n,{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const n=[],s=new Map,r=new Map,a=new Map,o=new Map,l=new _(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:p,resultRecordCount:f}=e,m=c?.length,h=!!m,g=h?c[0]:null,x=h&&!this.fieldsIndex.get(g);for(const p of u??[]){const{outStatisticFieldName:u,statisticType:f}=p,_=p,T="exceedslimit"!==f?p.onStatisticField:void 0,v="percentile_disc"===f||"percentile_cont"===f,S="EnvelopeAggregate"===f||"CentroidAggregate"===f||"ConvexHullAggregate"===f,I=h&&1===m&&(T===g||x)&&"count"===f;if(h){if(!a.has(T)){const e=[];for(const i of c){const n=this._getAttributeValues(l,i,t,s);e.push(n)}a.set(T,this._calculateUniqueValues(e,t,!S&&l.returnDistinctValues))}const i=a.get(T);if(!i)continue;const n=Object.keys(i);for(const r of n){const{count:n,data:a,items:p,itemPositions:f}=i[r],m=a.join(",");if(!d||l.validateItems(p,d)){const i=o.get(m)||{attributes:{}};if(e.returnAggIds&&(i.aggregateIds=p.map(e=>this.featureAdapter.getObjectId(e)).filter(e=>null!=e)),S){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(_,p);i.aggregateGeometries[t]=e}else{let e=null;if(I)e=n;else{const i=this._getAttributeValues(l,T,t,s),n=f.map(e=>i[e]);e=v&&"statisticParameters"in _?this._getPercentileValue(_,n):this._getStatisticValue(_,n,null,l.returnDistinctValues)}i.attributes[u]=e}let r=0;c.forEach((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=a[t]),o.set(m,i)}}}else if(S){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:n}=await this._getAggregateGeometry(_,t);i.aggregateGeometries[n]=e}else{const e=this._getAttributeValues(l,T,t,s);i.attributes[u]=v&&"statisticParameters"in _?this._getPercentileValue(_,e):this._getStatisticValue(_,e,r,l.returnDistinctValues)}const F="min"!==f&&"max"!==f||!(0,y.yM)(this.fieldsIndex.get(T))&&!this._isAnyDateField(T)?null:this.fieldsIndex.get(T)?.type;n.push({name:u,alias:u,type:F||"esriFieldTypeDouble"})}const T=h?Array.from(o.values()):[i];return this._sortFeatures(T,p,(e,t)=>e.attributes[t]),f&&(T.length=Math.min(f,T.length)),{fields:n,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,y.vE)(t)||(0,y.zD)(t)||(0,y.Ah)(t)||(0,y.OH)(t)}async _getAggregateGeometry(e,t){const{statisticType:i,outStatisticFieldName:n}=e,{featureAdapter:s,spatialReference:r,geometryType:a}=this,u=t.map(e=>(0,h.pL)(a,s.getGeometry(e))),c={aggregateGeometries:null,outStatisticFieldName:null},{convexHullExecuteMany:d}=await O.getImportPromise();let[p]=d(u,{merge:!0});if(p&&p.rings[0].length<=3&&(p=null),"EnvelopeAggregate"===i){const e=p?(0,l.v)(p):V(u);c.aggregateGeometries={...e,spatialReference:r},c.outStatisticFieldName=n||"extent"}else if("CentroidAggregate"===i){const[e,t]=p?(0,o.l8)(p):(0,o.Z4)(V(u));c.aggregateGeometries={x:e,y:t,spatialReference:r},c.outStatisticFieldName=n||"centroid"}else"ConvexHullAggregate"===i&&(c.aggregateGeometries=p&&{...p,spatialReference:r},c.outStatisticFieldName=n||"convexHull");return c}_getStatisticValue(e,t,i,n){const{onStatisticField:s,statisticType:r}=e;let a=null;return a=i?.has(s)?i.get(s):(0,y.yM)(this.fieldsIndex.get(s))||this._isAnyDateField(s)?(0,g.z9)({values:t,returnDistinct:n}):(0,g.G_)({values:n?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,a),a["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:n,statisticType:s}=e,{value:r,orderBy:a}=n,o=this.fieldsIndex.get(i);return(0,g.qg)(t,{value:r,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===s})}_getAttributeValues(e,t,i,n){if(n.has(t))return n.get(t);const s=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,s));return n.set(t,r),r}_calculateUniqueValues(e,t,i){const n={},s=t.length;for(let r=0;r<s;r++){const s=t[r],a=[];for(const t of e)a.push(t[r]);const o=a.join(",");null==n[o]?n[o]={count:1,data:a,items:[s],itemPositions:[r]}:(i||n[o].count++,n[o].items.push(s),n[o].itemPositions.push(r))}return n}async _getDataValues(e,t,i=!0){const n=new _(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:s,scale:o,timeZone:l}=e,u=a.A.fromJSON(this.query.outSR||this.spatialReference);return s?n.getExpressionValues(t,s,{viewingMode:"map",scale:o,spatialReference:u},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},l):n.getDataValues(t,(0,r.o8)(e),i)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const n=t.intervals,s=t.min??0,r=t.max??0,a=n.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=s&&o<=r){const e=(0,g.Ak)(n,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:n,valueType:s}=t,r=[],a=[{name:n??i,alias:n??i,type:s??"esriFieldTypeString"},{name:C,alias:C,type:"esriFieldTypeInteger"}],o=new _(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[i],(e,t,i)=>o.getFieldValue(e,t,i));const c=this._getAttributeValues(o,i,u,l),d=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const t in d){const{items:s}=d[t],o=await this._createBinsResponse(e,s);if(r.push(...o.features.map(e=>({...e,attributes:{...e.attributes,[n??i]:t}}))),o.fields)for(const e of o.fields)a.some(t=>t.name===e.name)||a.push(e)}return{fields:a,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(E.A.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(R.A.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(A.A.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.A.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:n,normalizationField:s,numBins:r,normalizationType:a,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field||e.expression,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),d=(0,g.sU)(c,{field:n,normalizationField:s,normalizationType:a,normalizationTotal:o,numBins:r,minValue:(0,v.dO)(a?e.normalizationMinValue:l,!1),maxValue:(0,v.dO)(a?e.normalizationMaxValue:u,!1)}),p=this._calculateHistogramBins(c,d,i);return this._createFeaturesFromHistogramBins(p,t)}async _createDateBinsResponse(e,t,i){const{field:n,interval:s,start:r,end:a,snapToData:o,returnFullIntervalBin:l,offset:u,firstDayOfWeek:c}=e,d=s.unit,p=await this._getDataValues({field:n||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},i),f=(0,y.OH)(this.fieldsIndex.get(n)),m=w.g.toJSON(d),h=p.filter(Boolean).sort((e,t)=>e-t),g=null!=r?(0,v.dO)(r,f):h[0],x=null!=a?(0,v.dO)(a,f):h[h.length-1],_=[];if(null!=g&&null!=x){const e={zone:t.outTimeReference?.ianaTimeZone??"UTC"},i=u?.unit?w.g.toJSON(u.unit):"milliseconds",n={[i]:u?.value||0},r=M.c9.fromMillis(g,e).minus(n),a=M.c9.fromMillis(x,e).minus(n),d="number"==typeof c&&c>=1&&c<=7?c:7,p=(e,t)=>{const i=(e.weekday-t+7)%7;return e.minus({days:i}).startOf("day")};if("last"===o){let e="week"===m?((e,t)=>p(e,t).plus({days:7}))(a,d):a;for(;e>r;){const t=e.minus({[m]:s.value});if(t<r){_.unshift([l?t.plus(n).toMillis():r.plus(n).toMillis(),e.plus(n).toMillis()]);break}_.unshift([t.plus(n).toMillis(),e.plus(n).toMillis()]),e=t}}else{let e="first"===o?r:"week"===m?p(r,d):r.startOf(m);for(;e<=a;){const t=e.plus({[m]:s.value});if(t>a){_.push([e.plus(n).toMillis(),l?t.plus(n).toMillis():a.plus(n).toMillis()]);break}_.push([e.plus(n).toMillis(),t.plus(n).toMillis()]),e=t}}}const T=this._calculateHistogramBins(p,{intervals:_,min:g,max:x},i);return this._createFeaturesFromHistogramBins(T,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:n}=e,s=await this._getDataValues({field:n||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},i),r=(0,y.OH)(this.fieldsIndex.get(n)),a=e.boundaries.map(e=>(0,v.dO)(e,r)).sort((e,t)=>e-t),o=[];for(let e=0;e<a.length-1;e++)o.push([a[e],a[e+1]]);const l={intervals:o,min:a.at(0),max:a.at(-1)},u=this._calculateHistogramBins(s,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:n,interval:s,normalizationType:r,start:a,end:o}=e,l=await this._getDataValues({field:n||e.expression,normalizationField:e.normalizationField,normalizationType:r,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),u=(0,y.OH)(this.fieldsIndex.get(n)),c=(0,g.sU)(l,{field:n,classificationMethod:"defined-interval",definedInterval:s,minValue:(0,v.dO)(r?e.normalizationMinValue:a,u),maxValue:(0,v.dO)(r?e.normalizationMaxValue:o,u)},!0),d=this._calculateHistogramBins(l,c,i);return this._createFeaturesFromHistogramBins(d,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:n}=t,s=n||"lowerBoundary",r=i||"upperBoundary",a=[],o=[{name:s,alias:s,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:C,alias:C,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const d="dateBin"===t.bin.type,p=t.outTimeReference?.ianaTimeZone;for(const i of e){const{minValue:e,maxValue:n,items:f}=i,m={attributes:{}};let h;if(m.attributes[s]=d&&p&&null!=e?M.c9.fromMillis(e,{zone:p}).toISO():e,t.bin.hideUpperBound||(m.attributes[r]=d&&p&&null!=n?M.c9.fromMillis(n,{zone:p}).toISO():n),t.returnAggIds&&(m.aggregateIds=f.map(e=>this.featureAdapter.getObjectId(e)).filter(e=>null!=e)),l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},f),m.attributes[C]=++c,"flat"===t.bin.jsonStyle?a.push(...h.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...m.attributes}:{...t,...m.attributes}}))):(m.stackedAttributes=h.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),a.push(m))):(t.bin?.splitBy&&(m.attributes[C]=++c),h=await this._createStatisticsQueryResponse(t,f,m),a.push(m)),h.fields)for(const e of h.fields)o.some(t=>t.name===e.name)||o.push(e)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function V(e){const t=(0,l.HA)(e[0]);for(const i of e.slice(1))(0,l.JM)(t,(0,l.HA)(i));return t}function z(e,t,i,n){const s=n.x-i.x,r=n.y-i.y,a=t.x-i.x,o=t.y-i.y,l=s*s+r*r;if(0===l)return!1;const u=a*s+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+s*c,e.y=i.y+r*c,!0}class D{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const B=[1];function P(e,t){const i=e.split(" "),n=i[0],s=t.get(n),r=!!i[1]&&"desc"===i[1].toLowerCase();return{compare:(0,g.FM)(s?.type,r,"case-insensitive"),fieldOrExpression:n,fieldInfo:s}}},29441(e,t,i){i.d(t,{MG:()=>_,SN:()=>f,SY:()=>g,Wq:()=>y,_d:()=>S,eD:()=>m,g9:()=>x,j4:()=>h});var n=i(49186),s=i(44123),r=i(98453);const a=new s.WhereClauseCache(50,500),o="unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),c=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...u,...c]);function p(e,t,i={}){const s=h(t,e);if(!s){const i=a.getError(t,e);throw new n.A(o,"invalid SQL expression",{expression:t,error:i})}const r=i.expressionName||"expression";if(i.validateStandardized&&!s.isStandardized)throw new n.A(o,`${r} is not standard`,{expression:t});if(i.validateAggregate&&!s.isAggregate)throw new n.A(o,`${r} does not contain a valid aggregate function`,{expression:t});return s.fieldNames}function f(e,t,i,n){if(!i)return!0;const s="where clause";return _(e,t,p(e,i,{validateStandardized:!0,expressionName:s}),{expressionName:s,query:n}),!0}function m(e,t,i,s,r){if(!i)return!0;const a="having clause",l=p(e,i,{validateAggregate:!0,expressionName:a});_(e,t,l,{expressionName:a,query:r});const u=h(i,e),c=u?.getExpressions().every(t=>{const{aggregateType:i,field:n}=t,r=e.get(n)?.name;return s.some(t=>{const{onStatisticField:n,statisticType:s}=t,a=e.get(n)?.name;return a===r&&s.toLowerCase().trim()===i})});if(!c)throw new n.A(o,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function h(e,t){return e?a.get(e,t):null}function y(e){return/\((.*?)\)/.test(e)?e:e.split(l)[0]}function g(e){return e.split(l)[1]}function x(e,t,i){if(!S(t))return[];const n=new Set,s=t=>{if(t&&"*"!==t)for(const i of T(e,t))n.add(i)};for(const e of t)s(e.onStatisticField);for(const e of i??[])s(e);return Array.from(n)}function _(e,t,i,s={}){const r=new Map;if(function(e,t,i,n,s){const r=s.includes("*")?[...i,...s.filter(e=>"*"!==e)]:s;for(const s of r)if(t.get(s))v(e,t,i,n,s);else try{for(const r of T(t,s))v(e,t,i,n,r)}catch(t){e.set(s,{type:"expression-error",expression:s,error:t})}}(r,e,t,s.allowedFieldTypes??d,i),r.size){const e=s.expressionName??"expression";throw new n.A(o,`${e} contains invalid or missing fields`,{errors:Array.from(r.values()),query:s.query})}}function T(e,t){const i=e.get(t);return i?[i.name]:p(e,y(t),{validateStandardized:!0})}function v(e,t,i,n,s){const a=t.get(s);a?i.has(a.name)?"all"!==n&&!1===n?.has(a.type)&&e.set(s,{type:"invalid-type",fieldName:a.name,fieldType:r.m.fromJSON(a.type),allowedFieldTypes:Array.from(n,e=>r.m.fromJSON(e))}):e.set(s,{type:"missing-field",fieldName:a.name}):e.set(s,{type:"invalid-field",fieldName:s})}function S(e){return null!=e&&e.every(e=>"exceedslimit"!==e.statisticType)}i.d(t,["VW",0,c,"vl",0,u])},58727(e,t,i){i.d(t,{GC:()=>g,T2:()=>x,dO:()=>T,iJ:()=>y});var n=i(49186),s=i(66552),r=i(86211),a=i(39829),o=i(99917),l=i(90634),u=i(60408),c=i(65864),d=i(52039),p=i(21325),f=i(31464);const m=new s.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 y(e,t,i){const n=e.bin;return n.onField&&(n.onField=n.onField.trim()),n.onExpression?.value&&(n.onExpression.value=n.onExpression.value.trim()),n.splitBy&&(n.splitBy.value&&(n.splitBy.value=n.splitBy.value.trim()),n.splitBy.outAlias&&(n.splitBy.outAlias=n.splitBy.outAlias.trim())),n.stackBy&&(n.stackBy.value&&(n.stackBy.value=n.stackBy.value.trim()),n.stackBy.outAlias&&(n.stackBy.outAlias=n.stackBy.outAlias.trim())),"normalizationField"in n.parameters&&n.parameters.normalizationField&&(n.parameters.normalizationField=n.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:"frequency"}]),g(e,t,i)}async function g(e,t,i){const{outFields:n,orderByFields:s,groupByFieldsForStatistics:r,outStatistics:a}=e;if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),x(e,t,i)}async function x(e,t,i){if(!e)return null;let{where:n}=e;if(e.where=n=n?.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let s=await _(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;s=(0,l.HA)(s),s.spatialReference=t}if(!s)return e;await(0,f.Nk)(s.spatialReference,i);let[r]=await(0,d.el)((0,c.rS)(s));if(null==r)throw h;let m=!1;((0,u.ZC)(r)||(0,u.Bi)(r)||(0,u.Rg)(r))&&(m=!(0,p.aI)(r.spatialReference,i)&&!(0,o.canProjectWithoutEngine)(r.spatialReference,i)),m&&(0,u.ZC)(r)&&(r=a.A.fromExtent(r));const y="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,g=m&&y?{extendedParams:{densificationStep:8*y}}:void 0,x=r.toJSON(),T=(0,f.Cv)(x,x.spatialReference,i,g);if(!T)throw h;return T.spatialReference=i,e.geometry=T,e}async function _(e){const{distance:t,units:s}=e,a=e.geometry;if(!t||"vertexAttributes"in a)return a;const o=a.spatialReference,l=s?m.fromJSON(s):(0,r.Ij)(o),c=o&&((0,p.EA)(o)||(0,p.K8)(o))?a:await(0,f.Nk)(o,p.KK).then(()=>(0,f.Cv)(a,p.KK)),{geodesicBufferExecute:d,geodesicBufferLoad:h}=await i.e(9159).then(()=>i(49159));await h();const y=d(c,t||1,{unit:l})??void 0;if(!y||!(0,u.Bi)(y)||0===y.rings.length)throw new n.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return y}function T(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}i.d(t,["VY",0,m,"v8",0,h])},62660(e,t,i){i.d(t,{tC:()=>S,c0:()=>v,xt:()=>T});var n=i(49186),s=i(94078),r=i(12176),a=i(60408),o=i(21325);function l(e,t){return c(e,t.coords[0],t.coords[1])}function u(e,t){const{coords:i,lengths:n,stride:s}=t;if(!n)return!1;for(let t=0,r=0;t<n.length;t++,r+=s)if(!c(e,i[r],i[r+1]))return!1;return!0}function c(e,t,i){if(!e)return!1;const{coords:n,lengths:s,stride:r}=e;let a=!1,o=0;for(const e of s)a=d(a,n,r,o,e,t,i),o+=e*r;return a}function d(e,t,i,n,s,r,a){let o=e,l=n;for(let e=n,u=n+s*i;e<u;e+=i){l=e+i,l===u&&(l=n);const s=t[e],c=t[e+1],d=t[l],p=t[l+1];(c<a&&p>=a||p<a&&c>=a)&&s+(a-c)/(p-c)*(d-s)<r&&(o=!o)}return o}var p=i(90708),f=i(51441),m=i(31464);const h="unsupported-query",y={esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},g={esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},x={esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1},_={esriSpatialRelIntersects:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(6033)]).then(()=>i(55284)).then(e=>e.intersectsExecute),esriSpatialRelContains:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(2990)]).then(()=>i(51508)).then(e=>e.containsExecute),esriSpatialRelCrosses:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(4935)]).then(()=>i(85672)).then(e=>e.crossesExecute),esriSpatialRelDisjoint:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(4579)]).then(()=>i(7978)).then(e=>e.disjointExecute),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(923)]).then(()=>i(46178)).then(e=>e.overlapsExecute),esriSpatialRelTouches:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(368)]).then(()=>i(83547)).then(e=>e.touchesExecute),esriSpatialRelWithin:()=>Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(4168)]).then(()=>i(85445)).then(e=>e.withinExecute),esriSpatialRelRelation:null};async function T(e,t,i){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,p.Ye)(t,!1,!1);return t=>l(e,t)}if("esriGeometryMultipoint"===i){const i=(0,p.Ye)(t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,e)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,s.qz)(t,(0,f.pL)(i,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,s.rL)(t,(0,f.pL)(i,e));if("esriSpatialRelIntersects"===e){const e=function(e){return"mesh"===e?r.xB:(0,r.xK)(e)}(i);return n=>e(t,(0,f.pL)(i,n))}}"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const n=await function(e){const t=_[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>n(t,(0,f.pL)(i,e))}async function v(e,t,i){const{spatialRel:s,geometry:r}=e;if(r){if(null==(l=s)||!0!==y[l])throw new n.A(h,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(r.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===g[(0,a.$B)(e)]}(r))throw new n.A(h,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===x[e]}(t))throw new n.A(h,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,m.Nk)(e.geometry?.spatialReference,e.outSR)}}var l}function S(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},86420(e,t,i){i.d(t,{I:()=>r,W:()=>s});var n=i(21818);async function s(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:s,endTimeField:r}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(s&&r)await t.forEach(e=>{const t=i.getAttribute((0,n.z)(e),s),l=i.getAttribute((0,n.z)(e),r);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))});else{const e=s||r;await t.forEach(t=>{const s=i.getAttribute((0,n.z)(t),e);null==s||isNaN(s)||(a=Math.min(a,s),o=Math.max(o,s))})}return{start:a,end:o}}function r(e,t,i){if(!t||!e)return null;const{startTimeField:n,endTimeField:s}=e;if(!n&&!s)return null;const{start:r,end:a}=t;if(null===r&&null===a)return null;if(void 0===r&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return n&&s?function(e,t,i,n,s){return null!=n&&null!=s?r=>{const a=e(r,t),o=e(r,i);return(null==a||a<=s)&&(null==o||o>=n)}:null!=n?t=>{const s=e(t,i);return null==s||s>=n}:null!=s?i=>{const n=e(i,t);return null==n||n<=s}:void 0}(o,n,s,r,a):function(e,t,i,n){return null!=i&&null!=n&&i===n?n=>e(n,t)===i:null!=i&&null!=n?s=>{const r=e(s,t);return null!=r&&r>=i&&r<=n}:null!=i?n=>{const s=e(n,t);return null!=s&&s>=i}:null!=n?i=>{const s=e(i,t);return null!=s&&s<=n}:void 0}(o,n||s,r,a)}},5834(e,t,i){i.d(t,{A:()=>d});var n=i(32198),s=i(93637),r=i(91429),a=i(78888),o=i(41266),l=i(41366),u=i(93223);function c(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,l.K)(o.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],d.prototype,"numBins",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:c}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:c}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,u.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,n.Cg)([(0,r.$K)("esri.rest.support.AutoIntervalBinParameters")],d),d.from=(0,a.dp)(d)},41266(e,t,i){i.d(t,{A:()=>h});var n=i(32198),s=i(69540),r=i(66552),a=i(25482),o=i(91429),l=i(78888),u=i(93223);const c=new r.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let d=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"outAlias",write:!0}})],d.prototype,"alias",void 0),(0,n.Cg)([(0,o.MZ)({type:String})],d.prototype,"responseType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"type",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],d.prototype,"value",void 0),(0,n.Cg)([(0,u.e)(c)],d.prototype,"valueType",void 0),d=(0,n.Cg)([(0,o.$K)("esri.rest.support.AttributeBinsGrouping")],d);const p=d;d.from=(0,l.dp)(d);const f=new r.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),m=new r.J({naturalLog:"natural-log",squareRoot:"square-root"});let h=class extends((0,s.OU)(a.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,n.Cg)([(0,o.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],h.prototype,"expression",void 0),(0,n.Cg)([(0,u.e)(f,{name:"onExpression.valueType"})],h.prototype,"expressionValueType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],h.prototype,"field",void 0),(0,n.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],h.prototype,"firstDayOfWeek",void 0),(0,n.Cg)([(0,o.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"hideUpperBound",void 0),(0,n.Cg)([(0,o.MZ)({type:p,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],h.prototype,"splitBy",void 0),(0,n.Cg)([(0,o.MZ)({type:p,json:{write:{target:{stackBy:{type:p},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)=>p.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],h.prototype,"stackBy",void 0),(0,n.Cg)([(0,u.e)(m)],h.prototype,"transformation",void 0),h=(0,n.Cg)([(0,o.$K)("esri.rest.support.BinParametersBase")],h)},9760(e,t,i){i.d(t,{A:()=>c});var n=i(32198),s=i(66552),r=i(25482),a=i(91429),o=i(93223);const l=new s.J({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),u=new s.J({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let c=class extends r.o{constructor(e){super(e),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(e){"standard-deviation"===this.classificationMethod&&this._set("standardDeviationInterval",e)}set definedInterval(e){"defined-interval"===this.classificationMethod&&this._set("definedInterval",e)}};(0,n.Cg)([(0,o.e)({classBreaksDef:"class-breaks-definition"})],c.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],c.prototype,"breakCount",void 0),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],c.prototype,"classificationField",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{read:l.read,write:l.write}})],c.prototype,"classificationMethod",void 0),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],c.prototype,"normalizationField",void 0),(0,n.Cg)([(0,a.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"normalizationType",void 0),(0,n.Cg)([(0,a.MZ)({value:null,json:{write:!0}})],c.prototype,"standardDeviationInterval",null),(0,n.Cg)([(0,a.MZ)({value:null,json:{write:!0}})],c.prototype,"definedInterval",null),c=(0,n.Cg)([(0,a.$K)("esri.rest.support.ClassBreaksDefinition")],c)},59977(e,t,i){i.d(t,{A:()=>y});var n=i(32198),s=i(93637),r=i(91429),a=i(78888),o=i(41266),l=i(69540),u=i(25482),c=i(57231),d=i(93223);let p=class extends((0,l.OU)(u.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"number",write:!0}})],p.prototype,"value",void 0),(0,n.Cg)([(0,d.e)(c.g)],p.prototype,"unit",void 0),p=(0,n.Cg)([(0,r.$K)("esri.rest.support.DateBinTimeInterval")],p);const f=p;function m(e,t,i){(0,s.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function h(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}p.from=(0,a.dp)(p);let y=class extends o.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,n.Cg)([(0,r.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:m}}})],y.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:f,json:{name:"parameters",write:!0}})],y.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({type:f,json:{name:"parameters.offset",write:!0}})],y.prototype,"offset",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],y.prototype,"returnFullIntervalBin",void 0),(0,n.Cg)([(0,r.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:m}}})],y.prototype,"start",void 0),(0,n.Cg)([(0,r.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],y.prototype,"snapToData",void 0),(0,n.Cg)([(0,d.e)({dateBin:"date"},{readOnly:!0})],y.prototype,"type",void 0),y=(0,n.Cg)([(0,r.$K)("esri.rest.support.DateBinParameters")],y),y.from=(0,a.dp)(y)},57231(e,t,i){const n=(0,i(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});i.d(t,["g",0,n])},11440(e,t,i){i.d(t,{A:()=>u});var n=i(32198),s=i(93637),r=i(91429),a=i(78888),o=i(41266),l=i(93223);let u=class extends o.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,s.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],u.prototype,"boundaries",void 0),(0,n.Cg)([(0,l.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],u.prototype,"type",void 0),u=(0,n.Cg)([(0,r.$K)("esri.rest.support.FixedBoundariesBinParameters")],u),u.from=(0,a.dp)(u)},60909(e,t,i){i.d(t,{A:()=>d});var n=i(32198),s=i(93637),r=i(91429),a=i(78888),o=i(41266),l=i(41366),u=i(93223);function c(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,l.K)(o.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:c}}})],d.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],d.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:c}}})],d.prototype,"start",void 0),(0,n.Cg)([(0,u.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,n.Cg)([(0,r.$K)("esri.rest.support.FixedIntervalBinParameters")],d),d.from=(0,a.dp)(d)},41366(e,t,i){var n=i(32198),s=i(66552),r=i(53966),a=i(91429),o=i(93223);const l=(0,s.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),u="percent-of-total",c="field";i.d(t,["K",0,e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&c||i&&u||null,t&&i&&r.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==u||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,n.Cg)([(0,o.e)(l,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,n.Cg)([(0,a.$K)("esri.rest.support.NormalizationBinParametersMixin")],i),i},"Q",0,l])},84892(e,t,i){i.d(t,{t:()=>r});var n=i(53966);function s(e,t){return Number(e.toFixed(t))}function r(e,t){const{normalizationTotal:i}=e;return{classBreaks:a(e,t),normalizationTotal:i}}function a(e,t){const i=e.definition,{classificationMethod:n,normalizationType:r,definedInterval:a}=i,u=i.breakCount??1,c=[];let d=e.values;if(0===d.length)return[];d=d.sort((e,t)=>e-t);const[p,f]=t??[d.at(0),d.at(-1)];if("equal-interval"===n)if(d.length>=u){const e=(f-p)/u;let t=p;for(let i=1;i<u;i++){const n=s(p+i*e,6);c.push({minValue:t,maxValue:n,label:o(t,n,r)}),t=n}c.push({minValue:t,maxValue:f,label:o(t,f,r)})}else d.forEach(e=>{c.push({minValue:e,maxValue:e,label:o(e,e,r)})});else if("natural-breaks"===n){const t=function(e){const t=[],i=[];let n=Number.MIN_VALUE,s=1,r=-1;for(let a=0;a<e.length;a++){const o=e[a];o===n?(s++,i[r]=s):null!==o&&(t.push(o),n=o,s=1,i.push(s),r++)}return{uniqueValues:t,valueFrequency:i}}(d),i=e.valueFrequency||t.valueFrequency,n=l(t.uniqueValues,i,u);let a=p;for(let e=1;e<u;e++)if(t.uniqueValues.length>e){const i=s(t.uniqueValues[n[e]],6);c.push({minValue:a,maxValue:i,label:o(a,i,r)}),a=i}c.push({minValue:a,maxValue:f,label:o(a,f,r)})}else if("quantile"===n)if(d.length>=u&&p!==f){let e=p,t=Math.ceil(d.length/u),i=0;for(let n=1;n<u;n++){let s=t+i-1;s>d.length&&(s=d.length-1),s<0&&(s=0),c.push({minValue:e,maxValue:d[s],label:o(e,d[s],r)}),e=d[s],i+=t,t=Math.ceil((d.length-i)/(u-n))}c.push({minValue:e,maxValue:f,label:o(e,f,r)})}else{let e=-1;for(let t=0;t<d.length;t++){const i=d[t];i!==e&&(e=i,c.push({minValue:e,maxValue:i,label:o(e,i,r)}),e=i)}}else if("standard-deviation"===n){const e=function(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i];return t/=e.length,t}(d),t=function(e,t){let i=0;for(let n=0;n<e.length;n++){const s=e[n];i+=(s-t)*(s-t)}return i/=e.length,Math.sqrt(i)}(d,e);if(0===t)c.push({minValue:d[0],maxValue:d[0],label:o(d[0],d[0],r)});else{const i=function(e,t,i,n,s){let r=Math.max(n-e,t-n)/s/i;return r=r>=1?1:r>=.5?.5:.25,r}(p,f,u,e,t)*t;let n=0,a=p;for(let t=u;t>=1;t--){const l=s(e-(t-.5)*i,6);c.push({minValue:a,maxValue:l,label:o(a,l,r)}),a=l,n++}let l=s(e+.5*i,6);c.push({minValue:a,maxValue:l,label:o(a,l,r)}),a=l,n++;for(let t=1;t<=u;t++)l=n===2*u?f:s(e+(t+.5)*i,6),c.push({minValue:a,maxValue:l,label:o(a,l,r)}),a=l,n++}}else if("defined-interval"===n){if(!a)return c;const[e,i]=t??[d.at(0),d.at(-1)],n=Math.ceil((i-e)/a);let l=e;for(let t=1;t<n;t++){const i=s(e+t*a,6);c.push({minValue:l,maxValue:i,label:o(l,i,r)}),l=i}c.push({minValue:l,maxValue:i,label:o(l,i,r)})}return c}function o(e,t,i){let n=null;return n=e===t?i&&"percent-of-total"===i?e+"%":e.toString():i&&"percent-of-total"===i?e+"% - "+t+"%":e+" - "+t,n}function l(e,t,i){const n=e.length,s=[];i>n&&(i=n);for(let e=0;e<i;e++)s.push(Math.round(e*n/i-1));s.push(n-1);let r=u(s,e,t,i);return function(e,t,i,n,s,r){let a=0,o=0,l=0,u=0,d=!0;for(let p=0;p<2&&d;p++){0===p&&(d=!1);for(let p=0;p<r-1;p++)for(;i[p+1]+1!==i[p+2];){i[p+1]=i[p+1]+1;const r=c(p,i,n,s);l=r.sbMean,a=r.sbSdcm;const f=c(p+1,i,n,s);if(u=f.sbMean,o=f.sbSdcm,!(a+o<t[p]+t[p+1])){i[p+1]=i[p+1]-1;break}t[p]=a,t[p+1]=o,e[p]=l,e[p+1]=u,d=!0}for(let p=r-1;p>0;p--)for(;i[p]!==i[p-1]+1;){i[p]=i[p]-1;const r=c(p-1,i,n,s);l=r.sbMean,a=r.sbSdcm;const f=c(p,i,n,s);if(u=f.sbMean,o=f.sbSdcm,!(a+o<t[p-1]+t[p])){i[p]=i[p]+1;break}t[p-1]=a,t[p]=o,e[p-1]=l,e[p]=u,d=!0}}return d}(r.mean,r.sdcm,s,e,t,i)&&(r=u(s,e,t,i)),s}function u(e,t,i,n){let s=[],r=[],a=[],o=0;const l=[],u=[];for(let s=0;s<n;s++){const n=c(s,e,t,i);l.push(n.sbMean),u.push(n.sbSdcm),o+=u[s]}let d,p=o,f=!0;for(;f||o<p;){f=!1,s=[];for(let t=0;t<n;t++)s.push(e[t]);for(let i=0;i<n;i++)for(let s=e[i]+1;s<=e[i+1];s++)if(d=t[s],i>0&&s!==e[i+1]&&Math.abs(d-l[i])>Math.abs(d-l[i-1]))e[i]=s;else if(i<n-1&&e[i]!==s-1&&Math.abs(d-l[i])>Math.abs(d-l[i+1])){e[i+1]=s-1;break}p=o,o=0,r=[],a=[];for(let s=0;s<n;s++){r.push(l[s]),a.push(u[s]);const n=c(s,e,t,i);l[s]=n.sbMean,u[s]=n.sbSdcm,o+=u[s]}}if(o>p){for(let t=0;t<n;t++)e[t]=s[t],l[t]=r[t],u[t]=a[t];o=p}return{mean:l,sdcm:u}}function c(e,t,i,s){let r=0,a=0;for(let n=t[e]+1;n<=t[e+1];n++){const e=s[n];r+=i[n]*e,a+=e}a<=0&&n.A.getLogger("esri.rest.support.generateRendererUtils").warn("Exception in Natural Breaks calculation");const o=r/a;let l=0;for(let n=t[e]+1;n<=t[e+1];n++)l+=s[n]*(i[n]-o)**2;return{sbMean:o,sbSdcm:l}}},1873(e,t,i){i.d(t,{$y:()=>V,Ak:()=>D,FM:()=>m,G_:()=>p,Rw:()=>O,Vb:()=>c,b3:()=>A,gJ:()=>u,jM:()=>N,lv:()=>M,oZ:()=>w,qg:()=>f,sU:()=>z,z9:()=>d,zS:()=>C});var n=i(9760),s=i(84892);const r=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,a=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),o=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),l=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function u(e){return null==e||"string"==typeof e&&!e?"<Null>":e}function c(e){const t=null!=e.normalizationField||null!=e.normalizationType,i=null!=e.minValue||null!=e.maxValue,n=!!e.sqlExpression&&e.supportsSQLExpression;return!t&&!i&&!n}function d(e){const{outStatisticTypes:t}=e,i=e.returnDistinct?[...new Set(e.values)]:e.values,n=i.filter(e=>null!=e).sort(),s=n.length,r={count:s,min:n[0],max:n[s-1]};return e.supportsNullCount&&(r.nullcount=i.length-s),!e.percentileParams||t?.include?.length&&!t.include.includes("median")||t?.exclude?.length&&t.exclude.includes("median")||(r.median=f(i,e.percentileParams)),r}function p(e){const{values:t,useSampleStdDev:i,supportsNullCount:n,outStatisticTypes:s}=e;let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=null,l=null,u=null,c=null,d=0;const p=null==e.minValue?-1/0:e.minValue,m=null==e.maxValue?1/0:e.maxValue;for(const e of t)Number.isFinite(e)?e>=p&&e<=m&&(o=null===o?e:o+e,r=Math.min(r,e),a=Math.max(a,e),d++):"string"==typeof e&&d++;if(d&&null!=o){l=o/d;let e=0;for(const i of t)Number.isFinite(i)&&i>=p&&i<=m&&(e+=(i-l)**2);c=i?d>1?e/(d-1):0:d>0?e/d:0,u=Math.sqrt(c)}else r=null,a=null;const h={avg:l,count:d,max:a,min:r,stddev:u,sum:o,variance:c};return n&&(h.nullcount=t.length-d),!e.percentileParams||s?.include?.length&&!s.include.includes("median")||s?.exclude?.length&&s.exclude.includes("median")||(h.median=f(t,e.percentileParams)),h}function f(e,t){const{fieldType:i,value:n,orderBy:s,isDiscrete:r}=t,a=m(i,"desc"===s,"case-insensitive");if(0===(e=[...e].filter(e=>null!=e).sort((e,t)=>a(e,t))).length)return null;if(n<=0)return e[0];if(n>=1)return e[e.length-1];const o=(e.length-1)*n,l=Math.floor(o),u=l+1,c=o%1,d=e[l],p=e[u];return u>=e.length||r||"string"==typeof d||"string"==typeof p?d:d*(1-c)+p*c}function m(e,t,i="case-sensitive"){if(e){if(a.has(e))return E(t);if(o.has(e))return S(t,!0);if("esriFieldTypeTimestampOffset"===e)return function(e){return e?_:x}(t);const n=S(t,"case-sensitive"===i);if("esriFieldTypeString"===e)return n;if("esriFieldTypeGUID"===e||"esriFieldTypeGlobalID"===e)return(e,t)=>n(R(e),R(t))}const n=t?1:-1,s=E(t),r=S(t,"case-sensitive"===i),l=g(t);return(e,t)=>"number"==typeof e&&"number"==typeof t?s(e,t):"string"==typeof e&&"string"==typeof t?r(e,t):l(e,t)??n}const h=(e,t)=>null==e?null==t?0:1:null==t?-1:null,y=(e,t)=>null==e?null==t?0:-1:null==t?1:null;function g(e){return e?h:y}const x=(e,t)=>y(e,t)??(e===t?0:new Date(e).getTime()-new Date(t).getTime()),_=(e,t)=>h(e,t)??(e===t?0:new Date(t).getTime()-new Date(e).getTime()),T=(e,t)=>y(e,t)??(e===t?0:e<t?-1:1),v=(e,t)=>h(e,t)??(e===t?0:e<t?1:-1);function S(e,t){if(t)return e?v:T;const i=g(e);return e?(e,t)=>{const n=i(e,t);return null!=n?n:(e=e.toUpperCase())>(t=t.toUpperCase())?-1:e<t?1:0}:(e,t)=>{const n=i(e,t);return null!=n?n:(e=e.toUpperCase())<(t=t.toUpperCase())?-1:e>t?1:0}}const I=(e,t)=>h(e,t)??t-e,F=(e,t)=>y(e,t)??e-t;function E(e){return e?I:F}function R(e){return e.slice(24,36)+e.slice(19,23)+e.slice(16,18)+e.slice(14,16)+e.slice(11,13)+e.slice(9,11)+e.slice(6,8)+e.slice(4,6)+e.slice(2,4)+e.slice(0,2)}function w(e,t,i){let n;for(n in e)t?.include?.length&&!t.include.includes(n)||t?.exclude?.length&&t.exclude.includes(n)?delete e[n]:l.includes(n)&&(Number.isFinite(e[n])||(e[n]=null));return i?(["avg","stddev","variance"].forEach(t=>{null!=e[t]&&(e[t]=Math.ceil(e[t]??0))}),e):e}function A(e){const t={};for(let i of e)(null==i||"string"==typeof i&&""===i.trim())&&(i=null),null==t[i]?t[i]={count:1,data:i}:t[i].count++;return{count:t}}function b(e){return"coded-value"!==e?.type?[]:e.codedValues.map(e=>e.code)}function M(e,t,i,n){const s=e.count,r=[];if(i&&t){const e=[],i=b(t[0]);for(const s of i)if(t[1]){const i=b(t[1]);for(const r of i)if(t[2]){const i=b(t[2]);for(const t of i)e.push(`${u(s)}${n}${u(r)}${n}${u(t)}`)}else e.push(`${u(s)}${n}${u(r)}`)}else e.push(s);for(const t of e)s.hasOwnProperty(t)||(s[t]={data:t,count:0})}for(const e in s){const t=s[e];r.push({value:t.data,count:t.count,label:t.label})}return{uniqueValueInfos:r}}function C(e,t,i,n){let s=null;switch(t){case"log":0!==e&&(s=Math.log(e)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(n)&&0!==n&&(s=e/n*100);break;case"field":Number.isFinite(i)&&0!==i&&(s=e/i);break;case"natural-log":e>0&&(s=Math.log(e));break;case"square-root":e>0&&(s=e**.5)}return s}function O(e,t,i){const r=function(e){const{breakCount:t,field:i,normalizationField:s,normalizationType:r}=e,a=e.classificationMethod||"equal-interval",o="standard-deviation"===a?e.standardDeviationInterval||1:void 0,l="defined-interval"===a?e.definedInterval:void 0;return new n.A({breakCount:t,classificationField:i,classificationMethod:a,normalizationField:"field"===r?s:void 0,normalizationType:r,standardDeviationInterval:o,definedInterval:l})}({field:t.field,normalizationType:t.normalizationType,normalizationField:t.normalizationField,classificationMethod:t.classificationMethod,standardDeviationInterval:t.standardDeviationInterval,definedInterval:t.definedInterval,breakCount:t.numClasses||5});return e=function(e,t,i){const n=t??-1/0,s=i??1/0;return e.filter(e=>Number.isFinite(e)&&e>=n&&e<=s)}(e,t.minValue,t.maxValue),(0,s.t)({definition:r,values:e,normalizationTotal:t.normalizationTotal},i)}function N(e,t){let i=e.classBreaks;const n=i.length,s=i[0]?.minValue,a=i[n-1]?.maxValue,o="standard-deviation"===t,l=r;return i=i.map(e=>{const t=e.label,i={minValue:e.minValue,maxValue:e.maxValue,label:t};if(o&&t){const e=t.match(l),n=e?.map(e=>+e.trim())??[];2===n.length?(i.minStdDev=n[0],i.maxStdDev=n[1],n[0]<0&&n[1]>0&&(i.hasAvg=!0)):1===n.length&&(t.includes("<")?(i.minStdDev=null,i.maxStdDev=n[0]):t.includes(">")&&(i.minStdDev=n[0],i.maxStdDev=null))}return i}),{minValue:s,maxValue:a,classBreakInfos:i,normalizationTotal:e.normalizationTotal}}function V(e,t){const i=z(e,t);if(null==i.min&&null==i.max)return{bins:[],minValue:i.min,maxValue:i.max,normalizationTotal:t.normalizationTotal};const n=i.intervals,s=i.min??0,r=i.max??0,a=n.map((e,t)=>({minValue:n[t][0],maxValue:n[t][1],count:0}));for(const t of e)if(null!=t&&t>=s&&t<=r){const e=D(n,t);e>-1&&a[e].count++}return{bins:a,minValue:s,maxValue:r,normalizationTotal:t.normalizationTotal}}function z(e,t,i=!1){const{field:n,classificationMethod:s,standardDeviationInterval:r,definedInterval:a,normalizationType:o,normalizationField:l,normalizationTotal:u,minValue:d,maxValue:f}=t,m=t.numBins||10;let h=null,y=null,g=null;if(s&&"equal-interval"!==s||o){const{classBreaks:t}=O(e,{field:n,normalizationType:o,normalizationField:l,normalizationTotal:u,classificationMethod:s,standardDeviationInterval:r,definedInterval:a,minValue:d,maxValue:f,numClasses:m},null!=d&&null!=f?[d,f]:void 0);h=t[0]?.minValue,y=t[t.length-1]?.maxValue,g=t.map(e=>[e.minValue,e.maxValue])}else{if(null!=d&&null!=f)h=d,y=f;else{const t=p({values:e,minValue:d,maxValue:f,useSampleStdDev:!o,supportsNullCount:c({normalizationType:o,normalizationField:l,minValue:d,maxValue:f})});h=t.min??null,y=t.max??null}g=function(e,t,i){const n=(t-e)/i,s=[];let r,a=e;for(let e=1;e<=i;e++)r=a+n,r=Number(r.toFixed(16)),s.push([a,e===i?t:r]),a=r;return s}(h??0,y??0,m)}if(i&&g.length){const e=g.at(-1)[1];g.push([e,e])}return{min:h,max:y,intervals:g}}function D(e,t){let i=-1;for(let n=e.length-1;n>=0;n--)if(t>=e[n][0]){i=n;break}return i}},92359(e,t,i){i.d(t,{nu:()=>p,W6:()=>u}),i(4576),i(71511),i(44208),i(53966);var n=i(17676),s=(i(36708),i(44794),i(78659)),r=i(32198),a=i(69622),o=i(91429);let l=class extends a.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,r.Cg)([(0,o.MZ)()],l.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,r.Cg)([(0,o.MZ)()],l.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),l=(0,r.Cg)([(0,o.$K)("esri.views.support.debugFlags")],l),new l,i(49186),Symbol("Yield");const u={RESOURCE_CONTROLLER_IMMEDIATE:"immediate",RESOURCE_CONTROLLER:"schedule",SLIDE:"slide",STREAM_DATA_LOADER:"stream loader",ELEVATION_QUERY:"elevation query",TERRAIN_SURFACE:"terrain",SURFACE_GEOMETRY_UPDATES:"surface geometry updates",LOD_RENDERER:"LoD renderer",GRAPHICS_CORE:"Graphics3D",I3S:"I3S",LYR3D:"Lyr3D",TILES3D:"3DTiles",POINT_CLOUD_LAYER:"point cloud",FEATURE_TILE_FETCHER:"feature fetcher",STREAM_CONTROLLER:"stream controller",SCREEN_POLYGON_INTERSECTION:"screen polygon intersection",OCCLUSION_QUERY:"occlusion query",OVERLAY:"overlay",OVERLAY_RENDERER:"overlay renderer",STAGE:"stage",GRAPHICS_DECONFLICTOR:"graphics deconflictor",FILTER_VISIBILITY:"graphics filter visibility",SCALE_VISIBILITY:"graphics scale visibility",FRUSTUM_VISIBILITY:"graphics frustum visibility",POINT_OF_INTEREST_FREQUENT:"POI frequent",POINT_OF_INTEREST_INFREQUENT:"POI infrequent",LABELER:"labeler",FEATURE_QUERY_ENGINE:"feature query",FEATURE_TILE_TREE:"feature tile tree",FEATURE_TILE_TREE_ACTIVE:"fast feature tile tree",ELEVATION_ALIGNMENT:"elevation alignment",ELEVATION_ALIGNMENT_SCENE:"elevation alignment scene",TEXT_TEXTURE_ATLAS:"text texture atlas",TEXTURE_UNLOAD:"texture unload",LINE_OF_SIGHT_TOOL:"line of sight tool",LINE_OF_SIGHT_TOOL_INTERACTIVE:"interactive line of sight tool",VOLUME_MEASUREMENT:"volume measurement",ELEVATION_PROFILE:"elevation profile",SNAPPING:"snapping",SHADOW_ACCUMULATOR:"shadow accumulator",CLOUDS_GENERATOR:"clouds generator",FLOW_GENERATOR:"flow generator",GAUSSIAN_SPLAT_SORTING:"gaussian splat sorting",GAUSSIAN_SPLAT_TEXTURE_ATLAS:"gaussian splat texture atlas",MAPVIEW_FETCH_QUEUE:"mapview fetch queue",MAPVIEW_LAYERVIEW_UPDATE:"mapview layerview update",MAPVIEW_VECTOR_TILE_PARSING_QUEUE:"mapview vector tile parsing queue",NONE:0,TEST_PRIO:1};new Map([[u.RESOURCE_CONTROLLER_IMMEDIATE,0],[u.RESOURCE_CONTROLLER,4],[u.SLIDE,0],[u.STREAM_DATA_LOADER,0],[u.ELEVATION_QUERY,0],[u.TERRAIN_SURFACE,1],[u.SURFACE_GEOMETRY_UPDATES,1],[u.LOD_RENDERER,2],[u.GRAPHICS_CORE,2],[u.I3S,2],[u.LYR3D,2],[u.TILES3D,3],[u.POINT_CLOUD_LAYER,2],[u.FEATURE_TILE_FETCHER,2],[u.STREAM_CONTROLLER,2],[u.SCREEN_POLYGON_INTERSECTION,0],[u.CLOUDS_GENERATOR,2],[u.OCCLUSION_QUERY,2],[u.OVERLAY,4],[u.OVERLAY_RENDERER,4],[u.STAGE,4],[u.GRAPHICS_DECONFLICTOR,4],[u.FILTER_VISIBILITY,4],[u.SCALE_VISIBILITY,4],[u.FRUSTUM_VISIBILITY,4],[u.POINT_OF_INTEREST_FREQUENT,6],[u.POINT_OF_INTEREST_INFREQUENT,30],[u.LABELER,8],[u.FEATURE_QUERY_ENGINE,8],[u.FEATURE_TILE_TREE,16],[u.FEATURE_TILE_TREE_ACTIVE,0],[u.ELEVATION_ALIGNMENT,12],[u.ELEVATION_ALIGNMENT_SCENE,14],[u.TEXT_TEXTURE_ATLAS,12],[u.TEXTURE_UNLOAD,12],[u.LINE_OF_SIGHT_TOOL,16],[u.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[u.VOLUME_MEASUREMENT,4],[u.SNAPPING,0],[u.SHADOW_ACCUMULATOR,30],[u.FLOW_GENERATOR,12],[u.GAUSSIAN_SPLAT_SORTING,2],[u.GAUSSIAN_SPLAT_TEXTURE_ATLAS,12],[u.MAPVIEW_FETCH_QUEUE,0],[u.MAPVIEW_LAYERVIEW_UPDATE,2],[u.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]),(0,s.l5)(6.5),(0,s.l5)(1),(0,s.l5)(30),(0,s.l5)(1e3/30),(0,s.l5)(100),Symbol.dispose;const c=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};c.enabled=!1;class d{remove(){}[Symbol.dispose](){this.remove()}processQueue(){}schedule(e,t,i){try{if((0,n.G4)(t)){const e=(0,n.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,n.z7)(e(c))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,n.G4)(t)){const e=(0,n.NK)();if(i)return i(e);throw e}const s=e(c);for(;;){const e=s.next(c),r=(0,n.$X)(e)?await e:e;if((0,n.G4)(t)){const e=(0,n.NK)();if(i){const t=i(e),r=s.return(null);return(0,n.$X)(r)&&await(0,n.QZ)(r),t}const t=s.throw(e);throw(0,n.$X)(t)&&await(0,n.QZ)(t),e}if(r.done)return r.value}}}const p=new d}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3359,5740],{46130(e,t,r){r.d(t,{v:()=>n});var a=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,a.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},76553(e,t,r){function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>a})},33359(e,t,r){r.d(t,{save:()=>U,saveAs:()=>k});var a=r(4576),n=(r(49186),r(71530)),o=r(60694),s=r(23154),i=(r(20655),r(80812),r(88788)),l=r(10407);const u="Feature Service",c="feature-layer-utils",y=`${c}-save`,f=`${c}-save-as`;function p(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"dimension-feature"===t||"annotation-feature"===t)&&"feature-layer"===e?.source?.type}function m(e){return{isValid:p(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function d(e,t){const r=(0,i.m)(e,"portal-item");return t?.isTable&&(r.layerContainerType="tables"),r}function w(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)h(a)?r.push(n):t.push(n);return{layers:t,tables:r}}function h(e,t){return e.isTable}function L(e){return w([e])}async function b(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):async function(e,t){if(e.reverse(),!t)return w(e);const a=await async function(e,t){let a,n=await e.fetchData("json");if(!function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(n)||(0,l.Y)(e,l.mm.HOSTED_SERVICE))a=!0;else{if(function(e){return[...e.layers,...e.tables].every(e=>"layerType"in e&&!!e.layerType)}(n))return n;a=!1}n??={},function(e){e.layers??=[],e.tables??=[]}(n);const{layer:{url:o,customParameters:i,apiKey:u}}=t[0];return await async function(e,t,a,n){const{url:o,customParameters:i,apiKey:l}=t,{serviceJSON:u,layersJSON:c}=await(0,s.A6)(o,{customParameters:i,apiKey:l});if(!n)return void A(e,u);const y=g(e.layers,u.layers,a),f=g(e.tables,u.tables,a);e.layers=y.itemResources,e.tables=f.itemResources,A(e,u);const p=[...y.added,...f.added],m=c?[...c.layers,...c.tables]:[];await async function(e,t,a,n){const o=await async function(e){const t=new Set,a=[];for(const{type:n}of e){const e=(0,s.Jo)(n);if(e&&!t.has(n))switch(t.add(n),e){case"AnnotationFeatureLayer":a.push(r.e(737).then(()=>r(20737)).then(e=>e.default));break;case"CatalogLayer":a.push(Promise.all([r.e(1214),r.e(5051),r.e(4473),r.e(9789),r.e(893),r.e(7013),r.e(7067)]).then(()=>r(83508)).then(e=>e.default));break;case"DimensionFeatureLayer":a.push(r.e(5077).then(()=>r(25077)).then(e=>e.default));break;case"FeatureLayer":a.push(Promise.all([r.e(6361),r.e(9953),r.e(1214),r.e(5051),r.e(4473),r.e(1017),r.e(9789),r.e(8589),r.e(4500)]).then(()=>r(18589)).then(e=>e.default));break;case"OrientedImageryLayer":a.push(Promise.all([r.e(6361),r.e(9953),r.e(1214),r.e(5051),r.e(4473),r.e(1017),r.e(9789),r.e(8589),r.e(5651)]).then(()=>r(16852)).then(e=>e.default))}}const n=await Promise.all(a),o=new Map;return Array.from(t).forEach((e,t)=>{o.set(e,n[t])}),o}(t),i=[];for(const{id:e,type:r}of t){const t=o.get(r);t&&i.push(new t({url:a,layerId:e,sourceJSON:n.find(({id:t})=>t===e)}))}await Promise.allSettled(i.map(e=>e.load()));for(const t of i){const{layerId:r,loaded:a}=t;if(!a||!("defaultPopupTemplate"in t)||!t.defaultPopupTemplate)continue;const n={id:r,popupInfo:t.defaultPopupTemplate.toJSON()};I(t,"ArcGISFeatureLayer"===t.operationalLayerType?n:{...n,layerType:t.operationalLayerType},e)}}(e,p,o,m)}(n,{url:o??"",customParameters:i,apiKey:u},t.map(e=>e.layer.layerId),a),n}(t,e);for(const t of e)I(t.layer,t.layerJSON,a);return function(e,t){const r=[],a=[];for(const{layer:e}of t){const{isTable:t,layerId:n}=e;t?a.push(n):r.push(n)}S(e.layers,r),S(e.tables,a)}(a,e),a}(t,e)}function S(e,t){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);(0,a.aI)(r.sort(T),t.slice().sort(T))&&e.sort((e,r)=>{const a=t.indexOf(e.id),n=t.indexOf(r.id);return a<n?-1:a>n?1:0})}function T(e,t){return e<t?-1:e>t?1:0}function g(e,t,r){const n=(0,a.iv)(e,t,(e,t)=>e.id===t.id);e=e.filter(e=>!n.removed.some(t=>t.id===e.id));const o=n.added;for(const{id:t}of o)e.push({id:t});return{itemResources:e,added:o.filter(({id:e})=>!r.includes(e))}}function I(e,t,r){e.isTable?v(r.tables,t):v(r.layers,t)}function v(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}function A(e,t){const r=e.layers??[],a=e.tables??[],n=[...t.layers??[],...t.tables??[]];for(const e of[...r,...a]){const{id:t}=e;if("layerType"in e&&e.layerType)continue;const r=n.find(({id:e})=>e===t);if(!r)continue;const o=(0,s.Aq)(r.type,a.includes(e));o&&O(0,o)&&P(o)&&(e.layerType=o)}}function O(e,t){return"ArcGISFeatureLayer"!==t&&"Table"!==t}function P(e){return"ArcGISFeatureLayer"!==e&&"Table"!==e}function N(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"CatalogLayer":return!!e.footprintLayer?.charts?.length;case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length)}return!1}function E(e,t){let r=0,a=0,n=0,o=0,s=0,i=0,u=0;for(const e of[...t.layers,...t.tables])if(N(e)&&u++,"layerType"in e)switch(e.layerType){case"CatalogLayer":r++;break;case"OrientedImageryLayer":a++;break;case"ParcelLayer":s++;break;case"SubtypeGroupLayer":n++;break;case"SubtypeGroupTable":o++;break;case"UtilityNetworkLayer":i++}(0,l.Sm)(e,l.mm.CATALOG_LAYER,r>0),(0,l.Sm)(e,l.mm.ORIENTED_IMAGERY_LAYER,a>0),(0,l.Sm)(e,l.mm.PARCEL_FABRIC,s>0),(0,l.Sm)(e,l.mm.SUBTYPE_GROUP_LAYER,n>0),(0,l.Sm)(e,l.mm.SUBTYPE_GROUP_TABLE,o>0),(0,l.Sm)(e,l.mm.UTILITY_NETWORK,i>0),(0,l.Sm)(e,l.mm.CHARTS,u>0)}function R(e,t,r){E(t,r)}async function C(e,t,r){const{url:a,layerId:n,title:s,fullExtent:i,isTable:u}=e,c=(0,o.qg)(a);t.url=("FeatureServer"===c?.serverType?a:`${a}/${n}`)??null,t.title||=s,t.extent=null,u||null==i||(t.extent=await(0,l.sQ)(i)),function(e,t,r){(0,l.OM)(t,l.mm.METADATA),(0,l.Sm)(t,l.mm.MULTI_LAYER,e.length>1),(0,l.Sm)(t,l.mm.SINGLE_LAYER,1===e.length),(0,l.Sm)(t,l.mm.TABLE,r.tables.length>0&&0===r.layers.length),E(t,r)}([e],t,r)}async function U(e,t){return(0,n.UN)({layer:e,itemType:u,validateLayer:m,createJSONContext:t=>d(t,e),createItemData:(e,t)=>b(t,[e]),errorNamePrefix:y,setItemProperties:R},t)}async function k(e,t,r){return(0,n.Uh)({layer:e,itemType:u,validateLayer:m,createJSONContext:t=>d(t,e),createItemData:(e,t)=>Promise.resolve(L(e)),errorNamePrefix:f,newItem:t,setItemProperties:C},r)}},71530(e,t,r){r.d(t,{UN:()=>L,Uh:()=>b});var a=r(49186),n=r(46130),o=r(20655),s=r(80812),i=r(88788),l=r(10407),u=r(26121);async function c(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.A(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function f(e){const{item:t,errorNamePrefix:r,layer:n,validateItem:o}=e;if(function(e){const{item:t,itemType:r,additionalItemType:n,errorNamePrefix:o,layer:s}=e,i=[r];if(n&&i.push(n),!i.includes(t.type)){const e=i.map(e=>`'${e}'`).join(", ");throw new a.A(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:t,layer:s})}}(e),o){const e=o(t);if(!e.isValid)throw new a.A(`${r}:invalid-parameters`,e.errorMessage,{layer:n})}}function p(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.A(`${r}:portal-item-not-set`,y(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.A(`${r}:portal-item-not-loaded`,y(t,"cannot be saved to a portal item that does not exist or is inaccessible"));f({...e,item:n})}function m(e){const{newItem:t,itemType:r}=e;let a=s.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.A.getDefault(),f({...e,item:a}),a}function d(e){return(0,i.m)(e,"portal-item")}async function w(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),(0,u.ci)(t,{errorName:"layer-write:unsupported"},r),a}function h(e){(0,l.LG)(e,l.mm.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function L(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e),p(e);const u=r.portalItem,y=o?o(u):d(u),f=await w(r,y,{...t,supplementalUnsupportedErrors:l}),m=await a({layer:r,layerJSON:f},u);return await(s?.(r,u,m)),h(u),await u.update({data:m}),(0,n.v)(y),await(i?.(u,y)),u}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e);const u=m(e),y=o?o(u):d(u),f=await w(r,y,{...t,supplementalUnsupportedErrors:l}),p=await a({layer:r,layerJSON:f},u);return await s(r,u,p),h(u),await async function(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}(u,p,t),r.portalItem=u,(0,n.v)(y),await(i?.(u,y)),u}},23154(e,t,r){r.d(t,{A6:()=>i,Aq:()=>d,Jo:()=>m,QM:()=>s});var a=r(77548),n=r(7861);const o=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,t){const{serviceJSON:r,layersJSON:a,...n}=await i(e,t);c(r);const o={serviceJSON:r,...n};return a&&(c(a),o.layersJSON=a),o}async function i(e,t){const{loadContext:r,...o}=t||{},s=r?await r.fetchServiceMetadata(e,o):await(0,n.L)(e,o),i=(0,a.G$)();p(s);const l={serviceJSON:s,preferredHost:i};if((s.currentVersion??0)<10.5)return l;const u=`${(0,a.$x)()??e}/layers`,c=r?await r.fetchServiceMetadata(u,o):await(0,n.L)(u,o);return p(c),l.layersJSON={layers:c.layers,tables:c.tables},l}function l(e){return o.has(e.type)}function u(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(l),e.tables=e.tables?.filter(u)}function y(e){e.type||="Feature Layer"}function f(e){e.type||="Table"}function p(e){e.layers?.forEach(y),e.tables?.forEach(f)}function m(e){if(!e)return"FeatureLayer";switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationFeatureLayer"}return null}function d(e,t){if(!e)return t?"Table":"ArcGISFeatureLayer";switch(e){case"Annotation Layer":return"ArcGISAnnotationLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"ArcGISDimensionLayer";case"Feature Layer":return"ArcGISFeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Parcel Layer":return"ParcelLayer";case"Table":return"Table";case"Topology Layer":return"TopologyLayer";case"Trace Network Layer":return"TraceNetworkLayer";case"Utility Network Layer":return"UtilityNetworkLayer";default:return null}}},88788(e,t,r){r.d(t,{m:()=>s,v:()=>o});var a=r(84952),n=r(20655);function o(e,t){return{...i(e,t),readResourcePaths:[]}}function s(e,t,r){const n=(0,a.An)(r?.forceNewItemContext?null:e.itemUrl);return{...i(e,t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?.withResources?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t,r){return{origin:t,url:(0,a.An)(r?.forceNewItemContext?null:e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}},7861(e,t,r){r.d(t,{L:()=>n});var a=r(56507);async function n(e,t){return(await(0,a.A)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}})).data}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>i,dL:()=>s});var a=r(49186),n=r(77548),o=r(59923);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function i(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new a.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,o.GL)("url",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:a}=r;e&&(n=n.filter(({name:e})=>!(o.MG.has(e)||t.includes(e)))),a&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new a.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function l(e){return(0,n.qd)(e).some(e=>!!e.charts?.length)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3359,5740],{46130(e,t,r){r.d(t,{v:()=>n});var a=r(76553);function n(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,a.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},76553(e,t,r){function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>a})},33359(e,t,r){r.d(t,{save:()=>U,saveAs:()=>k});var a=r(4576),n=(r(49186),r(71530)),o=r(60694),s=r(23154),i=(r(20655),r(80812),r(88788)),l=r(10407);const u="Feature Service",c="feature-layer-utils",y=`${c}-save`,f=`${c}-save-as`;function p(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"dimension-feature"===t||"annotation-feature"===t)&&"feature-layer"===e?.source?.type}function m(e){return{isValid:p(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function d(e,t){const r=(0,i.m)(e,"portal-item");return t?.isTable&&(r.layerContainerType="tables"),r}function w(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)h(a)?r.push(n):t.push(n);return{layers:t,tables:r}}function h(e,t){return e.isTable}function L(e){return w([e])}async function b(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):async function(e,t){if(e.reverse(),!t)return w(e);const a=await async function(e,t){let a,n=await e.fetchData("json");if(!function(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}(n)||(0,l.Y)(e,l.mm.HOSTED_SERVICE))a=!0;else{if(function(e){return[...e.layers,...e.tables].every(e=>"layerType"in e&&!!e.layerType)}(n))return n;a=!1}n??={},function(e){e.layers??=[],e.tables??=[]}(n);const{layer:{url:o,customParameters:i,apiKey:u}}=t[0];return await async function(e,t,a,n){const{url:o,customParameters:i,apiKey:l}=t,{serviceJSON:u,layersJSON:c}=await(0,s.A6)(o,{customParameters:i,apiKey:l});if(!n)return void A(e,u);const y=g(e.layers,u.layers,a),f=g(e.tables,u.tables,a);e.layers=y.itemResources,e.tables=f.itemResources,A(e,u);const p=[...y.added,...f.added],m=c?[...c.layers,...c.tables]:[];await async function(e,t,a,n){const o=await async function(e){const t=new Set,a=[];for(const{type:n}of e){const e=(0,s.Jo)(n);if(e&&!t.has(n))switch(t.add(n),e){case"AnnotationFeatureLayer":a.push(r.e(737).then(()=>r(20737)).then(e=>e.default));break;case"CatalogLayer":a.push(Promise.all([r.e(1214),r.e(5051),r.e(6854),r.e(9789),r.e(893),r.e(7013),r.e(7067)]).then(()=>r(83508)).then(e=>e.default));break;case"DimensionFeatureLayer":a.push(r.e(5077).then(()=>r(25077)).then(e=>e.default));break;case"FeatureLayer":a.push(Promise.all([r.e(6361),r.e(9953),r.e(1214),r.e(5051),r.e(6854),r.e(1017),r.e(9789),r.e(8589),r.e(4500)]).then(()=>r(18589)).then(e=>e.default));break;case"OrientedImageryLayer":a.push(Promise.all([r.e(6361),r.e(9953),r.e(1214),r.e(5051),r.e(6854),r.e(1017),r.e(9789),r.e(8589),r.e(5651)]).then(()=>r(16852)).then(e=>e.default))}}const n=await Promise.all(a),o=new Map;return Array.from(t).forEach((e,t)=>{o.set(e,n[t])}),o}(t),i=[];for(const{id:e,type:r}of t){const t=o.get(r);t&&i.push(new t({url:a,layerId:e,sourceJSON:n.find(({id:t})=>t===e)}))}await Promise.allSettled(i.map(e=>e.load()));for(const t of i){const{layerId:r,loaded:a}=t;if(!a||!("defaultPopupTemplate"in t)||!t.defaultPopupTemplate)continue;const n={id:r,popupInfo:t.defaultPopupTemplate.toJSON()};I(t,"ArcGISFeatureLayer"===t.operationalLayerType?n:{...n,layerType:t.operationalLayerType},e)}}(e,p,o,m)}(n,{url:o??"",customParameters:i,apiKey:u},t.map(e=>e.layer.layerId),a),n}(t,e);for(const t of e)I(t.layer,t.layerJSON,a);return function(e,t){const r=[],a=[];for(const{layer:e}of t){const{isTable:t,layerId:n}=e;t?a.push(n):r.push(n)}S(e.layers,r),S(e.tables,a)}(a,e),a}(t,e)}function S(e,t){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);(0,a.aI)(r.sort(T),t.slice().sort(T))&&e.sort((e,r)=>{const a=t.indexOf(e.id),n=t.indexOf(r.id);return a<n?-1:a>n?1:0})}function T(e,t){return e<t?-1:e>t?1:0}function g(e,t,r){const n=(0,a.iv)(e,t,(e,t)=>e.id===t.id);e=e.filter(e=>!n.removed.some(t=>t.id===e.id));const o=n.added;for(const{id:t}of o)e.push({id:t});return{itemResources:e,added:o.filter(({id:e})=>!r.includes(e))}}function I(e,t,r){e.isTable?v(r.tables,t):v(r.layers,t)}function v(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}function A(e,t){const r=e.layers??[],a=e.tables??[],n=[...t.layers??[],...t.tables??[]];for(const e of[...r,...a]){const{id:t}=e;if("layerType"in e&&e.layerType)continue;const r=n.find(({id:e})=>e===t);if(!r)continue;const o=(0,s.Aq)(r.type,a.includes(e));o&&O(0,o)&&P(o)&&(e.layerType=o)}}function O(e,t){return"ArcGISFeatureLayer"!==t&&"Table"!==t}function P(e){return"ArcGISFeatureLayer"!==e&&"Table"!==e}function N(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"CatalogLayer":return!!e.footprintLayer?.charts?.length;case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length)}return!1}function E(e,t){let r=0,a=0,n=0,o=0,s=0,i=0,u=0;for(const e of[...t.layers,...t.tables])if(N(e)&&u++,"layerType"in e)switch(e.layerType){case"CatalogLayer":r++;break;case"OrientedImageryLayer":a++;break;case"ParcelLayer":s++;break;case"SubtypeGroupLayer":n++;break;case"SubtypeGroupTable":o++;break;case"UtilityNetworkLayer":i++}(0,l.Sm)(e,l.mm.CATALOG_LAYER,r>0),(0,l.Sm)(e,l.mm.ORIENTED_IMAGERY_LAYER,a>0),(0,l.Sm)(e,l.mm.PARCEL_FABRIC,s>0),(0,l.Sm)(e,l.mm.SUBTYPE_GROUP_LAYER,n>0),(0,l.Sm)(e,l.mm.SUBTYPE_GROUP_TABLE,o>0),(0,l.Sm)(e,l.mm.UTILITY_NETWORK,i>0),(0,l.Sm)(e,l.mm.CHARTS,u>0)}function R(e,t,r){E(t,r)}async function C(e,t,r){const{url:a,layerId:n,title:s,fullExtent:i,isTable:u}=e,c=(0,o.qg)(a);t.url=("FeatureServer"===c?.serverType?a:`${a}/${n}`)??null,t.title||=s,t.extent=null,u||null==i||(t.extent=await(0,l.sQ)(i)),function(e,t,r){(0,l.OM)(t,l.mm.METADATA),(0,l.Sm)(t,l.mm.MULTI_LAYER,e.length>1),(0,l.Sm)(t,l.mm.SINGLE_LAYER,1===e.length),(0,l.Sm)(t,l.mm.TABLE,r.tables.length>0&&0===r.layers.length),E(t,r)}([e],t,r)}async function U(e,t){return(0,n.UN)({layer:e,itemType:u,validateLayer:m,createJSONContext:t=>d(t,e),createItemData:(e,t)=>b(t,[e]),errorNamePrefix:y,setItemProperties:R},t)}async function k(e,t,r){return(0,n.Uh)({layer:e,itemType:u,validateLayer:m,createJSONContext:t=>d(t,e),createItemData:(e,t)=>Promise.resolve(L(e)),errorNamePrefix:f,newItem:t,setItemProperties:C},r)}},71530(e,t,r){r.d(t,{UN:()=>L,Uh:()=>b});var a=r(49186),n=r(46130),o=r(20655),s=r(80812),i=r(88788),l=r(10407),u=r(26121);async function c(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.A(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function y(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function f(e){const{item:t,errorNamePrefix:r,layer:n,validateItem:o}=e;if(function(e){const{item:t,itemType:r,additionalItemType:n,errorNamePrefix:o,layer:s}=e,i=[r];if(n&&i.push(n),!i.includes(t.type)){const e=i.map(e=>`'${e}'`).join(", ");throw new a.A(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${e}"`,{item:t,layer:s})}}(e),o){const e=o(t);if(!e.isValid)throw new a.A(`${r}:invalid-parameters`,e.errorMessage,{layer:n})}}function p(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.A(`${r}:portal-item-not-set`,y(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.A(`${r}:portal-item-not-loaded`,y(t,"cannot be saved to a portal item that does not exist or is inaccessible"));f({...e,item:n})}function m(e){const{newItem:t,itemType:r}=e;let a=s.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.A.getDefault(),f({...e,item:a}),a}function d(e){return(0,i.m)(e,"portal-item")}async function w(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const a=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),(0,u.ci)(t,{errorName:"layer-write:unsupported"},r),a}function h(e){(0,l.LG)(e,l.mm.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}async function L(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e),p(e);const u=r.portalItem,y=o?o(u):d(u),f=await w(r,y,{...t,supplementalUnsupportedErrors:l}),m=await a({layer:r,layerJSON:f},u);return await(s?.(r,u,m)),h(u),await u.update({data:m}),(0,n.v)(y),await(i?.(u,y)),u}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:s,saveResources:i,supplementalUnsupportedErrors:l}=e;await c(e);const u=m(e),y=o?o(u):d(u),f=await w(r,y,{...t,supplementalUnsupportedErrors:l}),p=await a({layer:r,layerJSON:f},u);return await s(r,u,p),h(u),await async function(e,t,r){const a=e.portal;await a.signIn(),await a.user.addItem({item:e,data:t,folder:r?.folder})}(u,p,t),r.portalItem=u,(0,n.v)(y),await(i?.(u,y)),u}},23154(e,t,r){r.d(t,{A6:()=>i,Aq:()=>d,Jo:()=>m,QM:()=>s});var a=r(77548),n=r(7861);const o=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function s(e,t){const{serviceJSON:r,layersJSON:a,...n}=await i(e,t);c(r);const o={serviceJSON:r,...n};return a&&(c(a),o.layersJSON=a),o}async function i(e,t){const{loadContext:r,...o}=t||{},s=r?await r.fetchServiceMetadata(e,o):await(0,n.L)(e,o),i=(0,a.G$)();p(s);const l={serviceJSON:s,preferredHost:i};if((s.currentVersion??0)<10.5)return l;const u=`${(0,a.$x)()??e}/layers`,c=r?await r.fetchServiceMetadata(u,o):await(0,n.L)(u,o);return p(c),l.layersJSON={layers:c.layers,tables:c.tables},l}function l(e){return o.has(e.type)}function u(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(l),e.tables=e.tables?.filter(u)}function y(e){e.type||="Feature Layer"}function f(e){e.type||="Table"}function p(e){e.layers?.forEach(y),e.tables?.forEach(f)}function m(e){if(!e)return"FeatureLayer";switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationFeatureLayer"}return null}function d(e,t){if(!e)return t?"Table":"ArcGISFeatureLayer";switch(e){case"Annotation Layer":return"ArcGISAnnotationLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"ArcGISDimensionLayer";case"Feature Layer":return"ArcGISFeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Parcel Layer":return"ParcelLayer";case"Table":return"Table";case"Topology Layer":return"TopologyLayer";case"Trace Network Layer":return"TraceNetworkLayer";case"Utility Network Layer":return"UtilityNetworkLayer";default:return null}}},88788(e,t,r){r.d(t,{m:()=>s,v:()=>o});var a=r(84952),n=r(20655);function o(e,t){return{...i(e,t),readResourcePaths:[]}}function s(e,t,r){const n=(0,a.An)(r?.forceNewItemContext?null:e.itemUrl);return{...i(e,t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:n?{rootPath:n.path,writtenUrls:[]}:null,resources:r?.withResources?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function i(e,t,r){return{origin:t,url:(0,a.An)(r?.forceNewItemContext?null:e.itemUrl),portal:e.portal||n.A.getDefault(),portalItem:e}}},7861(e,t,r){r.d(t,{L:()=>n});var a=r(56507);async function n(e,t){return(await(0,a.A)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}})).data}},26121(e,t,r){r.d(t,{I6:()=>l,ci:()=>i,dL:()=>s});var a=r(49186),n=r(77548),o=r(59923);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}function i(e,t,r){let n=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new a.A(e,t,r));if(e.blockedRelativeUrls&&(n=n.concat(e.blockedRelativeUrls.map(e=>(0,o.GL)("url",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:a}=r;e&&(n=n.filter(({name:e})=>!(o.MG.has(e)||t.includes(e)))),a&&(n=n.filter(e=>"web-document-write:property-required"!==e.name))}if(n.length>0)throw new a.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:n})}function l(e){return(0,n.qd)(e).some(e=>!!e.charts?.length)}}}]);