@arcgis/core 5.2.0-next.36 → 5.2.0-next.38

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 (288) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/02b043a3c5fa8bcb4c5b.js +1 -0
  3. package/assets/esri/core/workers/chunks/{acbc14395c31f6da509e.js → 03437a8ef35c200dbf17.js} +1 -1
  4. package/assets/esri/core/workers/chunks/034dd8ee5152a12412cd.js +1 -0
  5. package/assets/esri/core/workers/chunks/{29542a3d7f3fa8d42380.js → 0603cbd938ab619c706b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/0a6e03263ab0906d8bcf.js +1 -0
  7. package/assets/esri/core/workers/chunks/0edd250159ec259601b3.js +1 -0
  8. package/assets/esri/core/workers/chunks/{401ee7fa500adad77db1.js → 1079914101d69a40b3eb.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{c72121076e438ed28d60.js → 1599dc5309a4e60017ce.js} +2 -2
  10. package/assets/esri/core/workers/chunks/181e98399732f425305d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{47d88e1b003c4519b7b6.js → 18f4b2099299942aaf97.js} +1 -1
  12. package/assets/esri/core/workers/chunks/196e7515a43bd0026f49.js +1 -0
  13. package/assets/esri/core/workers/chunks/1aa7496a7dc95aae11ac.js +1 -0
  14. package/assets/esri/core/workers/chunks/{c2a02c33462bcdabd39d.js → 1c263ffb7144e171a64f.js} +1 -1
  15. package/assets/esri/core/workers/chunks/1d524690c4b66289bd20.js +1 -0
  16. package/assets/esri/core/workers/chunks/{f72f38e7609756a7f8ea.js → 20fa2c3d4360afa5e136.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{03350a56f840cffe5459.js → 2757c4bf0280e27f3484.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{93ceb74ac88ef460fe5f.js → 278409028bc5af45b507.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{afaf6874a645854c3357.js → 294537e1ac43e8dfeaea.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{2c61bb25578f73ba49bc.js → 29a1d0659bbc5a039864.js} +1 -1
  21. package/assets/esri/core/workers/chunks/29df3f829006719b2680.js +1 -0
  22. package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js → 2a344bca6837ca3b5c41.js} +2 -2
  23. package/assets/esri/core/workers/chunks/30cf84a47ebefd180bb7.js +1 -0
  24. package/assets/esri/core/workers/chunks/{71a593fa116770e58832.js → 37a95f097533bad1b338.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{7335a762412bc8c15a2f.js → 37e823202424c11076cb.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{ee446250a40e5d89bb5a.js → 3a76fffa2016c16d7989.js} +3 -3
  27. package/assets/esri/core/workers/chunks/{58ce4bcfb15f378b1b9f.js → 3d6d2b42ba2ad7086d5d.js} +1 -1
  28. package/assets/esri/core/workers/chunks/3ec91474658eae87b832.js +1 -0
  29. package/assets/esri/core/workers/chunks/448e0596005cba9a4225.js +1 -0
  30. package/assets/esri/core/workers/chunks/{f148666308071bdb185a.js → 45530a49fa1f09d1682e.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{155940ef3d1888272d73.js → 459e89d1b94a3b204d20.js} +2 -2
  32. package/assets/esri/core/workers/chunks/{f71f5778e03f68f27482.js → 45b2e58051f42ebd236e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/4611cf051c3c396fdf96.js +1 -0
  34. package/assets/esri/core/workers/chunks/{efaa1d05705f6b450e8f.js → 46e3d33e44e5398221e2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{866950e9ab96aebc6b32.js → 4a8201e09bc3ad5cc00b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{110135b0562a3b5708b9.js → 4abe820bbe4f7ffccc09.js} +1 -1
  37. package/assets/esri/core/workers/chunks/4ad86d6b1be07c97b6f6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{20ffeb09bb30400de110.js → 4e28f49d0be20ea50fd7.js} +1 -1
  39. package/assets/esri/core/workers/chunks/4f25aac84d9eb10cac83.js +1 -0
  40. package/assets/esri/core/workers/chunks/{0197e459fdb04dfb28ef.js → 51838d55d8ec4ce70398.js} +1 -1
  41. package/assets/esri/core/workers/chunks/542d8a6c415098b9857c.js +1 -0
  42. package/assets/esri/core/workers/chunks/57abf838fcff0f0e2c5e.js +1 -0
  43. package/assets/esri/core/workers/chunks/57dd017fed2943d24e3d.js +1 -0
  44. package/assets/esri/core/workers/chunks/59801b2ccaaf4b394e02.js +1 -0
  45. package/assets/esri/core/workers/chunks/{add79af151e3eb560599.js → 5a2d2dcdfa8d958f277d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/5a62c9f64db4fcae5e52.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e84c13ac59e5381b77e2.js → 5aebecb5c2b3e7887127.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{c19fe4f31e4ef84bbcf6.js → 5e68b74fd548c7cdba36.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{9dcb2cbf89dcb7558432.js → 5f360492560ae07083a6.js} +1 -1
  50. package/assets/esri/core/workers/chunks/6022f43ebd58e21c737a.js +1 -0
  51. package/assets/esri/core/workers/chunks/62b137a795e487fa06a1.js +1 -0
  52. package/assets/esri/core/workers/chunks/{007485862ce95928717a.js → 632de34ebd2f44b4423d.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{1ad5fcae6d6a9801cf58.js → 63ca17f569407c89bde1.js} +2 -2
  54. package/assets/esri/core/workers/chunks/6896a6dd36fa91a27151.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e6263e1983e703befe48.js → 68bc674affe2f7269c40.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{759686b896f51f0fe6a9.js → 6a51499c6623ddce5f00.js} +1 -1
  57. package/assets/esri/core/workers/chunks/6cdf1db30793133294dd.js +1 -0
  58. package/assets/esri/core/workers/chunks/{b0e4af49fc968b0a910f.js → 6ff6783f89ecd3a5e752.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{857532de88f21e8c3466.js → 70763c7b68d8abe8d5fe.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{e67a9f9298d63026e7f6.js → 716b1f073e3cd807abd3.js} +1 -1
  61. package/assets/esri/core/workers/chunks/71a3f05cb86ae2920f8d.js +1 -0
  62. package/assets/esri/core/workers/chunks/723bb56de2324b41df4e.js +1 -0
  63. package/assets/esri/core/workers/chunks/73f61107cb7e6d30bf03.js +1 -0
  64. package/assets/esri/core/workers/chunks/752c34cee981862add89.js +1 -0
  65. package/assets/esri/core/workers/chunks/760dfd585b6c2c1937ce.js +1 -0
  66. package/assets/esri/core/workers/chunks/{595401947e74a0a67144.js → 76449e50222111ba0eb1.js} +1 -1
  67. package/assets/esri/core/workers/chunks/76bed5497f42f23a27ed.js +1 -0
  68. package/assets/esri/core/workers/chunks/832ecc1f7d45774c4726.js +1 -0
  69. package/assets/esri/core/workers/chunks/860a0f9d20f53db1caf4.js +1 -0
  70. package/assets/esri/core/workers/chunks/867e39bb444947c93586.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4f08b69f4a33a114c5f7.js → 8a66a3e8391206f7d8aa.js} +1 -1
  72. package/assets/esri/core/workers/chunks/8a8b7ac6693bdfbebf07.js +1 -0
  73. package/assets/esri/core/workers/chunks/{cda2bae39135e5519d8c.js → 8e80441eddef1b5be8b9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/8fce15ce4cfdccf407f3.js +1 -0
  75. package/assets/esri/core/workers/chunks/{5260f623438bd84f2caa.js → 937cf55b3b9d324eea73.js} +1 -1
  76. package/assets/esri/core/workers/chunks/93df864c2e829f0fd5ce.js +1 -0
  77. package/assets/esri/core/workers/chunks/{7b5e628ea3d4a51f1c4e.js → 966d002acec8c72be56a.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{367a3031abbeff0c0090.js → 9aef0b87f471626abd66.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{f1d211904d5a1de93cb3.js → 9ba9a3705623679bc305.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{aec82b94787821153d2b.js → a188d0767825d322f96d.js} +1 -1
  81. package/assets/esri/core/workers/chunks/a638de0102c3990403d1.js +1 -0
  82. package/assets/esri/core/workers/chunks/{828b64624c76156a6416.js → a6bda5f17fb1c03f7e4b.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{050aba7089318e1c7d53.js → b022debf9e0bc2bff0e2.js} +1 -1
  84. package/assets/esri/core/workers/chunks/b09935d0105d50a0971b.js +1 -0
  85. package/assets/esri/core/workers/chunks/b12fc1b5a9da97346684.js +1 -0
  86. package/assets/esri/core/workers/chunks/b2c0262c4a76b8a86200.js +1 -0
  87. package/assets/esri/core/workers/chunks/{599bd80379423c99799d.js → b4323e69e624c6b51754.js} +1 -1
  88. package/assets/esri/core/workers/chunks/b5141f240ca79729686d.js +1 -0
  89. package/assets/esri/core/workers/chunks/b549a4d4b1a34bee8beb.js +1 -0
  90. package/assets/esri/core/workers/chunks/bb89b6fd93513c61b2d3.js +1 -0
  91. package/assets/esri/core/workers/chunks/{3bd32387af52fa48d747.js → bc553ecc8cbcc1b02717.js} +1 -1
  92. package/assets/esri/core/workers/chunks/bcba02f61cf0abcb5600.js +1 -0
  93. package/assets/esri/core/workers/chunks/{f63e7b01c70352538b1e.js → bd0f488e228a75fbefb3.js} +2 -2
  94. package/assets/esri/core/workers/chunks/c48dfda8dcb9551606fb.js +1 -0
  95. package/assets/esri/core/workers/chunks/c4e44fde4bc4ff89e2bc.js +1 -0
  96. package/assets/esri/core/workers/chunks/c93a68618674b38b932e.js +1 -0
  97. package/assets/esri/core/workers/chunks/d2745886ba5a86fd5c4c.js +680 -0
  98. package/assets/esri/core/workers/chunks/d4c341b15d9244276fb9.js +1 -0
  99. package/assets/esri/core/workers/chunks/d5faab9799891e5da5a8.js +1 -0
  100. package/assets/esri/core/workers/chunks/d811924acc9c0be95bba.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4b96aa2dc5b88846bb53.js → e0a4d0288abd334b0673.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{b22a1c98271c2e4d8808.js → e1ddb8e4977b317fd40c.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e961c6140c39921816a8.js +1 -0
  104. package/assets/esri/core/workers/chunks/eb7daa0f6610983ff8db.js +1 -0
  105. package/assets/esri/core/workers/chunks/eb842cf470ce28a73187.js +1 -0
  106. package/assets/esri/core/workers/chunks/ed1d4ebf487c7dcd5c33.js +1 -0
  107. package/assets/esri/core/workers/chunks/f80cadcc2a588da63b38.js +1 -0
  108. package/assets/esri/core/workers/chunks/f8bbb52b865a0a242140.js +1 -0
  109. package/assets/esri/core/workers/chunks/f9592bcdd9988199a7ea.js +1 -0
  110. package/assets/esri/core/workers/chunks/ff7e1eb2366d4301d288.js +1 -0
  111. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  112. package/chunks/NavigationDepth.glsl.js +18 -0
  113. package/chunks/Path.glsl.js +20 -16
  114. package/config.js +1 -1
  115. package/core/accessorSupport/diffUtils.js +1 -1
  116. package/geometry/FlatGeometry.js +1 -1
  117. package/geometry/support/Indices.js +1 -1
  118. package/geometry/support/ShortArray.js +1 -1
  119. package/geometry/support/UintArray.js +1 -1
  120. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  121. package/kernel.js +1 -1
  122. package/layers/mixins/PublishableLayer.js +1 -1
  123. package/layers/mixins/RefreshableLayer.js +1 -1
  124. package/layers/raster/functions/pixelUtils.js +1 -1
  125. package/layers/support/kustoUtils.js +1 -1
  126. package/package.json +2 -2
  127. package/popup/Feature.js +1 -1
  128. package/portal/support/resourceUtils.js +1 -1
  129. package/renderers/support/rasterTypeUtils.js +1 -1
  130. package/rest/query/operations/pbfFeatureSetUtils.js +1 -1
  131. package/support/revision.js +1 -1
  132. package/symbols/cim/utils.js +1 -1
  133. package/tables/support/tablesUtils.js +1 -1
  134. package/views/2d/engine/flow/utils.js +1 -1
  135. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/AlignedVertexSpec.js +1 -1
  140. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  141. package/views/2d/layers/features/layerAdapters/labelingUtils.js +1 -1
  142. package/views/2d/layers/support/annodime/dimensionUtils.js +1 -1
  143. package/views/2d/layers/support/annodime/utils.js +1 -1
  144. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  145. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  146. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  147. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  148. package/views/3d/layers/Lyr3DWasm.js +1 -1
  149. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  151. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  152. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  153. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  154. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  155. package/views/3d/state/utils/navigationUtils.js +1 -1
  156. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  157. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  158. package/views/3d/support/orientedBoundingBox.js +1 -1
  159. package/views/3d/terrain/terrainUtils.js +1 -1
  160. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  161. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  162. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +32 -16
  163. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +1 -1
  164. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +2 -2
  165. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  166. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  167. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  168. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  169. package/views/3d/webgl-engine/lib/NavigationDepthCache.js +2 -0
  170. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  171. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  172. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  173. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  174. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  175. package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
  176. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  177. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  178. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  179. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  180. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  181. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  182. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  183. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  184. package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +2 -0
  185. package/views/3d/webgl-engine/shaders/NavigationDepthTechnique.js +2 -0
  186. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  187. package/views/SelectionManager.js +1 -1
  188. package/views/draw/support/Reshape.js +1 -1
  189. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  190. package/views/support/selectionUtils.js +1 -1
  191. package/views/webgl/BufferObject.js +1 -1
  192. package/views/webgl/FramebufferObject.js +1 -1
  193. package/views/webgl/RenderingContext.js +1 -1
  194. package/views/webgl/VertexAttributeLayouts.js +1 -1
  195. package/webscene/spec-certification/utils.js +1 -1
  196. package/widgets/Editor/legacy/workflowUtils.js +1 -1
  197. package/widgets/Editor/workflowUtils.js +1 -1
  198. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  199. package/widgets/OrientedImageryViewer/navigation/errors.js +1 -1
  200. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  201. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  202. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  203. package/widgets/OrientedImageryViewer/utils.js +1 -1
  204. package/widgets/OrientedImageryViewer.js +1 -1
  205. package/widgets/PanoramicViewer/constants.js +1 -1
  206. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  207. package/widgets/PanoramicViewer/utils.js +1 -1
  208. package/widgets/support/dateUtils.js +1 -1
  209. package/assets/esri/core/workers/chunks/0a2f08298a3c932614f2.js +0 -1
  210. package/assets/esri/core/workers/chunks/0df978697328b6453c94.js +0 -1
  211. package/assets/esri/core/workers/chunks/168c15cf462f9abcbdd2.js +0 -1
  212. package/assets/esri/core/workers/chunks/22c447fcc9a28afeb6e3.js +0 -1
  213. package/assets/esri/core/workers/chunks/24aa98cb2021ddd789ce.js +0 -1
  214. package/assets/esri/core/workers/chunks/2509da565e5a2b43ac7f.js +0 -1
  215. package/assets/esri/core/workers/chunks/256cc116e3be4feee593.js +0 -1
  216. package/assets/esri/core/workers/chunks/2bb3494659609594c4ca.js +0 -1
  217. package/assets/esri/core/workers/chunks/2c017eae434254610c8e.js +0 -1
  218. package/assets/esri/core/workers/chunks/303e723e829ea7088d43.js +0 -1
  219. package/assets/esri/core/workers/chunks/368db1420b8520beae05.js +0 -1
  220. package/assets/esri/core/workers/chunks/38a6a7c56c592f336a12.js +0 -1
  221. package/assets/esri/core/workers/chunks/39ff5b2a05a90e1cb214.js +0 -1
  222. package/assets/esri/core/workers/chunks/3b914ca36e7e2b00cfe6.js +0 -1
  223. package/assets/esri/core/workers/chunks/3e8fa2a7a36881234479.js +0 -1
  224. package/assets/esri/core/workers/chunks/451331f69d21c61ec93b.js +0 -1
  225. package/assets/esri/core/workers/chunks/4656a4bf430d7eed1465.js +0 -1
  226. package/assets/esri/core/workers/chunks/472ec242cd3070e6acfe.js +0 -1
  227. package/assets/esri/core/workers/chunks/51d7145f748b4865de7f.js +0 -1
  228. package/assets/esri/core/workers/chunks/54f54623532f633dc0e2.js +0 -1
  229. package/assets/esri/core/workers/chunks/570a4725b2a4a19c5148.js +0 -1
  230. package/assets/esri/core/workers/chunks/586ca90e46f5cbdfeece.js +0 -1
  231. package/assets/esri/core/workers/chunks/59c22bab85f9cdbb9948.js +0 -1
  232. package/assets/esri/core/workers/chunks/5dfeefee96659832398a.js +0 -1
  233. package/assets/esri/core/workers/chunks/6c746ac4bd2e57b8cb41.js +0 -1
  234. package/assets/esri/core/workers/chunks/6d72a1bdc2664df62c4c.js +0 -1
  235. package/assets/esri/core/workers/chunks/7085b4c655a19694da04.js +0 -1
  236. package/assets/esri/core/workers/chunks/777b16b76db406c99c69.js +0 -1
  237. package/assets/esri/core/workers/chunks/818a481ce579f519de1c.js +0 -1
  238. package/assets/esri/core/workers/chunks/85a280ee915010a8da3c.js +0 -1
  239. package/assets/esri/core/workers/chunks/86731e276b31453bc235.js +0 -1
  240. package/assets/esri/core/workers/chunks/87b86375f8557418dbe6.js +0 -1
  241. package/assets/esri/core/workers/chunks/8817d25c7f4cf0e6c6bd.js +0 -1
  242. package/assets/esri/core/workers/chunks/8a9b2efa0603e9fa4e8b.js +0 -1
  243. package/assets/esri/core/workers/chunks/8aa5bbf9a9b09815725a.js +0 -1
  244. package/assets/esri/core/workers/chunks/8b68a69ab8fb1679e7b2.js +0 -1
  245. package/assets/esri/core/workers/chunks/98685bd149dee1d6dc99.js +0 -1
  246. package/assets/esri/core/workers/chunks/9de673a04c70bd47047e.js +0 -1
  247. package/assets/esri/core/workers/chunks/9de9cec5c644bc452294.js +0 -1
  248. package/assets/esri/core/workers/chunks/9fb0431b0628dcb53004.js +0 -680
  249. package/assets/esri/core/workers/chunks/a2a688dd2ed4565e01ff.js +0 -1
  250. package/assets/esri/core/workers/chunks/a3ae7c41832c7a8b0570.js +0 -1
  251. package/assets/esri/core/workers/chunks/a3e86830460e52706a4d.js +0 -1
  252. package/assets/esri/core/workers/chunks/a58b8903ae17acf117d6.js +0 -1
  253. package/assets/esri/core/workers/chunks/a99ce2f12c8204ee542a.js +0 -1
  254. package/assets/esri/core/workers/chunks/ab3d1c00ef514b61ce0b.js +0 -1
  255. package/assets/esri/core/workers/chunks/ae5363956b4467208e04.js +0 -1
  256. package/assets/esri/core/workers/chunks/b24b7411a73d1da87c30.js +0 -1
  257. package/assets/esri/core/workers/chunks/b97b83159fec34f383af.js +0 -1
  258. package/assets/esri/core/workers/chunks/bec660ee2e7828f965e2.js +0 -1
  259. package/assets/esri/core/workers/chunks/c7316fd2bdb7ac9eada3.js +0 -1
  260. package/assets/esri/core/workers/chunks/ca7d4d76a6bf5a3046cd.js +0 -1
  261. package/assets/esri/core/workers/chunks/cffef41791f0cfa6c26c.js +0 -1
  262. package/assets/esri/core/workers/chunks/d26b1a9f47b4b2744c89.js +0 -1
  263. package/assets/esri/core/workers/chunks/d4a96f0402172787823a.js +0 -1
  264. package/assets/esri/core/workers/chunks/d9fcc63df008f687848a.js +0 -1
  265. package/assets/esri/core/workers/chunks/e3a4695c31d3f9d55213.js +0 -1
  266. package/assets/esri/core/workers/chunks/e65d291bab13f7f5323b.js +0 -1
  267. package/assets/esri/core/workers/chunks/eeee7421f64a52074ff4.js +0 -1
  268. package/assets/esri/core/workers/chunks/eef7e0bee19c4258ba55.js +0 -1
  269. package/assets/esri/core/workers/chunks/efaf998d18479a0380ae.js +0 -1
  270. package/assets/esri/core/workers/chunks/f0573db9a3d3e1499a7e.js +0 -1
  271. package/assets/esri/core/workers/chunks/f07722efd7fa2b75d4dd.js +0 -1
  272. package/assets/esri/core/workers/chunks/f137e544076482e348ad.js +0 -1
  273. package/assets/esri/core/workers/chunks/fd53ef66176ae164e221.js +0 -1
  274. package/assets/esri/core/workers/chunks/fd956a58787020d610af.js +0 -1
  275. package/rest/sharedTemplates/addSharedTemplates.js +0 -2
  276. package/support/featureFlags.js +0 -2
  277. package/views/2d/engine/webgl/ClippingInfo.js +0 -2
  278. package/views/2d/engine/webgl/Mesh2D.js +0 -2
  279. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +0 -2
  280. package/views/2d/layers/features/ProcessorTileMessageQueue.js +0 -2
  281. package/views/3d/support/AsyncWorkerQueue.js +0 -2
  282. package/views/3d/webgl-engine/lib/PathGeometryData.js +0 -2
  283. package/widgets/BatchAttributeForm/templates/support/contingentValuesUtils.js +0 -2
  284. package/widgets/OrientedImageryViewer/components/NavigationAction.js +0 -2
  285. package/widgets/OrientedImageryViewer/components/NavigationActions.js +0 -2
  286. package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +0 -2
  287. package/widgets/PanoramicViewer/support/PanoramicMediaCollection.js +0 -2
  288. /package/assets/esri/core/workers/chunks/{2c00f89030c7a4201033.js.LICENSE.txt → 2a344bca6837ca3b5c41.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- function e(e){return e.isGeographic||e.isWebMercator}function r(e,r){switch(e.type){case"georeferenced":return r.isGeographic;case"local":return r.isGeographic||r.isWebMercator}}export{e as isGlobal,r as performGlobalOperation};
2
+ function e(e,r){switch(e.type){case"georeferenced":return r.isGeographic;case"local":return r.isGeographic||r.isWebMercator}}export{e as performGlobalOperation};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.36",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.38",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../core/accessorSupport/decorators.js";import i from"../support/PublishingInfo.js";const n=Symbol();function r(t){return null!=t&&"object"==typeof t&&n in t}const o=r=>{var o;const u=r;let l=class extends u{constructor(){super(...arguments),this[o]=!0}static{o=n}get publishingInfo(){if(this.destroyed)return null;const t=this._get("publishingInfo");if(t)return t;const e=new i;return this._checkPublishingStatus(e),e}_checkPublishingStatus(t){const e=250,s=125;let i=0;const n=async e=>{let o;t.updating=!0;try{o=await this.fetchPublishingStatus()}catch(u){o="unavailable"}"published"!==o&&"unavailable"!==o||("publishing"===t.status&&this.refresh(),r.remove()),t.status=o,t.updating=!1,r.removed||(i=setTimeout(n,e,e+s))},r={removed:!1,remove(){this.removed=!0,clearTimeout(i)}};this.when().catch(()=>r.remove()),n(e),this.addHandles(r)}};return t([e({readOnly:!0,clonable:!1})],l.prototype,"publishingInfo",null),l=t([s("esri.layers.mixins.PublishableLayer")],l),l};export{o as PublishableLayer,r as isPublishableLayer};
2
+ import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../core/accessorSupport/decorators.js";import i from"../support/PublishingInfo.js";const r=Symbol(),o=o=>{var n;const a=o;let l=class extends a{constructor(){super(...arguments),this[n]=!0}static{n=r}get publishingInfo(){if(this.destroyed)return null;const t=this._get("publishingInfo");if(t)return t;const s=new i;return this._checkPublishingStatus(s),s}_checkPublishingStatus(t){const s=250,e=125;let i=0;const r=async s=>{let n;t.updating=!0;try{n=await this.fetchPublishingStatus()}catch(a){n="unavailable"}"published"!==n&&"unavailable"!==n||("publishing"===t.status&&this.refresh(),o.remove()),t.status=n,t.updating=!1,o.removed||(i=setTimeout(r,s,s+e))},o={removed:!1,remove(){this.removed=!0,clearTimeout(i)}};this.when().catch(()=>o.remove()),r(s),this.addHandles(o)}};return t([s({readOnly:!0,clonable:!1})],l.prototype,"publishingInfo",null),l=t([e("esri.layers.mixins.PublishableLayer")],l),l};export{o as PublishableLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../core/has.js";import r from"../../core/Logger.js";import{debounce as t,ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{property as o,cast as a,subclass as n}from"../../core/accessorSupport/decorators.js";import{excludeTables as i}from"../../core/accessorSupport/layerContainerType.js";import{registerLayer as h,unregisterLayer as p}from"./refresh.js";function m(e){return null!=e&&"object"==typeof e&&"refreshTimestamp"in e&&"refresh"in e}const f=.1,l=m=>{const l=m;let c=class extends l{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=t(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||h(this)},()=>{})}destroy(){p(this)}castRefreshInterval(e){return e>=f?e:e<=0?0:f}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){s(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:r})},e=>{r.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})})}async hasDataChanged(){return!0}get test(){}};return e([o({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:i}}}}})],c.prototype,"refreshInterval",void 0),e([a("refreshInterval")],c.prototype,"castRefreshInterval",null),e([o({readOnly:!0})],c.prototype,"refreshTimestamp",void 0),e([o({readOnly:!0})],c.prototype,"refreshParameters",null),c=e([n("esri.layers.mixins.RefreshableLayer")],c),c};export{l as RefreshableLayer,m as isRefreshableLayer};
2
+ import{__decorate as e}from"tslib";import"../../core/has.js";import r from"../../core/Logger.js";import{debounce as t,ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{property as a,cast as o,subclass as h}from"../../core/accessorSupport/decorators.js";import{excludeTables as i}from"../../core/accessorSupport/layerContainerType.js";import{registerLayer as n,unregisterLayer as p}from"./refresh.js";const m=.1,f=f=>{const l=f;let c=class extends l{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=t(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||n(this)},()=>{})}destroy(){p(this)}castRefreshInterval(e){return e>=m?e:e<=0?0:m}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){s(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:r})},e=>{r.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})})}async hasDataChanged(){return!0}get test(){}};return e([a({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:i}}}}})],c.prototype,"refreshInterval",void 0),e([o("refreshInterval")],c.prototype,"castRefreshInterval",null),e([a({readOnly:!0})],c.prototype,"refreshTimestamp",void 0),e([a({readOnly:!0})],c.prototype,"refreshParameters",null),c=e([h("esri.layers.mixins.RefreshableLayer")],c),c};export{f as RefreshableLayer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import{getPixelValueRange as e}from"../formats/pixelRangeUtils.js";import n from"../../support/PixelBlock.js";const l=9,i="PixelID";function o(t){return null!=t&&t.pixels?.length>0}function r(t,e){return e?.length&&o(t)?t.extractBands(e):t}function s(t){if(!t?.length||t.some(t=>!o(t)))return null;if(1===t.length)return t[0]?.clone()??null;const e=t,{width:l,height:i,pixelType:r}=e[0];if(e.some(t=>t.width!==l||t.height!==i))return null;const s=e.map(({mask:t})=>t).filter(t=>null!=t);let a=null;s.length&&(a=new Uint8Array(l*i),a.set(s[0]),s.length>1&&k(s.slice(1),a));const h=[];e.forEach(({pixels:t})=>h.push(...t));const f=null!=a&&h.length===e.length?e.map(({width:t,height:e,mask:n})=>n??new Uint8Array(t*e).fill(255)):null,c=e.map(({statistics:t})=>t).filter(t=>t?.length),u=[];return c.forEach(t=>u.push(...t)),new n({pixelType:r,width:l,height:i,mask:a,bandMasks:f,pixels:h,statistics:u.length?u:null})}function a(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort((t,e)=>t[0]-e[0]),l=n[0][0]<0?n[0][0]:0,i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),r=[],s=5===n[0].length;if(i>65536)return n.forEach(t=>{r[t[0]-l]=s?t.slice(1):t.slice(1).concat([255])}),{indexed2DColormap:r,offset:l,alphaSpecified:s};if(t.fillUnspecified){let t=n[0];for(let e=t[0]-l,r=0;e<i;e++)o[4*e]=t[1],o[4*e+1]=t[2],o[4*e+2]=t[3],o[4*e+3]=s?t[4]:255,e===t[0]-l&&(t=r===n.length-1?t:n[++r])}else for(let a=0;a<n.length;a++){const t=n[a],e=4*(t[0]-l);o[e]=t[1],o[e+1]=t[2],o[e+2]=t[3],o[e+3]=s?t[4]:255}return{indexedColormap:o,offset:l,alphaSpecified:s}}function h(t,e){if(!o(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const r=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:s,indexed2DColormap:a,offset:h,alphaSpecified:f}=e,c=l[0],u=new Uint8Array(c.length),p=new Uint8Array(c.length),x=new Uint8Array(c.length);let d,m=0;if(s){const t=s.length-1;if(null!=i)for(let e=0;e<r;e++)i[e]&&(m=4*(c[e]-h),m<h||m>t?i[e]=0:(u[e]=s[m],p[e]=s[m+1],x[e]=s[m+2],i[e]=s[m+3]));else{i=new Uint8Array(r);for(let e=0;e<r;e++)m=4*(c[e]-h),m<h||m>t?i[e]=0:(u[e]=s[m],p[e]=s[m+1],x[e]=s[m+2],i[e]=s[m+3]);n.mask=i}}else if(a)if(null!=i)for(let o=0;o<r;o++)i[o]&&(d=a[c[o]],u[o]=d[0],p[o]=d[1],x[o]=d[2],i[o]=d[3]);else{i=new Uint8Array(r);for(let t=0;t<r;t++)d=a[c[t]],u[t]=d[0],p[t]=d[1],x[t]=d[2],i[t]=d[3];n.mask=i}return n.pixels=[u,p,x],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function f(t,e){if(!o(t))return null;const{pixels:l,mask:i}=t,r=l.length;let s=e.lut;const{offset:a}=e;s&&1===s[0].length&&(s=l.map(()=>s));const h=[],f=e.outputPixelType||"u8";for(let n=0;n<r;n++){const t=c(l[n],i,s[n],a||0,f);h.push(t)}const u=new n({width:t.width,height:t.height,pixels:h,mask:i,pixelType:f});return u.updateStatistics(),u}function c(t,e,l,i,o){const r=t.length,s=n.createEmptyBand(o,r);if(e)for(let n=0;n<r;n++)e[n]&&(s[n]=l[t[n]-i]);else for(let n=0;n<r;n++)s[n]=l[t[n]-i];return s}function u(t,e,n,l){const{width:i,height:o,pixels:r,mask:s}=t,a=i*o,{bandId:h,ranges:f}=n,c=r[h];if(!c)return;const u=1===f.length,[p,x]=f[0];for(let d=0;d<a;d++)if(!s||s[d]){const t=c[d];if(u)t>=p&&t<=x&&(e[d]=l);else for(let n=0;n<f.length;n++){const[i,o]=f[n];if(t>=i&&t<=o){e[d]=l;break}}}}function p(t,e,n,l){const{width:i,height:o,xyMask:r,xBandId:s,yBandId:a,xBandRange:h,yBandRange:f}=n,{pixels:c,mask:u}=t,p=c[s],x=c[a],[d,m]=h,[g,y]=f,w=(m-d)/i,k=(y-g)/o;for(let M=0;M<p.length;M++)if(!u||u[M]){let t=p[M],n=x[M];if(t<d||t>m||n<g||n>y)continue;r?(t=(t-d)*w,t=t>i-1?i-1:t<0?0:255&t,n=(y-n)*k,n=n>o-1?o-1:n<0?0:255&n,r[n*i+t]&&(e[M]=l)):e[M]=l}}function x(t){const{pixelBlock:e,renderedPixelBlock:n,highlightOptions:l}=t;if(!o(e))return;const{width:i,height:r}=e,s=i*r,a=new Uint8Array(s);for(let o=1;o<=l.length;o++){const t=l[o-1];"bandId"in t?u(e,a,t,o):p(e,a,t,o)}const{pixels:h}=n;1===h.length&&(h[1]=h[0].slice(),h[2]=h[0].slice());const f=l.map(t=>t.color),[c,x,d]=h;if(n.mask){const t=n.mask;for(let e=0;e<s;e++)if(t[e]){t[e]=255;const n=a[e];if(n){const l=f[n-1];c[e]=l[0],x[e]=l[1],d[e]=l[2],t[e]=l[3]}}}else{const t=new Uint8Array(s).fill(255);for(let e=0;e<s;e++){const n=a[e];if(n){const l=f[n-1];c[e]=l[0],x[e]=l[1],d[e]=l[2],t[e]=l[3]}}n.mask=t}n.maskIsAlpha=!0}function d(t,e){if(!o(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,r=e.length,s=Math.floor(r/2),a=e[Math.floor(s)],h=l[0],f=new Uint8Array(i),c=new Uint8Array(i),u=new Uint8Array(i);let p=n.mask;const x=4===e[0].mappedColor.length;p||(p=new Uint8Array(i),p.fill(x?255:1),n.mask=p);for(let o=0;o<i;o++)if(p[o]){const t=h[o];let n=!1,l=s,i=a,x=0,d=r-1;for(;d-x>1;){if(t===i.value){n=!0;break}t>i.value?x=l:d=l,l=Math.floor((x+d)/2),i=e[Math.floor(l)]}n||(t===e[x].value?(i=e[x],n=!0):t===e[d].value?(i=e[d],n=!0):t<e[x].value?n=!1:t>e[x].value&&(t<e[d].value?(i=e[x],n=!0):d===r-1?n=!1:(i=e[d],n=!0))),n?(f[o]=i.mappedColor[0],c[o]=i.mappedColor[1],u[o]=i.mappedColor[2],p[o]=i.mappedColor[3]):f[o]=c[o]=u[o]=p[o]=0}return n.pixels=[f,c,u],n.mask=p,n.pixelType="u8",n.maskIsAlpha=x,n}function m(e,n,i=!1){const o=1e-5,r=new Float32Array(3*l),s=n.length;for(let a=0;a<l;a++)r[3*a]=e[2*a]??t-1,r[3*a+1]=e[2*a+1]??t,r[3*a+2]=n[a]??0,a<s&&(a>0&&(r[3*a]-=o),e[2*a+1]!==e[2*a]&&(a<s-1||!i)&&(r[3*a+1]-=o));return r}function g(t,l){if(!o(t))return null;const{width:i,height:r}=t,{inputRanges:s,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=t.pixels[0],d=n.createEmptyBand(h,x.length),m=t.mask,g=new Uint8Array(i*r);m?g.set(m):g.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=s.map(t=>t-y);w[0]=s[0],w[w.length-1]=s[s.length-1]+(p?1e-6:0);const k=s.length/2,[M,A]=e(h);for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=e*i+t;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===s[2*l]||t>w[2*l]&&t<w[2*l+1]){d[n]=a[l],e=!0;break}e||(c?d[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!m||m[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){d[n]=0,g[n]=0;break}}}return new n({width:i,height:r,pixelType:h,pixels:[d],mask:g})}function y(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,r=!!e?.length;for(let s=0;s<t.length;s++)if(l[s]){const n=t[s];if(r){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[s]=0)}l[s]&&(n===o||i?.has(n))&&(l[s]=0)}}function w(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}return e}function k(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}return e}function M(t,e){if(!o(t))return null;const{width:l,height:i,pixels:r}=t,s=l*i,a=new Uint8Array(s);t.mask?a.set(t.mask):a.fill(255);const h=r.length,{includedRanges:f,noDataValues:u,outputPixelType:p,matchAll:x,lookups:d}=e;if(d){const t=[];for(let e=0;e<h;e++){const n=d[e],l=c(r[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):x?w(t,a):k(t,a)}else if(x){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(s);n.set(a),y(r[e],f?.slice(2*e,2*e+2),u?.[e],n),t.push(n)}1===t.length?a.set(t[0]):w(t,a)}else for(let n=0;n<h;n++)y(r[n],f?.slice(2*n,2*n+2),u?.[n],a);return new n({width:l,height:i,pixelType:p,pixels:r,mask:a})}function A(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:r,noDataRanges:s,isLastInputRangeInclusive:a,outputPixelType:h}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=n.createEmptyBand(h,f),p=new Uint8Array(f);r&&p.fill(255);const[x,d]=e(h);if(i?.length&&o?.length){const t=1e-6,e=i.map(e=>e-t);e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>d?d:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),r=i[2*n+1]===i[2*n]?l:Math.floor(e[2*n+1]-c);for(let e=l;e<=r;e++)u[e]=t,p[e]=255}}if(s?.length)for(let e=0;e<s.length;e++){const t=Math.ceil(s[2*e]-c),n=Math.floor(s[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function U(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let r=0;r<e.length;r++){const t=Math.ceil(e[2*r]-i),n=Math.floor(e[2*r+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let r=0;r<n.length;r++)o[n[r]-i]=0;return{lut:o,offset:i}}function b(t,e,n,l,i,o,r,s){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+r<=n*t?0:i+r<n*t+t?i+r-n*t:t,ymax:o+s<=l*e?0:o+s<l*e+e?o+s-l*e:e}}function T(t,e){if(!t||0===t.length)return null;const n=t.find(t=>t.pixelBlock);if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),r=t.sort((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0),s=Math.min.apply(null,r.map(t=>t.extent.xmin)),a=Math.min.apply(null,r.map(t=>t.extent.ymin)),h=Math.max.apply(null,r.map(t=>t.extent.xmax)),f=Math.max.apply(null,r.map(t=>t.extent.ymax)),c={x:Math.round((e.xmin-s)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-s)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==r.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:S(r.map(t=>t.pixelBlock),u,{clipOffset:c,clipSize:p})}}function B(t,e,n,l,i,o){const{width:r,height:s}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=b(r,s,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=r*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let d=u.ymin;d<u.ymax;d++){const n=(i*s+d-h)*f+(l*r-a)+p,o=d*r;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let d=u.ymin;d<u.ymax;d++){const n=(i*s+d-h)*f+(l*r-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function S(t,e,l={}){const{clipOffset:i,clipSize:r,alignmentInfo:s,blockWidths:a}=l;if(a)return v(t,e,{blockWidths:a});const h=t.find(t=>o(t));if(null==h)return null;const f=r?r.width:e.width,c=r?r.height:e.height,u=h.width,p=h.height,x=e.width/u,d=e.height/p,m={offset:i||{x:0,y:0},mosaic:r||e,block:{width:u,height:p}},g=h.pixelType,y=n.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,A;for(let n=0;n<w;n++){A=new y(f*c);for(let e=0;e<d;e++)for(let l=0;l<x;l++){const i=t[e*x+l];o(i)&&(M=i.pixels[n],B(A,M,m,l,e,s))}k.push(A)}const U=t.some(t=>null==t||null!=t.mask&&t.mask.length>0),b=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),T=U?new Uint8Array(f*c):void 0,S=b?[]:void 0;if(T){for(let e=0;e<d;e++)for(let n=0;n<x;n++){const l=t[e*x+n],i=null!=l?l.mask:null;B(T,null!=i?i:l?255:0,m,n,e,s)}if(S)for(let e=0;e<w;e++){const n=new Uint8Array(f*c);for(let l=0;l<d;l++)for(let i=0;i<x;i++){const o=t[l*x+i],r=o?.bandMasks?.[e]??o?.mask;B(n,null!=r?r:o?255:0,m,i,l,s)}S.push(n)}}const C=new n({width:f,height:c,pixels:k,pixelType:g,bandMasks:S,mask:T});return C.updateStatistics(),C}function v(t,e,l){const i=t.find(t=>null!=t);if(null==i)return null;const r=t.some(t=>null==t||!!t.mask),{width:s,height:a}=e,h=r?new Uint8Array(s*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=n.getPixelArrayConstructor(i.pixelType);if(r)for(let n=0,y=0;n<t.length;y+=f[n],n++){const e=t[n];if(!o(e))continue;const l=e.mask;for(let t=0;t<a;t++)for(let i=0;i<f[n];i++)h[t*s+i+y]=null==l?255:l[t*e.width+i]}const x=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),d=x?[]:void 0,m=s*a;for(let n=0;n<u;n++){const e=new p(m),l=x?new Uint8Array(m):void 0;for(let i=0,r=0;i<t.length;r+=f[i],i++){const h=t[i];if(!o(h))continue;const c=h.pixels[n];if(null!=c){for(let t=0;t<a;t++)for(let n=0;n<f[i];n++)e[t*s+n+r]=c[t*h.width+n];if(l){const t=h.bandMasks?.[n]??h.mask;for(let e=0;e<a;e++)for(let n=0;n<f[i];n++)l[e*s+n+r]=t?t[e*h.width+n]:255}}}c.push(e),d&&l&&d.push(l)}const g=new n({width:s,height:a,mask:h,bandMasks:d,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function C(t,e,n){if(!o(t))return null;const{width:l,height:i}=t,r=e.x,s=e.y,a=n.width+r,h=n.height+s;if(r<0||s<0||a>l||h>i)return t;if(0===r&&0===s&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let o=0;o<i;o++){const t=o*l;for(let e=0;e<l;e++)f[t+e]=o<s||o>=h||e<r||e>=a?0:1}return t.updateStatistics(),t}function I(t){if(!o(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,r=i[0],s=e.pixels[0],a=t.mask;for(let o=2;o<l-1;o++){const t=new Map;for(let l=o-2;l<o+2;l++)for(let e=0;e<4;e++){const i=l*n+e;D(t,r[i],a?a[i]:1)}s[o*n]=R(t),s[o*n+1]=s[o*n+2]=s[o*n];let e=3;for(;e<n-1;e++){let l=(o-2)*n+e+1;D(t,r[l],a?a[l]:1),l=(o-1)*n+e+1,D(t,r[l],a?a[l]:1),l=o*n+e+1,D(t,r[l],a?a[l]:1),l=(o+1)*n+e+1,D(t,r[l],a?a[l]:1),l=(o-2)*n+e-3,P(t,r[l],a?a[l]:1),l=(o-1)*n+e-3,P(t,r[l],a?a[l]:1),l=o*n+e-3,P(t,r[l],a?a[l]:1),l=(o+1)*n+e-3,P(t,r[l],a?a[l]:1),s[o*n+e]=R(t)}s[o*n+e+1]=s[o*n+e]}for(let o=0;o<n;o++)s[o]=s[n+o]=s[2*n+o],s[(l-1)*n+o]=s[(l-2)*n+o];return e.updateStatistics(),e}function R(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function P(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function D(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function _(t,e,l){let{x:i,y:r}=e;const{width:s,height:a}=l;if(0===i&&0===r&&a===t.height&&s===t.width)return t;const{width:h,height:f}=t,c=Math.max(0,r),u=Math.max(0,i),p=Math.min(i+s,h),x=Math.min(r+a,f);if(p<0||x<0||!o(t))return null;i=Math.max(0,-i),r=Math.max(0,-r);const{pixels:d}=t,m=s*a,g=d.length,y=[];for(let o=0;o<g;o++){const e=d[o],l=n.createEmptyBand(t.pixelType,m);for(let t=c;t<x;t++){const n=t*h;let o=(t+r-c)*s+i;for(let t=u;t<p;t++)l[o++]=e[n+t]}y.push(l)}const w=new Uint8Array(m),k=t.mask;for(let n=c;n<x;n++){const t=n*h;let e=(n+r-c)*s+i;for(let n=u;n<p;n++)w[e++]=k?k[t+n]:1}const M=new n({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function F(t,e=!0){if(!o(t))return null;const{pixels:l,width:i,height:r,mask:s,pixelType:a}=t,h=[],f=Math.round(i/2),c=Math.round(r/2),u=r-1,p=i-1;for(let o=0;o<l.length;o++){const t=l[o],s=n.createEmptyBand(a,f*c);let x=0;for(let n=0;n<r;n+=2)for(let l=0;l<i;l+=2){const o=t[n*i+l];if(e){const e=l===p?o:t[n*i+l+1],r=n===u?o:t[n*i+l+i],a=l===p?r:n===u?e:t[n*i+l+i+1];s[x++]=(o+e+r+a)/4}else s[x++]=o}h.push(s)}let x=null;if(null!=s){x=new Uint8Array(f*c);let t=0;for(let n=0;n<r;n+=2)for(let l=0;l<i;l+=2){const o=s[n*i+l];if(e){const e=l===p?o:s[n*i+l+1],r=n===u?o:s[n*i+l+i],a=l===p?r:n===u?e:s[n*i+l+i+1];x[t++]=o*e*r*a?1:0}else x[t++]=o}}return new n({width:f,height:c,pixelType:a,pixels:h,mask:x})}function W(t,e,n=0,l=!0){if(!o(t))return null;const{width:i,height:r}=e;let{width:s,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let o=0;o<c;o++){const t=Math.ceil(s/i),n=Math.ceil(a/r);for(let l=0;l<n;l++){f.y=l*r;for(let n=0;n<t;n++){f.x=n*i;const t=_(u,f,e);h.set(`${o}/${l}/${n}`,t)}}o<c-1&&(u=F(u,l)),s=Math.round(s/2),a=Math.round(a/2)}return h}function E(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:r,useBilinear:s}=t;if(!o(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=_(e,{y:i*u,x:r*c},{width:c,height:u});if(!p)return null;for(let o=l;o>0;o--)p=F(p,s);return p}function N(t,e,n,l,i=0){const{width:o,height:r}=t,{width:s,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(s/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,d,m,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let B,S,v=0;for(let C=0;C<u;C++)for(let t=0;t<c;t++){p=12*(C*c+t),x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){v=(C*f+e)*k+t*h,S=(e+.5)/f;for(let t=0;t<e;t++)B=(t+.5)/h,A[v+t]=(x*B+d*S+m)*o+i,U[v+t]=(g*B+y*S+w)*r+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}p+=6,x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){v=(C*f+e)*k+t*h,S=(e+.5)/f;for(let t=e;t<h;t++)B=(t+.5)/h,A[v+t]=(x*B+d*S+m)*o+i,U[v+t]=(g*B+y*S+w)*r+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function j(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:r}=N(t,t,n,{rows:l[0],cols:l[1]}),{width:s,height:a}=t,h=new Float32Array(s*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<s;t++){const e=c*r+t,n=0===c?e:e-r,l=c===a-1?e:e+r,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*s+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*s+t]=e}}return h}function z(t,e,l,i,r="nearest"){if(!o(t))return null;"majority"===r&&(t=I(t));const{pixels:s,mask:a,bandMasks:h,pixelType:f}=t,c=t.width,u=t.height,p=n.getPixelArrayConstructor(f),x=s.length,{width:d,height:m}=e;let g=!1;for(let n=0;n<l.length;n+=3)-1===l[n]&&-1===l[n+1]&&-1===l[n+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=N({width:c,height:u},e,l,i,"majority"===r?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<m;o++){U=o*A;for(let r=0;r<d;r++){if(y[U]<0||w[U]<0)t[o*d+r]=0;else if(l)t[o*d+r]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),s=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-s;if(!n||n[l+s*c]&&n[a+s*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+s*c]+f*e[a+s*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*d+r]=(1-u)*n+u*p+i}else t[o*d+r]=e[k[U]+M[U]*c]}U++}}},T=[];let B;const S=h?.length===x,v=[];for(let n=0;n<x;n++){if(S){const t=new Uint8Array(d*m);b(t,h[n],h[n],!0),v.push(t)}B=new p(d*m),b(B,s[n],S?h[n]:a,"nearest"===r||"majority"===r),T.push(B)}const C=new n({width:d,height:m,pixelType:f,pixels:T,bandMasks:S?v:void 0});if(null!=a)C.mask=new Uint8Array(d*m),b(C.mask,a,a,!0);else if(g){C.mask=new Uint8Array(d*m);for(let t=0;t<d*m;t++)C.mask[t]=y[t]<0||w[t]<0?0:1}return C.updateStatistics(),C}function O(t){const{pixelBlock:e,extent:n,fieldNames:l,skipFactor:o,skipSpatialReference:r=!1,pixelIdOffset:s=0}=t,a=[],{width:h,height:f,pixels:c,mask:u}=e,p=t.imageRowSize??h,x=n.width/h,d=n.height/f,m=c.length,g=Math.floor(o/2),{xmin:y,ymax:w}=n,k=r?void 0:n.spatialReference.toJSON();for(let M=g;M<f;M+=o)for(let t=g;t<h;t+=o){const e=M*h+t;if(!u||u[e]){const n={x:y+(t+.5)*x,y:w-(M+.5)*d,spatialReference:k},o={[i]:s+M*p+t};for(let t=0;t<m;t++)o[l[t+1]]=c[t][e];a.push({geometry:n,attributes:o})}}return a}function L(t,e){const{width:n,height:l,pixels:i,mask:o}=t,r=i[0];let s=0;for(let a=0;a<l;a++){let t=a*n;for(let l=0;l<n;l++,t++)if(!o||o[t]){const n=r[t];e.set(n,(e.get(n)??0)+1),s++}}return s}function G(t,e){const{width:n,height:l,pixels:i,mask:o}=t,r=e.width/n,s=e.height/l,{xmin:a,ymax:h}=e,f=e.spatialReference.toJSON(),c=[];for(let u=0;u<l;u++)for(let t=0;t<n;t++){const e=u*n+t;if(!o||o[e]){const n={x:a+(t+.5)*r,y:h-(u+.5)*s,spatialReference:f},l=i.map(t=>t[e]);c.push({location:n,value:l})}}return c}function V(t,e,l){const{attributeTable:i}=e;if(!i)return t;const o=i.fields.find(t=>t.name.toLowerCase()===l.toLowerCase()),r=i.fields.find(t=>"value"===t.name.toLowerCase());if(!o||!r)return t;const[s]=t.pixels,a="single"===o.type?"f32":"double"===o.type||"big-integer"===o.type?"f64":"small-integer"===o.type?"s16":"s32",h=s.length,f=new("f32"===a?Float32Array:"f64"===a?Float64Array:"s16"===a?Int16Array:Int32Array)(h),c=new Map;for(const n of i.features){const t=n.attributes[r.name],e=n.attributes[o.name];c.set(t,e)}const u=t.mask??new Uint8Array(h).fill(255);for(let n=0;n<h;n++)if(u[n]){const t=c.get(s[n]);null==t?u[n]=0:f[n]=t}return new n({width:t.width,height:t.height,pixels:[f],mask:u,pixelType:a})}function $(t){const{srcDimensions:e,destDimension:n,transformGrid:{coefficients:l,spacing:i},bias:o=0,pos:{x:r,y:s}}=t;if(!l?.length)return null;const{width:a,height:h}=e,{width:f}=n,[c,u]=i,p=Math.ceil(f/c-.1/c),x=Math.floor(r/c),d=Math.floor(s/u),m=Math.floor(r-x*c),g=Math.floor(s-d*u),y=12*(d*p+x)+(m>=g?6:0),w=(g+.5)/u,k=(m+.5)/c;return{x:(l[y]*k+l[y+1]*w+l[y+2])*a+o,y:(l[y+3]*k+l[y+4]*w+l[y+5])*h+o}}function J(t){const{pos:e,pixelData:n,pixelSize:l,transformGrid:i}=t;if(!n.pixelBlock)return null;const{xmin:o,xmax:r,ymin:s,ymax:a}=n.extent;let h=Math.floor((e.x-o)/l.x),f=Math.floor((a-e.y)/l.y);const c={width:Math.round((r-o)/l.x),height:Math.round((a-s)/l.y)},{width:u,height:p,mask:x}=n.pixelBlock;if(i){const t=$({pos:{x:h,y:f},transformGrid:i,srcDimensions:{width:u,height:p},destDimension:c});if(!t||t.x<0||t.x>=u||t.y<0||t.y>=p)return null;h=t.x,f=t.y}const d=Math.floor(f),m=Math.floor(h),g=d*u+m,y=x&&!x[g]?null:n.pixelBlock.pixels.map(t=>t[g]);return{x:h,y:f,row:d,col:m,position:g,value:y}}export{z as approximateTransform,_ as clip,E as clipTile,h as colorize,s as compositeBands,O as convertPixelBlockToFeatures,L as countCategoricalPixels,a as createColormapLUT,U as createMaskLUT,m as createRangeMaps,A as createRemapLUT,r as extractBands,b as getClipBounds,j as getLocalArithmeticNorthRotations,J as getPixelLocationAndValue,$ as getPixelOffset,G as getValidPixels,x as highlightPixels,N as interpolateOffsets,o as isValidPixelBlock,c as lookupBandValues,f as lookupPixels,V as mapPixelValueToAttribute,M as mask,k as matchAnyMask,l as maxMapSizeGpu,S as mosaic,T as mosaicPixelData,i as pixelIdFieldName,g as remap,d as remapColor,I as resampleByMajority,u as selectBySingleBandRange,p as selectByXYMask,C as setValidBoundary,W as split};
2
+ import{numberMaxFloat32 as t}from"../../../core/mathUtils.js";import{getPixelValueRange as e}from"../formats/pixelRangeUtils.js";import n from"../../support/PixelBlock.js";const l=9,i="PixelID";function o(t){return null!=t&&t.pixels?.length>0}function s(t){if(!t?.length||t.some(t=>!o(t)))return null;if(1===t.length)return t[0]?.clone()??null;const e=t,{width:l,height:i,pixelType:s}=e[0];if(e.some(t=>t.width!==l||t.height!==i))return null;const r=e.map(({mask:t})=>t).filter(t=>null!=t);let a=null;r.length&&(a=new Uint8Array(l*i),a.set(r[0]),r.length>1&&w(r.slice(1),a));const h=[];e.forEach(({pixels:t})=>h.push(...t));const f=null!=a&&h.length===e.length?e.map(({width:t,height:e,mask:n})=>n??new Uint8Array(t*e).fill(255)):null,c=e.map(({statistics:t})=>t).filter(t=>t?.length),u=[];return c.forEach(t=>u.push(...t)),new n({pixelType:s,width:l,height:i,mask:a,bandMasks:f,pixels:h,statistics:u.length?u:null})}function r(t){if(!t)return;const e=t.colormap;if(!e||0===e.length)return;const n=e.sort((t,e)=>t[0]-e[0]),l=n[0][0]<0?n[0][0]:0,i=Math.max(256,n[n.length-1][0]-l+1),o=new Uint8Array(4*i),s=[],r=5===n[0].length;if(i>65536)return n.forEach(t=>{s[t[0]-l]=r?t.slice(1):t.slice(1).concat([255])}),{indexed2DColormap:s,offset:l,alphaSpecified:r};if(t.fillUnspecified){let t=n[0];for(let e=t[0]-l,s=0;e<i;e++)o[4*e]=t[1],o[4*e+1]=t[2],o[4*e+2]=t[3],o[4*e+3]=r?t[4]:255,e===t[0]-l&&(t=s===n.length-1?t:n[++s])}else for(let a=0;a<n.length;a++){const t=n[a],e=4*(t[0]-l);o[e]=t[1],o[e+1]=t[2],o[e+2]=t[3],o[e+3]=r?t[4]:255}return{indexedColormap:o,offset:l,alphaSpecified:r}}function a(t,e){if(!o(t))return t;if(!e||!e.indexedColormap&&!e.indexed2DColormap)return t;const n=t.clone(),l=n.pixels;let i=n.mask;const s=n.width*n.height;if(1!==l.length)return t;const{indexedColormap:r,indexed2DColormap:a,offset:h,alphaSpecified:f}=e,c=l[0],u=new Uint8Array(c.length),p=new Uint8Array(c.length),x=new Uint8Array(c.length);let d,m=0;if(r){const t=r.length-1;if(null!=i)for(let e=0;e<s;e++)i[e]&&(m=4*(c[e]-h),m<h||m>t?i[e]=0:(u[e]=r[m],p[e]=r[m+1],x[e]=r[m+2],i[e]=r[m+3]));else{i=new Uint8Array(s);for(let e=0;e<s;e++)m=4*(c[e]-h),m<h||m>t?i[e]=0:(u[e]=r[m],p[e]=r[m+1],x[e]=r[m+2],i[e]=r[m+3]);n.mask=i}}else if(a)if(null!=i)for(let o=0;o<s;o++)i[o]&&(d=a[c[o]],u[o]=d[0],p[o]=d[1],x[o]=d[2],i[o]=d[3]);else{i=new Uint8Array(s);for(let t=0;t<s;t++)d=a[c[t]],u[t]=d[0],p[t]=d[1],x[t]=d[2],i[t]=d[3];n.mask=i}return n.pixels=[u,p,x],n.statistics=null,n.pixelType="u8",n.maskIsAlpha=f,n}function h(t,e){if(!o(t))return null;const{pixels:l,mask:i}=t,s=l.length;let r=e.lut;const{offset:a}=e;r&&1===r[0].length&&(r=l.map(()=>r));const h=[],c=e.outputPixelType||"u8";for(let n=0;n<s;n++){const t=f(l[n],i,r[n],a||0,c);h.push(t)}const u=new n({width:t.width,height:t.height,pixels:h,mask:i,pixelType:c});return u.updateStatistics(),u}function f(t,e,l,i,o){const s=t.length,r=n.createEmptyBand(o,s);if(e)for(let n=0;n<s;n++)e[n]&&(r[n]=l[t[n]-i]);else for(let n=0;n<s;n++)r[n]=l[t[n]-i];return r}function c(t,e,n,l){const{width:i,height:o,pixels:s,mask:r}=t,a=i*o,{bandId:h,ranges:f}=n,c=s[h];if(!c)return;const u=1===f.length,[p,x]=f[0];for(let d=0;d<a;d++)if(!r||r[d]){const t=c[d];if(u)t>=p&&t<=x&&(e[d]=l);else for(let n=0;n<f.length;n++){const[i,o]=f[n];if(t>=i&&t<=o){e[d]=l;break}}}}function u(t,e,n,l){const{width:i,height:o,xyMask:s,xBandId:r,yBandId:a,xBandRange:h,yBandRange:f}=n,{pixels:c,mask:u}=t,p=c[r],x=c[a],[d,m]=h,[g,y]=f,w=(m-d)/i,k=(y-g)/o;for(let M=0;M<p.length;M++)if(!u||u[M]){let t=p[M],n=x[M];if(t<d||t>m||n<g||n>y)continue;s?(t=(t-d)*w,t=t>i-1?i-1:t<0?0:255&t,n=(y-n)*k,n=n>o-1?o-1:n<0?0:255&n,s[n*i+t]&&(e[M]=l)):e[M]=l}}function p(t){const{pixelBlock:e,renderedPixelBlock:n,highlightOptions:l}=t;if(!o(e))return;const{width:i,height:s}=e,r=i*s,a=new Uint8Array(r);for(let o=1;o<=l.length;o++){const t=l[o-1];"bandId"in t?c(e,a,t,o):u(e,a,t,o)}const{pixels:h}=n;1===h.length&&(h[1]=h[0].slice(),h[2]=h[0].slice());const f=l.map(t=>t.color),[p,x,d]=h;if(n.mask){const t=n.mask;for(let e=0;e<r;e++)if(t[e]){t[e]=255;const n=a[e];if(n){const l=f[n-1];p[e]=l[0],x[e]=l[1],d[e]=l[2],t[e]=l[3]}}}else{const t=new Uint8Array(r).fill(255);for(let e=0;e<r;e++){const n=a[e];if(n){const l=f[n-1];p[e]=l[0],x[e]=l[1],d[e]=l[2],t[e]=l[3]}}n.mask=t}n.maskIsAlpha=!0}function x(t,e){if(!o(t))return null;const n=t.clone(),{pixels:l}=n,i=n.width*n.height,s=e.length,r=Math.floor(s/2),a=e[Math.floor(r)],h=l[0],f=new Uint8Array(i),c=new Uint8Array(i),u=new Uint8Array(i);let p=n.mask;const x=4===e[0].mappedColor.length;p||(p=new Uint8Array(i),p.fill(x?255:1),n.mask=p);for(let o=0;o<i;o++)if(p[o]){const t=h[o];let n=!1,l=r,i=a,x=0,d=s-1;for(;d-x>1;){if(t===i.value){n=!0;break}t>i.value?x=l:d=l,l=Math.floor((x+d)/2),i=e[Math.floor(l)]}n||(t===e[x].value?(i=e[x],n=!0):t===e[d].value?(i=e[d],n=!0):t<e[x].value?n=!1:t>e[x].value&&(t<e[d].value?(i=e[x],n=!0):d===s-1?n=!1:(i=e[d],n=!0))),n?(f[o]=i.mappedColor[0],c[o]=i.mappedColor[1],u[o]=i.mappedColor[2],p[o]=i.mappedColor[3]):f[o]=c[o]=u[o]=p[o]=0}return n.pixels=[f,c,u],n.mask=p,n.pixelType="u8",n.maskIsAlpha=x,n}function d(e,n,i=!1){const o=1e-5,s=new Float32Array(3*l),r=n.length;for(let a=0;a<l;a++)s[3*a]=e[2*a]??t-1,s[3*a+1]=e[2*a+1]??t,s[3*a+2]=n[a]??0,a<r&&(a>0&&(s[3*a]-=o),e[2*a+1]!==e[2*a]&&(a<r-1||!i)&&(s[3*a+1]-=o));return s}function m(t,l){if(!o(t))return null;const{width:i,height:s}=t,{inputRanges:r,outputValues:a,outputPixelType:h,noDataRanges:f,allowUnmatched:c,replacementValue:u,isLastInputRangeInclusive:p}=l,x=t.pixels[0],d=n.createEmptyBand(h,x.length),m=t.mask,g=new Uint8Array(i*s);m?g.set(m):g.fill(255);const y=t.pixelType.startsWith("f")?1e-6:0,w=r.map(t=>t-y);w[0]=r[0],w[w.length-1]=r[r.length-1]+(p?1e-6:0);const k=r.length/2,[M,A]=e(h);for(let e=0;e<s;e++)for(let t=0;t<i;t++){const n=e*i+t;if(g[n]){const t=x[n];let e=!1;for(let l=k-1;l>=0;l--)if(t===r[2*l]||t>w[2*l]&&t<w[2*l+1]){d[n]=a[l],e=!0;break}e||(c?d[n]=t>A?A:t<M?M:u??t:g[n]=0)}}const U=f?.length;if(U)for(let e=0;e<s;e++)for(let t=0;t<i;t++){const n=e*i+t;if(!m||m[n]){const t=x[n];for(let e=0;e<U;e+=2)if(t>=f[e]&&t<=f[e+1]){d[n]=0,g[n]=0;break}}}return new n({width:i,height:s,pixelType:h,pixels:[d],mask:g})}function g(t,e,n,l){const i=null!=n&&n.length>=2?new Set(n):null,o=1===n?.length?n[0]:null,s=!!e?.length;for(let r=0;r<t.length;r++)if(l[r]){const n=t[r];if(s){let t=!1;for(let l=0;l<e.length;l+=2)if(n>=e[l]&&n<=e[l+1]){t=!0;break}t||(l[r]=0)}l[r]&&(n===o||i?.has(n))&&(l[r]=0)}}function y(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(t[e][l]){n=!0;break}n||(e[l]=0)}return e}function w(t,e){const n=t[0].length;e??=new Uint8Array(n).fill(255);for(let l=0;l<n;l++)if(e[l]){let n=!1;for(let e=0;e<t.length;e++)if(0===t[e][l]){n=!0;break}n&&(e[l]=0)}return e}function k(t,e){if(!o(t))return null;const{width:l,height:i,pixels:s}=t,r=l*i,a=new Uint8Array(r);t.mask?a.set(t.mask):a.fill(255);const h=s.length,{includedRanges:c,noDataValues:u,outputPixelType:p,matchAll:x,lookups:d}=e;if(d){const t=[];for(let e=0;e<h;e++){const n=d[e],l=f(s[e],a,n.lut,n.offset||0,"u8");t.push(l)}1===t.length?a.set(t[0]):x?y(t,a):w(t,a)}else if(x){const t=[];for(let e=0;e<h;e++){const n=new Uint8Array(r);n.set(a),g(s[e],c?.slice(2*e,2*e+2),u?.[e],n),t.push(n)}1===t.length?a.set(t[0]):y(t,a)}else for(let n=0;n<h;n++)g(s[n],c?.slice(2*n,2*n+2),u?.[n],a);return new n({width:l,height:i,pixelType:p,pixels:s,mask:a})}function M(t){const{srcPixelType:l,inputRanges:i,outputValues:o,allowUnmatched:s,noDataRanges:r,isLastInputRangeInclusive:a,outputPixelType:h}=t;if("u8"!==l&&"s8"!==l&&"u16"!==l&&"s16"!==l)return null;const f=l.includes("16")?65536:256,c=l.includes("s")?-f/2:0,u=n.createEmptyBand(h,f),p=new Uint8Array(f);s&&p.fill(255);const[x,d]=e(h);if(i?.length&&o?.length){const t=1e-6,e=i.map(e=>e-t);e[0]=i[0],a&&(e[e.length-1]=i[i.length-1]);for(let n=0;n<e.length;n++){const t=o[n]>d?d:o[n]<x?x:o[n],l=Math.ceil(e[2*n]-c),s=i[2*n+1]===i[2*n]?l:Math.floor(e[2*n+1]-c);for(let e=l;e<=s;e++)u[e]=t,p[e]=255}}if(r?.length)for(let e=0;e<r.length;e++){const t=Math.ceil(r[2*e]-c),n=Math.floor(r[2*e+1]-c);for(let e=t;e<=n;e++)p[e]=0}return{lut:u,offset:c,mask:p}}function A(t,e,n){if("u8"!==t&&"s8"!==t&&"u16"!==t&&"s16"!==t)return null;const l=t.includes("16")?65536:256,i=t.includes("s")?-l/2:0,o=new Uint8Array(l);if(e)for(let s=0;s<e.length;s++){const t=Math.ceil(e[2*s]-i),n=Math.floor(e[2*s+1]-i);for(let e=t;e<=n;e++)o[e]=255}else o.fill(255);if(n)for(let s=0;s<n.length;s++)o[n[s]-i]=0;return{lut:o,offset:i}}function U(t,e,n,l,i,o,s,r){return{xmin:i<=n*t?0:i<n*t+t?i-n*t:t,ymin:o<=l*e?0:o<l*e+e?o-l*e:e,xmax:i+s<=n*t?0:i+s<n*t+t?i+s-n*t:t,ymax:o+r<=l*e?0:o+r<l*e+e?o+r-l*e:e}}function b(t,e){if(!t||0===t.length)return null;const n=t.find(t=>t.pixelBlock);if(null==n?.pixelBlock)return null;const l=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,i=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,o=.01*Math.min(l,i),s=t.sort((t,e)=>Math.abs(t.extent.ymax-e.extent.ymax)>o?e.extent.ymax-t.extent.ymax:Math.abs(t.extent.xmin-e.extent.xmin)>o?t.extent.xmin-e.extent.xmin:0),r=Math.min.apply(null,s.map(t=>t.extent.xmin)),a=Math.min.apply(null,s.map(t=>t.extent.ymin)),h=Math.max.apply(null,s.map(t=>t.extent.xmax)),f=Math.max.apply(null,s.map(t=>t.extent.ymax)),c={x:Math.round((e.xmin-r)/l),y:Math.round((f-e.ymax)/i)},u={width:Math.round((h-r)/l),height:Math.round((f-a)/i)},p={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/i)};if(Math.round(u.width/n.pixelBlock.width)*Math.round(u.height/n.pixelBlock.height)!==s.length||c.x<0||c.y<0||u.width<p.width||u.height<p.height)return null;return{extent:e,pixelBlock:B(s.map(t=>t.pixelBlock),u,{clipOffset:c,clipSize:p})}}function T(t,e,n,l,i,o){const{width:s,height:r}=n.block,{x:a,y:h}=n.offset,{width:f,height:c}=n.mosaic,u=U(s,r,l,i,a,h,f,c);let p=0,x=0;if(o){const t=o.hasGCSSShiftTransform?360:o.halfWorldWidth??0,e=s*o.resolutionX,n=o.startX+l*e;n<t&&n+e>t?x=o.rightPadding:n>=t&&(p=o.leftMargin-o.rightPadding,x=0)}if(u.xmax-=x,"number"!=typeof e)for(let d=u.ymin;d<u.ymax;d++){const n=(i*r+d-h)*f+(l*s-a)+p,o=d*s;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e[o+l]}else for(let d=u.ymin;d<u.ymax;d++){const n=(i*r+d-h)*f+(l*s-a)+p;for(let l=u.xmin;l<u.xmax;l++)t[n+l]=e}}function B(t,e,l={}){const{clipOffset:i,clipSize:s,alignmentInfo:r,blockWidths:a}=l;if(a)return S(t,e,{blockWidths:a});const h=t.find(t=>o(t));if(null==h)return null;const f=s?s.width:e.width,c=s?s.height:e.height,u=h.width,p=h.height,x=e.width/u,d=e.height/p,m={offset:i||{x:0,y:0},mosaic:s||e,block:{width:u,height:p}},g=h.pixelType,y=n.getPixelArrayConstructor(g),w=h.pixels.length,k=[];let M,A;for(let n=0;n<w;n++){A=new y(f*c);for(let e=0;e<d;e++)for(let l=0;l<x;l++){const i=t[e*x+l];o(i)&&(M=i.pixels[n],T(A,M,m,l,e,r))}k.push(A)}const U=t.some(t=>null==t||null!=t.mask&&t.mask.length>0),b=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),B=U?new Uint8Array(f*c):void 0,v=b?[]:void 0;if(B){for(let e=0;e<d;e++)for(let n=0;n<x;n++){const l=t[e*x+n],i=null!=l?l.mask:null;T(B,null!=i?i:l?255:0,m,n,e,r)}if(v)for(let e=0;e<w;e++){const n=new Uint8Array(f*c);for(let l=0;l<d;l++)for(let i=0;i<x;i++){const o=t[l*x+i],s=o?.bandMasks?.[e]??o?.mask;T(n,null!=s?s:o?255:0,m,i,l,r)}v.push(n)}}const C=new n({width:f,height:c,pixels:k,pixelType:g,bandMasks:v,mask:B});return C.updateStatistics(),C}function S(t,e,l){const i=t.find(t=>null!=t);if(null==i)return null;const s=t.some(t=>null==t||!!t.mask),{width:r,height:a}=e,h=s?new Uint8Array(r*a):null,{blockWidths:f}=l,c=[],u=i.getPlaneCount(),p=n.getPixelArrayConstructor(i.pixelType);if(s)for(let n=0,y=0;n<t.length;y+=f[n],n++){const e=t[n];if(!o(e))continue;const l=e.mask;for(let t=0;t<a;t++)for(let i=0;i<f[n];i++)h[t*r+i+y]=null==l?255:l[t*e.width+i]}const x=t.some(t=>t?.bandMasks&&t.bandMasks.length>1),d=x?[]:void 0,m=r*a;for(let n=0;n<u;n++){const e=new p(m),l=x?new Uint8Array(m):void 0;for(let i=0,s=0;i<t.length;s+=f[i],i++){const h=t[i];if(!o(h))continue;const c=h.pixels[n];if(null!=c){for(let t=0;t<a;t++)for(let n=0;n<f[i];n++)e[t*r+n+s]=c[t*h.width+n];if(l){const t=h.bandMasks?.[n]??h.mask;for(let e=0;e<a;e++)for(let n=0;n<f[i];n++)l[e*r+n+s]=t?t[e*h.width+n]:255}}}c.push(e),d&&l&&d.push(l)}const g=new n({width:r,height:a,mask:h,bandMasks:d,pixels:c,pixelType:i.pixelType});return g.updateStatistics(),g}function v(t,e,n){if(!o(t))return null;const{width:l,height:i}=t,s=e.x,r=e.y,a=n.width+s,h=n.height+r;if(s<0||r<0||a>l||h>i)return t;if(0===s&&0===r&&a===l&&h===i)return t;t.mask||(t.mask=new Uint8Array(l*i));const f=t.mask;for(let o=0;o<i;o++){const t=o*l;for(let e=0;e<l;e++)f[t+e]=o<r||o>=h||e<s||e>=a?0:1}return t.updateStatistics(),t}function C(t){if(!o(t))return null;const e=t.clone(),{width:n,height:l,pixels:i}=t,s=i[0],r=e.pixels[0],a=t.mask;for(let o=2;o<l-1;o++){const t=new Map;for(let l=o-2;l<o+2;l++)for(let e=0;e<4;e++){const i=l*n+e;P(t,s[i],a?a[i]:1)}r[o*n]=I(t),r[o*n+1]=r[o*n+2]=r[o*n];let e=3;for(;e<n-1;e++){let l=(o-2)*n+e+1;P(t,s[l],a?a[l]:1),l=(o-1)*n+e+1,P(t,s[l],a?a[l]:1),l=o*n+e+1,P(t,s[l],a?a[l]:1),l=(o+1)*n+e+1,P(t,s[l],a?a[l]:1),l=(o-2)*n+e-3,R(t,s[l],a?a[l]:1),l=(o-1)*n+e-3,R(t,s[l],a?a[l]:1),l=o*n+e-3,R(t,s[l],a?a[l]:1),l=(o+1)*n+e-3,R(t,s[l],a?a[l]:1),r[o*n+e]=I(t)}r[o*n+e+1]=r[o*n+e]}for(let o=0;o<n;o++)r[o]=r[n+o]=r[2*n+o],r[(l-1)*n+o]=r[(l-2)*n+o];return e.updateStatistics(),e}function I(t){if(0===t.size)return 0;let e=0,n=-1,l=0;const i=t.keys();let o=i.next();for(;!o.done;)l=t.get(o.value),l>e&&(n=o.value,e=l),o=i.next();return n}function R(t,e,n){if(0===n)return;const l=t.get(e);1===l?t.delete(e):t.set(e,l-1)}function P(t,e,n){0!==n&&t.set(e,t.has(e)?t.get(e)+1:1)}function D(t,e,l){let{x:i,y:s}=e;const{width:r,height:a}=l;if(0===i&&0===s&&a===t.height&&r===t.width)return t;const{width:h,height:f}=t,c=Math.max(0,s),u=Math.max(0,i),p=Math.min(i+r,h),x=Math.min(s+a,f);if(p<0||x<0||!o(t))return null;i=Math.max(0,-i),s=Math.max(0,-s);const{pixels:d}=t,m=r*a,g=d.length,y=[];for(let o=0;o<g;o++){const e=d[o],l=n.createEmptyBand(t.pixelType,m);for(let t=c;t<x;t++){const n=t*h;let o=(t+s-c)*r+i;for(let t=u;t<p;t++)l[o++]=e[n+t]}y.push(l)}const w=new Uint8Array(m),k=t.mask;for(let n=c;n<x;n++){const t=n*h;let e=(n+s-c)*r+i;for(let n=u;n<p;n++)w[e++]=k?k[t+n]:1}const M=new n({width:l.width,height:l.height,pixelType:t.pixelType,pixels:y,mask:w});return M.updateStatistics(),M}function _(t,e=!0){if(!o(t))return null;const{pixels:l,width:i,height:s,mask:r,pixelType:a}=t,h=[],f=Math.round(i/2),c=Math.round(s/2),u=s-1,p=i-1;for(let o=0;o<l.length;o++){const t=l[o],r=n.createEmptyBand(a,f*c);let x=0;for(let n=0;n<s;n+=2)for(let l=0;l<i;l+=2){const o=t[n*i+l];if(e){const e=l===p?o:t[n*i+l+1],s=n===u?o:t[n*i+l+i],a=l===p?s:n===u?e:t[n*i+l+i+1];r[x++]=(o+e+s+a)/4}else r[x++]=o}h.push(r)}let x=null;if(null!=r){x=new Uint8Array(f*c);let t=0;for(let n=0;n<s;n+=2)for(let l=0;l<i;l+=2){const o=r[n*i+l];if(e){const e=l===p?o:r[n*i+l+1],s=n===u?o:r[n*i+l+i],a=l===p?s:n===u?e:r[n*i+l+i+1];x[t++]=o*e*s*a?1:0}else x[t++]=o}}return new n({width:f,height:c,pixelType:a,pixels:h,mask:x})}function F(t,e,n=0,l=!0){if(!o(t))return null;const{width:i,height:s}=e;let{width:r,height:a}=t;const h=new Map,f={x:0,y:0},c=1+n;let u=t;for(let o=0;o<c;o++){const t=Math.ceil(r/i),n=Math.ceil(a/s);for(let l=0;l<n;l++){f.y=l*s;for(let n=0;n<t;n++){f.x=n*i;const t=D(u,f,e);h.set(`${o}/${l}/${n}`,t)}}o<c-1&&(u=_(u,l)),r=Math.round(r/2),a=Math.round(a/2)}return h}function W(t){const{pixelBlock:e,tileSize:n,level:l,row:i,col:s,useBilinear:r}=t;if(!o(e))return null;const{width:a,height:h}=n,f=2**l,c=f*a,u=f*h;let p=D(e,{y:i*u,x:s*c},{width:c,height:u});if(!p)return null;for(let o=l;o>0;o--)p=_(p,r);return p}function E(t,e,n,l,i=0){const{width:o,height:s}=t,{width:r,height:a}=e,h=l.cols,f=l.rows,c=Math.ceil(r/h-.1/h),u=Math.ceil(a/f-.1/f);let p,x,d,m,g,y,w;const k=c*h,M=k*u*f,A=new Float32Array(M),U=new Float32Array(M),b=new Uint32Array(M),T=new Uint32Array(M);let B,S,v=0;for(let C=0;C<u;C++)for(let t=0;t<c;t++){p=12*(C*c+t),x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){v=(C*f+e)*k+t*h,S=(e+.5)/f;for(let t=0;t<e;t++)B=(t+.5)/h,A[v+t]=(x*B+d*S+m)*o+i,U[v+t]=(g*B+y*S+w)*s+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}p+=6,x=n[p],d=n[p+1],m=n[p+2],g=n[p+3],y=n[p+4],w=n[p+5];for(let e=0;e<f;e++){v=(C*f+e)*k+t*h,S=(e+.5)/f;for(let t=e;t<h;t++)B=(t+.5)/h,A[v+t]=(x*B+d*S+m)*o+i,U[v+t]=(g*B+y*S+w)*s+i,b[v+t]=Math.floor(A[v+t]),T[v+t]=Math.floor(U[v+t])}}return{offsets_x:A,offsets_y:U,offsets_xi:b,offsets_yi:T,gridWidth:k}}function N(t,e){const{coefficients:n,spacing:l}=e,{offsets_x:i,offsets_y:o,gridWidth:s}=E(t,t,n,{rows:l[0],cols:l[1]}),{width:r,height:a}=t,h=new Float32Array(r*a),f=180/Math.PI;for(let c=0;c<a;c++)for(let t=0;t<r;t++){const e=c*s+t,n=0===c?e:e-s,l=c===a-1?e:e+s,u=i[n]-i[l],p=o[l]-o[n];if(isNaN(u)||isNaN(p))h[c*r+t]=90;else{let e=Math.atan2(p,u)*f;e=(360+e)%360,h[c*r+t]=e}}return h}function j(t,e,l,i,s="nearest"){if(!o(t))return null;"majority"===s&&(t=C(t));const{pixels:r,mask:a,bandMasks:h,pixelType:f}=t,c=t.width,u=t.height,p=n.getPixelArrayConstructor(f),x=r.length,{width:d,height:m}=e;let g=!1;for(let n=0;n<l.length;n+=3)-1===l[n]&&-1===l[n+1]&&-1===l[n+2]&&(g=!0);const{offsets_x:y,offsets_y:w,offsets_xi:k,offsets_yi:M,gridWidth:A}=E({width:c,height:u},e,l,i,"majority"===s?.5:0);let U;const b=(t,e,n,l)=>{const i=t instanceof Float32Array||t instanceof Float64Array?0:.5;for(let o=0;o<m;o++){U=o*A;for(let s=0;s<d;s++){if(y[U]<0||w[U]<0)t[o*d+s]=0;else if(l)t[o*d+s]=e[k[U]+M[U]*c];else{const l=Math.floor(y[U]),r=Math.floor(w[U]),a=Math.ceil(y[U]),h=Math.ceil(w[U]),f=y[U]-l,u=w[U]-r;if(!n||n[l+r*c]&&n[a+r*c]&&n[l+h*c]&&n[a+h*c]){const n=(1-f)*e[l+r*c]+f*e[a+r*c],p=(1-f)*e[l+h*c]+f*e[a+h*c];t[o*d+s]=(1-u)*n+u*p+i}else t[o*d+s]=e[k[U]+M[U]*c]}U++}}},T=[];let B;const S=h?.length===x,v=[];for(let n=0;n<x;n++){if(S){const t=new Uint8Array(d*m);b(t,h[n],h[n],!0),v.push(t)}B=new p(d*m),b(B,r[n],S?h[n]:a,"nearest"===s||"majority"===s),T.push(B)}const I=new n({width:d,height:m,pixelType:f,pixels:T,bandMasks:S?v:void 0});if(null!=a)I.mask=new Uint8Array(d*m),b(I.mask,a,a,!0);else if(g){I.mask=new Uint8Array(d*m);for(let t=0;t<d*m;t++)I.mask[t]=y[t]<0||w[t]<0?0:1}return I.updateStatistics(),I}function z(t){const{pixelBlock:e,extent:n,fieldNames:l,skipFactor:o,skipSpatialReference:s=!1,pixelIdOffset:r=0}=t,a=[],{width:h,height:f,pixels:c,mask:u}=e,p=t.imageRowSize??h,x=n.width/h,d=n.height/f,m=c.length,g=Math.floor(o/2),{xmin:y,ymax:w}=n,k=s?void 0:n.spatialReference.toJSON();for(let M=g;M<f;M+=o)for(let t=g;t<h;t+=o){const e=M*h+t;if(!u||u[e]){const n={x:y+(t+.5)*x,y:w-(M+.5)*d,spatialReference:k},o={[i]:r+M*p+t};for(let t=0;t<m;t++)o[l[t+1]]=c[t][e];a.push({geometry:n,attributes:o})}}return a}function O(t,e){const{width:n,height:l,pixels:i,mask:o}=t,s=i[0];let r=0;for(let a=0;a<l;a++){let t=a*n;for(let l=0;l<n;l++,t++)if(!o||o[t]){const n=s[t];e.set(n,(e.get(n)??0)+1),r++}}return r}function L(t,e){const{width:n,height:l,pixels:i,mask:o}=t,s=e.width/n,r=e.height/l,{xmin:a,ymax:h}=e,f=e.spatialReference.toJSON(),c=[];for(let u=0;u<l;u++)for(let t=0;t<n;t++){const e=u*n+t;if(!o||o[e]){const n={x:a+(t+.5)*s,y:h-(u+.5)*r,spatialReference:f},l=i.map(t=>t[e]);c.push({location:n,value:l})}}return c}function G(t,e,l){const{attributeTable:i}=e;if(!i)return t;const o=i.fields.find(t=>t.name.toLowerCase()===l.toLowerCase()),s=i.fields.find(t=>"value"===t.name.toLowerCase());if(!o||!s)return t;const[r]=t.pixels,a="single"===o.type?"f32":"double"===o.type||"big-integer"===o.type?"f64":"small-integer"===o.type?"s16":"s32",h=r.length,f=new("f32"===a?Float32Array:"f64"===a?Float64Array:"s16"===a?Int16Array:Int32Array)(h),c=new Map;for(const n of i.features){const t=n.attributes[s.name],e=n.attributes[o.name];c.set(t,e)}const u=t.mask??new Uint8Array(h).fill(255);for(let n=0;n<h;n++)if(u[n]){const t=c.get(r[n]);null==t?u[n]=0:f[n]=t}return new n({width:t.width,height:t.height,pixels:[f],mask:u,pixelType:a})}function V(t){const{srcDimensions:e,destDimension:n,transformGrid:{coefficients:l,spacing:i},bias:o=0,pos:{x:s,y:r}}=t;if(!l?.length)return null;const{width:a,height:h}=e,{width:f}=n,[c,u]=i,p=Math.ceil(f/c-.1/c),x=Math.floor(s/c),d=Math.floor(r/u),m=Math.floor(s-x*c),g=Math.floor(r-d*u),y=12*(d*p+x)+(m>=g?6:0),w=(g+.5)/u,k=(m+.5)/c;return{x:(l[y]*k+l[y+1]*w+l[y+2])*a+o,y:(l[y+3]*k+l[y+4]*w+l[y+5])*h+o}}function $(t){const{pos:e,pixelData:n,pixelSize:l,transformGrid:i}=t;if(!n.pixelBlock)return null;const{xmin:o,xmax:s,ymin:r,ymax:a}=n.extent;let h=Math.floor((e.x-o)/l.x),f=Math.floor((a-e.y)/l.y);const c={width:Math.round((s-o)/l.x),height:Math.round((a-r)/l.y)},{width:u,height:p,mask:x}=n.pixelBlock;if(i){const t=V({pos:{x:h,y:f},transformGrid:i,srcDimensions:{width:u,height:p},destDimension:c});if(!t||t.x<0||t.x>=u||t.y<0||t.y>=p)return null;h=t.x,f=t.y}const d=Math.floor(f),m=Math.floor(h),g=d*u+m,y=x&&!x[g]?null:n.pixelBlock.pixels.map(t=>t[g]);return{x:h,y:f,row:d,col:m,position:g,value:y}}export{j as approximateTransform,D as clip,W as clipTile,a as colorize,s as compositeBands,z as convertPixelBlockToFeatures,O as countCategoricalPixels,r as createColormapLUT,A as createMaskLUT,d as createRangeMaps,M as createRemapLUT,U as getClipBounds,N as getLocalArithmeticNorthRotations,$ as getPixelLocationAndValue,V as getPixelOffset,L as getValidPixels,p as highlightPixels,E as interpolateOffsets,o as isValidPixelBlock,f as lookupBandValues,h as lookupPixels,G as mapPixelValueToAttribute,k as mask,w as matchAnyMask,l as maxMapSizeGpu,B as mosaic,b as mosaicPixelData,i as pixelIdFieldName,m as remap,x as remapColor,C as resampleByMajority,c as selectBySingleBandRange,u as selectByXYMask,v as setValidBoundary,F as split};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../request.js";import n from"../../core/Error.js";import t from"./FabricKustoSource.js";import s from"./Field.js";import o from"./GeometryEncodingLocation.js";import{inferLocationInfo as a}from"./locationUtils.js";async function r(t,s){const{data:o}=await e(`https://api.fabric.microsoft.com/v1/workspaces/${t}/kqlDatabases/${s}`,{responseType:"json"});if(null==o)throw new n("kusto:connection",`KQL database '${s}' was not found in workspace '${t}'`);return o}async function i(e,n,t,s={}){return c(e,n,t,{},s)}async function c(e,n,s,i,c={}){if(i.database||(i.database=await r(e,n)),i.fields?.length||(i.fields=await l(i.database,s,c)),i.source||(i.source=new t({workspace:e,database:n,table:s})),!i.source.geometryEncoding){const e=a(i.fields.map(e=>e.name));e.latitudeFieldName&&e.longitudeFieldName&&(i.source.geometryEncoding=new o({xField:e.longitudeFieldName,yField:e.latitudeFieldName}))}return i}async function l(e,n,t={}){const s=await u(e,n,t),o=[];for(const a of s.OrderedColumns){const e=d(a);e&&o.push(e)}return o}async function u(n,t,s={}){const o=n.properties.queryServiceUri;return p((await e(`${o}/v1/rest/mgmt`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:n.displayName,csl:`.show table ${f(t)} schema as json`}),signal:s.signal})).data)}function d(e){const n=m(e.CslType);return n?new s({name:e.Name,type:n}):null}function m(e){switch(e){case"bool":return"small-integer";case"guid":case"string":return"string";case"int":return"integer";case"long":return"big-integer";case"real":return"double";case"dynamic":case"datetime":case"decimal":case"timespan":return null}}function p(e){const t=e.Tables[0];if(null==t||0===t.Rows.length)throw new n("kusto:invalid-schema-response","Kusto schema response did not include any rows");const[s,o]=t.Rows[0];if("string"!=typeof o)throw new n("kusto:invalid-schema-response","Kusto schema response did not include a schema string");return JSON.parse(o)}function f(e){return`['${e.replaceAll("'","''")}']`}function g(e){return e.replaceAll("'","''")}export{c as completeKustoStreamLayerInfo,f as escapeKustoIdentifier,g as escapeKustoStringLiteral,r as fetchKustoDatabaseDetails,i as getKustoStreamLayerInfo};
2
+ import e from"../../request.js";import n from"../../core/Error.js";import t from"./FabricKustoSource.js";import s from"./Field.js";import o from"./GeometryEncodingLocation.js";import{inferLocationInfo as a}from"./locationUtils.js";async function r(t,s){const{data:o}=await e(`https://api.fabric.microsoft.com/v1/workspaces/${t}/kqlDatabases/${s}`,{responseType:"json"});if(null==o)throw new n("kusto:connection",`KQL database '${s}' was not found in workspace '${t}'`);return o}async function i(e,n,s,i,l={}){if(i.database||(i.database=await r(e,n)),i.fields?.length||(i.fields=await c(i.database,s,l)),i.source||(i.source=new t({workspace:e,database:n,table:s})),!i.source.geometryEncoding){const e=a(i.fields.map(e=>e.name));e.latitudeFieldName&&e.longitudeFieldName&&(i.source.geometryEncoding=new o({xField:e.longitudeFieldName,yField:e.latitudeFieldName}))}return i}async function c(e,n,t={}){const s=await l(e,n,t),o=[];for(const a of s.OrderedColumns){const e=u(a);e&&o.push(e)}return o}async function l(n,t,s={}){const o=n.properties.queryServiceUri;return m((await e(`${o}/v1/rest/mgmt`,{responseType:"json",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:n.displayName,csl:`.show table ${p(t)} schema as json`}),signal:s.signal})).data)}function u(e){const n=d(e.CslType);return n?new s({name:e.Name,type:n}):null}function d(e){switch(e){case"bool":return"small-integer";case"guid":case"string":return"string";case"int":return"integer";case"long":return"big-integer";case"real":return"double";case"dynamic":case"datetime":case"decimal":case"timespan":return null}}function m(e){const t=e.Tables[0];if(null==t||0===t.Rows.length)throw new n("kusto:invalid-schema-response","Kusto schema response did not include any rows");const[s,o]=t.Rows[0];if("string"!=typeof o)throw new n("kusto:invalid-schema-response","Kusto schema response did not include a schema string");return JSON.parse(o)}function p(e){return`['${e.replaceAll("'","''")}']`}function f(e){return e.replaceAll("'","''")}export{i as completeKustoStreamLayerInfo,p as escapeKustoIdentifier,f as escapeKustoStringLiteral,r as fetchKustoDatabaseDetails};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.36",
3
+ "version": "5.2.0-next.38",
4
4
  "type": "module",
5
5
  "homepage": "https://js.arcgis.com",
6
6
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
@@ -20,7 +20,7 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.19.1",
23
- "@arcgis/toolkit": "^5.2.0-next.29",
23
+ "@arcgis/toolkit": "^5.2.0-next.33",
24
24
  "@esri/arcgis-html-sanitizer": "~4.1.0",
25
25
  "@esri/calcite-components": "^5.1.1",
26
26
  "@vaadin/grid": "~25.2.0",
package/popup/Feature.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import _ from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import T from"./content/TextContent.js";import{compileExpressionInfos as I,formatArcadeValue as A}from"./support/arcadeFeatureUtils.js";import x from"./support/FeatureAbilities.js";import{preLayerQueryCallback as C,preRequestCallback as E,createFieldInfoMap as w,getAllFieldInfos as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as L}from"./support/featureUtils.js";import{queryLayerInfos as N,queryRelatedFeatures as S,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new x,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(C,E)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return w(F(this._effectivePopupTemplate),this._layer)}get _layer(){const{graphic:t}=this;return t?v(t):void 0}get isFeatureFromTable(){return this._layer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t||!i)return;const s=t?.attributes?.[r];if(null==s)return;const o=[s],a=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),n=a?.geometry;n&&(t.geometry=n)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),I(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,heading:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new T({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileHeading(t){const{_fieldInfoMap:e,_layer:i,graphic:r,expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?A(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._set("expressionAttributes",n??null),this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,F(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=null!=s?.associatedLayer?await(s?.associatedLayer.load(i)):s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&L(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await N({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await S({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=G(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||q(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],J.prototype,"_layer",null),t([g({type:x})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:_})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([y("esri.popup.Feature")],J);const K=J;export{K as default};
2
+ import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import _ from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import v from"./content/TextContent.js";import{compileExpressionInfos as T,formatArcadeValue as I}from"./support/arcadeFeatureUtils.js";import A from"./support/FeatureAbilities.js";import{preLayerQueryCallback as x,preRequestCallback as C,createFieldInfoMap as E,getAllFieldInfos as w,getSourceLayer as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as L}from"./support/featureUtils.js";import{queryLayerInfos as N,queryRelatedFeatures as S,setRelatedFeatures as H,getRelatedFieldInfo as G,createRelatedInfo as q,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._graphicExpressionAttributes=null,this.abilities=new A,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.expressionAttributes=null,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.heading="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(x,C)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return E(w(this._effectivePopupTemplate),this._layer)}get _layer(){return F(this.graphic)}get isFeatureFromTable(){return this._layer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t||!i)return;const s=t?.attributes?.[r];if(null==s)return;const o=[s],a=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),n=a?.geometry;n&&(t.geometry=n)}_clear(){this._set("heading",""),this._set("content",null),this._set("formattedAttributes",null),this._set("expressionAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),T(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,heading:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new v({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileHeading(t){const{_fieldInfoMap:e,_layer:i,graphic:r,expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({heading:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?I(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._set("expressionAttributes",n??null),this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("heading",this._compileHeading(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,w(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=null!=s?.associatedLayer?await(s?.associatedLayer.load(i)):s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&L(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await N({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await S({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{H(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=G(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||q(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],J.prototype,"_layer",null),t([g({type:A})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"expressionAttributes",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:_})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"heading",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([y("esri.popup.Feature")],J);const K=J;export{K as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../request.js";import t from"../../core/Error.js";import{join as r,getPathExtension as o}from"../../core/urlUtils.js";async function s(e,t={},o){await e.load(o);const s=r(e.itemUrl,"resources"),{start:a=1,num:n=10,sortOrder:c="asc",sortField:i="resource"}=t,l={query:{start:a,num:n,sortOrder:c,sortField:i,token:e.apiKey},signal:o?.signal},u=await e.portal.request(s,l);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)}))}}async function a(e,o,s,a){const n=new Map;for(const{resource:r,content:u,compress:p,access:f}of o){if(!r.hasPath())throw new t(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[e,o]=i(r.path),a=`${e}/${p??""}/${f??""}`;n.has(a)||n.set(a,{prefix:e,compress:p,access:f,files:[]});n.get(a).files.push({fileName:o,content:u})}await e.load(a);const c=r(e.userItemUrl,"add"===s?"addResources":"updateResources");for(const{prefix:r,compress:i,access:u,files:p}of n.values()){const o=25;for(let s=0;s<p.length;s+=o){const n=p.slice(s,s+o),f=new FormData;r&&"."!==r&&f.append("resourcesPrefix",r),i&&f.append("compress","true"),u&&f.append("access",u);let d=0;for(const{fileName:e,content:t}of n)f.append("file"+ ++d,t,e);f.append("f","json");try{await e.portal.request(c,{method:"post",body:f,signal:a?.signal})}catch(l){if(a?.ignoreResourceCopyErrors&&l instanceof t&&"CONT_00942"===l.details?.messageCode)continue;throw l}}}}async function n(e,o,s){if(!o.hasPath())throw new t("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(s);const a=r(e.userItemUrl,"removeResources");await e.portal.request(a,{method:"post",query:{resource:o.path},signal:s?.signal}),o.portalItem=null}async function c(e,t){await e.load(t);const o=r(e.userItemUrl,"removeResources");return e.portal.request(o,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function i(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function l(e){const[t,r]=u(e),[o,s]=i(t);return[o,s,r]}function u(e){const t=o(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}async function p(t){if("blob"===t.type)return t.blob;if("json"===t.type)return new Blob([t.jsonString],{type:"application/json"});return(await e(t.url,{responseType:"blob"})).data}function f(e,t){if(!e.hasPath())return null;const[o,,s]=l(e.path);return e.portalItem.resourceFromPath(r(o,t+s))}function d(e,t){if(!e.hasPath())return null;const[o,,s]=l(e.path);return e.portalItem.resourceFromPath(r(o,t+s))}export{a as addOrUpdateResources,p as contentToBlob,s as fetchResources,f as getSiblingOfSameType,d as getSiblingOfSameTypeI,c as removeAllResources,n as removeResource,l as splitPrefixFileNameAndExtension};
2
+ import e from"../../request.js";import t from"../../core/Error.js";import{join as r,getPathExtension as s}from"../../core/urlUtils.js";async function o(e,t={},s){await e.load(s);const o=r(e.itemUrl,"resources"),{start:a=1,num:n=10,sortOrder:c="asc",sortField:i="resource"}=t,l={query:{start:a,num:n,sortOrder:c,sortField:i,token:e.apiKey},signal:s?.signal},u=await e.portal.request(o,l);return{total:u.total,nextStart:u.nextStart,resources:u.resources.map(({created:t,size:r,resource:s})=>({created:new Date(t),size:r,resource:e.resourceFromPath(s)}))}}async function a(e,s,o,a){const n=new Map;for(const{resource:r,content:u,compress:p,access:f}of s){if(!r.hasPath())throw new t(`portal-item-resource-${o}:invalid-path`,"Resource does not have a valid path");const[e,s]=i(r.path),a=`${e}/${p??""}/${f??""}`;n.has(a)||n.set(a,{prefix:e,compress:p,access:f,files:[]});n.get(a).files.push({fileName:s,content:u})}await e.load(a);const c=r(e.userItemUrl,"add"===o?"addResources":"updateResources");for(const{prefix:r,compress:i,access:u,files:p}of n.values()){const s=25;for(let o=0;o<p.length;o+=s){const n=p.slice(o,o+s),f=new FormData;r&&"."!==r&&f.append("resourcesPrefix",r),i&&f.append("compress","true"),u&&f.append("access",u);let d=0;for(const{fileName:e,content:t}of n)f.append("file"+ ++d,t,e);f.append("f","json");try{await e.portal.request(c,{method:"post",body:f,signal:a?.signal})}catch(l){if(a?.ignoreResourceCopyErrors&&l instanceof t&&"CONT_00942"===l.details?.messageCode)continue;throw l}}}}async function n(e,s,o){if(!s.hasPath())throw new t("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(o);const a=r(e.userItemUrl,"removeResources");await e.portal.request(a,{method:"post",query:{resource:s.path},signal:o?.signal}),s.portalItem=null}async function c(e,t){await e.load(t);const s=r(e.userItemUrl,"removeResources");return e.portal.request(s,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function i(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function l(e){const[t,r]=u(e),[s,o]=i(t);return[s,o,r]}function u(e){const t=s(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}async function p(t){if("blob"===t.type)return t.blob;if("json"===t.type)return new Blob([t.jsonString],{type:"application/json"});return(await e(t.url,{responseType:"blob"})).data}function f(e,t){if(!e.hasPath())return null;const[s,,o]=l(e.path);return e.portalItem.resourceFromPath(r(s,t+o))}export{a as addOrUpdateResources,p as contentToBlob,o as fetchResources,f as getSiblingOfSameTypeI,c as removeAllResources,n as removeResource,l as splitPrefixFileNameAndExtension};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../ClassBreaksRenderer.js";import r from"../FlowRenderer.js";import t from"../RasterColormapRenderer.js";import s from"../RasterShadedReliefRenderer.js";import o from"../RasterStretchRenderer.js";import a from"../UniqueValueRenderer.js";import i from"../VectorFieldRenderer.js";import{addUnsupportedMessage as n}from"../../webdoc/support/unsupportedErrors.js";const l={key:"type",base:null,typeMap:{"class-breaks":e,flow:r,"raster-colormap":t,"raster-shaded-relief":s,"raster-stretch":o,"unique-value":a,"vector-field":i}},p={...l,typeMap:{...l.typeMap}};delete p.typeMap["vector-field"];const d={classBreaks:e,flowRenderer:r,rasterColormap:t,rasterShadedRelief:s,rasterStretch:o,uniqueValue:a,vectorField:i};function u(e){return e&&d[e.type]||null}function c(e,r){if(!e)return null;if("classBreaks"===e.type&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}"vectorField"===e.type&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const t=u(e);if(t){const s=new t;return s.read(e,r),s}return r?.messages&&e&&n(r,"warning","renderer",`Renderers of type '${e.type??"unknown"} are not supported`,{definition:e}),null}function f(e,r){return c(e,r)}export{f as fromJSON,l as rasterRendererTypes,c as read,p as websceneRasterRendererTypes};
2
+ import e from"../ClassBreaksRenderer.js";import r from"../FlowRenderer.js";import t from"../RasterColormapRenderer.js";import s from"../RasterShadedReliefRenderer.js";import a from"../RasterStretchRenderer.js";import o from"../UniqueValueRenderer.js";import i from"../VectorFieldRenderer.js";import{addUnsupportedMessage as n}from"../../webdoc/support/unsupportedErrors.js";const l={key:"type",base:null,typeMap:{"class-breaks":e,flow:r,"raster-colormap":t,"raster-shaded-relief":s,"raster-stretch":a,"unique-value":o,"vector-field":i}},p={...l,typeMap:{...l.typeMap}};delete p.typeMap["vector-field"];const d={classBreaks:e,flowRenderer:r,rasterColormap:t,rasterShadedRelief:s,rasterStretch:a,uniqueValue:o,vectorField:i};function u(e){return e&&d[e.type]||null}function c(e,r){if(!e)return null;if("classBreaks"===e.type&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}"vectorField"===e.type&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const t=u(e);if(t){const s=new t;return s.read(e,r),s}return r?.messages&&e&&n(r,"warning","renderer",`Renderers of type '${e.type??"unknown"} are not supported`,{definition:e}),null}export{l as rasterRendererTypes,c as read,p as websceneRasterRendererTypes};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import r from"../../../core/Logger.js";function t(r){return class{constructor(){for(const t of r)this[t]=null}}}function e(r,t=1){const{transform:e,hasZ:o,hasM:s}=r;if(null==e)return o&&1!==t?r=>{r[2]*=t}:null;const[i,u]=n(e,o,s,t),a=r.hasZ?3:2;return r=>{for(let t=0;t<r.length&&(t!==a||0!==r[t]);++t)r[t]=r[t]*i[t]+u[t]}}function n(r,t,e,n){let{scale:o,translate:s,originPosition:i}=r;return"upperLeft"===i&&(o=o.map((r,t)=>1===t?-r:r)),t&&(o=o.map((r,t)=>2===t?r*n:r),s=s.map((r,t)=>2===t?r*n:r)),!t&&e&&(o=o.filter((r,t)=>2!==t),s=s.filter((r,t)=>2!==t)),[o,s]}function o(){return r.getLogger("esri.rest.query.operations.pbfFeatureServiceParser")}export{o as getLogger,t as makeAttributesClass,e as makeVertexTransformer};
2
+ function t(t){return class{constructor(){for(const n of t)this[n]=null}}}function n(t,n=1){const{transform:o,hasZ:e,hasM:l}=t;if(null==o)return e&&1!==n?t=>{t[2]*=n}:null;const[s,u]=r(o,e,l,n),a=t.hasZ?3:2;return t=>{for(let n=0;n<t.length&&(n!==a||0!==t[n]);++n)t[n]=t[n]*s[n]+u[n]}}function r(t,n,r,o){let{scale:e,translate:l,originPosition:s}=t;return"upperLeft"===s&&(e=e.map((t,n)=>1===n?-t:t)),n&&(e=e.map((t,n)=>2===n?t*o:t),l=l.map((t,n)=>2===n?t*o:t)),!n&&r&&(e=e.filter((t,n)=>2!==n),l=l.filter((t,n)=>2!==n)),[e,l]}export{t as makeAttributesClass,n as makeVertexTransformer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const c="20260702",e="9cb0f65cedee11214dc0733aff765c68de304ab6";export{c as buildDate,e as commitHash};
2
+ const b="20260704",c="65ab76e1fad94c43720b850751e521988992bc17";export{b as buildDate,c as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function a(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function l(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,a(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,a(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,a]=i;if(null!=t&&""!==t)a?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const a of t){const[t,n,l]=a;if(null!=t&&""!==t)l?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const a=e.attributes[t];null!=a&&""!==a&&(null!=i&&(o+=i,i=null),o+=a)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,a=!0){const l=t/o,c=r/i,s=Math.ceil(l/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(a?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*l,a=o*o;for(let c=Math.floor(r*l);c<(r+1)*l;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function S(e){return new g(e)}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function E(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function x(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=x(t);if(null!=e)return e}break;case"CIMTextSymbol":return x(e.symbol);case"CIMSolidFill":return e.color}return null}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=G(e);if(null!=t)return t}break}case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":return e.color}}function N(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function T(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=T(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return T(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function A(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function F(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const z=e=>e.includes("data:image/svg+xml");function B(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function V(e,t,r,n,o,i,a=!0){const{infos:l}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of l){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||a)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>R(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function D(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function W(e){return e.split(" ").map(e=>Number(e))}function j(e){return"string"==typeof e?W(e):e}function q(e){return e?.dashTemplate&&(e.dashTemplate=j(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(le(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=D(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const a=e[t.primitiveName];if(null!=a){const e=a[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){if(!e)return"None";switch(e){case"Begin":return"Begin";case"End":return"End";case"Both":return"Both";default:return"None"}}function oe(e){if(!e)return"None";switch(e){case"Tolerance":return"Tolerance";case"Text":return"Text";default:return"None"}}function ie(e){if(!e)return"None";switch(e){case"MoveBegin":return"MoveBegin";case"MoveEnd":return"MoveEnd";default:return"None"}}function ae(e){if(!e)return"None";switch(e){case"Only":return"Only";case"Suffix":return"Suffix";case"Expression":return"Expression";default:return"None"}}function le(e){return e.type.startsWith("Private")}function ce(e){return null!=e&&se(e)?e:void 0}function se(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,l as analyzeTextParts,V as applyParentTransform,ce as asCIMGeometryCursor,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,E as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,A as fromCIMVerticalAlignment,D as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,x as getFillColor,P as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,G as getStrokeColor,T as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,N as hasStrokeLayer,S as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,le as isPrivateGeometricEffect,z as isSVGImage,R as isValidCIMValue,B as mapCIMSymbolToGeometryType,M as normalizeAlpha,q as normalizeDashEffectTemplate,j as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,W as parseDashTemplate,f as resampleHermite,oe as stringToDimensionMarkerFit,ne as stringToDimensionPartOptions,ie as stringToDimensionTextFit,ae as stringToDimensionTextOptions,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
2
+ import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function l(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function a(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,l(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,l(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,l]=i;if(null!=t&&""!==t)l?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const l of t){const[t,n,a]=l;if(null!=t&&""!==t)a?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const l=e.attributes[t];null!=l&&""!==l&&(null!=i&&(o+=i,i=null),o+=l)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,l=!0){const a=t/o,c=r/i,s=Math.ceil(a/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(l?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*a,l=o*o;for(let c=Math.floor(r*a);c<(r+1)*a;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(l+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function P(e){return new g(e)}function S(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function G(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function E(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=E(t);if(null!=e)return e}break;case"CIMTextSymbol":return E(e.symbol);case"CIMSolidFill":return e.color}return null}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=A(e);if(null!=t)return t}break}case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":return e.color}}function T(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=x(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function N(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function F(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const z=e=>e.includes("data:image/svg+xml");function V(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function R(e,t,r,n,o,i,l=!0){const{infos:a}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of a){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||l)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function D(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>D(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function W(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function j(e){return e.split(" ").map(e=>Number(e))}function q(e){return"string"==typeof e?j(e):e}function B(e){return e?.dashTemplate&&(e.dashTemplate=q(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(ne(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=W(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const l=e[t.primitiveName];if(null!=l){const e=l[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){return e.type.startsWith("Private")}function oe(e){return null!=e&&ie(e)?e:void 0}function ie(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,a as analyzeTextParts,R as applyParentTransform,oe as asCIMGeometryCursor,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,G as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,N as fromCIMVerticalAlignment,W as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,E as getFillColor,S as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,A as getStrokeColor,x as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,T as hasStrokeLayer,P as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,ne as isPrivateGeometricEffect,z as isSVGImage,D as isValidCIMValue,V as mapCIMSymbolToGeometryType,M as normalizeAlpha,B as normalizeDashEffectTemplate,q as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,j as parseDashTemplate,f as resampleHermite,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ensureOneOfType as t}from"../../core/accessorSupport/ensureType.js";import e from"../elements/AttributeTableAttachmentElement.js";import p from"../elements/AttributeTableElement.js";import r from"../elements/AttributeTableFieldElement.js";import o from"../elements/AttributeTableRelationshipElement.js";const n={base:p,key:"type",typeMap:{attachment:e,field:r,relationship:o}};function i(t){return{typesWithGroup:{base:p,key:"type",typeMap:{attachment:e,field:r,group:t,relationship:o}},typesWithoutGroup:n}}function u(t,e,p=!0){if(!t)return null;const r=p?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(t=>r[t.type]).map(t=>r[t.type].fromJSON(t))}function s(t,e,p=!0){if(!t)return null;const r=p?e.typesWithGroup.typeMap:e.typesWithoutGroup.typeMap;return t.filter(t=>r[t.type]).map(t=>t.toJSON())}function l(e,p,r=!0){return e?e.map(e=>t(r?p.typesWithGroup:p.typesWithoutGroup,e)):null}export{i as buildTypeMaps,l as ensureType,u as fromJSON,s as toJSON,n as typesWithoutGroup};
2
+ import e from"../elements/AttributeTableAttachmentElement.js";import t from"../elements/AttributeTableElement.js";import i from"../elements/AttributeTableFieldElement.js";import r from"../elements/AttributeTableRelationshipElement.js";const m={base:t,key:"type",typeMap:{attachment:e,field:i,relationship:r}};function p(p){return{typesWithGroup:{base:t,key:"type",typeMap:{attachment:e,field:i,group:p,relationship:r}},typesWithoutGroup:m}}export{p as buildTypeMaps,m as typesWithoutGroup};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{simulationSettingsEqual as t}from"../../../support/flow/utils.js";function n(t){const n=t.toRgba();return[n[0]/255,n[1]/255,n[2]/255,n[3]]}function o(t){return{kind:"constant",value:[.1,.1,.1,1]}}function s(t){if(!t.hasVisualVariables("color"))return{kind:"constant",value:n(t.color)};const o=t.getVisualVariablesForType("color")[0],s=[],e=[];for(const a of o.stops)s.push(a.value),Array.prototype.push.apply(e,n(a.color));return{kind:"ramp",stops:s,values:e,count:o.stops.length}}function e(t){if(!t.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const n=t.getVisualVariablesForType("opacity")[0],o=[],s=[];for(const e of n.stops)o.push(e.value),s.push(e.opacity);return{kind:"ramp",stops:o,values:s,count:n.stops.length}}const a=8;function r(t){if("constant"===t.kind)return{constant:t.value,count:1,stops:new Array(a).fill(0),values:new Array(a).fill(t.value)};const n=Math.min(t.count,a),o=new Array(a).fill(t.stops[n-1]),s=new Array(a).fill(null).map((o,s)=>{const e=4*Math.min(s,n-1);return t.values.slice(e,e+4)});for(let e=0;e<n;e++)o[e]=t.stops[e];return{constant:[0,0,0,0],count:n,stops:o,values:s}}function i(t){if("constant"===t.kind)return{constant:t.value[0],count:1,stops:new Array(a).fill(0),values:new Array(a).fill(t.value[0])};const n=Math.min(t.count,a),o=new Array(a).fill(t.stops[n-1]),s=new Array(a).fill(t.values[n-1]);for(let e=0;e<n;e++)o[e]=t.stops[e],s[e]=t.values[e];return{constant:0,count:n,stops:o,values:s}}function u(t,n,o,s){switch(n){case"int":t.setUniform1iv(o,s);break;case"float":t.setUniform1fv(o,s);break;case"vec2":t.setUniform2fv(o,s);break;case"vec3":t.setUniform3fv(o,s);break;case"vec4":t.setUniform4fv(o,s)}}function l(t,n,o,s){"constant"===s.kind?u(t,o,`u_${n}`,s.value):(u(t,"float",`u_${n}_stops`,s.stops),u(t,o,`u_${n}_values`,s.values),t.setUniform1i(`u_${n}_count`,s.count))}function c(t,n){return t===n||null!=t&&null!=n&&t.equals(n)}function f(n,o){if(!t(n.simulationSettings,o.simulationSettings))return!1;if(!c(n.timeExtent,o.timeExtent))return!1;let s=!0;return s=s&&n.loadImagery===o.loadImagery,s=s&&n.createFlowMesh===o.createFlowMesh,s=s&&n.color.kind===o.color.kind,s=s&&n.opacity.kind===o.opacity.kind,s=s&&n.size.kind===o.size.kind,s}const p=36e5,v=3600;export{f as areStreamlinesCompatible,s as getColor,r as getFlowColorUniforms,i as getFlowFloatUniforms,o as getForegroundColor,e as getOpacity,p as longSafetyTime,u as setUniform,l as setUniforms,v as shortMarginTime,c as timeExtentsEqual,n as toRgba};
2
+ import{simulationSettingsEqual as t}from"../../../support/flow/utils.js";function n(t){const n=t.toRgba();return[n[0]/255,n[1]/255,n[2]/255,n[3]]}function o(t){return{kind:"constant",value:[.1,.1,.1,1]}}function s(t){if(!t.hasVisualVariables("color"))return{kind:"constant",value:n(t.color)};const o=t.getVisualVariablesForType("color")[0],s=[],e=[];for(const r of o.stops)s.push(r.value),Array.prototype.push.apply(e,n(r.color));return{kind:"ramp",stops:s,values:e,count:o.stops.length}}function e(t){if(!t.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const n=t.getVisualVariablesForType("opacity")[0],o=[],s=[];for(const e of n.stops)o.push(e.value),s.push(e.opacity);return{kind:"ramp",stops:o,values:s,count:n.stops.length}}const r=8;function a(t){if("constant"===t.kind)return{constant:t.value,count:1,stops:new Array(r).fill(0),values:new Array(r).fill(t.value)};const n=Math.min(t.count,r),o=new Array(r).fill(t.stops[n-1]),s=new Array(r).fill(null).map((o,s)=>{const e=4*Math.min(s,n-1);return t.values.slice(e,e+4)});for(let e=0;e<n;e++)o[e]=t.stops[e];return{constant:[0,0,0,0],count:n,stops:o,values:s}}function l(t){if("constant"===t.kind)return{constant:t.value[0],count:1,stops:new Array(r).fill(0),values:new Array(r).fill(t.value[0])};const n=Math.min(t.count,r),o=new Array(r).fill(t.stops[n-1]),s=new Array(r).fill(t.values[n-1]);for(let e=0;e<n;e++)o[e]=t.stops[e],s[e]=t.values[e];return{constant:0,count:n,stops:o,values:s}}function u(t,n){return t===n||null!=t&&null!=n&&t.equals(n)}function i(n,o){if(!t(n.simulationSettings,o.simulationSettings))return!1;if(!u(n.timeExtent,o.timeExtent))return!1;let s=!0;return s=s&&n.loadImagery===o.loadImagery,s=s&&n.createFlowMesh===o.createFlowMesh,s=s&&n.color.kind===o.color.kind,s=s&&n.opacity.kind===o.opacity.kind,s=s&&n.size.kind===o.size.kind,s}const c=36e5,p=3600;export{i as areStreamlinesCompatible,s as getColor,a as getFlowColorUniforms,l as getFlowFloatUniforms,o as getForegroundColor,e as getOpacity,c as longSafetyTime,p as shortMarginTime,u as timeExtentsEqual,n as toRgba};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as a,sdfSizeComplex as r,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import g from"./Rect.js";import p from"./RectangleBinPack.js";import{charCodes as d}from"./Utils.js";import _ from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function x(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const C=t=>({mosaicItem:{rect:new g(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});class I{constructor(t,e,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:r,sdfBufferPx:a,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new p(t,e),this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<11;t++){const h=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),a=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,a,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new _(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const g=s?r:c,p=s?h:o,_=s?a:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const a=this._glyphSDFCreator.sdfSizePx,[r,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(r).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/a,midline:h.midline()/a},u=h.shape(r,c,a).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,a]=e(t);y=h;const r=this._getGlyphCache(i),n=d(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(r,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:g,sdfRadius:p,sdfPadding:_}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);await this._fetchRanges(t,e,null);const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await x(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),a=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,a)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const h=this._glyphSource.getRange(e,s),a=h?.getRect(s),r=h?.getShaping(s),o=h?.getBitmap(s);if(i&&(!a||!r))return;if(!a||!r)return C(s);const c=o?this._recordGlyph(a,o,n):new g(0,0,0,0),l=this._currentPage;t[s]={mosaicItem:{rect:c,sdf:!0,page:l},rect:a,shaping:r,code:s},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h=i??{width:0,height:0,top:0,left:0},r=i?this._recordGlyph(h,i.buffer,a):new g(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN,o={rect:r,sdf:!0,page:this._currentPage};t[e.glyphId]={mosaicItem:o,rect:h,shaping:void 0,code:n},this._invalidate()}return{...t[e.glyphId],shaping:{xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,yAdvance:e.yAdvance}}}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)},e=>{throw delete this._preloadCache[t],e});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return x(this._rangePromises,i,()=>this._glyphSource.fetchRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new p(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new g(0,0,0,0);else{const h=t.width+2*s,a=t.height+2*s;let r=h,n=a;if(this._snapCoords){r+=h%4?4-h%4:4,n+=a%4?4-a%4:4}i=this._binPack.allocate(r,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(r,n));const o=this._pageData[this._currentPage];for(let t=0;t<a;t++){const s=h*t,a=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[a+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let a=0;a<t.length;++a)h[4*a]=t[a],h[4*a+1]=0,h[4*a+2]=0,h[4*a+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{I as default};
2
+ import t from"../../../../request.js";import{bidiText as e}from"../../../../core/BidiText.js";import has from"../../../../core/has.js";import{throwIfNotAbortError as s}from"../../../../core/promiseUtils.js";import{loadTextModule as i}from"../../../../libs/text/loadTextModule.js";import{sdfRadiusComplex as h,sdfBufferGlyphSDFCreator as a,sdfSizeComplex as r,sdfBufferServer as n,sdfRadiusSimple as o,sdfSizeSimple as c}from"./definitions.js";import{GlyphSDFCreator as l}from"./GlyphSDFCreator.js";import g from"./Rect.js";import p from"./RectangleBinPack.js";import{charCodes as d}from"./Utils.js";import _ from"../../../webgl/Texture.js";import{TextureDescriptor as f}from"../../../webgl/TextureDescriptor.js";const u=256,y=.25,m=t=>Math.floor(t/256);function w(t){const e=new Set;for(const s of t)e.add(m(s));return e}function x(t,e,i){return t.has(e)||t.set(e,i().then(()=>{t.delete(e)}).catch(i=>{t.delete(e),s(i)})),t.get(e)}const C=t=>({mosaicItem:{rect:new g(0,0,0,0),sdf:!0,page:0},rect:{left:0,width:0,height:0,top:0},shaping:{xAdvance:0,yAdvance:0,xOffset:0,yOffset:0},code:t});class I{constructor(t,e,s,i=!1){this._snapCoords=i,this.width=0,this.height=0,this._dirties=[],this._pageData=[],this._currentPage=0,this._glyphCache={},this._glyphCacheById={},this._textures=[],this._rangePromises=new Map,this._facePromises=new Map,this._preloadCache={},this._glyphSDFCreator=new l({sdfSizePx:r,sdfBufferPx:a,radius:h,cutoff:y}),this._faces=new Map,this.width=t,this.height=e,this._glyphSource=s,this._binPack=new p(t,e),this._pageData.push(new Uint8Array(t*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const t of this._textures)t&&t.dispose();this._textures.length=0,this._pageData.length=0}_initDecorationGlyphs(){const t=[117,149,181,207,207,181,149,117],e=[],s=[];for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<11;t++){const h=r>=3&&r<5&&t>=3&&t<8?255:0;e.push(i),s.push(h)}}const i={width:5,height:2,left:0,top:0,advance:0},h=new Uint8Array(e),a=new Uint8Array(s);this._recordGlyph(i,h,n),this._recordGlyph(i,a,n)}getTexture(t,e){if(!this._textures[e]){const s=new f(this.width,this.height);s.pixelFormat=6406,s.wrapMode=33071,this._textures[e]=new _(t,s,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._pageData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(t,s,i,l){const g=s?r:c,p=s?h:o,_=s?a:n;let f,u=[],y=!1;if(s){const s=this._getGlyphCacheById(i),h=await this.getFace(i);if(!h)return null;const a=this._glyphSDFCreator.sdfSizePx,[r,n,o]=e(t,!1);y=n;const c=new Uint32Array(Array.from(r).map((t,e)=>o.levels[o.targetToSource[e]]));f={baseline:h.baseline()/a,midline:h.midline()/a},u=h.shape(r,c,a).map(t=>this._getMosaicItemComplex(s,t,h))}else{const[s,h,a]=e(t);y=h;const r=this._getGlyphCache(i),n=d(s);try{await this._fetchRanges(i,n,l)}catch{return null}for(const t of n){const e=this._getMosaicItem(r,i,t);e&&u.push(e)}}return{type:"glyphs",isRightToLeft:y,glyphs:u,faceInfo:f,sdfSize:g,sdfRadius:p,sdfPadding:_}}async getGlyphItemsVTL(t,e){const s=this._getGlyphCache(t);try{await this._fetchRanges(t,e,null)}catch{return[]}const i=[];for(const h of e){const e=this._getMosaicItem(s,t,h,!0);e&&(i[h]=e)}return i}async getFace(e){if(this._faces.has(e))return this._faces.get(e);const s=this._glyphSource.woffURL(e);return await x(this._facePromises,e,async()=>{const h=await t(s,{responseType:"array-buffer"}),a=(await i()).Face.parseWoff2(new Uint8Array(h.data));this._faces.set(e,a)}),this._faces.get(e)}_getMosaicItem(t,e,s,i=!1){if(!t[s]){const h=this._glyphSource.getRange(e,s),a=h?.getRect(s),r=h?.getShaping(s),o=h?.getBitmap(s);if(i&&(!a||!r))return;if(!a||!r)return C(s);const c=o?this._recordGlyph(a,o,n):new g(0,0,0,0),l=this._currentPage;t[s]={mosaicItem:{rect:c,sdf:!0,page:l},rect:a,shaping:r,code:s},this._invalidate()}return t[s]}_getMosaicItemComplex(t,e,s){if(!t[e.glyphId]){const i=this._glyphSDFCreator.draw(s,e.glyphId),h=i??{width:0,height:0,top:0,left:0},r=i?this._recordGlyph(h,i.buffer,a):new g(0,0,0,0),n=e.isNewline?10:e.isWhitespace?32:NaN,o={rect:r,sdf:!0,page:this._currentPage};t[e.glyphId]={mosaicItem:o,rect:h,shaping:void 0,code:n},this._invalidate()}return{...t[e.glyphId],shaping:{xOffset:e.xOffset,yOffset:e.yOffset,xAdvance:e.xAdvance,yAdvance:e.yAdvance}}}bind(t,e,s,i){const h=this.getTexture(t,s);h.setSamplingMode(e),t.bindTexture(h,i)}preloadASCIIGlyphCache(t){const e=this._preloadCache[t];if(null!=e)return e;const s=this._glyphSource.preloadASCIIRange(t).then(()=>{const e=this._getGlyphCache(t);for(let s=0;s<256;s++)this._getMosaicItem(e,t,s)},e=>{throw delete this._preloadCache[t],e});return this._preloadCache[t]=s,s}_getGlyphCache(t){return this._glyphCache[t]||(this._glyphCache[t]={}),this._glyphCache[t]}_getGlyphCacheById(t){return this._glyphCacheById[t]||(this._glyphCacheById[t]={}),this._glyphCacheById[t]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(t,e,s){const i=w(e),h=[];i.forEach(e=>{h.push(this._fetchRange(t,e,s))}),await Promise.all(h)}async _fetchRange(t,e,s){if(e>u)return;const i=t+e;return x(this._rangePromises,i,()=>this._glyphSource.fetchRange(t,e,s))}_allocNewPage(){this._dirties[this._currentPage]||(this._pageData[this._currentPage]=null),this._currentPage=this._pageData.length,this._pageData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs(),this._binPack=new p(this.width,this.height)}_recordGlyph(t,e,s){let i;if(0===t.width)i=new g(0,0,0,0);else{const h=t.width+2*s,a=t.height+2*s;let r=h,n=a;if(this._snapCoords){r+=h%4?4-h%4:4,n+=a%4?4-a%4:4}i=this._binPack.allocate(r,n),i.isEmpty&&(this._allocNewPage(),i=this._binPack.allocate(r,n));const o=this._pageData[this._currentPage];for(let t=0;t<a;t++){const s=h*t,a=this.width*(i.y+t)+i.x;for(let t=0;t<h;t++)o[a+t]=e[s+t]}has("esri-glyph-debug")&&this._showDebugPage(o)}return i}_showDebugPage(t){const e=document.createElement("canvas"),s=e.getContext("2d"),i=new ImageData(this.width,this.height),h=i.data;e.width=this.width,e.height=this.height,e.style.border="1px solid black";for(let a=0;a<t.length;++a)h[4*a]=t[a],h[4*a+1]=0,h[4*a+2]=0,h[4*a+3]=255;s.putImageData(i,0,0),document.body.appendChild(e)}}export{I as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as r,option as s}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as m,Sampler2D as p,step as u,negate as d,cond as c,equal as y,Mat2 as f,cos as v,sin as b,Mat3 as S,Vec3 as h,lessThanEqual as w,ifElse as g,texture2D as x,clamp as V,abs as z,block as T}from"../../graph/glsl.js";import{AnimationUniformInfo as P}from"./AnimationUniformInfo.js";import{MarkerConstants as j}from"../markers/markerConstants.js";import{FeatureVertexInput as _,AFeatureShader as O,FeatureFragmentInput as I}from"../shaders/AFeatureShader.js";import{softEdgeRatio as C}from"../shaders/constants.js";import{LocalTileOffset as M}from"../shaders/LocalTileOffset.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as A,rgba2float as F}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as R}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as k}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as U}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as E}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as G}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as N,getVisualVariableAngle as W}from"../shaders/vvUtils.js";class q extends _{}i([o(3,l)],q.prototype,"offset",void 0),i([o(4,n)],q.prototype,"sizing",void 0),i([o(5,n)],q.prototype,"value1Position2Value2",void 0),i([o(6,n)],q.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,l)],q.prototype,"zoomRange",void 0),i([o(8,m)],q.prototype,"lineLength",void 0);class H extends I{}class J extends O{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:r,sizing:s}=i,l=r.xy,n=r.z,p=r.w,S=s.xy,h=this._getEvalParams(i,S,e);let w,g;if(i.value1Position2Value2){const t=K(l,6,h).a,e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,r=i.value1Position2Value2.w,s=t.subtract(a).divide(r.subtract(a));g=e.add(o.subtract(e).multiply(s)),w=u(new m(1),s).add(u(new m(0),d(s)))}else g=i.pos,w=new m(0);const x=s.z,V=A(i.bitset,j.bitset.isStroke),z=s.w,T=A(i.bitset,j.bitset.scaleSymbolsProportionally),P=K(l,0,h),_=c([y(A(i.bitset,j.bitset.isMapAligned),new m(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new m(0)]),O=new f(v(_),b(_.multiply(-1)),b(_),v(_)).multiply(P.xy),I=P.z.subtract(_).subtract(t),C=P.w,M=A(i.bitset,j.bitset.isSDF),D=N(this,o,new m(p)).divide(new m(p));return{baseSize:n,animationPointer:l,strokeWidth:x,isOutline:V,unscaledDistanceToPx:z,scaleSymbolsProportionally:T,isSDF:M,position:this._getScreenPosition({id:o,pos:g,offset:a,referenceSize:p,translation:O,rotation:I,scale:C,vvScale:D}),evalParams:h,vvScale:D,scale:C,clip:w}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:r,id:s,vvScale:l}=i,n=W(this,s).multiply(Math.PI/180),p=e.x.multiply(4/3),u=e.y.multiply(-1).multiply(4/3),c=b(n),y=v(n),f=y.multiply(p).add(d(c).multiply(u)),w=c.multiply(p).add(y.multiply(u)),g=b(o.subtract(n)),x=v(o.subtract(n)),V=new m(0),z=new m(1),{pixelRatio:T}=this.animationInfo,P=new S(z,V,V,V,z,V,f.multiply(T),w.multiply(T),z),j=new S(x,g.multiply(-1),V,g,x,V,0,0,z),_=a.multiply(l).multiply(T).multiply(4/3),O=j.multiply(_),I=this.animationInfo.toScreen.multiply(new h(t,1)),C=P.multiply(I).xy,M=O.multiply(new h(r,0)).xy;return C.add(M)}_clip(i,e){let o=super.clip(i,e);const a=w(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(o=o.add(c([a,()=>new m(2)],[!0,()=>new m(0)]))),o}_getLocalTimeOrigin(i){return this.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new h(i,1)).xy}_getEvalParams(i,t,e){const{globalTime:o,animationTextureSize:a}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:a,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:e}}_getColor(i,t){return g(y(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return x(this.mosaicTexture,i).multiply(t.color)}_getSDFColor(i,t){const e=x(this.mosaicTexture,i),o=new m(.5).subtract(F(e)).multiply(t.distanceToPx).multiply(C),a=V(new m(.5).subtract(o),new m(0),new m(1)),r=t.color.multiply(a),s=t.outlineSize.multiply(.5),l=z(o).subtract(s),n=V(new m(.5).subtract(l),new m(0),new m(1)),p=t.outlineColor.multiply(n);return new m(1).subtract(p.a).multiply(r).add(p)}}function K(i,t,o){const a=i.add(new l(t,0)),r=x(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(r),T({animationPointer:i,...o},n,null,i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})})}i([a(D)],J.prototype,"mosaicInfo",void 0),i([a(P)],J.prototype,"animationInfo",void 0),i([a(M)],J.prototype,"localTileOffset",void 0),i([r(p)],J.prototype,"mosaicTexture",void 0),i([s(L)],J.prototype,"visualVariableColor",void 0),i([s(R)],J.prototype,"visualVariableOpacity",void 0),i([s(U)],J.prototype,"visualVariableSizeMinMaxValue",void 0),i([s(E)],J.prototype,"visualVariableSizeScaleStops",void 0),i([s(B)],J.prototype,"visualVariableSizeStops",void 0),i([s(G)],J.prototype,"visualVariableSizeUnitValue",void 0),i([s(k)],J.prototype,"visualVariableRotation",void 0),i([r(p)],J.prototype,"animationTexture",void 0);export{H as AAnimatedFragmentInput,J as AAnimatedShader,q as AAnimatedVertexInput,K as getValue};
2
+ import{__decorate as i}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as e}from"../../../animations/instructions.js";import{location as o,uniform as a,texture as r,option as s}from"../../GraphShaderModule.js";import{Vec2 as l,Vec4 as n,Float as m,Sampler2D as p,step as u,negate as d,cond as c,equal as y,Mat2 as f,cos as v,sin as b,Mat3 as h,Vec3 as S,lessThanEqual as w,ifElse as g,texture2D as x,clamp as V,abs as z,block as T}from"../../graph/glsl.js";import{AnimationUniformInfo as P}from"./AnimationUniformInfo.js";import{MarkerConstants as j}from"../markers/markerConstants.js";import{FeatureVertexInput as _,AFeatureShader as O,FeatureFragmentInput as I}from"../shaders/AFeatureShader.js";import{softEdgeRatio as C}from"../shaders/constants.js";import{LocalTileOffset as M}from"../shaders/LocalTileOffset.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as A,rgba2float as F}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as R}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as k}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as U}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as E}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as G}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as N,getVisualVariableAngle as q}from"../shaders/vvUtils.js";class W extends _{}i([o(3,l)],W.prototype,"offset",void 0),i([o(4,n)],W.prototype,"sizing",void 0),i([o(5,n)],W.prototype,"value1Position2Value2",void 0),i([o(6,n)],W.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),i([o(7,l)],W.prototype,"zoomRange",void 0),i([o(8,m)],W.prototype,"lineLength",void 0);class H extends I{}class J extends O{_vertexPreamble(i,t,e){const{id:o,offset:a,animationPointerAndBaseSizeAndReferenceSize:r,sizing:s}=i,l=r.xy,n=r.z,p=r.w,h=s.xy,S=this._getEvalParams(i,h,e);let w,g;if(i.value1Position2Value2){let t;t=this.hittestRequest?new m(0):K(l,6,S).a;const e=i.pos,o=i.value1Position2Value2.yz,a=i.value1Position2Value2.x,r=i.value1Position2Value2.w,s=t.subtract(a).divide(r.subtract(a));g=e.add(o.subtract(e).multiply(s)),w=u(new m(1),s).add(u(new m(0),d(s)))}else g=i.pos,w=new m(0);const x=s.z,V=A(i.bitset,j.bitset.isStroke),z=s.w,T=A(i.bitset,j.bitset.scaleSymbolsProportionally),P=K(l,0,S),_=c([y(A(i.bitset,j.bitset.isMapAligned),new m(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new m(0)]),O=new f(v(_),b(_.multiply(-1)),b(_),v(_)).multiply(P.xy),I=P.z.subtract(_).subtract(t),C=P.w,M=A(i.bitset,j.bitset.isSDF),D=N(this,o,new m(p)).divide(new m(p));return{baseSize:n,animationPointer:l,strokeWidth:x,isOutline:V,unscaledDistanceToPx:z,scaleSymbolsProportionally:T,isSDF:M,position:this._getScreenPosition({id:o,pos:g,offset:a,referenceSize:p,translation:O,rotation:I,scale:C,vvScale:D}),evalParams:S,vvScale:D,scale:C,clip:w}}_getScreenPosition(i){const{pos:t,translation:e,rotation:o,scale:a,offset:r,id:s,vvScale:l}=i,n=q(this,s).multiply(Math.PI/180),p=e.x.multiply(4/3),u=e.y.multiply(-1).multiply(4/3),c=b(n),y=v(n),f=y.multiply(p).add(d(c).multiply(u)),w=c.multiply(p).add(y.multiply(u)),g=b(o.subtract(n)),x=v(o.subtract(n)),V=new m(0),z=new m(1),{pixelRatio:T}=this.animationInfo,P=new h(z,V,V,V,z,V,f.multiply(T),w.multiply(T),z),j=new h(x,g.multiply(-1),V,g,x,V,0,0,z),_=a.multiply(l).multiply(T).multiply(4/3),O=j.multiply(_),I=this.animationInfo.toScreen.multiply(new S(t,1)),C=P.multiply(I).xy,M=O.multiply(new S(r,0)).xy;return C.add(M)}_clip(i,e){let o=super.clip(i,e);const a=w(this._getLocalTimeOrigin(i),new m(0));return t.forceGlobalTimeOrigin||(o=o.add(c([a,()=>new m(2)],[!0,()=>new m(0)]))),o}_getLocalTimeOrigin(i){return this.getLocalTimeOrigin(i)}_toNdc(i){return this.animationInfo.toNdc.multiply(new S(i,1)).xy}_getEvalParams(i,t,e){const{globalTime:o,animationTextureSize:a}=this.animationInfo;return{globalTime:o,localTimeOrigin:this._getLocalTimeOrigin(i.id),animationTextureSize:a,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:e}}_getColor(i,t){return g(y(t.isSDF,new m(1)),this._getSDFColor(i,t),this._getSpriteColor(i,t))}_getSpriteColor(i,t){return x(this.mosaicTexture,i).multiply(t.color)}_getSDFColor(i,t){const e=x(this.mosaicTexture,i),o=new m(.5).subtract(F(e)).multiply(t.distanceToPx).multiply(C),a=V(new m(.5).subtract(o),new m(0),new m(1)),r=t.color.multiply(a),s=t.outlineSize.multiply(.5),l=z(o).subtract(s),n=V(new m(.5).subtract(l),new m(0),new m(1)),p=t.outlineColor.multiply(n);return new m(1).subtract(p.a).multiply(r).add(p)}}function K(i,t,o){const a=i.add(new l(t,0)),r=x(o.animationTexture,a.add(.5).divide(o.animationTextureSize)).xy;return i=i.add(r),T({animationPointer:i,...o},n,null,i=>{const{out:t}=i;if(!t)throw new Error("out is null");return e({...i,out:t})})}i([a(D)],J.prototype,"mosaicInfo",void 0),i([a(P)],J.prototype,"animationInfo",void 0),i([a(M)],J.prototype,"localTileOffset",void 0),i([r(p)],J.prototype,"mosaicTexture",void 0),i([s(L)],J.prototype,"visualVariableColor",void 0),i([s(R)],J.prototype,"visualVariableOpacity",void 0),i([s(U)],J.prototype,"visualVariableSizeMinMaxValue",void 0),i([s(E)],J.prototype,"visualVariableSizeScaleStops",void 0),i([s(B)],J.prototype,"visualVariableSizeStops",void 0),i([s(G)],J.prototype,"visualVariableSizeUnitValue",void 0),i([s(k)],J.prototype,"visualVariableRotation",void 0),i([r(p)],J.prototype,"animationTexture",void 0);export{H as AAnimatedFragmentInput,J as AAnimatedShader,W as AAnimatedVertexInput,K as getValue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHittest as o,getSelectionDefines as n,getFeatureTextures as s,getLocalTileOffset as m,getFeatureUniforms as u,resolveDynamicUniforms as l,getFeaturePipelineState as c}from"../featureTechniqueUtils.js";import{getAntialiasingControls as g}from"../line/utils.js";class f extends r{render(r,f){const{context:p,painter:x,pixelRatio:d}=r,{target:b}=f,{freezeGlobalTime:h}=a,T=0,D=x.textureManager.animationStore.getTexture(p,T),y=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],R=Array.from(e(i(),y)),j=Array.from(t(i(),R,b.transforms.displayViewScreenMat3)),z=f.instance.getInput(),M=x.textureManager.getMosaicInfo(r,f.textureKey,!1),{optionalAttributes:S}=z,A=S.zoomRange,I=S.value1Position2Value2,q="accumulatedDistance"in S&&S.accumulatedDistance,w="segmentDirection"in S&&S.segmentDirection,P="normal"in S&&S.normal;x.setShader({shader:this.shaders.geometry,uniforms:{...l(r,f.target,z.uniforms),...u(r,f.target),antialiasingControls:g(d),mosaicInfo:M,animationInfo:{globalTime:r.animationsEnabled?!1===h?r.time/1e3:h:0,animationTextureSize:[D.descriptor.width,D.descriptor.height],toScreen:j,toNdc:y,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:m(f.target)},textures:{...s(r),mosaicTexture:x.textureManager.getMosaicTexture(r,f.textureKey,!1),animationTexture:{unit:6,texture:D}},defines:{...n(r)},optionalAttributes:{zoomRange:A,value1Position2Value2:I,accumulatedDistance:q,segmentDirection:w,normal:P},useComputeBuffer:o(r)}),x.setPipelineState({...c(r)}),x.submitDraw(r,f),!1===h&&r.animationsEnabled&&b.requestRender()}}export{f as AnimatedTechnique};
2
+ import{invert as e,multiply as t}from"../../../../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{animationDebugFlags as a}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHittest as o,getSelectionDefines as n,getFeatureTextures as s,getLocalTileOffset as m,getFeatureUniforms as u,resolveDynamicUniforms as l,getFeaturePipelineState as c}from"../featureTechniqueUtils.js";import{getAntialiasingControls as g}from"../line/utils.js";class f extends r{render(r,f){const{context:p,painter:x,pixelRatio:d}=r,{target:b}=f,{freezeGlobalTime:h}=a,T=0,D=x.textureManager.animationStore.getTexture(p,T),y=[2/r.state.size[0],0,0,0,-2/r.state.size[1],0,-1,1,1],R=Array.from(e(i(),y)),j=Array.from(t(i(),R,b.transforms.displayViewScreenMat3)),z=f.instance.getInput(),M=x.textureManager.getMosaicInfo(r,f.textureKey,!1),{optionalAttributes:S}=z,A=S.zoomRange,I=S.value1Position2Value2,q="accumulatedDistance"in S&&!!S.accumulatedDistance,w="segmentDirection"in S&&!!S.segmentDirection,P="normal"in S&&!!S.normal;x.setShader({shader:this.shaders.geometry,uniforms:{...l(r,f.target,z.uniforms),...u(r,f.target),antialiasingControls:g(d),mosaicInfo:M,animationInfo:{globalTime:r.animationsEnabled?!1===h?r.time/1e3:h:0,animationTextureSize:[D.descriptor.width,D.descriptor.height],toScreen:j,toNdc:y,mapRotation:r.state.rotation,pixelRatio:r.state.pixelRatio},localTileOffset:m(f.target)},textures:{...s(r),mosaicTexture:x.textureManager.getMosaicTexture(r,f.textureKey,!1),animationTexture:{unit:6,texture:D}},defines:{...n(r)},optionalAttributes:{zoomRange:A,value1Position2Value2:I,accumulatedDistance:q,segmentDirection:w,normal:P},useComputeBuffer:o(r)}),x.setPipelineState({...c(r)}),x.submitDraw(r,f),!1===h&&r.animationsEnabled&&b.requestRender()}}export{f as AnimatedTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as f,convertOptimizedGeometryToFlat as g,convertFlatToOptimizedGeometry as p,FlatGeometry as _}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as y}from"../../../../../../../geometry/GeometryCursor.js";import{getLabelPoint as x}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as P,convertToGeometry as v}from"../../../../../../../layers/graphics/featureConversionUtils.js";import b from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{importLazily as M}from"../../../../../../../symbols/cim/utils.js";import{tileSize as w}from"../../../definitions.js";import L from"../../../collisions/BoundingBox.js";import{LabelMetric as I}from"../../../collisions/LabelMetric.js";import{smoothPaths as B,pathDivide as S}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as z,processColorInput as G}from"../fill/meshWriterUtils.js";import{TextMeshWriter as j,maxLabelZoom as D}from"../text/TextMeshWriter.js";const A=1,F=0,R=128,$=w*w/16,k=M(()=>import("../../../../../../../geometry/operators/gx/operatorIntersection.js")),C=M(()=>import("../../../../../../../chunks/FlatGeometry.js"));function E(e,t,r){return i(`${e}${t}${r}`)}function O(e,t,r,s,o){return i(`${e}${t}${r}${s*2**(D-o)}`)}function T(e,t,r){return i(`${e}${t}${r}`)}function W(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(D-s)}`)}const Z=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class U extends j{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),k.getImportPromise(),C.getImportPromise()])}_write(e,{target:t,effectGeometry:i,level:r,viewExtent:s}){if(this._zoomLevel=r,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,s);break;case"esriGeometryMultipoint":{let i=0;const r=y.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new I(e,h,t,i,r,s,n,a,l,c,o)}_writePolygon(e,t,i){const r=k.module,s=C.module.constructFromFlatGeometry,o=t.readGeometryForDisplay(),n=t.readCentroidForDisplay()?.coords,a=o?.area()||0;if(!n)return;const l=a>=$;e.requiresRefresh||=l;const c=s(f(i)),h=s(f({x:n[0],y:n[1]})),m=!!r.execute(h,c,null);if(!o||!l||!m)return void this._writePoint(e,n[0],n[1],0,t);const u=s(g("polygon",o,null)),d=r.execute(u,c,null);if(!d)return void this._writePoint(e,n[0],n[1],0,t);const P=p(new _(d.toFlatGeometry())),v=y.fromOptimized(P,"esriGeometryPolygon",1),b=x(v)??n;this._writePoint(e,b[0],b[1],0,t)}_writePoint(e,t,i,r,s){if(t<0||t>w||i<0||i>w)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=E(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=T(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new I(n,a,l,c,t,i,h,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<A);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:z(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=P(n,"esriGeometryPolyline",1)??new b,l=X(a,o),c=X(a,-o),h=v(c,"esriGeometryPolyline",!1,!1),m=v(l,"esriGeometryPolyline",!1,!1),u=B(m.paths,s.bounds.width),d=B(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,S(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,S(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=B(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,S(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,u=this._current.zoomRange[0],d=Z(t),f=this._current.shaping.bounds.width/(1<<A),g=Math.sqrt(n||R)/(1<<A),p=Math.min(i,r-i),_=h.isMultiline?D:Math.log2(p/(g+f/2)),y=0===t?_:Math.min(d,_),x=Math.max(u,this._zoomLevel+A-y),P=this._zoomLevel-x,v=h.bounds.width/2*2**P,b=O(a,c,m,t,this._zoomLevel),M=W(c,m,t,this._zoomLevel,l);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,b,M):s&&P<0?this._placeStraightAlong(e,u,b,M):"parallel"===o?this._placeStraightAlong(e,x,b,M):"curved"===o&&this._placeCurved(e,x,v,b,M)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,p=e.clone(),_=e.angle*(180/Math.PI)%360,y=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(D,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:_,mapAligned:!0,isLineLabel:!0},p=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(p,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(p,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=y,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(p,i,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(p,i,0,y,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+F;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+F}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+F;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+F}_placeFirst(e,t,i,r,s=!1){const{out:o,id:n,shaping:a,zoomRange:l,referenceBounds:c}=this._current,h=a.glyphs,m=this._getBoundsOffset(e.angle);for(const u of h){const h=u.x>a.bounds.x?i:1-i,d=h*e.remainingLength+(1-h)*e.backwardLength,f=Math.abs(u.x+u.width/2-a.bounds.x),g=Math.max(0,this._zoomLevel+Math.log2(f/(d+F))),p=Math.max(t,s?0:g);u.angle=e.angle+(1-i)*Math.PI;const _=[Math.max(l[0],p),Math.min(l[1],D)];this._writeLineGlyph(o,n,e.x,e.y,u,_,r,c),this._writeLineGlyphBox(o,u,i,_,m)}}_placeOnSegment(e,t,i,r,s,o,n){const{out:a,id:l,shaping:c,referenceBounds:h}=this._current,m=c.glyphs,u=e.dx/e.length,d=e.dy/e.length,f={x:e.x+i*-s*u,y:e.y+i*-s*d},g=this._getBoundsOffset(e.angle);for(const p of m){const t=p.x>c.bounds.x?o:1-o;if(!(t&&1===s||!t&&-1===s))continue;const m=Math.abs(p.x+p.width/2-c.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(m/i)-.1),d=Math.max(r,this._zoomLevel+Math.log2(m/(i+e.length+F)));if(0===u)continue;p.angle=e.angle+(1-o)*Math.PI;const _=[d,u];this._writeLineGlyph(a,l,f.x,f.y,p,_,n,h),this._writeLineGlyphBox(a,p,o,_,g)}}_getBoundsOffset(e){const i=t(this.evaluatedMeshParams.offsetX),s=t(this.evaluatedMeshParams.offsetY),a=u(i,s),l=r(o(),-e);return n(a,a,l)}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>w||r<0||r>w)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:u}=this._textMeshTransformProps,{sdfSize:d,sdfRadius:f}=this.evaluatedMeshParams.glyphs;this._writeQuad(e,t,i,r,{sdfSize:d,sdfRadius:f,texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:u,color:G(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],o[0]),maxZoom:Math.min(this._current.zoomRange[1],o[1]),clipAngle:n,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,i,r,s){if((i||this._current.offsetDirection)&&this._isVisible(r)&&t.bounds){const i=t.bounds,r=new L(i.x+s[0],i.y+s[1],i.width,i.height);e.metricBoxWrite(r)}}_isVisible(e){const t=Math.max(this._current.zoomRange[0],e[0]),i=Math.min(this._current.zoomRange[1],e[1]),r=this._zoomLevel;return t<=r&&r<=i}}function X(e,t){const i=new b,{coords:r,lengths:s}=e,o=d(),n=d(),u=d(),f=d(),g=d(),p=d(),_=2;let y=0;for(let d=0;d<s.length;d++){const e=s[d];for(let s=0;s<e;s++){const d=_*(s+y-1),x=_*(s+y),P=_*(s+y+1);s>0?a(o,r[d],r[d+1]):a(o,0,0),a(n,r[x],r[x+1]),s<e-1?a(u,r[P],r[P+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===e-1?a(g,0,0):(l(g,u,n),c(g,g),a(g,g[1],-g[0])),h(p,f,g),c(p,p);const v=p[0]*g[0]+p[1]*g[1];0!==v&&m(p,p,v),m(p,p,t),i.coords.push(n[0]+p[0],n[1]+p[1])}i.lengths.push(e),y+=e}return i}export{U as LabelMeshWriter,E as labelIdHash,T as labelMetricHash,O as lineLabelIdHash,W as lineLabelMetricHash};
2
+ import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as f,convertOptimizedGeometryToFlat as g,convertFlatToOptimizedGeometry as p,FlatGeometry as _}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as y}from"../../../../../../../geometry/GeometryCursor.js";import{getLabelPoint as x}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as P,convertToGeometry as v}from"../../../../../../../layers/graphics/featureConversionUtils.js";import b from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{importLazily as M}from"../../../../../../../symbols/cim/utils.js";import{tileSize as w}from"../../../definitions.js";import L from"../../../collisions/BoundingBox.js";import{LabelMetric as I}from"../../../collisions/LabelMetric.js";import{smoothPaths as B,pathDivide as S}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as z,processColorInput as G}from"../fill/meshWriterUtils.js";import{TextMeshWriter as j,maxLabelZoom as D}from"../text/TextMeshWriter.js";const A=1,F=0,R=128,$=w*w/16,k=M(()=>import("../../../../../../../geometry/operators/gx/operatorIntersection.js")),C=M(()=>import("../../../../../../../chunks/FlatGeometry.js"));function E(e,t,r){return i(`${e}${t}${r}`)}function O(e,t,r,s,o){return i(`${e}${t}${r}${s*2**(D-o)}`)}function T(e,t,r){return i(`${e}${t}${r}`)}function X(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(D-s)}`)}const Y=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class W extends j{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),k.getImportPromise(),C.getImportPromise()])}_write(e,{target:t,effectGeometry:i,level:r,viewExtent:s}){if(this._zoomLevel=r,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,s);break;case"esriGeometryMultipoint":{let i=0;const r=y.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new I(e,h,t,i,r,s,n,a,l,c,o)}_writePolygon(e,t,i){const r=k.module,s=C.module.constructFromFlatGeometry,o=t.readGeometryForDisplay()?.justXY(),n=t.readCentroidForDisplay()?.coords,a=o?.area()||0;if(!n)return;const l=a>=$;e.requiresRefresh||=l;const c=s(f(i)),h=s(f({x:n[0],y:n[1]})),m=!!r.execute(h,c,null);if(!o||!l||!m)return void this._writePoint(e,n[0],n[1],0,t);const u=s(g("polygon",o,null)),d=r.execute(u,c,null);if(!d)return void this._writePoint(e,n[0],n[1],0,t);const P=p(new _(d.toFlatGeometry())),v=y.fromOptimized(P,"esriGeometryPolygon",1),b=x(v)??n;this._writePoint(e,b[0],b[1],0,t)}_writePoint(e,t,i,r,s){if(t<0||t>w||i<0||i>w)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=E(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=T(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new I(n,a,l,c,t,i,h,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<A);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:z(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay()?.justXY();if(!n)return;const a=P(n,"esriGeometryPolyline",1)??new b,l=Z(a,o),c=Z(a,-o),h=v(c,"esriGeometryPolyline",!1,!1),m=v(l,"esriGeometryPolyline",!1,!1),u=B(m.paths,s.bounds.width),d=B(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,S(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,S(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=B(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,S(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,u=this._current.zoomRange[0],d=Y(t),f=this._current.shaping.bounds.width/(1<<A),g=Math.sqrt(n||R)/(1<<A),p=Math.min(i,r-i),_=h.isMultiline?D:Math.log2(p/(g+f/2)),y=0===t?_:Math.min(d,_),x=Math.max(u,this._zoomLevel+A-y),P=this._zoomLevel-x,v=h.bounds.width/2*2**P,b=O(a,c,m,t,this._zoomLevel),M=X(c,m,t,this._zoomLevel,l);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,x,b,M):s&&P<0?this._placeStraightAlong(e,u,b,M):"parallel"===o?this._placeStraightAlong(e,x,b,M):"curved"===o&&this._placeCurved(e,x,v,b,M)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,p=e.clone(),_=e.angle*(180/Math.PI)%360,y=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(D,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:_,mapAligned:!0,isLineLabel:!0},p=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(p,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(p,x),[i,r]=h.shapeBackground(s(o(),f,t));g.clipAngle=y,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(p,i,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(p,i,0,y,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+F;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+F}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+F;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+F}_placeFirst(e,t,i,r,s=!1){const{out:o,id:n,shaping:a,zoomRange:l,referenceBounds:c}=this._current,h=a.glyphs,m=this._getBoundsOffset(e.angle);for(const u of h){const h=u.x>a.bounds.x?i:1-i,d=h*e.remainingLength+(1-h)*e.backwardLength,f=Math.abs(u.x+u.width/2-a.bounds.x),g=Math.max(0,this._zoomLevel+Math.log2(f/(d+F))),p=Math.max(t,s?0:g);u.angle=e.angle+(1-i)*Math.PI;const _=[Math.max(l[0],p),Math.min(l[1],D)];this._writeLineGlyph(o,n,e.x,e.y,u,_,r,c),this._writeLineGlyphBox(o,u,i,_,m)}}_placeOnSegment(e,t,i,r,s,o,n){const{out:a,id:l,shaping:c,referenceBounds:h}=this._current,m=c.glyphs,u=e.dx/e.length,d=e.dy/e.length,f={x:e.x+i*-s*u,y:e.y+i*-s*d},g=this._getBoundsOffset(e.angle);for(const p of m){const t=p.x>c.bounds.x?o:1-o;if(!(t&&1===s||!t&&-1===s))continue;const m=Math.abs(p.x+p.width/2-c.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(m/i)-.1),d=Math.max(r,this._zoomLevel+Math.log2(m/(i+e.length+F)));if(0===u)continue;p.angle=e.angle+(1-o)*Math.PI;const _=[d,u];this._writeLineGlyph(a,l,f.x,f.y,p,_,n,h),this._writeLineGlyphBox(a,p,o,_,g)}}_getBoundsOffset(e){const i=t(this.evaluatedMeshParams.offsetX),s=t(this.evaluatedMeshParams.offsetY),a=u(i,s),l=r(o(),-e);return n(a,a,l)}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>w||r<0||r>w)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:u}=this._textMeshTransformProps,{sdfSize:d,sdfRadius:f}=this.evaluatedMeshParams.glyphs;this._writeQuad(e,t,i,r,{sdfSize:d,sdfRadius:f,texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:u,color:G(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],o[0]),maxZoom:Math.min(this._current.zoomRange[1],o[1]),clipAngle:n,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,i,r,s){if((i||this._current.offsetDirection)&&this._isVisible(r)&&t.bounds){const i=t.bounds,r=new L(i.x+s[0],i.y+s[1],i.width,i.height);e.metricBoxWrite(r)}}_isVisible(e){const t=Math.max(this._current.zoomRange[0],e[0]),i=Math.min(this._current.zoomRange[1],e[1]),r=this._zoomLevel;return t<=r&&r<=i}}function Z(e,t){const i=new b,{coords:r,lengths:s}=e,o=d(),n=d(),u=d(),f=d(),g=d(),p=d(),_=2;let y=0;for(let d=0;d<s.length;d++){const e=s[d];for(let s=0;s<e;s++){const d=_*(s+y-1),x=_*(s+y),P=_*(s+y+1);s>0?a(o,r[d],r[d+1]):a(o,0,0),a(n,r[x],r[x+1]),s<e-1?a(u,r[P],r[P+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===e-1?a(g,0,0):(l(g,u,n),c(g,g),a(g,g[1],-g[0])),h(p,f,g),c(p,p);const v=p[0]*g[0]+p[1]*g[1];0!==v&&m(p,p,v),m(p,p,t),i.coords.push(n[0]+p[0],n[1]+p[1])}i.lengths.push(e),y+=e}return i}export{W as LabelMeshWriter,E as labelIdHash,T as labelMetricHash,O as lineLabelIdHash,X as lineLabelMetricHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../../../../core/has.js";import{vertexLayoutHash as t}from"./utils.js";import{DataType as e}from"../../../../../../webgl/enums.js";function s(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:case e.HALF_FLOAT:return 2;case e.FLOAT:case e.INT:case e.UNSIGNED_INT:return 4}}function o(t){const e=[],o=[],n=[];for(const i of t){const t=s(i.type)*i.count;switch(t%2||t%4||4){case 4:e.push(i);continue;case 2:o.push(i);continue;case 1:n.push(i);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...o),e.push(...n),e}class n{static fromVertexSpec(t,e){const{attributes:i,optionalAttributes:r}=t;let a,c,u;const p=[];for(const s in i){if(i[s].otherSource)continue;const t=i[s];"position"===t.pack?a={...t,name:s,offset:0}:"id"===t.pack?c={...t,name:s,offset:4}:"bitset"===s?u={...t,name:s,offset:7}:p.push({...t,name:s})}for(const s in r)if(!0===e[s]){const t=r[s];p.push({...t,name:s})}const h=o(p),f=[];let m=8,b=1;for(const o of h)f.push({...o,offset:m}),m+=s(o.type)*o.count,o.packAlternating&&(b=Math.max(o.packAlternating.count,b));const d=Uint32Array.BYTES_PER_ELEMENT,_=m%d;return new n(a,c,u,f,m+(_?d-_:0),b)}constructor(t,e,s,o,n,i){this.position=t,this.id=e,this.bitset=s,this.standardAttributes=o,this.stride=n,this.packVertexCount=i,o.push(s),this._attributes=[t,e,s,...o]}get attributeLayout(){if(!this._attributeLayout){const e=t(this._attributes),s=this._attributes.map(t=>({name:t.name,count:t.count,offset:t.offset,type:t.type,packPrecisionFactor:t.packPrecisionFactor,normalized:t.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}}export{n as AlignedVertexSpec,o as sortByAlignment};
2
+ import"../../../../../../../core/has.js";import{vertexLayoutHash as t}from"./utils.js";import{DataType as e}from"../../../../../../webgl/enums.js";function s(t){switch(t){case e.BYTE:case e.UNSIGNED_BYTE:return 1;case e.SHORT:case e.UNSIGNED_SHORT:case e.HALF_FLOAT:return 2;case e.FLOAT:case e.INT:case e.UNSIGNED_INT:return 4}}function o(t){const e=[],o=[],n=[];for(const i of t){const t=s(i.type)*i.count;switch(t%2||t%4||4){case 4:e.push(i);continue;case 2:o.push(i);continue;case 1:n.push(i);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...o),e.push(...n),e}class n{static fromVertexSpec(t,e){const i=t.attributes,r=t.optionalAttributes;let a,c,u;const p=[];for(const s in i){if(i[s].otherSource)continue;const t=i[s];"position"===t.pack?a={...t,name:s,offset:0}:"id"===t.pack?c={...t,name:s,offset:4}:"bitset"===s?u={...t,name:s,offset:7}:p.push({...t,name:s})}for(const s in r)if(!0===e[s]){const t=r[s];p.push({...t,name:s})}const h=o(p),f=[];let m=8,b=1;for(const o of h)f.push({...o,offset:m}),m+=s(o.type)*o.count,o.packAlternating&&(b=Math.max(o.packAlternating.count,b));const d=Uint32Array.BYTES_PER_ELEMENT,_=m%d;return new n(a,c,u,f,m+(_?d-_:0),b)}constructor(t,e,s,o,n,i){this.position=t,this.id=e,this.bitset=s,this.standardAttributes=o,this.stride=n,this.packVertexCount=i,o.push(s),this._attributes=[t,e,s,...o]}get attributeLayout(){if(!this._attributeLayout){const e=t(this._attributes),s=this._attributes.map(t=>({name:t.name,count:t.count,offset:t.offset,type:t.type,packPrecisionFactor:t.packPrecisionFactor,normalized:t.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}}export{n as AlignedVertexSpec,o as sortByAlignment};