@arcgis/core 5.1.0-next.37 → 5.1.0-next.39

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 (320) hide show
  1. package/applications/WebEditor/sketchUtils.js +1 -1
  2. package/arcade/batchExec.js +1 -1
  3. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  4. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{11058e660139c427c3e7.js → 01777e91cd4e0bf04fd0.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{666db81085bc97831b18.js → 02a0a58ca5916db1db19.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{3d18b8c1c759c7240721.js → 03c8453ae72a4e190252.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{828998d33a48be161782.js → 04981ae9d7728208ffce.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{b2cf19a28aa5c32a99e3.js → 04b04548d4eb0941a01e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{64870f555fefa85a5c59.js → 06003996a378c45bc605.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{ce063df750018024c9ed.js → 0601c316da0256a60538.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{653d61aaaacb169b9418.js → 0d321b3496adc640d96a.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0dd12d6af0cf7707109c.js +2 -0
  15. package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +1 -0
  16. package/assets/esri/core/workers/chunks/{1ff40e6057916e8482b3.js → 0eb57ef4a1b387c951d6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{0554f310066937098099.js → 10941b50f5933d168df6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{22aeab5c363645c04806.js → 13a009229c96ecb7b04f.js} +1 -1
  19. package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +1 -0
  20. package/assets/esri/core/workers/chunks/{3b86e8eb553122d3b68d.js → 167e4ff7cbc88b42db71.js} +1 -1
  21. package/assets/esri/core/workers/chunks/16a767cc5f3e2e0e49c2.js +1 -0
  22. package/assets/esri/core/workers/chunks/19cbaeda71486df01d0f.js +1 -0
  23. package/assets/esri/core/workers/chunks/{96132a37bc08c7fa8f2e.js → 1a6a77902dd8c84e059a.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{00947268b6de12329146.js → 1f5d9e5d4ddc623fd511.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{a2d045217a42ecc36308.js → 236b4ab3da0bc8f788a2.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{0a66a2b4aaab0774c34f.js → 23af269e88f9ac101ffb.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{da60a6df2f7858a2910e.js → 244dd7a948ca8a7dc6ef.js} +1 -1
  28. package/assets/esri/core/workers/chunks/25946077568ab14c7bfc.js +1 -0
  29. package/assets/esri/core/workers/chunks/{bb7e0334f438daa665da.js → 26cafd20c8d03c274389.js} +1 -1
  30. package/assets/esri/core/workers/chunks/284ce99af7bdd73dc7e9.js +1 -0
  31. package/assets/esri/core/workers/chunks/{1d0153c7d65bd9ea7d39.js → 2b386374330d96387aec.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2c12b1488819c038c6b1.js +1 -0
  33. package/assets/esri/core/workers/chunks/2d2c10c31cc1460dd96a.js +1 -0
  34. package/assets/esri/core/workers/chunks/2fa86dacc8a12a6a6c43.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8bd24534ed185afcb124.js → 30cdb2d1d9f018f1642d.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5691c1624190abeaebea.js → 34484afe767d60f85982.js} +1 -1
  37. package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +1 -0
  38. package/assets/esri/core/workers/chunks/{6a0c371ec3acd7529fe6.js → 36a0e48113ab59a4f21d.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{cc3939983cf6f78f7243.js → 38c28189f273636e4017.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{e00000468fb8ec2b3d43.js → 392941013107bbd96503.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{43f60f41d353d3fc7c4b.js → 399fcea09dfb1ad6deaa.js} +1 -1
  42. package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +1 -0
  43. package/assets/esri/core/workers/chunks/{a52a8254577840a23aba.js → 3d4bb59ab2f644f4d675.js} +1 -1
  44. package/assets/esri/core/workers/chunks/3e2953ea62817e75d840.js +1 -0
  45. package/assets/esri/core/workers/chunks/{582d45a41e29005f6c63.js → 4005d37d03c834da7629.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{285f3b07de852bfc1604.js → 427183ea93e759943a78.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{4ceba469398ef55de8ea.js → 42b556d56013350c9d80.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{446bc8461403ed1ac7b2.js → 4577df99c92c7ec0f9de.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{7a2dd3d85d31dce29d94.js → 49d6249e98f023344e0a.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{6ca2064ea96bdb594f52.js → 4b0d6309abf273f1f79f.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{6f3f7f785241edacdb8b.js → 4b5737021a149aa786af.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{210ef3f1cc6ef8a831bf.js → 4b79ebfb3328f9483147.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{305b2a8dc6438c5fd4aa.js → 4d378d4e021a33b0047e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{114aecdbd2bd92b24de2.js → 52175ff9e8c2c136f90a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{dfee98e7d1b206f33ba9.js → 54db91c0a3bd1946e026.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{c79e8003812b789724af.js → 5b2fe488a461bc433f59.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{1fa2bf0d6740092ec619.js → 5b70295da76d9227f64b.js} +1 -1
  58. package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +1 -0
  59. package/assets/esri/core/workers/chunks/{0f2d6f267d235db48767.js → 5e9595eb6ae6a40e7265.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{776a7179d32fe62a37e3.js → 604f9e7228a66b6cf2f9.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d0d836502321e7a80e61.js → 60d0f8a949b130baff81.js} +1 -1
  62. package/assets/esri/core/workers/chunks/60e4312044fe40dfd41d.js +2 -0
  63. package/assets/esri/core/workers/chunks/{98a84dc2988297bd6ab1.js → 6258ae3d991ce652d97f.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{e0d6292aaa3f8a796de3.js → 65865c25487d23dd2e31.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{d4b97ca16d79809ed6f2.js → 65ea5028eb12457a3aeb.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{cf100c80b75ba74b479c.js → 66a4d764937918a2779f.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{ebcfc20c1d92d90bf661.js → 6afdaa6c4555c467dca7.js} +1 -1
  68. package/assets/esri/core/workers/chunks/6ee956d5a92ca905f53f.js +1 -0
  69. package/assets/esri/core/workers/chunks/{14e05d37e10ebba8cf10.js → 6f58ec80abebb7bfbbb0.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{5698098c3691b3b49283.js → 73d7337ac9efdbad14a4.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{568d32ceee1409809e5a.js → 749c368f5cc2366716f1.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{586bc903e2c285649bf2.js → 77769663cd712822d33e.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{620965d2e1a9ccf81d43.js → 77f6659e400064d38130.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{8ed7ff651241f8adc4bf.js → 78472f69053061a18967.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{0e7d3f3479fcb366cc6f.js → 80a1ccabd4257cc61e0d.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{0d156e14fc34d0600fd5.js → 81b830f0d620587966ca.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{9cd548ea00b641d8e65d.js → 8333561a938bcdf6c2e6.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{283ce37403c5e7a76e95.js → 8677865189081e0b83bc.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{087403b53f15eb4d375c.js → 86f70bd786d6d57fde69.js} +1 -1
  80. package/assets/esri/core/workers/chunks/88c6cc90606409b5c884.js +1 -0
  81. package/assets/esri/core/workers/chunks/{8e10e4c25869af9da5ba.js → 8967a02f394a63f11030.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{d2fa8bd3f4cd3cf6b436.js → 89dbea6f436d45a3b185.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{8eed5b6cac937099102c.js → 8d5bc17557a31ed79ed8.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{2d6165796af522858e56.js → 8e18ac7b22d8dca1e1e2.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{ae72c530d52a6d4461be.js → 8e3cb1c584951c3d1eb7.js} +1 -1
  86. package/assets/esri/core/workers/chunks/92f6d637f4786ba0d3e3.js +1 -0
  87. package/assets/esri/core/workers/chunks/93846f8b77fc802069a7.js +1 -0
  88. package/assets/esri/core/workers/chunks/{34f2e9d7466abc0919e7.js → 9639b1dd27ccc17ee21e.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{7ebd836b98d14c7d3ecf.js → 969f58a2de4ebe63619d.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{9a3e5053e95db36f26dc.js → 9a95c28d4a3b3b4b2c50.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{c3e4f8664988e50bda55.js → 9b365a6242b0287f8727.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{e021b2f0e15aee5bf3ad.js → 9b80569819cd1c72a9ff.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{3dcb4ee8b862689a141b.js → 9bd68abc6b5b07b2add3.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{952ff668d202e80b43b0.js → a029db48079af4b5cccd.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{9cc1b44c5a325a840307.js → a1f36240a31057f998da.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{ff8de370abf661768380.js → a84d67c1a1008bca2075.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{c6112dcd6b36e256d7b5.js → a90883ff02c0cc6450c2.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{0d196cf72cd8bef8d91d.js → abcb39ad1e2d54710766.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{80f0810527743833b4b7.js → af804beb43d4d10c54d9.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{fbada7f029b293d934ac.js → b014f0b2385dc82dc683.js} +2 -2
  101. package/assets/esri/core/workers/chunks/{8c2e5b116bac21e7d577.js → b056b4c79bcd542dd1d2.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{3b9de873f87f0feeb20b.js → b1ac09d8fa340d194aa2.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{2f0e850ebea0ffd2708f.js → b1c5f69bd1400e66c635.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{414a802b6365688d31cb.js → b6e63d8ce3c9ac9762f4.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{d7229019876c0e4ff545.js → b86cb84c03b76e824213.js} +1 -1
  106. package/assets/esri/core/workers/chunks/bf9b83e020ff08c51ac1.js +1 -0
  107. package/assets/esri/core/workers/chunks/{b396b5186d618fad1cee.js → c0ecb68387e342dddf58.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{623bfacf4b9c9a5387cc.js → c2f3fc1b34a6782b431f.js} +1 -1
  109. package/assets/esri/core/workers/chunks/c4f64195e44986644993.js +1 -0
  110. package/assets/esri/core/workers/chunks/{b7a3a7f7fb747f9689d7.js → c7799ba861ac5af08e6a.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{9c6e96b1c2b0418a4f1c.js → ca1b0cb14ea9ae1bf2a3.js} +1 -1
  112. package/assets/esri/core/workers/chunks/cce2d2c60d136e1bac75.js +1 -0
  113. package/assets/esri/core/workers/chunks/{b98366d8a5bc6cc2b219.js → cda2e445eb2ac269abdf.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{448620052233e51b496c.js → cf74d1605ad2f21699e7.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d024278a1c2aa7d22be3.js +1 -0
  116. package/assets/esri/core/workers/chunks/{f4301ea9a6cb3bcef906.js → d0983cc19d19c19c3478.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{ee582bbe7365b678ec54.js → d50e6681ecb9612e4528.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{68abe4e70ea48e978642.js → d51c41c1944df0cbab3e.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{b2f497339493926d4c9e.js → d53b31c9056f82831bc0.js} +1 -1
  120. package/assets/esri/core/workers/chunks/{ffc87a038712a4c9d2cb.js → d6eddb94f5f2e9759bd0.js} +1 -1
  121. package/assets/esri/core/workers/chunks/{6cdda5aa35fa12ea9345.js → d7439d357f68160844cb.js} +1 -1
  122. package/assets/esri/core/workers/chunks/{b5403c8b5099179dc16d.js → d82b543c96f09ded3bf9.js} +2 -2
  123. package/assets/esri/core/workers/chunks/{6c853fd89f0e9f102c6e.js → dba479176db0a23c8034.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{6792e981a3c73063a3e6.js → dd26e3a29161ea411e41.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{0337138d3702a1a52ce0.js → de79645e559a2d1ffa67.js} +1 -1
  126. package/assets/esri/core/workers/chunks/e09f8b17cb0b92354de8.js +1 -0
  127. package/assets/esri/core/workers/chunks/{8346c342b822487a5477.js → e47dd011c06ab42c18e0.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{ba4e018492bd3327cd95.js → e68d7aec0f095b6d743d.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{ca64867bc322a354be8e.js → e907acaec4c62adac2f2.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{9813f25192ea27084754.js → ea356a5b90ea44b5cbe1.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{d30253b4990a76bfd72b.js → eab74d830c2eaa9d133b.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{eef102e13fd8878eeb96.js → eb36417edc11fa80e312.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{f5dbda08d7fd4bed1c62.js → eca45cd479f7fd28ca6e.js} +1 -1
  134. package/assets/esri/core/workers/chunks/{56f64df68bb11c0c74d2.js → f209a7076d67cbf4d205.js} +1 -1
  135. package/assets/esri/core/workers/chunks/{b81780e5e7cd9a1a010a.js → f36a234ef35faf8ca04d.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{64450e280d602c5b0863.js → f45e4eb89db31d7a7640.js} +14 -14
  137. package/assets/esri/core/workers/chunks/{45d57e561fc993bc75ed.js → f9cde38cb56c547e87e5.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{0efe90bd43ab29dab8ae.js → f9da5c81535eaffc8b9c.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{23cb0611abe1031c513c.js → fce30184f354fb7d11af.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{c8ae8d1b456ace0b383b.js → fce8d4ff920baf8856e6.js} +1 -1
  141. package/assets/esri/core/workers/chunks/{5fa5a2fb69f84e9092ba.js → fd629a3ab558adf52617.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{4bfc6f8c2d13ca4d2082.js → fdf4c1f202cfddf0f226.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{5b12865ac53d984d8149.js → fe7dec83e40014c55a6b.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{5f3b25b30acd7a07f5c0.js → ff31936236dd9b1acb24.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{122ff8d0d428f31fc5d1.js → ff8ec6369c8a1bee9bb4.js} +1 -1
  146. package/chunks/Fog.glsl.js +2 -1
  147. package/chunks/GaussianSplatComposition.glsl.js +21 -3
  148. package/chunks/GlowBlur.glsl.js +8 -8
  149. package/chunks/GlowComposition.glsl.js +7 -7
  150. package/chunks/HUDMaterial.glsl.js +4 -1
  151. package/chunks/OITBlend.glsl.js +10 -10
  152. package/chunks/OITDim.glsl.js +3 -4
  153. package/chunks/lyr3DMain.js +1 -1
  154. package/chunks/lyr3DWorker.js +1 -1
  155. package/config.js +1 -1
  156. package/core/Promise.js +1 -1
  157. package/core/QueueProcessor.js +1 -1
  158. package/core/has.js +1 -1
  159. package/core/promiseUtils.js +1 -1
  160. package/core/scheduling.js +1 -1
  161. package/core/workers/Connection.js +1 -1
  162. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  163. package/geometry/libtess.js +1 -1
  164. package/identity/IdentityManagerBase.js +1 -1
  165. package/intl/messages.js +1 -1
  166. package/kernel.js +1 -1
  167. package/layers/VoxelWasmPerSceneView.js +1 -1
  168. package/layers/graphics/data/projectionSupport.js +1 -1
  169. package/layers/graphics/editingSupport.js +1 -1
  170. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  171. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  172. package/layers/mixins/EditBusLayer.js +1 -1
  173. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  174. package/libs/lyr3d/Lyr3DModule.js +1 -1
  175. package/package.json +2 -2
  176. package/rest/print.js +1 -1
  177. package/support/revision.js +1 -1
  178. package/views/2d/engine/Bitmap.js +1 -1
  179. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  180. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  181. package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
  182. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
  183. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  184. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  185. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  186. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  187. package/views/2d/layers/features/FeatureContainer.js +1 -1
  188. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  189. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  190. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  191. package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
  192. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  193. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  194. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  195. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  196. package/views/3d/environment/EnvironmentManager.js +1 -1
  197. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  198. package/views/3d/layers/I3SMeshView3D.js +1 -1
  199. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  200. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  201. package/views/3d/layers/IntegratedMeshNormals.js +1 -1
  202. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  203. package/views/3d/layers/graphics/ElevationQuery.js +1 -1
  204. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  205. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  206. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  207. package/views/3d/state/ViewStateManager.js +1 -1
  208. package/views/3d/terrain/OverlayRenderer.js +1 -1
  209. package/views/3d/terrain/RasterTile.js +1 -1
  210. package/views/3d/terrain/TerrainRenderer.js +1 -1
  211. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  212. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  213. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  214. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  215. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  216. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  217. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  218. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  219. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  220. package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +2 -0
  221. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  222. package/views/3d/webgl-engine/effects/WeatherFader.js +2 -0
  223. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  224. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  225. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  226. package/views/3d/webgl-engine/effects/glow/GlowBlurTechniqueConfiguration.js +1 -1
  227. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  228. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  229. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  230. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  231. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  232. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  233. package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
  234. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  235. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +2 -0
  236. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +2 -0
  237. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  238. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  239. package/views/3d/webgl-engine/lib/Material.js +1 -1
  240. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  241. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  242. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  243. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  244. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  245. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  246. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  247. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  248. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  249. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  250. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  251. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  252. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  253. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  254. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  255. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  256. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  257. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  258. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  259. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  260. package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
  261. package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +2 -0
  262. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  263. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  264. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
  265. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  266. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  267. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  268. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +2 -0
  269. package/views/3d/webgl.js +1 -1
  270. package/views/PopupView.js +1 -1
  271. package/views/ViewAnimation.js +1 -1
  272. package/views/analysis/ExclusiveOperationManager.js +1 -1
  273. package/views/interactive/InteractiveToolBase.js +1 -1
  274. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  275. package/views/support/AnalysisViewManager.js +1 -1
  276. package/views/support/LayerLayerViewInfo.js +1 -1
  277. package/views/support/LayerViewManager.js +1 -1
  278. package/views/support/ScheduledQueueProcessor.js +1 -1
  279. package/views/support/waitForResources.js +1 -1
  280. package/widgets/Editor/EditorViewModel.js +1 -1
  281. package/widgets/Editor/UpdateWorkflow.js +1 -1
  282. package/widgets/Editor/Upload.js +1 -1
  283. package/widgets/Editor/Workflow.js +1 -1
  284. package/widgets/Editor.js +1 -1
  285. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  286. package/widgets/FeatureForm.js +1 -1
  287. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  288. package/widgets/FeatureTable.js +1 -1
  289. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  290. package/assets/esri/core/workers/chunks/1ee3d44e6d7add0b24cb.js +0 -1
  291. package/assets/esri/core/workers/chunks/29ff5325e604dd0adc37.js +0 -1
  292. package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +0 -1
  293. package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +0 -1
  294. package/assets/esri/core/workers/chunks/4d7f7b1e7663cf6088d1.js +0 -1
  295. package/assets/esri/core/workers/chunks/5d87316d6f973d95745c.js +0 -1
  296. package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +0 -1
  297. package/assets/esri/core/workers/chunks/75664587bb80f4e187e1.js +0 -1
  298. package/assets/esri/core/workers/chunks/7975abb2162a82c88edb.js +0 -1
  299. package/assets/esri/core/workers/chunks/889835e61ea97f090082.js +0 -1
  300. package/assets/esri/core/workers/chunks/917474f9dd2039b82e9d.js +0 -1
  301. package/assets/esri/core/workers/chunks/9360a24ba765742f4e81.js +0 -1
  302. package/assets/esri/core/workers/chunks/bd278f8081be8304be8d.js +0 -1
  303. package/assets/esri/core/workers/chunks/c2e4cf3a277a6f40c7c2.js +0 -1
  304. package/assets/esri/core/workers/chunks/c7f27a84268a9b0d8cdb.js +0 -1
  305. package/assets/esri/core/workers/chunks/cd73d37ea0e66db46e45.js +0 -1
  306. package/assets/esri/core/workers/chunks/d42d670edfae902c677b.js +0 -2
  307. package/assets/esri/core/workers/chunks/d6c2c9fedde498ad1a8c.js +0 -2
  308. package/assets/esri/core/workers/chunks/dcef87f7d06c45cd928b.js +0 -1
  309. package/assets/esri/core/workers/chunks/e011318fb8f8e59bc1f1.js +0 -1
  310. package/assets/esri/core/workers/chunks/e0344b45af88081fa186.js +0 -1
  311. package/assets/esri/core/workers/chunks/e16f5f089259988e8993.js +0 -1
  312. package/assets/esri/core/workers/chunks/ecddd8c7593d3483ed09.js +0 -1
  313. package/assets/esri/core/workers/chunks/fe21b2d31fbf83224e6b.js +0 -1
  314. package/views/3d/environment/EnvironmentRenderer.js +0 -2
  315. package/views/3d/webgl-engine/lib/CutFillColor.js +0 -2
  316. package/views/3d/webgl-engine/lib/CutFillDepth.js +0 -2
  317. /package/assets/esri/core/workers/chunks/{d6c2c9fedde498ad1a8c.js.LICENSE.txt → 0dd12d6af0cf7707109c.js.LICENSE.txt} +0 -0
  318. /package/assets/esri/core/workers/chunks/{d42d670edfae902c677b.js.LICENSE.txt → 60e4312044fe40dfd41d.js.LICENSE.txt} +0 -0
  319. /package/assets/esri/core/workers/chunks/{fbada7f029b293d934ac.js.LICENSE.txt → b014f0b2385dc82dc683.js.LICENSE.txt} +0 -0
  320. /package/assets/esri/core/workers/chunks/{b5403c8b5099179dc16d.js.LICENSE.txt → d82b543c96f09ded3bf9.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{createResolver as o}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as d}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as u,equals as p,isWGS84 as c,isWebMercator as m}from"../../geometry/support/spatialReferenceUtils.js";import{densifyUnsupportedCurves as h}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{isEditBusLayer as f,emitApplyEditsEvent as y}from"../mixins/EditBusLayer.js";import{isValidFieldValue as g}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as w}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as b,getEffectiveLayerCapabilities as F}from"../support/layerUtils.js";function A(e){return null!=e?.applyEdits}const v=()=>s.getLogger("esri.layers.graphics.editingSupport"),I=new WeakMap;async function $(e,t,a,s={}){let i;const n="gdbVersion"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(f(e)&&e.url)i=y(e.url,e.layerId,d,"original-and-current-features"===s.returnServiceEditsOption);else{i=o(),i.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:i.promise};e.emit("apply-edits",t)}try{const{results:o,edits:n}=await E(e,t,a,s),d=e=>e.filter(e=>!e.error).map(r),l={edits:n,addedFeatures:d(o.addFeatureResults),updatedFeatures:d(o.updateFeatureResults),deletedFeatures:d(o.deleteFeatureResults),addedAttachments:d(o.addAttachmentResults),updatedAttachments:d(o.updateAttachmentResults),deletedAttachments:d(o.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:o.editMoment?new Date(o.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return o.editedFeatureResults?.length&&(l.editedFeatures=o.editedFeatureResults),i.resolve(l),o}catch(l){throw i.reject(l),l}}async function E(e,t,r,s){if(await e.load(),!A(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!b(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:o}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,o)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const s=F(e),o=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(G(t,s,r,!!o,!!n,`${e.type}-layer`),!s.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!s.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||s.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&v().warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),l.rollbackOnFailureEnabled=!0),!s.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=D(t,s,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach(e=>T(e,t))}u.addFeatures.forEach(t=>j(t,e,p,c)),u.updateFeatures.forEach(t=>k(t,e,p,c)),u.deleteFeatures.forEach(t=>U(t,e,p,c)),u.addAttachments.forEach(t=>L(t,e)),u.updateAttachments.forEach(t=>L(t,e)),d&&await x(u,e);const m=i(I,e,()=>new Map);return{edits:await B(u,s.data.supportedCurveTypes??[],m),options:l}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!g(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function O(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,o=t.spatialReference,n="local"===i.type,d=u(o),l=p(o,s),h=l||c(o)&&(c(s)||m(s));if(!(n&&d&&h||!n&&!d&&l))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${o.wkid} is not supported.`)}}function j(e,t,a,r){R(e,t,a,r),O(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),O(e,t);const i=F(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function T(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=d())}async function B(e,t,a){const r=e.addFeatures??[],s=e.updateFeatures??[],i=r.concat(s).map(e=>e.geometry),o=await h(i,t,a),n=await l(o),d=r.length,u=s.length;return n.slice(0,d).forEach((e,t)=>r[t].geometry=e),n.slice(d,d+u).forEach((e,t)=>s[t].geometry=e),e}function M(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function D(e,t,r){const s=M(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(V),s.updateFeatures=s.updateFeatures.map(V),s.addAssetFeatures=[],s}function G(e,t,r,s,i,o){if(!(e&&(s||i)||r?.usingTelecomOperations))throw new a(`${o}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const n=t.editing.supportsGlobalId||r?.usingFeatureServiceEndpoint;if(!n&&r?.globalIdUsed)throw new a(`${o}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!n&&i)throw new a(`${o}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${o}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function V(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!w(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function C(e,t,r,s){if(!A(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,G as checkEditingCapabilities,M as normalizeCollections,D as normalizeEdits,B as processGeometries,V as shallowCloneFeature,C as uploadAssets};
2
+ import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as o}from"../../core/uuid.js";import{normalizeCentralMeridian as d}from"../../geometry/support/normalizeUtils.js";import{isGeographic as l,equals as u,isWGS84 as p,isWebMercator as c}from"../../geometry/support/spatialReferenceUtils.js";import{densifyUnsupportedCurves as h}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{isEditBusLayer as m,emitApplyEditsEvent as f}from"../mixins/EditBusLayer.js";import{isValidFieldValue as y}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as g}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as w,getEffectiveLayerCapabilities as b}from"../support/layerUtils.js";function F(e){return null!=e?.applyEdits}const v=()=>s.getLogger("esri.layers.graphics.editingSupport"),A=new WeakMap;async function I(e,t,a,s={}){let i;const n="gdbVersion"in e?e.gdbVersion:null,o=s.gdbVersion??n;if(m(e)&&e.url)i=f(e.url,e.layerId,o,"original-and-current-features"===s.returnServiceEditsOption);else{i=Promise.withResolvers(),i.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:i.promise};e.emit("apply-edits",t)}try{const{results:n,edits:o}=await $(e,t,a,s),d=e=>e.filter(e=>!e.error).map(r),l={edits:o,addedFeatures:d(n.addFeatureResults),updatedFeatures:d(n.updateFeatureResults),deletedFeatures:d(n.deleteFeatureResults),addedAttachments:d(n.addAttachmentResults),updatedAttachments:d(n.updateAttachmentResults),deletedAttachments:d(n.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:n.editMoment?new Date(n.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return n.editedFeatureResults?.length&&(l.editedFeatures=n.editedFeatureResults),i.resolve(l),n}catch(d){throw i.reject(d),d}}async function $(e,t,r,s){if(await e.load(),!F(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!w(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:n}=await E(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,n)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function E(e,t,r){const s=b(e),n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(D(t,s,r,!!n,!!o,`${e.type}-layer`),!s.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!s.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||s.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&v().warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),l.rollbackOnFailureEnabled=!0),!s.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=M(t,s,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach(e=>L(e,t))}u.addFeatures.forEach(t=>O(t,e,p,c)),u.updateFeatures.forEach(t=>k(t,e,p,c)),u.deleteFeatures.forEach(t=>j(t,e,p,c)),u.addAttachments.forEach(t=>U(t,e)),u.updateAttachments.forEach(t=>U(t,e)),d&&await V(u,e);const h=i(A,e,()=>new Map);return{edits:await T(u,s.data.supportedCurveTypes??[],h),options:l}}function S(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!y(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function R(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,n=t.spatialReference,o="local"===i.type,d=l(n),h=u(n,s),m=h||p(n)&&(p(s)||c(s));if(!(o&&d&&m||!o&&!d&&h))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${n.wkid} is not supported.`)}}function O(e,t,a,r){S(e,t,a,r),R(e,t)}function j(e,t,a,r){S(e,t,a,r)}function k(e,t,r,s){S(e,t,r,s),R(e,t);const i=b(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function U(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function L(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=o())}async function T(e,t,a){const r=e.addFeatures??[],s=e.updateFeatures??[],i=r.concat(s).map(e=>e.geometry),n=await h(i,t,a),o=await d(n),l=r.length,u=s.length;return o.slice(0,l).forEach((e,t)=>r[t].geometry=e),o.slice(l,l+u).forEach((e,t)=>s[t].geometry=e),e}function B(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function M(e,t,r){const s=B(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(G),s.updateFeatures=s.updateFeatures.map(G),s.addAssetFeatures=[],s}function D(e,t,r,s,i,n){if(!(e&&(s||i)||r?.usingTelecomOperations))throw new a(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const o=t.editing.supportsGlobalId||r?.usingFeatureServiceEndpoint;if(!o&&r?.globalIdUsed)throw new a(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!o&&i)throw new a(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function G(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function V(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!g(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])x(a)&&s.push(a);for(const a of e.updateFeatures??[])x(a)&&s.push(a)}function x(e){return"mesh"===e?.geometry?.type}function z(e,t,r,s){if(!F(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{I as applyEdits,D as checkEditingCapabilities,B as normalizeCollections,M as normalizeEdits,T as processGeometries,G as shallowCloneFeature,z as uploadAssets};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{createResolver as o}from"../../../../core/promiseUtils.js";import{addQueryParameters as s}from"../../../../core/urlUtils.js";import{subclass as n}from"../../../../core/accessorSupport/decorators.js";import a from"../../../../geometry/SpatialReference.js";import{fromJSON as c}from"../../../../geometry/support/jsonUtils.js";import{WebSocketConnection as u}from"./WebSocketConnection.js";import{executeQuery as l}from"../../../../rest/query/operations/query.js";import f from"../../../../rest/support/Query.js";const h=1e4,d={maxQueryDepth:5,maxRecordCountFactor:3};let g=class extends u{constructor(e){super({...d,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){if("attributes"in e){let o;try{o=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(o.geometry)}catch(t){return void i.getLogger(this).error(new r("geoevent-connection","Failed to parse message",t))}this.onFeature(o)}else this.onMessage(e)}async _fetchServiceDefinition(e){const r={f:"json",...this._config.customParameters},i=t(e.path,{query:r,responseType:"json"}),o=(await i).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:i,token:o}=r,n=this._inferWebSocketBaseUrl(i);return s(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.getLogger(this).error(new r("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let a=!1;const c=o(),u=()=>{a||(this.destroyed||this._websocket!==s||i.getLogger(this).error(new r("geoevent-connection","Server timed out when setting filter")),c.reject())},l=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.getLogger(this).error(new r("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),c.reject(t.error)),this._setWebSocketJSONParseHandler(s),a=!0,c.resolve())};return s.onmessage=l,s.send(n),setTimeout(u,h),c.promise}_serializeFilter(e,t){const o={};if(null==e&&null==t)return o;if(e?.geometry)try{const t=c(e.geometry);if("extent"!==t.type)throw new r("geoevent-connection",`Expected extent but found type ${t.type}`);o.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(s){i.getLogger(this).error(new r("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(o.where=e.where),null!=t&&(o.outFields=t.join(",")),o}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,o=e.attributes[t],s=this._relatedFeatures.get(o);if(!s)return i.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:n,geometry:a}=s;for(const r in n)e.attributes[r]=n[r];return a&&(e.geometry=a),e.geometry||e.centroid||i.getLogger(this).error(new r("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),i=this._queryArchive(t);await r;const o=await i;if(!o)return;for(const s of o.features)this.onFeature(this._enrich(s))}catch(e){i.getLogger(this).error(new r("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await import("../../../FeatureLayer.js")).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,s=r.query.supportsCentroid,n=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,u=i?c*n:c,h=new f;if(h.outFields=this._config.outFields??["*"],h.where=this._config.filter?.where??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=a.fromJSON(this._config.spatialReference),s&&(h.returnCentroid=!0),i&&(h.maxRecordCountFactor=n),o)return h.num=u,t.destroy(),this._queryPages(e,h);const d=await l(e,h,this._config.sourceSpatialReference);return t.destroy(),d}async _queryPages(e,t,r=[],i=0){t.start=null!=t.num?i*t.num:null;const o=await l(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(o.features.forEach(e=>r.push(e)),this._queryPages(e,t,r,i+1)):(r.forEach(e=>o.features.push(e)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const e=o.attributes[i];t.set(e,o)}this._relatedFeatures=t}};g=e([n("esri.layers.graphics.sources.connections.GeoEventConnection")],g);export{g as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{addQueryParameters as o}from"../../../../core/urlUtils.js";import{subclass as s}from"../../../../core/accessorSupport/decorators.js";import n from"../../../../geometry/SpatialReference.js";import{fromJSON as a}from"../../../../geometry/support/jsonUtils.js";import{WebSocketConnection as c}from"./WebSocketConnection.js";import{executeQuery as u}from"../../../../rest/query/operations/query.js";import l from"../../../../rest/support/Query.js";const f=1e4,h={maxQueryDepth:5,maxRecordCountFactor:3};let d=class extends c{constructor(e){super({...h,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){if("attributes"in e){let o;try{o=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(o.geometry)}catch(t){return void i.getLogger(this).error(new r("geoevent-connection","Failed to parse message",t))}this.onFeature(o)}else this.onMessage(e)}async _fetchServiceDefinition(e){const r={f:"json",...this._config.customParameters},i=t(e.path,{query:r,responseType:"json"}),o=(await i).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:i,token:s}=r,n=this._inferWebSocketBaseUrl(i);return o(`${n}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.getLogger(this).error(new r("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const o=this._websocket;if(null==o||null==e&&null==t)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let n=!1;const a=Promise.withResolvers(),c=()=>{n||(this.destroyed||this._websocket!==o||i.getLogger(this).error(new r("geoevent-connection","Server timed out when setting filter")),a.reject())},u=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.getLogger(this).error(new r("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),a.reject(t.error)),this._setWebSocketJSONParseHandler(o),n=!0,a.resolve())};return o.onmessage=u,o.send(s),setTimeout(c,f),a.promise}_serializeFilter(e,t){const o={};if(null==e&&null==t)return o;if(e?.geometry)try{const t=a(e.geometry);if("extent"!==t.type)throw new r("geoevent-connection",`Expected extent but found type ${t.type}`);o.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(s){i.getLogger(this).error(new r("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(o.where=e.where),null!=t&&(o.outFields=t.join(",")),o}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,o=e.attributes[t],s=this._relatedFeatures.get(o);if(!s)return i.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:n,geometry:a}=s;for(const r in n)e.attributes[r]=n[r];return a&&(e.geometry=a),e.geometry||e.centroid||i.getLogger(this).error(new r("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),i=this._queryArchive(t);await r;const o=await i;if(!o)return;for(const s of o.features)this.onFeature(this._enrich(s))}catch(e){i.getLogger(this).error(new r("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await import("../../../FeatureLayer.js")).default)({url:e}),{capabilities:r}=await t.load(),i=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,s=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,f=i?c*a:c,h=new l;if(h.outFields=this._config.outFields??["*"],h.where=this._config.filter?.where??"1=1",h.returnGeometry=!0,h.returnExceededLimitFeatures=!0,h.outSpatialReference=n.fromJSON(this._config.spatialReference),s&&(h.returnCentroid=!0),i&&(h.maxRecordCountFactor=a),o)return h.num=f,t.destroy(),this._queryPages(e,h);const d=await u(e,h,this._config.sourceSpatialReference);return t.destroy(),d}async _queryPages(e,t,r=[],i=0){t.start=null!=t.num?i*t.num:null;const o=await u(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&i<(this._config.maxQueryDepth??0)?(o.features.forEach(e=>r.push(e)),this._queryPages(e,t,r,i+1)):(r.forEach(e=>o.features.push(e)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,i=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const e=o.attributes[i];t.set(e,o)}this._relatedFeatures=t}};d=e([s("esri.layers.graphics.sources.connections.GeoEventConnection")],d);export{d as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{after as s,createResolver as r}from"../../../../core/promiseUtils.js";import{addQueryParameters as n}from"../../../../core/urlUtils.js";import{property as i,subclass as c}from"../../../../core/accessorSupport/decorators.js";import{getGeometryZScaler as a}from"../../../../geometry/support/zscale.js";import l from"../../../support/StreamConnection.js";let h=class extends l{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:o,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=a(t,s,o),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,r=1e3,i=0){try{if(this.destroyed)return;const t=n(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(c){const n=r/1e3;return this._config.maxReconnectionAttempts&&i>=this._config.maxReconnectionAttempts?(o.getLogger(this).error(new t("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.getLogger(this).error(new t("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,c)),await s(r),this._tryCreateWebSocket(e,Math.min(1.5*r,1e3*this._config.maxReconnectionInterval),i+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(s){return void o.getLogger(this).error(new t("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(e){return new Promise((t,o)=>{const s=new WebSocket(e);s.onopen=()=>{if(s.onopen=null,this.destroyed)return s.onclose=null,void s.close();s.onclose=e=>this._onClose(e),s.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(s),t(s)},s.onclose=e=>{s.onopen=s.onclose=null,o(e)}})}async _handshake(e=1e4){const s=this._websocket;if(null==s)return;const n=r(),i=s.onmessage,{filter:c,outFields:a,spatialReference:l}=this._config;return n.timeout(e),s.onmessage=e=>{let r=null;try{r=JSON.parse(e.data)}catch(h){}r&&"object"==typeof r||(o.getLogger(this).error(new t("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),n.reject(),this.destroy()),r.spatialReference?.wkid!==l?.wkid&&(o.getLogger(this).error(new t("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,e.data)),n.reject(),this.destroy()),"json"!==r.format&&(o.getLogger(this).error(new t("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),n.reject(),this.destroy()),c&&r.filter!==c&&o.getLogger(this).error(new t("websocket-connection","Tried to set filter, but server doesn't support it")),a&&r.outFields!==a&&o.getLogger(this).error(new t("websocket-connection","Tried to set outFields, but server doesn't support it")),s.onmessage=i;for(const t of this._outstandingMessages)s.send(JSON.stringify(t));this._outstandingMessages=[],n.resolve()},s.send(JSON.stringify({filter:c,outFields:a,format:"json",spatialReference:{wkid:l.wkid}})),n.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),o.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&o.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};e([i()],h.prototype,"connectionStatus",null),e([i()],h.prototype,"errorString",void 0),h=e([c("esri.layers.graphics.sources.connections.WebSocketConnection")],h);export{h as WebSocketConnection};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{after as s}from"../../../../core/promiseUtils.js";import{addQueryParameters as r}from"../../../../core/urlUtils.js";import{property as n,subclass as i}from"../../../../core/accessorSupport/decorators.js";import{getGeometryZScaler as c}from"../../../../geometry/support/zscale.js";import a from"../../../support/StreamConnection.js";let l=class extends a{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:o,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=c(t,s,o),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case 0:case 1:return"connected";case 2:case 3:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,n=1e3,i=0){try{if(this.destroyed)return;const t=r(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(c){const r=n/1e3;return this._config.maxReconnectionAttempts&&i>=this._config.maxReconnectionAttempts?(o.getLogger(this).error(new t("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.getLogger(this).error(new t("websocket-connection",`Failed to connect. Attempting to reconnect in ${r}s`,c)),await s(n),this._tryCreateWebSocket(e,Math.min(1.5*n,1e3*this._config.maxReconnectionInterval),i+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(s){return void o.getLogger(this).error(new t("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(e){return new Promise((t,o)=>{const s=new WebSocket(e);s.onopen=()=>{if(s.onopen=null,this.destroyed)return s.onclose=null,void s.close();s.onclose=e=>this._onClose(e),s.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(s),t(s)},s.onclose=e=>{s.onopen=s.onclose=null,o(e)}})}async _handshake(e=1e4){const s=this._websocket;if(null==s)return;const r=Promise.withResolvers(),n=s.onmessage,{filter:i,outFields:c,spatialReference:a}=this._config,l=setTimeout(()=>r.reject(),e),h=()=>{clearTimeout(l),r.reject()};return s.onmessage=e=>{let d=null;try{d=JSON.parse(e.data)}catch(g){}d&&"object"==typeof d||(o.getLogger(this).error(new t("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),h(),this.destroy()),d.spatialReference?.wkid!==a?.wkid&&(o.getLogger(this).error(new t("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${a.wkid}`,e.data)),h(),this.destroy()),"json"!==d.format&&(o.getLogger(this).error(new t("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),h(),this.destroy()),i&&d.filter!==i&&o.getLogger(this).error(new t("websocket-connection","Tried to set filter, but server doesn't support it")),c&&d.outFields!==c&&o.getLogger(this).error(new t("websocket-connection","Tried to set outFields, but server doesn't support it")),s.onmessage=n;for(const t of this._outstandingMessages)s.send(JSON.stringify(t));this._outstandingMessages=[],clearTimeout(l),r.resolve()},s.send(JSON.stringify({filter:i,outFields:c,format:"json",spatialReference:{wkid:a.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),o.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&o.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};e([n()],l.prototype,"connectionStatus",null),e([n()],l.prototype,"errorString",void 0),l=e([i("esri.layers.graphics.sources.connections.WebSocketConnection")],l);export{l as WebSocketConnection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{createResolver as s}from"../../core/promiseUtils.js";import{property as d,subclass as n}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as r,defaultVersionNameLookup as o}from"../../versionManagement/support/versionManagementUtils.js";const a=new e;function l(t){return a.on("apply-edits",new WeakRef(t))}function h(t){return a.on("update-moment",new WeakRef(t))}function c(t,e,i=null,d=!1){const n=s();return d=null==e||d,a.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:d,result:n.promise}),n}function u(t,e,i=null,s){a.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const m=Symbol();function p(t){return null!=t&&"object"==typeof t&&m in t}function b(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function g(t,e,i){const s=new URL(t).host,d=o.get(s),n=t=>!t||t===d;return n(e)&&n(i)||e===i}const F=e=>{var s;const o=e;let a=class extends o{static{s=m}constructor(...t){super(...t),this[s]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:d,mayReceiveServiceEdits:n,result:r}=t,o=e===this.url,a=null!=s&&null!=this.layerId&&s===this.layerId,l=b(this),h=b(this)&&g(e,d,this.gdbVersion);if(!o||l&&!h||!a&&!n)return;const c=r.then(t=>{if(this.lastEditsEventDate=new Date,a&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find(({layerId:t})=>t===this.layerId);if(s){const{adds:e,updates:d,deletes:n}=s.editedFeatures,r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:n?n.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:d?d.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",r),r}const n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,n.historicMoment)&&this.emit("edits",n),n}).then(t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,t.historicMoment)&&(this.historicMoment=t.historicMoment),t));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,d=e===this.url,n=b(this),r=b(this)&&g(e,i,this.gdbVersion),o=b(this)&&!g(e,this.gdbVersion,null);d&&n&&r&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then(()=>{this.addHandles(l(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(h(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&r(t,e)}};return t([d()],a.prototype,"lastEditsEventDate",void 0),a=t([n("esri.layers.mixins.EditBusLayer")],a),a};export{F as EditBusLayer,c as emitApplyEditsEvent,u as emitUpdateMomentEvent,p as isEditBusLayer,b as isLayerWithGDBVersion,l as onApplyEditsEvent,h as onUpdateMomentEvent,g as versionMatches};
2
+ import{__decorate as t}from"tslib";import{EventEmitter as e}from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import{isVersionInEditSession as n,defaultVersionNameLookup as r}from"../../versionManagement/support/versionManagementUtils.js";const o=new e;function a(t){return o.on("apply-edits",new WeakRef(t))}function l(t){return o.on("update-moment",new WeakRef(t))}function h(t,e,i=null,s=!1){const d=Promise.withResolvers();return s=null==e||s,o.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:s,result:d.promise}),d}function c(t,e,i=null,s){o.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const u=Symbol();function m(t){return null!=t&&"object"==typeof t&&u in t}function p(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function b(t,e,i){const s=new URL(t).host,d=r.get(s),n=t=>!t||t===d;return n(e)&&n(i)||e===i}const g=e=>{var r;const o=e;let h=class extends o{static{r=u}constructor(...t){super(...t),this[r]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:d,mayReceiveServiceEdits:n,result:r}=t,o=e===this.url,a=null!=s&&null!=this.layerId&&s===this.layerId,l=p(this),h=p(this)&&b(e,d,this.gdbVersion);if(!o||l&&!h||!a&&!n)return;const c=r.then(t=>{if(this.lastEditsEventDate=new Date,a&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find(({layerId:t})=>t===this.layerId);if(s){const{adds:e,updates:d,deletes:n}=s.editedFeatures,r={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],deletedFeatures:n?n.map(({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],updatedFeatures:d?d.map(({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]})):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",r),r}const n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,n.historicMoment)&&this.emit("edits",n),n}).then(t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,d,t.historicMoment)&&(this.historicMoment=t.historicMoment),t));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,d=e===this.url,n=p(this),r=p(this)&&b(e,i,this.gdbVersion),o=p(this)&&!b(e,this.gdbVersion,null);d&&n&&r&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then(()=>{this.addHandles(a(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(l(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return t([s()],h.prototype,"lastEditsEventDate",void 0),h=t([d("esri.layers.mixins.EditBusLayer")],h),h};export{g as EditBusLayer,h as emitApplyEditsEvent,c as emitUpdateMomentEvent,m as isEditBusLayer,p as isLayerWithGDBVersion,a as onApplyEditsEvent,l as onUpdateMomentEvent,b as versionMatches};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as i}from"../../../core/units.js";import o from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as x}from"../../../geometry/projectionUtils.js";import m from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";function p(){if(!N)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const g=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],x=2*i;let m=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>m&&(m=r+s,p=[r,s]),x&&m>x){h=!0;break}}if(h)break}return p},y={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},d=32,w=4,M=w,R=new Map,S=new Map,P=500,b=39.37,G=96;let k,E,T,N=!1;async function j(){return k||(k=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),N=!0,k.resolve()),k.promise}function v(e,t,n){if(p(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function C(e,t,n,i){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;p();const s=n.center,a=new o({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:i}),c=$(t);return null==l||null!=c&&l.width>=c?_(e,r,t):{x:l.width,y:l.height}}function _(e,t,n){const o=i(t)/i(n);return{x:e.x*o,y:e.y*o}}function z(e,n,o){const{spatialReference:r}=o;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return _(e,r,n);if(p(),!N)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*i(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,x=s*f/2,m=a*f/2,{x:h,y:g}=o.center,y=[];for(let t=0;t<=f;t++)y.push([h-x,g-m+t*a]);for(let t=1;t<=f;t++)y.push([h-x+t*s,g+m]);for(let t=1;t<=f;t++)y.push([h+x,g+m-t*a]);for(let t=1;t<f;t++)y.push([h+x-t*s,g-m]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return _(e,r,n);const M=w.extent,R=$(n);if(null==M||null!=R&&M.width>=R)return _(e,r,n);const S=pe(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},T=G.x*G.y;return Math.abs(T-k.x*k.y)/T<.1?G:k}function L(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*i(t)*G*b}function W(e,t){const{pixelSize:n,extent:i}=e;return L(z(n,t,i),t)}function I(e,t=.01){return i(e)?t/i(e):0}function O(e,t,n,i=!0){const o=e.spatialReference;if(o.equals(t))return e;p();const r=E.execute(e,t,{geographicTransformation:n});return i&&r?(A([e],[r],o,t),r):r}function A(e,t,n,i){const o=ee(n,!0),r=ee(i,!0),s=I(n,P),a=I(i,P);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:i}=e;if(t.equals(n)){const{points:t}=X(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return B(e);if(i){if(t.isGeographic)return Y(e);if(null!=U(t))return Y(e)}return q(e)}function q(e){const{points:t}=X(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map(e=>new f(e[0],e[1],n)),s=E.executeMany(r,i,{geographicTransformation:o});return o&&A(r,s,n,i),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function Y(e){const{inSR:t,outSR:n,datumTransformation:i}=e,o=U(t),{points:a,mask:f}=X(e,o);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);l.projToGeog(e,a.length,a)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=a.map(([e])=>e>t?1:e<-t?-1:0)),i.steps.forEach(e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);c.geogToGeog(t,a.length,a,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<a.length;n++){const i=e[n],o=a[n][0],r=o>t?1:o<-t?-1:0;i&&r&&i!==r&&(a[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=U(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];K(a,t);const i=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);l.geogToProj(i,a.length,a)}let u=a;if(f&&a.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(a[t++]):u.push([NaN,NaN])}return u}function B(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=i/2,c-=o/2);const u=[],m=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+i*Math.min(t,g),r=c-o*Math.min(n,g),h=x(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&m.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],m[e]]);return p}function U(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),R.has(n)){const e=R.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),o=J(i,I(e,1e-4)),a=J(i,0,!0);return R.set(n,{pcs:o,gcs:a}),t?a:o}function J(e,t=0,n=!1){const i=a.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,s=o.find(e=>1===e.getInclusive()&&1===e.getKind());if(!s){if(s=o.find(e=>1===e.getInclusive()&&0===e.getKind()),!s)return null;r=!0}const l=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:l};let u=0;const x=[];let[m,h]=f[0],[p,g]=f[0];for(let a=0,y=f.length;a<y;a++){u++,u===y&&(u=0);const[e,t]=f[a],[n,i]=f[u];if(i===t)x.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?x.push([o,r,t,i,0]):x.push([o,r,i,t,1])}m=m<e?m:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,h,p,g],poleLocation:l}}function X(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,h=0;t<i;t++){const i=l+r*t,p=e||i>=a&&i<=x;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=u&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<o;m++){const e=c-s*m,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort((e,t)=>e-t)}else t[0]>t[1]&&(i=[t[1],t[0]]);x.push(i)}for(let m=0,h=0;m<i;m++){const e=l+r*m;for(let t=0;t<o;t++,h++){const i=c-s*t,o=x[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function K(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function D(e,t){const n=$(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??I(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:i,xmax:r,ymin:s,ymax:a}=e[0];for(let o=1;o<e.length;o++){const t=e[o];r=t.xmax+n*o,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new o({xmin:i,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function H(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=ne(t),l=$(s,!0),c=$(n);if(0===a||null==l||null==c){const e=Z(t,n,i,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<I(n)&&E.isLoaded()){const i=U(s);if(null!=i&&0===i.poleLocation&&t.width<(i.bbox[2]-i.bbox[0])/2)return V(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>I(s)){const{xmin:e,xmax:n}=t;for(let i=0;i<=a;i++){const r=0===i?e:-l/2,c=i===a?n-l*i:l/2;f[i]=new o({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>Z(e,n,i,r)).filter(e);return 0===u.length?null:D(u)}function Q(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new u({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(p(),E.execute(e,t,{geographicTransformation:n}))}function V(e,t){const n=$(t);if(null==n)return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:x}=f,m=I(l),h=new o({spatialReference:t});for(let o=0;o<2;o++){i=s=x[o][0][0],r=a=x[o][0][1];for(let e=0;e<x[o].length;e++)i=i>x[o][e][0]?x[o][e][0]:i,s=s<x[o][e][0]?x[o][e][0]:s,r=r>x[o][e][1]?x[o][e][1]:r,a=a<x[o][e][1]?x[o][e][1]:a;if(0===o)h.ymin=r,h.ymax=a,h.xmin=i,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<m)h.xmin=i,h.xmax=h.xmax+n;else{if(!(Math.abs(i+n/2)<m))return null;h.xmax=s+n}}return h}function Z(e,t,n,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;p();const s=E.execute(e,t,{geographicTransformation:n});if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=ee(r,!0),l=ee(t,!0);if(null==a||null==l)return s;const c=I(r,.001),u=I(r,P),x=I(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<c&&o>u){s.xmin=l[0];const i=[];i.push(new f(e.xmax,e.ymin,r)),i.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new f(e.xmax,e.ymax,r));const o=i.map(e=>O(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,o)}if(o<c&&i>u){s.xmax=l[1];const i=[];i.push(new f(e.xmin,e.ymin,r)),i.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new f(e.xmin,e.ymax,r));const o=i.map(e=>O(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,o)}}else{const e=I(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function $(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*y[e.wkid]||null}function ee(e,t=!1){if(e.isGeographic)return[-180,180];const n=$(e,t);return n?[-n/2,n/2]:null}function te(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!==0?o=Math.floor(o):i&&(o-=1),o}function ne(e,t=!1){const n=$(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=I(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return te(r,i,n,!0)-te(s,i,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=$(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:i),h=x?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)===0?i:Math.ceil(i),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:x}}function oe(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(S.has(t))n=S.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),S.set(t,n)}return new m({wkid:n})}function re(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[d,d],i=se(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:g(i.offsets,o,n,M);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>M)&&(l.isGeographic||U(l),n=[w,w],i=se({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=g(i.offsets,o,n,M)),i.error=s,n[0]>1&&(i.coefficients=ae(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=U(l);if(null!=t&&!t.isEnvelope){const t=oe(l),s=H(e.projectedExtent,t),{offsets:a}=se({...e,srcBufferExtent:s,spacing:n}),c=ae(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function se(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;p();const{xmin:l,ymin:c,xmax:u,ymax:x}=t,m=$(a),h=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[d,d],y=g[0]*i.x,M=g[1]*i.y,R=1===g[0],S=Math.ceil((u-l)/y-.1/g[0])+(R?0:1),b=Math.ceil((x-c)/M-.1/g[1])+(R?0:1),G=F({cols:S,rows:b,xmin:l,ymax:x,xres:y,yres:M,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=w,usePixelCenter:R}),k=[];let E,T=0;const N=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=I(a,P),W=null!=m&&j>0&&v>m/2,O=U(s),A=null!=O&&O.poleLocation>0;for(let p=0;p<S;p++){const e=[];for(let t=0;t<b;t++){let n=G[p*b+t];if(h&&n[0]>v&&n[0]>m/2-L?n[0]-=m:h&&0===p&&n[0]<0&&W&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))k.push(N),k.push(N),e.push(null),T++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),p>0&&h&&E[t]&&n[0]<E[t][0]&&(n[0]+=m,A&&n[0]>v&&n[0]>m&&(n[0]-=m)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:R?[S,b]:[S-1,b-1]}}function ae(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],x=e[n+3];n+=2*o;const m=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function le(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:D(n,t)}function ce(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[i,r]=n.valid,s=r-i;let a=0;if(e.xmin<i){const t=i-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new o({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function fe(e,t,n){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,c="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=c;for(let i=1;i<=l.length;i++){if(e=(l[i-1].x+l[i-1].y)/2,u<=e){u===e?s=i:"down"===n?(s=i-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?i:i-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*i(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(x,m)):"up"===n?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function ue(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=v(o,t,!1),s=H(le(o,(i.x+i.y)/16),t,r);return!s||n||0===ne(s)?s:Z(o,t,r)}function xe(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=z(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=L(c,t),u=256/i,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=ue(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!h&&p&&o&&(t.isGeographic||t.isWebMercator)){const n=$(t);if(h=ne(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*c*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*c*i}const o=Math.ceil(n/t);h=1===o||2===o&&n/2-p.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=x;const n=me(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function me(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=t.isGeographic?4326:3857,o=ue(e,new m({wkid:i}),!0),r=z({x:n,y:n},e.spatialReference,o);return{x:r.x/n,y:r.y/n}}const n=z(e.pixelSize,t,e.extent),i=(n.x+n.y)/2;return{x:e.pixelSize.x/i,y:e.pixelSize.y/i}}function he(e,t){const{spatialReference:n,lods:i}=t,{x:o,y:r}=me(e,n);return i.map(({resolution:e})=>({x:e*o,y:e*r}))}function pe(e){let t=0;for(const n of e){const e=n.length;let i=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)i+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=i/2}return Math.abs(t)}export{xe as computeProjectedScales,me as computeSrcResolutionRatio,he as computeSrcResolutions,d as defaultGridSpacing,M as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,re as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,W as getSourceScale,$ as getWorldWidth,ne as getWorldWrapCount,j as load,w as minimumGridSpacing,ue as projectDatasetExtent,z as projectDatasetResolution,H as projectExtent,O as projectPoint,Q as projectPolygon,C as projectResolution,ce as shiftExtent,le as snapExtent,fe as snapPyramid};
2
+ import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import i from"../../../geometry/Extent.js";import{P as o,a as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{projectWithoutEngine as u}from"../../../geometry/projectionUtils.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as m}from"../../../geometry/support/spatialReferenceUtils.js";function h(){if(!T)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const p=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],x=2*i;let m=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>m&&(m=r+s,p=[r,s]),x&&m>x){h=!0;break}}if(h)break}return p},g={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},y=32,d=4,w=d,M=new Map,R=new Map,S=500,P=39.37,b=96;let G,k,E,T=!1;async function N(){return G||(G=Promise.withResolvers(),k=await import("../../../geometry/operators/projectOperator.js"),E=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),k.isLoaded()||await k.load(),E.isLoaded()||await E.load(),T=!0,G.resolve()),G.promise}function v(e,t,n){if(h(),n){const n=k.execute(e,t);return E.getTransformation(t,e.spatialReference,n)}return E.getTransformation(e.spatialReference,t,e)}function j(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;h();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=k.execute(a,t,{geographicTransformation:o}),c=Z(t);return null==l||null!=c&&l.width>=c?C(e,r,t):{x:l.width,y:l.height}}function C(e,t,i){const o=n(t)/n(i);return{x:e.x*o,y:e.y*o}}function _(e,i,o){const{spatialReference:r}=o;if(!r||!i||r.equals(i))return e;if(r.isGeographic&&i.isGeographic)return C(e,r,i);if(h(),!T)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,x=s*u/2,m=a*u/2,{x:p,y:g}=o.center,y=[];for(let t=0;t<=u;t++)y.push([p-x,g-m+t*a]);for(let t=1;t<=u;t++)y.push([p-x+t*s,g+m]);for(let t=1;t<=u;t++)y.push([p+x,g+m-t*a]);for(let t=1;t<u;t++)y.push([p+x-t*s,g-m]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=k.execute(d,i);if(!w)return C(e,r,i);const M=w.extent,R=Z(i);if(null==M||null!=R&&M.width>=R)return C(e,r,i);const S=he(w.rings),P=s*a*u*u,b=Math.sqrt(S/P)/c,G={x:M.width/c/u,y:M.height/c/u},E={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-E.x*E.y)/N<.1?G:E}function z(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*b*P}function L(e,t){const{pixelSize:n,extent:i}=e;return z(_(n,t,i),t)}function W(e,t=.01){return n(e)?t/n(e):0}function I(e,t,n,i=!0){const o=e.spatialReference;if(o.equals(t))return e;h();const r=k.execute(e,t,{geographicTransformation:n});return i&&r?(O([e],[r],o,t),r):r}function O(e,t,n,i){const o=$(n,!0),r=$(i,!0),s=W(n,S),a=W(i,S);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function A(e){const{inSR:t,outSR:n,preferPE:i}=e;if(t.equals(n)){const{points:t}=J(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return Y(e);if(i){if(t.isGeographic)return q(e);if(null!=B(t))return q(e)}return F(e)}function F(e){const{points:t}=J(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map(e=>new c(e[0],e[1],n)),s=k.executeMany(r,i,{geographicTransformation:o});return o&&O(r,s,n,i),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function q(e){const{inSR:t,outSR:n,datumTransformation:i}=e,s=B(t),{points:c,mask:f}=J(e,s);if(!t.isGeographic){const e=t.wkid?o.coordsys(t.wkid):o.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map(([e])=>e>t?1:e<-t?-1:0)),i.steps.forEach(e=>{const t=e.wkid?o.geogtran(e.wkid):o.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<c.length;n++){const i=e[n],o=c[n][0],r=o>t?1:o<-t?-1:0;i&&r&&i!==r&&(c[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=B(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];X(c,t);const i=n.wkid?o.coordsys(n.wkid):o.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(i,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function Y(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=i/2,f-=o/2);const x=[],m=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+i*Math.min(t,g),r=f-o*Math.min(n,g),h=u(new c({x:e,y:r,spatialReference:s}),s,a);g<=t&&x.push(h.x),g<=n&&m.push(h.y)}const p=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)p.push([x[c],m[e]]);return p}function B(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),M.has(n)){const e=M.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?o.coordsys(e.wkid):o.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=U(i,W(e,1e-4)),a=U(i,0,!0);return M.set(n,{pcs:s,gcs:a}),t?a:s}function U(e,t=0,n=!1){const i=s.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,a=o.find(e=>1===e.getInclusive()&&1===e.getKind());if(!a){if(a=o.find(e=>1===e.getInclusive()&&0===e.getKind()),!a)return null;r=!0}const l=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=a.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:l};let u=0;const x=[];let[m,h]=f[0],[p,g]=f[0];for(let s=0,y=f.length;s<y;s++){u++,u===y&&(u=0);const[e,t]=f[s],[n,i]=f[u];if(i===t)x.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?x.push([o,r,t,i,0]):x.push([o,r,i,t,1])}m=m<e?m:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,h,p,g],poleLocation:l}}function J(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,h=0;t<i;t++){const i=l+r*t,p=e||i>=a&&i<=x;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=u&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<o;m++){const e=c-s*m,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort((e,t)=>e-t)}else t[0]>t[1]&&(i=[t[1],t[0]]);x.push(i)}for(let m=0,h=0;m<i;m++){const e=l+r*m;for(let t=0;t<o;t++,h++){const i=c-s*t,o=x[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function X(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function K(e,t){const n=Z(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function D(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=te(t),l=Z(s,!0),c=Z(n);if(0===a||null==l||null==c){const e=V(t,n,o,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&k.isLoaded()){const i=B(s);if(null!=i&&0===i.poleLocation&&t.width<(i.bbox[2]-i.bbox[0])/2)return Q(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>V(e,n,o,r)).filter(e);return 0===u.length?null:K(u)}function H(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new f({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(h(),k.execute(e,t,{geographicTransformation:n}))}function Q(e,t){const n=Z(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),u=k.execute(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:x}=u,m=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=x[i][0][0],r=a=x[i][0][1];for(let e=0;e<x[i].length;e++)o=o>x[i][e][0]?x[i][e][0]:o,s=s<x[i][e][0]?x[i][e][0]:s,r=r>x[i][e][1]?x[i][e][1]:r,a=a<x[i][e][1]?x[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<m)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<m))return null;h.xmax=s+n}}return h}function V(e,t,n,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;h();const s=k.execute(e,t,{geographicTransformation:n});if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=$(r,!0),l=$(t,!0);if(null==a||null==l)return s;const f=W(r,.001),u=W(r,S),x=W(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<f&&o>u){s.xmin=l[0];const i=[];i.push(new c(e.xmax,e.ymin,r)),i.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmax,e.ymax,r));const o=i.map(e=>I(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,o)}if(o<f&&i>u){s.xmax=l[1];const i=[];i.push(new c(e.xmin,e.ymin,r)),i.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmin,e.ymax,r));const o=i.map(e=>I(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,o)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function Z(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*g[e.wkid]||null}function $(e,t=!1){if(e.isGeographic)return[-180,180];const n=Z(e,t);return n?[-n/2,n/2]:null}function ee(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!==0?o=Math.floor(o):i&&(o-=1),o}function te(e,t=!1){const n=Z(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return ee(r,i,n,!0)-ee(s,i,n,!1)}function ne(e){const t=e.storageInfo.origin.x,n=Z(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:i),h=x?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)===0?i:Math.ceil(i),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:x}}function ie(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(R.has(t))n=R.get(t);else{n=(e.wkid?o.coordsys(e.wkid):o.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),R.set(t,n)}return new x({wkid:n})}function oe(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[y,y],i=re(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:p(i.offsets,o,n,w);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>w)&&(l.isGeographic||B(l),n=[d,d],i=re({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=p(i.offsets,o,n,w)),i.error=s,n[0]>1&&(i.coefficients=se(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=B(l);if(null!=t&&!t.isEnvelope){const t=ie(l),s=D(e.projectedExtent,t),{offsets:a}=re({...e,srcBufferExtent:s,spacing:n}),c=se(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function re(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;h();const{xmin:l,ymin:f,xmax:u,ymax:x}=t,m=Z(a),p=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[y,y],w=g[0]*i.x,M=g[1]*i.y,R=1===g[0],P=Math.ceil((u-l)/w-.1/g[0])+(R?0:1),b=Math.ceil((x-f)/M-.1/g[1])+(R?0:1),G=A({cols:P,rows:b,xmin:l,ymax:x,xres:w,yres:M,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=d,usePixelCenter:R}),k=[];let E,T=0;const N=R?-1:NaN,{xmin:v,xmax:j,ymax:C,width:_,height:z}=n,L=W(a,S),I=null!=m&&v>0&&j>m/2,O=B(s),F=null!=O&&O.poleLocation>0;for(let h=0;h<P;h++){const e=[];for(let t=0;t<b;t++){let n=G[h*b+t];if(p&&n[0]>j&&n[0]>m/2-L?n[0]-=m:p&&0===h&&n[0]<0&&I&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))k.push(N),k.push(N),e.push(null),T++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),h>0&&p&&E[t]&&n[0]<E[t][0]&&(n[0]+=m,F&&n[0]>j&&n[0]>m&&(n[0]-=m)),k.push((n[0]-v)/_),k.push((C-n[1])/z)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:R?[P,b]:[P-1,b-1]}}function se(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],x=e[n+3];n+=2*o;const m=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ae(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:K(n,t)}function le(e){const{spatialReference:t}=e,n=m(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ce(e,t,i){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,f="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===i?(s=n-1,a=u/t>8):s="up"===i||u-t>e-u||u/t>2?n:n-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===i?Math.floor(Math.min(x,m)):"up"===i?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function fe(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=v(o,t,!1),s=D(ae(o,(i.x+i.y)/16),t,r);return!s||n||0===te(s)?s:V(o,t,r)}function ue(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=_(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=z(c,t),u=256/i,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=fe(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!h&&p&&o&&(t.isGeographic||t.isWebMercator)){const n=Z(t);if(h=te(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*c*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*c*i}const o=Math.ceil(n/t);h=1===o||2===o&&n/2-p.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=x;const n=xe(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function xe(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=t.isGeographic?4326:3857,o=fe(e,new x({wkid:i}),!0),r=_({x:n,y:n},e.spatialReference,o);return{x:r.x/n,y:r.y/n}}const n=_(e.pixelSize,t,e.extent),i=(n.x+n.y)/2;return{x:e.pixelSize.x/i,y:e.pixelSize.y/i}}function me(e,t){const{spatialReference:n,lods:i}=t,{x:o,y:r}=xe(e,n);return i.map(({resolution:e})=>({x:e*o,y:e*r}))}function he(e){let t=0;for(const n of e){const e=n.length;let i=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)i+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=i/2}return Math.abs(t)}export{ue as computeProjectedScales,xe as computeSrcResolutionRatio,me as computeSrcResolutions,y as defaultGridSpacing,w as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,A as getProjectedGridPoints,oe as getProjectionOffsetGrid,ne as getRasterDatasetAlignmentInfo,L as getSourceScale,Z as getWorldWidth,te as getWorldWrapCount,N as load,d as minimumGridSpacing,fe as projectDatasetExtent,_ as projectDatasetResolution,D as projectExtent,I as projectPoint,H as projectPolygon,j as projectResolution,le as shiftExtent,ae as snapExtent,ce as snapPyramid};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getAssetUrl as t}from"../../assets.js";function n(){return new Promise(t=>import("../../chunks/lyr3DMain.js").then(t=>t.l).then(({default:n})=>{const e=n({locateFile:i,onRuntimeInitialized:()=>t(e)})})).catch(t=>{throw t})}function e(){return new Promise(t=>import("../../chunks/lyr3DWorker.js").then(t=>t.l).then(({default:n})=>{const e=n({locateFile:i,onRuntimeInitialized:()=>t(e)})})).catch(t=>{throw t})}function i(n){return t(`esri/libs/lyr3d/${n}`)}export{n as loadLyr3DMainWASM,e as loadLyr3DWorkerWASM};
2
+ import{getAssetUrl as t}from"../../assets.js";function n(){return new Promise(t=>import("../../chunks/lyr3DMain.js").then(({default:n})=>{const e=n({locateFile:i,onRuntimeInitialized:()=>t(e)})})).catch(t=>{throw t})}function e(){return new Promise(t=>import("../../chunks/lyr3DWorker.js").then(({default:n})=>{const e=n({locateFile:i,onRuntimeInitialized:()=>t(e)})})).catch(t=>{throw t})}function i(n){return t(`esri/libs/lyr3d/${n}`)}export{n as loadLyr3DMainWASM,e as loadLyr3DWorkerWASM};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.37",
3
+ "version": "5.1.0-next.39",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -19,7 +19,7 @@
19
19
  "license": "SEE LICENSE IN LICENSE.md",
20
20
  "dependencies": {
21
21
  "@amcharts/amcharts5": "~5.16.1",
22
- "@arcgis/toolkit": "^5.1.0-next.37",
22
+ "@arcgis/toolkit": "^5.1.0-next.38",
23
23
  "@esri/arcgis-html-sanitizer": "~4.1.0",
24
24
  "@esri/calcite-components": "^5.0.2",
25
25
  "@vaadin/grid": "~25.0.7",
package/rest/print.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as c}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as u}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),R=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),j=new Map;async function J(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=W(e),r=j.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,j.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function _(e,t,a){return(await C(e,a))[t]??null}async function q(e,t,a){const i=await _(e,t,a);return i?.executionType?R.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const c=await $(t,i,a);if(c.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of c.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let u=null;s?.legendLayers&&(u=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(c.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(c,{exportOptions:n,layoutOptions:l||{}}),Object.assign(c.layoutOptions,{legendOptions:{operationalLayers:null!=u?u:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,j.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(c),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await B(i,t,a)};t.includeTables&&(n.tables=await ce(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function W(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function B(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?G(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ue(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function G(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),u=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=u.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=u.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e,"web-map"),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=u.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete u.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await c(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,u.layerDefinition.fields=a}const m=t?.length;let g;for(let c=0;c<m;c++){const e=t[c]||t.at(c);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?u.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,u,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,c="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||c||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=u(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],c={id:e.id,...await Q(null,l,i,a)};return r.push(c),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,c=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(c);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var u;return e.sublayers?.forEach(c),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(u=xe(e)).layerType,customParameters:u.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let c=96,u=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(c=e.dpi),null!=e.width&&e.width>0&&(u=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===c&&(!u||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},u||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ce(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ue(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const c=i/n,u=c/2-a.width/2-a.x,y=c/2-a.height/2-a.y;if(o.translate(u,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t);else if("uniqueValue"===a||"classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));const i=e["uniqueValue"===a?"uniqueValueInfos":"classBreakInfos"];if(i)for(const e of i)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?R.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{J as execute,z as getGpPrintParams,W as getGpServerUrl,A as getMode,q as getTaskExecutionMode,_ as getTaskInfo,C as getTaskInfos,j as printCacheMap};
2
+ import{id as e}from"../kernel.js";import t from"../request.js";import{JSONMap as a}from"../core/jsonMap.js";import{createScreenPoint as i,pt2px as r,px2pt as n}from"../core/screenUtils.js";import{dataComponents as o,normalize as s}from"../core/urlUtils.js";import l from"../geometry/Polygon.js";import{collectLabelingFields as u}from"../layers/support/fieldUtils.js";import{getFloorFilterClause as c}from"../layers/support/floorFilterUtils.js";import{getSizeRangeAtScale as y}from"../renderers/visualVariables/support/visualVariableUtils.js";import{asValidOptions as f,findToken as p}from"./utils.js";import{execute as d}from"./geoprocessor/execute.js";import{submitJob as m}from"./geoprocessor/submitJob.js";import{formatJsonMap as g}from"./support/fileFormat.js";import{toJSON as b}from"./support/layoutTemplate.js";import{getVisibleLayerViews as h,isScreenshotRequired as w,isBingMapsLayer as S,isBlendLayer as I,getCopyright as x,getSelectionSymbol as v,createPointLayer as D,getContextBoundingBox as L,createPolygonLayer as T,createPolylineLayer as O,createMultipointLayer as V}from"./support/printTaskUtils.js";import E from"./support/PrintTemplate.js";import{toJSON as P}from"./support/reportTemplate.js";import M from"../symbols/WebStyleSymbol.js";import F from"../views/support/HighlightOptions.js";const k={Feet:"ft",Kilometers:"km",Meters:"m",Miles:"mi"},N=new a({esriFeet:"Feet",esriKilometers:"Kilometers",esriMeters:"Meters",esriMiles:"Miles"}),R=new a({esriExecutionTypeSynchronous:"sync",esriExecutionTypeAsynchronous:"async"}),j=new Map;async function J(e,t,a){const i=await U(e,a),r=await z(t,i);if("sync"===await A(e,a)){const{results:t}=await d(e,r,void 0,a);return t?.[0]?.value}const n=await m(e,r,void 0,a);await n.waitForJobCompletion({interval:t.updateDelay});const{value:o}=await n.fetchResultData("Output_File",null,a);return o}async function U(e,a){const i=G(e),r=j.get(i)??{gpServerUrl:i,legendLayerNameMap:{},legendLayers:[],screenshotLayers:[]};return r.gpMetadata??=(await t(i,f({f:"json"},a))).data,r.cimVersion=r.gpMetadata.cimVersion,r.webStyleCache??=new Map,j.set(i,r),r}async function A(e,t){return ve(await U(e,t))}async function C(e,a){const i=await U(e,a),r=i.gpMetadata.tasks,n=i.gpServerUrl;if(i.taskInfos)return i.taskInfos;const o=(await t(e,f({f:"json"},a))).data;i.taskInfos={ExportWebMap:o};const s=r?.filter(e=>e!==o.name)??[];return await Promise.all(s.map(async e=>{const r=(await t(`${n}/${e}`,f({f:"json"},a))).data,o=r.name.startsWith("GetLayoutTemplatesInfo")?"GetLayoutTemplatesInfo":null;o&&(i.taskInfos[o]??=r)})),i.taskInfos}async function q(e,t,a){return(await C(e,a))[t]??null}async function _(e,t,a){const i=await q(e,t,a);return i?.executionType?R.fromJSON(i.executionType):"sync"}async function z(t,a){a=a||{is11xService:!1,legendLayerNameMap:{},legendLayers:[]};const i=t.template||new E;null==i.showLabels&&(i.showLabels=!0);const r=i.exportOptions;let n;const o=b(i.layout);if(r){if(n={dpi:r.dpi},"map_only"===o?.toLowerCase()||""===o){const{width:e,height:t}=r;n.outputSize=null!=e&&null!=t?[e,t]:void 0}}const s=i.layoutOptions;let l;if(s){let e,t;"Miles"===s.scalebarUnit||"Kilometers"===s.scalebarUnit?(e="Kilometers",t="Miles"):"Meters"!==s.scalebarUnit&&"Feet"!==s.scalebarUnit||(e="Meters",t="Feet"),l={titleText:s.titleText,authorText:s.authorText,copyrightText:s.copyrightText,customTextElements:s.customTextElements,elementOverrides:s.elementOverrides,scaleBarOptions:e||t?{metricUnit:N.toJSON(e)??void 0,metricLabel:e?k[e]:void 0,nonMetricUnit:N.toJSON(t)??void 0,nonMetricLabel:t?k[t]:void 0}:void 0}}const u=await $(t,i,a);if(u.operationalLayers){const e=new RegExp("[\\u4E00-\\u9FFF\\u0E00-\\u0E7F\\u0900-\\u097F\\u3040-\\u309F\\u30A0-\\u30FF\\u31F0-\\u31FF]"),t=/[\u0600-\u06FF]/,a=a=>{const i=a.text,r=a.font,n=r?.family?.toLowerCase();i&&r&&("arial"===n||"arial unicode ms"===n)&&(r.family=e.test(i)?"Arial Unicode MS":"Arial","normal"!==r.style&&t.test(i)&&(r.family="Arial Unicode MS"))};for(const i of u.operationalLayers)if(i.featureCollection?.layers)for(const e of i.featureCollection.layers){if(e.layerDefinition?.drawingInfo?.renderer?.symbol){const t=e.layerDefinition.drawingInfo.renderer;"esriTS"===t.symbol.type&&a(t.symbol)}if(e.featureSet?.features)for(const t of e.featureSet.features)t.symbol&&"esriTS"===t.symbol.type&&a(t.symbol)}}let c=null;s?.legendLayers&&(c=s.legendLayers.filter(e=>!a.screenshotLayers.includes(e.layerId)).map(e=>{const t=e.layerId;a.legendLayerNameMap[t]=e.title;const i={id:t};if(e.subLayerIds){i.subLayerIds=e.subLayerIds;const t=e.dynamicLegend;null!=t&&(i.subLayerDynamicLegends=e.subLayerIds.map(()=>t))}return null!=e.dynamicLegend&&(i.dynamicLegend=e.dynamicLegend),i})),t.outSpatialReference&&(u.mapOptions.spatialReference=t.outSpatialReference.toJSON()),Object.assign(u,{exportOptions:n,layoutOptions:l||{}}),Object.assign(u.layoutOptions,{legendOptions:{operationalLayers:null!=c?c:a.legendLayers.slice()}}),a.legendLayers.length=0,a.screenshotLayers.length=0,j.set(a.gpServerUrl,a);const y={Web_Map_as_JSON:JSON.stringify(u),Format:g.toJSON(i.format),Layout_Template:o,Layout_Item_ID:void 0,Report_Template:P(i.report),Report_Item_ID:void 0};if(i.layoutItem){delete y.Layout_Template;const t=i.layoutItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Layout_Item_ID=JSON.stringify({id:t.id})}if(i.reportItem){delete y.Report_Template;const t=i.reportItem;await t.load(),"public"!==t.access&&e&&await e.getCredential(a.gpServerUrl),y.Report_Item_ID=JSON.stringify({id:t.id})}return t.extraParameters&&Object.assign(y,t.extraParameters),y}async function $(e,t,a){const i=e.view;let r=i.spatialReference;const n={operationalLayers:await W(i,t,a)};t.includeTables&&(n.tables=await ue(i));let o=e.extent||a.ssExtent||i.extent;if(r?.isWrappable&&(o=o.clone()._normalize(!0),r=o.spatialReference),n.mapOptions={extent:o&&o.toJSON(),spatialReference:r&&r.toJSON(),showAttribution:t.attributionVisible},a.ssExtent=null,i.background&&(n.background=i.background.toJSON()),i.rotation&&(n.mapOptions.rotation=-i.rotation),t.scalePreserved&&(n.mapOptions.scale=t.outScale||i.scale),null!=i.timeExtent){const e=null!=i.timeExtent.start?i.timeExtent.start.getTime():null,t=null!=i.timeExtent.end?i.timeExtent.end.getTime():null;n.mapOptions.time=[e,t]}return t.reportOptions&&(n.reportOptions=t.reportOptions),n}function G(e){let t=e;const a=t.lastIndexOf("/GPServer/");return a>0&&(t=t.slice(0,a+9)),t}async function W(e,t,a){const i=[];let r=0;t.scalePreserved&&(r=t.outScale||e.scale);const n={layerView:null,outScale:r,printTemplate:t,view:e},o=h(e,r);for(const s of o){const e=s.layer;if(!e.loaded||"layers"in e)continue;let t;n.layerView=s,t=w(s)?await oe(e,n,a):S(e)?B(e):"csv"===e?.type?await H(e,n,a):"catalog-footprint"===e?.type?await K(e,n,a):"feature"===e?.type?await X(e,n,a):"geojson"===e?.type?await Y(e,n,a):"graphics"===e?.type?await Z(e,n,a):"imagery"===e?.type?ee(e,a):"imagery-tile"===e?.type?await te(e,n,a):"kml"===e?.type?await ae(e,n,a):"map-image"===e?.type?ie(e,n,a):"map-notes"===e?.type?await re(n,a):"open-street-map"===e?.type?ne():"stream"===e?.type?await se(e,n,a):"subtype-group"===e?.type?await le(e,a):"tile"===e?.type?ce(e,a):"vector-tile"===e?.type?await ye(e,n,a):"web-tile"===e?.type?fe(e):"wfs"===e?.type?await pe(e,n,a):"wms"===e?.type?de(e,a):"wmts"===e?.type?me(e):await oe(e,n,a),t&&(Array.isArray(t)?i.push(...t):(t.id=e.id,t.title=a.legendLayerNameMap[e.id]||e.title,t.opacity=s.fullOpacity,t.minScale=e.minScale||0,t.maxScale=e.maxScale||0,I(e)&&e.blendMode&&"normal"!==e.blendMode&&(t.blendMode=e.blendMode),i.push(t)))}if(r)for(const s of i)s.minScale=0,s.maxScale=0;if(e.graphics?.length){const r=await Q(null,e.graphics,t,a);r&&i.push(r)}return i}function B(e){return{culture:e.culture,key:e.key,type:"BingMaps"+("aerial"===e.style?"Aerial":"hybrid"===e.style?"Hybrid":"Road")}}async function K(e,{layerView:t,printTemplate:a},i){if(parseFloat(i.cimVersion)<3.1){return Q(e,await Ie(t),a,i)}const r=e.parent,n={id:(o=xe(r,"web-map")).id,url:o.url,layerType:o.layerType,customParameters:o.customParameters,dynamicGroupLayer:{visibility:!1},footprintLayer:o.footprintLayer,layerDefinition:o.layerDefinition};var o;return ge(n,r),n}async function H(e,t,a){e.legendEnabled&&a.legendLayers.push({id:e.id});const i=t.layerView,r=t.printTemplate;if(!(i.filter||e.portalItem&&"public"!==e.portalItem.access)){const t=xe(e,"web-map");return t.type="CSV",delete t.popupInfo,delete t.layerType,t.showLabels=r.showLabels&&e.labelsVisible,t}return Q(e,await Ie(i),r,a)}async function Q(e,t,a,i){let r;const n=T(),o=O(),s=D(),c=V(),y=D();if(y.layerDefinition.name="textLayer",delete y.layerDefinition.drawingInfo,e){if("esri.layers.FeatureLayer"===e.declaredClass||"esri.layers.StreamLayer"===e.declaredClass?n.layerDefinition.name=o.layerDefinition.name=s.layerDefinition.name=c.layerDefinition.name=i.legendLayerNameMap[e.id]||e.arcgisProps?.title||e.title:"esri.layers.GraphicsLayer"===e.declaredClass&&(t=e.graphics.items),e.renderer){const t=e.renderer.toJSON(),a=n.layerDefinition.drawingInfo;a&&(a.renderer=t);const i=o.layerDefinition.drawingInfo;i&&(i.renderer=t);const r=s.layerDefinition.drawingInfo;r&&(r.renderer=t);const l=c.layerDefinition.drawingInfo;l&&(l.renderer=t)}if(a.showLabels&&e.labelsVisible&&"function"==typeof e.write){const t=xe(e,"web-map"),a=t.layerDefinition?.drawingInfo?.labelingInfo;if(a){r=!0;const e=n.layerDefinition.drawingInfo;e&&(e.labelingInfo=a);const t=o.layerDefinition.drawingInfo;t&&(t.labelingInfo=a);const i=s.layerDefinition.drawingInfo;i&&(i.labelingInfo=a);const l=c.layerDefinition.drawingInfo;l&&(l.labelingInfo=a)}}}let f;e?.renderer||r||(delete n.layerDefinition.drawingInfo,delete o.layerDefinition.drawingInfo,delete s.layerDefinition.drawingInfo,delete c.layerDefinition.drawingInfo);const p=e?.fieldsIndex,d=e?.renderer;if(p){const t=new Set;r&&await u(t,e),d&&"function"==typeof d.collectRequiredFields&&await d.collectRequiredFields(t,p),f=Array.from(t);const a=p.fields.map(e=>e.toJSON());n.layerDefinition.fields=a,o.layerDefinition.fields=a,s.layerDefinition.fields=a,c.layerDefinition.fields=a}const m=t?.length;let g;for(let u=0;u<m;u++){const e=t[u]||t.at(u);if(!1!==e.visible&&e.geometry){if(g=e.toJSON(),g.hasOwnProperty("popupTemplate")&&delete g.popupTemplate,g.geometry?.z&&delete g.geometry.z,g.symbol&&(g.symbol.angle||delete g.symbol.angle,De(g.symbol)?g.symbol=await be(g.symbol,i):g.symbol.text&&delete g.attributes),(!a||!a.forceFeatureAttributes)&&f?.length){const e={};for(const t of f)g.attributes?.hasOwnProperty(t)&&(e[t]=g.attributes[t]);g.attributes=e}"polygon"===e.geometry.type?n.featureSet.features.push(g):"polyline"===e.geometry.type?o.featureSet.features.push(g):"point"===e.geometry.type?g.symbol?.text?y.featureSet.features.push(g):s.featureSet.features.push(g):"multipoint"===e.geometry.type?c.featureSet.features.push(g):"extent"===e.geometry.type&&(g.geometry=l.fromExtent(e.geometry).toJSON(),n.featureSet.features.push(g))}}const b=[n,o,c,s,y].filter(e=>e.featureSet.features.length>0);for(const l of b){const e=l.featureSet.features.every(e=>e.symbol);if(e&&(!a||!a.forceFeatureAttributes))for(const t of l.featureSet.features)delete t.attributes;e&&delete l.layerDefinition.drawingInfo,l.layerDefinition.drawingInfo?.renderer&&(await Se(l.layerDefinition.drawingInfo.renderer,i),await he(l.layerDefinition.drawingInfo.renderer,i))}return b.length?{featureCollection:{layers:b},showLabels:r}:null}async function X(e,t,a){let i;const r=e.renderer,n=parseFloat(a.cimVersion);if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type&&(n<2.9||"pie-chart"===e.featureReduction.renderer?.type)||"pie-chart"===r?.type&&n<3.1||"dot-density"===r?.type&&n<2.6||"polygon"===e.geometryType&&r?.authoringInfo?.visualVariables?.some(e=>"spike"===e.theme))return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const o=t.layerView,{printTemplate:s,view:l}=t,u="feature-layer"!==e.source?.type&&"ogc-feature"!==e.source?.type;if(o.filter||u||!r||"field"in r&&null!=r.field&&!e.getField(r.field)){const t=await Ie(o);i=await Q(e,t,s,a)}else{if(i={id:(f=xe(e)).id,title:f.title,url:f.url,layerType:f.layerType,customParameters:f.customParameters,layerDefinition:f.layerDefinition,charts:s.includeCharts?f.charts:void 0},s.attributionVisible&&(i.credits=x(e)),i.showLabels=s.showLabels&&e.labelsVisible&&!!e.labelingInfo&&e.labelingInfo.length>0,ge(i,e),delete i.layerDefinition?.featureReduction?.disablePopup,delete i.layerDefinition?.featureReduction?.popupInfo,o.displayFilterEnabled||delete i.layerDefinition?.displayFilterInfo,i.layerDefinition?.drawingInfo?.renderer&&(delete i.layerDefinition.minScale,delete i.layerDefinition.maxScale,await Se(i.layerDefinition.drawingInfo.renderer,a),await he(i.layerDefinition.drawingInfo.renderer,a),"visualVariables"in r&&r.visualVariables?.[0])){const e=r.visualVariables[0];if("size"===e.type&&e.maxSize&&"number"!=typeof e.maxSize&&e.minSize&&"number"!=typeof e.minSize){const t=y(e,l.scale);i.layerDefinition.drawingInfo.renderer.visualVariables[0].minSize=t.minSize,i.layerDefinition.drawingInfo.renderer.visualVariables[0].maxSize=t.maxSize}}const t=c(o);if(t&&(i.layerDefinition??={},i.layerDefinition.definitionExpression=i.layerDefinition.definitionExpression?`(${i.layerDefinition.definitionExpression}) AND (${t})`:t),e.gdbVersion&&(i.layerDefinition??={},i.layerDefinition.gdbVersion=e.gdbVersion),o.hasHighlight&&"highlightIds"in o){const t=o;i.selectionObjectIds=t.highlightIds;const a=t.highlightOptions??l.defaultHighlight??new F;i.selectionSymbol=v(e.geometryType,a)}}var f;return i}async function Y(e,t,a){if("binning"===e.featureReduction?.type||"cluster"===e.featureReduction?.type)return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});return Q(e,await Ie(t.layerView),t.printTemplate,a)}async function Z(e,{printTemplate:t},a){return Q(e,null,t,a)}function ee(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return a.bandIds=e.bandIds,a.compressionQuality=e.compressionQuality,a.format=e.format,a.interpolation=e.interpolation,(e.mosaicRule||e.definitionExpression)&&(a.mosaicRule=e.exportImageServiceParameters.mosaicRule.toJSON()),e.rasterFunction&&(a.renderingRule=e.rasterFunction.toJSON()),e.renderer&&(a.layerDefinition??={},a.layerDefinition.drawingInfo??={},a.layerDefinition.drawingInfo.renderer=e.renderer.toJSON()),ge(a,e),a}async function te(e,t,a){if("flow"===e.renderer?.type||!e.supportsWrite())return oe(e,t,a);e.legendEnabled&&a.legendLayers.push({id:e.id});const i={bandIds:(r=xe(e)).bandIds,customParameters:r.customParameters,interpolation:r.interpolation,layerDefinition:r.layerDefinition};var r;return i.layerType="ArcGISImageServiceLayer",ge(i,e),i}async function ae(e,t,a){const i=t.printTemplate;if(!e.portalItem||"public"===e.portalItem.access){const t=xe(e,"web-map");return t.type="kml",delete t.layerType,t.url=s(e.url),t}const r=[],n=t.layerView,o="data:image/png;base64,";n.allVisibleMapImages.forEach((t,a)=>{const i={id:`${e.id}_image${a}`,type:"image",title:e.id,minScale:e.minScale||0,maxScale:e.maxScale||0,opacity:n.fullOpacity,extent:t.extent};t.href.startsWith(o)?i.imageData=t.href.slice(o.length):i.url=t.href,r.push(i)});const l=[...n.allVisiblePoints.items,...n.allVisiblePolylines.items,...n.allVisiblePolygons.items],u={id:e.id,...await Q(null,l,i,a)};return r.push(u),r}function ie(e,{outScale:t,printTemplate:a,view:i},r){let n;const o={id:e.id,subLayerIds:[]};let s=[];const l=t||i.scale,u=e=>{const t=0===l,a=0===e.minScale||l<=e.minScale,i=0===e.maxScale||l>=e.maxScale;if(e.visible&&(t||a&&i))if(e.sublayers)e.sublayers.forEach(u);else{const t=e.toExportImageJSON(),a={id:e.id,name:e.title,layerDefinition:{definitionExpression:t.definitionExpression,drawingInfo:t.drawingInfo,orderBy:t.orderBy,source:t.source}};s.unshift(a),o.subLayerIds.push(e.id)}};var c;return e.sublayers?.forEach(u),s.length&&(s=s.map(({id:e,name:t,layerDefinition:a})=>({id:e,name:t,layerDefinition:a})),n={layerType:(c=xe(e)).layerType,customParameters:c.customParameters},n.layers=s,n.visibleLayers=e.capabilities?.exportMap?.supportsDynamicLayers?void 0:o.subLayerIds,a.attributionVisible&&(n.credits=x(e)),e.gdbVersion&&(n.gdbVersion=e.gdbVersion),ge(n,e),e.legendEnabled&&r.legendLayers.push(o)),n}async function re({layerView:e,printTemplate:t},a){const i=[],r=e.layer;if(null!=r.featureCollections)for(const n of r.featureCollections){const e=await Q(n,n.source,t,a);e&&i.push(...e.featureCollection.layers)}else if(null!=r.sublayers)for(const n of r.sublayers){const e=await Q(null,n.graphics,t,a);e&&i.push(...e.featureCollection.layers)}return{featureCollection:{layers:i}}}function ne(){return{type:"OpenStreetMap"}}async function oe(e,{printTemplate:t,view:a},r){const n={type:"image"};r.screenshotLayers.push(e.id);const s={format:"png",ignoreBackground:!0,ignorePadding:!0,layers:[e]};0!==a.rotation&&(s.rotation=0);const l=r.ssExtent||a.state.extent.clone();let u=96,c=!0,y=!0;if(t.exportOptions){const e=t.exportOptions;null!=e.dpi&&e.dpi>0&&(u=e.dpi),null!=e.width&&e.width>0&&(c=e.width%2==a.width%2),null!=e.height&&e.height>0&&(y=e.height%2==a.height%2)}if("map-only"===t.layout&&t.scalePreserved&&(!t.outScale||t.outScale===a.scale)&&96===u&&(!c||!y)&&a.state.extent.equals(a.extent)&&(s.area={x:0,y:0,width:a.width,height:a.height},c||(s.area.width-=1),y||(s.area.height-=1),!r.ssExtent)){const e=a.toMap(i(s.area.width,s.area.height));l.ymin=e.y,l.xmax=e.x,r.ssExtent=l}n.extent=l.clone()._normalize(!0).toJSON();const f=await a.takeScreenshot(s);return n.imageData=o(f.dataUrl)?.data,n}async function se(e,{layerView:t,printTemplate:a},i){e.legendEnabled&&i.legendLayers.push({id:e.id});return Q(e,await Ie(t),a,i)}async function le(e,t){if(e.legendEnabled)for(const r of e.sublayers)r.legendEnabled&&t.legendLayers.push({id:r.id});const a={customParameters:(i=xe(e)).customParameters,effect:i.effect,layerDefinition:i.layerDefinition,layerType:i.layerType,layers:i.layers,url:i.url};var i;if(ge(a,e),Array.isArray(a.layers)){for(const e of a.layers)delete e.popupInfo;a.token&&a.layers.length>0&&(a.layers[a.layers.length-1].token=a.token,delete a.token)}return a}async function ue(e){const t=[],a=[];for(const i of e.map.allTables)"feature"!==i.type||i.loaded||a.push(i.load());a.length&&await Promise.allSettled(a);for(const i of e.map.allTables)if("feature"===i.type&&i.loaded&&i.isTable&&"feature-layer"===i.source?.type){const e=(e=>({id:e.id,title:e.title,customParameters:e.customParameters,layerDefinition:{definitionExpression:e.layerDefinition?.definitionExpression},url:e.url}))(xe(i));ge(e,i),t.push(e)}return t.length?t:void 0}function ce(e,t){e.legendEnabled&&t.legendLayers.push({id:e.id});const a={layerType:(i=xe(e)).layerType,customParameters:i.customParameters};var i;return ge(a,e),a}async function ye(e,t,a){const i=t.layerView;if(e.serviceUrl&&e.styleUrl&&!i.spriteSourceChanged&&!i.styleChanged){const t=p(e.styleUrl,e.apiKey),i=p(e.serviceUrl,e.apiKey);if(!t&&!i||"2.1.0"!==a.cimVersion){const a={type:"VectorTileLayer"};return a.styleUrl=s(e.styleUrl),a.token=t,i!==t&&(a.additionalTokens=[{url:e.serviceUrl,token:i}]),a}}return oe(e,t,a)}function fe(e){const t=e.urlTemplate?.replaceAll("${","{"),a={type:"WebTiledLayer",urlTemplate:t,credits:e.copyright};return e.subDomains&&e.subDomains.length>0&&(a.subDomains=e.subDomains),a}async function pe(e,t,a){return parseFloat(a.cimVersion)<3.5?oe(e,t,a):(e.legendEnabled&&a.legendLayers.push({id:e.id}),{layerType:(i=xe(e,"web-map")).layerType,layerDefinition:i.layerDefinition,url:i.url,wfsInfo:i.wfsInfo});var i}function de(e,t){let a;const i=[],r=e=>{e.visible&&(e.sublayers?e.sublayers.forEach(r):e.name&&i.unshift(e.name))};return e.sublayers&&e.sublayers.forEach(r),i.length&&(e.legendEnabled&&t.legendLayers.push({id:e.id,subLayerIds:i}),a={type:"wms",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,transparentBackground:e.imageTransparency,visibleLayers:i,url:s(e.url),version:e.version}),a}function me(e){const t=e.activeLayer;return{type:"wmts",customLayerParameters:e.customLayerParameters,customParameters:e.customParameters,format:t.imageFormat,layer:t.id,style:t.styleId,tileMatrixSet:t.tileMatrixSetId,url:s(e.url)}}function ge(e,t){t.url&&(e.url=s(e.url||t.url),e.token=p(e.url,t.apiKey))}async function be(e,a){a.canvas||(a.canvas=document.createElement("canvas"));const i=1024;a.canvas.width=i,a.canvas.height=i;const o=a.canvas.getContext("2d");let s,l;if(e.path){const t=new Path2D(e.path);t.closePath(),o.fillStyle=Array.isArray(e.color)?`rgba(${e.color[0]},${e.color[1]},${e.color[2]},${e.color[3]/255})`:"rgb(0,0,0)",o.fill(t);const a=L(o);if(!a)return null;o.clearRect(0,0,i,i);const n=r(e.size)/Math.max(a.width,a.height);o.scale(n,n);const u=i/n,c=u/2-a.width/2-a.x,y=u/2-a.height/2-a.y;if(o.translate(c,y),Array.isArray(e.color)&&o.fill(t),e.outline?.width&&Array.isArray(e.outline.color)){const i=e.outline;o.lineWidth=r(i.width)/n,o.lineJoin="round",o.strokeStyle=`rgba(${i.color[0]},${i.color[1]},${i.color[2]},${i.color[3]/255})`,o.stroke(t),a.width+=o.lineWidth,a.height+=o.lineWidth}a.width*=n,a.height*=n;const f=o.getImageData(i/2-a.width/2,i/2-a.height/2,Math.ceil(a.width),Math.ceil(a.height));s=f.width,l=f.height,o.canvas.width=s,o.canvas.height=l,o.putImageData(f,0,0)}else{const a="image/svg+xml"===e.contentType?"data:image/svg+xml;base64,"+e.imageData:e.url,i=(await t(a,{responseType:"image"})).data;s=r(e.width),l=r(e.height),o.canvas.width=s,o.canvas.height=l,o.drawImage(i,0,0,o.canvas.width,o.canvas.height)}return{type:"esriPMS",imageData:o.canvas.toDataURL("image/png").slice(22),angle:e.angle,contentType:"image/png",height:n(l),width:n(s),xoffset:e.xoffset,yoffset:e.yoffset}}async function he(e,t){const a=e.type;if("simple"===a&&De(e.symbol))e.symbol=await be(e.symbol,t)??{type:"esriSMS",color:[0,0,0,0],size:0,style:"esriSMSSquare"};else if("uniqueValue"===a){if(De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t)),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t));if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)De(e.symbol)&&(e.symbol=await be(e.symbol,t))}else if("classBreaks"===a){De(e.defaultSymbol)&&(e.defaultSymbol=await be(e.defaultSymbol,t));for(const a of e.classBreakInfos)De(a.symbol)&&(a.symbol=await be(a.symbol,t))}}async function we(e,t){if("styleSymbolReference"!==e?.type)return e;try{const a=await M.fromJSON(e).fetchSymbol({cache:t.webStyleCache});return a?.toJSON()??e}catch{return e}}async function Se(e,t){if("simple"===e.type&&e.symbol)e.symbol=await we(e.symbol,t);else if("uniqueValue"===e.type){if(e.defaultSymbol=await we(e.defaultSymbol,t),"uniqueValueInfos"in e&&e.uniqueValueInfos)for(const a of e.uniqueValueInfos)a.symbol=await we(a.symbol,t);if("uniqueValueGroups"in e&&e.uniqueValueGroups)for(const a of e.uniqueValueGroups)for(const e of a.classes)e.symbol=await we(e.symbol,t)}else if("classBreaks"===e.type){e.defaultSymbol=await we(e.defaultSymbol,t);for(const a of e.classBreakInfos)a.symbol=await we(a.symbol,t)}}async function Ie(e){return e.queryFeatures(e.createQuery()).then(e=>e.features)}function xe(e,t){return e.write({},{ignorePersistenceEnabled:!0,origin:t})??{}}function ve(e){return e.gpMetadata?.executionType?R.fromJSON(e.gpMetadata.executionType):"sync"}function De(e){return e&&(e.path||"image/svg+xml"===e.contentType||e.url?.endsWith(".svg"))}export{J as execute,z as getGpPrintParams,G as getGpServerUrl,A as getMode,_ as getTaskExecutionMode,q as getTaskInfo,C as getTaskInfos,j as printCacheMap};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const c="20260310",f="53e28c284c5837474fdd2cc35f1f080cf29c457b";export{c as buildDate,f as commitHash};
2
+ const c="20260312",b="701f3a4dbef1743e0a6cbbc3cbc01d12f4d9d0cb";export{c as buildDate,b as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{createResolver as t,onAbortOrThrow as e,throwIfNotAbortError as i}from"../../../core/promiseUtils.js";import{identity as s,translate as r,rotate as h,scaleByVec2 as o,multiply as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as l}from"./DisplayObject.js";import c from"./ImageryBitmapSource.js";import{SizedPixelFormat as d}from"../../webgl/enums.js";import _ from"../../webgl/Texture.js";import{TextureDescriptor as p}from"../../webgl/TextureDescriptor.js";function m(t){t instanceof ImageBitmap&&t.close()}function x(t){return t&&"render"in t}function g(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function f(t){return x(t)?t instanceof c?t.getRenderedRasterPixels()?.renderedRasterPixels:g(t):t}class w extends l{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._texture=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){super.destroy(),this._texture&&(this._texture.dispose(),this._texture=null),this._source&&m(this._source),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source&&m(this._source),this._source=t,this.invalidateTexture(),this.requestRender())}get texture(){return this._texture}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(i,s){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const r=new AbortController,h=t();return e(s,()=>r.abort()),e(r,t=>h.reject(t)),this._uploadStatus={controller:r,resolver:h},this.source=i,h.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=s(this.transforms.displayViewScreenMat3),[i,a]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,c=l*this.width,d=l*this.height,_=Math.PI*this.rotation/180;r(e,e,n(i,a)),r(e,e,n(c/2,d/2)),h(e,e,-_),r(e,e,n(-c/2,-d/2)),o(e,e,n(c,d)),u(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=f(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:i}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=e.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),i.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){i(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:a()}}_createTexture(t){const e=this.immutable,i=new p(this._sourceWidth,this._sourceHeight);return i.internalFormat=e?d.RGBA8:6408,i.wrapMode=33071,i.isImmutable=e,new _(t,i)}}export{w as Bitmap,x as isImageSource,g as rasterize};
2
+ import{onAbortOrThrow as t,throwIfNotAbortError as e}from"../../../core/promiseUtils.js";import{identity as i,translate as s,rotate as r,scaleByVec2 as h,multiply as o}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as a}from"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as n}from"./DisplayObject.js";import l from"./ImageryBitmapSource.js";import{SizedPixelFormat as c}from"../../webgl/enums.js";import d from"../../webgl/Texture.js";import{TextureDescriptor as _}from"../../webgl/TextureDescriptor.js";function m(t){t instanceof ImageBitmap&&t.close()}function p(t){return t&&"render"in t}function x(t){const e=document.createElement("canvas");return e.width=t.width,e.height=t.height,t.render(e.getContext("2d")),e}function g(t){return p(t)?t instanceof l?t.getRenderedRasterPixels()?.renderedRasterPixels:x(t):t}class f extends n{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._texture=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){super.destroy(),this._texture&&(this._texture.dispose(),this._texture=null),this._source&&m(this._source),null!=this._uploadStatus&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return void 0!==this._height?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){null==t&&null==this._source||(this._source&&m(this._source),this._source=t,this.invalidateTexture(),this.requestRender())}get texture(){return this._texture}get width(){return void 0!==this._width?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(e,i){null!=this._uploadStatus&&this._uploadStatus.controller.abort();const s=new AbortController,r=Promise.withResolvers();return t(i,()=>s.abort()),t(s,t=>r.reject(t)),this._uploadStatus={controller:s,resolver:r},this.source=e,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=i(this.transforms.displayViewScreenMat3),[u,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,c=l*this.width,d=l*this.height,_=Math.PI*this.rotation/180;s(e,e,a(u,n)),s(e,e,a(c/2,d/2)),r(e,e,-_),s(e,e,a(-c/2,-d/2)),h(e,e,a(c,d)),o(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:i}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const s=g(this.source);try{if(null!=this._uploadStatus){const{controller:t,resolver:e}=this._uploadStatus,r={signal:t.signal},{width:h,height:o}=this,u=this._texture,a=i.textureUploadManager;await a.enqueueTextureUpdate({data:s,texture:u,width:h,height:o},r),e.resolve(),this._uploadStatus=null}else this._texture.setData(s);this.ready()}catch(r){e(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:u()}}_createTexture(t){const e=this.immutable,i=new _(this._sourceWidth,this._sourceHeight);return i.internalFormat=e?c.RGBA8:6408,i.wrapMode=33071,i.isImmutable=e,new d(t,i)}}export{f as Bitmap,p as isImageSource,x as rasterize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,translate as s,rotate as r,scaleByVec2 as i,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as o}from"../DisplayObject.js";import{createTransformTexture as n,createPixelMaskTexture as l,createRasterTexture as d,createColormapTexture as _}from"../../../webgl/rasterUtils.js";const x={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class m extends o{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._maskTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this._highlightTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._highlighted=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._mask=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){super.destroy(),this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get highlightTexture(){return this._highlightTexture}set highlightTexture(t){this._highlightTexture!==t&&(this._highlightTexture?.dispose(),this._highlightTexture=t),null==t&&(this._highlighted=!1)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(this.processedTexture=t(this.processedTexture),this.invalidateTexture())}get highlighted(){return this._highlighted}get symbolizerParameters(){return this._symbolizerParameters||x}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._maskTexture=t(this._maskTexture))}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdsChanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?9729:9728)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:a()}}setTransform(t){const a=e(this.transforms.displayViewScreenMat3),[o,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,_=l*this.height,x=Math.PI*this.rotation/180;s(a,a,u(o,n)),s(a,a,u(d/2,_/2)),r(a,a,-x),s(a,a,u(-d/2,-_/2)),i(a,a,u(d,_)),h(this.transforms.displayViewScreenMat3,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),!this._colormapTexture||!e&&t||(i.push(this._colormapTexture),r.push("u_colormap")),this._maskTexture&&(i.push(this._maskTexture),r.push("u_mask")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?(this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=n(t,this.transformGrid)),this._mask&&!this._maskTexture&&(this._maskTexture=l(t,this._mask,[this.width,this.height]))):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(t=!0){t&&(this._highlighted=null!=this.highlightTexture);const{functionTextures:e}=this;0!==e.length&&(this.processedTexture=e.shift(),e.forEach(t=>t?.dispose()),e.length=0,this.processed=!!this.processedTexture)}_createOrDestroyRasterTexture(e){const s=this.source?.extractBands(this.bandIds);if(!this._isValidSource(s))return void(this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),h=this.isRendereredSource;this._rasterTexture=d(e,s,i,h),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&e.join("")===t?.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e&&!this.symbolizerParameters.isClassBreaks||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(e){const s=this._colormap,r=this.symbolizerParameters.colormap;return r?s?r.length!==s.length||r.some((t,e)=>t!==s[e])?(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),this._colormapTexture=_(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=_(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),void(this._colormap=null))}_disposeTextures(e=!1){e?this.projected&&(this._transformGridTexture=t(this._transformGridTexture)):(this._rasterTexture=t(this._rasterTexture),this._colormapTexture=t(this._colormapTexture),this._transformGridTexture=t(this._transformGridTexture),this._maskTexture=t(this._maskTexture),this._rasterTextureBandIds=null,this._colormap=null,this._colormapTextureInvalidated=!0),this._processedTexture=t(this._processedTexture),this._highlightTexture=t(this._highlightTexture)}}class c extends m{get source(){return this._source}}export{m as RasterBitmap,c as RasterBitmapWithSource};
2
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{identity as e,translate as s,rotate as r,scaleByVec2 as i,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{DisplayObject as o}from"../DisplayObject.js";import{createTransformTexture as n,createPixelMaskTexture as l,createRasterTexture as d,createColormapTexture as _}from"../../../webgl/rasterUtils.js";const x={bandCount:3,minOutput:0,maxOutput:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class m extends o{constructor(t=null,e=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._maskTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this._highlightTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._highlighted=!1,this._symbolizerParameters=null,this.height=null,this.isRenderedSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._mask=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=t,this.transformGrid=e,this.interpolation=s}destroy(){super.destroy(),this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(t){this._processedTexture!==t&&(this._disposeTextures(!0),this._processedTexture=t)}get highlightTexture(){return this._highlightTexture}set highlightTexture(t){this._highlightTexture!==t&&(this._highlightTexture?.dispose(),this._highlightTexture=t),null==t&&(this._highlighted=!1)}get rasterTexture(){return this._rasterTexture}set rasterTexture(t){this._rasterTexture!==t&&(this._rasterTexture?.dispose(),this._rasterTexture=t),null==t&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(this.processedTexture=t(this.processedTexture),this.invalidateTexture())}get highlighted(){return this._highlighted}get symbolizerParameters(){return this._symbolizerParameters||x}set symbolizerParameters(t){this._symbolizerParameters!==t&&(this._symbolizerParameters=t,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null),this.projected=!1,this.invalidateTexture())}get mask(){return this._mask}set mask(e){this._mask!==e&&(this._mask=e,this._maskTexture=t(this._maskTexture))}get suspended(){return this._suspended}set suspended(t){this._suspended&&!t&&this.stage&&(this.ready(),this.requestRender()),this._suspended=t}get bandIds(){return this._bandIds}set bandIds(t){this._bandIds=t,this._isBandIdsChanged(t)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(t){this._interpolation=t,this._rasterTexture&&this._rasterTexture.setSamplingMode("bilinear"===this._getTextureSamplingMethod(t||"nearest")?9729:9728)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=t(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(t=!1){const e=t||this.projected;return[e?this.width:this.source?.width||this.width,e?this.height:this.source?.height||this.height]}getRasterCellSize(){const t=this.rawPixelData?.srcPixelSize,{projected:e,resolution:s}=this;return t&&!e?[t.x,t.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:a()}}setTransform(t){const a=e(this.transforms.displayViewScreenMat3),[o,n]=t.toScreenNoRotation([0,0],[this.x,this.y]),l=this.resolution/this.pixelRatio/t.resolution,d=l*this.width,_=l*this.height,x=Math.PI*this.rotation/180;s(a,a,u(o,n)),s(a,a,u(d/2,_/2)),r(a,a,-x),s(a,a,u(-d/2,-_/2)),i(a,a,u(d,_)),h(this.transforms.displayViewScreenMat3,t.displayViewMat3,a)}getTextures({forProcessing:t=!1,useProcessedTexture:e=!1}={}){const s=e?this._processedTexture??this._rasterTexture:this._rasterTexture,r=[],i=[];return s?(this._transformGridTexture&&!this.projected&&(i.push(this._transformGridTexture),r.push("u_transformGrid")),i.push(s),r.push("u_image"),!this._colormapTexture||!e&&t||(i.push(this._colormapTexture),r.push("u_colormap")),this._maskTexture&&(i.push(this._maskTexture),r.push("u_mask")),{names:r,textures:i}):{names:r,textures:i}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:t}){if(!this.stage)return void this._disposeTextures();const e=this._isValidSource(this.source);e&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(t)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(t),this._rasterTexture&&(e?(this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=n(t,this.transformGrid)),this._mask&&!this._maskTexture&&(this._maskTexture=l(t,this._mask,[this.width,this.height]))):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(t=!0){t&&(this._highlighted=null!=this.highlightTexture);const{functionTextures:e}=this;0!==e.length&&(this.processedTexture=e.shift(),e.forEach(t=>t?.dispose()),e.length=0,this.processed=!!this.processedTexture)}_createOrDestroyRasterTexture(e){const s=this.source?.extractBands(this.bandIds);if(!this._isValidSource(s))return void(this._rasterTexture&&(this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture=t(this._rasterTexture),this._rasterTextureBandIds=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),h=this.isRenderedSource;this._rasterTexture=d(e,s,i,h),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(t){const e=this._rasterTextureBandIds;return!(null==e&&null==t||e&&e.join("")===t?.join(""))}_isValidSource(t){return null!=t&&t.pixels?.length>0}_getTextureSamplingMethod(t){const{type:e}=this.symbolizerParameters,s="lut"===e&&!this.symbolizerParameters.isClassBreaks||"hillshade"===e||"stretch"===e&&1===this.symbolizerParameters.bandCount;return!this._supportsBilinearTexture||s||"bilinear"!==t&&"cubic"!==t?"nearest":"bilinear"}_updateColormapTexture(e){const s=this._colormap,r=this.symbolizerParameters.colormap;return r?s?r.length!==s.length||r.some((t,e)=>t!==s[e])?(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),this._colormapTexture=_(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=_(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture=t(this._colormapTexture)),void(this._colormap=null))}_disposeTextures(e=!1){e?this.projected&&(this._transformGridTexture=t(this._transformGridTexture)):(this._rasterTexture=t(this._rasterTexture),this._colormapTexture=t(this._colormapTexture),this._transformGridTexture=t(this._transformGridTexture),this._maskTexture=t(this._maskTexture),this._rasterTextureBandIds=null,this._colormap=null,this._colormapTextureInvalidated=!0),this._processedTexture=t(this._processedTexture),this._highlightTexture=t(this._highlightTexture)}}class c extends m{get source(){return this._source}}export{m as RasterBitmap,c as RasterBitmapWithSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Accessor.js";import has from"../../../../core/has.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{property as s,subclass as o}from"../../../../core/accessorSupport/decorators.js";let r=class extends e{constructor(t){super(t),this.computedOpacity=1,this.computedVisible=!0,this.opacity=1,this.visible=!0,this._fadeOutResolver=null,this._fadeInResolver=null}get transitioning(){return(this._fadeOutResolver||!this.visible?0:this.opacity)!==this.computedOpacity}endTransition(){this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeInResolver=this._fadeOutResolver=null,this.computedOpacity=this.visible?this.opacity:0}fadeIn(){return this._fadeInResolver||(this.opacity=1,this.computedOpacity=0,this._fadeOutResolver?.(),this._fadeOutResolver=null,this._fadeInResolver=i()),this._fadeInResolver.promise}fadeOut(){return this._fadeOutResolver||(this.opacity=0,this._fadeInResolver?.(),this._fadeInResolver=null,this._fadeOutResolver=i()),this._fadeOutResolver.promise}transitionStep(t,e){const i=has("mapview-transitions-duration"),s=i?1/i:0;if(0===s)this.computedOpacity=this.opacity,this.computedVisible=this.visible;else{const e=this._fadeOutResolver||!this.visible?0:this.opacity,i=this.computedOpacity;if(i===e)this.computedVisible=this.visible;else{const o=t*s;this.computedOpacity=i>e?Math.max(e,i-o):Math.min(e,i+o),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};t([s()],r.prototype,"computedOpacity",void 0),t([s()],r.prototype,"computedVisible",void 0),t([s()],r.prototype,"opacity",void 0),t([s()],r.prototype,"visible",void 0),t([s()],r.prototype,"transitioning",null),t([s()],r.prototype,"_fadeOutResolver",void 0),t([s()],r.prototype,"_fadeInResolver",void 0),r=t([o("esri.views.2d.engine.transitions.FadeTransition")],r);export{r as FadeTransition};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import has from"../../../../core/has.js";import{property as i,subclass as s}from"../../../../core/accessorSupport/decorators.js";let o=class extends t{constructor(e){super(e),this.computedOpacity=1,this.computedVisible=!0,this.opacity=1,this.visible=!0,this._fadeOutResolver=null,this._fadeInResolver=null}get transitioning(){return(this._fadeOutResolver||!this.visible?0:this.opacity)!==this.computedOpacity}endTransition(){this._fadeInResolver?.resolve(),this._fadeOutResolver?.resolve(),this._fadeInResolver=this._fadeOutResolver=null,this.computedOpacity=this.visible?this.opacity:0}fadeIn(){return this._fadeInResolver||(this.opacity=1,this.computedOpacity=0,this._fadeOutResolver?.resolve(),this._fadeOutResolver=null,this._fadeInResolver=Promise.withResolvers()),this._fadeInResolver.promise}fadeOut(){return this._fadeOutResolver||(this.opacity=0,this._fadeInResolver?.resolve(),this._fadeInResolver=null,this._fadeOutResolver=Promise.withResolvers()),this._fadeOutResolver.promise}transitionStep(e,t){const i=has("mapview-transitions-duration"),s=i?1/i:0;if(0===s)this.computedOpacity=this.opacity,this.computedVisible=this.visible;else{const t=this._fadeOutResolver||!this.visible?0:this.opacity,i=this.computedOpacity;if(i===t)this.computedVisible=this.visible;else{const o=e*s;this.computedOpacity=i>t?Math.max(t,i-o):Math.min(t,i+o),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.resolve(),this._fadeOutResolver?.resolve(),this._fadeOutResolver=this._fadeInResolver=null)}};e([i()],o.prototype,"computedOpacity",void 0),e([i()],o.prototype,"computedVisible",void 0),e([i()],o.prototype,"opacity",void 0),e([i()],o.prototype,"visible",void 0),e([i()],o.prototype,"transitioning",null),e([i()],o.prototype,"_fadeOutResolver",void 0),e([i()],o.prototype,"_fadeInResolver",void 0),o=e([s("esri.views.2d.engine.transitions.FadeTransition")],o);export{o as FadeTransition};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{createResolver as e,throwIfAborted as t,onAbortOrThrow as s}from"../../../../core/promiseUtils.js";import{textureUploadManagerChunkSize as o,textureUploadManagerBudget as u}from"./definitions.js";class r{constructor(e){this._queue=[],this._refreshable=e}destroy(){this._queue=[]}enqueueTextureUpdate(u,r){const n=e(),h=u,i=o,a=Math.ceil(h.height/i);t(r);for(let e=0;e<a;e++){const t=e*i,s=e===a-1,o=s?h.height-i*e:i;this._queue.push({type:"chunk",request:u,resolver:n,chunk:e,chunkOffset:t,destHeight:o,chunkIsLast:s,options:r})}return s(r,e=>n.reject(e)),n.promise}upload(){const e=performance.now();let t=0;for(;this._queue.length;){const s=this._queue.shift();if(s){if(null!=s.options.signal&&s.options.signal.aborted)continue;switch(s.type){case"chunk":this._uploadChunk(s);break;case"no-chunk":this._uploadNoChunk(s)}++t;const o=performance.now()-e;if(o+o/t>=u)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:t,resolver:s,chunkOffset:o,chunkIsLast:u,destHeight:r}=e,{data:n,texture:h,width:i}=t;null!=n&&(h.updateData(0,0,o,i,r,n,o),u&&s.resolve())}_uploadNoChunk(e){const{request:t,resolver:s}=e,{data:o,texture:u}=t;u.setData(o),s.resolve()}}export{r as TextureUploadManager};
2
+ import{throwIfAborted as e,onAbortOrThrow as t}from"../../../../core/promiseUtils.js";import{textureUploadManagerChunkSize as s,textureUploadManagerBudget as o}from"./definitions.js";class r{constructor(e){this._queue=[],this._refreshable=e}destroy(){this._queue=[]}enqueueTextureUpdate(o,r){const u=Promise.withResolvers(),n=o,h=s,i=Math.ceil(n.height/h);e(r);for(let e=0;e<i;e++){const t=e*h,s=e===i-1,a=s?n.height-h*e:h;this._queue.push({type:"chunk",request:o,resolver:u,chunk:e,chunkOffset:t,destHeight:a,chunkIsLast:s,options:r})}return t(r,e=>u.reject(e)),u.promise}upload(){const e=performance.now();let t=0;for(;this._queue.length;){const s=this._queue.shift();if(s){if(null!=s.options.signal&&s.options.signal.aborted)continue;switch(s.type){case"chunk":this._uploadChunk(s);break;case"no-chunk":this._uploadNoChunk(s)}++t;const r=performance.now()-e;if(r+r/t>=o)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(e){const{request:t,resolver:s,chunkOffset:o,chunkIsLast:r,destHeight:u}=e,{data:n,texture:h,width:i}=t;null!=n&&(h.updateData(0,0,o,i,u,n,o),r&&s.resolve())}_uploadNoChunk(e){const{request:t,resolver:s}=e,{data:o,texture:r}=t;r.setData(o),s.resolve()}}export{r as TextureUploadManager};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{createResolver as e}from"../../../../../../core/promiseUtils.js";import{Container as s}from"../../../Container.js";import{TestDisplayObject as r}from"./TestDisplayObject.js";class t extends s{constructor(e,s){super(),this.store=e,this.meshData=s}whenRender(){return null==this._resolver&&(this._resolver=e(),this.requestRender()),this._resolver.promise}doRender(e){const s=this._stage?.bufferPool,t=r.fromMeshData(this.meshData,s,this.store);for(const[r,o]of this.store.entries())t.setActiveMesh(r),o.techniqueRef.render(e,t);t.destroy(),this._resolver&&(this._resolver.resolve(),this._resolver=null)}}export{t as TechniqueDebugContainer};
2
+ import{Container as e}from"../../../Container.js";import{TestDisplayObject as s}from"./TestDisplayObject.js";class r extends e{constructor(e,s){super(),this.store=e,this.meshData=s}whenRender(){return null==this._resolver&&(this._resolver=Promise.withResolvers(),this.requestRender()),this._resolver.promise}doRender(e){const r=this._stage?.bufferPool,t=s.fromMeshData(this.meshData,r,this.store);for(const[s,o]of this.store.entries())t.setActiveMesh(s),o.techniqueRef.render(e,t);t.destroy(),this._resolver&&(this._resolver.resolve(),this._resolver=null)}}export{r as TechniqueDebugContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as s}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{FramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import m from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";const h=160,p=new Set(["f32","f64","u16","s16","u32","s32"]);class f extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new o,stretch:new n,shadedRelief:new r},this._mosaicFbo=null,this._statisticsTechnique=null,this._draTimer=0}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const s=i.bitmaps.some(g);s||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const o=s?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:s}=e.symbolizerParameters,r="stretch"===s?this._getStretchOptions(e,o):"lut"===s?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(t.context,r,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const s=this._statisticsTechnique;let o=has("esri-2d-dra-delay");if(null==o){const e=t.bitmaps.find(g),{stretchType:i,bandCount:s}=e.symbolizerParameters,{pixelType:r}=e.source;"minMax"===i&&s>=3&&p.has(r)&&(o=h)}if(o){const i=performance.now();(i-this._draTimer>=o||e.stationary||!s.minValuesTexture)&&(this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo}),this._draTimer=i)}else this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo});return{minTexture:s.minValuesTexture,maxTexture:s.maxValuesTexture,meanTexture:s.meanValuesTexture,stddevTexture:s.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:s}=e,o=i.getBoundFramebufferObject();if(this._mosaicFbo)this._mosaicFbo.resize(o.width,o.height);else{const e=d(i,o.width,o.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const r="RasterColorizerMosaic";for(const n of t.bitmaps){if(!g(n))continue;e.timeline.begin(r),s.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,s.submitDrawMesh(e.context,i,s.quadMesh,n),n.interpolation=t,e.timeline.end(r)}i.bindFramebuffer(o)}_getLutOptions(e){const{config:t,projectionConfig:i,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),u=s(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n},defines:{...a,...u,applyPixelMask:!!r,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const i=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,projectionDefines:c,textureUnit:m}=this._getCommonConfig(e),l=s(e),h=t?{minTexture:{texture:t.minTexture,unit:m},maxTexture:{texture:t.maxTexture,unit:m+1},meanTexture:{texture:t.meanTexture,unit:m+2},stddevTexture:{texture:t.stddevTexture,unit:m+3},numberOfStandardDeviations:i.numberOfStandardDeviations||2}:void 0,p=t?"standardDeviation"===i.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:i,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,statisticsConfig:h},defines:{...c,...l,isMultiband:i.bandCount>1,applyColormap:!!n,useGamma:i.useGamma,noOp:e.isRendereredSource&&!e.processed,applyPixelMask:!!a,applyPixelHighlights:!!u,draStretchType:p},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:o,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a,projectionDefines:u}=this._getCommonConfig(e),c=s(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:o,config:i,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a},defines:{...u,...c,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:s}=e,{names:o,textures:r}=e.getTextures({useProcessedTexture:e.processed}),n=r[o.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={texture:{texture:n,unit:u++},dvsMat3:s.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m=r[o.indexOf("u_transformGrid")],{transformGrid:l}=e,h=!(!m||!l),p=h?{transformTexture:{texture:m,unit:u++},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,f=r[o.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,x=f&&d?{colormapTexture:{texture:f,unit:u++},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,b=r[o.indexOf("u_mask")],T=b?{maskTexture:{texture:b,unit:u++}}:void 0,{highlightTexture:C}=e;return{config:c,projectionConfig:p,colormapConfig:x,pixelMaskConfig:T,highlightConfig:C?{highlightTexture:{texture:C,unit:u++}}:void 0,projectionDefines:{applyProjection:h,lookupProjection:h&&1===l.spacing[0]},textureUnit:u}}}function d(e,t,i){const s=new l(t,i);return s.internalFormat=a.RGBA32F,s.samplingMode=9728,s.dataType=u.FLOAT,s.wrapMode=33071,new m(e,s)}function g(e){return!e.suspended&&null!=e.source&&!e.isRendereredSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{f as RasterColorizerTechnique};
2
+ import has from"../../../../../../../core/has.js";import{disposeMaybe as e}from"../../../../../../../core/maybe.js";import{Technique as t}from"../Technique.js";import{TextureStatisticsTechnique as i}from"../TextureStatisticsTechnique.js";import{getInterpolationDefines as s}from"./processor/textureUtils.js";import{RasterColorizerLUTShader as o}from"../shaders/raster/RasterColorizerLUTShader.js";import{RasterColorizerShadedReliefShader as r}from"../shaders/raster/RasterColorizerShadedReliefShader.js";import{RasterColorizerStretchShader as n}from"../shaders/raster/RasterColorizerStretchShader.js";import{SizedPixelFormat as a,PixelType as u}from"../../../../../../webgl/enums.js";import{FramebufferObject as c}from"../../../../../../webgl/FramebufferObject.js";import m from"../../../../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../../../../webgl/TextureDescriptor.js";const h=160,p=new Set(["f32","f64","u16","s16","u32","s32"]);class f extends t{constructor(){super(...arguments),this.name="BrushRasterColorizer",this.type=0,this.shaders={lut:new o,stretch:new n,shadedRelief:new r},this._mosaicFbo=null,this._statisticsTechnique=null,this._draTimer=0}shutdown(t){super.shutdown(t),this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique)}render(t,i){const s=i.bitmaps.some(g);s||(this._mosaicFbo=e(this._mosaicFbo),this._statisticsTechnique=e(this._statisticsTechnique));const o=s?this._computeStatisticsTextures(t,i):void 0;for(const e of i.bitmaps){if(!e.source||e.suspended)continue;t.timeline.begin(this.name);const{painter:i}=t;i.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}}),e.updateTexture(t),e.updateProcessedTexture();const{type:s}=e.symbolizerParameters,r="stretch"===s?this._getStretchOptions(e,o):"lut"===s?this._getLutOptions(e):this._getShadedReliefOptions(e);"bilinear"!==e.interpolation||t.context.capabilities.textureFloatLinear||(r.defines.bilinear=!0),i.submitDrawMesh(t.context,r,i.quadMesh,e),t.timeline.end(this.name)}}_computeStatisticsTextures(e,t){this._statisticsTechnique??=new i;const s=this._statisticsTechnique;let o=has("esri-2d-dra-delay");if(null==o){const e=t.bitmaps.find(g),{stretchType:i,bandCount:s}=e.symbolizerParameters,{pixelType:r}=e.source;"minMax"===i&&s>=3&&p.has(r)&&(o=h)}if(o){const i=performance.now();(i-this._draTimer>=o||e.stationary||!s.minValuesTexture)&&(this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo}),this._draTimer=i)}else this._mosaic(e,t),s.render(e,{fbo:this._mosaicFbo});return{minTexture:s.minValuesTexture,maxTexture:s.maxValuesTexture,meanTexture:s.meanValuesTexture,stddevTexture:s.stdDevValuesTexture}}_mosaic(e,t){const{context:i,painter:s}=e,o=i.getBoundFramebufferObject();if(this._mosaicFbo)this._mosaicFbo.resize(o.width,o.height);else{const e=d(i,o.width,o.height);this._mosaicFbo=new c(i,e)}i.bindFramebuffer(this._mosaicFbo);const r="RasterColorizerMosaic";for(const n of t.bitmaps){if(!g(n))continue;e.timeline.begin(r),s.setPipelineState({depth:!1,stencil:{test:{mask:255,compare:514,op:{fail:7680,zFail:7680,zPass:7680}},write:!1},color:{write:[!0,!0,!0,!0],blendMode:"composite"}});const t=n.interpolation;n.interpolation="nearest",n.updateTexture(e),n.updateProcessedTexture();const i=this._getStretchOptions(n);i.defines.noOp=!0,s.submitDrawMesh(e.context,i,s.quadMesh,n),n.interpolation=t,e.timeline.end(r)}i.bindFramebuffer(o)}_getLutOptions(e){const{config:t,projectionConfig:i,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n,projectionDefines:a}=this._getCommonConfig(e),u=s(e);return{shader:this.shaders.lut,uniforms:{projectionConfig:i,config:t,colormapConfig:o,pixelMaskConfig:r,highlightConfig:n},defines:{...a,...u,applyPixelMask:!!r,applyPixelHighlights:!!n},optionalAttributes:null,useComputeBuffer:!1}}_getStretchOptions(e,t){const i=e.symbolizerParameters,{config:o,projectionConfig:r,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,projectionDefines:c,textureUnit:m}=this._getCommonConfig(e),l=s(e),h=t?{minTexture:{texture:t.minTexture,unit:m},maxTexture:{texture:t.maxTexture,unit:m+1},meanTexture:{texture:t.meanTexture,unit:m+2},stddevTexture:{texture:t.stddevTexture,unit:m+3},numberOfStandardDeviations:i.numberOfStandardDeviations||2}:void 0,p=t?"standardDeviation"===i.stretchType?2:1:0;return{shader:this.shaders.stretch,uniforms:{projectionConfig:r,config:o,stretchConfig:i,colormapConfig:n,pixelMaskConfig:a,highlightConfig:u,statisticsConfig:h},defines:{...c,...l,isMultiband:i.bandCount>1,applyColormap:!!n,useGamma:i.useGamma,noOp:e.isRenderedSource&&!e.processed,applyPixelMask:!!a,applyPixelHighlights:!!u,draStretchType:p},optionalAttributes:null,useComputeBuffer:!1}}_getShadedReliefOptions(e){const t=e.symbolizerParameters,{config:i,projectionConfig:o,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a,projectionDefines:u}=this._getCommonConfig(e),c=s(e);return{shader:this.shaders.shadedRelief,uniforms:{projectionConfig:o,config:i,hillshadeConfig:t,colormapConfig:r,pixelMaskConfig:n,highlightConfig:a},defines:{...u,...c,isMultidirectional:t.hillshadeType>0,applyColormap:!!r,applyPixelMask:!!n,applyPixelHighlights:!!a},optionalAttributes:null,useComputeBuffer:!1}}_getCommonConfig(e){const{coordScale:t,computedOpacity:i,transforms:s}=e,{names:o,textures:r}=e.getTextures({useProcessedTexture:e.processed}),n=r[o.indexOf("u_image")],a=e.getRasterTextureSize();let u=0;const c={texture:{texture:n,unit:u++},dvsMat3:s.displayViewScreenMat3,coordScale:t,srcImageSize:a,opacity:i},m=r[o.indexOf("u_transformGrid")],{transformGrid:l}=e,h=!(!m||!l),p=h?{transformTexture:{texture:m,unit:u++},targetImageSize:[e.width,e.height],transformSpacing:l.spacing,transformGridSize:l.size}:void 0,f=r[o.indexOf("u_colormap")],{colormap:d,colormapOffset:g}=e.symbolizerParameters,x=f&&d?{colormapTexture:{texture:f,unit:u++},colormapOffset:g??0,colormapMaxIndex:d.length/4-1}:void 0,b=r[o.indexOf("u_mask")],T=b?{maskTexture:{texture:b,unit:u++}}:void 0,{highlightTexture:C}=e;return{config:c,projectionConfig:p,colormapConfig:x,pixelMaskConfig:T,highlightConfig:C?{highlightTexture:{texture:C,unit:u++}}:void 0,projectionDefines:{applyProjection:h,lookupProjection:h&&1===l.spacing[0]},textureUnit:u}}}function d(e,t,i){const s=new l(t,i);return s.internalFormat=a.RGBA32F,s.samplingMode=9728,s.dataType=u.FLOAT,s.wrapMode=33071,new m(e,s)}function g(e){return!e.suspended&&null!=e.source&&!e.isRenderedSource&&"stretch"===e.symbolizerParameters.type&&!!e.symbolizerParameters.dynamicRangeAdjustment}export{f as RasterColorizerTechnique};