@arcgis/core 5.0.0-next.11 → 5.0.0-next.12

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 (382) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  4. package/arcade/functions/geomasync.js +1 -1
  5. package/arcade/functions/geomsync.js +1 -1
  6. package/arcade/functions/knowledgegraph.js +1 -1
  7. package/arcade/geometry/nearestVertex.js +5 -0
  8. package/arcade/geometry/operators.js +1 -1
  9. package/arcade/geometry/operatorsWorker.js +1 -1
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  15. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  17. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  23. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  26. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  28. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  29. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  30. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  31. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  33. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  35. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  36. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  37. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  38. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  40. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  41. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  42. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  43. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  45. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  48. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  51. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  55. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  56. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  57. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  58. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  61. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  63. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  64. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  66. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  67. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  73. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  74. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  75. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  76. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  77. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  79. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  80. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  81. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  84. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  85. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  86. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  87. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{6cf391b5ed7351601a2a.js → 9978ec6c67e87dc08a1d.js} +1 -1
  89. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  90. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  91. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  95. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  96. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  97. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  98. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  99. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  100. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  101. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  102. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  103. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  104. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  105. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  106. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  108. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  109. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{b6853c6a25eaabc9a7f6.js → c9579d607e59bae214da.js} +1 -1
  113. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  114. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  116. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  117. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  118. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  119. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  121. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  122. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  123. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  124. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  125. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  126. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  127. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  128. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  129. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  130. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  131. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  136. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  140. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  141. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  142. package/assets/esri/themes/dark/main.css +1 -1
  143. package/assets/esri/themes/light/main.css +1 -1
  144. package/assets/esri/themes/light/view.css +1 -1
  145. package/chunks/Envelope.js +1 -1
  146. package/chunks/Geometry.js +1 -1
  147. package/chunks/MultiPathImpl.js +1 -1
  148. package/chunks/Point2D.js +1 -1
  149. package/chunks/UnitFactory.js +1 -1
  150. package/chunks/containsOperator.js +1 -1
  151. package/chunks/densifyOperator.js +1 -1
  152. package/chunks/differenceOperator.js +1 -1
  153. package/chunks/intersectsOperator.js +1 -1
  154. package/chunks/persistableUrlUtils.js +1 -1
  155. package/config.js +1 -1
  156. package/core/XHRAdapter.js +1 -1
  157. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  158. package/core/quantityFormatUtils.js +1 -1
  159. package/core/unitFormatUtils.js +1 -1
  160. package/core/unitUtils.js +1 -1
  161. package/editing/fieldUtils.js +5 -0
  162. package/geometry/Extent.js +1 -1
  163. package/geometry/Geometry.js +1 -1
  164. package/geometry/Mesh.js +1 -1
  165. package/geometry/Point.js +1 -1
  166. package/geometry/SpatialReference.js +1 -1
  167. package/geometry/ellipsoidUtils.js +1 -1
  168. package/geometry/operators/support/jsonConverter.js +1 -1
  169. package/geometry/support/MeshTransform.js +1 -1
  170. package/geometry/support/axisAngleDegrees.js +1 -1
  171. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  172. package/geometry/support/meshUtils/rotate.js +1 -1
  173. package/geometry/support/meshUtils/scale.js +1 -1
  174. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  175. package/geometry/support/plane.js +1 -1
  176. package/geometry/support/polygonUtils.js +1 -1
  177. package/interfaces.d.ts +90 -7
  178. package/kernel.js +1 -1
  179. package/layers/Layer.js +1 -1
  180. package/layers/MapNotesLayer.js +1 -1
  181. package/layers/graphics/data/QueryEngine.js +1 -1
  182. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  183. package/layers/save/groupLayerUtils.js +1 -1
  184. package/layers/save/imageryUtils.js +1 -1
  185. package/layers/save/streamLayerUtils.js +1 -1
  186. package/layers/support/DateTimeFieldFormat.js +1 -1
  187. package/layers/support/FieldFormat.js +1 -1
  188. package/layers/support/LayerLoadContext.js +1 -1
  189. package/layers/support/NumberFieldFormat.js +1 -1
  190. package/layers/support/arcgisLayerUrl.js +1 -1
  191. package/layers/support/arcgisLayers.js +1 -1
  192. package/layers/support/fetchService.js +1 -1
  193. package/layers/support/fieldUtils.js +1 -1
  194. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  195. package/layers/video/VideoCameraSensorModel.js +1 -1
  196. package/networks/support/UNTraceConfiguration.js +1 -1
  197. package/package.json +1 -1
  198. package/popup/ExpressionInfo.js +1 -1
  199. package/popup/FieldInfo.js +1 -1
  200. package/popup/content/AttachmentsContent.js +1 -1
  201. package/popup/content/BarChartMediaInfo.js +1 -1
  202. package/popup/content/ColumnChartMediaInfo.js +1 -1
  203. package/popup/content/Content.js +1 -1
  204. package/popup/content/CustomContent.js +1 -1
  205. package/popup/content/ExpressionContent.js +1 -1
  206. package/popup/content/FieldsContent.js +1 -1
  207. package/popup/content/ImageMediaInfo.js +1 -1
  208. package/popup/content/LineChartMediaInfo.js +1 -1
  209. package/popup/content/MediaContent.js +1 -1
  210. package/popup/content/PieChartMediaInfo.js +1 -1
  211. package/popup/content/RelationshipContent.js +1 -1
  212. package/popup/content/TextContent.js +1 -1
  213. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  214. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  215. package/popup/content/mixins/MediaInfo.js +1 -1
  216. package/popup/content.js +1 -1
  217. package/popup/support/FieldInfoFormat.js +1 -1
  218. package/portal/support/layersLoader.js +1 -1
  219. package/request/cors.js +5 -0
  220. package/request/loadImage.js +5 -0
  221. package/request/preferredHosts.js +5 -0
  222. package/request/process.js +5 -0
  223. package/request/queue.js +5 -0
  224. package/request/serviceJSON.js +5 -0
  225. package/request.js +1 -1
  226. package/rest/geometryService/utils.js +1 -1
  227. package/rest/knowledgeGraphService.d.ts +1 -0
  228. package/support/getDefaultUnitForView.js +1 -1
  229. package/support/popupUtils.js +1 -1
  230. package/support/revision.js +1 -1
  231. package/symbols/support/symbolUtils.js +1 -1
  232. package/time/TimeExtent.js +1 -1
  233. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  234. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  235. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  236. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  237. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  238. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  239. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  240. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  241. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  242. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  243. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  244. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  245. package/views/3d/environment/CloudsRenderer.js +1 -1
  246. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  247. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  248. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  249. package/views/3d/layers/FlowSubView3D.js +1 -1
  250. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  253. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  255. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  256. package/views/3d/support/StreamTextureCollection.js +1 -1
  257. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  258. package/views/3d/terrain/TerrainSurface.js +1 -1
  259. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  260. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  261. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  262. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  263. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  264. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  265. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  267. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  268. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  269. package/views/View2D.js +1 -1
  270. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  271. package/views/analysis/ElevationProfile/constants.js +1 -1
  272. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  273. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  274. package/views/draw/DrawOperation.js +1 -1
  275. package/views/magnifier/resources.js +1 -1
  276. package/webdoc/support/webdocSaveUtils.js +1 -1
  277. package/widgets/BasemapLayerList.js +1 -1
  278. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  279. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  280. package/widgets/Editor/EditorViewModel.js +1 -1
  281. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  282. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  283. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  284. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  285. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  286. package/widgets/Editor/UpdateWorkflow.js +1 -1
  287. package/widgets/Editor/Workflow.js +1 -1
  288. package/widgets/Editor/components/FeatureList.js +1 -1
  289. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  290. package/widgets/Editor/components/Notices.js +1 -1
  291. package/widgets/Editor/components/PanelContent.js +1 -1
  292. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  293. package/widgets/Editor/css.js +1 -1
  294. package/widgets/Editor/support/EditorItem.js +1 -1
  295. package/widgets/Editor/support/SketchController.js +1 -1
  296. package/widgets/Editor/support/errors.js +1 -1
  297. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  298. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  299. package/widgets/Editor/workflowUtils.js +1 -1
  300. package/widgets/Editor.js +1 -1
  301. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  302. package/widgets/FeatureForm/FieldInput.js +1 -1
  303. package/widgets/FeatureForm.js +1 -1
  304. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  305. package/widgets/FeatureTable/FieldColumn.js +1 -1
  306. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  307. package/widgets/LayerList.js +1 -1
  308. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  309. package/widgets/Legend/support/utils.js +1 -1
  310. package/widgets/PanoramicVideoViewer.js +1 -1
  311. package/widgets/support/FilterCondition.js +1 -1
  312. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  313. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  314. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  315. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  316. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  317. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  318. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  319. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  320. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  321. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  322. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  323. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  324. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  325. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  326. package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +0 -1
  327. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  328. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  329. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  330. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  331. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  332. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  333. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  334. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  335. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  336. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  337. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  338. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  339. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  340. package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +0 -1
  341. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  342. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  343. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  344. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  345. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  346. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  347. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  348. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  349. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  350. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  351. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  352. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  353. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  354. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  355. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  356. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  357. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  358. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  359. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  360. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  361. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  362. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  363. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  364. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  365. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  366. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  367. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  368. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  369. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  370. package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +0 -1
  371. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  372. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  373. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  374. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  375. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  376. package/processRequest.js +0 -5
  377. package/requestQueue.js +0 -5
  378. package/support/requestPresets.js +0 -5
  379. package/support/requestUtils.js +0 -5
  380. /package/{rest/support → request}/ImageWithType.js +0 -0
  381. /package/{requestConfig.js → request/config.js} +0 -0
  382. /package/{support/requestImageUtils.js → request/image.js} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3299],{83299:(e,t,n)=>{n.r(t),n.d(t,{fromGeometries:()=>me,fromGeometry:()=>le,fromGeometryToGXGeometry:()=>ce,fromSpatialReference:()=>de,getSpatialReference:()=>oe,toGeometry:()=>he});var r=n(55537),i=n(83661),a=n(39117),s=n(95213),o=n(88885),u=n(16930);function m(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function l(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}n(90293);class c{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:m}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:l}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=(0,i.aJ)()&&this.m_currentValue<=(0,i.i)()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;(0,r.d)("unrecognized json element type")}return(0,r.d)("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}isError(){return 0}}class d{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&(0,r.q)("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&(0,r.q)("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void(0,r.d)("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===d.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===d.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||(0,r.p)("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){(0,r.g)(e>=0&&e<=this.m_sz),this.m_sz=e}}function h(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function _(e){let t=!1,n=!1,r=!1,i=!1,s=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=-1,N=-1,T=-1,v=-1,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,O=0,I=0,z="",E="",G=null;for(;3!==e.nextToken();){const a=e.currentString();e.nextToken(),"wkid"===a?t||(t=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestWkid"===a?n||(n=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"wkt"===a?s||(s=!0,6===e.currentToken()&&(z=e.currentString())):"wkt2"===a?s||6===e.currentToken()&&(E=e.currentString()):"vcsWkid"===a?r||(r=!0,8===e.currentToken()&&(T=e.currentInt32Value())):"latestVcsWkid"===a?i||(i=!0,8===e.currentToken()&&(v=e.currentInt32Value())):"xyTolerance"===a?u||(u=!0,o=!0,x=e.currentDoubleValue()):"zTolerance"===a?m||(m=!0,o=!0,A=e.currentDoubleValue()):"mTolerance"===a?l||(l=!0,o=!0,S=e.currentDoubleValue()):"falseX"===a?c||(c=!0,o=!0,F=e.currentDoubleValue()):"falseY"===a?d||(d=!0,o=!0,j=e.currentDoubleValue()):"falseZ"===a?_||(_=!0,o=!0,O=e.currentDoubleValue()):"falseM"===a?f||(f=!0,o=!0,I=e.currentDoubleValue()):"xyUnits"===a?p||(p=!0,o=!0,w=e.currentDoubleValue()):"zUnits"===a?k||(k=!0,o=!0,C=e.currentDoubleValue()):"mUnits"===a?b||(b=!0,o=!0,D=e.currentDoubleValue()):"unit"===a?y||(y=!0,G=h(e)):e.skipChildren()}v<=0&&T>0&&(v=T),T<=0&&v>0&&(T=v);let P=null,B=!0;if(0!==z.length&&(B=!1,(0,a.q)(z)&&(P=(0,a.b)(z))),P||0===E.length||(B=!1,(0,a.q)(E)&&(P=(0,a.b)(E))),!P&&N>0&&(B=!1,(0,a.p)(N)&&(v<=0||(0,a.aX)())&&(P=(0,a.c)(N,v))),!P&&g>0&&(B=!1,(0,a.p)(g)&&(T<=0||(0,a.aX)())&&(P=(0,a.c)(g,T))),B&&(P=(0,a.e)(G)),o&&P){const e=new a.a;P.queryPrecisionDescriptorWithoutFalseXY(e),u&&e.setTolerance(0,x),m&&e.setTolerance(1,A),l&&e.setTolerance(2,S),p&&c&&d&&e.setGridParams(F,j,w),k&&_&&e.setZParams(O,C),b&&f&&e.setMParams(I,D),P=(0,a.f)(P,e)}return P}function f(e,t,n,a){2!==a.currentToken()&&(0,r.a)("failed to parse multipath: array of array of vertices is expected");const u=e?new o.a:new o.P,m=u,l=(0,s.$)(0),c=(0,s.a1)(2,0),d=(0,s.a0)(0);let h=null,_=null,f=null,p=null,k=null,y=0,v=0,x=0;const A=new o.S,S=i.P.getNAN();let w=0,C=0;const D=e?1:0;for(;4!==a.nextToken();){2!==a.currentToken()&&(0,r.a)("failed to parse multipath: ring/path array is expected");let n=2,u=0,F=!0;const j=4;let O=0,I=0;const z=i.P.getNAN(),E=(0,i.d)(j,Number.NaN),G=(0,i.d)(j,Number.NaN);let P=!1;for(a.nextToken();4!==a.currentToken();){if(t&&1===a.currentToken())F&&(0,r.a)("failed to parse multipath: starting vertex array is expected"),f||(f=(0,s.a0)(w-1,1),p=(0,s.$)(w-1,-1),k=(0,s.a1)(0)),P=!0,n=1,({segFlag:x,toPointSz:O}=T(A,E,S,a));else{for(P=!1,2!==a.currentToken()&&(0,r.a)("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),O=0;4!==a.nextToken();)O===j&&(0,r.a)("failed to parse multipath: each vertex array has to have at most 4 elements"),E[O++]=b(a);O<2&&(0,r.a)("failed to parse multipath: each vertex array has to have at least 2 elements"),(0,s.a5)(E[0],E[1])||(0,r.a)("failed to parse multipath: x and y must be finite")}a.nextToken();do{if(c.size()===2*w&&c.resize(g(w)),c.writePoint2D(2*w,z.setCoords(E[0],E[1])),h&&h.size()===w&&h.resize(N(w)),O>2?(h||(h=(0,s.a1)(w+1,Number.NaN)),h.write(w,E[2])):h&&h.write(w,Number.NaN),_&&_.size()===w&&_.resize(N(w)),O>3?(_||(_=(0,s.a1)(w+1,Number.NaN)),_.write(w,E[3])):_&&_.write(w,Number.NaN),F)C++,l.add(w),d.add(D),F=!1,I=O,(0,i.b)(G,E,0,0,I);else if(null!==f)if(P){const e=(0,o.a9)(x),t=k.size();k.resize(t+e),f.add(x),p.add(y),A.get().writeInBufferStream(k,y),y+=e,m.incCurveType(x,1),v++}else f.add(1),p.add(-1);w++,u++,S.setCoords(E[0],E[1])}while(u<n&&4===a.currentToken())}0!==u&&(e&&u>n&&O===I&&0===(0,i.aK)(E,G,O)?(w--,u--):null!==f&&(f.add(1),p.add(-1)))}return w&&(l.resize(C),d.resize(C),w>0&&(l.add(w),d.add(0)),m.setAttributeStreamRef(0,c),m.setPathFlagsStreamRef(d),m.setPathStreamRef(l),null!==f&&(m.updateCurveCounter(v),m.setSegmentData(p,k,f,y)),m.notifyModifiedFlags(65535)),{geometry:u,as:h,bs:_}}function p(e,t){2!==t.currentToken()&&(0,r.a)("failed to parse multipoint: array of vertices is expected");let n=0;const a=new o.M,u=(0,s.a1)(2,0);let m=0;const l=(0,i.d)(4,Number.NaN),c=new i.P;let d=null,h=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&(0,r.a)("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),m=0;4!==t.nextToken();)4===m&&(0,r.a)("failed to parse multipoint: each vertex array has to have at most 4 elements"),l[m++]=b(t);m<2&&(0,r.a)("failed to parse multipoint: each vertex array has to have at least 2 elements"),(0,s.a5)(l[0],l[1])||(0,r.a)("failed to parse multipoint: x and y must be finite"),u.size()===2*n&&u.resize(g(n)),u.writePoint2D(2*n,c.setCoords(l[0],l[1])),d&&d.size()===n&&d.resize(N(n)),m>2?(d||(d=(0,s.a1)(n+1,Number.NaN)),d.write(n,l[2])):d&&d.write(n,Number.NaN),h&&h.size()===n&&h.resize(N(n)),m>3?(h||(h=(0,s.a1)(n+1,Number.NaN)),h.write(n,l[3])):h&&h.write(n,Number.NaN),n++}if(n){const e=a.getImpl();e.setAttributeStreamRef(0,u),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:a,as:d,bs:h}}function k(e,t){2!==t.currentToken()&&(0,r.a)("failed to parse array of IDs: array of array of integers is expected");const n=(0,s.a6)(2,0);let i=0,a=-1;for(;4!==t.nextToken();){const e=i;n.size()===i&&n.resize(N(i)),i++;let s=0;for(-1===a?a=2===t.currentToken()?1:0:1===a&&2!==t.currentToken()&&(0,r.a)("failed to parse array of IDs: array of array of integers is expected"),0===a&&(n.size()===i&&n.resize(N(i)),n.write(i,y(t)),s++,i++);4!==t.nextToken();)n.size()===i&&n.resize(N(i)),n.write(i,y(t)),s++,i++;if(n.write(e,s),0===a)break}return n.resize(i),n}function b(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function y(e){return e.currentInt32Value()}function g(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function N(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function T(e,t,n,a,s){const u={segFlag:0,toPointSz:0};let m=a.currentToken();m=a.nextToken();const l=a.currentString(),c=l[0];for((1!==l.length||"a"!==c&&"b"!==c&&"c"!==c&&"n"!==c&&"q"!==c)&&(0,r.a)('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for curve parameters"),m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for to point"),u.toPointSz=0;4!==a.nextToken();)4===u.toPointSz&&(0,r.a)("failed to parse curve: vertex array cannot have more than 4 elements"),t[u.toPointSz++]=b(a);u.toPointSz<2&&(0,r.a)("failed to parse curve: vertex array must have at least 2 elements");const h=i.P.construct(t[0],t[1]),_=i.P.getNAN();let f=-1,p=-1,k=!1,y=Number.NaN,g=Number.NaN,N=Number.NaN;const T=[i.P.getNAN(),i.P.getNAN(),i.P.getNAN()],x=i.P.getNAN();if("a"===c){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for center point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for center point"),_.setCoords(e,t),m=a.nextToken(),f=a.currentInt32Value(),m=a.nextToken(),p=a.currentInt32Value(),m=a.nextToken(),4!==m?(k=!1,y=b(a),m=a.nextToken(),g=b(a),m=a.nextToken(),N=b(a),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters")):k=!0,u.segFlag=4}else if("b"===c){for(let e=0;e<2;e++){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[e].setCoords(t,n)}m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=2}else if("n"===c){{m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[0].setCoords(e,t)}m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);T[1].setCoords(e,t),T[2].setCoords(n,n),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=8}else if("q"===c){for(let e=0;e<1;e++){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[e].setCoords(t,n)}m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=16}else{m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for interior point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for interior point"),x.setCoords(e,t),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=4}if(m=a.nextToken(),3!==m&&(0,r.a)("failed to parse curve: end object is expected for curve"),"a"===c)if(e.createEllipticArc(),k){const t=!0;v(e.get(),n,h,_,t,f,p)}else!function(e,t,n,r,i,a,s,u,m){e.dropAllAttributes();const l=new ArrayBuffer(44),c=new d({sz:44,buffer:l});let h=0;c.writeDouble(h,r.x),h+=8,c.writeDouble(h,r.y),h+=8,c.writeDouble(h,s),h+=8,c.writeDouble(h,u),h+=8,c.writeDouble(h,m),h+=8;let _=0;a||(_|=2048),i&&(_|=4096),c.writeInt32(h,_),h+=4,function(e,t,n,r){e.m_bits=0,e.m_center.x=r.readDouble(0),e.m_center.y=r.readDouble(8),e.m_rotation=r.readDouble(16),e.m_semiMajorAxis=r.readDouble(24),e.m_minorMajorRatio=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const i=r.readInt32(40);if(1&i)return!1;let a=!!(64&i),s=!!(128&i);const u=!!(2048&i),m=!!(4096&i);!(512&i)&&!(1024&i)||s||(a=!0),s&&!t.equals(n)?(s=!1,a=!0):a&&t.equals(n)&&(s=!0,a=!1),s?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,(0,o.a8)(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),(0,o.a6)(e)}(e,t,n,c)}(e.get(),n,h,_,f,p,y,g,N);else if("b"===c)e.createCubicBezier(),function(e,t,n,a){e.dropAllAttributes();const s=new ArrayBuffer(32),o=new d({sz:32,buffer:s});let u=0;o.writeDouble(u,a[0].x),u+=8,o.writeDouble(u,a[0].y),u+=8,o.writeDouble(u,a[1].x),u+=8,o.writeDouble(u,a[1].y),u+=8,function(e,t,n,a){(0,r.g)(32<=a.size()),e.m_cp=(0,i.m)(i.P,2),e.m_cp[0].x=a.readDouble(0),e.m_cp[0].y=a.readDouble(8),e.m_cp[1].x=a.readDouble(16),e.m_cp[1].y=a.readDouble(24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,o)}(e.get(),n,h,T);else if("n"===c)e.createQuadraticRationalBezier(),function(e,t,n,r,i,a,s){e.dropAllAttributes();const o=new ArrayBuffer(40),u=new d({sz:40,buffer:o});let m=0;u.writeDouble(m,r.x),m+=8,u.writeDouble(m,r.y),m+=8,u.writeDouble(m,i),m+=8,u.writeDouble(m,a),m+=8,u.writeDouble(m,s),m+=8,function(e,t,n,r){e.m_cp.x=r.readDouble(0),e.m_cp.y=r.readDouble(8),e.m_weights[0]=r.readDouble(16),e.m_weights[1]=r.readDouble(24),e.m_weights[2]=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,u)}(e.get(),n,h,T[0],T[1].x,T[1].y,T[2].x);else if("q"===c)e.createQuadraticBezier(),e.get().construct(n,T[0],h);else{e.createEllipticArc();const t=!1;v(e.get(),n,h,x,t,-1,-1)}return u}function v(e,t,n,a,s,u,m){e.dropAllAttributes();const l=new ArrayBuffer(20),c=new d({sz:20,buffer:l});let h=0;c.writeDouble(h,a.x),h+=8,c.writeDouble(h,a.y),h+=8;let _=0;s?(m||(_|=8),u&&(_|=16)):_|=128,c.writeInt32(h,_),h+=4,function(e,t,n,a){0>=a.size()&&(0,r.q)("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const s=i.P.getNAN();s.x=a.readDouble(0),s.y=a.readDouble(8);const u=a.readInt32(16);if(1&u)return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),!1;let m=!!(64&u);const l=!!(128&u);let c=!!(32&u);const d=!!(8&u),h=!!(16&u),_=t.equals(n);m&&!_&&(m=!1,c=!0),c&&_&&(m=!0,c=!1,s.setCoords(0,0)),m||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,s),_&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),e.queryCoord2D(.5,e.m_interior)):(0,o.a7)(e,t,n,s,d,h)),m&&(e.m_center.assign(t),e.m_startAngle=s.x,e.m_sweepAngle=s.y,(0,o.a8)(e,Number.NaN,d,h),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),(0,o.a6)(e)}(e,t,n,c)}function x(e,t,n,i,a){const s=e.getGeometryType();if(s===r.G.enumEllipticArc)return function(e,t,n,i,a){(0,r.g)(!(0,o.a5)(e));const s=e.getEndXY(),u=e.hasAttribute(1)&&!t,m=e.hasAttribute(2)&&!n;let l=Number.NaN,c=Number.NaN;if(u&&(l=e.getEndAttributeAsDbl(1,0)),m&&(c=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return S(u,m,s.x,s.y,l,c,i,a),!0;const d=0===e.projectionBehavior(),h=!!d&&e.isClosed();if(d&&!h)a.startObject(),a.addFieldName("c"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a),w(e.m_interior.x,e.m_interior.y,17,a),a.endArray(),a.endObject();else if(d){a.startObject(),a.addFieldName("a"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a);const t=0,n=0;w(e.m_center.x+t,e.m_center.y+n,17,a);const r=!e.isMajor();a.addInt32(r?1:0);const o=e.isClockwise();a.addInt32(o?1:0),a.endArray(),a.endObject()}else{a.startObject(),a.addFieldName("a"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a);const t=e;w(t.m_center.x,t.m_center.y,17,a);const n=!t.isMajor();a.addInt32(n?1:0);const r=t.isClockwise();a.addInt32(r?1:0),a.addDouble(t.m_rotation,17),a.addDouble(t.m_semiMajorAxis,17),a.addDouble(t.m_minorMajorRatio,17),a.endArray(),a.endObject()}return!1}(e,t,n,i,a);if(s===r.G.enumBezier)return A(e,t,n,i,a);if(s===r.G.enumRationalBezier2)return function(e,t,n,r,i){const a=e.getEndXY(),s=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;s&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),S(s,o,a.x,a.y,u,m,r,i),w(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}(e,t,n,i,a);if(s===r.G.enumBezier2){const r=new o.N;return r.constructFromQuadraticSegment(e),A(r,t,n,i,a)}(0,r.t)("")}function A(e,t,n,r,i){const a=e.getEndXY(),s=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return s&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),S(s,o,a.x,a.y,u,m,r,i),w(e.m_cp[0].x,e.m_cp[0].y,r,i),w(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function S(e,t,n,r,i,a,s,o){o.startArray(),o.addDouble(n,s),o.addDouble(r,s),e&&o.addDouble(i,s),t&&o.addDouble(a,s),o.endArray()}function w(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}function C(e,t,n,i){const a=n.getImpl(),u=!!(2&t),m=!!(4&t),l=!!(8&t),c=a.hasAttribute(1)&&!u,d=a.hasAttribute(2)&&!m,h=a.hasAttribute(3)&&!l,_=a.hasNonLinearSegments();c&&(i.addFieldName("hasZ"),i.addBool(!0)),d&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let f=null;const p=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const l=n.getPathCount();let k=0;const b=a.getAttributeStreamRef(0);let y=null,g=null,N=null;const T=new o.S;let v=null,A=null,S=null;_&&(v=a.getSegmentFlagsStreamRef(),A=a.getSegmentIndexStreamRef(),S=a.getSegmentDataStreamRef()),c&&(y=a.getAttributeStreamRef(1)),d&&(g=a.getAttributeStreamRef(2)),h&&(N=a.getAttributeStreamRef(3),f=(0,s.Y)(3,0));for(let t=0;t<l;t++){i.startArray(),h&&p.push(0);const a=n.getPathEnd(t);if(k===a){i.endArray();continue}const s=n.isClosedPath(t);let o=b.read(2*k),l=b.read(2*k+1),_=c?y.read(k):Number.NaN,w=d?g.read(k):Number.NaN,C=h?N.read(k):0;D(c,d,o,l,_,w,e,i);let F=1;h&&(f.add(C),p[p.length-1]++);const j=o,O=l,I=_,z=w,E=C;let G=!1,P=0,B=Number.NaN,R=Number.NaN,V=0;for(let t=k+1,n=k,M=s?a+1:a;t<M;t++,n++){const s=null!==v?31&v.read(n):1;let k,M;if(t<a?(k=b.read(2*t),M=b.read(2*t+1),c&&(B=y.read(t)),d&&(R=g.read(t)),h&&(V=N.read(t))):(k=j,M=O,B=I,R=z,V=E),1!==s){G=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():(0,r.t)("JSON export.unsupported curve");const t=T.get(),a=A.read(n);t.setStartXYCoords(o,l),t.setEndXYCoords(k,M),c&&(t.setStartAttribute(1,0,_),t.setEndAttribute(1,0,B)),d&&(t.setStartAttribute(2,0,w),t.setEndAttribute(2,0,R)),t.readFromBufferStream(S,a),x(T.get(),u,m,e,i)&&P++}else D(c,d,k,M,B,R,e,i);h&&(f.add(V),p[p.length-1]++),F++,o=k,l=M,_=B,w=R,C=V}G&&0===P||(F<2&&P<1&&(D(c,d,o,l,_,w,e,i),F++,h&&(f.add(C),p[p.length-1]++)),s&&F<3&&P<2&&(D(c,d,j,O,I,z,e,i),F++,o=j,l=O,_=I,w=z,C=E,h&&(f.add(E),p[p.length-1]++))),i.endArray(),k=a}i.endArray()}if(h){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=p.length;t<n;++t){const n=p[t];(0,r.g)(0===n||null!==f&&e+n<=f.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(f.read(e)),e++;i.endArray()}i.endArray()}}function D(e,t,n,r,i,a,s,o){o.startArray(),o.addDouble(n,s),o.addDouble(r,s),e&&o.addDouble(i,s),t&&o.addDouble(a,s),o.endArray()}const F="a".charCodeAt(0),j="A".charCodeAt(0),O="*".charCodeAt(0),I="b".charCodeAt(0),z="\\".charCodeAt(0),E="[".charCodeAt(0),G="{".charCodeAt(0),P=":".charCodeAt(0),B=".".charCodeAt(0),R=",".charCodeAt(0),V='"'.charCodeAt(0),M="]".charCodeAt(0),U="}".charCodeAt(0),W="e".charCodeAt(0),X="E".charCodeAt(0),Y="f".charCodeAt(0),L="F".charCodeAt(0),q="/".charCodeAt(0),K="-".charCodeAt(0),J="+".charCodeAt(0),Z="n".charCodeAt(0),H="N".charCodeAt(0),Q="r".charCodeAt(0),$="t".charCodeAt(0),ee="u".charCodeAt(0),te="0".charCodeAt(0),ne="9".charCodeAt(0);class re{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?(0,r.t)("streaming json parsing not yet impl"):(0,r.d)("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);return this.m_endToken+=e-1,{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){(0,r.t)("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){(0,r.t)("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return(0,r.g)(0),""}childrenAsString(){return(0,r.g)(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}(0,r.a)("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===z&&t.charCodeAt(r+1)===ee;)n++,r+=6;r=e;const i=new Uint8Array(n);let a=0;for(;t.charCodeAt(r)===z&&t.charCodeAt(r+1)===ee;)i[a++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let a=t;a<n;a++)if(i.charCodeAt(a)!==z)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++a)){case V:e+='"';break;case ee:{const{u8s:t,end:n}=this.toUTF8_(a-1,i);a=n-1,e+=t;break}case z:e+="\\";break;case q:e+="/";break;case I:e+="\b";break;case Y:e+="\f";break;case Z:e+="\n";break;case Q:e+="\r";break;case $:e+="\t"}t=a+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){return 5!==this.m_currentTokenType&&6!==this.m_currentTokenType?this.currentTerminalAsString_():this.m_bHasEscapes?this.unquoteCurrentString_():this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&(0,r.a)("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&(0,r.a)("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&(0,r.a)("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&(0,r.a)("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&(0,r.a)("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&(0,r.a)("invalid token"),n}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return(0,r.g)(0),!1}isError(){return 0}JSONString(){return(0,r.g)(0),""}pushPosition(){return(0,r.g)(0),!1}popPosition(){return(0,r.g)(0),!1}skipCStyleComments_(){(0,r.g)(0)}skipCppStyleComments_(){(0,r.g)(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e===O?this.skipCStyleComments_():e===q?this.skipCppStyleComments_():(0,r.a)("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&(0,r.a)("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&(0,r.a)("invalid token"),t=this.m_peekChar();t===q?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===M&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===U&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token");let e=this.m_peekChar();for(;e!==V;){const t=e===z;if(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===V||e===z||e===q||e===I||e===Y||e===Z||e===Q||e===$)this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar();else if(e===ee)for(let t=0;t<4;t++)this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e>=te&&e<=ne||e>=F&&e<=Y||e>=j&&e<=L||(0,r.a)("invalid token");else(0,r.a)("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===R&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===P&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):(0,r.a)("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken,this.m_peekChar()!==V&&(0,r.a)("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():(0,r.a)("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():(0,r.a)("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==te?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar()}while(e>=te&&e<=ne)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e>=te&&e<=ne||(0,r.a)("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e!==J&&e!==K||(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar()),e>=te&&e<=ne||(0,r.a)("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===K?(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),t=this.m_peekChar(),e=!0,t>=te&&t<=ne||(0,r.a)("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===B)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==W&&t!==X||this.exp_();else if(t===W||t===X)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.a)("invalid token"),"null"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.a)("invalid token"),"true"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&(0,r.a)("invalid token"),"false"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&(0,r.a)("invalid token"),"NaN"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===G?this.valueStartObject_():e===E?this.valueStartArray_():e===V?this.valueString_():e===K||e>=te&&e<=te+9?this.valueNumber_():e===Z?this.valueNull_():e===$?this.valueTrue_():e===Y?this.valueFalse_():e===H?this.valueNan_():(0,r.a)("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==G&&e!==E&&(0,r.a)("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}const ie=new class{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){(0,r.g)(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}},ae=new class{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,s,o){!function(e,t,n,i){if(t||n){if(i.startObject(),null!==t)switch(t.getGeometryType()){case r.G.enumPolygon:C(!0,e,t,i);break;case r.G.enumPolyline:C(!1,e,t,i);break;case r.G.enumMultiPoint:!function(e,t,n){const i=t.getImpl(),a=i.hasAttribute(1)&&!(2&e),s=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);a&&(n.addFieldName("hasZ"),n.addBool(!0)),s&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;a&&(o=i.getAttributeStreamRef(1)),s&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;a&&(l=o.read(e)),s&&(c=m.read(e)),D(a,s,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),(0,r.g)(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}(e,t,i);break;case r.G.enumPoint:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),a=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(a&&(n.addFieldName("id"),n.addInt32(0)));const s=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),s),n.addFieldName("y"),n.addDouble(t.getY(),s),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),s)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),s)),a&&(n.addFieldName("id"),n.addInt32(t.getID()))}(e,t,i);break;case r.G.enumEnvelope:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),a=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(a&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const s=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),s),n.addFieldName("ymin"),n.addDouble(t.getYMin(),s),n.addFieldName("xmax"),n.addDouble(t.getXMax(),s),n.addFieldName("ymax"),n.addDouble(t.getYMax(),s),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,s),n.addFieldName("zmax"),n.addDouble(e.vmax,s)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,s),n.addFieldName("mmax"),n.addDouble(e.vmax,s)}if(a){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}(e,t,i);break;case r.G.enumMultipatch:(0,r.g)(0);break;default:(0,r.d)("exportToJSON")}null!==n&&(i.addFieldName("spatialReference"),function(e,t,n){n.startObject();let i=0;t.isCustomWkid()||(i=t.getOldID());let s=0;const o=t.getVCS();if(null!==o&&(o.isCustomWkid()||(s=o.getOldID()),s<=0&&(i=0)),i>0){n.addFieldName("wkid"),n.addInt32(i);const e=t.getLatestID();if(e>0&&e!==i&&(n.addFieldName("latestWkid"),n.addInt32(e)),s>0){n.addFieldName("vcsWkid"),n.addInt32(s);const e=t.getLatestVerticalID();e!==s&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),function(e,t,n){n.startObject();const i=t.getID();i<=0&&(0,r.a)("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(i),n.endObject()}(0,t.getUnit(),n));else if(i<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new a.a;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}(e,n,i)),i.endObject()}}(e,t,n,i)}exportSpatialReference(e,t,n,i){(0,r.g)(0)}exportProjectionTransformation(e,t,n,i){(0,r.g)(0)}exportDatumTransformation(e,t,n,i){(0,r.g)(0)}static geometryTypeToString(e){return(0,r.g)(0),""}},se=new class{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,u,m,l){let c;"string"==typeof n?(c=new re({jsonString:n}),c.nextToken()):c=n,1!==c.currentToken()&&(0,r.a)("failed to import map geometry: start of object is expected");const d=function(e,t,n,i,a){let u=!1,m=!1,l=!1,c=!1,d=!1,h=!1,g=!1,N=!1,T=!1,v=!1,x=!1,A=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,I=!1,z=!1,E=!1,G=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Z=Number.NaN,H=0,Q=0,$=!1,ee=!1,te=null,ne=null,re=null,ie=null,ae=null;for(;3!==n.nextToken();){const t=n.currentString();if(n.nextToken(),"spatialReference"===t){if(a&&!u){u=!0,1===n.currentToken()?ie=_(n):10!==n.currentToken()&&(0,r.a)("failed to parse spatial reference: object or null is expected");continue}}else if(i)if("hasZ"===t){if(!m){m=!0,$=11===n.currentToken();continue}}else if("hasM"===t){if(!l){l=!0,ee=11===n.currentToken();continue}}else if("rings"===t){if(!(d||h||e!==r.G.enumUnknown&&e!==r.G.enumPolygon)){d=!0,({geometry:ae,as:te,bs:ne}=f(!0,!1,0,n));continue}}else if("curveRings"===t){if(!h&&(e===r.G.enumUnknown||e===r.G.enumPolygon)){h=!0,({geometry:ae,as:te,bs:ne}=f(!0,!0,0,n));continue}}else if("paths"===t){if(!(g||N||e!==r.G.enumUnknown&&e!==r.G.enumPolyline)){g=!0,({geometry:ae,as:te,bs:ne}=f(!1,!1,0,n));continue}}else if("curvePaths"===t){if(!N&&(e===r.G.enumUnknown||e===r.G.enumPolyline)){N=!0,({geometry:ae,as:te,bs:ne}=f(!1,!0,0,n));continue}}else if("points"===t){if(!T&&(e===r.G.enumUnknown||e===r.G.enumMultiPoint)){T=!0,({geometry:ae,as:te,bs:ne}=p(0,n));continue}}else if("ids"===t){if(!c){c=!0,re=k(0,n);continue}}else if("x"===t){if(!v&&(e===r.G.enumUnknown||e===r.G.enumPoint)){v=!0,B=b(n);continue}}else if("y"===t){if(!x&&(e===r.G.enumUnknown||e===r.G.enumPoint)){x=!0,R=b(n);continue}}else if("z"===t){if(!A&&(e===r.G.enumUnknown||e===r.G.enumPoint)){A=!0,V=b(n);continue}}else if("m"===t){if(!S&&(e===r.G.enumUnknown||e===r.G.enumPoint)){S=!0,M=b(n);continue}}else if("id"===t){if(!w&&(e===r.G.enumUnknown||e===r.G.enumPoint)){w=!0,U=y(n);continue}}else if("xmin"===t){if(!C&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){C=!0,W=b(n);continue}}else if("ymin"===t){if(!D&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){D=!0,X=b(n);continue}}else if("mmin"===t){if(!z&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){z=!0,J=b(n);continue}}else if("zmin"===t){if(!O&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){O=!0,q=b(n);continue}}else if("idmin"===t){if(!G&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){G=!0,H=y(n);continue}}else if("xmax"===t){if(!F&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){F=!0,Y=b(n);continue}}else if("ymax"===t){if(!j&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){j=!0,L=b(n);continue}}else if("mmax"===t){if(!E&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){E=!0,Z=b(n);continue}}else if("zmax"===t){if(!I&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){I=!0,K=b(n);continue}}else if("idmax"===t){if(!P&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){P=!0,Q=y(n);continue}}else"materials"===t&&(0,r.g)(0);n.skipChildren()}if(d||h||g||N||T){let e=null,t=null;const n=ae;$&&(ae.addAttribute(1),e=te,e||(e=(0,s.a1)(n.getPointCount(),Number.NaN))),ee&&(ae.addAttribute(2),t=$?ne:te),null!=re&&ae.addAttribute(3),$&&null!=e&&n.setAttributeStreamRef(1,e),ee&&null!=t&&n.setAttributeStreamRef(2,t),null!=re&&function(e,t){if(e.isEmpty())return;const n=(0,s.a6)(2,0),i=e.getGeometryType();let a=0;i===o.M.type?a=1:i===o.P.type||i===o.a.type?a=e.getPathCount():(0,r.d)("not implemented"),n.resize(e.getPointCount(),0);let u=0;for(let s=0;s<a;++s){const a=t.read(u);u++;const m=u+a;let l=0,c=0;i===o.M.type?l=e.getPointCount():i===o.P.type||i===o.a.type?(l=e.getPathSize(s),c=e.getPathStart(s)):(0,r.d)("not implemented");for(let e=0,r=Math.min(a,l);e<r;++e)n.write(c,t.read(u)),u++,c++;u=m}e.getImpl().setAttributeStreamRef(3,n)}(n,re)}else if(v||x||S||A||w){(0,s.a4)(B,R)||(0,r.a)("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new s.P({x:B,y:R});A&&e.setZ(V),S&&e.setM(M),w&&e.setID(U),ae=e}else if(C||D||F||j||O||I||z||E||G||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new s.E({xmin:W,ymin:X,xmax:Y,ymax:L});O&&I&&e.setInterval(1,0,q,K),z&&E&&e.setInterval(2,0,J,Z),G&&P&&e.setInterval(3,0,H,Q),ae=e}return{...ae?{geom:ae}:{},...ie?{sr:ie}:{}}}(t,0,c,i,u);return new a.aY(d)}importSpatialReference(e){const t=_(e);return null===t&&(0,r.d)("failed to import spatial reference"),t}importProjectionTransformation(e,t){return(0,r.g)(0),{}}importDatumTransformation(e,t){return(0,r.g)(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||(0,r.a)("string_to_geometry_type"),e.endsWith("point")?r.G.enumPoint:e.endsWith("envelope")?r.G.enumEnvelope:e.endsWith("multipoint")?r.G.enumMultiPoint:e.endsWith("polyline")?r.G.enumPolyline:e.endsWith("polygon")?r.G.enumPolygon:void(0,r.a)("string_to_geometry_type")}};function oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function ue(e,t){const{includeGeometry:n=!0,includeSpatialReference:i=!0}=t??{};i&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const a=new c(e,{strict:!1});return a.nextToken(),se.execute(0,r.G.enumUnknown,a,n,i)}function me(e){let t=null;return[e.map(e=>{if(null==t){const n=le(e);return t=n.getSpatialReference(),n.getGeometry()}return ce(e)}),t]}function le(e){return e.spatialReference instanceof u.A&&(e={...e,spatialReference:e.spatialReference.toJSON()}),ue(e)}function ce(e){return ue(e,{includeSpatialReference:!1}).getGeometry()}function de(e){return e instanceof u.A&&(e=e.toJSON()),ue({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function he(e,t){return e instanceof a.aY&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(ie.reset(),ae.execute(0,e,t,ie),ie.getObject())}},90293:(e,t,n)=>{n(79187),n(55537),n(88885),n(95213),n(83661);var r=n(39117),i=n(83047),a=n(21325);(0,r.k)()||(0,r.l)(e=>{let t,n;"number"==typeof e?t=e:n=e;const r={wkid:t,wkt:n};let s,o;if(n){s=(0,i.x1)(n);const e=(0,a.EA)(r);if(!s&&!e)throw new Error(`Unsupported WKT type: ${n}`)}else s=!(0,a.EA)(r);return o=t&&i.yD.has(t)?Math.PI/200:s?(0,i.Ao)(r):Math.PI/180,{isPCS:s,metersOrRadiansPerUnit:o,semiMajor:0,wkidOrWkt:e}})}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3299],{83299:(e,t,n)=>{n.r(t),n.d(t,{fromGeometries:()=>me,fromGeometry:()=>le,fromGeometryToGXGeometry:()=>ce,fromSpatialReference:()=>de,getSpatialReference:()=>oe,toGeometry:()=>he});var r=n(55537),i=n(83661),a=n(39117),s=n(95213),o=n(88885),u=n(16930);function m(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function l(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}n(90293);class c{createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:m}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:l}}constructor(e,t){this.m_currentToken=0,this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=(0,i.aJ)()&&this.m_currentValue<=(0,i.i)()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;(0,r.d)("unrecognized json element type")}return(0,r.d)("unrecognized json element type"),0}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&(0,r.a)("invalid token"),this.m_currentValue}isError(){return 0}}class d{constructor(e){return this.m_buffer=null,this.m_view=null,this.m_sz=0,this.m_offset=0,this.m_bOwnsBuffer=!0,this.m_bLittleEndian=!0,this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&(0,r.q)("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&(0,r.q)("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void(0,r.d)("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===d.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===d.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||(0,r.p)("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){(0,r.g)(e>=0&&e<=this.m_sz),this.m_sz=e}}function h(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function _(e){let t=!1,n=!1,r=!1,i=!1,s=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,f=!1,p=!1,k=!1,b=!1,y=!1,g=-1,N=-1,T=-1,v=-1,x=0,A=0,S=0,w=0,C=0,D=0,F=0,j=0,O=0,I=0,z="",E="",G=null;for(;3!==e.nextToken();){const a=e.currentString();e.nextToken(),"wkid"===a?t||(t=!0,8===e.currentToken()&&(g=e.currentInt32Value())):"latestWkid"===a?n||(n=!0,8===e.currentToken()&&(N=e.currentInt32Value())):"wkt"===a?s||(s=!0,6===e.currentToken()&&(z=e.currentString())):"wkt2"===a?s||6===e.currentToken()&&(E=e.currentString()):"vcsWkid"===a?r||(r=!0,8===e.currentToken()&&(T=e.currentInt32Value())):"latestVcsWkid"===a?i||(i=!0,8===e.currentToken()&&(v=e.currentInt32Value())):"xyTolerance"===a?u||(u=!0,o=!0,x=e.currentDoubleValue()):"zTolerance"===a?m||(m=!0,o=!0,A=e.currentDoubleValue()):"mTolerance"===a?l||(l=!0,o=!0,S=e.currentDoubleValue()):"falseX"===a?c||(c=!0,o=!0,F=e.currentDoubleValue()):"falseY"===a?d||(d=!0,o=!0,j=e.currentDoubleValue()):"falseZ"===a?_||(_=!0,o=!0,O=e.currentDoubleValue()):"falseM"===a?f||(f=!0,o=!0,I=e.currentDoubleValue()):"xyUnits"===a?p||(p=!0,o=!0,w=e.currentDoubleValue()):"zUnits"===a?k||(k=!0,o=!0,C=e.currentDoubleValue()):"mUnits"===a?b||(b=!0,o=!0,D=e.currentDoubleValue()):"unit"===a?y||(y=!0,G=h(e)):e.skipChildren()}v<=0&&T>0&&(v=T),T<=0&&v>0&&(T=v);let P=null,B=!0;if(0!==z.length&&(B=!1,(0,a.q)(z)&&(P=(0,a.b)(z))),P||0===E.length||(B=!1,(0,a.q)(E)&&(P=(0,a.b)(E))),!P&&N>0&&(B=!1,(0,a.p)(N)&&(v<=0||(0,a.aX)())&&(P=(0,a.c)(N,v))),!P&&g>0&&(B=!1,(0,a.p)(g)&&(T<=0||(0,a.aX)())&&(P=(0,a.c)(g,T))),B&&(P=(0,a.e)(G)),o&&P){const e=new a.a;P.queryPrecisionDescriptorWithoutFalseXY(e),u&&e.setTolerance(0,x),m&&e.setTolerance(1,A),l&&e.setTolerance(2,S),p&&c&&d&&e.setGridParams(F,j,w),k&&_&&e.setZParams(O,C),b&&f&&e.setMParams(I,D),P=(0,a.f)(P,e)}return P}function f(e,t,n,a){2!==a.currentToken()&&(0,r.a)("failed to parse multipath: array of array of vertices is expected");const u=e?new o.a:new o.P,m=u,l=(0,s.$)(0),c=(0,s.a1)(2,0),d=(0,s.a0)(0);let h=null,_=null,f=null,p=null,k=null,y=0,v=0,x=0;const A=new o.S,S=i.P.getNAN();let w=0,C=0;const D=e?1:0;for(;4!==a.nextToken();){2!==a.currentToken()&&(0,r.a)("failed to parse multipath: ring/path array is expected");let n=2,u=0,F=!0;const j=4;let O=0,I=0;const z=i.P.getNAN(),E=(0,i.d)(j,Number.NaN),G=(0,i.d)(j,Number.NaN);let P=!1;for(a.nextToken();4!==a.currentToken();){if(t&&1===a.currentToken())F&&(0,r.a)("failed to parse multipath: starting vertex array is expected"),f||(f=(0,s.a0)(w-1,1),p=(0,s.$)(w-1,-1),k=(0,s.a1)(0)),P=!0,n=1,({segFlag:x,toPointSz:O}=T(A,E,S,a));else{for(P=!1,2!==a.currentToken()&&(0,r.a)("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),O=0;4!==a.nextToken();)O===j&&(0,r.a)("failed to parse multipath: each vertex array has to have at most 4 elements"),E[O++]=b(a);O<2&&(0,r.a)("failed to parse multipath: each vertex array has to have at least 2 elements"),(0,s.a5)(E[0],E[1])||(0,r.a)("failed to parse multipath: x and y must be finite")}a.nextToken();do{if(c.size()===2*w&&c.resize(g(w)),c.writePoint2D(2*w,z.setCoords(E[0],E[1])),h&&h.size()===w&&h.resize(N(w)),O>2?(h||(h=(0,s.a1)(w+1,Number.NaN)),h.write(w,E[2])):h&&h.write(w,Number.NaN),_&&_.size()===w&&_.resize(N(w)),O>3?(_||(_=(0,s.a1)(w+1,Number.NaN)),_.write(w,E[3])):_&&_.write(w,Number.NaN),F)C++,l.add(w),d.add(D),F=!1,I=O,(0,i.b)(G,E,0,0,I);else if(null!==f)if(P){const e=(0,o.a9)(x),t=k.size();k.resize(t+e),f.add(x),p.add(y),A.get().writeInBufferStream(k,y),y+=e,m.incCurveType(x,1),v++}else f.add(1),p.add(-1);w++,u++,S.setCoords(E[0],E[1])}while(u<n&&4===a.currentToken())}0!==u&&(e&&u>n&&O===I&&0===(0,i.aK)(E,G,O)?(w--,u--):null!==f&&(f.add(1),p.add(-1)))}return w&&(l.resize(C),d.resize(C),w>0&&(l.add(w),d.add(0)),m.setAttributeStreamRef(0,c),m.setPathFlagsStreamRef(d),m.setPathStreamRef(l),null!==f&&(m.updateCurveCounter(v),m.setSegmentData(p,k,f,y)),m.notifyModifiedFlags(65535)),{geometry:u,as:h,bs:_}}function p(e,t){2!==t.currentToken()&&(0,r.a)("failed to parse multipoint: array of vertices is expected");let n=0;const a=new o.M,u=(0,s.a1)(2,0);let m=0;const l=(0,i.d)(4,Number.NaN),c=new i.P;let d=null,h=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&(0,r.a)("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),m=0;4!==t.nextToken();)4===m&&(0,r.a)("failed to parse multipoint: each vertex array has to have at most 4 elements"),l[m++]=b(t);m<2&&(0,r.a)("failed to parse multipoint: each vertex array has to have at least 2 elements"),(0,s.a5)(l[0],l[1])||(0,r.a)("failed to parse multipoint: x and y must be finite"),u.size()===2*n&&u.resize(g(n)),u.writePoint2D(2*n,c.setCoords(l[0],l[1])),d&&d.size()===n&&d.resize(N(n)),m>2?(d||(d=(0,s.a1)(n+1,Number.NaN)),d.write(n,l[2])):d&&d.write(n,Number.NaN),h&&h.size()===n&&h.resize(N(n)),m>3?(h||(h=(0,s.a1)(n+1,Number.NaN)),h.write(n,l[3])):h&&h.write(n,Number.NaN),n++}if(n){const e=a.getImpl();e.setAttributeStreamRef(0,u),e.resizeNoInit(n),e.notifyModifiedFlags(65535)}return{geometry:a,as:d,bs:h}}function k(e,t){2!==t.currentToken()&&(0,r.a)("failed to parse array of IDs: array of array of integers is expected");const n=(0,s.a6)(2,0);let i=0,a=-1;for(;4!==t.nextToken();){const e=i;n.size()===i&&n.resize(N(i)),i++;let s=0;for(-1===a?a=2===t.currentToken()?1:0:1===a&&2!==t.currentToken()&&(0,r.a)("failed to parse array of IDs: array of array of integers is expected"),0===a&&(n.size()===i&&n.resize(N(i)),n.write(i,y(t)),s++,i++);4!==t.nextToken();)n.size()===i&&n.resize(N(i)),n.write(i,y(t)),s++,i++;if(n.write(e,s),0===a)break}return n.resize(i),n}function b(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function y(e){return e.currentInt32Value()}function g(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function N(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function T(e,t,n,a,s){const u={segFlag:0,toPointSz:0};let m=a.currentToken();m=a.nextToken();const l=a.currentString(),c=l[0];for((1!==l.length||"a"!==c&&"b"!==c&&"c"!==c&&"n"!==c&&"q"!==c)&&(0,r.a)('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for curve parameters"),m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for to point"),u.toPointSz=0;4!==a.nextToken();)4===u.toPointSz&&(0,r.a)("failed to parse curve: vertex array cannot have more than 4 elements"),t[u.toPointSz++]=b(a);u.toPointSz<2&&(0,r.a)("failed to parse curve: vertex array must have at least 2 elements");const h=i.P.construct(t[0],t[1]),_=i.P.getNAN();let f=-1,p=-1,k=!1,y=Number.NaN,g=Number.NaN,N=Number.NaN;const T=[i.P.getNAN(),i.P.getNAN(),i.P.getNAN()],x=i.P.getNAN();if("a"===c){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for center point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for center point"),_.setCoords(e,t),m=a.nextToken(),f=a.currentInt32Value(),m=a.nextToken(),p=a.currentInt32Value(),m=a.nextToken(),4!==m?(k=!1,y=b(a),m=a.nextToken(),g=b(a),m=a.nextToken(),N=b(a),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters")):k=!0,u.segFlag=4}else if("b"===c){for(let e=0;e<2;e++){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[e].setCoords(t,n)}m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=2}else if("n"===c){{m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[0].setCoords(e,t)}m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);T[1].setCoords(e,t),T[2].setCoords(n,n),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=8}else if("q"===c){for(let e=0;e<1;e++){m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for control point"),m=a.nextToken();const t=b(a);m=a.nextToken();const n=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for control point"),T[e].setCoords(t,n)}m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=16}else{m=a.nextToken(),2!==m&&(0,r.a)("failed to parse curve: start array is expected for interior point"),m=a.nextToken();const e=b(a);m=a.nextToken();const t=b(a);m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for interior point"),x.setCoords(e,t),m=a.nextToken(),4!==m&&(0,r.a)("failed to parse curve: end array is expected for curve parameters"),u.segFlag=4}if(m=a.nextToken(),3!==m&&(0,r.a)("failed to parse curve: end object is expected for curve"),"a"===c)if(e.createEllipticArc(),k){const t=!0;v(e.get(),n,h,_,t,f,p)}else!function(e,t,n,r,i,a,s,u,m){e.dropAllAttributes();const l=new ArrayBuffer(44),c=new d({sz:44,buffer:l});let h=0;c.writeDouble(h,r.x),h+=8,c.writeDouble(h,r.y),h+=8,c.writeDouble(h,s),h+=8,c.writeDouble(h,u),h+=8,c.writeDouble(h,m),h+=8;let _=0;a||(_|=2048),i&&(_|=4096),c.writeInt32(h,_),h+=4,function(e,t,n,r){e.m_bits=0,e.m_center.x=r.readDouble(0),e.m_center.y=r.readDouble(8),e.m_rotation=r.readDouble(16),e.m_semiMajorAxis=r.readDouble(24),e.m_minorMajorRatio=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const i=r.readInt32(40);if(1&i)return!1;let a=!!(64&i),s=!!(128&i);const u=!!(2048&i),m=!!(4096&i);!(512&i)&&!(1024&i)||s||(a=!0),s&&!t.equals(n)?(s=!1,a=!0):a&&t.equals(n)&&(s=!0,a=!1),s?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,(0,o.a8)(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),(0,o.a6)(e)}(e,t,n,c)}(e.get(),n,h,_,f,p,y,g,N);else if("b"===c)e.createCubicBezier(),function(e,t,n,a){e.dropAllAttributes();const s=new ArrayBuffer(32),o=new d({sz:32,buffer:s});let u=0;o.writeDouble(u,a[0].x),u+=8,o.writeDouble(u,a[0].y),u+=8,o.writeDouble(u,a[1].x),u+=8,o.writeDouble(u,a[1].y),u+=8,function(e,t,n,a){(0,r.g)(32<=a.size()),e.m_cp=(0,i.m)(i.P,2),e.m_cp[0].x=a.readDouble(0),e.m_cp[0].y=a.readDouble(8),e.m_cp[1].x=a.readDouble(16),e.m_cp[1].y=a.readDouble(24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,o)}(e.get(),n,h,T);else if("n"===c)e.createQuadraticRationalBezier(),function(e,t,n,r,i,a,s){e.dropAllAttributes();const o=new ArrayBuffer(40),u=new d({sz:40,buffer:o});let m=0;u.writeDouble(m,r.x),m+=8,u.writeDouble(m,r.y),m+=8,u.writeDouble(m,i),m+=8,u.writeDouble(m,a),m+=8,u.writeDouble(m,s),m+=8,function(e,t,n,r){e.m_cp.x=r.readDouble(0),e.m_cp.y=r.readDouble(8),e.m_weights[0]=r.readDouble(16),e.m_weights[1]=r.readDouble(24),e.m_weights[2]=r.readDouble(32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y}(e,t,n,u)}(e.get(),n,h,T[0],T[1].x,T[1].y,T[2].x);else if("q"===c)e.createQuadraticBezier(),e.get().construct(n,T[0],h);else{e.createEllipticArc();const t=!1;v(e.get(),n,h,x,t,-1,-1)}return u}function v(e,t,n,a,s,u,m){e.dropAllAttributes();const l=new ArrayBuffer(20),c=new d({sz:20,buffer:l});let h=0;c.writeDouble(h,a.x),h+=8,c.writeDouble(h,a.y),h+=8;let _=0;s?(m||(_|=8),u&&(_|=16)):_|=128,c.writeInt32(h,_),h+=4,function(e,t,n,a){0>=a.size()&&(0,r.q)("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const s=i.P.getNAN();s.x=a.readDouble(0),s.y=a.readDouble(8);const u=a.readInt32(16);if(1&u)return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),!1;let m=!!(64&u);const l=!!(128&u);let c=!!(32&u);const d=!!(8&u),h=!!(16&u),_=t.equals(n);m&&!_&&(m=!1,c=!0),c&&_&&(m=!0,c=!1,s.setCoords(0,0)),m||(l?c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(s),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,s),_&&d===e.isClockwise()&&e.reverse()):c?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,(0,o.a6)(e),e.queryCoord2D(.5,e.m_interior)):(0,o.a7)(e,t,n,s,d,h)),m&&(e.m_center.assign(t),e.m_startAngle=s.x,e.m_sweepAngle=s.y,(0,o.a8)(e,Number.NaN,d,h),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),(0,o.a6)(e)}(e,t,n,c)}function x(e,t,n,i,a){const s=e.getGeometryType();if(s===r.G.enumEllipticArc)return function(e,t,n,i,a){(0,r.g)(!(0,o.a5)(e));const s=e.getEndXY(),u=e.hasAttribute(1)&&!t,m=e.hasAttribute(2)&&!n;let l=Number.NaN,c=Number.NaN;if(u&&(l=e.getEndAttributeAsDbl(1,0)),m&&(c=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return S(u,m,s.x,s.y,l,c,i,a),!0;const d=0===e.projectionBehavior(),h=!!d&&e.isClosed();if(d&&!h)a.startObject(),a.addFieldName("c"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a),w(e.m_interior.x,e.m_interior.y,17,a),a.endArray(),a.endObject();else if(d){a.startObject(),a.addFieldName("a"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a);const t=0,n=0;w(e.m_center.x+t,e.m_center.y+n,17,a);const r=!e.isMajor();a.addInt32(r?1:0);const o=e.isClockwise();a.addInt32(o?1:0),a.endArray(),a.endObject()}else{a.startObject(),a.addFieldName("a"),a.startArray(),S(u,m,s.x,s.y,l,c,i,a);const t=e;w(t.m_center.x,t.m_center.y,17,a);const n=!t.isMajor();a.addInt32(n?1:0);const r=t.isClockwise();a.addInt32(r?1:0),a.addDouble(t.m_rotation,17),a.addDouble(t.m_semiMajorAxis,17),a.addDouble(t.m_minorMajorRatio,17),a.endArray(),a.endObject()}return!1}(e,t,n,i,a);if(s===r.G.enumBezier)return A(e,t,n,i,a);if(s===r.G.enumRationalBezier2)return function(e,t,n,r,i){const a=e.getEndXY(),s=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;s&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),S(s,o,a.x,a.y,u,m,r,i),w(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}(e,t,n,i,a);if(s===r.G.enumBezier2){const r=new o.J;return r.constructFromQuadraticSegment(e),A(r,t,n,i,a)}(0,r.t)("")}function A(e,t,n,r,i){const a=e.getEndXY(),s=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return s&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),S(s,o,a.x,a.y,u,m,r,i),w(e.m_cp[0].x,e.m_cp[0].y,r,i),w(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function S(e,t,n,r,i,a,s,o){o.startArray(),o.addDouble(n,s),o.addDouble(r,s),e&&o.addDouble(i,s),t&&o.addDouble(a,s),o.endArray()}function w(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}function C(e,t,n,i){const a=n.getImpl(),u=!!(2&t),m=!!(4&t),l=!!(8&t),c=a.hasAttribute(1)&&!u,d=a.hasAttribute(2)&&!m,h=a.hasAttribute(3)&&!l,_=a.hasNonLinearSegments();c&&(i.addFieldName("hasZ"),i.addBool(!0)),d&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let f=null;const p=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const l=n.getPathCount();let k=0;const b=a.getAttributeStreamRef(0);let y=null,g=null,N=null;const T=new o.S;let v=null,A=null,S=null;_&&(v=a.getSegmentFlagsStreamRef(),A=a.getSegmentIndexStreamRef(),S=a.getSegmentDataStreamRef()),c&&(y=a.getAttributeStreamRef(1)),d&&(g=a.getAttributeStreamRef(2)),h&&(N=a.getAttributeStreamRef(3),f=(0,s.Y)(3,0));for(let t=0;t<l;t++){i.startArray(),h&&p.push(0);const a=n.getPathEnd(t);if(k===a){i.endArray();continue}const s=n.isClosedPath(t);let o=b.read(2*k),l=b.read(2*k+1),_=c?y.read(k):Number.NaN,w=d?g.read(k):Number.NaN,C=h?N.read(k):0;D(c,d,o,l,_,w,e,i);let F=1;h&&(f.add(C),p[p.length-1]++);const j=o,O=l,I=_,z=w,E=C;let G=!1,P=0,B=Number.NaN,R=Number.NaN,V=0;for(let t=k+1,n=k,M=s?a+1:a;t<M;t++,n++){const s=null!==v?31&v.read(n):1;let k,M;if(t<a?(k=b.read(2*t),M=b.read(2*t+1),c&&(B=y.read(t)),d&&(R=g.read(t)),h&&(V=N.read(t))):(k=j,M=O,B=I,R=z,V=E),1!==s){G=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():(0,r.t)("JSON export.unsupported curve");const t=T.get(),a=A.read(n);t.setStartXYCoords(o,l),t.setEndXYCoords(k,M),c&&(t.setStartAttribute(1,0,_),t.setEndAttribute(1,0,B)),d&&(t.setStartAttribute(2,0,w),t.setEndAttribute(2,0,R)),t.readFromBufferStream(S,a),x(T.get(),u,m,e,i)&&P++}else D(c,d,k,M,B,R,e,i);h&&(f.add(V),p[p.length-1]++),F++,o=k,l=M,_=B,w=R,C=V}G&&0===P||(F<2&&P<1&&(D(c,d,o,l,_,w,e,i),F++,h&&(f.add(C),p[p.length-1]++)),s&&F<3&&P<2&&(D(c,d,j,O,I,z,e,i),F++,o=j,l=O,_=I,w=z,C=E,h&&(f.add(E),p[p.length-1]++))),i.endArray(),k=a}i.endArray()}if(h){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=p.length;t<n;++t){const n=p[t];(0,r.g)(0===n||null!==f&&e+n<=f.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(f.read(e)),e++;i.endArray()}i.endArray()}}function D(e,t,n,r,i,a,s,o){o.startArray(),o.addDouble(n,s),o.addDouble(r,s),e&&o.addDouble(i,s),t&&o.addDouble(a,s),o.endArray()}const F="a".charCodeAt(0),j="A".charCodeAt(0),O="*".charCodeAt(0),I="b".charCodeAt(0),z="\\".charCodeAt(0),E="[".charCodeAt(0),G="{".charCodeAt(0),P=":".charCodeAt(0),B=".".charCodeAt(0),R=",".charCodeAt(0),V='"'.charCodeAt(0),M="]".charCodeAt(0),U="}".charCodeAt(0),W="e".charCodeAt(0),X="E".charCodeAt(0),Y="f".charCodeAt(0),L="F".charCodeAt(0),q="/".charCodeAt(0),K="-".charCodeAt(0),J="+".charCodeAt(0),Z="n".charCodeAt(0),H="N".charCodeAt(0),Q="r".charCodeAt(0),$="t".charCodeAt(0),ee="u".charCodeAt(0),te="0".charCodeAt(0),ne="9".charCodeAt(0);class re{constructor(e){this.m_functionStack=[],this.m_pushPositions=[],this.m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0}),void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?(0,r.t)("streaming json parsing not yet impl"):(0,r.d)("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);return this.m_endToken+=e-1,{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){(0,r.t)("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){(0,r.t)("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return(0,r.g)(0),""}childrenAsString(){return(0,r.g)(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}(0,r.a)("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===z&&t.charCodeAt(r+1)===ee;)n++,r+=6;r=e;const i=new Uint8Array(n);let a=0;for(;t.charCodeAt(r)===z&&t.charCodeAt(r+1)===ee;)i[a++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let a=t;a<n;a++)if(i.charCodeAt(a)!==z)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++a)){case V:e+='"';break;case ee:{const{u8s:t,end:n}=this.toUTF8_(a-1,i);a=n-1,e+=t;break}case z:e+="\\";break;case q:e+="/";break;case I:e+="\b";break;case Y:e+="\f";break;case Z:e+="\n";break;case Q:e+="\r";break;case $:e+="\t"}t=a+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){return 5!==this.m_currentTokenType&&6!==this.m_currentTokenType?this.currentTerminalAsString_():this.m_bHasEscapes?this.unquoteCurrentString_():this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&(0,r.a)("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&(0,r.a)("invalid token")}const n=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(n)&&(0,r.a)("invalid token");else if(Number.isNaN(n))return Number.NaN;return n}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&(0,r.a)("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&(0,r.a)("invalid token"));const n=parseInt(e);return Number.isNaN(n)&&(0,r.a)("invalid token"),n}currentInt64Value(){return(0,r.g)(0),0n}currentBoolValue(){return(0,r.g)(0),!1}isError(){return 0}JSONString(){return(0,r.g)(0),""}pushPosition(){return(0,r.g)(0),!1}popPosition(){return(0,r.g)(0),!1}skipCStyleComments_(){(0,r.g)(0)}skipCppStyleComments_(){(0,r.g)(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e===O?this.skipCStyleComments_():e===q?this.skipCppStyleComments_():(0,r.a)("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&(0,r.a)("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&(0,r.a)("invalid token"),t=this.m_peekChar();t===q?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===M&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===U&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token");let e=this.m_peekChar();for(;e!==V;){const t=e===z;if(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===V||e===z||e===q||e===I||e===Y||e===Z||e===Q||e===$)this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar();else if(e===ee)for(let t=0;t<4;t++)this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e>=te&&e<=ne||e>=F&&e<=Y||e>=j&&e<=L||(0,r.a)("invalid token");else(0,r.a)("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===R&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===P&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):(0,r.a)("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken,this.m_peekChar()!==V&&(0,r.a)("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():(0,r.a)("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():(0,r.a)("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==te?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar()}while(e>=te&&e<=ne)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e>=te&&e<=ne||(0,r.a)("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar(),e!==J&&e!==K||(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),e=this.m_peekChar()),e>=te&&e<=ne||(0,r.a)("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===K?(this.m_stepOverChar(),this.m_eof()&&(0,r.a)("invalid token"),t=this.m_peekChar(),e=!0,t>=te&&t<=ne||(0,r.a)("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===B)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==W&&t!==X||this.exp_();else if(t===W||t===X)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.a)("invalid token"),"null"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&(0,r.a)("invalid token"),"true"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&(0,r.a)("invalid token"),"false"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&(0,r.a)("invalid token"),"NaN"!==e&&(0,r.a)("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===G?this.valueStartObject_():e===E?this.valueStartArray_():e===V?this.valueString_():e===K||e>=te&&e<=te+9?this.valueNumber_():e===Z?this.valueNull_():e===$?this.valueTrue_():e===Y?this.valueFalse_():e===H?this.valueNan_():(0,r.a)("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==G&&e!==E&&(0,r.a)("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}const ie=new class{constructor(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject=[]}reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){(0,r.g)(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}},ae=new class{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,s,o){!function(e,t,n,i){if(t||n){if(i.startObject(),null!==t)switch(t.getGeometryType()){case r.G.enumPolygon:C(!0,e,t,i);break;case r.G.enumPolyline:C(!1,e,t,i);break;case r.G.enumMultiPoint:!function(e,t,n){const i=t.getImpl(),a=i.hasAttribute(1)&&!(2&e),s=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);a&&(n.addFieldName("hasZ"),n.addBool(!0)),s&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;a&&(o=i.getAttributeStreamRef(1)),s&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;a&&(l=o.read(e)),s&&(c=m.read(e)),D(a,s,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),(0,r.g)(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}(e,t,i);break;case r.G.enumPoint:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),a=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(a&&(n.addFieldName("id"),n.addInt32(0)));const s=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),s),n.addFieldName("y"),n.addDouble(t.getY(),s),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),s)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),s)),a&&(n.addFieldName("id"),n.addInt32(t.getID()))}(e,t,i);break;case r.G.enumEnvelope:!function(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),a=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(a&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const s=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),s),n.addFieldName("ymin"),n.addDouble(t.getYMin(),s),n.addFieldName("xmax"),n.addDouble(t.getXMax(),s),n.addFieldName("ymax"),n.addDouble(t.getYMax(),s),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,s),n.addFieldName("zmax"),n.addDouble(e.vmax,s)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,s),n.addFieldName("mmax"),n.addDouble(e.vmax,s)}if(a){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}(e,t,i);break;case r.G.enumMultipatch:(0,r.g)(0);break;default:(0,r.d)("exportToJSON")}null!==n&&(i.addFieldName("spatialReference"),function(e,t,n){n.startObject();let i=0;t.isCustomWkid()||(i=t.getOldID());let s=0;const o=t.getVCS();if(null!==o&&(o.isCustomWkid()||(s=o.getOldID()),s<=0&&(i=0)),i>0){n.addFieldName("wkid"),n.addInt32(i);const e=t.getLatestID();if(e>0&&e!==i&&(n.addFieldName("latestWkid"),n.addInt32(e)),s>0){n.addFieldName("vcsWkid"),n.addInt32(s);const e=t.getLatestVerticalID();e!==s&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),function(e,t,n){n.startObject();const i=t.getID();i<=0&&(0,r.a)("cannot export unit that has no valid WKID"),n.addFieldName("uwkid"),n.addInt32(i),n.endObject()}(0,t.getUnit(),n));else if(i<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new a.a;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}(e,n,i)),i.endObject()}}(e,t,n,i)}exportSpatialReference(e,t,n,i){(0,r.g)(0)}exportProjectionTransformation(e,t,n,i){(0,r.g)(0)}exportDatumTransformation(e,t,n,i){(0,r.g)(0)}static geometryTypeToString(e){return(0,r.g)(0),""}},se=new class{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,i,u,m,l){let c;"string"==typeof n?(c=new re({jsonString:n}),c.nextToken()):c=n,1!==c.currentToken()&&(0,r.a)("failed to import map geometry: start of object is expected");const d=function(e,t,n,i,a){let u=!1,m=!1,l=!1,c=!1,d=!1,h=!1,g=!1,N=!1,T=!1,v=!1,x=!1,A=!1,S=!1,w=!1,C=!1,D=!1,F=!1,j=!1,O=!1,I=!1,z=!1,E=!1,G=!1,P=!1,B=Number.NaN,R=Number.NaN,V=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,Y=Number.NaN,L=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Z=Number.NaN,H=0,Q=0,$=!1,ee=!1,te=null,ne=null,re=null,ie=null,ae=null;for(;3!==n.nextToken();){const t=n.currentString();if(n.nextToken(),"spatialReference"===t){if(a&&!u){u=!0,1===n.currentToken()?ie=_(n):10!==n.currentToken()&&(0,r.a)("failed to parse spatial reference: object or null is expected");continue}}else if(i)if("hasZ"===t){if(!m){m=!0,$=11===n.currentToken();continue}}else if("hasM"===t){if(!l){l=!0,ee=11===n.currentToken();continue}}else if("rings"===t){if(!(d||h||e!==r.G.enumUnknown&&e!==r.G.enumPolygon)){d=!0,({geometry:ae,as:te,bs:ne}=f(!0,!1,0,n));continue}}else if("curveRings"===t){if(!h&&(e===r.G.enumUnknown||e===r.G.enumPolygon)){h=!0,({geometry:ae,as:te,bs:ne}=f(!0,!0,0,n));continue}}else if("paths"===t){if(!(g||N||e!==r.G.enumUnknown&&e!==r.G.enumPolyline)){g=!0,({geometry:ae,as:te,bs:ne}=f(!1,!1,0,n));continue}}else if("curvePaths"===t){if(!N&&(e===r.G.enumUnknown||e===r.G.enumPolyline)){N=!0,({geometry:ae,as:te,bs:ne}=f(!1,!0,0,n));continue}}else if("points"===t){if(!T&&(e===r.G.enumUnknown||e===r.G.enumMultiPoint)){T=!0,({geometry:ae,as:te,bs:ne}=p(0,n));continue}}else if("ids"===t){if(!c){c=!0,re=k(0,n);continue}}else if("x"===t){if(!v&&(e===r.G.enumUnknown||e===r.G.enumPoint)){v=!0,B=b(n);continue}}else if("y"===t){if(!x&&(e===r.G.enumUnknown||e===r.G.enumPoint)){x=!0,R=b(n);continue}}else if("z"===t){if(!A&&(e===r.G.enumUnknown||e===r.G.enumPoint)){A=!0,V=b(n);continue}}else if("m"===t){if(!S&&(e===r.G.enumUnknown||e===r.G.enumPoint)){S=!0,M=b(n);continue}}else if("id"===t){if(!w&&(e===r.G.enumUnknown||e===r.G.enumPoint)){w=!0,U=y(n);continue}}else if("xmin"===t){if(!C&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){C=!0,W=b(n);continue}}else if("ymin"===t){if(!D&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){D=!0,X=b(n);continue}}else if("mmin"===t){if(!z&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){z=!0,J=b(n);continue}}else if("zmin"===t){if(!O&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){O=!0,q=b(n);continue}}else if("idmin"===t){if(!G&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){G=!0,H=y(n);continue}}else if("xmax"===t){if(!F&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){F=!0,Y=b(n);continue}}else if("ymax"===t){if(!j&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){j=!0,L=b(n);continue}}else if("mmax"===t){if(!E&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){E=!0,Z=b(n);continue}}else if("zmax"===t){if(!I&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){I=!0,K=b(n);continue}}else if("idmax"===t){if(!P&&(e===r.G.enumUnknown||e===r.G.enumEnvelope)){P=!0,Q=y(n);continue}}else"materials"===t&&(0,r.g)(0);n.skipChildren()}if(d||h||g||N||T){let e=null,t=null;const n=ae;$&&(ae.addAttribute(1),e=te,e||(e=(0,s.a1)(n.getPointCount(),Number.NaN))),ee&&(ae.addAttribute(2),t=$?ne:te),null!=re&&ae.addAttribute(3),$&&null!=e&&n.setAttributeStreamRef(1,e),ee&&null!=t&&n.setAttributeStreamRef(2,t),null!=re&&function(e,t){if(e.isEmpty())return;const n=(0,s.a6)(2,0),i=e.getGeometryType();let a=0;i===o.M.type?a=1:i===o.P.type||i===o.a.type?a=e.getPathCount():(0,r.d)("not implemented"),n.resize(e.getPointCount(),0);let u=0;for(let s=0;s<a;++s){const a=t.read(u);u++;const m=u+a;let l=0,c=0;i===o.M.type?l=e.getPointCount():i===o.P.type||i===o.a.type?(l=e.getPathSize(s),c=e.getPathStart(s)):(0,r.d)("not implemented");for(let e=0,r=Math.min(a,l);e<r;++e)n.write(c,t.read(u)),u++,c++;u=m}e.getImpl().setAttributeStreamRef(3,n)}(n,re)}else if(v||x||S||A||w){(0,s.a4)(B,R)||(0,r.a)("failed to parse point: x and y must be finite or nan"),(Number.isNaN(R)||Number.isNaN(B))&&(B=Number.NaN,R=Number.NaN);const e=new s.P({x:B,y:R});A&&e.setZ(V),S&&e.setM(M),w&&e.setID(U),ae=e}else if(C||D||F||j||O||I||z||E||G||P){(Number.isNaN(X)||Number.isNaN(Y)||Number.isNaN(L))&&(W=Number.NaN);const e=new s.E({xmin:W,ymin:X,xmax:Y,ymax:L});O&&I&&e.setInterval(1,0,q,K),z&&E&&e.setInterval(2,0,J,Z),G&&P&&e.setInterval(3,0,H,Q),ae=e}return{...ae?{geom:ae}:{},...ie?{sr:ie}:{}}}(t,0,c,i,u);return new a.aY(d)}importSpatialReference(e){const t=_(e);return null===t&&(0,r.d)("failed to import spatial reference"),t}importProjectionTransformation(e,t){return(0,r.g)(0),{}}importDatumTransformation(e,t){return(0,r.g)(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||(0,r.a)("string_to_geometry_type"),e.endsWith("point")?r.G.enumPoint:e.endsWith("envelope")?r.G.enumEnvelope:e.endsWith("multipoint")?r.G.enumMultiPoint:e.endsWith("polyline")?r.G.enumPolyline:e.endsWith("polygon")?r.G.enumPolygon:void(0,r.a)("string_to_geometry_type")}};function oe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function ue(e,t){const{includeGeometry:n=!0,includeSpatialReference:i=!0}=t??{};i&&(e.spatialReference?.latestVcsWkid||e.spatialReference?.vcsWkid)&&(e={...e,spatialReference:{...e.spatialReference}},delete e.spatialReference?.latestVcsWkid,delete e.spatialReference?.vcsWkid);const a=new c(e,{strict:!1});return a.nextToken(),se.execute(0,r.G.enumUnknown,a,n,i)}function me(e){let t=null;return[e.map(e=>{if(null==t){const n=le(e);return t=n.getSpatialReference(),n.getGeometry()}return ce(e)}),t]}function le(e){return e.spatialReference instanceof u.A&&(e={...e,spatialReference:e.spatialReference.toJSON()}),ue(e)}function ce(e){return ue(e,{includeSpatialReference:!1}).getGeometry()}function de(e){return e instanceof u.A&&(e=e.toJSON()),ue({x:0,y:0,spatialReference:e},{includeGeometry:!1}).getSpatialReference()}function he(e,t){return e instanceof a.aY&&(t=e.getSpatialReference(),e=e.getGeometry()),e?.isEmpty()?null:(ie.reset(),ae.execute(0,e,t,ie),ie.getObject())}},90293:(e,t,n)=>{n(79187),n(55537),n(88885),n(95213),n(83661);var r=n(39117),i=n(83047),a=n(21325);(0,r.k)()||(0,r.l)(e=>{let t,n;"number"==typeof e?t=e:n=e;const r={wkid:t,wkt:n};let s,o;if(n){s=(0,i.x1)(n);const e=(0,a.EA)(r);if(!s&&!e)throw new Error(`Unsupported WKT type: ${n}`)}else s=!(0,a.EA)(r);return o=t&&i.yD.has(t)?Math.PI/200:s?(0,i.Ao)(r):Math.PI/180,{isPCS:s,metersOrRadiansPerUnit:o,semiMajor:0,wkidOrWkt:e}})}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});var s=i(97768),r=i(74887),n=i(9775),o=i(32587),l=i(76030),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,this._queue=new n.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&!this.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,n=(0,r.Tw)(),o=t?(0,r.u7)(t,()=>s.abort()):null,l=(0,r.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),n.reject((0,r.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,n),this._controllers.set(e,s),n.promise.then(a,a),this._queue.push(e),this._scheduleNext(),n.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency&&!this.sharedConcurrency.full;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s),this.sharedConcurrency.current.value+=1;try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,r.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),v=i(20223),w=i(87045),b=i(76353),I=i(77301),R=i(70834);const S=new Map,C=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const r=s[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const r=s[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const r=s[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function T(e,t,i,s,r=null){const n=S.get(e);if(!n)return void(null==t&&C.putBlock(e,i,s,r));if(null==t||null==n[t])return void C.putBlock(e,i,s,r);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:r};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:w.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,b.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const r=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,r.size[0],r.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r;let{transposedVariableName:l}=t;const a=null!=o&&n&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=r,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(m);if(!r.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&r.hasMultidimensionalTranspose;if((0,b.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=r,n=3,o=s.x*n/2,l=s.y*n/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,n,n,u),{pixelBlock:d}=await this.fetchPixels(a,n,n,u);if(null==h)return{location:m,value:null};const f=Math.floor(n*n*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:v,rowOffset:w,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,v,t);if(!k?.pixels?.length)return{location:m,value:null};const M=w*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:r}=this;if(s.requestRawData&&r)return this._fetchPixels(e,t,i,s);const n=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),h=u-Math.round((n/2-a)/(c-a)*t);let d=0;const f=[];for(let r=0;r<=o;r++){const m=new p.A({xmin:0===r?a:-n/2,xmax:r===o?c-n*r:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===r?u-h:r===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&r>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,s),{nativeExtent:n,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=r;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const r=s.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(n.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(r){const t=(r[e].x+r[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new w.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:r,height:n,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new v.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<r.length;s++){const{x:n,y:o}=r[s];l.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=s**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,s){const{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,r,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,r,n){const[o,l]=n,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,r=m.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:r});const{extent:n,storageInfo:o}=e;if(o){o.origin=new f.A({x:n.xmin,y:n.ymax,spatialReference:r});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let r=(0,R.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=n;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(r=(0,R.OM)(n.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:r},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,v=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:b}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:b}=e[o-1]);else{const e=t**o;w*=e,b*=e}}const I=d.spatialReference,S=new f.A({x:w,y:b,spatialReference:I}),C=_===c&&v===u&&h.x%_===0&&h.y%v===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&v===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),v=Math.floor((a+u+m-1)/o),w=Math.floor((c+h+m-1)/l),b=n[e];if(!b)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=b;if(0===d&&(w<I||v<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=w;t++)for(let i=x;i<=v;i++){let r=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(r=i-g-y),t>=I&&r>=R&&C>=t&&S>=r){const i=this._fetchRawTile(e,t,r,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(w-_+1)*l,width:(v-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:r.x+x*o*B,xmax:r.x+(v+1)*o*B,ymin:r.y-(w+1)*l*D,ymax:r.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!s.transposedVariableName;if(!n){const s=r.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:o,maxCol:l,maxRow:a}=s;if(t<n||i<o||t>a||i>l)return Promise.resolve(null)}const o=n?s.transposeVariableName:s.sliceId,l=r.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const n=new AbortController,o=s.bandIds?.slice();if(o?.length&&r.isBsqTile){const r=new Set(o),l=[],a=Array.from(r);for(const r of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[r]}},{signal:n.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:n.signal});T(c,s.registryId,u,h,n),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[r,n]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([r[e],n[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const r={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(r.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=r,c=o/t,u=l/i,h=a<n&&c*u>=16,d=a===n&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/s;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+s)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,n);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,b.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map(e=>e[s]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(62788),r=i(95488);class n{constructor(e){this._observable=new r.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),r=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=[];if(t){const n=s(e,i);for(let e=0;e<n.length;e++)s(n[e],t).forEach(e=>r.push(e));return r}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)r.push(n[e]||n.item(e));return r}function r(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=s(e,i);return n.length>0?t?r(n[0],t):n[0]:null}function n(e,t=null){const i=t?r(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),r=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&r.push(n));return r}function l(e,t=null){const i=n(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=n(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>r,g7:()=>u,mX:()=>n,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>r});var s=i(19419);class r{constructor(e,t,i,r=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),r=i(49186),n=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:r,rasterIds:n}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===r.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&r.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=r.map(r=>r.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const v=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==v||(_=await(0,c.$Q)(_,e,v)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(e=>e.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(n);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new r.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:r,extent:n}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&r.equals(a)&&n.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let n=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);n=(0,h.uk)(n,t.spatialReference),t=r.execute(n,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>v});var s,r=i(31635),n=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:n=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,n),size:[r,r],spatialReference:n})}const a=(0,m.Vp)(n),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),u=1/(39.37*(0,l.GA)(n)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(n)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,r=i*u;h.push(new y.A({level:s,scale:i,resolution:r})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[r,r],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],r=t[s+1];if(i<=e)return s;if(r===e)return s+1;if(i>e&&r<e)return s+Math.log(i/e)/Math.log(i/r)}return s}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,o=e.y,s=i}const l=r.resolution*this.size[0],a=r.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,n=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,r=s*this.size[0],n=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+r,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const s=e+t,{scale:r,resolution:n}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:r,resolution:n}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,r.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,r.Cg)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,r.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,r.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,r.Cg)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,r.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,r.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,r.Cg)([(0,h.$)("esri.layers.support.TileInfo")],v)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),v=i(22796),w=i(87045),b=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,b.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");r=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,r,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,r),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,r=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,o=(0,T.m7)(s,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const r=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:r,symbolizer:this.symbolizer},i);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,b.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return w.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const n=this.getTileUrl(e,t,i);return(0,r.A)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const r=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,r);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const r=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(r.pixelBlock=r.pixelBlock?.extractBands(s.bandIds)),r}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new n.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},r=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(r)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const r=this.multidimensionalSubset?.areaOfInterest;if(r&&!r.contains(e))throw new n.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,b.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some(e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,b.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,b.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:r}=t;if("multipoint"===r)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,23346))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=n/(o+(2===r.paths[0].length?1:0))),r=s.execute(t,l,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const n=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/n),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const r=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(r))&&f.push(r)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,r=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=r?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),n=t.statistics,o=n&&n.length>0?n[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const n=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:n,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,b.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",v.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,b.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const r=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),n=new I.A({rasterFunction:r});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:r}=this,{bandCount:n}=this.raster.rasterInfo,o=r?.length?r.some(e=>e>=n):n>=3;r&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),r=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:r})];const n=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:r,attributes:l});n.push(a)}),n}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:v.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),n=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends n.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,r.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,r.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});var s=i(97768),r=i(74887),n=i(9775),o=i(32587),l=i(76030),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,this._queue=new n.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&!this.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,n=(0,r.Tw)(),o=t?(0,r.u7)(t,()=>s.abort()):null,l=(0,r.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),n.reject((0,r.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,n),this._controllers.set(e,s),n.promise.then(a,a),this._queue.push(e),this._scheduleNext(),n.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency&&!this.sharedConcurrency.full;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s),this.sharedConcurrency.current.value+=1;try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,r.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),r=i(11254),n=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),v=i(20223),w=i(87045),b=i(76353),I=i(77301),R=i(70834);const S=new Map,C=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const r=s[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const r=s[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const r=s[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function T(e,t,i,s,r=null){const n=S.get(e);if(!n)return void(null==t&&C.putBlock(e,i,s,r));if(null==t||null==n[t])return void C.putBlock(e,i,s,r);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:r};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:w.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,b.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const r=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,r.size[0],r.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r;let{transposedVariableName:l}=t;const a=null!=o&&n&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=r,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(m);if(!r.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&r.hasMultidimensionalTranspose;if((0,b.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=r,n=3,o=s.x*n/2,l=s.y*n/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,n,n,u),{pixelBlock:d}=await this.fetchPixels(a,n,n,u);if(null==h)return{location:m,value:null};const f=Math.floor(n*n*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:v,rowOffset:w,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,v,t);if(!k?.pixels?.length)return{location:m,value:null};const M=w*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:r}=this;if(s.requestRawData&&r)return this._fetchPixels(e,t,i,s);const n=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),h=u-Math.round((n/2-a)/(c-a)*t);let d=0;const f=[];for(let r=0;r<=o;r++){const m=new p.A({xmin:0===r?a:-n/2,xmax:r===o?c-n*r:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===r?u-h:r===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&r>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,s),{nativeExtent:n,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=r;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const r=s.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(n.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(r){const t=(r[e].x+r[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new w.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:r,height:n,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new v.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<r.length;s++){const{x:n,y:o}=r[s];l.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=s**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,s){const{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,r,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,r,n){const[o,l]=n,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,r=m.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:r});const{extent:n,storageInfo:o}=e;if(o){o.origin=new f.A({x:n.xmin,y:n.ymax,spatialReference:r});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let r=(0,R.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=n;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(r=(0,R.OM)(n.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:r},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,v=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:b}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:b}=e[o-1]);else{const e=t**o;w*=e,b*=e}}const I=d.spatialReference,S=new f.A({x:w,y:b,spatialReference:I}),C=_===c&&v===u&&h.x%_===0&&h.y%v===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&v===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),v=Math.floor((a+u+m-1)/o),w=Math.floor((c+h+m-1)/l),b=n[e];if(!b)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=b;if(0===d&&(w<I||v<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=w;t++)for(let i=x;i<=v;i++){let r=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(r=i-g-y),t>=I&&r>=R&&C>=t&&S>=r){const i=this._fetchRawTile(e,t,r,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(w-_+1)*l,width:(v-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:r.x+x*o*B,xmax:r.x+(v+1)*o*B,ymin:r.y-(w+1)*l*D,ymax:r.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!s.transposedVariableName;if(!n){const s=r.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:o,maxCol:l,maxRow:a}=s;if(t<n||i<o||t>a||i>l)return Promise.resolve(null)}const o=n?s.transposeVariableName:s.sliceId,l=r.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const n=new AbortController,o=s.bandIds?.slice();if(o?.length&&r.isBsqTile){const r=new Set(o),l=[],a=Array.from(r);for(const r of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[r]}},{signal:n.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:n.signal});T(c,s.registryId,u,h,n),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[r,n]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([r[e],n[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const r={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(r.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=r,c=o/t,u=l/i,h=a<n&&c*u>=16,d=a===n&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/s;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+s)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,n);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,b.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map(e=>e[s]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(62788),r=i(95488);class n{constructor(e){this._observable=new r.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),r=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=[];if(t){const n=s(e,i);for(let e=0;e<n.length;e++)s(n[e],t).forEach(e=>r.push(e));return r}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)r.push(n[e]||n.item(e));return r}function r(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=s(e,i);return n.length>0?t?r(n[0],t):n[0]:null}function n(e,t=null){const i=t?r(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),r=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&r.push(n));return r}function l(e,t=null){const i=n(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=n(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>r,g7:()=>u,mX:()=>n,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>r});var s=i(19419);class r{constructor(e,t,i,r=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),r=i(49186),n=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:r,rasterIds:n}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===r.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&r.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=r.map(r=>r.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const v=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==v||(_=await(0,c.$Q)(_,e,v)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(e=>e.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(n);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new r.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:r,extent:n}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&r.equals(a)&&n.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let n=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);n=(0,h.uk)(n,t.spatialReference),t=r.execute(n,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>v});var s,r=i(31635),n=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:n=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,n),size:[r,r],spatialReference:n})}const a=(0,m.Vp)(n),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),u=1/(39.37*(0,l.GA)(n)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(n)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,r=i*u;h.push(new y.A({level:s,scale:i,resolution:r})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[r,r],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],r=t[s+1];if(i<=e)return s;if(r===e)return s+1;if(i>e&&r<e)return s+Math.log(i/e)/Math.log(i/r)}return s}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,o=e.y,s=i}const l=r.resolution*this.size[0],a=r.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,n=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,r=s*this.size[0],n=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+r,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const s=e+t,{scale:r,resolution:n}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:r,resolution:n}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,r.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,r.Cg)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,r.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,r.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,r.Cg)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,r.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,r.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,r.Cg)([(0,h.$)("esri.layers.support.TileInfo")],v)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),r=i(11254),n=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),v=i(22796),w=i(87045),b=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,b.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");r=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,r,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,r),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,r=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,o=(0,T.m7)(s,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const r=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:r,symbolizer:this.symbolizer},i);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,b.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return w.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const n=this.getTileUrl(e,t,i);return(0,r.A)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const r=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,r);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const r=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(r.pixelBlock=r.pixelBlock?.extractBands(s.bandIds)),r}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new n.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},r=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(r)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const r=this.multidimensionalSubset?.areaOfInterest;if(r&&!r.contains(e))throw new n.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,b.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some(e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,b.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,b.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:r}=t;if("multipoint"===r)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,23346))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=n/(o+(2===r.paths[0].length?1:0))),r=s.execute(t,l,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const n=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/n),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const r=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(r))&&f.push(r)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,r=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=r?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),n=t.statistics,o=n&&n.length>0?n[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const n=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:n,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,b.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",v.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,b.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const r=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),n=new I.A({rasterFunction:r});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:r}=this,{bandCount:n}=this.raster.rasterInfo,o=r?.length?r.some(e=>e>=n):n>=3;r&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),r=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:r})];const n=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:r,attributes:l});n.push(a)}),n}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:v.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),n=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends n.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,r.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,r.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);