@arcgis/core 5.2.0-next.127 → 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 (405) hide show
  1. package/WebScene.js +1 -1
  2. package/applications/Components/imageryUtils.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.d.ts +14 -1
  4. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  5. package/applications/WebEditor/sketchUtils.js +1 -1
  6. package/arcade/batchExec.js +1 -1
  7. package/arcade/geometry/adapters/dehydrated.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/06da350b4ea25732f52b.js +1 -0
  10. package/assets/esri/core/workers/chunks/{67dcf9b873cb037b2647.js → 081c9ccaa5884c730a91.js} +1 -1
  11. package/assets/esri/core/workers/chunks/094102031cc77b20db74.js +1 -0
  12. package/assets/esri/core/workers/chunks/0b85c844af97b2fb0ba8.js +1 -0
  13. package/assets/esri/core/workers/chunks/{86d7a3ae672a51b75fcc.js → 0d44f793d3b0d33153ac.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0de140199161fcd15a0c.js +1 -0
  15. package/assets/esri/core/workers/chunks/0deceece4b465f653f58.js +1 -0
  16. package/assets/esri/core/workers/chunks/111dc5653daa7f3e1001.js +1 -0
  17. package/assets/esri/core/workers/chunks/139e3da8ea081e21539e.js +1 -0
  18. package/assets/esri/core/workers/chunks/142bedebd37d747f84ba.js +1 -0
  19. package/assets/esri/core/workers/chunks/15dc28b4fa5b5110472b.js +1 -0
  20. package/assets/esri/core/workers/chunks/{dd02cc18ebebb90778c6.js → 17e2bfc7468c23e43bef.js} +1 -1
  21. package/assets/esri/core/workers/chunks/196d33f4d8e3a256ad94.js +1 -0
  22. package/assets/esri/core/workers/chunks/1a02c68de65a67ab6a67.js +1 -0
  23. package/assets/esri/core/workers/chunks/{4165eb86471ea3bbf364.js → 1aecf7106a21320e054e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/1bc03b8065cbbbb06c87.js +1 -0
  25. package/assets/esri/core/workers/chunks/1beb32170d659bc43977.js +1 -0
  26. package/assets/esri/core/workers/chunks/20ee32fee219afbcfee3.js +1 -0
  27. package/assets/esri/core/workers/chunks/{9467744cb7d094a5067a.js → 21d2f5324db0b199060c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/22abb9a74f6594f9db2a.js +1 -0
  29. package/assets/esri/core/workers/chunks/237795866c075880531b.js +1 -0
  30. package/assets/esri/core/workers/chunks/25e4da9c6837ab0fa585.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a5fde737dc99627142e.js +1 -0
  32. package/assets/esri/core/workers/chunks/3412050ae63ff7dcaf36.js +1 -0
  33. package/assets/esri/core/workers/chunks/35316724c8d3cc39cf80.js +1 -0
  34. package/assets/esri/core/workers/chunks/354cc6cd2a56937f1747.js +1 -0
  35. package/assets/esri/core/workers/chunks/365ae479765ca9e47de4.js +1 -0
  36. package/assets/esri/core/workers/chunks/{8190fcb1dd10ad20feed.js → 36ef86701883a20dd6f6.js} +1 -1
  37. package/assets/esri/core/workers/chunks/3759e272a1d43534a190.js +1 -0
  38. package/assets/esri/core/workers/chunks/397ddcf0b8e858a17b70.js +1 -0
  39. package/assets/esri/core/workers/chunks/3a7a558e30b5cb81c801.js +1 -0
  40. package/assets/esri/core/workers/chunks/3c9405d310a1b08c901e.js +1 -0
  41. package/assets/esri/core/workers/chunks/{e10fe4c77b8dc4492092.js → 3ce53562926b05e71af5.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3d174a84b785fc633a5a.js +1 -0
  43. package/assets/esri/core/workers/chunks/3d67fed3e53993c38b58.js +1 -0
  44. package/assets/esri/core/workers/chunks/42bdeeff55fb1a3f735f.js +1 -0
  45. package/assets/esri/core/workers/chunks/48f1532520b76fa7f0c2.js +1 -0
  46. package/assets/esri/core/workers/chunks/{00d9e41deecf5828975c.js → 4adc3822ed9f498f5653.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{d5f0fed415b5b155d57c.js → 51741ef8225d470716fe.js} +1 -1
  48. package/assets/esri/core/workers/chunks/5191e481d0e19a7f3888.js +1 -0
  49. package/assets/esri/core/workers/chunks/{7fcee3a1b900ddc9a5e3.js → 540acf6abdee9dbd453e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{d9b63cf111035b05cd2e.js → 5484b89adc53430226d5.js} +1 -1
  51. package/assets/esri/core/workers/chunks/55361b50ecfc98db2ffb.js +1 -0
  52. package/assets/esri/core/workers/chunks/58da7c41c1bcef2f4141.js +1 -0
  53. package/assets/esri/core/workers/chunks/5979bbefb09d132c008f.js +1 -0
  54. package/assets/esri/core/workers/chunks/{84db05e872dbf35c80a2.js → 5982c6a8459c1237b298.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{0a20f84b5f004a77a9f9.js → 5abfc4f447b01d6bf287.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{4c0dba437de0969a5b63.js → 5b9f88194433410bad5b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/5f794f4e0113d5dd50ba.js +1 -0
  58. package/assets/esri/core/workers/chunks/62a30692e2a7612bafc1.js +1 -0
  59. package/assets/esri/core/workers/chunks/62aa7daad4ca7332854e.js +1 -0
  60. package/assets/esri/core/workers/chunks/66926c3686d5ef2d4692.js +29 -0
  61. package/assets/esri/core/workers/chunks/6994ba168465b77a36af.js +1 -0
  62. package/assets/esri/core/workers/chunks/6d0c6fda9100fe89f3cb.js +1 -0
  63. package/assets/esri/core/workers/chunks/72a898894438f177cd62.js +1 -0
  64. package/assets/esri/core/workers/chunks/78d4455237120103f639.js +1 -0
  65. package/assets/esri/core/workers/chunks/7fccf53aa751cd9dae57.js +1 -0
  66. package/assets/esri/core/workers/chunks/{26995de0c18bef8db590.js → 81327e10200065a0ccef.js} +1 -1
  67. package/assets/esri/core/workers/chunks/84a3fbe5d85a357f4e82.js +1 -0
  68. package/assets/esri/core/workers/chunks/862479729f2d036f606b.js +1 -0
  69. package/assets/esri/core/workers/chunks/89dad6c1bfd81e4d7f8e.js +1 -0
  70. package/assets/esri/core/workers/chunks/8a9aa6db11d0f643961c.js +1 -0
  71. package/assets/esri/core/workers/chunks/8dfea65341991e13ab71.js +1 -0
  72. package/assets/esri/core/workers/chunks/8e92925043dc49ed1018.js +1 -0
  73. package/assets/esri/core/workers/chunks/8f0b2b0ca239b01f44d0.js +1 -0
  74. package/assets/esri/core/workers/chunks/93a89168c18db88f60e7.js +1 -0
  75. package/assets/esri/core/workers/chunks/991c854a4459c82d4d93.js +1 -0
  76. package/assets/esri/core/workers/chunks/{f90cad9f007a11154c0d.js → 9b080d07699b56f06c5f.js} +1 -1
  77. package/assets/esri/core/workers/chunks/9cd69aa3880838a834f8.js +1 -0
  78. package/assets/esri/core/workers/chunks/{2ca49fb4590cc34a02bd.js → 9d87f38b16dda1ff7978.js} +1 -1
  79. package/assets/esri/core/workers/chunks/9fd1e5a2c0a261ed2a33.js +1 -0
  80. package/assets/esri/core/workers/chunks/a0a9c41400ae98df1912.js +1 -0
  81. package/assets/esri/core/workers/chunks/a189e520da39919cdcca.js +1 -0
  82. package/assets/esri/core/workers/chunks/a3a5cb664bdb1db190dd.js +1 -0
  83. package/assets/esri/core/workers/chunks/a63c456ecf018ec06778.js +1 -0
  84. package/assets/esri/core/workers/chunks/{842f993fa60b410cb613.js → a8322a978e33c7349fdf.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{f479b4a4cee4bb2e046c.js → aa96eea0899757ab38c7.js} +1 -1
  86. package/assets/esri/core/workers/chunks/ab0b2a76247dfd56b92d.js +1 -0
  87. package/assets/esri/core/workers/chunks/ab7337b076d152a8eb9e.js +1 -0
  88. package/assets/esri/core/workers/chunks/ac0de274853a42d518a1.js +1 -0
  89. package/assets/esri/core/workers/chunks/ad372e399e20d5a3262d.js +1 -0
  90. package/assets/esri/core/workers/chunks/ae75b3e5320d03dff64c.js +1 -0
  91. package/assets/esri/core/workers/chunks/ae98530d5816306216b3.js +1 -0
  92. package/assets/esri/core/workers/chunks/afc94c4b9bc007fe310f.js +1 -0
  93. package/assets/esri/core/workers/chunks/afe54923339e957b71b9.js +1 -0
  94. package/assets/esri/core/workers/chunks/bbcac00362fef5e3956d.js +1 -0
  95. package/assets/esri/core/workers/chunks/{1302bf9718747cd9fdd9.js → bcee161dd1c4781d1998.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{d1f54b0079fb71a15612.js → bd231bc0624eb889ac14.js} +1 -1
  97. package/assets/esri/core/workers/chunks/c0075715fbe7bec10fc3.js +1 -0
  98. package/assets/esri/core/workers/chunks/c4e1e864fb8c119b2520.js +1 -0
  99. package/assets/esri/core/workers/chunks/c93cedf9e53da5aaa35b.js +1 -0
  100. package/assets/esri/core/workers/chunks/{2d592c935571de80a2e2.js → c9690810b198a97bc16d.js} +1 -1
  101. package/assets/esri/core/workers/chunks/cada517cc25fa37f778c.js +1 -0
  102. package/assets/esri/core/workers/chunks/cd1821bf601949674e02.js +1 -0
  103. package/assets/esri/core/workers/chunks/{1b42d163ef22e3565bb7.js → cf7b7e54cd87422ca62a.js} +1 -1
  104. package/assets/esri/core/workers/chunks/d1187ad6cc4959683819.js +1 -0
  105. package/assets/esri/core/workers/chunks/d195c57fc6de3560653d.js +1 -0
  106. package/assets/esri/core/workers/chunks/d7f830a06ded11f2fc80.js +1 -0
  107. package/assets/esri/core/workers/chunks/d877783815afd21dbe98.js +1 -0
  108. package/assets/esri/core/workers/chunks/db5181fcea96cc2ede3e.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js → de28a86775235bd5d3c4.js} +2 -2
  110. package/assets/esri/core/workers/chunks/df6992416cba9539f1ed.js +1 -0
  111. package/assets/esri/core/workers/chunks/e4005d95a396e1af9ac2.js +1 -0
  112. package/assets/esri/core/workers/chunks/{668ec0bdfb2095e90c9e.js → e495697860f7207da4c7.js} +1 -1
  113. package/assets/esri/core/workers/chunks/ec187933b42fe65594b7.js +1 -0
  114. package/assets/esri/core/workers/chunks/eec5a93dbc258a90b6de.js +1 -0
  115. package/assets/esri/core/workers/chunks/f163502c513205c892e7.js +1 -0
  116. package/assets/esri/core/workers/chunks/f287ec0fcb611f82ebb0.js +1 -0
  117. package/assets/esri/core/workers/chunks/{37ae52c71bf9c70fbb92.js → f2d45d15d0ba2537a4eb.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{d507d7d7a7282fc38e8d.js → f652d1db26fbdea1a79b.js} +1 -1
  119. package/assets/esri/core/workers/chunks/f6b38ed75baae198c19b.js +1 -0
  120. package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js → f6cfc901267a229de7a1.js} +2 -2
  121. package/assets/esri/core/workers/chunks/f6d04d14323b926f1025.js +1 -0
  122. package/assets/esri/core/workers/chunks/f7ab606be37373312ebe.js +1 -0
  123. package/assets/esri/core/workers/chunks/{3b7dff15a0058ea29886.js → f92178ac6dc9abff304f.js} +1 -1
  124. package/assets/esri/core/workers/chunks/fc39593febef74a036f1.js +1 -0
  125. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  126. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  127. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  128. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  129. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  130. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  131. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  132. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  133. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  134. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  135. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  136. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  137. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  138. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  139. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  140. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  141. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  142. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  143. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  144. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  145. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  146. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  147. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  148. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  149. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  150. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  151. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  152. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  153. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  154. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  155. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  156. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  157. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  158. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  159. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  160. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  161. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  162. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  163. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  164. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  165. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  166. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  167. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  168. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  169. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  170. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  171. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  172. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  173. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  174. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  175. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  176. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  177. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
  178. package/assets/esri/themes/base/widgets/_Tooltip.scss +5 -3
  179. package/assets/esri/themes/dark/main.css +1 -1
  180. package/assets/esri/themes/light/main.css +1 -1
  181. package/assets/esri/themes/light/view.css +1 -1
  182. package/assets/esri/views/interactive/tooltip/t9n/messages.ar.json +1 -1
  183. package/assets/esri/views/interactive/tooltip/t9n/messages.bg.json +1 -1
  184. package/assets/esri/views/interactive/tooltip/t9n/messages.bs.json +1 -1
  185. package/assets/esri/views/interactive/tooltip/t9n/messages.ca.json +1 -1
  186. package/assets/esri/views/interactive/tooltip/t9n/messages.cs.json +1 -1
  187. package/assets/esri/views/interactive/tooltip/t9n/messages.da.json +1 -1
  188. package/assets/esri/views/interactive/tooltip/t9n/messages.de.json +1 -1
  189. package/assets/esri/views/interactive/tooltip/t9n/messages.el.json +1 -1
  190. package/assets/esri/views/interactive/tooltip/t9n/messages.es.json +1 -1
  191. package/assets/esri/views/interactive/tooltip/t9n/messages.et.json +1 -1
  192. package/assets/esri/views/interactive/tooltip/t9n/messages.fi.json +1 -1
  193. package/assets/esri/views/interactive/tooltip/t9n/messages.fr.json +1 -1
  194. package/assets/esri/views/interactive/tooltip/t9n/messages.he.json +1 -1
  195. package/assets/esri/views/interactive/tooltip/t9n/messages.hr.json +1 -1
  196. package/assets/esri/views/interactive/tooltip/t9n/messages.hu.json +1 -1
  197. package/assets/esri/views/interactive/tooltip/t9n/messages.id.json +1 -1
  198. package/assets/esri/views/interactive/tooltip/t9n/messages.it.json +1 -1
  199. package/assets/esri/views/interactive/tooltip/t9n/messages.ja.json +1 -1
  200. package/assets/esri/views/interactive/tooltip/t9n/messages.ko.json +1 -1
  201. package/assets/esri/views/interactive/tooltip/t9n/messages.lt.json +1 -1
  202. package/assets/esri/views/interactive/tooltip/t9n/messages.lv.json +1 -1
  203. package/assets/esri/views/interactive/tooltip/t9n/messages.nl.json +1 -1
  204. package/assets/esri/views/interactive/tooltip/t9n/messages.no.json +1 -1
  205. package/assets/esri/views/interactive/tooltip/t9n/messages.pl.json +1 -1
  206. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-BR.json +1 -1
  207. package/assets/esri/views/interactive/tooltip/t9n/messages.pt-PT.json +1 -1
  208. package/assets/esri/views/interactive/tooltip/t9n/messages.ro.json +1 -1
  209. package/assets/esri/views/interactive/tooltip/t9n/messages.ru.json +1 -1
  210. package/assets/esri/views/interactive/tooltip/t9n/messages.sk.json +1 -1
  211. package/assets/esri/views/interactive/tooltip/t9n/messages.sl.json +1 -1
  212. package/assets/esri/views/interactive/tooltip/t9n/messages.sr.json +1 -1
  213. package/assets/esri/views/interactive/tooltip/t9n/messages.sv.json +1 -1
  214. package/assets/esri/views/interactive/tooltip/t9n/messages.th.json +1 -1
  215. package/assets/esri/views/interactive/tooltip/t9n/messages.tr.json +1 -1
  216. package/assets/esri/views/interactive/tooltip/t9n/messages.uk.json +1 -1
  217. package/assets/esri/views/interactive/tooltip/t9n/messages.vi.json +1 -1
  218. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-CN.json +1 -1
  219. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-HK.json +1 -1
  220. package/assets/esri/views/interactive/tooltip/t9n/messages.zh-TW.json +1 -1
  221. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  222. package/chunks/batchExec.js +2 -0
  223. package/config.js +1 -1
  224. package/core/units.js +1 -1
  225. package/geometry/HeightModelInfo.js +1 -1
  226. package/geometry/ellipsoidUtils.js +1 -1
  227. package/geometry/support/heightModelInfoUtils.js +1 -1
  228. package/geometry/support/intersects.js +1 -1
  229. package/geometry/support/intersectsBase.js +1 -1
  230. package/interfaces.d.ts +1 -0
  231. package/kernel.js +1 -1
  232. package/layers/ElevationLayer.js +1 -1
  233. package/layers/GeospatialPDFLayer.js +1 -1
  234. package/layers/ImageryTileLayer.js +1 -1
  235. package/layers/OrientedImageryLayer.js +1 -1
  236. package/layers/graphics/dehydratedFeatures.js +1 -1
  237. package/layers/graphics/hydrateGeometryJSON.js +2 -0
  238. package/layers/graphics/hydratedFeatures.js +1 -1
  239. package/layers/graphics/hydratedSpatialReference.js +2 -0
  240. package/layers/graphics/transferFeatures.js +2 -0
  241. package/layers/mixins/FeatureLayerBase.js +1 -1
  242. package/layers/mixins/HeightModelInfoMixin.js +2 -0
  243. package/layers/mixins/SceneService.js +1 -1
  244. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  245. package/layers/raster/datasets/DBFParser.js +1 -1
  246. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  247. package/layers/raster/datasets/RasterFactory.js +1 -1
  248. package/layers/raster/datasets/TIFFRaster.js +1 -1
  249. package/layers/raster/formats/JpgPlus.js +1 -1
  250. package/layers/raster/formats/RasterCodec.js +1 -1
  251. package/layers/raster/formats/Raw.js +1 -1
  252. package/layers/support/arcadeUtils.js +1 -1
  253. package/package.json +3 -3
  254. package/popup/FeatureContent.js +1 -1
  255. package/popup/FeatureContentCollection.d.ts +2 -0
  256. package/popup/FeatureContentCollection.js +1 -1
  257. package/popup/support/featureUtils.js +1 -1
  258. package/rest/imageService.js +1 -1
  259. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  260. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  261. package/support/arcadeUtils.js +1 -1
  262. package/support/loadArcade.js +1 -1
  263. package/support/revision.js +1 -1
  264. package/symbols/cim/cimAnalyzer.js +1 -1
  265. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  266. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  267. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  268. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  269. package/views/2d/engine/vectorTiles/decluttering/util.js +1 -1
  270. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  271. package/views/2d/layerViewModuleImportUtils.js +1 -1
  272. package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
  273. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  274. package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
  275. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  276. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  277. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  278. package/views/2d/support/hitTestUtils.js +1 -1
  279. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  280. package/views/3d/camera/intersectionUtils.js +1 -1
  281. package/views/3d/interactive/Manipulator3D.js +1 -1
  282. package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  285. package/views/3d/layers/support/featureReference.js +1 -1
  286. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  287. package/views/3d/state/Constraints.js +1 -1
  288. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  289. package/views/3d/support/PBFDecoder.js +1 -1
  290. package/views/3d/support/PBFDecoderWorker.js +1 -1
  291. package/views/3d/support/QualityProfile.js +1 -1
  292. package/views/3d/terrain/TerrainRenderer.js +1 -1
  293. package/views/3d/terrain/TileCompositor.js +1 -1
  294. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  295. package/views/DOMContainer.d.ts +18 -8
  296. package/views/SceneView.js +1 -1
  297. package/views/ToolViewManager.js +1 -1
  298. package/views/VideoView.d.ts +38 -0
  299. package/views/VideoView.js +1 -1
  300. package/views/View.d.ts +20 -2
  301. package/views/View.js +1 -1
  302. package/views/input/types.d.ts +19 -6
  303. package/views/interactive/dragEventPipeline.js +1 -1
  304. package/views/interactive/options/TooltipVisibleElements.d.ts +11 -1
  305. package/views/interactive/options/TooltipVisibleElements.js +1 -1
  306. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  307. package/views/layers/ImageryTileLayerView.js +1 -1
  308. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  309. package/widgets/BatchAttributeForm.js +1 -1
  310. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  311. package/widgets/OrientedImageryViewer/utils.js +1 -1
  312. package/widgets/Search/SearchViewModel.js +1 -1
  313. package/widgets/Search/support/layerSearchUtils.js +1 -1
  314. package/assets/esri/core/workers/chunks/025da54eef112d7e8f66.js +0 -1
  315. package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +0 -1
  316. package/assets/esri/core/workers/chunks/04d4cd66485b622403d0.js +0 -1
  317. package/assets/esri/core/workers/chunks/05afa8c2b5929ce0545a.js +0 -1
  318. package/assets/esri/core/workers/chunks/09676cfa99b90fe0cc63.js +0 -1
  319. package/assets/esri/core/workers/chunks/0a2b7c691a577cb3d189.js +0 -1
  320. package/assets/esri/core/workers/chunks/0aadee0437fa061e4ff5.js +0 -1
  321. package/assets/esri/core/workers/chunks/0ccd4200c5a2a5de6e16.js +0 -1
  322. package/assets/esri/core/workers/chunks/1262918b2161d79851c0.js +0 -1
  323. package/assets/esri/core/workers/chunks/1406a884241809b62bff.js +0 -1
  324. package/assets/esri/core/workers/chunks/1c33aa349beea9a3792f.js +0 -1
  325. package/assets/esri/core/workers/chunks/1f135269aea3931e11b2.js +0 -1
  326. package/assets/esri/core/workers/chunks/2146c25c01c9fc11b16c.js +0 -1
  327. package/assets/esri/core/workers/chunks/24014f3701c31ee74bc2.js +0 -1
  328. package/assets/esri/core/workers/chunks/25a2e02677a74834c8b5.js +0 -1
  329. package/assets/esri/core/workers/chunks/2afce71e8b6ae86e0792.js +0 -1
  330. package/assets/esri/core/workers/chunks/2c7bb5c9751524687002.js +0 -1
  331. package/assets/esri/core/workers/chunks/2c7fc24649d91552e68a.js +0 -1
  332. package/assets/esri/core/workers/chunks/2ebad7e588b26e74cefe.js +0 -1
  333. package/assets/esri/core/workers/chunks/319434415d2c0561bc59.js +0 -1
  334. package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +0 -1
  335. package/assets/esri/core/workers/chunks/3aceedec9abfb2fdfa18.js +0 -1
  336. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +0 -1
  337. package/assets/esri/core/workers/chunks/4327d2c39a660bd89da7.js +0 -1
  338. package/assets/esri/core/workers/chunks/462fd57af8ed7921d6ba.js +0 -1
  339. package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +0 -1
  340. package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +0 -1
  341. package/assets/esri/core/workers/chunks/48a2f68e06a2e90b77d0.js +0 -1
  342. package/assets/esri/core/workers/chunks/4a73f73f1698fad2df20.js +0 -1
  343. package/assets/esri/core/workers/chunks/4f464047c6f6c9486efd.js +0 -1
  344. package/assets/esri/core/workers/chunks/50c29d10ec53f0e48e8a.js +0 -1
  345. package/assets/esri/core/workers/chunks/526cc64ae46dec3fbeda.js +0 -1
  346. package/assets/esri/core/workers/chunks/550d4df0732352fa48b5.js +0 -1
  347. package/assets/esri/core/workers/chunks/56e97b98dcb8a3f2bcb7.js +0 -1
  348. package/assets/esri/core/workers/chunks/581285e4d7bbe1b7c27a.js +0 -1
  349. package/assets/esri/core/workers/chunks/58fb92775d668cfd295c.js +0 -1
  350. package/assets/esri/core/workers/chunks/5adf2792416b22cd602f.js +0 -1
  351. package/assets/esri/core/workers/chunks/5aee7739afb5160d4ace.js +0 -1
  352. package/assets/esri/core/workers/chunks/6006bd8a5ed945fa2776.js +0 -1
  353. package/assets/esri/core/workers/chunks/64ee22134fda2f09c094.js +0 -1
  354. package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +0 -1
  355. package/assets/esri/core/workers/chunks/67678054342178b601cf.js +0 -1
  356. package/assets/esri/core/workers/chunks/6c82cbcd504c711a7450.js +0 -1
  357. package/assets/esri/core/workers/chunks/6e75f09fb9452bd5f9fb.js +0 -1
  358. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +0 -1
  359. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +0 -1
  360. package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +0 -1
  361. package/assets/esri/core/workers/chunks/78085f804969c9282700.js +0 -1
  362. package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +0 -1
  363. package/assets/esri/core/workers/chunks/80f16f5f15518013f7d0.js +0 -1
  364. package/assets/esri/core/workers/chunks/82ce034b5ba54de9b970.js +0 -29
  365. package/assets/esri/core/workers/chunks/8465e2c7221125fd3cc4.js +0 -1
  366. package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +0 -1
  367. package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +0 -1
  368. package/assets/esri/core/workers/chunks/8daed13400d9e63e65ae.js +0 -1
  369. package/assets/esri/core/workers/chunks/8f1c5f5e70d4b33d021d.js +0 -1
  370. package/assets/esri/core/workers/chunks/9020bd7a0e488d55ef14.js +0 -1
  371. package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +0 -1
  372. package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +0 -1
  373. package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +0 -1
  374. package/assets/esri/core/workers/chunks/a3a33ffa34f4d645ddfe.js +0 -1
  375. package/assets/esri/core/workers/chunks/b396c4b4bb144200acc7.js +0 -1
  376. package/assets/esri/core/workers/chunks/b9c834e3c0701e9b14a2.js +0 -1
  377. package/assets/esri/core/workers/chunks/ba435cc73956d9c64a11.js +0 -1
  378. package/assets/esri/core/workers/chunks/bbfb80a6983574007ce5.js +0 -1
  379. package/assets/esri/core/workers/chunks/bcf2e5cf6b9c6d0442bb.js +0 -1
  380. package/assets/esri/core/workers/chunks/c35e9dee87937f483a3d.js +0 -1
  381. package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +0 -1
  382. package/assets/esri/core/workers/chunks/c77496c350004ee66eb2.js +0 -1
  383. package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +0 -1
  384. package/assets/esri/core/workers/chunks/ccaeabc3be07f3c96f50.js +0 -1
  385. package/assets/esri/core/workers/chunks/d25fb32a233d2128afbe.js +0 -1
  386. package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +0 -1
  387. package/assets/esri/core/workers/chunks/d5ef269ab0ee3744b05d.js +0 -1
  388. package/assets/esri/core/workers/chunks/dc92710a8fdfb9135e55.js +0 -1
  389. package/assets/esri/core/workers/chunks/dd4ecf81250cc001d040.js +0 -1
  390. package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +0 -1
  391. package/assets/esri/core/workers/chunks/e4016ae9cb8f16e3efc3.js +0 -1
  392. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +0 -1
  393. package/assets/esri/core/workers/chunks/e6637f9176566382ed3e.js +0 -1
  394. package/assets/esri/core/workers/chunks/e6a4cef0af9be30ffe3d.js +0 -1
  395. package/assets/esri/core/workers/chunks/eaa7cb3ffa8c11706a09.js +0 -1
  396. package/assets/esri/core/workers/chunks/ed31ec586b754241474d.js +0 -1
  397. package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +0 -1
  398. package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +0 -1
  399. package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +0 -1
  400. package/assets/esri/core/workers/chunks/f71ec8a260405ed07958.js +0 -1
  401. package/assets/esri/core/workers/chunks/f91cab9904020cf25d50.js +0 -1
  402. package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +0 -1
  403. package/assets/esri/core/workers/chunks/ff0e9f8d323eb1729650.js +0 -1
  404. /package/assets/esri/core/workers/chunks/{6e8187a77846239ed112.js.LICENSE.txt → de28a86775235bd5d3c4.js.LICENSE.txt} +0 -0
  405. /package/assets/esri/core/workers/chunks/{168b45c5d8233f23793e.js.LICENSE.txt → f6cfc901267a229de7a1.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{debounce as o}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import l from"../../geometry/Extent.js";import p from"../../geometry/HeightModelInfo.js";import c from"../../geometry/SpatialReference.js";import{titleFromUrlAndName as u,parse as d,cleanTitle as y,sanitizeUrlWithLayerId as m}from"../support/arcgisLayerUrl.js";import{id as h}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";import{reader as _}from"../../core/accessorSupport/decorators/reader.js";const R=m=>{const R=m;let E=class extends R{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=o(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return T(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:T(t)}:e;return l.fromJSON(i,r)}const i=t.store,o=T(t);return null==o||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<L)?null:new l({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:o})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){if("item-title"===this.sublayerTitleMode)return this.url?u(this.url,t.name):t.name;let r=t.name;if(!r&&this.url){const e=d(this.url);null!=e&&(r=e.title)}const i=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&i&&(r=i+" - "+r),y(r)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,i.getLogger(this),t),this.indexInfo.catch(()=>{});const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[r];A(e,i?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<L)return;const i=r[2],o=r[3];e.zmin=i-o,e.zmax=i+o}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(i=!0),i)return this._fetchVoxelServiceLayer();const o=r.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const i={...P,...t};let o=x.from(e);if(!o)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const a=I(o,"portal-item",{withResources:!0}),l={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,a,i),this.url&&(o.url=this.url),o.title||(o.title=this.title),O(o,i,1),await s.signIn(),await s.user.addItem({item:o,folder:i?.folder,data:l}),await j(this.resourceReferences,a),this.portalItem=o,n(a),a.portalItem=o,o}async _save(e){const t={...P,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const i=I(this.portalItem,"portal-item",{withResources:!0}),o=this.write({},i),s=await C(this.portalItem,o);await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(s,i,t);const a=q(this.portalItem,this.url);return a&&(this.portalItem.url=a),this.portalItem.title||(this.portalItem.title=this.title),O(this.portalItem,t,0),await b(this.portalItem,s,this.resourceReferences,i),n(i),this.portalItem}async _validateAgainstJSONSchema(e,t,o){const s=o?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,o.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(i.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(h)],E.prototype,"id",void 0),e([s({type:c})],E.prototype,"spatialReference",void 0),e([_("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readSpatialReference",null),e([s({type:l})],E.prototype,"fullExtent",void 0),e([_("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readFullExtent",null),e([s({readOnly:!0,type:p})],E.prototype,"heightModelInfo",void 0),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],E.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],E.prototype,"maxScale",void 0),e([s({readOnly:!0})],E.prototype,"version",void 0),e([_("version",["store.version"])],E.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],E.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],E.prototype,"sublayerTitleMode",void 0),e([s({type:String})],E.prototype,"title",void 0),e([_("portal-item","title")],E.prototype,"readTitlePortalItem",null),e([_("service","title",["name"])],E.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],E.prototype,"url",void 0),e([s({readOnly:!0})],E.prototype,"parsedUrl",null),e([s({readOnly:!0})],E.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],E.prototype,"rootNode",void 0),E=e([a("esri.layers.mixins.SceneService")],E),E},L=-1e38;function T(e){if(null!=e.spatialReference)return c.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new c(i):null}function A(e,t){if(null==t?.center||null==t.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<L)return;const i=t.halfSize,o=t.center[2],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);e.zmin=o-s,e.zmax=o+s}function O(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const o of i)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}},E={layerId:null};function K(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}async function C(e,t){const r=await e.fetchData("json")??{};return Array.isArray(r.layers)||(r.layers=await V(e,t)),K(r.layers,t),r}function q(e,t){return t&&M(e.url,t)?e.url:t}function M(e,t){const r=J(e);return!!r&&r===F(t).url}async function V(e,t){const r=await z(e).catch(()=>null);return r?.some(({id:e})=>e===t.id)?r:[t]}async function z(e){const r=J(e.url);if(!r)return null;const i=(await t(r,{query:{f:"json"},responseType:"json"})).data.layers;if(!Array.isArray(i))return null;const o=i.filter(({id:e})=>null!=e).map(({id:e})=>({id:e}));return o.length?o:null}function J(e){if(!e)return null;const t=F(e);if(null!=t.layerId)return null;const r=d(t.url);return null==r||"SceneServer"===r.serverType?t.url:null}function F(e){return m({layer:E,url:e,nonStandardUrlAllowed:!0})}export{R as SceneService,U as sceneServiceItemType,A as updateExtentFromPageObb};
2
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{debounce as o}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import l from"../../geometry/Extent.js";import p from"../../geometry/SpatialReference.js";import{HeightModelInfoMixin as c}from"./HeightModelInfoMixin.js";import{titleFromUrlAndName as u,parse as d,cleanTitle as m,sanitizeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{id as h}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";import{reader as _}from"../../core/accessorSupport/decorators/reader.js";const R=y=>{const R=c(y);let E=class extends R{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=o(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return T(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:T(t)}:e;return l.fromJSON(i,r)}const i=t.store,o=T(t);return null==o||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<L)?null:new l({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:o})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){if("item-title"===this.sublayerTitleMode)return this.url?u(this.url,t.name):t.name;let r=t.name;if(!r&&this.url){const e=d(this.url);null!=e&&(r=e.title)}const i=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&i&&(r=i+" - "+r),m(r)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,i.getLogger(this),t),this.indexInfo.catch(()=>{});const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[r];A(e,i?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<L)return;const i=r[2],o=r[3];e.zmin=i-o,e.zmax=i+o}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(i=!0),i)return this._fetchVoxelServiceLayer();const o=r.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const i={...P,...t};let o=x.from(e);if(!o)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const a=I(o,"portal-item",{withResources:!0}),l={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,a,i),this.url&&(o.url=this.url),o.title||(o.title=this.title),O(o,i,1),await s.signIn(),await s.user.addItem({item:o,folder:i?.folder,data:l}),await j(this.resourceReferences,a),this.portalItem=o,n(a),a.portalItem=o,o}async _save(e){const t={...P,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const i=I(this.portalItem,"portal-item",{withResources:!0}),o=this.write({},i),s=await C(this.portalItem,o);await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(s,i,t);const a=q(this.portalItem,this.url);return a&&(this.portalItem.url=a),this.portalItem.title||(this.portalItem.title=this.title),O(this.portalItem,t,0),await b(this.portalItem,s,this.resourceReferences,i),n(i),this.portalItem}async _validateAgainstJSONSchema(e,t,o){const s=o?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,o.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(i.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(h)],E.prototype,"id",void 0),e([s({type:p})],E.prototype,"spatialReference",void 0),e([_("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readSpatialReference",null),e([s({type:l})],E.prototype,"fullExtent",void 0),e([_("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readFullExtent",null),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],E.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],E.prototype,"maxScale",void 0),e([s({readOnly:!0})],E.prototype,"version",void 0),e([_("version",["store.version"])],E.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],E.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],E.prototype,"sublayerTitleMode",void 0),e([s({type:String})],E.prototype,"title",void 0),e([_("portal-item","title")],E.prototype,"readTitlePortalItem",null),e([_("service","title",["name"])],E.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],E.prototype,"url",void 0),e([s({readOnly:!0})],E.prototype,"parsedUrl",null),e([s({readOnly:!0})],E.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],E.prototype,"rootNode",void 0),E=e([a("esri.layers.mixins.SceneService")],E),E},L=-1e38;function T(e){if(null!=e.spatialReference)return p.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new p(i):null}function A(e,t){if(null==t?.center||null==t.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<L)return;const i=t.halfSize,o=t.center[2],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);e.zmin=o-s,e.zmax=o+s}function O(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const o of i)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}},E={layerId:null};function K(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}async function C(e,t){const r=await e.fetchData("json")??{};return Array.isArray(r.layers)||(r.layers=await V(e,t)),K(r.layers,t),r}function q(e,t){return t&&M(e.url,t)?e.url:t}function M(e,t){const r=J(e);return!!r&&r===F(t).url}async function V(e,t){const r=await z(e).catch(()=>null);return r?.some(({id:e})=>e===t.id)?r:[t]}async function z(e){const r=J(e.url);if(!r)return null;const i=(await t(r,{query:{f:"json"},responseType:"json"})).data.layers;if(!Array.isArray(i))return null;const o=i.filter(({id:e})=>null!=e).map(({id:e})=>({id:e}));return o.length?o:null}function J(e){if(!e)return null;const t=F(e);if(null!=t.layerId)return null;const r=d(t.url);return null==r||"SceneServer"===r.serverType?t.url:null}function F(e){return y({layer:E,url:e,nonStandardUrlAllowed:!0})}export{R as SceneService,U as sceneServiceItemType,A as updateExtentFromPageObb};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i,cast as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Point.js";import{getGeometryZScaler as p}from"../../../geometry/support/zscale.js";import c from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as u,getEffectiveElevationSource as y,getArcGISServerUrl as d,getMetersPerUnitOfSR as f,orientedImageryTypeMap as g}from"./utils.js";import{ltpToGeographic as h}from"../transformations/utils.js";import{reader as v}from"../../../core/accessorSupport/decorators/reader.js";import{writer as w}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as O}from"../../../core/accessorSupport/decorators/enumeration.js";function b(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function j(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const S=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),N=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}}),I="$virtualCacheDirectory:",x="/rest/directories/dsid_",z=new Set(["location"]);let C=class extends(t(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const p in o)z.has(p.toLowerCase())||(r[p.toLowerCase()]=o[p],i[p.toLowerCase()]=p);const n=e.layer??{},s=n.effectiveSequenceOrderField;let l=null;if(s?.length){s.map(e=>e.fieldName).forEach(e=>{i[e.toLowerCase()]=e}),l=s.map(e=>({value:o[e.fieldName],...e}))}super.read({geometry:a,layer:n,sourceMap:i,sequenceOrder:l,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return u(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return y(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||j("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;if(r.startsWith(I)){return`${d(o.url)}${x}${r.replace(I,o.dataStoreID+"/")}`}return u(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return this.orientedImageryType?.includes("360")??!1}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(4===t){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new l(h([n,s,p],[t,r,o,a]))}const c=new l({x:r,y:o,z:a,spatialReference:s}),m=n?p("point",{wkid:n},s):null;return m&&m(c),c}if("number"!=typeof t)throw b("cameraHeight");const o=this.geometry.clone(),i=(r??0)+t/f(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=i-o.z;return null!=r&&Math.abs(e)>.001&&(a.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=i),o}return o.z=o.hasZ?o.z:i,o}set matrix(e){if(e)return 9!==e.length?(a.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=g.read(r??o??n.orientedImageryType),l=a??i??n.cameraPitch;return"oblique"===s?l<10?"nadir":"oblique":s}set radial(e){if(e){if("string"==typeof e){const[t,r,o]=e.split(";").map(Number);return void this._set("radial",[t??0,r??0,o??0])}this._set("radial",e)}else this._set("radial",[0,0,0])}set tangential(e){if(e){if("string"==typeof e){const[t,r]=e.split(";").map(Number);return void this._set("tangential",[t??0,r??0])}this._set("tangential",e)}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],C.prototype,"_geometry",void 0),e([i(S())],C.prototype,"a0",void 0),e([i(S())],C.prototype,"a1",void 0),e([i(S())],C.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],C.prototype,"acquisitionDate",void 0),e([i(S())],C.prototype,"b0",void 0),e([i(S())],C.prototype,"b1",void 0),e([i(S())],C.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],C.prototype,"cameraHeading",void 0),e([v("cameraHeading")],C.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraHeight",void 0),e([v("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],C.prototype,"readCameraHeight",null),e([i()],C.prototype,"cameraOffset",void 0),e([v("cameraOffset",["cameraoffset","camoffset"])],C.prototype,"readCamOffset",null),e([w("cameraOffset")],C.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:c}),n(e=>e?m.getCameraOrientation(e):null)],C.prototype,"cameraOrientation",void 0),e([v("cameraOrientation",["cameraorientation","camori"])],C.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraPitch",void 0),e([v("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],C.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraRoll",void 0),e([v("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],C.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],C.prototype,"depthImage",void 0),e([v("depthImage",["depthimage","depthimg"])],C.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],C.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],C.prototype,"elevationSource",void 0),e([v("elevationSource",["elevationsource","layer.effectiveElevationSource"])],C.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],C.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"farDistance",void 0),e([v("farDistance",["fardistance","fardist","layer.farDistance"])],C.prototype,"readFarDistance",null),e([i(S("focallength"))],C.prototype,"focalLength",void 0),e([i({type:l,json:{name:"geometry"}})],C.prototype,"geometry",null),e([w("geometry")],C.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],C.prototype,"horizontalFieldOfView",void 0),e([v("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],C.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],C.prototype,"imagePath",void 0),e([v("imagePath",["imagepath"])],C.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],C.prototype,"imageRotation",void 0),e([v("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],C.prototype,"readImageRotation",null),e([i()],C.prototype,"isHorizontal",null),e([i()],C.prototype,"isInspection",null),e([i()],C.prototype,"isNadir",null),e([i()],C.prototype,"isOblique",null),e([i()],C.prototype,"isSpherical",null),e([i()],C.prototype,"location",null),e([i(N())],C.prototype,"matrix",null),e([i({json:{write:!0},type:String})],C.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"nearDistance",void 0),e([v("nearDistance",["neardistance","neardist","layer.nearDistance"])],C.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],C.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"offsetFromStart",void 0),e([v("offsetFromStart",["offsetfromstart"])],C.prototype,"readOffsetFromStart",null),e([i()],C.prototype,"orientationAccuracy",void 0),e([v("orientationAccuracy",["accuracy","orientationaccuracy"])],C.prototype,"readOrientationAccuracy",null),e([w("orientationAccuracy")],C.prototype,"writeOrientationAccuracy",null),e([O(g)],C.prototype,"orientedImageryType",void 0),e([v("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],C.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],C.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],C.prototype,"principalY",void 0),e([i(N([0,0,0]))],C.prototype,"radial",null),e([i({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],C.prototype,"sequenceOrder",void 0),e([i({type:Object})],C.prototype,"sourceMap",void 0),e([i(N([0,0]))],C.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],C.prototype,"verticalFieldOfView",void 0),e([v("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],C.prototype,"readVFOV",null),C=e([s("esri.layers.orientedImagery.core.ExposurePoint")],C);const F=C;export{F as default};
2
+ import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import o from"../../../core/Error.js";import{JSONSupport as a}from"../../../core/JSONSupport.js";import i from"../../../core/Logger.js";import{isAbsolute as n,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as l,cast as p,subclass as c}from"../../../core/accessorSupport/decorators.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getArcGISServerUrl as h,getMetersPerUnitOfSR as v,orientedImageryTypeMap as w}from"./utils.js";import{ltpToGeographic as O}from"../transformations/utils.js";import{reader as b}from"../../../core/accessorSupport/decorators/reader.js";import{writer as j}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as S}from"../../../core/accessorSupport/decorators/enumeration.js";function N(e){throw new o("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function I(e,t){throw new o("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function x(e){return e.trim().replaceAll("\\","/").replace(/^\/+/,"")}function C(e,t){return n(e)?e:f(e,t.imagePathPrefix,t.imagePathSuffix)}function z(e,t){if(n(e))return e;const r=t.url?h(t.url):null;return r?`${r}/${x(e)}`:null}function F(e){const r=t?.findCredential(e.url)?.token;return r??null}function P(e,t){const r=F(t);return r?s(e,"token",r):e}const D=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),H=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}}),_="$virtualCacheDirectory:",R="/rest/directories/dsid_",T=new Set(["location"]);let V=class extends(r(a)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const p in o)T.has(p.toLowerCase())||(r[p.toLowerCase()]=o[p],i[p.toLowerCase()]=p);const n=e.layer??{},s=n.effectiveSequenceOrderField;let l=null;if(s?.length){s.map(e=>e.fieldName).forEach(e=>{i[e.toLowerCase()]=e}),l=s.map(e=>({value:o[e.fieldName],...e}))}super.read({geometry:a,layer:n,sourceMap:i,sequenceOrder:l,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{connectionid:r,imagepath:o,layer:a}=t;if(o||I("imagePath",this),o.startsWith(_)){return`${h(a.url)}${R}${o.replace(_,a.dataStoreID+"/")}`}if(null==r)return C(o,a);const i=a.imageAccessPaths?.[r];if(!i)return C(o,a);const n=z(i,a);if(!n)return C(o,a);return P(`${n}/${x(o)}`,a)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return this.orientedImageryType?.includes("360")??!1}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(4===t){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:l}=i;return new m(O([n,s,l],[t,r,o,a]))}const l=new m({x:r,y:o,z:a,spatialReference:s}),p=n?u("point",{wkid:n},s):null;return p&&p(l),l}if("number"!=typeof t)throw N("cameraHeight");const o=this.geometry.clone(),a=(r??0)+t/v(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=a-o.z;return null!=r&&Math.abs(e)>.001&&(i.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=a),o}return o.z=o.hasZ?o.z:a,o}set matrix(e){if(e)return 9!==e.length?(i.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=w.read(r??o??n.orientedImageryType),l=a??i??n.cameraPitch;return"oblique"===s?l<10?"nadir":"oblique":s}set radial(e){if(e){if("string"==typeof e){const[t,r,o]=e.split(";").map(Number);return void this._set("radial",[t??0,r??0,o??0])}this._set("radial",e)}else this._set("radial",[0,0,0])}set tangential(e){if(e){if("string"==typeof e){const[t,r]=e.split(";").map(Number);return void this._set("tangential",[t??0,r??0])}this._set("tangential",e)}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){i.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([l()],V.prototype,"_geometry",void 0),e([l(D())],V.prototype,"a0",void 0),e([l(D())],V.prototype,"a1",void 0),e([l(D())],V.prototype,"a2",void 0),e([l({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],V.prototype,"acquisitionDate",void 0),e([l(D())],V.prototype,"b0",void 0),e([l(D())],V.prototype,"b1",void 0),e([l(D())],V.prototype,"b2",void 0),e([l({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],V.prototype,"cameraHeading",void 0),e([b("cameraHeading")],V.prototype,"readCameraHeading",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraHeight",void 0),e([b("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],V.prototype,"readCameraHeight",null),e([l()],V.prototype,"cameraOffset",void 0),e([b("cameraOffset",["cameraoffset","camoffset"])],V.prototype,"readCamOffset",null),e([j("cameraOffset")],V.prototype,"writeCameraOffset",null),e([l({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),p(e=>e?d.getCameraOrientation(e):null)],V.prototype,"cameraOrientation",void 0),e([b("cameraOrientation",["cameraorientation","camori"])],V.prototype,"readCameraOrientation",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraPitch",void 0),e([b("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],V.prototype,"readCameraPitch",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraRoll",void 0),e([b("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],V.prototype,"readCameraRoll",null),e([l({json:{write:!0},type:String})],V.prototype,"depthImage",void 0),e([b("depthImage",["depthimage","depthimg"])],V.prototype,"readDepthImage",null),e([l({type:Number,json:{write:!0}})],V.prototype,"elevation",void 0),e([l({json:{write:!0},clonable:"reference"})],V.prototype,"elevationSource",void 0),e([b("elevationSource",["elevationsource","layer.effectiveElevationSource"])],V.prototype,"readElevationSource",null),e([l({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],V.prototype,"exposureStationId",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"farDistance",void 0),e([b("farDistance",["fardistance","fardist","layer.farDistance"])],V.prototype,"readFarDistance",null),e([l(D("focallength"))],V.prototype,"focalLength",void 0),e([l({type:m,json:{name:"geometry"}})],V.prototype,"geometry",null),e([j("geometry")],V.prototype,"writeGeometry",null),e([l({type:Number,json:{write:!0}})],V.prototype,"horizontalFieldOfView",void 0),e([b("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],V.prototype,"readHFOV",null),e([l({json:{write:!0},type:String})],V.prototype,"imagePath",void 0),e([b("imagePath",["imagepath"])],V.prototype,"readImageURL",null),e([l({type:Number,json:{write:!0}})],V.prototype,"imageRotation",void 0),e([b("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],V.prototype,"readImageRotation",null),e([l()],V.prototype,"isHorizontal",null),e([l()],V.prototype,"isInspection",null),e([l()],V.prototype,"isNadir",null),e([l()],V.prototype,"isOblique",null),e([l()],V.prototype,"isSpherical",null),e([l()],V.prototype,"location",null),e([l(H())],V.prototype,"matrix",null),e([l({json:{write:!0},type:String})],V.prototype,"name",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"nearDistance",void 0),e([b("nearDistance",["neardistance","neardist","layer.nearDistance"])],V.prototype,"readNearDistance",null),e([l({json:{write:!0,name:"objectid"},type:Number})],V.prototype,"objectId",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"offsetFromStart",void 0),e([b("offsetFromStart",["offsetfromstart"])],V.prototype,"readOffsetFromStart",null),e([l()],V.prototype,"orientationAccuracy",void 0),e([b("orientationAccuracy",["accuracy","orientationaccuracy"])],V.prototype,"readOrientationAccuracy",null),e([j("orientationAccuracy")],V.prototype,"writeOrientationAccuracy",null),e([S(w)],V.prototype,"orientedImageryType",void 0),e([b("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],V.prototype,"readOIType",null),e([l({type:Number,json:{write:!0,read:{source:"principalx"}}})],V.prototype,"principalX",void 0),e([l({type:Number,json:{write:!0,read:{source:"principaly"}}})],V.prototype,"principalY",void 0),e([l(H([0,0,0]))],V.prototype,"radial",null),e([l({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],V.prototype,"sequenceOrder",void 0),e([l({type:Object})],V.prototype,"sourceMap",void 0),e([l(H([0,0]))],V.prototype,"tangential",null),e([l({type:Number,json:{write:!0}})],V.prototype,"verticalFieldOfView",void 0),e([b("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],V.prototype,"readVFOV",null),V=e([c("esri.layers.orientedImagery.core.ExposurePoint")],V);const q=V;export{q as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{bytesToUTF8 as e}from"./byteStreamUtils.js";function t(e){const t=e.fields,r=e.records,n=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",i=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=i.map(e=>e.name),s=[];let o=0,l=0;return r.forEach(e=>{const t={};for(t[n]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];s.push({attributes:t})}),{displayFieldName:"",fields:i,features:s}}class r{static get supportedVersions(){return[5]}static parse(r){const n=new DataView(r),i=3&n.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const a=n.getUint32(4,!0),s=n.getUint16(8,!0),o=n.getUint16(10,!0),l={version:i,recordCount:a,headerByteCount:s,recordByteCount:o};let p=32;const d=[],g=[];let h;if(3===i){for(;13!==n.getUint8(p);)h=String.fromCharCode(n.getUint8(p+11)).trim(),d.push({name:e(new Uint8Array(r,p,11)),type:h,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(h)],length:n.getUint8(p+16)}),p+=32;if(p+=1,d.length>0)for(;g.length<a&&r.byteLength-p>o;){const t=[];32===n.getUint8(p)?(p+=1,d.forEach(n=>{if("C"===n.type)t.push(e(new Uint8Array(r,p,n.length)).trim());else if("N"===n.type)t.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim(),10));else if("F"===n.type)t.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim()));else if("D"===n.type){const e=String.fromCharCode.apply(null,new Uint8Array(r,p,n.length)).trim();t.push(new Date(parseInt(e.slice(0,4),10),parseInt(e.slice(4,6),10)-1,parseInt(e.slice(6,8),10)))}p+=n.length}),g.push(t)):p+=o}}return{header:l,fields:d,records:g,recordSet:t({fields:d,records:g})}}}export{r as default};
2
+ import{bytesToUTF8 as e}from"./byteStreamUtils.js";function t(e){const t=e.fields,n=e.records,r=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",i=[{name:r,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=i.map(e=>e.name),o=[];let s=0,l=0;return n.forEach(e=>{const t={};for(t[r]=s++,l=1;l<a.length;l++)t[a[l]]=e[l-1];o.push({attributes:t})}),{displayFieldName:"",fields:i,features:o}}function n(n){const r=new DataView(n),i=3&r.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const a=r.getUint32(4,!0),o=r.getUint16(8,!0),s=r.getUint16(10,!0),l={version:i,recordCount:a,headerByteCount:o,recordByteCount:s};let p=32;const h=[],g=[];for(;13!==r.getUint8(p);){const t=String.fromCharCode(r.getUint8(p+11)).trim();h.push({name:e(new Uint8Array(n,p,11)),type:t,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(t)],length:r.getUint8(p+16)}),p+=32}if(p+=1,h.length>0)for(;g.length<a&&n.byteLength-p>s;){const t=[];32===r.getUint8(p)?(p+=1,h.forEach(r=>{if("C"===r.type)t.push(e(new Uint8Array(n,p,r.length)).trim());else if("N"===r.type)t.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim(),10));else if("F"===r.type)t.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim()));else if("D"===r.type){const e=String.fromCharCode.apply(null,new Uint8Array(n,p,r.length)).trim();t.push(new Date(parseInt(e.slice(0,4),10),parseInt(e.slice(4,6),10)-1,parseInt(e.slice(6,8),10)))}p+=r.length}),g.push(t)):p+=s}return{header:l,fields:h,records:g,recordSet:t({fields:h,records:g})}}export{n as parse};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as r}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import l from"./BaseRaster.js";import c from"./InMemoryRaster.js";import{parsePAMInfo as m}from"./pamParser.js";import{getFormat as f}from"../formats/RasterCodec.js";import{estimateStatisticsFromHistograms as p}from"../functions/stretchUtils.js";import h from"../transforms/PolynomialTransform.js";let u=class extends l{set rasterJobHandler(t){this._set("rasterJobHandler",t),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=t)}fetchRawTile(t,e,s,r={}){if(this._imageBlob){const{blockWidth:r,blockHeight:a}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[r,a],tileIndex:[t,e,s],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster.fetchRawTile(t,e,s,r)}async _open(t){const s=await this._fetchData(t);if(null==s)throw new e("image-aux-raster:open","the data cannot be decoded");let{spatialReference:r,statistics:a,histograms:o,transform:l}=await this._fetchAuxiliaryData(t);const m=!r;m&&(r=new n({wkid:3857})),o?.length&&null==a&&(a=p(o));const{width:f,height:h}=s;let u=new i({xmin:-.5,ymin:.5-h,xmax:f-.5,ymax:.5,spatialReference:r});const d=l?l.forwardTransform(u):u;let g=!0;if(l){const t=l.forwardCoefficients;g=t&&0===t[1]&&0===t[2],g&&(l=null,u=d)}const{rasterJobHandler:y,ioConfig:w}=this,x=new c({preGenerateTiles:!1,rasterJobHandler:y,source:{extent:d,nativeExtent:u,transform:l,pixelBlocks:[s],statistics:a,histograms:o,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:m},ioConfig:{...w,sampling:"closest",skipStatistics:!0}});await x.open(),x.source=null,this._set("rasterInfo",x.rasterInfo),this._inMemoryRaster=x}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=f(s);if("jpg"!==r&&"png"!==r&&"gif"!==r&&"bmp"!==r)throw new e("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r.toUpperCase());const a=r.toLowerCase();try{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=s,t}catch{return this.decodePixelBlock(s,{format:a,canvasUsage:"no-canvas",skipStatistics:!0})}}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:a=[],skipMapInfo:o}=this.ioConfig,i=o||a.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,l="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,c=l&&a.includes(l)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:e}),f=await s([i,c]);if(e?.aborted)throw r();const p=m(f[0].value?.data);if(!p.transform){const t=f[1].value?f[1].value.data.split("\n").slice(0,6).map(t=>Number(t)):null;p.transform=6===t?.length?new h({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return p}};t([a({type:String,json:{write:!0}})],u.prototype,"datasetFormat",void 0),t([a()],u.prototype,"rasterJobHandler",null),u=t([o("esri.layers.raster.datasets.ImageAuxRaster")],u);const d=u;export{d as default};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{eachAlways as s,createAbortError as a}from"../../../core/promiseUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import l from"./BaseRaster.js";import c from"./InMemoryRaster.js";import{parsePAMInfo as p}from"./pamParser.js";import{parseHeader as m}from"../formats/JpgPlus.js";import{getFormat as f}from"../formats/RasterCodec.js";import{estimateStatisticsFromHistograms as h}from"../functions/stretchUtils.js";import u from"../transforms/PolynomialTransform.js";import d from"../../support/RasterInfo.js";let g=class extends l{set rasterJobHandler(t){this._set("rasterJobHandler",t),this._inMemoryRaster&&(this._inMemoryRaster.rasterJobHandler=t)}fetchRawTile(t,e,s,a={}){if(this._imageBlob){const{blockWidth:a,blockHeight:r}=this.rasterInfo.storageInfo;return this.decodePixelBlock(this._imageBlob,{tileSize:[a,r],tileIndex:[t,e,s],canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0})}return this._inMemoryRaster?this._inMemoryRaster.fetchRawTile(t,e,s,a):Promise.resolve(null)}async _open(t){const s=await this._fetchData(t);if(null==s)throw new e("image-aux-raster:open","the data cannot be decoded");let{spatialReference:a,statistics:r,histograms:i,transform:l}=await this._fetchAuxiliaryData(t);const p=!a;p&&(a=new n({wkid:3857})),i?.length&&null==r&&(r=h(i));const{width:m,height:f,pixelBlock:u}=s;let g=new o({xmin:-.5,ymin:.5-f,xmax:m-.5,ymax:.5,spatialReference:a});const w=l?l.forwardTransform(g):g;let x=!0;if(l){const t=l.forwardCoefficients;x=t&&0===t[1]&&0===t[2],x&&(l=null,g=w)}if(!u){const t=new d({width:m,height:f,bandCount:3,pixelType:"u8",extent:w,nativeExtent:g,transform:l,pixelSize:{x:w.width/m,y:w.height/f},spatialReference:w.spatialReference,keyProperties:{DataType:"Processed"}});return this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(t),this.createRemoteDatasetStorageInfo(t,512,512),this._set("rasterInfo",t),void this.updateTileInfo()}const{rasterJobHandler:y,ioConfig:b}=this,R=new c({preGenerateTiles:!1,rasterJobHandler:y,source:{extent:w,nativeExtent:g,transform:l,pixelBlocks:[u],statistics:r,histograms:i,keyProperties:{DataType:"Processed"},isPseudoSpatialReference:p},ioConfig:{...b,sampling:"closest",skipStatistics:!0}});await R.open(),R.source=null,this._set("rasterInfo",R.rasterInfo),this._inMemoryRaster=R}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),a=f(s);if("jpg"!==a&&"png"!==a&&"gif"!==a&&"bmp"!==a)throw new e("image-aux-raster:open","the data is not a supported format");if(this._set("datasetFormat",a.toUpperCase()),"jpg"===a){const t=m(s);if(null==t)throw new e("image-aux-raster:open","the data is not a supported format");return this._imageBlob=s,t}try{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"canvas-only",cloneSource:!0,skipStatistics:!0});return this._imageBlob=s,t?{width:t.width,height:t.height,pixelBlock:t}:null}catch{const t=await this.decodePixelBlock(s,{format:a,canvasUsage:"no-canvas",skipStatistics:!0});return t?{width:t.width,height:t.height,pixelBlock:t}:null}}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,o=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,l="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,c=l&&r.includes(l)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:e}),m=await s([o,c]);if(e?.aborted)throw a();const f=p(m[0].value?.data);if(!f.transform){const t=m[1].value?m[1].value.data.split("\n").slice(0,6).map(t=>Number(t)):null;f.transform=6===t?.length?new u({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return f}};t([r({type:String,json:{write:!0}})],g.prototype,"datasetFormat",void 0),t([r()],g.prototype,"rasterJobHandler",null),g=t([i("esri.layers.raster.datasets.ImageAuxRaster")],g);const w=g;export{w as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import r from"../../../core/Error.js";import e from"./CovJSONRaster.js";import t from"./ImageAuxRaster.js";import s from"./ImageServerRaster.js";import o from"./InMemoryRaster.js";import a from"./MRFRaster.js";import n from"./TIFFRaster.js";const c=new Map;c.set("MRF",{desc:"Meta Raster Format",constructor:a}),c.set("TIFF",{desc:"GeoTIFF",constructor:n}),c.set("RasterTileServer",{desc:"Raster Tile Server",constructor:s}),c.set("JPG",{desc:"JPG Raster Format",constructor:t}),c.set("PNG",{desc:"PNG Raster Format",constructor:t}),c.set("GIF",{desc:"GIF Raster Format",constructor:t}),c.set("BMP",{desc:"BMP Raster Format",constructor:t}),c.set("CovJSON",{desc:"COVJSON Raster Format",constructor:e}),c.set("MEMORY",{desc:"In Memory Raster Format",constructor:o});class l{static get supportedFormats(){const r=new Set;return c.forEach((e,t)=>r.add(t)),r}static async open(e){const{url:t,ioConfig:s,source:o,sourceJSON:a}=e;let n=e.datasetFormat??s?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===o?.type?.toLowerCase()?n="CovJSON":o?.extent&&o.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:t,source:o,sourceJSON:a,datasetFormat:n,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(r=>{null==l[r]&&delete l[r]}),n){if(!this.supportedFormats.has(n))throw new r("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new r("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,c.get(n).constructor)(l);return s.rasterJobHandler=e.rasterJobHandler,s.rasterInfo=e.rasterInfo,await s.open({signal:e.signal}),s}const u=Array.from(c.keys()).filter(r=>"CovJSON"!==r&&"Memory"!==r);let i=0;const m=()=>{if(n=u[i++],!n)return null;if("CRF"===n)return null;const r=new(0,c.get(n).constructor)(l);return r.rasterJobHandler=e.rasterJobHandler,r.open({signal:e.signal}).then(()=>r).catch(()=>m())};return m()}static register(r,e,t){c.has(r.toUpperCase())||c.set(r.toUpperCase(),{desc:e,constructor:t})}}export{l as default};
2
+ import r from"../../../core/Error.js";import e from"./CovJSONRaster.js";import t from"./ImageAuxRaster.js";import s from"./ImageServerRaster.js";import o from"./InMemoryRaster.js";import a from"./MRFRaster.js";import n from"./TIFFRaster.js";const c=new Map;c.set("MRF",{desc:"Meta Raster Format",constructor:a}),c.set("TIFF",{desc:"GeoTIFF",constructor:n}),c.set("RasterTileServer",{desc:"Raster Tile Server",constructor:s}),c.set("JPG",{desc:"JPG Raster Format",constructor:t}),c.set("PNG",{desc:"PNG Raster Format",constructor:t}),c.set("GIF",{desc:"GIF Raster Format",constructor:t}),c.set("BMP",{desc:"BMP Raster Format",constructor:t}),c.set("CovJSON",{desc:"COVJSON Raster Format",constructor:e}),c.set("MEMORY",{desc:"In Memory Raster Format",constructor:o});class l{static get supportedFormats(){const r=new Set;return c.forEach((e,t)=>r.add(t)),r}static async open(e){const{url:t,ioConfig:s,source:o,sourceJSON:a}=e;let n=e.datasetFormat??s?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===o?.type?.toLowerCase()?n="CovJSON":o?.extent&&o.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n||"DM"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:t,source:o,sourceJSON:a,datasetFormat:n,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(r=>{null==l[r]&&delete l[r]}),n){if(!this.supportedFormats.has(n))throw new r("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new r("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,c.get(n).constructor)(l);return s.rasterJobHandler=e.rasterJobHandler,s.rasterInfo=e.rasterInfo,await s.open({signal:e.signal}),s}const u=Array.from(c.keys()).filter(r=>"CovJSON"!==r&&"Memory"!==r);let i=0;const m=()=>{if(n=u[i++],!n)return null;if("CRF"===n)return null;const r=new(0,c.get(n).constructor)(l);return r.rasterJobHandler=e.rasterJobHandler,r.open({signal:e.signal}).then(()=>r).catch(()=>m())};return m()}static register(r,e,t){c.has(r.toUpperCase())||c.set(r.toUpperCase(),{desc:e,constructor:t})}}export{l as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import f from"./BaseRaster.js";import l from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as c}from"./pamParser.js";import{parseSignature as h,getPyramidIFDs as p,getMaskIFDs as d,parseIFD as m,parseFieldValues as y,isBSQConfig as g,getTagNumericValues as x,getTagFirstNumericValue as w,getImageInfo as I}from"../formats/tiffParser.js";import{tiffTags as T,geoKeys as _}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as R}from"../functions/stretchUtils.js";import F from"../transforms/PolynomialTransform.js";import S from"../../support/RasterInfo.js";import b from"../../support/RasterStorageInfo.js";import O from"../../../rest/support/FeatureSet.js";let k=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,r);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(e){const r=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:r});if(!s)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=h(s),f=[],l={fileChunk:s,posIFD:n,fileOffset:0};await this._readIFDs(f,l,a,o?8:4,r);const{imageInfo:u,rasterInfo:c}=E(f),m=p(f),y=d(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:m,maskIFDs:y,...u},this._set("rasterInfo",c),!u.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new t("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");c.isPseudoSpatialReference&&i.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const g=f[0].get("PREDICTOR")?.values?.[0],x=f[0].get("SAMPLEFORMAT")?.values?.[0];if(3===x&&2===g)throw new t("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:w,skipExtensions:I=[]}=this.ioConfig;if(!I.includes("aux.xml")&&!w){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&D(t,c)}I.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||w||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),w&&this.updateImageSpaceRasterInfo(c),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){r=s+r;i=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:t})).data,s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,i,r,s=4,a){if(!i.posIFD)return null;i=await this._validateOrFetchHeaderBuffer(i,a);const n=await this._readIFD(i,r,T,s,a);if(!n?.ifd)throw new t("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;i.posIFD=n.nextIFD-i.fileOffset,await this._readIFDs(e,i,r,s,a)}async _readIFD(e,t,i=T,r=4,s){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const f=m(a,t,n,o,i,r);if(f.success){const e=[];if(f.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,f.nextIFD,s),f.ifd?.has("GEOKEYDIRECTORY")){const e=f.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const r=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const f=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},s),l=await this._readIFD(f,t,_,2,s);e.data=l?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return f}if(f.requiredBufferSize){return a=(await this.request(this.url,{range:{from:o,to:o+n+f.requiredBufferSize+8},responseType:"array-buffer",signal:s})).data,a.byteLength<n+f.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,r,s))}return null}async _fillOffsets(e,t,i,r){const s=e.filter(e=>null!=e.offlineOffsetSize);if(0===s.length)return;const a=s.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let f=1===a.length||o-n<=this._bufferSize;if(!f&&a.length>1){a.sort((e,t)=>e[0]-t[0]);f=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o}if(f){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),r);return void s.forEach(i=>y(e,t,i,n))}const l=s.map(async e=>{const i=e.offlineOffsetSize,s=await this._fetchOffsets(i[0],i[1]+i[0],r);y(s,t,e,i[0])});await Promise.all(l)}async _fetchOffsets(e,t,i){const r=[],s=this._chunkSize,a=Math.ceil((t-e)/s);let n=e;for(let l=0;l<a;l++)r.push(this.request(this.url,{range:{from:n,to:l===a-1?t:n+s-1},responseType:"array-buffer",signal:i})),n+=s;const o=await Promise.all(r);if(1===a)return o[0].data;const f=new Uint8Array(t-e+1);for(let l=0;l<a;l++)f.set(new Uint8Array(o[l].data),l*s);return f.buffer}async _fetchRawTiffTile(e,t,i,r,s={}){const a=this._getTileLocation(e,t,i,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:f,ifd:l}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal})),c=await Promise.all(u),h=c.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===c.length?c[0].data:new ArrayBuffer(h),d=[0],m=[0];if(c.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<c.length;t++){const r=c[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;if(o!==y||f!==g){let e=x.mask;if(e)for(let t=0;t<g;t++){const i=t*y;if(t<f)for(let t=o;t<y;t++)e[i+t]=0;else for(let t=0;t<y;t++)e[i+t]=0}else{e=new Uint8Array(y*g),x.mask=e;for(let t=0;t<f;t++){const i=t*y;for(let t=0;t<o;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,r=!1){const{firstPyramidLevel:s,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const f=r?o.maskIFDs[n]:0===n?o.ifds[0]:o.pyramidIFDs[n-1];if(!f)return null;const l=g(f,o),u=x(f,"TILEOFFSETS"),c=x(f,"TILEBYTECOUNTS");if(!u?.length||!c?.length)return null;const{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const y=w(f,"IMAGEWIDTH"),I=w(f,"IMAGELENGTH"),T=w(f,"TILEWIDTH"),_=w(f,"TILELENGTH"),R=[];if(l){const{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){const e=r*(d+1)*(m+1)+t*(m+1)+i;R[r]={from:u[e],to:u[e]+c[e]-1}}}else{const e=t*(m+1)+i;R.push({from:u[e],to:u[e]+c[e]-1})}for(let g=0;g<R.length;g++)if(null==R[g].from||!R[g].to||R[g].to<0)return null;return{ranges:R,ifd:f,actualTileWidth:i===m&&y%T||T,actualTileHeight:t===d&&I%_||_}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=l.parse(t);return i?.recordSet?O.fromJSON(i.recordSet):null}catch{return null}}};function E(e){const t=I(e),{width:i,height:r,tileWidth:s,tileHeight:f,planes:l,pixelType:u,compression:h,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidBlockWidth:m,pyramidBlockHeight:y,pyramidResolutions:g,tileBoundary:x,affine:w,metadata:T,colormap:_}=t,R=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let O=c(R),k=!!t.isPseudoGeographic;null==O&&(k=!0,O=new o({wkid:3857}));const E=new a({...t.extent,spatialReference:O}),D=new n(E?{x:E.xmin,y:E.ymax,spatialReference:O}:{x:0,y:0}),v=new b({blockWidth:s,blockHeight:f,pyramidBlockWidth:m,pyramidBlockHeight:y,compression:h,origin:D,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidResolutions:g,blockBoundary:x}),P=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),B=T?{BandProperties:T.bandProperties,DataType:T.dataType}:{},z=new S({width:i,height:r,bandCount:l,pixelType:u,pixelSize:P,storageInfo:v,spatialReference:O,isPseudoSpatialReference:k,keyProperties:B,extent:E,colormap:_,statistics:T?T.statistics:null});if(w?.length&&(z.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:O}),z.transform=new F({polynomialOrder:1,forwardCoefficients:[w[2]+w[0]/2,w[5]-w[3]/2,w[0],w[3],-w[1],-w[4]]}),z.extent=z.transform.forwardTransform(z.nativeExtent),z.pixelSize=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),v.origin.x=-.5,v.origin.y=.5),g){const{x:e,y:t}=z.pixelSize;g.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:z}}function D(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=R(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new n({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}e([r()],k.prototype,"_files",void 0),e([r()],k.prototype,"_headerInfo",void 0),e([r()],k.prototype,"_bufferSize",void 0),e([r()],k.prototype,"_chunkSize",void 0),e([r({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),k=e([s("esri.layers.raster.datasets.TIFFRaster")],k);const v=k;export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import f from"./BaseRaster.js";import{parse as l}from"./DBFParser.js";import{parsePAMInfo as u,parseSpatialReference as c}from"./pamParser.js";import{parseSignature as h,getPyramidIFDs as p,getMaskIFDs as d,parseIFD as m,parseFieldValues as y,isBSQConfig as g,getTagNumericValues as x,getTagFirstNumericValue as w,getImageInfo as I}from"../formats/tiffParser.js";import{tiffTags as T,geoKeys as _}from"../formats/tiffTag.js";import{estimateStatisticsFromHistograms as R}from"../functions/stretchUtils.js";import F from"../transforms/PolynomialTransform.js";import S from"../../support/RasterInfo.js";import b from"../../support/RasterStorageInfo.js";import O from"../../../rest/support/FeatureSet.js";let k=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,r);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(e){const r=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:r});if(!s)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=h(s),f=[],l={fileChunk:s,posIFD:n,fileOffset:0};await this._readIFDs(f,l,a,o?8:4,r);const{imageInfo:u,rasterInfo:c}=E(f),m=p(f),y=d(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:m,maskIFDs:y,...u},this._set("rasterInfo",c),!u.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new t("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");c.isPseudoSpatialReference&&i.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const g=f[0].get("PREDICTOR")?.values?.[0],x=f[0].get("SAMPLEFORMAT")?.values?.[0];if(3===x&&2===g)throw new t("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:w,skipExtensions:I=[]}=this.ioConfig;if(!I.includes("aux.xml")&&!w){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&D(t,c)}I.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||w||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),w&&this.updateImageSpaceRasterInfo(c),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){r=s+r;i=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:t})).data,s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,i,r,s=4,a){if(!i.posIFD)return null;i=await this._validateOrFetchHeaderBuffer(i,a);const n=await this._readIFD(i,r,T,s,a);if(!n?.ifd)throw new t("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;i.posIFD=n.nextIFD-i.fileOffset,await this._readIFDs(e,i,r,s,a)}async _readIFD(e,t,i=T,r=4,s){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const f=m(a,t,n,o,i,r);if(f.success){const e=[];if(f.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,f.nextIFD,s),f.ifd?.has("GEOKEYDIRECTORY")){const e=f.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const r=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const f=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},s),l=await this._readIFD(f,t,_,2,s);e.data=l?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return f}if(f.requiredBufferSize){return a=(await this.request(this.url,{range:{from:o,to:o+n+f.requiredBufferSize+8},responseType:"array-buffer",signal:s})).data,a.byteLength<n+f.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,r,s))}return null}async _fillOffsets(e,t,i,r){const s=e.filter(e=>null!=e.offlineOffsetSize);if(0===s.length)return;const a=s.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let f=1===a.length||o-n<=this._bufferSize;if(!f&&a.length>1){a.sort((e,t)=>e[0]-t[0]);f=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o}if(f){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),r);return void s.forEach(i=>y(e,t,i,n))}const l=s.map(async e=>{const i=e.offlineOffsetSize,s=await this._fetchOffsets(i[0],i[1]+i[0],r);y(s,t,e,i[0])});await Promise.all(l)}async _fetchOffsets(e,t,i){const r=[],s=this._chunkSize,a=Math.ceil((t-e)/s);let n=e;for(let l=0;l<a;l++)r.push(this.request(this.url,{range:{from:n,to:l===a-1?t:n+s-1},responseType:"array-buffer",signal:i})),n+=s;const o=await Promise.all(r);if(1===a)return o[0].data;const f=new Uint8Array(t-e+1);for(let l=0;l<a;l++)f.set(new Uint8Array(o[l].data),l*s);return f.buffer}async _fetchRawTiffTile(e,t,i,r,s={}){const a=this._getTileLocation(e,t,i,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:f,ifd:l}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal})),c=await Promise.all(u),h=c.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===c.length?c[0].data:new ArrayBuffer(h),d=[0],m=[0];if(c.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<c.length;t++){const r=c[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;if(o!==y||f!==g){let e=x.mask;if(e)for(let t=0;t<g;t++){const i=t*y;if(t<f)for(let t=o;t<y;t++)e[i+t]=0;else for(let t=0;t<y;t++)e[i+t]=0}else{e=new Uint8Array(y*g),x.mask=e;for(let t=0;t<f;t++){const i=t*y;for(let t=0;t<o;t++)e[i+t]=1}}}return x}_getTileLocation(e,t,i,r=!1){const{firstPyramidLevel:s,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const f=r?o.maskIFDs[n]:0===n?o.ifds[0]:o.pyramidIFDs[n-1];if(!f)return null;const l=g(f,o),u=x(f,"TILEOFFSETS"),c=x(f,"TILEBYTECOUNTS");if(!u?.length||!c?.length)return null;const{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const y=w(f,"IMAGEWIDTH"),I=w(f,"IMAGELENGTH"),T=w(f,"TILEWIDTH"),_=w(f,"TILELENGTH"),R=[];if(l){const{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){const e=r*(d+1)*(m+1)+t*(m+1)+i;R[r]={from:u[e],to:u[e]+c[e]-1}}}else{const e=t*(m+1)+i;R.push({from:u[e],to:u[e]+c[e]-1})}for(let g=0;g<R.length;g++)if(null==R[g].from||!R[g].to||R[g].to<0)return null;return{ranges:R,ifd:f,actualTileWidth:i===m&&y%T||T,actualTileHeight:t===d&&I%_||_}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return u(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=l(t);return i?.recordSet?O.fromJSON(i.recordSet):null}catch{return null}}};function E(e){const t=I(e),{width:i,height:r,tileWidth:s,tileHeight:f,planes:l,pixelType:u,compression:h,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidBlockWidth:m,pyramidBlockHeight:y,pyramidResolutions:g,tileBoundary:x,affine:w,metadata:T,colormap:_}=t,R=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let O=c(R),k=!!t.isPseudoGeographic;null==O&&(k=!0,O=new o({wkid:3857}));const E=new a({...t.extent,spatialReference:O}),D=new n(E?{x:E.xmin,y:E.ymax,spatialReference:O}:{x:0,y:0}),v=new b({blockWidth:s,blockHeight:f,pyramidBlockWidth:m,pyramidBlockHeight:y,compression:h,origin:D,firstPyramidLevel:p,maximumPyramidLevel:d,pyramidResolutions:g,blockBoundary:x}),P=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),B=T?{BandProperties:T.bandProperties,DataType:T.dataType}:{},z=new S({width:i,height:r,bandCount:l,pixelType:u,pixelSize:P,storageInfo:v,spatialReference:O,isPseudoSpatialReference:k,keyProperties:B,extent:E,colormap:_,statistics:T?T.statistics:null});if(w?.length&&(z.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:O}),z.transform=new F({polynomialOrder:1,forwardCoefficients:[w[2]+w[0]/2,w[5]-w[3]/2,w[0],w[3],-w[1],-w[4]]}),z.extent=z.transform.forwardTransform(z.nativeExtent),z.pixelSize=new n({x:(E.xmax-E.xmin)/i,y:(E.ymax-E.ymin)/r,spatialReference:O}),v.origin.x=-.5,v.origin.y=.5),g){const{x:e,y:t}=z.pixelSize;g.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:z}}function D(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=R(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new n({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}e([r()],k.prototype,"_files",void 0),e([r()],k.prototype,"_headerInfo",void 0),e([r()],k.prototype,"_bufferSize",void 0),e([r()],k.prototype,"_chunkSize",void 0),e([r({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),k=e([s("esri.layers.raster.datasets.TIFFRaster")],k);const v=k;export{v as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{decodeBitMask as e}from"./ImageCanvasDecoder.js";import{J as t}from"../../../chunks/Jpg.js";class s{static async decode(s,a={}){const n=new Uint8Array(s),r=new t;r.parse(n);const{width:o,height:l,numComponents:i,eof:c}=r,p=a.decodeJpegAsRgb??1!==i,f=r.getData(o,l,p),g=o*l;let h=null;const{applyJpegMask:d=!1}=a;let m;d&&c<n.length-1&&(h=await e(n.subarray(c,-4),g));const u=p?3:i;if(1===u&&f.length===o*l){const e=new Uint8Array(f.buffer);m=[e,e,e]}else{m=[];for(let e=0;e<u;e++)m.push(new Uint8Array(g));for(let e=0,t=0;e<g;e++)for(let s=0;s<u;s++)m[s][e]=f[t++]}return{width:o,height:l,pixels:m,mask:h}}}export{s as default};
2
+ import{decodeBitMask as t}from"./ImageCanvasDecoder.js";import{J as n}from"../../../chunks/Jpg.js";const e=255;function r(t){const n=new Uint8Array(t),r=n.length;if(n[0]!==e||216!==n[1])return null;let o=2;for(;o<r&&n[o++]===e;){for(;n[o]===e;)o++;if(o>=r)break;const t=n[o++];if(217===t||218===t)break;if(t>=208&&t<=215||1===t)continue;const s=n[o]<<8|n[o+1];if(t>=192&&t<=207&&196!==t&&200!==t&&204!==t&&s>=8){const t=o+2,e=n[t+1]<<8|n[t+2];return{width:n[t+3]<<8|n[t+4],height:e,planes:n[t+5]}}o+=s}return null}async function o(e,r={}){const o=new Uint8Array(e),s=new n;s.parse(o);const{width:i,height:a,numComponents:l,eof:f}=s,c=r.decodeJpegAsRgb??1!==l,u=s.getData(i,a,c),h=i*a;let p=null;const{applyJpegMask:g=!1}=r;let w;g&&f<o.length-1&&(p=await t(o.subarray(f,-4),h));const m=c?3:l;if(1===m&&u.length===i*a){const t=new Uint8Array(u.buffer);w=[t,t,t]}else{w=[];for(let t=0;t<m;t++)w.push(new Uint8Array(h));for(let t=0,n=0;t<h;t++)for(let e=0;e<m;e++)w[e][t]=u[n++]}return{width:i,height:a,pixels:w,mask:p}}export{o as decode,r as parseHeader};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import r from"./JpgPlus.js";import{load as s,decode as n}from"./Lerc.js";import{decode as o}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{load as c,decode as p}from"./Qb3.js";import f from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as h}from"./utils.js";import{inflate as w}from"./Zlib.js";import m from"../../support/PixelBlock.js";import g from"../../support/SimpleBandStatistics.js";async function y(t,a){if(!h)throw new e("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{width:i,height:r,pixelType:o,statistics:l,depthCount:c,noDataValues:p,bandMasks:f,pixels:d,mask:u,validPixelCount:w}=n(t,{inputOffset:a.offset,returnInterleaved:a.returnInterleaved});return new m({width:i,height:r,pixelType:o.toLowerCase(),pixels:d,mask:u,validPixelCount:w,statistics:l.map(({minValue:e,maxValue:t})=>new g(e,t)),bandMasks:f,depthCount:c,noDataValues:p})}async function x(t,a){await c();const i=p(t);if(!i)throw new e("rasterCodec:decode","failed to decode the input data.");const{width:r,height:s,pixels:n,pixelType:o}=i;return new m({width:r,height:s,pixelType:o,pixels:n})}async function k(e,a){const i=await u(e,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});t(i);return new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks})}async function b(e,t){const a=await d(e,t.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask});return t.skipStatistics||i.updateStatistics(),i}function C(e,t){const a=t.pixelType||"u8",i=m.getPixelArrayConstructor(a),r="u8"===a?e:new i(e.buffer),s=[],n=t.planes||1;if(1===n)s.push(r);else for(let o=0;o<n;o++){const a=(t.width||1)*(t.height||e.length),l=new i(a);for(let e=0;e<a;e++)l[e]=r[e*n+o];s.push(l)}return new m({width:t.width||1,height:t.height||e.length,pixels:s,pixelType:a})}async function T(e,t){return C(await w(new Uint8Array(e)),t)}function j(e,t){return C(o(e,t.offset,t.eof,!t.isInputBigEndian),t)}function A(e,t){const a=t.format,{pixelTypeCtor:i}=V(t.pixelType),r=(0,f.decode)(e,{width:t.width,height:t.height,pixelType:i,format:a});return new m({width:t.width,height:t.height,pixels:r.pixels,pixelType:t.pixelType,mask:r.mask})}async function U(e,t){const a=await r.decode(e,t);return new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask})}async function D(e,t,a){const r=await i(e,t,a);return new m(r)}async function v(t,i,r){const s=i.format||I(t),n={...i,format:s},{canvasUsage:o}=i;if("no-canvas"!==o||"png"===s)try{return await D(t,n,r)}catch(l){if(a(l))throw l;if("canvas-only"===o)throw new e("rasterCodec:decode",`failed to decode the input data with canvas for format ${s}`)}return await U(t,n)}function P(t){let a=null;switch(t){case"lerc":a=y;break;case"jpg":case"png":a=v;break;case"bmp":case"gif":a=D;break;case"bsq":case"bip":a=A;break;case"tiff":a=k;break;case"deflate":a=T;break;case"lzw":a=j;break;case"qb3":a=x;break;default:a=()=>{throw new e("rasterCodec:decode",`unsupported raster format ${t}`)}}return a}function V(e){let t=null,a=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,t=Uint8Array;break;case"u16":a=a||65535,t=Uint16Array;break;case"u32":a=a||2**32-1,t=Uint32Array;break;case"s8":a=a||-128,t=Int8Array;break;case"s16":a=a||-32768,t=Int16Array;break;case"s32":a=a||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:a}}function L(e,t="bilinear"){if(!e)return;const{pixels:a,width:i,height:r,mask:s}=e;if(!a||0===a.length)return;const n=i-1,o=r-1,l=[];let c=null;const p=m.getPixelArrayConstructor(e.pixelType);if("nearest"===t){for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let i=0;i<n;i++)t[a*n+i]=e[r+i]}l.push(t)}if(null!=s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=s[t+a]}}}else{for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let s=0;s<n;s++)t[a*n+s]=(e[r+s]+e[r+s+1]+e[r+i+s]+e[r+i+s+1])/4}l.push(t)}if(s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=Math.min.apply(null,[s[t+a],s[t+a+1],s[t+i+a],s[t+i+a+1]])}}}e.width=n,e.height=o,e.mask=c,e.pixels=l}function I(e){if(!e)return;const t=new Uint8Array(e,0,10);let a;return 255===t[0]&&216===t[1]?a="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?a="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]||76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?a="lerc":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?a="tiff":71===t[0]&&73===t[1]&&70===t[2]?a="gif":66===t[0]&&77===t[1]?a="bmp":81===t[0]&&66===t[1]&&51===t[2]&&(a="qb3"),a}async function M(t,a={},i){if(null==t)throw new e("rasterCodec:decode","missing encodeddata parameter.");let r=a.format?.toLowerCase();if(!("bsq"!==r&&"bip"!==r||null!=a.width&&null!=a.height))throw new e("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===r&&a.customOptions)return b(t,a);if(!r||"bsq"!==r&&"bip"!==r&&"deflate"!==r&&"lzw"!==r){if(r=I(t),!r){throw String.fromCharCode.apply(null,[...new Uint8Array(t,0,10)]).toLowerCase().includes("error")?new e("rasterCodec:decode","input data contains error"):new e("rasterCodec:decode","unsupported raster format")}a={...a,format:r}}const s=P(r);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:o}=a;if(o&&o.length>1){const e=o.map((e,r)=>s(t.slice(e,o[r+1]),a,i)),r=await Promise.all(e);n=r[0],n.pixels=r.map(e=>e.pixels[0]);const l=r.map(e=>e.mask);l.some(e=>null!=e)&&(l.forEach((e,t)=>{l[t]??=new Uint8Array(n.width*n.height).fill(255)}),n.bandMasks=l,n.mask=m.combineBandMasks(l))}else n=await s(t,{...a,offset:o?.[0]??a.offset},i);return"jpg"!==r&&null!=a.noDataValue&&1===n.depthCount&&l(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&L(n),n.statistics?.length||a.skipStatistics||n.updateStatistics(),n}export{M as decode,I as getFormat};
2
+ import e from"../../../core/Error.js";import{assertIsSome as t}from"../../../core/maybe.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import{decode as i}from"./ImageCanvasDecoder.js";import{decode as r}from"./JpgPlus.js";import{load as s,decode as n}from"./Lerc.js";import{decode as o}from"./Lzw.js";import{convertNoDataToMask as l}from"./pixelRangeUtils.js";import{load as c,decode as p}from"./Qb3.js";import{decode as f}from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as h}from"./utils.js";import{inflate as w}from"./Zlib.js";import m from"../../support/PixelBlock.js";import g from"../../support/SimpleBandStatistics.js";async function y(t,a){if(!h)throw new e("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{width:i,height:r,pixelType:o,statistics:l,depthCount:c,noDataValues:p,bandMasks:f,pixels:d,mask:u,validPixelCount:w}=n(t,{inputOffset:a.offset,returnInterleaved:a.returnInterleaved});return new m({width:i,height:r,pixelType:o.toLowerCase(),pixels:d,mask:u,validPixelCount:w,statistics:l.map(({minValue:e,maxValue:t})=>new g(e,t)),bandMasks:f,depthCount:c,noDataValues:p})}async function x(t,a){await c();const i=p(t);if(!i)throw new e("rasterCodec:decode","failed to decode the input data.");const{width:r,height:s,pixels:n,pixelType:o}=i;return new m({width:r,height:s,pixelType:o,pixels:n})}async function k(e,a){const i=await u(e,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});t(i);return new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks})}async function b(e,t){const a=await d(e,t.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask});return t.skipStatistics||i.updateStatistics(),i}function C(e,t){const a=t.pixelType||"u8",i=m.getPixelArrayConstructor(a),r="u8"===a?e:new i(e.buffer),s=[],n=t.planes||1;if(1===n)s.push(r);else for(let o=0;o<n;o++){const a=(t.width||1)*(t.height||e.length),l=new i(a);for(let e=0;e<a;e++)l[e]=r[e*n+o];s.push(l)}return new m({width:t.width||1,height:t.height||e.length,pixels:s,pixelType:a})}async function T(e,t){return C(await w(new Uint8Array(e)),t)}function j(e,t){return C(o(e,t.offset,t.eof,!t.isInputBigEndian),t)}function A(e,t){const a=t.format,{pixelTypeCtor:i}=V(t.pixelType),r=f(e,{width:t.width,height:t.height,pixelType:i,format:a});return new m({width:t.width,height:t.height,pixels:r.pixels,pixelType:t.pixelType,mask:r.mask})}async function U(e,t){const a=await r(e,t);return new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask})}async function D(e,t,a){const r=await i(e,t,a);return new m(r)}async function v(t,i,r){const s=i.format||I(t),n={...i,format:s},{canvasUsage:o}=i;if("no-canvas"!==o||"png"===s)try{return await D(t,n,r)}catch(l){if(a(l))throw l;if("canvas-only"===o)throw new e("rasterCodec:decode",`failed to decode the input data with canvas for format ${s}`)}return await U(t,n)}function P(t){let a=null;switch(t){case"lerc":a=y;break;case"jpg":case"png":a=v;break;case"bmp":case"gif":a=D;break;case"bsq":case"bip":a=A;break;case"tiff":a=k;break;case"deflate":a=T;break;case"lzw":a=j;break;case"qb3":a=x;break;default:a=()=>{throw new e("rasterCodec:decode",`unsupported raster format ${t}`)}}return a}function V(e){let t=null,a=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,t=Uint8Array;break;case"u16":a=a||65535,t=Uint16Array;break;case"u32":a=a||2**32-1,t=Uint32Array;break;case"s8":a=a||-128,t=Int8Array;break;case"s16":a=a||-32768,t=Int16Array;break;case"s32":a=a||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:a}}function L(e,t="bilinear"){if(!e)return;const{pixels:a,width:i,height:r,mask:s}=e;if(!a||0===a.length)return;const n=i-1,o=r-1,l=[];let c=null;const p=m.getPixelArrayConstructor(e.pixelType);if("nearest"===t){for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let i=0;i<n;i++)t[a*n+i]=e[r+i]}l.push(t)}if(null!=s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=s[t+a]}}}else{for(const e of a){const t=new p(n*o);for(let a=0;a<o;a++){const r=a*i;for(let s=0;s<n;s++)t[a*n+s]=(e[r+s]+e[r+s+1]+e[r+i+s]+e[r+i+s+1])/4}l.push(t)}if(s){c=new Uint8Array(n*o);for(let e=0;e<o;e++){const t=e*i;for(let a=0;a<n;a++)c[e*n+a]=Math.min.apply(null,[s[t+a],s[t+a+1],s[t+i+a],s[t+i+a+1]])}}}e.width=n,e.height=o,e.mask=c,e.pixels=l}function I(e){if(!e)return;const t=new Uint8Array(e,0,10);let a;return 255===t[0]&&216===t[1]?a="jpg":137===t[0]&&80===t[1]&&78===t[2]&&71===t[3]?a="png":67===t[0]&&110===t[1]&&116===t[2]&&90===t[3]&&73===t[4]&&109===t[5]&&97===t[6]&&103===t[7]&&101===t[8]&&32===t[9]||76===t[0]&&101===t[1]&&114===t[2]&&99===t[3]&&50===t[4]&&32===t[5]?a="lerc":73===t[0]&&73===t[1]&&42===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&42===t[3]||73===t[0]&&73===t[1]&&43===t[2]&&0===t[3]||77===t[0]&&77===t[1]&&0===t[2]&&43===t[3]?a="tiff":71===t[0]&&73===t[1]&&70===t[2]?a="gif":66===t[0]&&77===t[1]?a="bmp":81===t[0]&&66===t[1]&&51===t[2]&&(a="qb3"),a}async function M(t,a={},i){if(null==t)throw new e("rasterCodec:decode","missing encodeddata parameter.");let r=a.format?.toLowerCase();if(!("bsq"!==r&&"bip"!==r||null!=a.width&&null!=a.height))throw new e("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===r&&a.customOptions)return b(t,a);if(!r||"bsq"!==r&&"bip"!==r&&"deflate"!==r&&"lzw"!==r){if(r=I(t),!r){throw String.fromCharCode.apply(null,[...new Uint8Array(t,0,10)]).toLowerCase().includes("error")?new e("rasterCodec:decode","input data contains error"):new e("rasterCodec:decode","unsupported raster format")}a={...a,format:r}}const s=P(r);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:o}=a;if(o&&o.length>1){const e=o.map((e,r)=>s(t.slice(e,o[r+1]),a,i)),r=await Promise.all(e);n=r[0],n.pixels=r.map(e=>e.pixels[0]);const l=r.map(e=>e.mask);l.some(e=>null!=e)&&(l.forEach((e,t)=>{l[t]??=new Uint8Array(n.width*n.height).fill(255)}),n.bandMasks=l,n.mask=m.combineBandMasks(l))}else n=await s(t,{...a,offset:o?.[0]??a.offset},i);return"jpg"!==r&&null!=a.noDataValue&&1===n.depthCount&&l(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&L(n),n.statistics?.length||a.skipStatistics||n.updateStatistics(),n}export{M as decode,I as getFormat};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e=(e,r)=>{const a=r.width*r.height,n=r.pixelType;return Math.floor(e.byteLength/(a*t(n)))},t=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},r=(e,t)=>{if(8*e.byteLength<t)return null;const r=new Uint8Array(e,0,Math.ceil(t/8)),a=new Uint8Array(t);let n=0,s=0;for(let c=0;c<r.length-1;c++){s=r[c];for(let e=7;e>=0;e--)a[n++]=s>>e&1}let l=7;for(;n<t-1;)s=r[r.length-1],a[n++]=s>>l&1,l--;return a};class a{static decode(a,n){const s=n.pixelType,l=[],c=n.width*n.height,i=e(a,n),{bandIds:h,format:o}=n,y=h?.length||e(a,n),b=a.byteLength-a.byteLength%(c*t(s)),f=new s(a,0,c*i);if("bip"===o)for(let e=0;e<y;e++){const t=new s(c),r=h?h[e]:e;for(let e=0;e<c;e++)t[e]=f[e*i+r];l.push(t)}else if("bsq"===o)for(let e=0;e<y;e++){const t=h?h[e]:e;l.push(f.subarray(t*c,(t+1)*c))}let u=null;return b<a.byteLength-1&&(u=r(a.slice(b),c)),{pixels:l,mask:u}}}export{a as default};
2
+ const e=(e,r)=>{const n=r.width*r.height,a=r.pixelType;return Math.floor(e.byteLength/(n*t(a)))},t=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},r=(e,t)=>{if(8*e.byteLength<t)return null;const r=new Uint8Array(e,0,Math.ceil(t/8)),n=new Uint8Array(t);let a=0,l=0;for(let i=0;i<r.length-1;i++){l=r[i];for(let e=7;e>=0;e--)n[a++]=l>>e&1}let s=7;for(;a<t-1;)l=r[r.length-1],n[a++]=l>>s&1,s--;return n};function n(n,a){const l=a.pixelType,s=[],i=a.width*a.height,h=e(n,a),{bandIds:o,format:c}=a,y=o?.length||e(n,a),b=n.byteLength-n.byteLength%(i*t(l)),f=new l(n,0,i*h);if("bip"===c)for(let e=0;e<y;e++){const t=new l(i),r=o?o[e]:e;for(let e=0;e<i;e++)t[e]=f[e*h+r];s.push(t)}else if("bsq"===c)for(let e=0;e<y;e++){const t=o?o[e]:e;s.push(f.subarray(t*i,(t+1)*i))}let u=null;return b<n.byteLength-1&&(u=r(n.slice(b),i)),{pixels:s,mask:u}}export{n as decode};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter(({valueExpression:e})=>e&&"$view.scale"!==e).map(({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}}));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter(({valueExpression:e})=>e).map(({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}}));r.push(...t)}return r}function n(e,n,r){let t;if("layer"!==e)t="-feature-reduction";else switch(n){case"imagery":case"imagery-tile":t="-imagery";break;case"voxel":t="-voxel";break;default:t=""}return`${r?"popup-element":"popup"}${t}`}function r(e,r,t){const o=[];if(e?.expressionInfos){const s=e?.expressionInfos.map(({title:e,name:o,expression:s,returnType:i})=>({title:e,name:o,expression:s,profileInfo:{name:n(r,t,!1),context:"popup-template",returnType:i,source:r}}));o.push(...s)}if(e?.content&&Array.isArray(e.content)){const s=e?.content.filter(({type:e})=>"expression"===e).map(({expressionInfo:e})=>({title:e.title,expression:e.expression,profileInfo:{name:n(r,t,!0),context:"popup-expression-content",returnType:e.returnType,source:r}}));o.push(...s)}return o}function t(e){const n=[];if(e?.featureExpressionInfo?.expression){const r={expression:e?.featureExpressionInfo?.expression,profileInfo:{name:"feature-z",context:"elevation-info",source:"layer"}};n.push(r)}return n}function o(e){const n=[];if(e){const r=e.filter(({valueExpression:e})=>e).map(({valueExpression:e})=>({expression:e,profileInfo:{name:"feature-z",context:"order-by",source:"layer"}}));n.push(...r)}return n}function s(e){const n=[];if(e?.expressionInfos){const r=e?.expressionInfos.map(({title:e,name:n,expression:r,returnType:t})=>({title:e,name:n,expression:r,profileInfo:{name:"boolean"===t?"form-constraint":"form-calculation",context:"form-template",returnType:t,source:"layer"}}));n.push(...r)}return n}function i(n){return[...r(n?.popupTemplate,"feature-reduction"),...p(n?.labelingInfo,"feature-reduction"),...e(n?.renderer,"feature-reduction"),...a(n?.fields)]}function a(e){const n=[];if(e){const r=e.filter(({onStatisticExpression:e,isAutoGenerated:n})=>e&&!n).map(({onStatisticExpression:{expression:e,title:n}})=>({expression:e,title:n,profileInfo:{name:"aggregate-field",context:"aggregate-field",source:"feature-reduction"}}));n.push(...r)}return n}function p(e,n){const r=[];if(e){const t=e.filter(({labelExpressionInfo:e})=>e?.expression).map(({labelExpressionInfo:e})=>({expression:e?.expression,title:e?.title,profileInfo:{name:"labeling",context:"label-class",source:n}}));r.push(...t)}return r}function l(n){const a=[];if("labelingInfo"in n&&a.push(...p(n.labelingInfo,"layer")),a.push(...r(n.popupTemplate,"layer",n.type)),"renderer"in n&&"imagery"!==n.type&&"imagery-tile"!==n.type&&a.push(...e(n.renderer,"layer")),"elevationInfo"in n&&a.push(...t(n.elevationInfo)),"featureReduction"in n&&a.push(...i(n.featureReduction)),"trackInfo"in n){const t=n.trackInfo;a.push(...e(t?.latestObservations.renderer),...e(t?.previousObservations.renderer),...e(t?.trackLines.renderer),...p(t?.latestObservations.labelingInfo),...p(t?.previousObservations.labelingInfo),...p(t?.trackLines.labelingInfo),...r(t?.popupTemplate))}return"orderBy"in n&&a.push(...o(n.orderBy)),"formTemplate"in n&&a.push(...s(n.formTemplate)),a}export{l as getExpressionsFromLayer};
2
+ function e(e,n){const r=[];if(!e)return r;if("valueExpression"in e&&e.valueExpression){const t={expression:e.valueExpression,title:e.valueExpressionTitle,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}};r.push(t)}if("visualVariables"in e&&e.visualVariables){const t=e.visualVariables.filter(({valueExpression:e})=>e&&"$view.scale"!==e).map(({valueExpression:e,valueExpressionTitle:r,type:t})=>({expression:e,title:r,profileInfo:{name:"visualization",context:`${t}-variable`,source:n}}));r.push(...t)}if("attributes"in e&&e.attributes){const t=e?.attributes.filter(({valueExpression:e})=>e).map(({valueExpression:r,valueExpressionTitle:t})=>({expression:r,title:t,profileInfo:{name:"visualization",context:`${e.type}-renderer`,source:n}}));r.push(...t)}return r}function n(e,n,r){let t;if("layer"!==e)t="-feature-reduction";else switch(n){case"imagery":case"imagery-tile":t="-imagery";break;case"voxel":t="-voxel";break;default:t=""}return`${r?"popup-element":"popup"}${t}`}function r(e,r,t){const o=[];if(e?.expressionInfos){const s=e?.expressionInfos.map(({title:e,name:o,expression:s,returnType:i})=>({title:e,name:o,expression:s,profileInfo:{name:n(r,t,!1),context:"popup-template",returnType:i,source:r}}));o.push(...s)}if(e?.content&&Array.isArray(e.content)){const s=e?.content.filter(({type:e})=>"expression"===e).map(({expressionInfo:e})=>({title:e.title,expression:e.expression,profileInfo:{name:n(r,t,!0),context:"popup-expression-content",returnType:e.returnType,source:r}}));o.push(...s)}return o}function t(e){const n=[];if(e?.featureExpressionInfo?.expression){const r={expression:e?.featureExpressionInfo?.expression,profileInfo:{name:"feature-z",context:"elevation-info",source:"layer"}};n.push(r)}return n}function o(e){const n=[];if(e){const r=e.filter(({valueExpression:e})=>e).map(({valueExpression:e})=>({expression:e,profileInfo:{name:"feature-z",context:"order-by",source:"layer"}}));n.push(...r)}return n}function s(e){const n=[];if(e?.expressionInfos){const r=e?.expressionInfos.map(({title:e,name:n,expression:r,returnType:t})=>({title:e,name:n,expression:r,profileInfo:{name:i(t),context:"form-template",returnType:t,source:"layer"}}));n.push(...r)}return n}function i(e){switch(e){case"boolean":return"form-constraint";case"dictionary":return"form-dynamic-choice";default:return"form-calculation"}}function a(n){return[...r(n?.popupTemplate,"feature-reduction"),...u(n?.labelingInfo,"feature-reduction"),...e(n?.renderer,"feature-reduction"),...p(n?.fields)]}function p(e){const n=[];if(e){const r=e.filter(({onStatisticExpression:e,isAutoGenerated:n})=>e&&!n).map(({onStatisticExpression:{expression:e,title:n}})=>({expression:e,title:n,profileInfo:{name:"aggregate-field",context:"aggregate-field",source:"feature-reduction"}}));n.push(...r)}return n}function u(e,n){const r=[];if(e){const t=e.filter(({labelExpressionInfo:e})=>e?.expression).map(({labelExpressionInfo:e})=>({expression:e?.expression,title:e?.title,profileInfo:{name:"labeling",context:"label-class",source:n}}));r.push(...t)}return r}function l(n){const i=[];if("labelingInfo"in n&&i.push(...u(n.labelingInfo,"layer")),i.push(...r(n.popupTemplate,"layer",n.type)),"renderer"in n&&"imagery"!==n.type&&"imagery-tile"!==n.type&&i.push(...e(n.renderer,"layer")),"elevationInfo"in n&&i.push(...t(n.elevationInfo)),"featureReduction"in n&&i.push(...a(n.featureReduction)),"trackInfo"in n){const t=n.trackInfo;i.push(...e(t?.latestObservations.renderer),...e(t?.previousObservations.renderer),...e(t?.trackLines.renderer),...u(t?.latestObservations.labelingInfo),...u(t?.previousObservations.labelingInfo),...u(t?.trackLines.labelingInfo),...r(t?.popupTemplate))}return"orderBy"in n&&i.push(...o(n.orderBy)),"formTemplate"in n&&i.push(...s(n.formTemplate)),i}export{l as getExpressionsFromLayer};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.127",
3
+ "version": "5.2.0-next.129",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,11 +20,11 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.8",
23
- "@arcgis/toolkit": "5.2.0-next.127",
23
+ "@arcgis/toolkit": "5.2.0-next.129",
24
24
  "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0-next.80",
26
26
  "@vaadin/grid": "~25.3.0",
27
- "@zip.js/zip.js": "~2.18.2",
27
+ "@zip.js/zip.js": "~2.20.0",
28
28
  "luxon": "~3.7.2",
29
29
  "marked": "~18.0.14",
30
30
  "tslib": "^2.8.1"
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import _ from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import v from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as I}from"./support/arcadeFeatureUtils.js";import A from"./support/FeatureAbilities.js";import{preLayerQueryCallback as x,preRequestCallback as C,createFieldInfoMap as E,getAllFieldInfos as w,getSourceLayer as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as N}from"./support/featureUtils.js";import{queryLayerInfos as S,queryRelatedFeatures as L,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new A,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(x,C)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){return E(w(this._effectivePopupTemplate),this._layer)}get _layer(){return F(this.graphic)}get isFeatureFromTable(){return this._layer?.isTable??!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t)return;const s=t.attributes?.[r];if(null==s)return;const o=[s],a=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),n=a?.geometry;n&&(t.geometry=n)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),T(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,heading:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new v({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileHeading(t){const{_fieldInfoMap:e,_layer:i,graphic:r,expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?I(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._set("expressionAttributes",n??null),this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,w(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=await(s?.associatedLayer?.load(i))??s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&N(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await S({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await L({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=G(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||q(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],J.prototype,"_layer",null),t([g({type:A})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:_})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([y("esri.popup.FeatureContent")],J);const K=J;export{K as default};
2
+ import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import s from"../core/Accessor.js";import{isSome as r}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as n}from"../core/Identifiable.js";import a from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import v from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as I}from"./support/arcadeFeatureUtils.js";import A from"./support/FeatureAbilities.js";import{preLayerQueryCallback as x,preRequestCallback as C,getPopupLayer as E,createFieldInfoMap as w,getAllFieldInfos as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as N}from"./support/featureUtils.js";import{queryLayerInfos as S,queryRelatedFeatures as L,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(n(s)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new A,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(x,C)}get _effectivePopupTemplate(){return this.graphic?.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled)??null}get _fieldInfoMap(){const t=E(this.graphic);return w(F(this._effectivePopupTemplate),t)}get isFeatureFromTable(){const t=E(this.graphic);return t?.isTable??!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:s}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=s&&!s.finished}async updateGeometry(){const{graphic:t,spatialReference:e}=this,i=E(t);await(i?.load());const s=i?.objectIdField;if(!s||!t)return;const r=t.attributes?.[s];if(null==r)return;const o=[r],n=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),a=n?.geometry;a&&(t.geometry=a)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_effectivePopupTemplate:i}=this,s=E(e),r=this.spatialReference;await j({graphic:e,popupTemplate:i,layer:s,spatialReference:r},{signal:t});const[{value:o},{value:n}]=await p([this._getContent(),this._getTitle()]),[,{value:a}]=await p([this._checkForRelatedFeatures({signal:t}),T(i?.expressionInfos,e)]);return{expressionInfos:a,content:o,heading:n}}catch(i){throw h(i)||(this._error=i,a.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){const e=E(this.graphic);return"relationship"===t.type?P(e)?t:void 0:"utility-network-associations"===t.type?R(e)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(r):"string"==typeof t?new v({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,graphic:e,timeZone:i}=this,s=E(e);if(!t)return;const{lastEditInfoEnabled:r}=t,o=s?.editFieldsInfo;return r&&o?O(o,e?.attributes,i,s):void 0}_compileHeading(t){const{_fieldInfoMap:e,graphic:i,expressionAttributes:s}=this,r=E(i),o=i?.attributes??{},n=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:n,expressionAttributes:s,layer:r,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async s=>{const{graphic:r,map:o,view:n,spatialReference:l,location:p}=this;try{if(!r)return;let a;if(null!=i){const t=[];for(const[e,a]of i.expressions.entries())null!=a?t.push(a.evaluate({graphic:r,interceptor:Q.interceptor,location:p,map:o,options:{signal:s},spatialReference:l,view:n}).then(t=>[e,"string"==typeof t?I(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));a=Object.fromEntries(await Promise.all(t)),c(s)}this._set("expressionAttributes",a??null),this._graphicExpressionAttributes={...r.attributes,...a},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,a.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:r,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:r,relatedInfos:o,_fieldInfoMap:n,_graphicExpressionAttributes:a,timeZone:l}=this,p=E(r);i.content[e]=U({attributes:{...a,...t.attributes},fieldInfoMap:n,fieldInfos:s?.fieldInfos,graphic:r,layer:p,relatedInfos:o,timeZone:l})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:s,relatedInfos:r,_fieldInfoMap:o,_graphicExpressionAttributes:n,timeZone:a}=this,l=E(s);i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:o,fieldInfos:t.fieldInfos,graphic:s,isContentFieldInfos:!0,layer:l,relatedInfos:r,timeZone:a})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:s,_fieldInfoMap:r,_graphicExpressionAttributes:o,timeZone:n}=this,a=E(i),l=e?.fieldInfos,p={global:U({attributes:o,fieldInfoMap:r,fieldInfos:l,graphic:i,layer:a,relatedInfos:s,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,F(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:s}=this,r=E(t);s.clear();const o=await(r?.associatedLayer?.load(i))??r;if(!o||!t)return;const n=e.filter(t=>!!t.fieldName&&N(t.fieldName));if(!n?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const a=await S({relatedInfos:s,layer:o},i);Object.keys(a).forEach(t=>{const e=s.get(t.toString()),i=a[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await L({graphic:t,relatedInfos:s,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,s.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,s=G(t.fieldName||"");if(!s)return;const{layerId:r,fieldName:o}=s;if(!r)return;const n=i.get(r.toString())||q(r,e);n&&(z({relatedInfo:n,fieldName:o,fieldInfo:t}),this.relatedInfos.set(r,n))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({type:A})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:y})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([_("esri.popup.FeatureContent")],J);const K=J;export{K as default};
@@ -325,6 +325,8 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
325
325
  * @see [waitingForResult](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#waitingForResult)
326
326
  */
327
327
  accessor open: boolean;
328
+ /** The location supplied when opening a feature stream while waiting for the first feature. This is `null` after the first feature arrives or the stream ends. Unlike [location](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#location), it does not change the popup location while waiting. */
329
+ get pendingLocation(): Point | null | undefined;
328
330
  /**
329
331
  * The selected feature accessed. The [content](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#content) is
330
332
  * determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) assigned to
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as a}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as s}from"../core/maybe.js";import{debounce as o,logOnError as n,isAbortError as l}from"../core/promiseUtils.js";import{watch as u,when as h,sync as c}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import g from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import f from"../geometry/SpatialReference.js";import{geographicToWebMercator as y}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as F}from"../layers/LayerConstants.js";import{ActionsCollection as v,zoomToAggregatedFeatures as w,browseAggregatedFeatures as b,zoomToFeature as I}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import A from"./FeatureContent.js";import S from"./support/FeatureAbilities.js";import{getDisplayedSymbol as P}from"../symbols/support/symbolUtils.js";import{system as x}from"../time/constants.js";import{highlightsSupported as L}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";const j=()=>[I.clone()],R=()=>[w.clone(),b.clone()];let O=null;function U(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let T=class extends(E(a)){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new S,this._activeFeatureStream=null,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&n(this._debouncedLocationUpdate(),r.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),u(()=>this.featureItems,()=>this._featureItemsChange()),u(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),h(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new v;e.removeAll();const{actions:i,defaultActions:a,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:o}=this,n=s?a.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(r)||o.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(n)??n;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set("diagnostics",null),this.features=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new v;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?R():j()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,i){this._set("diagnostics",i??null),this._get("featureStream")!==e&&(this._set("featureStream",e),this._cancelFeatureStream(),e&&(this.features=[],this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?y(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get streamingFeatures(){return null!=this._activeFeatureStream}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set("diagnostics",null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){const{view:a}=this;if(!a||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:a});const r={},s=a.fetchPopupFeatures(e,{diagnostics:r,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(s,void 0,r)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{selectedFeatureIndex:t}=this,i=null!=this._activeFeatureStream&&e.length>0;"list"!==this.initialDisplayMode?i&&-1===t?this.selectedFeatureIndex=0:i&&-1!==t||(this.selectedFeatureIndex=e.length?0:-1):i||(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=C(this);this._cancelCenterAtLocation();const a=new AbortController,{signal:s}=a;return this._centerAtLocationController=a,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{l(e)||r.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:a}=this;a&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:a,featureItems:r}=this;if(null==i)return;const s=((i-1)*a+t)%t,o=Math.min(s+a,r.length);for(let n=s;n<o;n++){const t=r[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:a}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!a)return;const r=_(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await P(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=a.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,a=this.view,r=this.spatialReference,s=this.map,o=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new A({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:s,view:a,timeZone:o});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=s(this._centerAtLocationController)}_cancelFeatureStream(){const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,a=i?.geometry?.type,s=this.location;if(a&&"mesh"!==a&&t&&s&&i){if("point"===a){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let a=i.geometry;const r=this._getHighlightLayer(i),o=i.getObjectId();if(!r||!this.view)return;if(null!=o){const i=this.view?.allLayerViews.find(e=>e.layer.uid===r.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;a=n[0]?.geometry}if(!a||"mesh"===a.type)return;a=m(a,t),O??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=O;if(!n(a,s)){const e=l(a,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(o){l(o)||r.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=s(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=_(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(U(t.type,i))return e;const a=e.getObjectId();if(null!=a)return a;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,s=e.attributes;return s&&r&&s[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:a,view:r,open:s}=this;if(!r||!a||!s)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(r,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&L(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(e!==this._activeFeatureStream)return;void 0!==t&&(this.location=t,t=void 0),this._addFeature(i)}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._waitingForResultChange())}}_addFeature(e){const{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([p()],T.prototype,"_initialDisplayMode",void 0),e([p()],T.prototype,"_activeFeatureStream",void 0),e([p({type:v})],T.prototype,"actions",void 0),e([p({readOnly:!0})],T.prototype,"active",null),e([p()],T.prototype,"activeFeature",void 0),e([p({readOnly:!0})],T.prototype,"allActions",null),e([p()],T.prototype,"aggregatedFeaturesEnabled",void 0),e([p({value:null})],T.prototype,"content",null),e([p({type:v,readOnly:!0})],T.prototype,"defaultActions",null),e([p({type:Boolean})],T.prototype,"defaultPopupTemplateEnabled",void 0),e([p({readOnly:!0})],T.prototype,"diagnostics",void 0),e([p({readOnly:!0})],T.prototype,"effectiveHeading",null),e([p({readOnly:!0})],T.prototype,"featureCount",null),e([p()],T.prototype,"featurePage",void 0),e([p({value:[]})],T.prototype,"features",null),e([p()],T.prototype,"featureStream",null),e([p()],T.prototype,"featuresPerPage",void 0),e([p()],T.prototype,"featureMenuOpen",void 0),e([p({type:S})],T.prototype,"featureItemAbilities",void 0),e([p({readOnly:!0})],T.prototype,"featureItems",void 0),e([p()],T.prototype,"heading",void 0),e([p()],T.prototype,"highlightEnabled",void 0),e([p()],T.prototype,"includeDefaultActions",void 0),e([p()],T.prototype,"initialDisplayMode",null),e([p({type:g})],T.prototype,"location",null),e([p()],T.prototype,"map",null),e([p()],T.prototype,"open",void 0),e([p({readOnly:!0})],T.prototype,"streamingFeatures",null),e([p({value:null,readOnly:!0})],T.prototype,"selectedFeature",null),e([p({value:-1})],T.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],T.prototype,"selectedFeatureItem",null),e([p({type:f})],T.prototype,"spatialReference",null),e([p({readOnly:!0})],T.prototype,"state",null),e([p()],T.prototype,"timeZone",null),e([p()],T.prototype,"updateLocationEnabled",void 0),e([p()],T.prototype,"view",void 0),e([p({readOnly:!0})],T.prototype,"waitingForContents",null),e([p({readOnly:!0})],T.prototype,"waitingForResult",null),e([p()],T.prototype,"zoomFactor",void 0),T=e([d("esri.popup.FeatureContentCollection")],T);const M=T;export{M as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as a}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as s}from"../core/maybe.js";import{debounce as n,logOnError as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as u,when as h,sync as c}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import g from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import f from"../geometry/SpatialReference.js";import{geographicToWebMercator as y}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as F}from"../layers/LayerConstants.js";import{ActionsCollection as v,zoomToAggregatedFeatures as w,browseAggregatedFeatures as b,zoomToFeature as I}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import A from"./FeatureContent.js";import L from"./support/FeatureAbilities.js";import{getDisplayedSymbol as S}from"../symbols/support/symbolUtils.js";import{system as P}from"../time/constants.js";import{highlightsSupported as x}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";const j=()=>[I.clone()],R=()=>[w.clone(),b.clone()];let O=null;function U(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let T=class extends(E(a)){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new L,this._activeFeatureStream=null,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&o(this._debouncedLocationUpdate(),r.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),u(()=>this.featureItems,()=>this._featureItemsChange()),u(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),h(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new v;e.removeAll();const{actions:i,defaultActions:a,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:n}=this,o=s?a.concat(i):i,l=n&&("function"==typeof n.getEffectivePopupTemplate&&n.getEffectivePopupTemplate(r)||n.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(o)??o;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set("diagnostics",null),this.features=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new v;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?R():j()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,i){this._set("diagnostics",i??null),this._get("featureStream")!==e&&(this._set("featureStream",e),this._cancelFeatureStream(),e&&(this.features=[],this._set("pendingLocation",t??null),this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?y(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingLocation(){return this._get("pendingLocation")??null}get streamingFeatures(){return null!=this._activeFeatureStream}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??P}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set("diagnostics",null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){const{view:a}=this;if(!a||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:a});const r={},s=a.fetchPopupFeatures(e,{diagnostics:r,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(s,void 0,r)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{selectedFeatureIndex:t}=this,i=null!=this._activeFeatureStream&&e.length>0;"list"!==this.initialDisplayMode?i&&-1===t?this.selectedFeatureIndex=0:i&&-1!==t||(this.selectedFeatureIndex=e.length?0:-1):i||(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=C(this);this._cancelCenterAtLocation();const a=new AbortController,{signal:s}=a;return this._centerAtLocationController=a,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{l(e)||r.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:a}=this;a&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:a,featureItems:r}=this;if(null==i)return;const s=((i-1)*a+t)%t,n=Math.min(s+a,r.length);for(let o=s;o<n;o++){const t=r[o];t&&(t.graphic??=e[o])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:a}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!a)return;const r=_(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await S(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=a.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,a=this.view,r=this.spatialReference,s=this.map,n=this.timeZone,o=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new A({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:o,map:s,view:a,timeZone:n});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=s(this._centerAtLocationController)}_cancelFeatureStream(){const e=this._activeFeatureStream;this._activeFeatureStream=null,this._set("pendingLocation",null),this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,a=i?.geometry?.type,s=this.location;if(a&&"mesh"!==a&&t&&s&&i){if("point"===a){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let a=i.geometry;const r=this._getHighlightLayer(i),n=i.getObjectId();if(!r||!this.view)return;if(null!=n){const i=this.view?.allLayerViews.find(e=>e.layer.uid===r.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[n],s.returnGeometry=!0;const{features:o}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;a=o[0]?.geometry}if(!a||"mesh"===a.type)return;a=m(a,t),O??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:o},{proximityGetNearestCoordinate:l}]=O;if(!o(a,s)){const e=l(a,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(n){l(n)||r.getLogger(this).error(n)}}}_cancelLocationUpdate(){this._locationUpdateController=s(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=_(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(U(t.type,i))return e;const a=e.getObjectId();if(null!=a)return a;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,s=e.attributes;return s&&r&&s[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:a,view:r,open:s}=this;if(!r||!a||!s)return;const n=this._getHighlightLayer(i);if(!n)return;const o=this._getHighlightLayerView(r,n);if(!o)return;this._highlightPromises[e]=o;const l=await o;if(!(l&&x(l)&&this._highlightPromises[e]===o&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,n,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(e!==this._activeFeatureStream)return;void 0!==t&&(this.location=t,t=void 0),this._set("pendingLocation",null),this._addFeature(i)}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._set("pendingLocation",null),this._waitingForResultChange())}}_addFeature(e){const{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([p()],T.prototype,"_initialDisplayMode",void 0),e([p()],T.prototype,"_activeFeatureStream",void 0),e([p({type:v})],T.prototype,"actions",void 0),e([p({readOnly:!0})],T.prototype,"active",null),e([p()],T.prototype,"activeFeature",void 0),e([p({readOnly:!0})],T.prototype,"allActions",null),e([p()],T.prototype,"aggregatedFeaturesEnabled",void 0),e([p({value:null})],T.prototype,"content",null),e([p({type:v,readOnly:!0})],T.prototype,"defaultActions",null),e([p({type:Boolean})],T.prototype,"defaultPopupTemplateEnabled",void 0),e([p({readOnly:!0})],T.prototype,"diagnostics",void 0),e([p({readOnly:!0})],T.prototype,"effectiveHeading",null),e([p({readOnly:!0})],T.prototype,"featureCount",null),e([p()],T.prototype,"featurePage",void 0),e([p({value:[]})],T.prototype,"features",null),e([p()],T.prototype,"featureStream",null),e([p()],T.prototype,"featuresPerPage",void 0),e([p()],T.prototype,"featureMenuOpen",void 0),e([p({type:L})],T.prototype,"featureItemAbilities",void 0),e([p({readOnly:!0})],T.prototype,"featureItems",void 0),e([p()],T.prototype,"heading",void 0),e([p()],T.prototype,"highlightEnabled",void 0),e([p()],T.prototype,"includeDefaultActions",void 0),e([p()],T.prototype,"initialDisplayMode",null),e([p({type:g})],T.prototype,"location",null),e([p()],T.prototype,"map",null),e([p()],T.prototype,"open",void 0),e([p({readOnly:!0})],T.prototype,"pendingLocation",null),e([p({readOnly:!0})],T.prototype,"streamingFeatures",null),e([p({value:null,readOnly:!0})],T.prototype,"selectedFeature",null),e([p({value:-1})],T.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],T.prototype,"selectedFeatureItem",null),e([p({type:f})],T.prototype,"spatialReference",null),e([p({readOnly:!0})],T.prototype,"state",null),e([p()],T.prototype,"timeZone",null),e([p()],T.prototype,"updateLocationEnabled",void 0),e([p()],T.prototype,"view",void 0),e([p({readOnly:!0})],T.prototype,"waitingForContents",null),e([p({readOnly:!0})],T.prototype,"waitingForResult",null),e([p()],T.prototype,"zoomFactor",void 0),T=e([d("esri.popup.FeatureContentCollection")],T);const M=T;export{M as default};