@arcgis/core 5.1.0-next.121 → 5.1.0-next.122

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 (372) hide show
  1. package/arcgisGlobal.d.ts +3 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/04895de94657e7f3d7e1.js +1 -0
  4. package/assets/esri/core/workers/chunks/{d35c475f004367e333eb.js → 06df187a116709f69952.js} +1 -1
  5. package/assets/esri/core/workers/chunks/0ecc1bc1686844cdd60e.js +1 -0
  6. package/assets/esri/core/workers/chunks/0f75c19d8e296a32e329.js +1 -0
  7. package/assets/esri/core/workers/chunks/174cc2e69e5b5a13d880.js +1 -0
  8. package/assets/esri/core/workers/chunks/{163ce1be8bfe20e77f97.js → 184d896fe66340129acd.js} +1 -1
  9. package/assets/esri/core/workers/chunks/18f980465db5a86153d1.js +1 -0
  10. package/assets/esri/core/workers/chunks/1996f0a930abdd97b855.js +1 -0
  11. package/assets/esri/core/workers/chunks/1c8436b27a3d3cde5cfc.js +1 -0
  12. package/assets/esri/core/workers/chunks/1cb1f125dccbf8c8cac9.js +1 -0
  13. package/assets/esri/core/workers/chunks/1d7e1bbd321d6f99776c.js +1 -0
  14. package/assets/esri/core/workers/chunks/1f289aa69dd6b6be534a.js +1 -0
  15. package/assets/esri/core/workers/chunks/{da29cf0e64065631a470.js → 24810c36ae09bb4e83dc.js} +1 -1
  16. package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +1 -0
  17. package/assets/esri/core/workers/chunks/2d2895f1fdf44d212a4d.js +1 -0
  18. package/assets/esri/core/workers/chunks/2dbc2fd0f2dde505c465.js +1 -0
  19. package/assets/esri/core/workers/chunks/2dbcdfdf000226bfe746.js +1 -0
  20. package/assets/esri/core/workers/chunks/2e6382d50bf012064eae.js +1 -0
  21. package/assets/esri/core/workers/chunks/30f1909c5ef1835b8507.js +1 -0
  22. package/assets/esri/core/workers/chunks/313773bd9c82d1858929.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1c029b03ed836f393a50.js → 3248001d9dfb9153699e.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +1 -0
  25. package/assets/esri/core/workers/chunks/{716a4d7e8b908b81870b.js → 32f26757e36704923286.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3529afab0c2444275d91.js +1 -0
  27. package/assets/esri/core/workers/chunks/36dac6ab51d9dbdd091d.js +1 -0
  28. package/assets/esri/core/workers/chunks/390fda094fa8695d98cf.js +1 -0
  29. package/assets/esri/core/workers/chunks/39596715e84d0da2f803.js +30 -0
  30. package/assets/esri/core/workers/chunks/{b23009d9f8eb7c20ce45.js → 3b15933f65f59625a650.js} +1 -1
  31. package/assets/esri/core/workers/chunks/3b3f91a61e3f29af1fb2.js +1 -0
  32. package/assets/esri/core/workers/chunks/{f815106d439ff1f76e51.js → 3b837b512999e6ab24bc.js} +1 -1
  33. package/assets/esri/core/workers/chunks/3d20c86f1fe877bf884b.js +1 -0
  34. package/assets/esri/core/workers/chunks/3e65b4b18760bde8ceee.js +1 -0
  35. package/assets/esri/core/workers/chunks/3ff7aa216cd794d951e8.js +1 -0
  36. package/assets/esri/core/workers/chunks/{8e1865392681d390ab2e.js → 401ee7fa500adad77db1.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{60915a3708a34da1977e.js → 426156137f279d979ddd.js} +1 -1
  38. package/assets/esri/core/workers/chunks/4517630bf869205bab87.js +1 -0
  39. package/assets/esri/core/workers/chunks/48f1c3a7c9f16d6896f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/4e293c4006bdc7cc4c08.js +1 -0
  41. package/assets/esri/core/workers/chunks/{22ac25e8f730218d7e69.js → 4efbe879d06013168f54.js} +8 -12
  42. package/assets/esri/core/workers/chunks/5121768c70f1e03b685c.js +1 -0
  43. package/assets/esri/core/workers/chunks/52f354bf80ee5ab0379a.js +1 -0
  44. package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +1 -0
  45. package/assets/esri/core/workers/chunks/58a7cdebc3d182c15ec6.js +1 -0
  46. package/assets/esri/core/workers/chunks/597aa39cdb5366ef9a74.js +1 -0
  47. package/assets/esri/core/workers/chunks/5bfae465872760e7af6d.js +1 -0
  48. package/assets/esri/core/workers/chunks/5cb274e5759f7ca0d4ed.js +1 -0
  49. package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +1 -0
  50. package/assets/esri/core/workers/chunks/5dd441db1e74dc9b56e9.js +1 -0
  51. package/assets/esri/core/workers/chunks/64114a7d2da162987958.js +1 -0
  52. package/assets/esri/core/workers/chunks/661f7e3f88727dc4801c.js +1 -0
  53. package/assets/esri/core/workers/chunks/6821462e5c1e9c76010a.js +1 -0
  54. package/assets/esri/core/workers/chunks/684d3cb4fb233180b2d0.js +1 -0
  55. package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +1 -0
  56. package/assets/esri/core/workers/chunks/{f02fe24177e56a7e42b2.js → 688fe64be39e9ac35ffd.js} +1 -1
  57. package/assets/esri/core/workers/chunks/69e98de578f467a35054.js +1 -0
  58. package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +1 -0
  59. package/assets/esri/core/workers/chunks/6aabde21b0b376d95888.js +1 -0
  60. package/assets/esri/core/workers/chunks/6d616b66fb32904b55a1.js +1 -0
  61. package/assets/esri/core/workers/chunks/{bcb021a167580bb1619f.js → 6ef3b8d67b498d655a99.js} +1 -1
  62. package/assets/esri/core/workers/chunks/6f125b4ed06c0022dee6.js +1 -0
  63. package/assets/esri/core/workers/chunks/6f4825c3ef1fe202ab82.js +1 -0
  64. package/assets/esri/core/workers/chunks/6f5d61f734ec40dafabb.js +1 -0
  65. package/assets/esri/core/workers/chunks/72d67cc3a382e83bf1a2.js +1 -0
  66. package/assets/esri/core/workers/chunks/78c53aeb0a408ab3c80c.js +1 -0
  67. package/assets/esri/core/workers/chunks/7b5c1030a7cf0f382cc4.js +1 -0
  68. package/assets/esri/core/workers/chunks/{542f5469f7b42026b24f.js → 7cb1afb32ec043e23ec2.js} +1 -1
  69. package/assets/esri/core/workers/chunks/7cee81c5aa1e6b7d2452.js +1 -0
  70. package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +1 -0
  71. package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +1 -0
  72. package/assets/esri/core/workers/chunks/{8477b5fdd99c6ac5c27b.js → 851705cf276eae8d4d37.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{b79428c5093614174e76.js → 8b0a01ebc86ab226f01f.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{452c01cecbbd1e370098.js → 8f93e6fc11a158d4f1ee.js} +1 -1
  75. package/assets/esri/core/workers/chunks/93bd56396b8cd020f965.js +1 -0
  76. package/assets/esri/core/workers/chunks/{359d3acb3953e64e5a78.js → 93ceb74ac88ef460fe5f.js} +1 -1
  77. package/assets/esri/core/workers/chunks/957f7b8de4aecb6f644e.js +1 -0
  78. package/assets/esri/core/workers/chunks/96e46424c3fb1dd9ce3b.js +1 -0
  79. package/assets/esri/core/workers/chunks/976ab2be6c244768c08a.js +1 -0
  80. package/assets/esri/core/workers/chunks/985fceacd6ec137bd490.js +1 -0
  81. package/assets/esri/core/workers/chunks/{e785f76c1a75cb1d1e1f.js → 99101789035f1787c630.js} +1 -1
  82. package/assets/esri/core/workers/chunks/99e5296192ab98fd0d99.js +1 -0
  83. package/assets/esri/core/workers/chunks/{d427d8091f18aa7b3867.js → 9c251f762df7a430cc0c.js} +1 -1
  84. package/assets/esri/core/workers/chunks/9d5f7573bfe3b051daf1.js +1 -0
  85. package/assets/esri/core/workers/chunks/a043e8c49ac8e4d1d0a6.js +1 -0
  86. package/assets/esri/core/workers/chunks/a0c00c6fe60db49b3ab9.js +1 -0
  87. package/assets/esri/core/workers/chunks/a2247f4c3116efb16c4f.js +1 -0
  88. package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +1 -0
  89. package/assets/esri/core/workers/chunks/a442534ac0956a68b769.js +1 -0
  90. package/assets/esri/core/workers/chunks/a4e9a17dacbb52444d75.js +1 -0
  91. package/assets/esri/core/workers/chunks/{8bdca6f06c8b5fedd917.js → a5abba59e738c3240c22.js} +1 -1
  92. package/assets/esri/core/workers/chunks/aa118c1bcd922b8ac328.js +1 -0
  93. package/assets/esri/core/workers/chunks/aae0049c2c3e15a813e8.js +1 -0
  94. package/assets/esri/core/workers/chunks/ab62724b80b3c478a597.js +1 -0
  95. package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +1 -0
  96. package/assets/esri/core/workers/chunks/adc32f6b45ea3026fc34.js +1 -0
  97. package/assets/esri/core/workers/chunks/{7601278ebced0c0c31cf.js → af75e91b88e747aa76ac.js} +1 -1
  98. package/assets/esri/core/workers/chunks/b22a1c98271c2e4d8808.js +1 -0
  99. package/assets/esri/core/workers/chunks/b44cf254585210578eab.js +1 -0
  100. package/assets/esri/core/workers/chunks/{2bcd4d395bfe6a19ccc8.js → b606af35a4fb893b762c.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{9f4681713f03365a2a53.js → b666027b9022fa346a79.js} +1 -1
  102. package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +1 -0
  103. package/assets/esri/core/workers/chunks/bb867fec068e26bb0c8e.js +1 -0
  104. package/assets/esri/core/workers/chunks/c2a65de34f6a6c89c652.js +1 -0
  105. package/assets/esri/core/workers/chunks/c357c0a08b99c1e7f290.js +1 -0
  106. package/assets/esri/core/workers/chunks/{4a23b27bfbcfa08fd9a7.js → c3cf9e6e91f71c9cc5f3.js} +1 -1
  107. package/assets/esri/core/workers/chunks/c3ff2ff0a86a9143d7a5.js +1 -0
  108. package/assets/esri/core/workers/chunks/c60b4f2dd5fccdf362a7.js +1 -0
  109. package/assets/esri/core/workers/chunks/c6d0b4875b6b8d6bc25a.js +1 -0
  110. package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +1 -0
  111. package/assets/esri/core/workers/chunks/c911f0b5bdd43b66b731.js +1 -0
  112. package/assets/esri/core/workers/chunks/c9a4601073e1a3eee9d0.js +1 -0
  113. package/assets/esri/core/workers/chunks/ccffaba50674adba7a0f.js +1 -0
  114. package/assets/esri/core/workers/chunks/{24646a1176ce34039155.js → cdf6ad970dc1893dac58.js} +1 -1
  115. package/assets/esri/core/workers/chunks/d13e003c9293cb7e2852.js +1 -0
  116. package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +1 -0
  117. package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +1 -0
  118. package/assets/esri/core/workers/chunks/d52864823067e57a719a.js +1 -0
  119. package/assets/esri/core/workers/chunks/d5c35a75fd4c41def420.js +1 -0
  120. package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +1 -0
  121. package/assets/esri/core/workers/chunks/d9d0a07245ee5117d2a0.js +1 -0
  122. package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +1 -0
  123. package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +1 -0
  124. package/assets/esri/core/workers/chunks/e1505ec80b068011bdc5.js +1 -0
  125. package/assets/esri/core/workers/chunks/e16b7ff4bf24fb99f7ea.js +1 -0
  126. package/assets/esri/core/workers/chunks/e1bf87077541da6853c6.js +1 -0
  127. package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +1 -0
  128. package/assets/esri/core/workers/chunks/e4406baf206b9e4c7e4f.js +1 -0
  129. package/assets/esri/core/workers/chunks/e499252cb52f7aed49a0.js +1 -0
  130. package/assets/esri/core/workers/chunks/{e178cd0e9178d6716410.js → e5837e5ac6ef761f26a2.js} +1 -1
  131. package/assets/esri/core/workers/chunks/e6a7272b59a4c2e34dca.js +1 -0
  132. package/assets/esri/core/workers/chunks/e912b515704e20313e53.js +1 -0
  133. package/assets/esri/core/workers/chunks/eabeaab5c4810f999a4d.js +1 -0
  134. package/assets/esri/core/workers/chunks/ec1841e6e498d54012eb.js +1 -0
  135. package/assets/esri/core/workers/chunks/ec723f8777b935c5e81a.js +1 -0
  136. package/assets/esri/core/workers/chunks/ed3d16a5b4084ef61f8a.js +1 -0
  137. package/assets/esri/core/workers/chunks/ef46ef4f0ee9f2aeaa4a.js +1 -0
  138. package/assets/esri/core/workers/chunks/efb4aa5886730ea377bd.js +1 -0
  139. package/assets/esri/core/workers/chunks/{485d20152495c27b8074.js → f2a268c69f2a5566381b.js} +1 -1
  140. package/assets/esri/core/workers/chunks/f590db684d88e72bd79b.js +1 -0
  141. package/assets/esri/core/workers/chunks/{de3d8f83f3ea09b315a0.js → f622ae3887c85535e8ab.js} +1 -1
  142. package/assets/esri/core/workers/chunks/f69df22a5c64389ebe28.js +1 -0
  143. package/assets/esri/core/workers/chunks/{f60292d97bcdbf19165b.js → f6d047358d14328f3622.js} +1 -1
  144. package/assets/esri/core/workers/chunks/f7fca88d120d45bb782a.js +1 -0
  145. package/assets/esri/core/workers/chunks/f819854098d63fe4ccdb.js +1 -0
  146. package/assets/esri/core/workers/chunks/f8f3579d0c1b65762902.js +1 -0
  147. package/assets/esri/core/workers/chunks/f98118127469449ca145.js +1 -0
  148. package/assets/esri/core/workers/chunks/{5abe34bb0110694f7b42.js → faad127dc07e54e7f6d1.js} +1 -1
  149. package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +1 -0
  150. package/assets/esri/core/workers/chunks/fbe7dae0b4bf2d172487.js +1 -0
  151. package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +1 -0
  152. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  153. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  154. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  155. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  156. package/chunks/GlowComposition.glsl.js +2 -2
  157. package/chunks/bundle2.js +1 -1
  158. package/chunks/lyr3DMain.js +1 -1
  159. package/chunks/lyr3DWorker.js +1 -1
  160. package/chunks/vxlLayer.js +1 -1
  161. package/config.js +1 -1
  162. package/core/has.js +1 -1
  163. package/core/sql.d.ts +1 -1
  164. package/geometry/Extent.d.ts +0 -13
  165. package/geometry/Geometry.d.ts +10 -8
  166. package/geometry/Point.d.ts +15 -71
  167. package/graphic/AnnotationGraphicOrigin.d.ts +34 -0
  168. package/graphic/AnnotationGraphicOrigin.js +2 -0
  169. package/graphic/DimensionFeatureGraphicOrigin.d.ts +34 -0
  170. package/graphic/DimensionFeatureGraphicOrigin.js +2 -0
  171. package/identity/IdentityManagerBase.js +1 -1
  172. package/interfaces.d.ts +7 -0
  173. package/kernel.js +1 -1
  174. package/layers/AnnotationLayer.d.ts +263 -32
  175. package/layers/AnnotationLayer.js +1 -1
  176. package/layers/DimensionFeatureLayer.d.ts +263 -32
  177. package/layers/DimensionFeatureLayer.js +1 -1
  178. package/layers/FeatureLayer.d.ts +1 -1
  179. package/layers/GeoJSONLayer.d.ts +7 -7
  180. package/layers/ParquetLayer.d.ts +22 -2
  181. package/layers/SceneLayer.d.ts +4 -2
  182. package/layers/catalog/CatalogFootprintLayer.d.ts +40 -10
  183. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  184. package/layers/graphics/sources/parquet/ParquetFileInfo.js +2 -0
  185. package/layers/graphics/sources/parquet/ParquetFileStatistics.js +2 -0
  186. package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +1 -1
  187. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  188. package/layers/graphics/sources/parquet/UrlsFileProvider.js +1 -1
  189. package/layers/graphics/sources/parquet/createFileProvider.js +1 -1
  190. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  191. package/layers/mixins/FeatureLayerBase.d.ts +40 -16
  192. package/layers/mixins/TemporalLayer.d.ts +4 -2
  193. package/layers/support/AnnotationSublayer.d.ts +44 -0
  194. package/layers/support/AnnotationSublayer.js +2 -0
  195. package/layers/support/GeometryEncodingLocation.d.ts +1 -1
  196. package/layers/support/GeometryEncodingWkb.d.ts +3 -2
  197. package/layers/support/ParquetFilesData.d.ts +13 -3
  198. package/layers/support/ParquetPortalItemData.d.ts +12 -1
  199. package/layers/support/commonProperties.js +1 -1
  200. package/layers/support/featureLayerUtils.js +1 -1
  201. package/layers/support/layerUtils.js +1 -1
  202. package/layers/support/parquetUtils.js +1 -1
  203. package/layers/support/tiles3DUtils.js +1 -1
  204. package/libs/parquet/parquet.js +1 -1
  205. package/package.json +1 -1
  206. package/request/types.d.ts +18 -20
  207. package/support/revision.js +1 -1
  208. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  209. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  210. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
  211. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
  213. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
  214. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  215. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
  216. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  217. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  218. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  219. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  220. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  221. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  222. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  223. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  224. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  225. package/views/3d/layers/FlowSubView3D.js +1 -1
  226. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  227. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  228. package/views/3d/terrain/OverlayManager.js +1 -1
  229. package/views/3d/webgl/RenderNode.d.ts +25 -4
  230. package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +6 -10
  231. package/views/layers/FeatureLikeLayerView.d.ts +25 -1
  232. package/views/layers/FeatureLikeLayerView.js +1 -1
  233. package/views/types.d.ts +1 -1
  234. package/webdoc/support/webdocSaveUtils.js +1 -1
  235. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -2
  236. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  237. package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +1 -1
  238. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  239. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +2 -6
  240. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  241. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  242. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  243. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  244. package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
  245. package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
  246. package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +1 -1
  247. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  248. package/widgets/BatchAttributeForm.d.ts +9 -1
  249. package/widgets/BatchAttributeForm.js +1 -1
  250. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  251. package/widgets/FeatureTable/Grid/Column.js +1 -1
  252. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  253. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  254. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  255. package/widgets/FeatureTable.js +1 -1
  256. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  257. package/widgets/Print/PrintViewModel.js +1 -1
  258. package/widgets/support/ContingentValuesManager.js +1 -1
  259. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
  260. package/assets/esri/core/workers/chunks/03354ad3d74d858173b4.js +0 -1
  261. package/assets/esri/core/workers/chunks/09a4139fc6d069ab6928.js +0 -1
  262. package/assets/esri/core/workers/chunks/0a510acf50915e00c62b.js +0 -1
  263. package/assets/esri/core/workers/chunks/0a780a883abfcdf0b900.js +0 -1
  264. package/assets/esri/core/workers/chunks/0fbf9bf52ecb4cd8293b.js +0 -1
  265. package/assets/esri/core/workers/chunks/119d352dd586f2bb61ec.js +0 -1
  266. package/assets/esri/core/workers/chunks/130784a27661de6b52a5.js +0 -1
  267. package/assets/esri/core/workers/chunks/145364aa20b4435294c2.js +0 -1
  268. package/assets/esri/core/workers/chunks/1595dc499a06b23b6a96.js +0 -1
  269. package/assets/esri/core/workers/chunks/16713986893adfbc9331.js +0 -1
  270. package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +0 -1
  271. package/assets/esri/core/workers/chunks/1c64e10f966e26af6fed.js +0 -1
  272. package/assets/esri/core/workers/chunks/201007cf1a91e2b126fc.js +0 -1
  273. package/assets/esri/core/workers/chunks/20d0adc678f11981059c.js +0 -1
  274. package/assets/esri/core/workers/chunks/227eff8aa4a6f5f03bc2.js +0 -1
  275. package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +0 -1
  276. package/assets/esri/core/workers/chunks/238478cfe493fd4a6100.js +0 -1
  277. package/assets/esri/core/workers/chunks/24647e7424798dccdaf5.js +0 -1
  278. package/assets/esri/core/workers/chunks/249616ea2d90d40a8299.js +0 -1
  279. package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +0 -1
  280. package/assets/esri/core/workers/chunks/2b36a54927f5a7281da3.js +0 -1
  281. package/assets/esri/core/workers/chunks/2c8584ec1c3c9fd5aba2.js +0 -1
  282. package/assets/esri/core/workers/chunks/2d374cc8c54a722a7afe.js +0 -1
  283. package/assets/esri/core/workers/chunks/2e11b4e9d66474a60064.js +0 -1
  284. package/assets/esri/core/workers/chunks/2fa080539d039c92ce08.js +0 -1
  285. package/assets/esri/core/workers/chunks/3109b05fe4fc40d4f25b.js +0 -1
  286. package/assets/esri/core/workers/chunks/31442f25d550ead58fc4.js +0 -1
  287. package/assets/esri/core/workers/chunks/32323b0e0fcecd8f640e.js +0 -1
  288. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
  289. package/assets/esri/core/workers/chunks/33e0130e6a40fc768978.js +0 -1
  290. package/assets/esri/core/workers/chunks/343ba5ea459e96ba79c6.js +0 -1
  291. package/assets/esri/core/workers/chunks/388e71e8f2ec41bfa5a9.js +0 -1
  292. package/assets/esri/core/workers/chunks/3a5c1c501808352857bd.js +0 -1
  293. package/assets/esri/core/workers/chunks/3aacaa1be5efeac23a37.js +0 -1
  294. package/assets/esri/core/workers/chunks/3b765a8cac9e92f644f2.js +0 -1
  295. package/assets/esri/core/workers/chunks/3bf6d55511cd7722eb93.js +0 -1
  296. package/assets/esri/core/workers/chunks/3e012cd3ca4451f89f59.js +0 -1
  297. package/assets/esri/core/workers/chunks/40910c69307e2d2d3f28.js +0 -1
  298. package/assets/esri/core/workers/chunks/40c4e14e7bb505ef10a3.js +0 -1
  299. package/assets/esri/core/workers/chunks/4193c0cca441be05c80e.js +0 -1
  300. package/assets/esri/core/workers/chunks/423a9882abd4a6dadf86.js +0 -1
  301. package/assets/esri/core/workers/chunks/428561df7ba6f02e2d80.js +0 -1
  302. package/assets/esri/core/workers/chunks/45323491f9005629c602.js +0 -1
  303. package/assets/esri/core/workers/chunks/46d0a25d33b5b328cfce.js +0 -1
  304. package/assets/esri/core/workers/chunks/47dd2bfecc5c4b5f10f0.js +0 -1
  305. package/assets/esri/core/workers/chunks/4845df00f6ebcce6ea3e.js +0 -1
  306. package/assets/esri/core/workers/chunks/4a9dd9f8aa98882218f3.js +0 -1
  307. package/assets/esri/core/workers/chunks/4bfffdfbe6d467f143a4.js +0 -1
  308. package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +0 -1
  309. package/assets/esri/core/workers/chunks/54dad475dc806a38c287.js +0 -1
  310. package/assets/esri/core/workers/chunks/552945a73a95cd2a9f54.js +0 -1
  311. package/assets/esri/core/workers/chunks/5553279998ae07b60f5f.js +0 -1
  312. package/assets/esri/core/workers/chunks/58155f24f8ed6aca7a21.js +0 -1
  313. package/assets/esri/core/workers/chunks/5838f46d341d2fde42ee.js +0 -1
  314. package/assets/esri/core/workers/chunks/592a599f514de373dead.js +0 -1
  315. package/assets/esri/core/workers/chunks/597eb2e040c86cc3c4fc.js +0 -1
  316. package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +0 -1
  317. package/assets/esri/core/workers/chunks/5f9bacee6fbf9ac1bca0.js +0 -1
  318. package/assets/esri/core/workers/chunks/62206d5d497b95fc4caf.js +0 -1
  319. package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +0 -1
  320. package/assets/esri/core/workers/chunks/62fc3c367f736c73b0d7.js +0 -1
  321. package/assets/esri/core/workers/chunks/643c33a98f2d30a92001.js +0 -1
  322. package/assets/esri/core/workers/chunks/64daa2a714e59d22bbd4.js +0 -1
  323. package/assets/esri/core/workers/chunks/6a5356ebed70e0f8f979.js +0 -1
  324. package/assets/esri/core/workers/chunks/6c9933f948efd7923aa1.js +0 -1
  325. package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +0 -1
  326. package/assets/esri/core/workers/chunks/76589434d573111a8fb4.js +0 -1
  327. package/assets/esri/core/workers/chunks/767ea5b455b3823afd09.js +0 -1
  328. package/assets/esri/core/workers/chunks/77859a61d059738d057f.js +0 -1
  329. package/assets/esri/core/workers/chunks/78aa5bc6af2758da20d0.js +0 -1
  330. package/assets/esri/core/workers/chunks/7b564226def99fcf79d8.js +0 -1
  331. package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +0 -1
  332. package/assets/esri/core/workers/chunks/7cadfd7444a2a05cf2fb.js +0 -1
  333. package/assets/esri/core/workers/chunks/823789261ca3338f0fa8.js +0 -1
  334. package/assets/esri/core/workers/chunks/8419934bec7723b0feef.js +0 -1
  335. package/assets/esri/core/workers/chunks/84b0b6e099d949e0fea5.js +0 -1
  336. package/assets/esri/core/workers/chunks/866709e1e55796999f3c.js +0 -1
  337. package/assets/esri/core/workers/chunks/92ab5886aa2d8b9b179f.js +0 -1
  338. package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +0 -1
  339. package/assets/esri/core/workers/chunks/9b676606bf839b7aa433.js +0 -1
  340. package/assets/esri/core/workers/chunks/9dcfaca1f4fa8c8026ac.js +0 -1
  341. package/assets/esri/core/workers/chunks/9f23a61c60949459c14f.js +0 -30
  342. package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +0 -1
  343. package/assets/esri/core/workers/chunks/a0fa60a24e58f7a47e41.js +0 -1
  344. package/assets/esri/core/workers/chunks/a261f4c22224511fdfff.js +0 -1
  345. package/assets/esri/core/workers/chunks/a2ac139d0975085279a6.js +0 -1
  346. package/assets/esri/core/workers/chunks/a806ac351ef5da04c250.js +0 -1
  347. package/assets/esri/core/workers/chunks/ab94c9f62462d7a98f6a.js +0 -1
  348. package/assets/esri/core/workers/chunks/abdb05754c50776c3edd.js +0 -1
  349. package/assets/esri/core/workers/chunks/ad488985824fbb830ed6.js +0 -1
  350. package/assets/esri/core/workers/chunks/b0ac4b0b7aec70cfe6eb.js +0 -1
  351. package/assets/esri/core/workers/chunks/bfbd1ca28ed2f263e58f.js +0 -1
  352. package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +0 -1
  353. package/assets/esri/core/workers/chunks/c44be4aaba829e6d149d.js +0 -1
  354. package/assets/esri/core/workers/chunks/ca6907e14b1dde4d5c07.js +0 -1
  355. package/assets/esri/core/workers/chunks/ce0e627a5e1cb78adce8.js +0 -1
  356. package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +0 -1
  357. package/assets/esri/core/workers/chunks/d21480b078ec9680d4c4.js +0 -1
  358. package/assets/esri/core/workers/chunks/d81291dac1932350eccd.js +0 -1
  359. package/assets/esri/core/workers/chunks/da3c54e27a808f4fcc18.js +0 -1
  360. package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +0 -1
  361. package/assets/esri/core/workers/chunks/dd58286dde3b20356f84.js +0 -1
  362. package/assets/esri/core/workers/chunks/df412ef1b6dff43970fd.js +0 -1
  363. package/assets/esri/core/workers/chunks/dfeddb7b17fa9eaae64c.js +0 -1
  364. package/assets/esri/core/workers/chunks/e4e0c5a45cf32973d5d5.js +0 -1
  365. package/assets/esri/core/workers/chunks/e638391801ad83fe4a68.js +0 -1
  366. package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +0 -1
  367. package/assets/esri/core/workers/chunks/e7712467db46e1385cf4.js +0 -1
  368. package/assets/esri/core/workers/chunks/ed2cb60e4f17f46fb78d.js +0 -1
  369. package/assets/esri/core/workers/chunks/edb55329305becdb204f.js +0 -1
  370. package/assets/esri/core/workers/chunks/f1fb2f12371f4c562079.js +0 -1
  371. package/assets/esri/core/workers/chunks/f3dfe1bd1146a6927407.js +0 -1
  372. package/assets/esri/core/workers/chunks/ff48334528d2554db4fe.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.121",
3
+ "version": "5.1.0-next.122",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -321,7 +321,7 @@ export interface RequestParameters {
321
321
  * // use the BeforeInterceptorCallback to check if the query of the
322
322
  * // FeatureLayer has a maxAllowableOffset property set.
323
323
  * // if so, then set the maxAllowableOffset to 0
324
- * before: function(params) {
324
+ * before: (params) => {
325
325
  * if (params.requestOptions.query.maxAllowableOffset) {
326
326
  * params.requestOptions.query.maxAllowableOffset = 0;
327
327
  * }
@@ -329,7 +329,7 @@ export interface RequestParameters {
329
329
  * // use the AfterInterceptorCallback to check if `ssl` is set to 'true'
330
330
  * // on the response to the request, if it's set to 'false', change
331
331
  * // the value to 'true' before returning the response
332
- * after: function(response) {
332
+ * after: (response) => {
333
333
  * if (!response.ssl) {
334
334
  * response.ssl = true;
335
335
  * }
@@ -344,7 +344,7 @@ export interface RequestParameters {
344
344
  * urls: featureLayer.url,
345
345
  * // set the error function and check if an error occurs, and if it's name is "AbortError"
346
346
  * // if so, display a useful error about the layer, if not, ignore the error
347
- * error: function(error) {
347
+ * error: (error) => {
348
348
  * if (error.name == "AbortError") {
349
349
  * // we're only interested in aborted request errors
350
350
  * console.error(`An error happened with layer ${featureLayer.title}`, error);
@@ -415,7 +415,7 @@ export interface RequestInterceptor {
415
415
  * // use the AfterInterceptorCallback to check if `ssl` is set to 'true'
416
416
  * // on the response to the request, if it's set to 'false', change
417
417
  * // the value to 'true' before returning the response
418
- * after: function(response) {
418
+ * after: (response) => {
419
419
  * if (!response.ssl) {
420
420
  * response.ssl = true;
421
421
  * }
@@ -447,7 +447,7 @@ export type AfterInterceptorCallback = (response: RequestResponse<any>) => void;
447
447
  * // use the BeforeInterceptorCallback to check if the query of the
448
448
  * // FeatureLayer has a maxAllowableOffset property set.
449
449
  * // if so, then set the maxAllowableOffset to 0
450
- * before: function(params) {
450
+ * before: (params) => {
451
451
  * if (params.requestOptions.query.maxAllowableOffset) {
452
452
  * params.requestOptions.query.maxAllowableOffset = 0;
453
453
  * }
@@ -459,22 +459,20 @@ export type AfterInterceptorCallback = (response: RequestResponse<any>) => void;
459
459
  *
460
460
  * esriConfig.request.interceptors.push({
461
461
  * urls: wmsLayerUrl,
462
- * before: function(params) {
462
+ * before: (params) => {
463
463
  * if (params.url === url && params.requestOptions.responseType === "xml") {
464
- * if ("fetch" in window && "TextDecoder" in window) {
465
- * // decode the response as ISO-8859-1 if it's not UTF-8 as expected
466
- * return fetch(url + "?SERVICE=WMS&REQUEST=GetCapabilities")
467
- * .then(function(response) {
468
- * return response.arrayBuffer();
469
- * })
470
- * .then(function(buffer) {
471
- * let textDecoder = new TextDecoder("ISO-8859-1"); // specified in the Capabilities XML declaration
472
- * let xmlText = textDecoder.decode(buffer);
473
- * let parser = new DOMParser();
474
- * xml = parser.parseFromString(xmlText, "application/xml");
475
- * return xml;
476
- * });
477
- * }
464
+ * // decode the response as ISO-8859-1 if it's not UTF-8 as expected
465
+ * return fetch(url + "?SERVICE=WMS&REQUEST=GetCapabilities")
466
+ * .then((response) => {
467
+ * return response.arrayBuffer();
468
+ * })
469
+ * .then((buffer) => {
470
+ * let textDecoder = new TextDecoder("ISO-8859-1"); // specified in the Capabilities XML declaration
471
+ * let xmlText = textDecoder.decode(buffer);
472
+ * let parser = new DOMParser();
473
+ * let xml = parser.parseFromString(xmlText, "application/xml");
474
+ * return xml;
475
+ * });
478
476
  * }
479
477
  * }
480
478
  * });
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const b="20260604",e="1d6241124e5dc6b58abb6b20420de1f8890f426e";export{b as buildDate,e as commitHash};
2
+ const e="20260605",a="1e7d96b14f488db2eaa3af7bae6309340c9199e7";export{e as buildDate,a as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{px2pt as n,pt2px as o}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{fromValues as l,empty as h,expandPointInPlace as c,center as m,width as f,height as u,diagonal as d,create as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isPolygon as P,isPolyline as S,isExtent as x,isMultipoint as w,isPoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import U from"./Rect.js";import F from"./TextRasterizer.js";import{getNumericValue as A,isSVGImage as j,getRelativeGradientSize as G,getEffectsInflateSize as D,fromCIMFontDecoration as H,fromCIMFontStyle as E,fromCIMHorizontalAlignment as B,fromCIMVerticalAlignment as X,getFillColor as J,getStrokeColor as N,getStrokeWidth as O,getFontWeight as q,getFontStyle as V,isCIMFill as W,getSize as Y}from"./utils.js";import{destroyHiddenSvg as K,createHiddenSvg as $,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Z,glyphSize as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as st}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as nt}from"../../views/2d/layers/graphics/graphicsUtils.js";const ot=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,n=s[0]*i[0]+s[3]*i[1],o=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=n,m[1]=o,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new ht([i,n,r,o,a,s])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this.geomUnitsPerPoint(),s=null,i=D(t),n=!1;let o=new b(a.fromJSONCIM(e));for(const a of t){const t=T(a);t&&(o=t.execute(o,a,{geomUnitsPerPoint:r,tileKey:s,maxInflateSize:i,scale:null,spatialReference:e.spatialReference,preventClipping:n}))}return o}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const n=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(M(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(S(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=A(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,n=r.height;if(!i||!n)return;const o=i/n,a=A(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*o*a,r*=s),l.translate(-e,-r)}let c=A(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*ot);let m=A(t.offsetX),f=A(t.offsetY);if(m||f){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=A(t.size,I.CIMVectorMarker.size),i=t.frame,n=i?i.ymax-i.ymin:0,o=s&&n?s/n:1,a=ht.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=o,r/=o),a.translate(-e,-r)}1!==o&&a.scale(o,o);let h=A(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*ot);let c=A(t.offsetX),m=A(t.offsetY);if(c||m){if(this._mapRotation){const t=ot*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!M(e))return;if(A(t.height,I.CIMTextSymbol.height)<=0)return;const s=ht.createIdentity();let i=A(t.angle);i=-i,i&&s.rotate(i*ot);const n=A(t.offsetX),o=A(t.offsetY);(n||o)&&s.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(x(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(A(r,I.CIMSolidStroke.width)),.5*at);if(P(t))this._processPath(t.rings,s);else if(S(t))this._processPath(t.paths,s);else if(x(t)){const e=yt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=A(t.scaleX,1);let i=s*e,n=e;const o=this._resourceManager.getResource(r);if(null!=o){const t=o.height/o.width;i=s*(e?t>1?e:e/t:o.width),n=e?t>1?e*t:e:o.height}this._merge(this.transformPt([-i/2,-n/2]),0),this._merge(this.transformPt([-i/2,n/2]),0),this._merge(this.transformPt([i/2,-n/2]),0),this._merge(this.transformPt([i/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=n(s),i=n(i);const o=this.transformSize(1)*this.reverseTransformScalar(1);s*=o,i*=o;const a=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,l=t.verticalAlignment??I.CIMTextSymbol.verticalalignment;let h=0;switch(a){case"Left":h=s/2;break;case"Right":h=-s/2}let c=0;switch(l){case"Bottom":c=i/2;break;case"Top":c=-i/2;break;case"Baseline":c=i/6}this._merge(this.transformPt([-s/2+h,-i/2+c]),0),this._merge(this.transformPt([-s/2+h,i/2+c]),0),this._merge(this.transformPt([s/2+h,-i/2+c]),0),this._merge(this.transformPt([s/2+h,i/2+c]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=K(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*o(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type);if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=n(et*window.devicePixelRatio),r=n(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(W))&&"CIMMeshSymbol"!==e?.type&&(Y(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,n,o){null!=o?this._hittestSvgPath(t,o,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=A(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const n=e*this.geomUnitsPerPoint(),o=n*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<o/2+e&&Math.abs(t[1])<n/2+e&&(this._earlyReturn=!0)}else{const t=o/2,e=n/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=it(A(t.height,I.CIMTextSymbol.height)),{lineGapType:n,lineGap:o}=t,a=n?Pt(n,A(o),i):0,l=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,h=t.verticalAlignment??I.CIMTextSymbol.verticalalignment,c="CIMBackgroundCallout"===t.callout?.type,m=st(s.glyphMosaicItems,{scale:i/tt,angle:0,xOffset:0,yOffset:0,horizontalAlignment:l,verticalAlignment:h,maxLineWidth:nt(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:c});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of m.glyphs){const[t,i]=s.offsets.topLeft,[n,o]=s.offsets.bottomRight;if(e>t&&e<n&&r>-o&&r<-i){this._earlyReturn=!0;break}}}else for(const f of m.glyphs){const[t,e]=f.offsets.topLeft,[r,s]=f.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(x(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(gt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=g();p(i,t);const n={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute("d",e);const a=o.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let o=Math.max(a.width/n.width,a.height/n.height),l=1;const h=2*t*o;h<1&&(l=2/h,o*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*o/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(o/l),m.stroke(f));const u=(n.width*o-a.width)/2,d=(n.height*o-a.height)/2,g=Math.floor((i[0]-n.x-t)*o-u+c),p=Math.floor((n.height-(i[1]-n.y)-t)*o+d+c),_=Math.ceil(2*t*o),y=Math.ceil(2*t*o),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[n.x,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height],[n.x+n.width,n.y],[n.x,n.y]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(x(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}if("point"===this._hittestType){pt(this.reverseTransformPt(this._searchTarget[0]),r,A(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class ut extends ct{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(x(t))this._buildPath(yt(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,n){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!x(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const o=this._ctx;o.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(s),this._setJoinStyle(i),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!x(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,n=A(t.scaleX,1),o=this._resourceManager.getResource(s);if(null==o)return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const h=j(s)||"src"in o&&j(o.src);let c="getFrame"in o?R(o):o;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:n*d*f,m12:n*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t,this.transformSize(n(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:o,anchorY:a,canvas:l}=s,h=i[0]*(o+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(x(t))this._buildPath(yt(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=j(h)||"src"in c&&j(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);o||(o=0),i?i*=t:i=0,n?n*=t:n=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==o||1!==e||1!==r||0!==i||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(i,n).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!x(t))return w(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=j(h)||"src"in m&&j(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(o(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(i),this._setJoinStyle(n),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let o of f)if(o=e(o),wt(o),o&&!(o.length<=1)){M=this.transformPt(o[0]);for(let t=1;t<o.length;t++){b=this.transformPt(o[t]);const e=_t(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!x(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:n,gradientSize:a,gradientSizeUnits:l}=e,g=I.CIMGradientFill,p=e.gradientType??g.gradientType,_=-s(i??0),y=h();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==n&&"Rectangular"!==n||(t=z(t,-_)),c(y,t)}}const[w,M,b,k]=y,T=this._ctx;switch(T.save(),n){case"Buffered":lt().error(`Gradient method "${n}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(o(a)):G(a,g.gradientSize)*(b-w),[s,i]="Discrete"===p?[b,b-r]:[w+r,w],n=z([s,t],_),h=z([i,t],_),c=T.createLinearGradient(n[0],n[1],h[0],h[1]);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Circular":{const t=m(y),r=d(y)/2,s="Absolute"===l?this.transformSize(o(a)):G(a,g.gradientSize)*r,[i,n]="Discrete"===p?[r,r-s]:[s,0],h=T.createRadialGradient(t[0],t[1],i,t[0],t[1],n);L(h,e),T.fillStyle=h,T.fill("evenodd");break}case"Rectangular":{const r=m(y),s=r[0],i=r[1],n=z(r,_),h=(r,s,i,o,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(n[0],n[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(n[0],n[1]),T.clip();const u=z([r,s],_),d=z([i,o],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let c="Absolute"===l?this.transformSize(o(a)):G(a,g.gradientSize)*(f(y)/2),[d,P]="Discrete"===p?[b,b-c]:[s+c,s];h(d,i,P,i,b,M,b,k),[d,P]="Discrete"===p?[w,w+c]:[s-c,s],h(d,i,P,i,w,k,w,M),c="Absolute"===l?this.transformSize(o(a)):G(a,g.gradientSize)*(u(y)/2);let[S,x]="Discrete"===p?[k,k-c]:[i+c,i];h(s,S,s,x,b,k,w,k),[S,x]="Discrete"===p?[M,M+c]:[i-c,i],h(s,S,s,x,w,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:n,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!x(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(o(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(o(n)):G(n,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const n=p[0]-g[0],o=p[1]-g[1],a=Math.sqrt(n*n+o*o);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([n/a,o/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=n/a,r=o/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return lt().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function dt(t,e,r){let s=A(t.separation,I.CIMHatchFill.separation)*r,i=A(t.rotation);if(0===s)return null;s<0&&(s=-s);let n=0;const o=.5*s;for(;n>o;)n-=s;for(;n<-o;)n+=s;const a=g();p(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const h=Math.cos(i*ot),c=Math.sin(i*ot),m=-s*c,f=s*h;let u,d,_,y;n=A(t.offsetX)*r*c-A(t.offsetY)*r*h,u=_=Number.MAX_VALUE,d=y=-Number.MAX_VALUE;for(const g of l){const t=g[0],e=g[1],r=h*t+c*e,s=-c*t+h*e;u=Math.min(u,r),_=Math.min(_,s),d=Math.max(d,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=h*u-c*_-m*n/s,S=c*u+h*_-f*n/s,x=h*d-c*_-m*n/s,w=c*d+h*_-f*n/s;const M=1+Math.round((y-_)/s),b=[];for(let g=0;g<M;g++)P+=m,S+=f,x+=m,w+=f,b.push([[P,S],[x,w]]);return{paths:b}}function gt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];if(e[1]>t[1]==n[1]>t[1])continue;(n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];let o=(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]);if(0===o)continue;o=Math.sqrt(o);const a=((n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0]))/o;if(Math.abs(a)<r){const s=((n[0]-e[0])*(t[0]-e[0])+(n[1]-e[1])*(t[1]-e[1]))/o;if(s>-r&&s<o+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const s=H(e),i=E(e.fontStyleName),n=e.fontFamilyName??t,{weight:o,style:a}=i,l=r*(e.height||5),h=B(e.horizontalAlignment),c=X(e.verticalAlignment),m=J(e),f=J(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=N(e.symbol),g=r*(O(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=J(p),y=O(p),P=N(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:n,style:V(a),weight:q(o),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const xt=1e-4;function wt(t){let e,r,s,i,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],r=t[a][1]-o[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=xt?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),s=i}function Mt(t){const e=1e-6,r=t[0],s=t[t.length-1];return Math.abs(r[0]-s[0])<=e&&Math.abs(r[1]-s[1])<=e}function bt(t,e){t.length>1&&!Mt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(gt(e,[t]))return!0;if(Mt(s))for(const r of t)if(gt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],n=t[(e+1)%t.length];if(y(r,i,s,n))return!0}}}return!1}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,ot as cDegToRad,Pt as lineGapType2LineHeight};
2
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as i}from"../../core/mathUtils.js";import s from"../../core/ObjectPool.js";import{px2pt as n,pt2px as a}from"../../core/screenUtils.js";import{GeometryCursor as o}from"../../geometry/GeometryCursor.js";import{fromValues as l,empty as h,expandPointInPlace as c,center as m,width as f,height as u,diagonal as d,create as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isPolygon as P,isPolyline as S,isExtent as x,isMultipoint as w,isPoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import T from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as k,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import U from"./Rect.js";import F from"./TextRasterizer.js";import{getNumericValue as A,isSVGImage as j,getRelativeGradientSize as D,getEffectsInflateSize as G,fromCIMFontDecoration as H,fromCIMFontStyle as E,fromCIMHorizontalAlignment as B,fromCIMVerticalAlignment as X,getFillColor as J,getStrokeColor as N,getStrokeWidth as O,getFontWeight as q,getFontStyle as V,isCIMFill as Y,getSize as W}from"./utils.js";import{destroyHiddenSvg as K,createHiddenSvg as $,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Z,glyphSize as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as st,getLineWidth as nt}from"../../views/2d/layers/graphics/graphicsUtils.js";const at=Math.PI/180,ot=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const i=t._t,s=e._t,n=i[0]*s[0]+i[3]*s[1],a=i[1]*s[0]+i[4]*s[1],o=i[2]*s[0]+i[5]*s[1]+s[2],l=i[0]*s[3]+i[3]*s[4],h=i[1]*s[3]+i[4]*s[4],c=i[2]*s[3]+i[5]*s[4]+s[5],m=r._t;return m[0]=n,m[1]=a,m[2]=o,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,n=-t[1]*e,a=-t[3]*e,o=t[0]*e;return new ht([s,n,r,a,o,i])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._textScaling=[],this._geomUnitsPerPoint=1,this._placementPool=new s(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1),this._textScaling.push(1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)],this._textScaling=[1]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}scaleText(t){return t*this._textScaling[this._textScaling.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}reverseScaleText(t){return t/this._textScaling[this._textScaling.length-1]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e=!1,r=1){const i=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i),this._textScaling.push(this._textScaling[this._textScaling.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1),this._textScaling.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this.geomUnitsPerPoint(),i=null,s=G(t),n=!1;let a=new b(o.fromJSONCIM(e));for(const o of t){const t=k(o);t&&(a=t.execute(a,o,{geomUnitsPerPoint:r,tileKey:i,maxInflateSize:s,scale:null,spatialReference:e.spatialReference,preventClipping:n}))}return a}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const i=t[r];if(!i||!1===i.enable)continue;const s=i.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const i=C(r);if(i){const s="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;s&&this.pushClipPath(e);const n=i.execute(o.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}s&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(M(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(P(e)){const i=_(e);i&&([r.tx,r.ty]=i,this.drawMarker(t,r))}else if(S(e)){for(const i of e.paths)for(const e of i)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const i of e.points)if(r.tx=i[0],r.ty=i[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),i=A(t.size,I.CIMPictureMarker.size);if(null==r||i<=0)return;const s=r.width,n=r.height;if(!s||!n)return;const a=s/n,o=A(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=i*a*o,r*=i),l.translate(-e,-r)}let c=A(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*at);let m=A(t.offsetX),f=A(t.offsetY);if(m||f){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=m*r+f*e;m=m*e-f*r,f=i}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const i=A(t.size,I.CIMVectorMarker.size),s=t.frame,n=s?s.ymax-s.ymin:0,a=i&&n?i/n:1,o=ht.createIdentity();s&&o.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?s&&(e*=s.xmax-s.xmin,r*=s.ymax-s.ymin):(e/=a,r/=a),o.translate(-e,-r)}1!==a&&o.scale(a,a);let h=A(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&o.rotate(h*at);let c=A(t.offsetX),m=A(t.offsetY);if(c||m){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),i=c*r+m*e;c=c*e-m*r,m=i}o.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&o.scale(f,f);const u=e.getAngle();u&&o.rotate(u),o.translate(e.tx,e.ty);const d=t.scaleSymbolsProportionally?1:a;this.push(o,t.scaleSymbolsProportionally,d);for(const g of r){g?.symbol&&g.geometry||lt().error("Invalid marker graphic",g);let t=g.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(g.symbol,g.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!M(e))return;if(A(t.height,I.CIMTextSymbol.height)<=0)return;const i=ht.createIdentity();let s=A(t.angle);s=-s,s&&i.rotate(s*at);const n=A(t.offsetX),a=A(t.offsetY);(n||a)&&i.translate(n,a);const o=this.geomUnitsPerPoint();1!==o&&i.scale(o,o),i.translate(e.x,e.y),this.push(i),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return l(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(P(t))this._processPath(t.rings,0);else if(S(t))this._processPath(t.paths,0);else if(x(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const i=Math.max(.5*this.transformSize(A(r,I.CIMSolidStroke.width)),.5*ot);if(P(t))this._processPath(t.rings,i);else if(S(t))this._processPath(t.paths,i);else if(x(t)){const e=yt(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){P(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1);let s=i*e,n=e;const a=this._resourceManager.getResource(r);if(null!=a){const t=a.height/a.width;s=i*(e?t>1?e:e/t:a.width),n=e?t>1?e*t:e:a.height}this._merge(this.transformPt([-s/2,-n/2]),0),this._merge(this.transformPt([-s/2,n/2]),0),this._merge(this.transformPt([s/2,-n/2]),0),this._merge(this.transformPt([s/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t);let[i,s]=this._textRasterizer.computeTextSize(e,r);i=n(i),s=n(s);const a=this.transformSize(1)*this.reverseTransformScalar(1);i*=a,s*=a;const o=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,l=t.verticalAlignment??I.CIMTextSymbol.verticalalignment;let h=0;switch(o){case"Left":h=i/2;break;case"Right":h=-i/2}let c=0;switch(l){case"Bottom":c=s/2;break;case"Top":c=-s/2;break;case"Baseline":c=s/6}this._merge(this.transformPt([-i/2+h,-s/2+c]),0),this._merge(this.transformPt([-i/2+h,s/2+c]),0),this._merge(this.transformPt([i/2+h,-s/2+c]),0),this._merge(this.transformPt([i/2+h,s/2+c]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(r[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=K(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,i){const{textInfo:s,mapRotation:o,resolution:l,searchDist:h,hittestType:c,isScreenAligned:m}=i;this._resetHittest();const f=l*a(1);switch(this.setGeomUnitsPerPoint(f),c){case"point":if(1!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=h/2/f,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}if(this._textInfo=s,this._mapRotation=m?o:0,!has("esri-mobile")){const t=n(et*window.devicePixelRatio),r=n(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(Y))&&"CIMMeshSymbol"!==e?.type&&(W(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,i,s,n,a){null!=a?this._hittestSvgPath(t,a,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}drawTextSymbol(t,e,r){if(!t||!M(e))return;if(A(t.height,I.CIMTextSymbol.height)<=0)return;const i=ht.createIdentity(),s=this.geomUnitsPerPoint();1!==s&&i.scale(s,s),i.translate(e.x,e.y),this.push(i),this.drawText(t,r),this.pop()}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,i=A(t.scaleX,1),s=this._resourceManager.getResource(r);if(null==s||0===s.height||0===e)return;const n=e*this.geomUnitsPerPoint(),a=n*i*(s.width/s.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<a/2+e&&Math.abs(t[1])<n/2+e&&(this._earlyReturn=!0)}else{const t=a/2,e=n/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const i=r.get(t);if(!i)return;if(!i.glyphMosaicItems.glyphs.length)return;const s=st(A(t.height,I.CIMTextSymbol.height)),{lineGapType:n,lineGap:a}=t,o=n?Pt(n,A(a),s):0,l=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,h=t.verticalAlignment??I.CIMTextSymbol.verticalalignment,c="CIMBackgroundCallout"===t.callout?.type,m=it(i.glyphMosaicItems,{scale:s/tt,angle:A(t.angle),xOffset:A(t.offsetX),yOffset:A(t.offsetY),horizontalAlignment:l,verticalAlignment:h,maxLineWidth:nt(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(o||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!1,hasBackground:c}),f=this.reverseScaleText(1);for(const u of m.glyphs){const t=u.offsets,e=[[t.topLeft[0]*f,-t.topLeft[1]*f],[t.topRight[0]*f,-t.topRight[1]*f],[t.bottomRight[0]*f,-t.bottomRight[1]*f],[t.bottomLeft[0]*f,-t.bottomLeft[1]*f],[t.topLeft[0]*f,-t.topLeft[1]*f]];if("point"===this._hittestType){gt(this.reverseTransformPt(this._searchTarget[0]),[e])&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[e])&&(this._earlyReturn=!0)}}}_hitTestFill(t){let e=null;if(x(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(P(t))e=t.rings;else{if(!S(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(gt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=$(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,i=0){const s=g();p(s,t);const n={x:s[0],y:s[1],width:s[2]-s[0],height:s[3]-s[1]},a=this._getSvgPath();a.setAttribute("d",e);const o=a.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),s=this.reverseTransformPt(this._searchTarget[0]);let a=Math.max(o.width/n.width,o.height/n.height),l=1;const h=2*t*a;h<1&&(l=2/h,a*=l,o.x*=l,o.y*=l,o.width*=l,o.height*=l);const c=1+i*a/2,m=this._getCanvasContext(o.width+2*c,o.height+2*c);m.setTransform(l,0,0,l,-o.x+c,-o.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=i*(a/l),m.stroke(f));const u=(n.width*a-o.width)/2,d=(n.height*a-o.height)/2,g=Math.floor((s[0]-n.x-t)*a-u+c),p=Math.floor((n.height-(s[1]-n.y)-t)*a+d+c),_=Math.ceil(2*t*a),y=Math.ceil(2*t*a),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[n.x,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height],[n.x+n.width,n.y],[n.x,n.y]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(x(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(P(t))r=t.rings;else{if(!S(t))return;r=t.paths}if("point"===this._hittestType){pt(this.reverseTransformPt(this._searchTarget[0]),r,A(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class ut extends ct{constructor(t,e,r,i){super(e,r),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new T,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(x(t))this._buildPath(yt(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,i,s,n){if(!t||!e||0===r)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!1);else{if(!x(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const a=this._ctx;a.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(r),ot),this._setCapStyle(i),this._setJoinStyle(s),a.miterLimit=n,a.stroke()}pushClipPath(t){if(this._ctx.save(),P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else{if(!x(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:i,tintColor:s}=t,n=A(t.scaleX,1),a=this._resourceManager.getResource(i);if(null==a)return;let o=e*(a.width/a.height),l=e;e||(o=a.width,l=a.height);const h=j(i)||"src"in a&&j(a.src);let c="getFrame"in a?R(a):a;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:n*d*f,m12:n*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-o/2,-l/2,o,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=St(t,this.transformSize(n(1))),i=this._textRasterizer.rasterizeText(e,r);if(!i)return;const{size:s,anchorX:a,anchorY:o,canvas:l}=i,h=s[0]*(a+.5),c=s[1]*(o-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:i,offsetX:s,offsetY:n,rotation:a,scaleX:o,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(P(t))this._buildPath(t.rings,!0);else if(S(t))this._buildPath(t.paths,!0);else if(x(t))this._buildPath(yt(t).rings,!0);else{if(!w(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=j(h)||"src"in c&&j(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);a||(a=0),s?s*=t:s=0,n?n*=t:n=0,i&&(i*=t);const e=i?i/c.height:1,r=o&&i?o*i/c.width:1;if(0!==a||1!==e||1!==r||0!==s||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-a).translateSelf(s,n).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:i,capStyle:s,joinStyle:n,miterLimit:o,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(P(t))f=t.rings;else if(S(t))f=t.paths;else{if(!x(t))return w(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=j(h)||"src"in m&&j(m.src);let d="getFrame"in m?R(m):m;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(a(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let M,b;_.save(),this._setCapStyle(s),this._setJoinStyle(n),void 0!==o&&(_.miterLimit=o),_.lineWidth=g;for(let a of f)if(a=e(a),wt(a),a&&!(a.length<=1)){M=this.transformPt(a[0]);for(let t=1;t<a.length;t++){b=this.transformPt(a[t]);const e=_t(M,b),r=new DOMMatrix;r.translateSelf(0,M[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(M[0],M[1]),_.lineTo(b[0],b[1]),_.stroke(),M=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(P(t))r=t.rings;else if(S(t))r=t.paths;else{if(!x(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:s,gradientMethod:n,gradientSize:o,gradientSizeUnits:l}=e,g=I.CIMGradientFill,p=e.gradientType??g.gradientType,_=-i(s??0),y=h();for(const i of r){const t=i?i.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(i[e]);"Linear"!==n&&"Rectangular"!==n||(t=z(t,-_)),c(y,t)}}const[w,M,b,T]=y,k=this._ctx;switch(k.save(),n){case"Buffered":lt().error(`Gradient method "${n}" currently unsupported.`);break;case"Linear":{const t=(M+T)/2,r="Absolute"===l?this.transformSize(a(o)):D(o,g.gradientSize)*(b-w),[i,s]="Discrete"===p?[b,b-r]:[w+r,w],n=z([i,t],_),h=z([s,t],_),c=k.createLinearGradient(n[0],n[1],h[0],h[1]);L(c,e),k.fillStyle=c,k.fill("evenodd");break}case"Circular":{const t=m(y),r=d(y)/2,i="Absolute"===l?this.transformSize(a(o)):D(o,g.gradientSize)*r,[s,n]="Discrete"===p?[r,r-i]:[i,0],h=k.createRadialGradient(t[0],t[1],s,t[0],t[1],n);L(h,e),k.fillStyle=h,k.fill("evenodd");break}case"Rectangular":{const r=m(y),i=r[0],s=r[1],n=z(r,_),h=(r,i,s,a,o,l,h,c)=>{k.save(),this.pushClipPath(t);const m=z([o,l],_),f=z([h,c],_);k.beginPath(),k.moveTo(n[0],n[1]),k.lineTo(m[0],m[1]),k.lineTo(f[0],f[1]),k.lineTo(n[0],n[1]),k.clip();const u=z([r,i],_),d=z([s,a],_),g=k.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),k.fillStyle=g,k.fill("evenodd"),k.restore()};let c="Absolute"===l?this.transformSize(a(o)):D(o,g.gradientSize)*(f(y)/2),[d,P]="Discrete"===p?[b,b-c]:[i+c,i];h(d,s,P,s,b,M,b,T),[d,P]="Discrete"===p?[w,w+c]:[i-c,i],h(d,s,P,s,w,T,w,M),c="Absolute"===l?this.transformSize(a(o)):D(o,g.gradientSize)*(u(y)/2);let[S,x]="Discrete"===p?[T,T-c]:[s+c,s];h(i,S,i,x,b,T,w,T),[S,x]="Discrete"===p?[M,M+c]:[s-c,s],h(i,S,i,x,w,M,b,M);break}}k.restore()}drawGradientStroke(t,r){const{capStyle:i,gradientMethod:s,gradientSize:n,gradientSizeUnits:o,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(P(t))m=t.rings;else if(S(t))m=t.paths;else{if(!x(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(a(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(i),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),wt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],i=p[1]-g[1];t+=Math.sqrt(r*r+i*i),g=p}const i="Absolute"===o?this.transformSize(a(n)):D(n,I.CIMGradientStroke.gradientSize)*("AcrossLine"===s?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const n=p[0]-g[0],a=p[1]-g[1],o=Math.sqrt(n*n+a*a);let h,c,m,y;switch(s){case"AcrossLine":{const[t,e]=z([n/o,a/o],-Math.PI/2),r=u/2,s="Discrete"===f?r:i-r;h=(g[0]+p[0])/2+t*s,c=(g[1]+p[1])/2+e*s,m=h-t*i,y=c-e*i;break}case"AlongLine":{const e=n/o,r=a/o;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*i,y=c+r*i):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*i,c=y-r*i);break}default:return lt().error("Unrecognized gradient method:",s),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=o,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let s=this.transformPt(i[0]);r.moveTo(s[0],s[1]);for(let e=1;e<t;e++)s=this.transformPt(i[e]),r.lineTo(s[0],s[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function dt(t,e,r){let i=A(t.separation,I.CIMHatchFill.separation)*r,s=A(t.rotation);if(0===i)return null;i<0&&(i=-i);let n=0;const a=.5*i;for(;n>a;)n-=i;for(;n<-a;)n+=i;const o=g();p(o,e),o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a;const l=[[o[0],o[1]],[o[0],o[3]],[o[2],o[3]],[o[2],o[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const h=Math.cos(s*at),c=Math.sin(s*at),m=-i*c,f=i*h;let u,d,_,y;n=A(t.offsetX)*r*c-A(t.offsetY)*r*h,u=_=Number.MAX_VALUE,d=y=-Number.MAX_VALUE;for(const g of l){const t=g[0],e=g[1],r=h*t+c*e,i=-c*t+h*e;u=Math.min(u,r),_=Math.min(_,i),d=Math.max(d,r),y=Math.max(y,i)}_=Math.floor(_/i)*i;let P=h*u-c*_-m*n/i,S=c*u+h*_-f*n/i,x=h*d-c*_-m*n/i,w=c*d+h*_-f*n/i;const M=1+Math.round((y-_)/i),b=[];for(let g=0;g<M;g++)P+=m,S+=f,x+=m,w+=f,b.push([[P,S],[x,w]]);return{paths:b}}function gt(t,e){let r=0;for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],n=i[s];if(e[1]>t[1]==n[1]>t[1])continue;(n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const i of e){const e=i.length;for(let s=1;s<e;s++){const e=i[s-1],n=i[s];let a=(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]);if(0===a)continue;a=Math.sqrt(a);const o=((n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0]))/a;if(Math.abs(o)<r){const i=((n[0]-e[0])*(t[0]-e[0])+(n[1]-e[1])*(t[1]-e[1]))/a;if(i>-r&&i<a+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const i=H(e),s=E(e.fontStyleName),n=e.fontFamilyName??t,{weight:a,style:o}=s,l=r*(e.height||5),h=B(e.horizontalAlignment),c=X(e.verticalAlignment),m=J(e),f=J(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=N(e.symbol),g=r*(O(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=J(p),y=O(p),P=N(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:n,style:V(o),weight:q(a),decoration:i},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:o},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const xt=1e-4;function wt(t){let e,r,i,s,n,a=t[0],o=1;for(;o<t.length;)e=t[o][0]-a[0],r=t[o][1]-a[1],s=0!==e?r/e:Math.PI/2,void 0!==i&&Math.abs(s-i)<=xt?(t.splice(o-1,1),a=n):(n=a,a=t[o],o++),i=s}function Mt(t){const e=1e-6,r=t[0],i=t[t.length-1];return Math.abs(r[0]-i[0])<=e&&Math.abs(r[1]-i[1])<=e}function bt(t,e){t.length>1&&!Mt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const i=e[r],s=i.length;for(const e of i)if(gt(e,[t]))return!0;if(Mt(i))for(const r of t)if(gt(r,e))return!0;for(let e=1;e<s;e++){const r=i[e-1],s=i[e];for(let e=0;e<t.length;e++){const i=t[e],n=t[(e+1)%t.length];if(y(r,s,i,n))return!0}}}return!1}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,at as cDegToRad,Pt as lineGapType2LineHeight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,input as o,ComputeVertexInput as l}from"../../GraphShaderModule.js";import{Vec2 as r,Float as a,Vec4 as n,ifElse as d,or as u,Bool as m,mix as p,Mat3 as h,lessThan as c,greaterThan as x,Vec3 as y,distance as f,negate as w,step as g}from"../../graph/glsl.js";import{AAnimatedVertexInput as v,AAnimatedShader as b,getValue as S,AAnimatedFragmentInput as _}from"./AAnimatedShader.js";import{MarkerConstants as V}from"../markers/markerConstants.js";import{noHit as z,trueHit as C}from"../shaders/constants.js";import{isRectHittest as P,hittestScreenRect as N,distPointTriangle as R,xyToBarycentric as k,inTriangle as M,failHittest as q}from"../shaders/hittestUtils.js";import{getBitBool as D}from"../shaders/utils.js";import{getVisualVariableColor as j,getVisualVariableOpacity as F}from"../shaders/vvUtils.js";class T extends v{}t([s(9,r)],T.prototype,"uv",void 0),t([s(10,a)],T.prototype,"angle",void 0);class U extends l{}t([s(11,r)],U.prototype,"offsetNextVertex1",void 0),t([s(12,r)],U.prototype,"offsetNextVertex2",void 0),t([s(13,r)],U.prototype,"textureUVNextVertex1",void 0),t([s(14,r)],U.prototype,"textureUVNextVertex2",void 0);class A extends _{}function I(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class L extends b{constructor(){super(...arguments),this.type="AnimatedMarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=t.uv.divide(this.mosaicInfo.size),{position:s,animationPointer:o,evalParams:l,isOutline:r,unscaledDistanceToPx:c,vvScale:x,strokeWidth:y,scaleSymbolsProportionally:f,scale:w,isSDF:g,baseSize:v,clip:b}=this._vertexPreamble(t,t.angle,t.lineLength||new a(0)),_=this._toNdc(s);let z=S(o,1,l);z=new n(z.rgb.multiply(z.a),z.a);let C=d(D(t.bitset,V.bitset.colorLocked),z,S(o,2,l));C=new n(C.rgb.multiply(C.a),C.a);let P=S(o,3,l);P=new n(P.rgb.multiply(P.a),P.a);const N=S(o,4,l).a,R=S(o,5,l).a,k=j(this,t.id,z,u(D(t.bitset,V.bitset.colorLocked),new m(r))),M=p(k,C,P),q=F(this,t.id),T=p(q,N,R),U=M.multiply(T),A=this.clip(t.id,t.zoomRange).add(b.multiply(2)),I=c.multiply(x);return{glPosition:new n(_,A,1),uv:i,color:U.multiply(new a(1).subtract(r)),outlineColor:U.multiply(r),distanceToPx:I,strokeWidth:y.multiply(p(new a(1),w,f)),isOutline:r,isSDF:g,...this.maybeRunHittest(t,e,{pos:t.pos,size:v,sizeCorrection:new a(1),isMapAligned:new a(1),vvRotationMat3:new h(1,0,0,0,1,0,0,0,1),placementMat3:new h(1,0,0,0,1,0,0,0,1),outlineSize:new a(1),distanceToPx:I,isSDF:g})}}fragment(t){let e=this._getColor(t.uv,{color:t.color,distanceToPx:t.distanceToPx,isSDF:t.isSDF,outlineColor:t.outlineColor,outlineSize:t.strokeWidth});return i.spotlightAnimatedSymbols&&(e=e.add(new n(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:s,pos1:o,pos2:l}=this.computeHittestTriangle(t,e,i),r=P(this.hittestRequest);return d(r,()=>{const{tlbr:t}=this.hittestRequest;return N(s,o,l,t)},()=>{const s=d(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return d(x(s,this.hittestRequest.distance),new a(z),new a(C))})}_hittestSmallMarker(t,e,i){const{position:s,distance:o,smallSymbolDistance:l}=this.hittestRequest,r=o.subtract(l),{viewMat3:a,tileMat3:n}=this.view,d=a.multiply(n).multiply(new y(i.pos,1)).xy,u=i.size.multiply(.5);return f(d,s).subtract(u).add(r)}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t},t.angle,new a(0)).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1},t.angle,new a(0)).position,l=this._vertexPreamble({...t,offset:e.offsetNextVertex2},t.angle,new a(0)).position,r=this.hittestRequest.position,n=this.hittestRequest.distance,u=R(r,s,o,l);return d(x(u,n),u,this._hittestSamples(s,o,l,t,e,i))}_hittestSamples(t,e,i,s,o,l){const{outlineSize:d,isSDF:u,distanceToPx:m}=l,p=this.hittestRequest.position,h=this.hittestRequest.distance,c=k(p.add(new r(w(h),w(h))),t,e,i),x=k(p.add(new r(0,w(h))),t,e,i),y=k(p.add(new r(h,w(h))),t,e,i),f=k(p.add(new r(w(h),0)),t,e,i),v=k(p,t,e,i),b=k(p.add(new r(h,0)),t,e,i),S=k(p.add(new r(w(h),h)),t,e,i),_=k(p.add(new r(0,h)),t,e,i),V=k(p.add(new r(h,h)),t,e,i),z=s.uv.divide(this.mosaicInfo.size),C=o.textureUVNextVertex1.divide(this.mosaicInfo.size),P=o.textureUVNextVertex2.divide(this.mosaicInfo.size),N={color:new n(1,1,1,1),outlineSize:d,outlineColor:new n(1,1,1,1),isSDF:u,distanceToPx:m};let R=new a(0);return R=R.add(M(c).multiply(this._getColor(I(c,z,C,P),N).a)),R=R.add(M(x).multiply(this._getColor(I(x,z,C,P),N).a)),R=R.add(M(y).multiply(this._getColor(I(y,z,C,P),N).a)),R=R.add(M(f).multiply(this._getColor(I(f,z,C,P),N).a)),R=R.add(M(v).multiply(this._getColor(I(v,z,C,P),N).a)),R=R.add(M(b).multiply(this._getColor(I(b,z,C,P),N).a)),R=R.add(M(S).multiply(this._getColor(I(S,z,C,P),N).a)),R=R.add(M(_).multiply(this._getColor(I(_,z,C,P),N).a)),R=R.add(M(V).multiply(this._getColor(I(V,z,C,P),N).a)),g(R,new a(.05)).multiply(q(this.hittestRequest))}}t([e(0,o(T)),e(1,o(U))],L.prototype,"vertex",null),t([e(0,o(A))],L.prototype,"fragment",null);export{A as AnimatedMarkerFragmentInput,L as AnimatedMarkerShader,T as AnimatedMarkerVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{animationDebugFlags as i}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as s,input as o,ComputeVertexInput as l}from"../../GraphShaderModule.js";import{Vec2 as r,Float as a,Vec4 as n,ifElse as d,or as u,Bool as m,mix as p,Mat3 as h,lessThan as c,Vec3 as x,distance as y,greaterThan as w,negate as f}from"../../graph/glsl.js";import{AAnimatedVertexInput as g,AAnimatedShader as v,getValue as b,AAnimatedFragmentInput as S}from"./AAnimatedShader.js";import{MarkerConstants as _}from"../markers/markerConstants.js";import{trueHit as V,noHit as z}from"../shaders/constants.js";import{isRectHittest as C,hittestMarkerScreenRect as P,distPointTriangle as N,xyToBarycentric as k,inTriangle as R}from"../shaders/hittestUtils.js";import{getBitBool as M}from"../shaders/utils.js";import{getVisualVariableColor as D,getVisualVariableOpacity as j}from"../shaders/vvUtils.js";class q extends g{}t([s(9,r)],q.prototype,"uv",void 0),t([s(10,a)],q.prototype,"angle",void 0);class F extends l{}t([s(11,r)],F.prototype,"offsetNextVertex1",void 0),t([s(12,r)],F.prototype,"offsetNextVertex2",void 0),t([s(13,r)],F.prototype,"textureUVNextVertex1",void 0),t([s(14,r)],F.prototype,"textureUVNextVertex2",void 0);class T extends S{}function U(t,e,i,s){return e.multiply(t.x).add(i.multiply(t.y)).add(s.multiply(t.z))}class A extends v{constructor(){super(...arguments),this.type="AnimatedMarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=t.uv.divide(this.mosaicInfo.size),{position:s,animationPointer:o,evalParams:l,isOutline:r,unscaledDistanceToPx:c,vvScale:x,strokeWidth:y,scaleSymbolsProportionally:w,scale:f,isSDF:g,baseSize:v,clip:S}=this._vertexPreamble(t,t.angle,t.lineLength||new a(0)),V=this._toNdc(s);let z=b(o,1,l);z=new n(z.rgb.multiply(z.a),z.a);let C=d(M(t.bitset,_.bitset.colorLocked),z,b(o,2,l));C=new n(C.rgb.multiply(C.a),C.a);let P=b(o,3,l);P=new n(P.rgb.multiply(P.a),P.a);const N=b(o,4,l).a,k=b(o,5,l).a,R=D(this,t.id,z,u(M(t.bitset,_.bitset.colorLocked),new m(r))),q=p(R,C,P),F=j(this,t.id),T=p(F,N,k),U=q.multiply(T),A=this.clip(t.id,t.zoomRange).add(S.multiply(2)),I=c.multiply(x);return{glPosition:new n(V,A,1),uv:i,color:U.multiply(new a(1).subtract(r)),outlineColor:U.multiply(r),distanceToPx:I,strokeWidth:y.multiply(p(new a(1),f,w)),isOutline:r,isSDF:g,...this.maybeRunHittest(t,e,{pos:t.pos,size:v,sizeCorrection:new a(1),isMapAligned:new a(1),vvRotationMat3:new h(1,0,0,0,1,0,0,0,1),placementMat3:new h(1,0,0,0,1,0,0,0,1),outlineSize:new a(1),distanceToPx:I,isSDF:g})}}fragment(t){let e=this._getColor(t.uv,{color:t.color,distanceToPx:t.distanceToPx,isSDF:t.isSDF,outlineColor:t.outlineColor,outlineSize:t.strokeWidth});return i.spotlightAnimatedSymbols&&(e=e.add(new n(0,.3,0,.3))),this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:s,pos1:o,pos2:l}=this.computeHittestTriangle(t,e,i),r=C(this.hittestRequest);return d(r,()=>{const{tlbr:t}=this.hittestRequest;return P(s,o,l,t)},()=>d(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i)))}_hittestSmallMarker(t,e,i){const{position:s,distance:o,smallSymbolDistance:l}=this.hittestRequest,r=o.subtract(l),{viewMat3:n,tileMat3:u}=this.view,m=n.multiply(u).multiply(new x(i.pos,1)).xy,p=i.size.multiply(.5),h=y(m,s).subtract(p).add(r);return d(w(h,this.hittestRequest.distance),new a(z),new a(V))}_hittestMarker(t,e,i){const s=this._vertexPreamble({...t},t.angle,new a(0)).position,o=this._vertexPreamble({...t,offset:e.offsetNextVertex1},t.angle,new a(0)).position,l=this._vertexPreamble({...t,offset:e.offsetNextVertex2},t.angle,new a(0)).position,r=this.hittestRequest.position,n=this.hittestRequest.distance,u=N(r,s,o,l);return d(w(u,n),new a(z),this._hittestSamples(s,o,l,t,e,i))}_hittestSamples(t,e,i,s,o,l){const{outlineSize:u,isSDF:m,distanceToPx:p}=l,h=this.hittestRequest.position,c=this.hittestRequest.distance,x=k(h.add(new r(f(c),f(c))),t,e,i),y=k(h.add(new r(0,f(c))),t,e,i),g=k(h.add(new r(c,f(c))),t,e,i),v=k(h.add(new r(f(c),0)),t,e,i),b=k(h,t,e,i),S=k(h.add(new r(c,0)),t,e,i),_=k(h.add(new r(f(c),c)),t,e,i),C=k(h.add(new r(0,c)),t,e,i),P=k(h.add(new r(c,c)),t,e,i),N=s.uv.divide(this.mosaicInfo.size),M=o.textureUVNextVertex1.divide(this.mosaicInfo.size),D=o.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new n(1,1,1,1),outlineSize:u,outlineColor:new n(1,1,1,1),isSDF:m,distanceToPx:p};let q=new a(0);return q=q.add(R(x).multiply(this._getColor(U(x,N,M,D),j).a)),q=q.add(R(y).multiply(this._getColor(U(y,N,M,D),j).a)),q=q.add(R(g).multiply(this._getColor(U(g,N,M,D),j).a)),q=q.add(R(v).multiply(this._getColor(U(v,N,M,D),j).a)),q=q.add(R(b).multiply(this._getColor(U(b,N,M,D),j).a)),q=q.add(R(S).multiply(this._getColor(U(S,N,M,D),j).a)),q=q.add(R(_).multiply(this._getColor(U(_,N,M,D),j).a)),q=q.add(R(C).multiply(this._getColor(U(C,N,M,D),j).a)),q=q.add(R(P).multiply(this._getColor(U(P,N,M,D),j).a)),d(w(q,new a(.05)),new a(V),new a(z))}}t([e(0,o(q)),e(1,o(F))],A.prototype,"vertex",null),t([e(0,o(T))],A.prototype,"fragment",null);export{T as AnimatedMarkerFragmentInput,A as AnimatedMarkerShader,q as AnimatedMarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{tileSize as o}from"../../../definitions.js";import{location as s,uniform as i,texture as r,define as d,input as l,UniformGroup as n,TextureGroup as a,FragmentOutput as p}from"../../GraphShaderModule.js";import{Float as h,FixedArray as u,Vec4 as c,Sampler2D as m,Mat3 as y,Vec3 as v,texture2D as g,Mat4 as x,step as w,dot as f,max as T}from"../../graph/glsl.js";import{FeatureFragmentInput as A,FeatureVertexInput as D,AFeatureShader as b}from"../shaders/AFeatureShader.js";import{failHittest as C}from"../shaders/hittestUtils.js";import{max4 as j}from"../shaders/utils.js";class V extends D{}t([s(3,h)],V.prototype,"inverseArea",void 0);class F extends A{}class O extends n{}t([i(u.ofType(c,2))],O.prototype,"isActive",void 0),t([i(u.ofType(c,8))],O.prototype,"colors",void 0),t([i(h)],O.prototype,"dotValue",void 0);class R extends n{}t([i(h)],R.prototype,"tileZoomFactor",void 0),t([i(h)],R.prototype,"pixelRatio",void 0),t([i(h)],R.prototype,"tileDotsOverArea",void 0);class S extends a{}t([r(m)],S.prototype,"dotTexture0",void 0),t([r(m)],S.prototype,"dotTexture1",void 0);class _ extends b{constructor(){super(...arguments),this.type="DotDensityPolygonShader"}_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new y(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new v(t.pos,1)),s=this.clip(t.id),i=new c(e.xy,s,1),r=this.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),d=this.storageTextures.getDataDrivenData0(this.getAttributeDataCoords(t.id)).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),l=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),n=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),a=this._dotThreshold(d,this.instance.dotValue,this.draw.tileDotsOverArea),p=t.pos.add(.5).divide(l);return{glPosition:i,color:new c(0,0,0,0),textureCoords:p,thresholds0:n,thresholds1:a}}fragment(t){const e=new p,o=g(this.drawTextures.dotTexture0,t.textureCoords),s=g(this.drawTextures.dotTexture1,t.textureCoords),i=t.thresholds0.subtract(o),r=t.thresholds1.subtract(s);let d;const l=x.fromColumns(this.instance.colors.get(0),this.instance.colors.get(1),this.instance.colors.get(2),this.instance.colors.get(3)),n=x.fromColumns(this.instance.colors.get(4),this.instance.colors.get(5),this.instance.colors.get(6),this.instance.colors.get(7));if(this.blending){const t=w(new h(0),i),e=w(new h(0),r),o=f(t,i).add(f(e,r)),s=w(o,new h(0)),a=new h(1).subtract(s),p=o.add(s),u=i.multiply(t).divide(p),c=r.multiply(e).divide(p),m=l.multiply(u).add(n.multiply(c));d=a.multiply(m)}else{const t=T(j(i),j(r)),e=w(t,new h(0)),o=new h(1).subtract(e),s=w(t,i),a=w(t,r),p=l.multiply(s).add(n.multiply(a));d=o.multiply(p)}return e.fragColor=d,e}hittest(t){return C(this.hittestRequest)}}t([d],_.prototype,"blending",void 0),t([i(O)],_.prototype,"instance",void 0),t([i(R)],_.prototype,"draw",void 0),t([r(S)],_.prototype,"drawTextures",void 0),t([e(0,l(V))],_.prototype,"vertex",null),t([e(0,l(A))],_.prototype,"fragment",null);export{S as DotDensityPolygonDrawTextures,R as DotDensityPolygonDrawUniforms,F as DotDensityPolygonFragmentInput,O as DotDensityPolygonInstanceUniforms,_ as DotDensityPolygonShader,V as DotDensityPolygonVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{tileSize as o}from"../../../definitions.js";import{location as s,uniform as i,texture as r,define as d,input as l,UniformGroup as n,TextureGroup as a,FragmentOutput as p}from"../../GraphShaderModule.js";import{Float as h,FixedArray as c,Vec4 as u,Sampler2D as m,Mat3 as y,Vec3 as v,texture2D as g,Mat4 as x,step as w,dot as f,max as T}from"../../graph/glsl.js";import{FeatureFragmentInput as A,FeatureVertexInput as D,AFeatureShader as b}from"../shaders/AFeatureShader.js";import{noHit as C}from"../shaders/constants.js";import{max4 as j}from"../shaders/utils.js";class V extends D{}t([s(3,h)],V.prototype,"inverseArea",void 0);class F extends A{}class O extends n{}t([i(c.ofType(u,2))],O.prototype,"isActive",void 0),t([i(c.ofType(u,8))],O.prototype,"colors",void 0),t([i(h)],O.prototype,"dotValue",void 0);class S extends n{}t([i(h)],S.prototype,"tileZoomFactor",void 0),t([i(h)],S.prototype,"pixelRatio",void 0),t([i(h)],S.prototype,"tileDotsOverArea",void 0);class _ extends a{}t([r(m)],_.prototype,"dotTexture0",void 0),t([r(m)],_.prototype,"dotTexture1",void 0);class P extends b{constructor(){super(...arguments),this.type="DotDensityPolygonShader"}_dotThreshold(t,e,o){return t.divide(e).divide(o)}vertex(t){const e=new y(2/o,0,0,0,-2/o,0,-1,1,1).multiply(new v(t.pos,1)),s=this.clip(t.id),i=new u(e.xy,s,1),r=this.getVVData(t.id).multiply(this.instance.isActive.get(0)).multiply(t.inverseArea),d=this.storageTextures.getDataDrivenData0(this.getAttributeDataCoords(t.id)).multiply(this.instance.isActive.get(1)).multiply(t.inverseArea),l=this.draw.tileZoomFactor.multiply(o).divide(this.draw.pixelRatio),n=this._dotThreshold(r,this.instance.dotValue,this.draw.tileDotsOverArea),a=this._dotThreshold(d,this.instance.dotValue,this.draw.tileDotsOverArea),p=t.pos.add(.5).divide(l);return{glPosition:i,color:new u(0,0,0,0),textureCoords:p,thresholds0:n,thresholds1:a}}fragment(t){const e=new p,o=g(this.drawTextures.dotTexture0,t.textureCoords),s=g(this.drawTextures.dotTexture1,t.textureCoords),i=t.thresholds0.subtract(o),r=t.thresholds1.subtract(s);let d;const l=x.fromColumns(this.instance.colors.get(0),this.instance.colors.get(1),this.instance.colors.get(2),this.instance.colors.get(3)),n=x.fromColumns(this.instance.colors.get(4),this.instance.colors.get(5),this.instance.colors.get(6),this.instance.colors.get(7));if(this.blending){const t=w(new h(0),i),e=w(new h(0),r),o=f(t,i).add(f(e,r)),s=w(o,new h(0)),a=new h(1).subtract(s),p=o.add(s),c=i.multiply(t).divide(p),u=r.multiply(e).divide(p),m=l.multiply(c).add(n.multiply(u));d=a.multiply(m)}else{const t=T(j(i),j(r)),e=w(t,new h(0)),o=new h(1).subtract(e),s=w(t,i),a=w(t,r),p=l.multiply(s).add(n.multiply(a));d=o.multiply(p)}return e.fragColor=d,e}hittest(t){return new h(C)}}t([d],P.prototype,"blending",void 0),t([i(O)],P.prototype,"instance",void 0),t([i(S)],P.prototype,"draw",void 0),t([r(_)],P.prototype,"drawTextures",void 0),t([e(0,l(V))],P.prototype,"vertex",null),t([e(0,l(A))],P.prototype,"fragment",null);export{_ as DotDensityPolygonDrawTextures,S as DotDensityPolygonDrawUniforms,F as DotDensityPolygonFragmentInput,O as DotDensityPolygonInstanceUniforms,P as DotDensityPolygonShader,V as DotDensityPolygonVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as l,input as r,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec4 as p,Vec2 as n,Float as u,Sampler2D as d,Vec3 as m,min as y,max as h,Mat3 as c,ifElse as x,lessThan as v,greaterThan as w,equal as V,texture2D as f,clamp as S,abs as b,mix as g,distance as C,negate as M,step as z}from"../../graph/glsl.js";import{MarkerConstants as _}from"./markerConstants.js";import{FeatureVertexInput as R,AFeatureShader as j,FeatureFragmentInput as U}from"../shaders/AFeatureShader.js";import{c256ToRad as N,noHit as T,trueHit as D,softEdgeRatio as F}from"../shaders/constants.js";import{isRectHittest as q,hittestScreenRect as O,distPointTriangle as k,xyToBarycentric as A,inTriangle as P,failHittest as I}from"../shaders/hittestUtils.js";import{MosaicInfo as H}from"../shaders/MosaicInfo.js";import{getBit as G,getBitBool as L,rgba2float as B}from"../shaders/utils.js";import{VisualVariableColor as E}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as J}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as K}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as Q}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as X}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as Y}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as Z,getVisualVariableColor as $,getVisualVariableSize as tt,getVisualVariableRotation as et}from"../shaders/vvUtils.js";class it extends R{}t([i(3,p)],it.prototype,"color",void 0),t([i(4,p)],it.prototype,"outlineColor",void 0),t([i(5,n)],it.prototype,"offset",void 0),t([i(6,n)],it.prototype,"textureUV",void 0),t([i(7,p)],it.prototype,"sizing",void 0),t([i(8,u)],it.prototype,"placementAngle",void 0),t([i(9,u)],it.prototype,"sdfDecodeCoeff",void 0),t([i(10,n)],it.prototype,"zoomRange",void 0);class ot extends a{}t([i(11,n)],ot.prototype,"offsetNextVertex1",void 0),t([i(12,n)],ot.prototype,"offsetNextVertex2",void 0),t([i(13,n)],ot.prototype,"textureUVNextVertex1",void 0),t([i(14,n)],ot.prototype,"textureUVNextVertex2",void 0);class st extends U{}function lt(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function rt(t){return t.multiply(t).divide(128)}class at extends j{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=rt(t.sizing.x),o=rt(t.sizing.y),s=rt(t.sizing.z),l=t.placementAngle,r=G(t.bitset,_.bitset.isSDF),a=G(t.bitset,_.bitset.isMapAligned),n=G(t.bitset,_.bitset.scaleSymbolsProportionally),d=L(t.bitset,_.bitset.colorLocked),x=Z(this,t.id),v=$(this,t.id,t.color,d).multiply(x),w=this.view.displayViewScreenMat3.multiply(new m(t.pos.xy,1)),V=tt(this,t.id,s).divide(s),f=i.multiply(V),S=t.offset.xy.multiply(V);let b=o.multiply(n.multiply(V.subtract(1)).add(1));b=y(b,h(f.subtract(.99),new u(0)));const g=h(b,new u(1)),C=y(b,new u(1)),M=c.fromRotation(l.multiply(N)),z=et(this,t.id),R=this._getViewRotationMatrix(a).multiply(z).multiply(M).multiply(new m(S.xy,0)).multiply(this.view.scaleFactor),j=this.clip(t.id,t.zoomRange),U=new p(w.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),F=G(t.bitset,_.bitset.overrideOutlineColor),q=t.sdfDecodeCoeff.multiply(f);return{glPosition:U,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:q,isSDF:r,overrideOutlineColor:F,...this.maybeRunHittest(t,e,{pos:t.pos,size:f,sizeCorrection:V,isMapAligned:a,vvRotationMat3:z,placementMat3:M,outlineSize:g,distanceToPx:q,isSDF:r})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=q(this.hittestRequest);return x(r,()=>{const{tlbr:t}=this.hittestRequest;return O(o,s,l,t)},()=>{const o=x(v(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return x(w(o,this.hittestRequest.distance),new u(T),new u(D))})}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return x(V(e.isSDF,new u(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return f(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=f(this.mosaicTexture,t),o=new u(.5).subtract(B(i)).multiply(e.distanceToPx).multiply(F),s=S(new u(.5).subtract(o),new u(0),new u(1)),l=e.color.multiply(s);let r=e.outlineSize;this.highlight&&(r=h(r,e.overrideOutlineColor.multiply(4)));const a=r.multiply(.5),p=b(o).subtract(a),n=S(new u(.5).subtract(p),new u(0),new u(1)),d=g(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new u(1).subtract(d.a).multiply(l).add(d)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:l}=this.hittestRequest,r=s.subtract(l),{viewMat3:a,tileMat3:p}=this.view,n=a.multiply(p).multiply(new m(i.pos,1)).xy,u=i.size.multiply(.5);return C(n,o).subtract(u).add(r)}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=this.hittestRequest.position,a=this.hittestRequest.distance,p=k(r,o,s,l);return x(w(p,a),p,this._hittestSamples(o,s,l,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:l}=i,r=new m(t.offset.multiply(s),0),a=new m(e.offsetNextVertex1.multiply(s),0),p=new m(e.offsetNextVertex2.multiply(s),0),{viewMat3:n,tileMat3:u}=this.view,d=n.multiply(u).multiply(new m(o,1)),y=this._getViewScreenMatrix(l).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:d.add(y.multiply(r)).xy,pos1:d.add(y.multiply(a)).xy,pos2:d.add(y.multiply(p)).xy}}_hittestSamples(t,e,i,o,s,l){const{outlineSize:r,isSDF:a,distanceToPx:d}=l,m=this.hittestRequest.position,y=this.hittestRequest.distance,h=A(m.add(new n(M(y),M(y))),t,e,i),c=A(m.add(new n(0,M(y))),t,e,i),x=A(m.add(new n(y,M(y))),t,e,i),v=A(m.add(new n(M(y),0)),t,e,i),w=A(m,t,e,i),V=A(m.add(new n(y,0)),t,e,i),f=A(m.add(new n(M(y),y)),t,e,i),S=A(m.add(new n(0,y)),t,e,i),b=A(m.add(new n(y,y)),t,e,i),g=o.textureUV.divide(this.mosaicInfo.size),C=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),R={color:new p(1),outlineColor:new p(1),overrideOutlineColor:new u(1),outlineSize:r,distanceToPx:d,isSDF:a};let j=new u(0);return j=j.add(P(h).multiply(this._getColor(lt(h,g,C,_),R).a)),j=j.add(P(c).multiply(this._getColor(lt(c,g,C,_),R).a)),j=j.add(P(x).multiply(this._getColor(lt(x,g,C,_),R).a)),j=j.add(P(v).multiply(this._getColor(lt(v,g,C,_),R).a)),j=j.add(P(w).multiply(this._getColor(lt(w,g,C,_),R).a)),j=j.add(P(V).multiply(this._getColor(lt(V,g,C,_),R).a)),j=j.add(P(f).multiply(this._getColor(lt(f,g,C,_),R).a)),j=j.add(P(S).multiply(this._getColor(lt(S,g,C,_),R).a)),j=j.add(P(b).multiply(this._getColor(lt(b,g,C,_),R).a)),z(j,new u(.05)).multiply(I(this.hittestRequest))}}t([o(E)],at.prototype,"visualVariableColor",void 0),t([o(J)],at.prototype,"visualVariableOpacity",void 0),t([o(K)],at.prototype,"visualVariableRotation",void 0),t([o(Q)],at.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(W)],at.prototype,"visualVariableSizeScaleStops",void 0),t([o(X)],at.prototype,"visualVariableSizeStops",void 0),t([o(Y)],at.prototype,"visualVariableSizeUnitValue",void 0),t([s(H)],at.prototype,"mosaicInfo",void 0),t([l(d)],at.prototype,"mosaicTexture",void 0),t([e(0,r(it)),e(1,r(ot))],at.prototype,"vertex",null),t([e(0,r(st))],at.prototype,"fragment",null);export{st as MarkerFragmentInput,at as MarkerShader,it as MarkerVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as l,input as r,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec4 as p,Vec2 as n,Float as u,Sampler2D as d,Vec3 as m,min as y,max as h,Mat3 as c,ifElse as x,lessThan as v,equal as w,texture2D as V,clamp as f,abs as S,mix as b,distance as g,greaterThan as C,negate as M}from"../../graph/glsl.js";import{MarkerConstants as z}from"./markerConstants.js";import{FeatureVertexInput as _,AFeatureShader as R,FeatureFragmentInput as j}from"../shaders/AFeatureShader.js";import{c256ToRad as U,softEdgeRatio as N,trueHit as T,noHit as D}from"../shaders/constants.js";import{isRectHittest as F,hittestMarkerScreenRect as q,distPointTriangle as O,xyToBarycentric as k,inTriangle as A}from"../shaders/hittestUtils.js";import{MosaicInfo as P}from"../shaders/MosaicInfo.js";import{getBit as I,getBitBool as H,rgba2float as G}from"../shaders/utils.js";import{VisualVariableColor as L}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as B}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as J}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as K}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Q}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as W}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as X,getVisualVariableColor as Y,getVisualVariableSize as Z,getVisualVariableRotation as $}from"../shaders/vvUtils.js";class tt extends _{}t([i(3,p)],tt.prototype,"color",void 0),t([i(4,p)],tt.prototype,"outlineColor",void 0),t([i(5,n)],tt.prototype,"offset",void 0),t([i(6,n)],tt.prototype,"textureUV",void 0),t([i(7,p)],tt.prototype,"sizing",void 0),t([i(8,u)],tt.prototype,"placementAngle",void 0),t([i(9,u)],tt.prototype,"sdfDecodeCoeff",void 0),t([i(10,n)],tt.prototype,"zoomRange",void 0);class et extends a{}t([i(11,n)],et.prototype,"offsetNextVertex1",void 0),t([i(12,n)],et.prototype,"offsetNextVertex2",void 0),t([i(13,n)],et.prototype,"textureUVNextVertex1",void 0),t([i(14,n)],et.prototype,"textureUVNextVertex2",void 0);class it extends j{}function ot(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function st(t){return t.multiply(t).divide(128)}class lt extends R{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=st(t.sizing.x),o=st(t.sizing.y),s=st(t.sizing.z),l=t.placementAngle,r=I(t.bitset,z.bitset.isSDF),a=I(t.bitset,z.bitset.isMapAligned),n=I(t.bitset,z.bitset.scaleSymbolsProportionally),d=H(t.bitset,z.bitset.colorLocked),x=X(this,t.id),v=Y(this,t.id,t.color,d).multiply(x),w=this.view.displayViewScreenMat3.multiply(new m(t.pos.xy,1)),V=Z(this,t.id,s).divide(s),f=i.multiply(V),S=t.offset.xy.multiply(V);let b=o.multiply(n.multiply(V.subtract(1)).add(1));b=y(b,h(f.subtract(.99),new u(0)));const g=h(b,new u(1)),C=y(b,new u(1)),M=c.fromRotation(l.multiply(U)),_=$(this,t.id),R=this._getViewRotationMatrix(a).multiply(_).multiply(M).multiply(new m(S.xy,0)).multiply(this.view.scaleFactor),j=this.clip(t.id,t.zoomRange),N=new p(w.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),F=I(t.bitset,z.bitset.overrideOutlineColor),q=t.sdfDecodeCoeff.multiply(f);return{glPosition:N,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:q,isSDF:r,overrideOutlineColor:F,...this.maybeRunHittest(t,e,{pos:t.pos,size:f,sizeCorrection:V,isMapAligned:a,vvRotationMat3:_,placementMat3:M,outlineSize:g,distanceToPx:q,isSDF:r})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=F(this.hittestRequest);return x(r,()=>{const{tlbr:t}=this.hittestRequest;return q(o,s,l,t)},()=>x(v(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i)))}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new u(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return x(w(e.isSDF,new u(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return V(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=V(this.mosaicTexture,t),o=new u(.5).subtract(G(i)).multiply(e.distanceToPx).multiply(N),s=f(new u(.5).subtract(o),new u(0),new u(1)),l=e.color.multiply(s);let r=e.outlineSize;this.highlight&&(r=h(r,e.overrideOutlineColor.multiply(4)));const a=r.multiply(.5),p=S(o).subtract(a),n=f(new u(.5).subtract(p),new u(0),new u(1)),d=b(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new u(1).subtract(d.a).multiply(l).add(d)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:l}=this.hittestRequest,r=s.subtract(l),{viewMat3:a,tileMat3:p}=this.view,n=a.multiply(p).multiply(new m(i.pos,1)).xy,d=i.size.multiply(.5),y=g(n,o).subtract(d).add(r);return x(C(y,this.hittestRequest.distance),new u(D),new u(T))}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=this.hittestRequest.position,a=this.hittestRequest.distance,p=O(r,o,s,l);return x(C(p,a),new u(D),this._hittestSamples(o,s,l,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:l}=i,r=new m(t.offset.multiply(s),0),a=new m(e.offsetNextVertex1.multiply(s),0),p=new m(e.offsetNextVertex2.multiply(s),0),{viewMat3:n,tileMat3:u}=this.view,d=n.multiply(u).multiply(new m(o,1)),y=this._getViewScreenMatrix(l).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:d.add(y.multiply(r)).xy,pos1:d.add(y.multiply(a)).xy,pos2:d.add(y.multiply(p)).xy}}_hittestSamples(t,e,i,o,s,l){const{outlineSize:r,isSDF:a,distanceToPx:d}=l,m=this.hittestRequest.position,y=this.hittestRequest.distance,h=k(m.add(new n(M(y),M(y))),t,e,i),c=k(m.add(new n(0,M(y))),t,e,i),v=k(m.add(new n(y,M(y))),t,e,i),w=k(m.add(new n(M(y),0)),t,e,i),V=k(m,t,e,i),f=k(m.add(new n(y,0)),t,e,i),S=k(m.add(new n(M(y),y)),t,e,i),b=k(m.add(new n(0,y)),t,e,i),g=k(m.add(new n(y,y)),t,e,i),z=o.textureUV.divide(this.mosaicInfo.size),_=s.textureUVNextVertex1.divide(this.mosaicInfo.size),R=s.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new p(1),outlineColor:new p(1),overrideOutlineColor:new u(1),outlineSize:r,distanceToPx:d,isSDF:a};let U=new u(0);return U=U.add(A(h).multiply(this._getColor(ot(h,z,_,R),j).a)),U=U.add(A(c).multiply(this._getColor(ot(c,z,_,R),j).a)),U=U.add(A(v).multiply(this._getColor(ot(v,z,_,R),j).a)),U=U.add(A(w).multiply(this._getColor(ot(w,z,_,R),j).a)),U=U.add(A(V).multiply(this._getColor(ot(V,z,_,R),j).a)),U=U.add(A(f).multiply(this._getColor(ot(f,z,_,R),j).a)),U=U.add(A(S).multiply(this._getColor(ot(S,z,_,R),j).a)),U=U.add(A(b).multiply(this._getColor(ot(b,z,_,R),j).a)),U=U.add(A(g).multiply(this._getColor(ot(g,z,_,R),j).a)),x(C(U,new u(.05)),new u(T),new u(D))}}t([o(L)],lt.prototype,"visualVariableColor",void 0),t([o(B)],lt.prototype,"visualVariableOpacity",void 0),t([o(E)],lt.prototype,"visualVariableRotation",void 0),t([o(J)],lt.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(K)],lt.prototype,"visualVariableSizeScaleStops",void 0),t([o(Q)],lt.prototype,"visualVariableSizeStops",void 0),t([o(W)],lt.prototype,"visualVariableSizeUnitValue",void 0),t([s(P)],lt.prototype,"mosaicInfo",void 0),t([l(d)],lt.prototype,"mosaicTexture",void 0),t([e(0,r(tt)),e(1,r(et))],lt.prototype,"vertex",null),t([e(0,r(it))],lt.prototype,"fragment",null);export{it as MarkerFragmentInput,lt as MarkerShader,tt as MarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{location as e,uniform as r,texture as i,input as s}from"../../GraphShaderModule.js";import{Vec4 as p,Float as l,Vec2 as a,Sampler2D as n,greaterThan as m,ifElse as u}from"../../graph/glsl.js";import{BaseHittestVertexInput as f,FeatureVertexInput as h}from"./AFeatureShader.js";import{getComplexFillVertexData as d,getComplexFillFragmentColor as c}from"./ComplexFillShader.js";import{signedToUnsignedByte as x,packPrecision as y}from"./constants.js";import{hittestFill as v,failHittest as j}from"./hittestUtils.js";import{getLineFragmentColor as g}from"./LineShader.js";import{LocalTileOffset as O}from"./LocalTileOffset.js";import{MosaicInfo as S}from"./MosaicInfo.js";import{AOutlineFillShader as b,getOutlineFillVertexData as F}from"./OutlineFillShader.js";import{PatternOutlineFillFragmentInput as w}from"./PatternOutlineFillShader.js";const C=1/y;class R extends h{}t([e(3,p)],R.prototype,"color",void 0),t([e(4,p)],R.prototype,"tlbr",void 0),t([e(5,l)],R.prototype,"angle",void 0),t([e(6,l)],R.prototype,"aux1",void 0),t([e(7,l)],R.prototype,"aux2",void 0),t([e(8,a)],R.prototype,"aux3",void 0),t([e(9,a)],R.prototype,"aux4",void 0),t([e(10,a)],R.prototype,"zoomRange",void 0);class T extends w{}class H extends b{constructor(){super(...arguments),this.type="ComplexOutlineFillShader"}vertex(t,o){const{aux1:e,aux2:r,aux3:i,aux4:s}=t,p={...t,width:e,height:r,offset:i,scale:s.multiply(C)},a={...t,halfWidth:e,referenceHalfWidth:r,offset:i,normal:s.subtract(x).multiply(C)},n=F(this,a),u=d(this,p),f=m(n.isOutline,new l(.5));return{...n,...u,...Object.assign({},this.maybeRunHittest(t,o,f))}}fragment(t){const{isOutline:o}=t,e=m(o,new l(.5)),r=g(t,this.antialiasingControls.blur),i=c(this,t),s=u(e,r,i),p=u(e,new l(1/255),new l(0));return this.getFragmentOutput(s,t,p)}hittest(t,o,e){return u(e,j(this.hittestRequest),v(this,t,o))}}t([r(S)],H.prototype,"mosaicInfo",void 0),t([i(n)],H.prototype,"mosaicTexture",void 0),t([r(O)],H.prototype,"localTileOffset",void 0),t([o(0,s(R)),o(1,s(f))],H.prototype,"vertex",null),t([o(0,s(T))],H.prototype,"fragment",null);export{H as ComplexOutlineFillShader,R as ComplexOutlineFillVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{location as o,uniform as r,texture as s,input as i}from"../../GraphShaderModule.js";import{Vec4 as p,Float as l,Vec2 as n,Sampler2D as a,greaterThan as m,ifElse as u,or as h}from"../../graph/glsl.js";import{BaseHittestVertexInput as f,FeatureVertexInput as d}from"./AFeatureShader.js";import{getComplexFillVertexData as c,getComplexFillFragmentColor as x}from"./ComplexFillShader.js";import{signedToUnsignedByte as y,noHit as v,trueHit as g,packPrecision as j}from"./constants.js";import{isRectHittest as O,hittestFill as b,hittestScreenRect as w}from"./hittestUtils.js";import{getLineFragmentColor as S}from"./LineShader.js";import{LocalTileOffset as F}from"./LocalTileOffset.js";import{MosaicInfo as R}from"./MosaicInfo.js";import{AOutlineFillShader as T,getOutlineFillVertexData as q}from"./OutlineFillShader.js";import{PatternOutlineFillFragmentInput as C}from"./PatternOutlineFillShader.js";const H=1/j;class I extends d{}t([o(3,p)],I.prototype,"color",void 0),t([o(4,p)],I.prototype,"tlbr",void 0),t([o(5,l)],I.prototype,"angle",void 0),t([o(6,l)],I.prototype,"aux1",void 0),t([o(7,l)],I.prototype,"aux2",void 0),t([o(8,n)],I.prototype,"aux3",void 0),t([o(9,n)],I.prototype,"aux4",void 0),t([o(10,n)],I.prototype,"zoomRange",void 0);class L extends C{}class M extends T{constructor(){super(...arguments),this.type="ComplexOutlineFillShader"}vertex(t,e){const{aux1:o,aux2:r,aux3:s,aux4:i}=t,p={...t,width:o,height:r,offset:s,scale:i.multiply(H)},n={...t,halfWidth:o,referenceHalfWidth:r,offset:s,normal:i.subtract(y).multiply(H)},a=q(this,n),u=c(this,p),h=m(a.isOutline,new l(.5));return{...a,...u,...Object.assign({},this.maybeRunHittest(t,e,h))}}fragment(t){const{isOutline:e}=t,o=m(e,new l(.5)),r=S(t,this.antialiasingControls.blur),s=x(this,t),i=u(o,r,s),p=u(o,new l(1/255),new l(0));return this.getFragmentOutput(i,t,p)}hittest(t,e,o){const{pos0:r,pos1:s,pos2:i}=this.computeHittestTriangle(t,e,null),p=O(this.hittestRequest);return u(p,()=>{const{tlbr:t}=this.hittestRequest;return w(r,s,i,t)},()=>{const r=b(this,t,e);return u(h(o,m(r,this.hittestRequest.distance)),new l(v),new l(g))})}}t([r(R)],M.prototype,"mosaicInfo",void 0),t([s(a)],M.prototype,"mosaicTexture",void 0),t([r(F)],M.prototype,"localTileOffset",void 0),t([e(0,i(I)),e(1,i(f))],M.prototype,"vertex",null),t([e(0,i(L))],M.prototype,"fragment",null);export{M as ComplexOutlineFillShader,I as ComplexOutlineFillVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{location as i,uniform as s,define as l,input as o,UniformGroup as r}from"../../GraphShaderModule.js";import{Vec2 as p,Float as a,Vec3 as n,Vec4 as u,length as m,step as d}from"../../graph/glsl.js";import{FeatureVertexInput as y,AFeatureShader as h,FeatureFragmentInput as c}from"./AFeatureShader.js";import{getHeatmapCompressionFactor as f}from"./heatmapUtils.js";import{hittestMarker as w}from"./hittestUtils.js";class v extends y{}t([i(5,p)],v.prototype,"offset",void 0);class x extends c{}class g extends r{}t([s(a)],g.prototype,"radius",void 0),t([s(a)],g.prototype,"isFieldActive",void 0);class F extends h{constructor(){super(...arguments),this.type="HeatmapAccumulateShader",this.usesHalfFloatPrecision=!1}vertex(t){const{radius:e,isFieldActive:i}=this.kernelControls,s=t.offset,l=i.multiply(this.getVVData(t.id).x).add(new a(1).subtract(i)),o=this.view.displayViewScreenMat3.multiply(new n(t.pos,1)).add(this.view.displayViewMat3.multiply(new n(s,0)).multiply(e)),r=this.clip(t.id);return{glPosition:new u(o.xy,r,1),offset:s,fieldValue:l,color:new u(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:e,fieldValue:i}=t,s=m(e),l=d(s,new a(1)),o=new a(1).subtract(s.multiply(s)),r=o.multiply(o),p=l.multiply(r).multiply(i).multiply(new a(f(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new u(p),t)}hittest(t){const{viewMat3:e,tileMat3:i}=this.view,s=e.multiply(i).multiply(new n(t.pos,1));return w(s.xy,this.kernelControls.radius,this.hittestRequest.position)}}t([l],F.prototype,"usesHalfFloatPrecision",void 0),t([s(g)],F.prototype,"kernelControls",void 0),t([e(0,o(v))],F.prototype,"vertex",null),t([e(0,o(x))],F.prototype,"fragment",null);export{x as HeatmapAccumulateFragmentInput,F as HeatmapAccumulateShader,v as HeatmapAccumulateVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{location as s,uniform as i,define as o,input as l,UniformGroup as r}from"../../GraphShaderModule.js";import{Vec2 as p,Float as n,Vec3 as a,Vec4 as u,length as m,step as d,ifElse as h,greaterThan as y}from"../../graph/glsl.js";import{FeatureVertexInput as c,AFeatureShader as f,FeatureFragmentInput as w}from"./AFeatureShader.js";import{trueHit as v,noHit as x}from"./constants.js";import{getHeatmapCompressionFactor as g}from"./heatmapUtils.js";import{hittestMarker as F}from"./hittestUtils.js";class j extends c{}t([s(5,p)],j.prototype,"offset",void 0);class V extends w{}class H extends r{}t([i(n)],H.prototype,"radius",void 0),t([i(n)],H.prototype,"isFieldActive",void 0);class M extends f{constructor(){super(...arguments),this.type="HeatmapAccumulateShader",this.usesHalfFloatPrecision=!1}vertex(t){const{radius:e,isFieldActive:s}=this.kernelControls,i=t.offset,o=s.multiply(this.getVVData(t.id).x).add(new n(1).subtract(s)),l=this.view.displayViewScreenMat3.multiply(new a(t.pos,1)).add(this.view.displayViewMat3.multiply(new a(i,0)).multiply(e)),r=this.clip(t.id);return{glPosition:new u(l.xy,r,1),offset:i,fieldValue:o,color:new u(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:e,fieldValue:s}=t,i=m(e),o=d(i,new n(1)),l=new n(1).subtract(i.multiply(i)),r=l.multiply(l),p=o.multiply(r).multiply(s).multiply(new n(g(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new u(p),t)}hittest(t){const{viewMat3:e,tileMat3:s}=this.view,i=e.multiply(s).multiply(new a(t.pos,1)),o=F(i.xy,this.kernelControls.radius,this.hittestRequest.position);return h(y(o,this.hittestRequest.distance),new n(x),new n(v))}}t([o],M.prototype,"usesHalfFloatPrecision",void 0),t([i(H)],M.prototype,"kernelControls",void 0),t([e(0,l(j))],M.prototype,"vertex",null),t([e(0,l(V))],M.prototype,"fragment",null);export{V as HeatmapAccumulateFragmentInput,M as HeatmapAccumulateShader,j as HeatmapAccumulateVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as o}from"tslib";import{location as i,uniform as e,option as r,input as s}from"../../GraphShaderModule.js";import{Vec2 as a,Vec4 as l,Float as p,greaterThan as n,ifElse as u,Vec3 as m}from"../../graph/glsl.js";import{BaseHittestVertexInput as c,FeatureVertexInput as d,AFeatureShader as h}from"./AFeatureShader.js";import{noHit as f,trueHit as y,bitsetTypeFillOutline as v,bitsetOutlineUsesColorVV as V}from"./constants.js";import{isRectHittest as S,failHittest as b,hittestFill as j,hittestScreenRect as x}from"./hittestUtils.js";import{AntialiasingControls as g,getLineFragmentColor as w,LineFragmentInput as z,getLineVertexData as M}from"./LineShader.js";import{getBit as O,getBitBool as R}from"./utils.js";import{VisualVariableColor as q}from"./VisualVariableColor.js";import{VisualVariableOpacity as C}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as P}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as U}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as W}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as H,getVisualVariableColor as A}from"./vvUtils.js";class G extends d{}t([i(3,a)],G.prototype,"offset",void 0),t([i(4,l)],G.prototype,"color",void 0),t([i(5,a)],G.prototype,"normal",void 0),t([i(6,p)],G.prototype,"halfWidth",void 0),t([i(7,p)],G.prototype,"referenceHalfWidth",void 0),t([i(8,a)],G.prototype,"zoomRange",void 0);class L extends z{}function T(t,o,i){const{id:e,bitset:r}=o,s=O(r,v),a=n(s,new p(.5)),c=M(t,o),d=u(a,c.halfWidth,new p(0)),h=H(t,e),f=A(t,e,o.color),y=u(a,u(R(r,V),f,o.color),f.multiply(h)),S=t.view.displayViewScreenMat3.multiply(new m(o.pos.xy,1)),b=t.clip(o.id),j=new l(S.xy,b,1),x=u(a,c.glPosition,j),g=i&&t.maybeRunHittest(o,i,a);return{isOutline:s,color:y,opacity:new p(1),halfWidth:d,normal:c.normal,glPosition:x,...g}}class k extends h{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}}t([e(g)],k.prototype,"antialiasingControls",void 0),t([r(q)],k.prototype,"visualVariableColor",void 0),t([r(C)],k.prototype,"visualVariableOpacity",void 0),t([r(P)],k.prototype,"visualVariableSizeMinMaxValue",void 0),t([r(U)],k.prototype,"visualVariableSizeScaleStops",void 0),t([r(W)],k.prototype,"visualVariableSizeStops",void 0),t([r(F)],k.prototype,"visualVariableSizeUnitValue",void 0);class B extends k{constructor(){super(...arguments),this.type="OutlineFillShader"}vertex(t,o){return T(this,t,o)}fragment(t){const{color:o,isOutline:i}=t,e=n(i,new p(.5)),r=w(t,this.antialiasingControls.blur),s=u(e,r,o),a=u(e,new p(1/255),new p(0));return this.getFragmentOutput(s,t,a)}hittest(t,o,i){const{pos0:e,pos1:r,pos2:s}=this.computeHittestTriangle(t,o,null),a=S(this.hittestRequest);return u(a,()=>{const{tlbr:t}=this.hittestRequest;return x(e,r,s,t)},()=>{const e=u(i,b(this.hittestRequest),j(this,t,o));return u(n(e,this.hittestRequest.distance),new p(f),new p(y))})}}t([o(0,s(G)),o(1,s(c))],B.prototype,"vertex",null),t([o(0,s(L))],B.prototype,"fragment",null);export{k as AOutlineFillShader,L as OutlineFillFragmentInput,B as OutlineFillShader,G as OutlineFillVertexInput,T as getOutlineFillVertexData};
2
+ import{__decorate as t,__param as o}from"tslib";import{location as i,uniform as e,option as r,input as s}from"../../GraphShaderModule.js";import{Vec2 as a,Vec4 as l,Float as p,greaterThan as n,ifElse as u,or as m,Vec3 as c}from"../../graph/glsl.js";import{BaseHittestVertexInput as d,FeatureVertexInput as h,AFeatureShader as f}from"./AFeatureShader.js";import{noHit as y,trueHit as v,bitsetTypeFillOutline as V,bitsetOutlineUsesColorVV as S}from"./constants.js";import{isRectHittest as b,hittestFill as j,hittestScreenRect as x}from"./hittestUtils.js";import{AntialiasingControls as g,getLineFragmentColor as w,LineFragmentInput as z,getLineVertexData as M}from"./LineShader.js";import{getBit as O,getBitBool as R}from"./utils.js";import{VisualVariableColor as C}from"./VisualVariableColor.js";import{VisualVariableOpacity as P}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as U}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as q}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as H,getVisualVariableColor as A}from"./vvUtils.js";class G extends h{}t([i(3,a)],G.prototype,"offset",void 0),t([i(4,l)],G.prototype,"color",void 0),t([i(5,a)],G.prototype,"normal",void 0),t([i(6,p)],G.prototype,"halfWidth",void 0),t([i(7,p)],G.prototype,"referenceHalfWidth",void 0),t([i(8,a)],G.prototype,"zoomRange",void 0);class L extends z{}function T(t,o,i){const{id:e,bitset:r}=o,s=O(r,V),a=n(s,new p(.5)),m=M(t,o),d=u(a,m.halfWidth,new p(0)),h=H(t,e),f=A(t,e,o.color),y=u(a,u(R(r,S),f,o.color),f.multiply(h)),v=t.view.displayViewScreenMat3.multiply(new c(o.pos.xy,1)),b=t.clip(o.id),j=new l(v.xy,b,1),x=u(a,m.glPosition,j),g=i&&t.maybeRunHittest(o,i,a);return{isOutline:s,color:y,opacity:new p(1),halfWidth:d,normal:m.normal,glPosition:x,...g}}class k extends f{constructor(){super(...arguments),this.computeAttributes={pos:["nextPos1","nextPos2"]}}}t([e(g)],k.prototype,"antialiasingControls",void 0),t([r(C)],k.prototype,"visualVariableColor",void 0),t([r(P)],k.prototype,"visualVariableOpacity",void 0),t([r(U)],k.prototype,"visualVariableSizeMinMaxValue",void 0),t([r(W)],k.prototype,"visualVariableSizeScaleStops",void 0),t([r(q)],k.prototype,"visualVariableSizeStops",void 0),t([r(F)],k.prototype,"visualVariableSizeUnitValue",void 0);class B extends k{constructor(){super(...arguments),this.type="OutlineFillShader"}vertex(t,o){return T(this,t,o)}fragment(t){const{color:o,isOutline:i}=t,e=n(i,new p(.5)),r=w(t,this.antialiasingControls.blur),s=u(e,r,o),a=u(e,new p(1/255),new p(0));return this.getFragmentOutput(s,t,a)}hittest(t,o,i){const{pos0:e,pos1:r,pos2:s}=this.computeHittestTriangle(t,o,null),a=b(this.hittestRequest);return u(a,()=>{const{tlbr:t}=this.hittestRequest;return x(e,r,s,t)},()=>{const e=j(this,t,o);return u(m(i,n(e,this.hittestRequest.distance)),new p(y),new p(v))})}}t([o(0,s(G)),o(1,s(d))],B.prototype,"vertex",null),t([o(0,s(L))],B.prototype,"fragment",null);export{k as AOutlineFillShader,L as OutlineFillFragmentInput,B as OutlineFillShader,G as OutlineFillVertexInput,T as getOutlineFillVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{and as t,greaterThanEqual as n,Float as y,Vec3 as u,Vec2 as e,min as r,max as x,equal as i,or as l,greaterThan as c,ifElse as s,lessThan as a,cond as w,not as d,Mat3 as o,abs as b,step as p,lessThanEqual as m,clamp as f,length as v,distance as j,dot as z,normalize as g}from"../../graph/glsl.js";import{trueHit as h,candidateHit as M,epsilonHitTest as P}from"./constants.js";import{cross2 as q}from"./utils.js";function R(t,n){return z(t,g(n))}function k(t,n,u){const e=u.subtract(n),r=R(t.subtract(n),e),x=f(r.divide(v(e)),new y(0),new y(1));return j(t,n.add(x.multiply(u.subtract(n))))}function A(t){const n=b(t);return p(n.x.add(n.y).add(n.z),new y(1.05))}function B(t,n,e,r){const x=new o(e.x.multiply(r.y).subtract(r.x.multiply(e.y)),r.x.multiply(n.y).subtract(n.x.multiply(r.y)),n.x.multiply(e.y).subtract(e.x.multiply(n.y)),e.y.subtract(r.y),r.y.subtract(n.y),n.y.subtract(e.y),r.x.subtract(e.x),n.x.subtract(r.x),e.x.subtract(n.x)),i=n.x.multiply(e.y.subtract(r.y)),l=e.x.multiply(r.y.subtract(n.y)),c=r.x.multiply(n.y.subtract(e.y)),s=i.add(l).add(c);return new y(1).divide(s).multiply(x.multiply(new u(1,t)))}function C(t,n,u,e){return i(A(B(t,n,u,e)),new y(1))}function D(n,u,e,x){const i=e.subtract(u),l=x.subtract(u),s=q(i,l),o=t(a(s,new y(P)),c(s,new y(-P)));return w([t(d(o),C(n.xy,u,e,x)),new y(-1)],[!0,()=>{const t=k(n,u,e),y=k(n,e,x),i=k(n,x,u);return r(r(t,y),i)}])}function E(t){return t.distance.add(1)}function F(t,n,y){const{viewMat3:e,tileMat3:r}=t.view,x=e.multiply(r),i=x.multiply(new u(n.pos,1)),l=x.multiply(new u(y.nextPos1,1)),c=x.multiply(new u(y.nextPos2,1));return D(t.hittestRequest.position,i.xy,l.xy,c.xy)}function G(t,n,y){return j(t,y).subtract(n)}function H(u,e,r,x){const l=u.x,c=u.y,a=e.x,w=e.y,o=r.x,b=r.y,p=x.x,f=x.y,v=p.subtract(o),j=l.subtract(o),z=a.subtract(l),g=f.subtract(b),h=c.subtract(b),M=w.subtract(c),P=g.multiply(z).subtract(v.multiply(M)),q=v.multiply(h).subtract(g.multiply(j)).divide(P),R=z.multiply(h).subtract(M.multiply(j)).divide(P),k=t(d(i(P,new y(0))),t(t(n(q,new y(0)),m(q,new y(1))),t(n(R,new y(0)),m(R,new y(1)))));return s(k,new y(1),new y(0))}function I(y,u,e,r,x){return t(t(n(y.x,u),n(y.y,e)),t(a(y.x,r),m(y.y,x)))}function J(n,u,a,w){const d=w.xy,o=w.zw,b=new e(o.x,d.y),p=new e(d.x,o.y),m=r(d.x,o.x),f=r(d.y,o.y),v=x(d.x,o.x),j=x(d.y,o.y),z=B(new e(m,f),n,u,a),g=B(new e(v,j),n,u,a),P=B(new e(m,j),n,u,a),q=B(new e(v,f),n,u,a),R=t(i(A(z),new y(1)),t(i(A(g),new y(1)),t(i(A(P),new y(1)),i(A(q),new y(1))))),k=H(d,b,n.xy,u.xy).add(H(b,o,n.xy,u.xy)).add(H(p,o,n.xy,u.xy)).add(H(p,d,n.xy,u.xy)),C=H(d,b,n.xy,a.xy).add(H(b,o,n.xy,a.xy)).add(H(p,o,n.xy,a.xy)).add(H(p,d,n.xy,a.xy)),D=H(d,b,u.xy,a.xy).add(H(b,o,u.xy,a.xy)).add(H(p,o,u.xy,a.xy)).add(H(p,d,u.xy,a.xy)),E=I(n.xy,m,f,v,j),F=I(u.xy,m,f,v,j),G=I(a.xy,m,f,v,j),J=t(E,t(F,G)),K=l(c(k,new y(0)),l(c(C,new y(0)),c(D,new y(0))));return s(l(K,R),new y(M),s(J,new y(h),new y(0)))}function K(u){return t(n(u.tlbr.x,new y(0)),n(u.tlbr.y,new y(0)),n(u.tlbr.z,new y(0)),n(u.tlbr.w,new y(0)))}export{k as distPointSegment,D as distPointTriangle,E as failHittest,F as hittestFill,G as hittestMarker,J as hittestScreenRect,A as inTriangle,K as isRectHittest,I as pointInRect,R as projectScalar,H as segmentIntersects,B as xyToBarycentric};
2
+ import{and as t,greaterThanEqual as n,Float as e,Vec3 as y,ifElse as r,or as u,greaterThan as i,lessThan as s,cond as l,min as x,not as c,Vec2 as a,max as w,equal as o,clamp as d,length as b,distance as m,Mat3 as p,abs as f,step as g,lessThanEqual as v,dot as I,normalize as h}from"../../graph/glsl.js";import{noHit as R,trueHit as j,epsilonHitTest as z,candidateHit as C}from"./constants.js";import{cross2 as S}from"./utils.js";function T(t,n){return I(t,h(n))}function V(t,n,y){const r=y.subtract(n),u=T(t.subtract(n),r),i=d(u.divide(b(r)),new e(0),new e(1));return m(t,n.add(i.multiply(y.subtract(n))))}function M(t){const n=f(t);return g(n.x.add(n.y).add(n.z),new e(1.05))}function P(t,n,r,u){const i=new p(r.x.multiply(u.y).subtract(u.x.multiply(r.y)),u.x.multiply(n.y).subtract(n.x.multiply(u.y)),n.x.multiply(r.y).subtract(r.x.multiply(n.y)),r.y.subtract(u.y),u.y.subtract(n.y),n.y.subtract(r.y),u.x.subtract(r.x),n.x.subtract(u.x),r.x.subtract(n.x)),s=n.x.multiply(r.y.subtract(u.y)),l=r.x.multiply(u.y.subtract(n.y)),x=u.x.multiply(n.y.subtract(r.y)),c=s.add(l).add(x);return new e(1).divide(c).multiply(i.multiply(new y(1,t)))}function q(t,n,y,r){return o(M(P(t,n,y,r)),new e(1))}function k(n,y,r,u){const a=r.subtract(y),w=u.subtract(y),o=S(a,w),d=t(s(o,new e(z)),i(o,new e(-z)));return l([t(c(d),q(n.xy,y,r,u)),new e(-1)],[!0,()=>{const t=V(n,y,r),e=V(n,r,u),i=V(n,u,y);return x(x(t,e),i)}])}function A(t,n,e){const{viewMat3:r,tileMat3:u}=t.view,i=r.multiply(u),s=i.multiply(new y(n.pos,1)),l=i.multiply(new y(e.nextPos1,1)),x=i.multiply(new y(e.nextPos2,1));return k(t.hittestRequest.position,s.xy,l.xy,x.xy)}function B(t,n,e){return m(t,e).subtract(n)}function D(y,u,i,s){const l=y.x,x=y.y,a=u.x,w=u.y,d=i.x,b=i.y,m=s.x,p=s.y,f=m.subtract(d),g=l.subtract(d),I=a.subtract(l),h=p.subtract(b),R=x.subtract(b),j=w.subtract(x),z=h.multiply(I).subtract(f.multiply(j)),C=f.multiply(R).subtract(h.multiply(g)).divide(z),S=I.multiply(R).subtract(j.multiply(g)).divide(z),T=t(c(o(z,new e(0))),t(t(n(C,new e(0)),v(C,new e(1))),t(n(S,new e(0)),v(S,new e(1)))));return r(T,new e(1),new e(0))}function E(e,y,r,u,i){return t(t(n(e.x,y),n(e.y,r)),t(s(e.x,u),v(e.y,i)))}function F(n,y,r,s){const l=s.xy,c=s.zw,d=new a(c.x,l.y),b=new a(l.x,c.y),m=x(l.x,c.x),p=x(l.y,c.y),f=w(l.x,c.x),g=w(l.y,c.y),v=P(new a(m,p),n,y,r),I=P(new a(f,g),n,y,r),h=P(new a(m,g),n,y,r),R=P(new a(f,p),n,y,r),j=t(o(M(v),new e(1)),t(o(M(I),new e(1)),t(o(M(h),new e(1)),o(M(R),new e(1))))),z=D(l,d,n.xy,y.xy).add(D(d,c,n.xy,y.xy)).add(D(b,c,n.xy,y.xy)).add(D(b,l,n.xy,y.xy)),C=D(l,d,n.xy,r.xy).add(D(d,c,n.xy,r.xy)).add(D(b,c,n.xy,r.xy)).add(D(b,l,n.xy,r.xy)),S=D(l,d,y.xy,r.xy).add(D(d,c,y.xy,r.xy)).add(D(b,c,y.xy,r.xy)).add(D(b,l,y.xy,r.xy)),T=E(n.xy,m,p,f,g),V=E(y.xy,m,p,f,g),q=E(r.xy,m,p,f,g),k=t(T,t(V,q));return{hasIntersectingSegments:u(i(z,new e(0)),u(i(C,new e(0)),i(S,new e(0)))),allTriangleVerticesInside:k,triangleContainsRect:j}}function G(t,n,y,i){const{hasIntersectingSegments:s,allTriangleVerticesInside:l,triangleContainsRect:x}=F(t,n,y,i);return r(s,new e(C),r(u(l,x),new e(j),new e(R)))}function H(t,n,y,i){const{hasIntersectingSegments:s,allTriangleVerticesInside:l,triangleContainsRect:x}=F(t,n,y,i);return r(u(s,u(l,x)),new e(j),new e(R))}function J(y){return t(n(y.tlbr.x,new e(0)),n(y.tlbr.y,new e(0)),n(y.tlbr.z,new e(0)),n(y.tlbr.w,new e(0)))}export{V as distPointSegment,k as distPointTriangle,A as hittestFill,B as hittestMarker,G as hittestMarkerScreenRect,H as hittestScreenRect,M as inTriangle,F as intersectsScreenRect,J as isRectHittest,E as pointInRect,T as projectScalar,D as segmentIntersects,P as xyToBarycentric};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as r,define as a,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as m,mod as c,step as h,and as f,lessThan as v,greaterThanEqual as w,Vec3 as b,Mat3 as x,ifElse as V,equal as S,greaterThan as R,Bool as g,texture2D as z,smoothstep as j,Int as A,bitRShift as C,bitAnd as O}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as T,FeatureFragmentInput as L}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as P,bitsetTextIsMapAligned as H,noHit as N,trueHit as U}from"../shaders/constants.js";import{isRectHittest as q,distPointTriangle as _,failHittest as k,hittestScreenRect as D}from"../shaders/hittestUtils.js";import{MosaicInfo as I}from"../shaders/MosaicInfo.js";import{getBit as B}from"../shaders/utils.js";import{VisualVariableColor as F}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as E}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as W}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as G}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as Z}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as J}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as K}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as Q,getVisualVariableRotation as X}from"../shaders/vvUtils.js";const Y=360/254;class $ extends M{}t([o(3,d)],$.prototype,"color",void 0),t([o(4,u)],$.prototype,"offset",void 0),t([o(5,u)],$.prototype,"textureUV",void 0),t([o(6,d)],$.prototype,"fontAndReferenceSize",void 0),t([o(7,d)],$.prototype,"outlineColor",void 0),t([o(8,d)],$.prototype,"haloColor",void 0),t([o(9,u)],$.prototype,"outlineAndHaloSize",void 0),t([o(10,u)],$.prototype,"zoomRange",void 0),t([o(11,y)],$.prototype,"clipAngle",void 0),t([o(12,d)],$.prototype,"referenceSymbol",void 0),t([o(15,y)],$.prototype,"visibility",void 0);class tt extends p{}t([o(13,u)],tt.prototype,"offsetNextVertex1",void 0),t([o(14,u)],tt.prototype,"offsetNextVertex2",void 0);class et extends L{}class it extends T{constructor(){super(...arguments),this.type="TextShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e){const{clipAngle:i,zoomRange:o,visibility:s}=t,l=i.multiply(Y),r=c(l.subtract(this.view.rotation),new y(360));let a=new y(0);const n=this.view.currentZoom,p=o.x,d=o.y,u=new y(1).subtract(h(p,n)).multiply(2),m=new y(f(w(r,new y(90)),v(r,new y(270)))).multiply(2),b=new y(2).multiply(new y(1).subtract(h(n,d)));return a=a.add(e.multiply(u)),a=a.add(e.multiply(m)),a=a.add(b),s&&(a=a.add(s)),a}vertex(t,e){const o=B(t.bitset,P),s=new y(1).subtract(o);let l=t.fontAndReferenceSize[0];const r=t.fontAndReferenceSize[1],a=t.fontAndReferenceSize[2],n=t.fontAndReferenceSize[3];let p=l.divide(a);const m=1===this.textRenderPassType?t.outlineColor:2===this.textRenderPassType?t.haloColor:this._getVertexColor(t),c=this.view.displayViewScreenMat3.multiply(new b(t.pos,1));let h=t.offset,f=new y(1),v=x.identity(),w=new u(0);if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,o=e.xy,s=e.z,l=this._unpackDirection(e.w),r=Q(this,t.id,s).divide(2),a=l.multiply(r.add(i));w=o.add(a),h=h.add(w)}else{f=Q(this,t.id,r).divide(r),l=l.multiply(f),p=p.multiply(f),h=h.multiply(f),v=X(this,t.id),h=v.multiply(new b(h,0)).xy}const z=B(t.bitset,H),j=this._getViewRotationMatrix(z).multiply(new b(h,0)).multiply(this.view.scaleFactor);let A=this.isLabel?this.clipLabel(t,z):this.clip(t.id,t.zoomRange);A=this.isBackgroundPass?A.add(s.multiply(2)):A.add(o.multiply(2));let C=new y(0);if(1===this.textRenderPassType){A=A.add(V(S(t.outlineAndHaloSize.x,new y(0)),new y(2),new y(0)));C=new y(t.outlineAndHaloSize.x).divide(p).divide(n)}if(2===this.textRenderPassType){const e=t.outlineAndHaloSize.x,i=new y(t.outlineAndHaloSize.y);A=A.add(V(S(i,new y(0)),new y(2),new y(0)));C=i.add(e).divide(p).divide(n)}const O=this.isLabel?R(A,new y(1)):new g(!1);return{glPosition:new d(c.xy.add(j.xy),A,1),color:m,size:p,textureUV:t.textureUV.divide(this.mosaicInfo.size),antialiasingWidth:new y(.105).multiply(a).divide(l).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(t,e,{vvSizeAdjustment:f,vvRotation:v,labelOffset:w,labelClipped:O})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new y(2/8),i=new y(1).subtract(e),o=z(this.mosaicTexture,t.textureUV).a;let s=i.subtract(t.outlineDistanceOffset);this.highlight&&(s=s.divide(2));const l=t.antialiasingWidth,r=j(s.subtract(l),s.add(l),o);return this.getFragmentOutput(t.color.multiply(r),t)}computeHittestTriangle(t,e,{vvSizeAdjustment:i,vvRotation:o,labelOffset:s}){let l,r,a;this.isLabel?(l=new b(t.offset.add(s),0),r=new b(e.offsetNextVertex1.add(s),0),a=new b(e.offsetNextVertex2.add(s),0)):(l=o.multiply(new b(t.offset.multiply(i),0)),r=o.multiply(new b(e.offsetNextVertex1.multiply(i),0)),a=o.multiply(new b(e.offsetNextVertex2.multiply(i),0)));const{viewMat3:n,tileMat3:p}=this.view,d=n.multiply(p).multiply(new b(t.pos,1));return{pos0:d.add(p.multiply(l)).xy,pos1:d.add(p.multiply(r)).xy,pos2:d.add(p.multiply(a)).xy}}hittest(t,e,i){const{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,labelClipped:r}=i,a=q(this.hittestRequest),{pos0:n,pos1:p,pos2:d}=this.computeHittestTriangle(t,e,{vvSizeAdjustment:o,vvRotation:s,labelOffset:l});return V(a,()=>{const{tlbr:t}=this.hittestRequest;return this.isLabel?V(r,k(this.hittestRequest),D(n,p,d,t)):D(n,p,d,t)},()=>{const t=_(this.hittestRequest.position,n,p,d),e=this.isLabel?V(r,k(this.hittestRequest),t):t;return V(R(e,this.hittestRequest.distance),new y(N),new y(U))})}_unpackDirection(t){const e=new A(t),i=C(e,new A(2)),o=O(e,new A(3));return new u(new y(i).subtract(1),new y(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new g(!1))}if(this.visualVariableOpacity){const i=this.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([s(F)],it.prototype,"visualVariableColor",void 0),t([s(E)],it.prototype,"visualVariableOpacity",void 0),t([s(W)],it.prototype,"visualVariableRotation",void 0),t([s(G)],it.prototype,"visualVariableSizeMinMaxValue",void 0),t([s(Z)],it.prototype,"visualVariableSizeScaleStops",void 0),t([s(J)],it.prototype,"visualVariableSizeStops",void 0),t([s(K)],it.prototype,"visualVariableSizeUnitValue",void 0),t([l(I)],it.prototype,"mosaicInfo",void 0),t([r(m)],it.prototype,"mosaicTexture",void 0),t([a],it.prototype,"textRenderPassType",void 0),t([a],it.prototype,"isBackgroundPass",void 0),t([a],it.prototype,"isLabel",void 0),t([e(0,n($)),e(1,n(tt))],it.prototype,"vertex",null),t([e(0,n(et))],it.prototype,"fragment",null);export{et as TextFragmentInput,it as TextShader,$ as TextVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{labelPlacementOffsetPadding as i}from"../../../definitions.js";import{location as o,option as s,uniform as l,texture as r,define as a,input as n,ComputeVertexInput as p}from"../../GraphShaderModule.js";import{Vec4 as d,Vec2 as u,Float as y,Sampler2D as m,mod as c,step as f,and as h,lessThan as v,greaterThanEqual as w,Vec3 as b,Mat3 as x,ifElse as V,equal as S,greaterThan as g,Bool as z,texture2D as R,smoothstep as j,Int as A,bitRShift as C,bitAnd as O}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as T,FeatureFragmentInput as L}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as P,bitsetTextIsMapAligned as H,noHit as N,trueHit as U}from"../shaders/constants.js";import{isRectHittest as _,distPointTriangle as k,hittestScreenRect as q}from"../shaders/hittestUtils.js";import{MosaicInfo as D}from"../shaders/MosaicInfo.js";import{getBit as I}from"../shaders/utils.js";import{VisualVariableColor as B}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as F}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as E}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as W}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as G}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as Z}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as J}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as K,getVisualVariableRotation as Q}from"../shaders/vvUtils.js";const X=360/254;class Y extends M{}t([o(3,d)],Y.prototype,"color",void 0),t([o(4,u)],Y.prototype,"offset",void 0),t([o(5,u)],Y.prototype,"textureUV",void 0),t([o(6,d)],Y.prototype,"fontAndReferenceSize",void 0),t([o(7,d)],Y.prototype,"outlineColor",void 0),t([o(8,d)],Y.prototype,"haloColor",void 0),t([o(9,u)],Y.prototype,"outlineAndHaloSize",void 0),t([o(10,u)],Y.prototype,"zoomRange",void 0),t([o(11,y)],Y.prototype,"clipAngle",void 0),t([o(12,d)],Y.prototype,"referenceSymbol",void 0),t([o(15,y)],Y.prototype,"visibility",void 0);class $ extends p{}t([o(13,u)],$.prototype,"offsetNextVertex1",void 0),t([o(14,u)],$.prototype,"offsetNextVertex2",void 0);class tt extends L{}class et extends T{constructor(){super(...arguments),this.type="TextShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(t,e){const{clipAngle:i,zoomRange:o,visibility:s}=t,l=i.multiply(X),r=c(l.subtract(this.view.rotation),new y(360));let a=new y(0);const n=this.view.currentZoom,p=o.x,d=o.y,u=new y(1).subtract(f(p,n)).multiply(2),m=new y(h(w(r,new y(90)),v(r,new y(270)))).multiply(2),b=new y(2).multiply(new y(1).subtract(f(n,d)));return a=a.add(e.multiply(u)),a=a.add(e.multiply(m)),a=a.add(b),s&&(a=a.add(s)),a}vertex(t,e){const o=I(t.bitset,P),s=new y(1).subtract(o);let l=t.fontAndReferenceSize[0];const r=t.fontAndReferenceSize[1],a=t.fontAndReferenceSize[2],n=t.fontAndReferenceSize[3];let p=l.divide(a);const m=1===this.textRenderPassType?t.outlineColor:2===this.textRenderPassType?t.haloColor:this._getVertexColor(t),c=this.view.displayViewScreenMat3.multiply(new b(t.pos,1));let f=t.offset,h=new y(1),v=x.identity(),w=new u(0);if(this.isLabel){if(!t.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const e=t.referenceSymbol,o=e.xy,s=e.z,l=this._unpackDirection(e.w),r=K(this,t.id,s).divide(2),a=l.multiply(r.add(i));w=o.add(a),f=f.add(w)}else{h=K(this,t.id,r).divide(r),l=l.multiply(h),p=p.multiply(h),f=f.multiply(h),v=Q(this,t.id),f=v.multiply(new b(f,0)).xy}const R=I(t.bitset,H),j=this._getViewRotationMatrix(R).multiply(new b(f,0)).multiply(this.view.scaleFactor);let A=this.isLabel?this.clipLabel(t,R):this.clip(t.id,t.zoomRange);A=this.isBackgroundPass?A.add(s.multiply(2)):A.add(o.multiply(2));let C=new y(0);if(1===this.textRenderPassType){A=A.add(V(S(t.outlineAndHaloSize.x,new y(0)),new y(2),new y(0)));C=new y(t.outlineAndHaloSize.x).divide(p).divide(n)}if(2===this.textRenderPassType){const e=t.outlineAndHaloSize.x,i=new y(t.outlineAndHaloSize.y);A=A.add(V(S(i,new y(0)),new y(2),new y(0)));C=i.add(e).divide(p).divide(n)}const O=this.isLabel?g(A,new y(1)):new z(!1);return{glPosition:new d(c.xy.add(j.xy),A,1),color:m,size:p,textureUV:t.textureUV.divide(this.mosaicInfo.size),antialiasingWidth:new y(.105).multiply(a).divide(l).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(t,e,{vvSizeAdjustment:h,vvRotation:v,labelOffset:w,labelClipped:O})}}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new y(1).subtract(t);return e.multiply(t).add(i.multiply(o))}fragment(t){const e=new y(2/8),i=new y(1).subtract(e),o=R(this.mosaicTexture,t.textureUV).a;let s=i.subtract(t.outlineDistanceOffset);this.highlight&&(s=s.divide(2));const l=t.antialiasingWidth,r=j(s.subtract(l),s.add(l),o);return this.getFragmentOutput(t.color.multiply(r),t)}computeHittestTriangle(t,e,{vvSizeAdjustment:i,vvRotation:o,labelOffset:s}){let l,r,a;this.isLabel?(l=new b(t.offset.add(s),0),r=new b(e.offsetNextVertex1.add(s),0),a=new b(e.offsetNextVertex2.add(s),0)):(l=o.multiply(new b(t.offset.multiply(i),0)),r=o.multiply(new b(e.offsetNextVertex1.multiply(i),0)),a=o.multiply(new b(e.offsetNextVertex2.multiply(i),0)));const{viewMat3:n,tileMat3:p}=this.view,d=n.multiply(p).multiply(new b(t.pos,1));return{pos0:d.add(p.multiply(l)).xy,pos1:d.add(p.multiply(r)).xy,pos2:d.add(p.multiply(a)).xy}}hittest(t,e,i){const{vvSizeAdjustment:o,vvRotation:s,labelOffset:l,labelClipped:r}=i,a=_(this.hittestRequest),{pos0:n,pos1:p,pos2:d}=this.computeHittestTriangle(t,e,{vvSizeAdjustment:o,vvRotation:s,labelOffset:l});return V(a,()=>{const{tlbr:t}=this.hittestRequest;return this.isLabel?V(r,new y(N),q(n,p,d,t)):q(n,p,d,t)},()=>{const t=k(this.hittestRequest.position,n,p,d),e=this.isLabel?r:new z(!1);return V(e,new y(N),V(g(t,this.hittestRequest.distance),new y(N),new y(U)))})}_unpackDirection(t){const e=new A(t),i=C(e,new A(2)),o=O(e,new A(3));return new u(new y(i).subtract(1),new y(o).subtract(1))}_getVertexColor(t){let e=t.color;if(this.visualVariableColor){const i=this.getColorValue(t.id);e=this.visualVariableColor.getColor(i,t.color,new z(!1))}if(this.visualVariableOpacity){const i=this.getOpacityValue(t.id),o=this.visualVariableOpacity.getOpacity(i);e=e.multiply(o)}return e}}t([s(B)],et.prototype,"visualVariableColor",void 0),t([s(F)],et.prototype,"visualVariableOpacity",void 0),t([s(E)],et.prototype,"visualVariableRotation",void 0),t([s(W)],et.prototype,"visualVariableSizeMinMaxValue",void 0),t([s(G)],et.prototype,"visualVariableSizeScaleStops",void 0),t([s(Z)],et.prototype,"visualVariableSizeStops",void 0),t([s(J)],et.prototype,"visualVariableSizeUnitValue",void 0),t([l(D)],et.prototype,"mosaicInfo",void 0),t([r(m)],et.prototype,"mosaicTexture",void 0),t([a],et.prototype,"textRenderPassType",void 0),t([a],et.prototype,"isBackgroundPass",void 0),t([a],et.prototype,"isLabel",void 0),t([e(0,n(Y)),e(1,n($))],et.prototype,"vertex",null),t([e(0,n(tt))],et.prototype,"fragment",null);export{tt as TextFragmentInput,et as TextShader,Y as TextVertexInput};