@arcgis/core 6.0.0-next.54 → 6.0.0-next.56

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 (467) hide show
  1. package/WebScene.js +2 -2
  2. package/applications/Components/OrientedImageryViewer/shared/constants.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/featureset/support/sqlUtils.js +1 -1
  8. package/arcade/validation/arcadeValidator.js +1 -1
  9. package/arcgisGlobal.d.ts +1 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/0329fa3aa3403f1c243b.js +1 -0
  12. package/assets/esri/core/workers/chunks/033b9fcd9833db3b6e7d.js +1 -0
  13. package/assets/esri/core/workers/chunks/{6602310c3fcd91fb6a2f.js → 07c8ac092e4b9e8d5b3c.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0978e12dd6a1cbc50b80.js +1 -0
  15. package/assets/esri/core/workers/chunks/0a97b1974367382cfdf5.js +1 -0
  16. package/assets/esri/core/workers/chunks/{db0a7671ab5cbe8afd72.js → 123661019bb69c53f2d3.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e956845255bce0910944.js → 1507297550c3cd1268e2.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{1b41ba050cde068d2860.js → 193a73a2c7f4f8482c21.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1c0f5c42331fb6fc26cb.js +1 -0
  20. package/assets/esri/core/workers/chunks/20acb6f3ed5140b6c6c6.js +1 -0
  21. package/assets/esri/core/workers/chunks/2cd2fcf4a37d180d5d5c.js +1 -0
  22. package/assets/esri/core/workers/chunks/2f9adf0b809ce8797ebf.js +1 -0
  23. package/assets/esri/core/workers/chunks/{afb4dfb89fbc8a342cc5.js → 3354f1fa90f8ce4c8fde.js} +1 -1
  24. package/assets/esri/core/workers/chunks/3982409149571a827390.js +1 -0
  25. package/assets/esri/core/workers/chunks/{9b458b0d1627f22fdd93.js → 3b11e4d2e69b7aea1d65.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3d851710f7fcc27c5b60.js +2 -0
  27. package/assets/esri/core/workers/chunks/3e8d70039800f2395d66.js +1 -0
  28. package/assets/esri/core/workers/chunks/41694ee8990e799da225.js +1 -0
  29. package/assets/esri/core/workers/chunks/4d8539674fc2e4fea03c.js +1 -0
  30. package/assets/esri/core/workers/chunks/{12add2003631fa314f25.js → 5060be52a380fc4920f8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{2aa6be0b047a1b25a520.js → 53bbb9aa6e4e4a0a8121.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c6d82397044e403a1f61.js → 5954f02c3901b28d8e73.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5ba6007c3c49a8153256.js +1 -0
  34. package/assets/esri/core/workers/chunks/5bdd95eeb8f34dbf26f2.js +2 -0
  35. package/assets/esri/core/workers/chunks/{4707aedcc1b3bdf5e987.js → 5c34d49a6c9cc34b7626.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js → 5e47026c681238038955.js} +2 -2
  37. package/assets/esri/core/workers/chunks/{2baf35b1b19482d603b5.js → 5f7505ada0991cfbdd84.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{976303f47c342b9d1cc0.js → 62ddd3a82864e26f009a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/69a09c6acb5ae03c67f6.js +1 -0
  40. package/assets/esri/core/workers/chunks/{542a9c414c99d84d52ab.js → 6a202ef9ba9b89e09153.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{0826feebdca8a31eb630.js → 6ba6fece5c11fe2a6ace.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5eb69e2895e5aec81051.js → 6fd10891506925560443.js} +1 -1
  43. package/assets/esri/core/workers/chunks/7b156905d168bf973518.js +1 -0
  44. package/assets/esri/core/workers/chunks/7b6fd287e7043ad50f4e.js +1 -0
  45. package/assets/esri/core/workers/chunks/7baa49055bc31618b56e.js +1 -0
  46. package/assets/esri/core/workers/chunks/8570e3df90fb76a8741a.js +1 -0
  47. package/assets/esri/core/workers/chunks/{c3c0f24a9e0047232ae1.js → 8679dfc0c53355b6feb0.js} +1 -1
  48. package/assets/esri/core/workers/chunks/8a636dc51372e14c98f5.js +1 -0
  49. package/assets/esri/core/workers/chunks/{d14732a57c8e63948c60.js → 9117c9b720c9ba6e7a6e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{f7e33d37dd11fb08f3f8.js → 97107e64407fa6825620.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{5118c7269b706089c88e.js → a05a2c2aaf0c288f9681.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{944f17e9c9f681b971fb.js → a12e2a345005189c64be.js} +1 -1
  53. package/assets/esri/core/workers/chunks/a22458e5272332d86cb9.js +1 -0
  54. package/assets/esri/core/workers/chunks/{15b3386ad92a0b4149b8.js → a24dc5350af001db417a.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{10967a36c77c5188690d.js → a66d6298236d59a615db.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{3ea480cebf8ee56228a5.js → a7dfca326883384d2751.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{723d8316f5d4b6ce2942.js → a9539393e2f1812a973a.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{ac8d38016e4bee37a77c.js → ab784764ddf9d7f693a1.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{255f5b45c4d32f97f86c.js → ac0861014b3d2f1a1de2.js} +1 -1
  60. package/assets/esri/core/workers/chunks/ace210d313ce53f3ae10.js +1 -0
  61. package/assets/esri/core/workers/chunks/ae48ee283cfa5b3c14b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/b38b6fe08a367e9de4f5.js +1 -0
  63. package/assets/esri/core/workers/chunks/{4e651869e9a196494694.js → b6e628b5d2643af4c19b.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{b37ab6b1cb4cfc85cd9d.js → b7828d7e2c5b75644057.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bbd8fcb0bbba7bde3d9b.js +1 -0
  66. package/assets/esri/core/workers/chunks/{ec465abb0344ad719e9d.js → bd8e329ec74d921d311a.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{56e6e70aa40e51827290.js → c3f94024c6c9eed9f273.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{6d17b45022dfd2548098.js → c5ddf8b347c31fe772a3.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{ee9af58ae202b803bba7.js → c7a0c4ca37ebd1d98cf1.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d0659f1b0495734be4b3.js +1 -0
  71. package/assets/esri/core/workers/chunks/d7763c42754152510e13.js +2 -0
  72. package/assets/esri/core/workers/chunks/{b9a2b05ede02c305e865.js → d8ffb1502def5c85740b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{7dfe1e78d2e66de6be22.js → d9ef244019954d5a8a27.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{95403bb27a4ea0a4b7b1.js → ddbfa664e69612295785.js} +1 -1
  75. package/assets/esri/core/workers/chunks/dfa1b0308e5e82d1ddfe.js +1120 -0
  76. package/assets/esri/core/workers/chunks/e566102c7ed7a8ebf89e.js +1 -0
  77. package/assets/esri/core/workers/chunks/e74586b074d0fa6abb4b.js +1 -0
  78. package/assets/esri/core/workers/chunks/e7dff025780726d5feae.js +1 -0
  79. package/assets/esri/core/workers/chunks/e96fa029acba59c04e4e.js +2 -0
  80. package/assets/esri/core/workers/chunks/{55d28d3f5b8ced061e39.js → eaf73ce60f39a48ddd2a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/ed2f2a5da830d058e339.js +1 -0
  82. package/assets/esri/core/workers/chunks/{e592f2483db71230e8e5.js → efd6ea0966f60ab19520.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{944cb751c85d3a127f49.js → f52d081bbde5c95265cf.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{1de9be7b65109c207bd5.js → fbd5f3b81cd9f061824d.js} +1 -1
  85. package/assets/esri/core/workers/chunks/fdfbd201be372d3796bf.js +2 -0
  86. package/assets/esri/core/workers/chunks/ff0a0819bba5e8264c47.js +1 -0
  87. package/assets/esri/layers/raster/formats/blosc-wasm.wasm +0 -0
  88. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  89. package/basemapGallery/support/basemapCompatibilityUtils.js +1 -1
  90. package/chunks/BlendLayers.glsl.js +1 -1
  91. package/chunks/ColorMaterial.glsl.js +14 -14
  92. package/chunks/Component.glsl.js +37 -37
  93. package/chunks/CypherParser.js +1 -1
  94. package/chunks/DefaultMaterial.glsl.js +15 -15
  95. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  96. package/chunks/HUDMaterial.glsl.js +3 -3
  97. package/chunks/MultiPathImpl.js +1 -1
  98. package/chunks/OperatorGeodesicBuffer.js +1 -1
  99. package/chunks/Path.glsl.js +15 -15
  100. package/chunks/Pattern.glsl.js +20 -20
  101. package/chunks/RasterColorizer.glsl.js +1 -1
  102. package/chunks/ShadowHighlight.glsl.js +1 -1
  103. package/chunks/Terrain.glsl.js +24 -24
  104. package/chunks/UnitFactory.js +1 -1
  105. package/chunks/Water.glsl.js +29 -20
  106. package/chunks/blosc-wasm.js +2 -0
  107. package/chunks/cameraUtilsSpherical.js +1 -1
  108. package/chunks/parquet.js +1 -1
  109. package/chunks/pdf.js +57 -0
  110. package/chunks/text.js +1 -1
  111. package/config.js +1 -1
  112. package/core/accessorSupport/write.js +1 -1
  113. package/core/scheduling.js +1 -1
  114. package/core/sql/SqlInterval.js +1 -1
  115. package/core/urlUtils.js +1 -1
  116. package/geometry/geometryEngine.js +1 -1
  117. package/geometry/operators/gx/operatorOffset.js +1 -1
  118. package/geometry/support/Ellipsoid.js +1 -1
  119. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  120. package/geometry/support/geodesicConstants.js +1 -1
  121. package/geometry/support/meshUtils/primitives.js +1 -1
  122. package/kernel.js +1 -1
  123. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  124. package/layers/VoxelWasmPerSceneView.js +1 -1
  125. package/layers/effects/parser.js +1 -1
  126. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  127. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -56
  128. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  129. package/layers/geospatialPDF/parserUtils.js +2 -0
  130. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  131. package/layers/graphics/data/QueryEngineResult.js +1 -1
  132. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  133. package/layers/parquet.js +1 -1
  134. package/layers/raster/datasets/ZarrRaster.js +1 -1
  135. package/layers/raster/datasets/wcsCoverageParser.js +1 -1
  136. package/layers/raster/formats/RasterCodec.js +1 -1
  137. package/layers/raster/formats/blosc.js +2 -0
  138. package/layers/support/BuildingFilter.js +1 -1
  139. package/layers/support/ControlPoint.js +1 -1
  140. package/layers/support/ControlPointsGeoreference.js +1 -1
  141. package/layers/support/IntegratedMeshSemantics.js +1 -1
  142. package/layers/support/commonProperties.js +1 -1
  143. package/layers/support/fieldUtils.d.ts +23 -87
  144. package/layers/support/fieldUtils.js +1 -1
  145. package/layers/support/geospatialPDFUtils.d.ts +63 -0
  146. package/layers/support/geospatialPDFUtils.js +2 -0
  147. package/layers/support/layersMapping.js +1 -1
  148. package/layers/video/VideoController.js +1 -1
  149. package/legend/ActiveLayerInfo.js +1 -1
  150. package/libs/ajv/ajv.bundle-wrapper.js +1 -1
  151. package/package.json +6 -6
  152. package/renderers/types.d.ts +1 -1
  153. package/rest/knowledgeGraphService.js +1 -1
  154. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  155. package/smartMapping/statistics/support/attributeDensity.js +1 -1
  156. package/smartMapping/support/adapters/support/utils.js +1 -1
  157. package/support/tests/serviceMockDependencies.js +1 -1
  158. package/symbols/CIMSymbol.d.ts +9 -9
  159. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  160. package/symbols/WaterSymbol3DLayer.d.ts +13 -1
  161. package/symbols/WaterSymbol3DLayer.js +1 -1
  162. package/symbols/cim/CIMEffects.js +1 -1
  163. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  164. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  165. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  166. package/symbols/cim/rasterizingUtils.js +1 -1
  167. package/views/2d/PaddedViewState.js +1 -1
  168. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  169. package/views/2d/engine/vectorTiles/constants.js +1 -1
  170. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  171. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  172. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  173. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  174. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
  175. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  176. package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
  177. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  178. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  179. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  180. package/views/2d/layers/features/Processor.js +1 -1
  181. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  182. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  183. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  184. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  185. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  186. package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
  187. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  188. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  189. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  190. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  191. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  192. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  193. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  194. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  195. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  196. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  197. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  198. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  199. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
  200. package/views/3d/animation/pointToPoint/Camera.js +1 -1
  201. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  202. package/views/3d/camera/constraintUtils.js +1 -1
  203. package/views/3d/camera/intersectionUtils.js +1 -1
  204. package/views/3d/environment/EnvironmentView.js +1 -1
  205. package/views/3d/focusAreaUtils.js +1 -1
  206. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  207. package/views/3d/interactive/Manipulator3D.js +1 -1
  208. package/views/3d/interactive/Manipulator3DBase.js +1 -1
  209. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  210. package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
  211. package/views/3d/interactive/editingTools/manipulations/config.js +1 -1
  212. package/views/3d/interactive/editingTools/media/MediaElementControllerControlPoints.js +1 -1
  213. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  214. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  215. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  216. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  217. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  218. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  219. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  220. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  221. package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
  222. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  223. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  224. package/views/3d/layers/DrapedSubView3D.js +1 -1
  225. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  226. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  227. package/views/3d/layers/FlowSubView3D.js +1 -1
  228. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  229. package/views/3d/layers/I3SMeshView3D.js +1 -1
  230. package/views/3d/layers/RouteLayerView3D.js +1 -1
  231. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  232. package/views/3d/layers/TiledLayerView3D.js +1 -1
  233. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  234. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  235. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  238. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  239. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  240. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  241. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  242. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  243. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  244. package/views/3d/layers/graphics/Graphics3DSymbolFactory.js +1 -1
  245. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  246. package/views/3d/layers/graphics/LabelInfo.js +1 -1
  247. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  248. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  249. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  250. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  251. package/views/3d/layers/i3s/I3SNode.js +1 -1
  252. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  253. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  254. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  255. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  256. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  257. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  258. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  259. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  260. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/Tiles3DBVH.js +1 -1
  262. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +1 -1
  263. package/views/3d/layers/support/createTileBVHForLayer.js +1 -1
  264. package/views/3d/layers/support/selectTiles3DSpatialReference.js +1 -1
  265. package/views/3d/layers/support/uvUtils.js +1 -1
  266. package/views/3d/state/Constraints.js +1 -1
  267. package/views/3d/state/ConstraintsManager.js +1 -1
  268. package/views/3d/state/NearFarHeuristic.js +1 -1
  269. package/views/3d/state/ViewState.js +1 -1
  270. package/views/3d/state/ViewStateManager.js +1 -1
  271. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  272. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  273. package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
  274. package/views/3d/state/controllers/RotateController.js +1 -1
  275. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  276. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  277. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  278. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  279. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  280. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  281. package/views/3d/state/utils/navigationUtils.js +1 -1
  282. package/views/3d/support/FrustumExtentIntersection.js +1 -1
  283. package/views/3d/support/QualityProfile.js +1 -1
  284. package/views/3d/support/QualitySettings.js +1 -1
  285. package/views/3d/support/RenderCoordsHelper.js +1 -1
  286. package/views/3d/support/SweptSphereVolume.js +1 -1
  287. package/views/3d/support/cameraUtils.js +1 -1
  288. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  289. package/views/3d/support/engineContent/line.js +1 -1
  290. package/views/3d/support/engineContent/marker.js +1 -1
  291. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  292. package/views/3d/support/hitTest.js +1 -1
  293. package/views/3d/support/orientedBoundingBox.js +1 -1
  294. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  295. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  296. package/views/3d/support/pointsOfInterest/SurfaceGeometryUpdates.js +1 -1
  297. package/views/3d/support/sunUtils.js +1 -1
  298. package/views/3d/terrain/BlendLayersTechniqueConfiguration.js +1 -1
  299. package/views/3d/terrain/ExtentHelper.js +1 -1
  300. package/views/3d/terrain/OverlayManager.js +1 -1
  301. package/views/3d/terrain/OverlayRenderer.js +1 -1
  302. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  303. package/views/3d/terrain/RasterColorizerTechniqueConfiguration.js +1 -1
  304. package/views/3d/terrain/TerrainRenderer.js +1 -1
  305. package/views/3d/terrain/TerrainSurface.js +1 -1
  306. package/views/3d/terrain/Tile.js +1 -1
  307. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  308. package/views/3d/terrain/terrainUtils.js +1 -1
  309. package/views/3d/webgl/RenderCamera.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  313. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticBVH.js +1 -1
  314. package/views/3d/webgl-engine/collections/Component/ComponentObjectElevationAgnosticComponentGeometryBVH.js +1 -1
  315. package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
  316. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  317. package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
  318. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  319. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  320. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  321. package/views/3d/webgl-engine/core/shaderLibrary/clampShadowPosition.glsl.js +2 -0
  322. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +14 -14
  323. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +1 -1
  324. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  325. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileComposite.glsl.js +2 -3
  326. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  327. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  328. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  329. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  330. package/views/3d/webgl-engine/effects/laserlines/LaserlinePathData.js +1 -1
  331. package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowAccumulator.js +1 -1
  332. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  333. package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
  334. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  335. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  336. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  337. package/views/3d/webgl-engine/lib/Program.js +1 -1
  338. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  339. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  340. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  341. package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
  342. package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
  343. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  344. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  345. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  346. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  347. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  348. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  349. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  350. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  351. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  352. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  353. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  354. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  355. package/views/3d/webgl-engine/parts/Model.js +1 -1
  356. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  357. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  358. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  359. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  360. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  361. package/views/Attribution.js +5 -5
  362. package/views/DOMContainer.d.ts +2 -1
  363. package/views/MapView.d.ts +1 -0
  364. package/views/SceneView.js +1 -1
  365. package/views/View2D.js +1 -1
  366. package/views/ViewingMode.js +1 -1
  367. package/views/analysis/ElevationProfile/elevationProfileChartBoundsUtils.js +1 -1
  368. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  369. package/views/draw/DrawAction.js +1 -1
  370. package/views/draw/DrawGraphicTool.js +1 -1
  371. package/views/draw/DrawOperation.js +1 -1
  372. package/views/draw/DrawTool.js +1 -1
  373. package/views/draw/SegmentDrawAction.js +1 -1
  374. package/views/draw/support/Reshape.js +1 -1
  375. package/views/draw/support/helpMessageUtils.js +1 -1
  376. package/views/draw/support/managers/EditSessionManager.js +1 -1
  377. package/views/draw/support/surfaceCoordinateSystems.js +1 -1
  378. package/views/interactive/dragEventPipeline.js +1 -1
  379. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  380. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  381. package/views/interactive/editGeometry/operations/AddOrUpdatePart.js +1 -1
  382. package/views/layers/support/editableLayerViews.js +1 -1
  383. package/views/overlay/TextOverlayItem.js +1 -1
  384. package/views/support/DefaultsFromMap.js +1 -1
  385. package/views/support/Scheduler.js +1 -1
  386. package/views/support/spatialReferenceSupport.js +1 -1
  387. package/views/webgl/Program.js +3 -3
  388. package/views/webgl/ShaderBuilder.js +23 -23
  389. package/views/webgl/ShaderTranspiler.js +2 -2
  390. package/webscene/Slide.js +1 -1
  391. package/webscene/VirtualLighting.d.ts +2 -4
  392. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  393. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  394. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +17 -1
  395. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  396. package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +7 -0
  397. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  398. package/widgets/BatchAttributeForm.js +1 -1
  399. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  400. package/widgets/Editor/workflowUtils.js +1 -1
  401. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  402. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  403. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  404. package/widgets/FeatureForm.js +1 -1
  405. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  406. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  407. package/widgets/Measurement.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  409. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  410. package/widgets/Search/support/layerSearchUtils.js +1 -1
  411. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  412. package/widgets/Sketch/SketchViewModel.js +1 -1
  413. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +1 -1
  414. package/widgets/UtilityNetworkAssociations.js +1 -1
  415. package/widgets/Weather/WeatherViewModel.js +1 -1
  416. package/widgets/Weather/css.js +1 -1
  417. package/widgets/Weather.js +1 -1
  418. package/widgets/support/ContingentValuesManager.js +1 -1
  419. package/widgets/support/forms/types.d.ts +23 -1
  420. package/assets/esri/core/workers/chunks/021bd07b9a3e70598840.js +0 -1
  421. package/assets/esri/core/workers/chunks/032733b863426c5bde00.js +0 -1121
  422. package/assets/esri/core/workers/chunks/144f18a3dd2c8cf07cf7.js +0 -1
  423. package/assets/esri/core/workers/chunks/170e68624b71ac96de4a.js +0 -1
  424. package/assets/esri/core/workers/chunks/23fc1c1ed483ed3b2298.js +0 -1
  425. package/assets/esri/core/workers/chunks/2634927d26cb1139c6d0.js +0 -1
  426. package/assets/esri/core/workers/chunks/2d1b8154ee40afc9d40b.js +0 -1
  427. package/assets/esri/core/workers/chunks/2d3e977f3b75474d7ebc.js +0 -1
  428. package/assets/esri/core/workers/chunks/4a41bf3d1e2e9bb79771.js +0 -2
  429. package/assets/esri/core/workers/chunks/5f324d88785ffcb73ae0.js +0 -1
  430. package/assets/esri/core/workers/chunks/70695e0fb53018d48e7b.js +0 -2
  431. package/assets/esri/core/workers/chunks/723c9ad4c25be2b82476.js +0 -1
  432. package/assets/esri/core/workers/chunks/766a1357be2ed7f4e125.js +0 -1
  433. package/assets/esri/core/workers/chunks/817bf487df056da1e6ec.js +0 -1
  434. package/assets/esri/core/workers/chunks/89e55895683369b5277a.js +0 -1
  435. package/assets/esri/core/workers/chunks/8a820e303941b351de81.js +0 -1
  436. package/assets/esri/core/workers/chunks/8c94e987754b3919181e.js +0 -1
  437. package/assets/esri/core/workers/chunks/90d567e920b6982b402d.js +0 -1
  438. package/assets/esri/core/workers/chunks/919115788da38049aea7.js +0 -2
  439. package/assets/esri/core/workers/chunks/97cdcedfe853280f6258.js +0 -1
  440. package/assets/esri/core/workers/chunks/9ebc6026934400fc1e1f.js +0 -1
  441. package/assets/esri/core/workers/chunks/b33e7e74cf8fa3926617.js +0 -1
  442. package/assets/esri/core/workers/chunks/b4a325dcf50e276751d7.js +0 -1
  443. package/assets/esri/core/workers/chunks/bb2af16e55cb39163827.js +0 -1
  444. package/assets/esri/core/workers/chunks/be5857b0d1b00faf430b.js +0 -1
  445. package/assets/esri/core/workers/chunks/cd9100a7c8309dfa7569.js +0 -1
  446. package/assets/esri/core/workers/chunks/d5bb9f9b7b341c671525.js +0 -1
  447. package/assets/esri/core/workers/chunks/d96e63d66f7b1f4ea54a.js +0 -2
  448. package/assets/esri/core/workers/chunks/e3bcd2e356f75afc316a.js +0 -1
  449. package/assets/esri/core/workers/chunks/e507dfc4788295d9c244.js +0 -1
  450. package/assets/esri/core/workers/chunks/e58f51618251f74aaafd.js +0 -1
  451. package/assets/esri/core/workers/chunks/e80526571f1a34de3278.js +0 -1
  452. package/assets/esri/core/workers/chunks/e83806797979138fd22a.js +0 -1
  453. package/assets/esri/core/workers/chunks/ea71850ba87ae6038000.js +0 -1
  454. package/assets/esri/core/workers/chunks/f537a5e808dc546813c7.js +0 -1
  455. package/assets/esri/core/workers/chunks/fe811d651d201f698b8f.js +0 -2
  456. package/chunks/NativeLine.glsl.js +0 -8
  457. package/layers/geospatialPDF/geospatialPDFParserUtils.js +0 -2
  458. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +0 -2
  459. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +0 -2
  460. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +0 -2
  461. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +0 -2
  462. /package/assets/esri/core/workers/chunks/{919115788da38049aea7.js.LICENSE.txt → 3d851710f7fcc27c5b60.js.LICENSE.txt} +0 -0
  463. /package/assets/esri/core/workers/chunks/{fe811d651d201f698b8f.js.LICENSE.txt → 5bdd95eeb8f34dbf26f2.js.LICENSE.txt} +0 -0
  464. /package/assets/esri/core/workers/chunks/{ced5dfb2bf46fc5eac8c.js.LICENSE.txt → 5e47026c681238038955.js.LICENSE.txt} +0 -0
  465. /package/assets/esri/core/workers/chunks/{4a41bf3d1e2e9bb79771.js.LICENSE.txt → d7763c42754152510e13.js.LICENSE.txt} +0 -0
  466. /package/assets/esri/core/workers/chunks/{d96e63d66f7b1f4ea54a.js.LICENSE.txt → e96fa029acba59c04e4e.js.LICENSE.txt} +0 -0
  467. /package/assets/esri/core/workers/chunks/{70695e0fb53018d48e7b.js.LICENSE.txt → fdfbd201be372d3796bf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{defaultFontFamily as e}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as t}from"../../core/lang.js";import n from"../../core/Logger.js";import{deg2rad as r}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{onePixelInPoints as a,pt2px as o,px2pt as s,onePointInPixels as c}from"../../core/screenUtils.js";import{GeometryCursor as l}from"../../geometry/GeometryCursor.js";import{empty as u,expandPointInPlace as d,center as f,width as p,height as m,diagonal as h,fromValues as g,create as _}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as v}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as y}from"../../geometry/support/centroid.js";import{targetIntersectsPolygon as b,pointInPolygon as x,nearLine as S}from"../../geometry/support/intersectsBase.js";import{isPolygon as C,isPolyline as w,isExtent as T,isMultipoint as E,isPoint as D}from"../../geometry/support/jsonTypeUtils.js";import{destroyHiddenSvg as O,createHiddenSvg as ee,createSvgElement as te}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as ne,glyphSize as k,hittestToleranceSmallSymbol as A,hittestSmallSymbolThreshold as re}from"../../views/2d/engine/webgl/definitions.js";import{shapeTextResource as ie}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as ae,getLineWidth as oe}from"../../views/2d/layers/graphics/graphicsUtils.js";import{SimpleEffectCursor as se}from"./CIMEffects.js";import ce from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as le,getPlacementOperator as ue}from"./CIMOperators.js";import{Placement as de}from"./CIMPlacements.js";import{defaultCIMValues as j}from"./defaultCIMValues.js";import{fromCIMFontStyle as fe}from"./fromCIMFontStyle.js";import{getFirstFrame as M}from"./imageUtils.js";import{rotate as N}from"./mathUtils.js";import{addColorStops as P}from"./rasterizingUtils.js";import pe from"./Rect.js";import{parseRichTextRuns as F,hasRichTextFormattingTags as I}from"./richTextUtils.js";import L from"./TextRasterizer.js";import{getNumericValue as R,isSVGImage as z,getRelativeGradientSize as B,getEffectsInflateSize as me,fromCIMFontDecoration as he,fromCIMHorizontalAlignment as ge,fromCIMVerticalAlignment as V,getFillColor as H,getStrokeColor as U,getStrokeWidth as W,getFontWeight as _e,getFontStyle as ve,isCIMFill as ye,getSize as be}from"./utils.js";const G=Math.PI/180,K=.5,q=()=>n.getLogger(`esri.symbols.cim.CIMSymbolDrawHelper`);class J{constructor(e){this._t=e}static createIdentity(){return new J([1,0,0,0,1,0])}clone(){let e=this._t;return new J(e.slice())}transform(e){let t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]}static createScale(e,t){return new J([e,0,0,0,t,0])}scale(e,t){let n=this._t;return n[0]*=e,n[1]*=e,n[2]*=e,n[3]*=t,n[4]*=t,n[5]*=t,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(e,t){return new J([0,0,e,0,0,t])}translate(e,t){let n=this._t;return n[2]+=e,n[5]+=t,this}static createRotate(e){let t=Math.cos(e),n=Math.sin(e);return new J([t,-n,0,n,t,0])}rotate(e){return J.multiply(this,J.createRotate(e),this)}angle(){let e=this._t[0],t=this._t[3],n=Math.sqrt(e*e+t*t);return[e/n,t/n]}static multiply(e,t,n){let r=e._t,i=t._t,a=r[0]*i[0]+r[3]*i[1],o=r[1]*i[0]+r[4]*i[1],s=r[2]*i[0]+r[5]*i[1]+i[2],c=r[0]*i[3]+r[3]*i[4],l=r[1]*i[3]+r[4]*i[4],u=r[2]*i[3]+r[5]*i[4]+i[5],d=n._t;return d[0]=a,d[1]=o,d[2]=s,d[3]=c,d[4]=l,d[5]=u,n}invert(){let e=this._t,t=e[0]*e[4]-e[1]*e[3];if(t===0)return new J([0,0,0,0,0,0]);t=1/t;let n=(e[1]*e[5]-e[2]*e[4])*t,r=(e[2]*e[3]-e[0]*e[5])*t,i=e[4]*t,a=-e[1]*t,o=-e[3]*t,s=e[0]*t;return new J([i,a,n,o,s,r])}}class Y{constructor(e,t){this._resourceManager=e,this._transfos=[],this._sizeTransfos=[],this._textScaling=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new de,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(t||J.createIdentity()),this._sizeTransfos.push(t?t.scaleRatio():1),this._textScaling.push(1)}setTransform(e,t){this._transfos=[e||J.createIdentity()],this._sizeTransfos=[t||(e?e.scaleRatio():1)],this._textScaling=[1]}setGeomUnitsPerPoint(e){this._geomUnitsPerPoint=e}transformPt(e){return this._transfos[this._transfos.length-1].transform(e)}transformSize(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]}scaleText(e){return e*this._textScaling[this._textScaling.length-1]}reverseTransformPt(e){return this._transfos[this._transfos.length-1].invert().transform(e)}reverseTransformSize(e){return e/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(e){return e/this._transfos[this._transfos.length-1].scaleRatio()}reverseScaleText(e){return e/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(e,t=!1,n=1){let r=t?e.scaleRatio():1;J.multiply(e,this.back(),e),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r),this._textScaling.push(this._textScaling[this._textScaling.length-1]*n)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1),this._textScaling.splice(-1,1)}drawSymbol(e,t,n){if(e)switch(e.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:this.drawMultiLayerSymbol(e,t);break;case`CIMTextSymbol`:this.drawTextSymbol(e,t,n)}}drawMultiLayerSymbol(e,t){if(!e||!t)return;let n=e.symbolLayers;if(!n)return;let r=e.effects;if(r&&r.length>0){let e=this.executeEffects(r,t);if(e){let t=e.next();for(;t;)this.drawSymbolLayers(n,t.asJSON()),t=e.next()}}else this.drawSymbolLayers(n,t)}executeEffects(e,t){let n=this.geomUnitsPerPoint(),r=me(e),i=new se(l.fromJSONCIM(t));for(let a of e){let e=le(a);e&&(i=e.execute(i,a,{geomUnitsPerPoint:n,tileKey:null,maxInflateSize:r,scale:null,spatialReference:t.spatialReference,preventClipping:!1}))}return i}drawSymbolLayers(e,t){let n=e.length;for(;n--;){let r=e[n];if(!r||r.enable===!1)continue;let i=r.effects;if(i&&i.length>0){let e=this.executeEffects(i,t);if(e){let t=null;for(;(t=e.next())&&(this.drawSymbolLayer(r,t.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(r,t);if(this._earlyReturn)return}}drawSymbolLayer(e,t){switch(e.type){case`CIMSolidFill`:this.drawSolidFill(t,e.color,e.path);break;case`CIMHatchFill`:this.drawHatchFill(t,e);break;case`CIMPictureFill`:this.drawPictureFill(t,e);break;case`CIMGradientFill`:this.drawGradientFill(t,e);break;case`CIMSolidStroke`:this.drawSolidStroke(t,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit,e.path);break;case`CIMPictureStroke`:this.drawPictureStroke(t,e);break;case`CIMGradientStroke`:this.drawGradientStroke(t,e);break;case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:this.drawMarkerLayer(e,t)}}drawHatchFill(e,t){let n=we(t,e,this.geomUnitsPerPoint());n&&(this.pushClipPath(e),this.drawMultiLayerSymbol(t.lineSymbol,n),this.popClipPath())}drawPictureFill(e,t){}drawGradientFill(e,t){}drawPictureStroke(e,t){}drawGradientStroke(e,t){}drawMarkerLayer(e,t){let n=e.markerPlacement;if(n){let r=ue(n);if(r){let i=n.type===`CIMMarkerPlacementInsidePolygon`||n.type===`CIMMarkerPlacementPolygonCenter`&&n.clipAtBoundary;i&&this.pushClipPath(t);let a=r.execute(l.fromJSONCIM(t),n,this.geomUnitsPerPoint(),null);if(a){let t=null;for(;(t=a.next())&&(this.drawMarker(e,t),!this._earlyReturn););}i&&this.popClipPath()}}else{let n=this._placementPool.acquire();if(D(t))n.tx=t.x,n.ty=t.y,this.drawMarker(e,n);else if(C(t)){let r=y(t);r&&([n.tx,n.ty]=r,this.drawMarker(e,n))}else if(w(t)){for(let r of t.paths)for(let t of r)if(n.tx=t[0],n.ty=t[1],this.drawMarker(e,n),this._earlyReturn)break}else for(let r of t.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,t){switch(e.type){case`CIMCharacterMarker`:case`CIMPictureMarker`:this.drawPictureMarker(e,t);break;case`CIMVectorMarker`:this.drawVectorMarker(e,t)}}drawPictureMarker(e,t){if(!e)return;let n=this._resourceManager.getResource(e.url),r=R(e.size,j.CIMPictureMarker.size);if(n==null||r<=0)return;let i=n.width,a=n.height;if(!i||!a)return;let o=i/a,s=R(e.scaleX,1),c=J.createIdentity(),l=e.anchorPoint;if(l){let t=l.x,n=l.y;e.anchorPointUnits!==`Absolute`&&(t*=r*o*s,n*=r),c.translate(-t,-n)}let u=R(e.rotation);e.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&c.rotate(u*G);let d=R(e.offsetX),f=R(e.offsetY);if(d||f){if(this._mapRotation){let e=G*this._mapRotation,t=Math.cos(e),n=Math.sin(e),r=d*t-f*n,i=d*n+f*t;d=r,f=i}c.translate(d,f)}let p=this.geomUnitsPerPoint();p!==1&&c.scale(p,p);let m=t.getAngle();m&&c.rotate(m),c.translate(t.tx,t.ty),this.push(c),this.drawImage(e,r),this.pop()}drawVectorMarker(e,t){if(!e)return;let n=e.markerGraphics;if(!n)return;let r=R(e.size,j.CIMVectorMarker.size),i=e.frame,a=i?i.ymax-i.ymin:0,o=r&&a?r/a:1,s=J.createIdentity();i&&s.translate(-(i.xmax+i.xmin)*.5,-(i.ymax+i.ymin)*.5);let c=e.anchorPoint;if(c){let t=c.x,n=c.y;e.anchorPointUnits===`Absolute`?(t/=o,n/=o):i&&(t*=i.xmax-i.xmin,n*=i.ymax-i.ymin),s.translate(-t,-n)}o!==1&&s.scale(o,o);let l=R(e.rotation);e.rotateClockwise&&(l=-l),this._mapRotation&&(l+=this._mapRotation),l&&s.rotate(l*G);let u=R(e.offsetX),d=R(e.offsetY);if(u||d){if(this._mapRotation){let e=G*this._mapRotation,t=Math.cos(e),n=Math.sin(e),r=u*t-d*n,i=u*n+d*t;u=r,d=i}s.translate(u,d)}let f=this.geomUnitsPerPoint();f!==1&&s.scale(f,f);let p=t.getAngle();p&&s.rotate(p),s.translate(t.tx,t.ty);let m=e.scaleSymbolsProportionally?1:o;this.push(s,e.scaleSymbolsProportionally,m);for(let e of n){e?.symbol&&e.geometry||q().error(`Invalid marker graphic`,e);let t=e.textString;if(typeof t==`number`&&(t=t.toString()),this.drawSymbol(e.symbol,e.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(e,t,n){if(!e||!D(t)||R(e.height,j.CIMTextSymbol.height)<=0)return;let r=J.createIdentity(),i=R(e.angle);i=-i,i&&r.rotate(i*G);let a=R(e.offsetX),o=R(e.offsetY);(a||o)&&r.translate(a,o);let s=this.geomUnitsPerPoint();s!==1&&r.scale(s,s),r.translate(t.x,t.y),this.push(r),this.drawText(e,n),this.pop()}}class xe extends Y{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new pe(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return g(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(!(!e||this._clipCount>0)){if(C(e))this._processPath(e.rings,0);else if(w(e))this._processPath(e.paths,0);else if(T(e)){let t=X(e);t&&this._processPath(t.rings,0)}else console.error(`drawSolidFill Unexpected geometry type!`)}}drawSolidStroke(e,t,n){if(!e||this._clipCount>0||n==null||n<=0)return;let r=Math.max(this.transformSize(R(n,j.CIMSolidStroke.width))*.5,.5*K);if(C(e))this._processPath(e.rings,r);else if(w(e))this._processPath(e.paths,r);else if(T(e)){let t=X(e);t&&this._processPath(t.rings,r)}else console.error(`drawSolidStroke unexpected geometry type!`)}drawMarkerLayer(e,t){C(t)&&e.markerPlacement&&(e.markerPlacement.type===`CIMMarkerPlacementInsidePolygon`||e.markerPlacement.type===`CIMMarkerPlacementPolygonCenter`&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){let{url:n}=e,r=R(e.scaleX,1),i=r*t,a=t,o=this._resourceManager.getResource(n);if(o!=null){let e=o.height/o.width;i=r*(t?e>1?t:t/e:o.width),a=t?e>1?t*e:t:o.height}this._merge(this.transformPt([-i/2,-a/2]),0),this._merge(this.transformPt([-i/2,a/2]),0),this._merge(this.transformPt([i/2,-a/2]),0),this._merge(this.transformPt([i/2,a/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||=new L;let n=Q(e),r=F({textString:t,font:n.font,symbol:e,supportsRichText:I(t)}),[i,a]=r?this._textRasterizer.computeRichTextSize(r,n):this._textRasterizer.computeTextSize(t,n);i=s(i),a=s(a);let o=this.transformSize(1)*this.reverseTransformScalar(1);i*=o,a*=o;let c=e.horizontalAlignment??j.CIMTextSymbol.horizontalalignment,l=e.verticalAlignment??j.CIMTextSymbol.verticalalignment,u=0;switch(c){case`Left`:u=i/2;break;case`Right`:u=-i/2}let d=0;switch(l){case`Bottom`:d=a/2;break;case`Top`:d=-a/2;break;case`Baseline`:d=a/6}this._merge(this.transformPt([-i/2+u,-a/2+d]),0),this._merge(this.transformPt([-i/2+u,a/2+d]),0),this._merge(this.transformPt([i/2+u,-a/2+d]),0),this._merge(this.transformPt([i/2+u,a/2+d]),0)}_processPath(e,t){if(e)for(let n of e){let e=n?n.length:0;if(e>1){this._merge(this.transformPt(n[0]),t);for(let r=1;r<e;r++)this._merge(this.transformPt(n[r]),t)}}}_merge(e,t){e[0]-t<this._xmin&&(this._xmin=e[0]-t),e[0]+t>this._xmax&&(this._xmax=e[0]+t),e[1]-t<this._ymin&&(this._ymin=e[1]-t),e[1]+t>this._ymax&&(this._ymax=e[1]+t)}}class Se extends Y{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=O(this._svg),this._path=null,this._canvas=null}hitTest(e,t,n,r){let{textInfo:i,mapRotation:a,resolution:o,searchDist:l,hittestType:u,isScreenAligned:d}=r;this._resetHittest();let f=o*c;switch(this.setGeomUnitsPerPoint(f),u){case`point`:if(e.length!==1)return q().error(`Unexpected hittest area`,e),!1;this._hittestType=`point`,this._searchDistPoint=l/2/f,this._searchTarget=[[e[0].x,e[0].y]];break;case`rect`:if(e.length!==4)return q().error(`Unexpected hittest area`,e),!1;this._hittestType=`rect`,this._searchDistPoint=0,this._searchTarget=e.map(e=>[e.x,e.y]);break;case`polygon`:this._hittestType=`polygon`,this._searchDistPoint=0,this._searchTarget=e.map(e=>[e.x,e.y])}if(this._textInfo=i,this._mapRotation=d?a:0,!has(`esri-mobile`)){let e=s(A*window.devicePixelRatio),n=s(re);(t?.type!==`CIMLineSymbol`&&t?.type!==`CIMPolygonSymbol`||!t.symbolLayers?.some(ye))&&t?.type!==`CIMMeshSymbol`&&(be(t)??0)<n&&(this._searchDistPoint=e)}return this._earlyReturn=!1,this.drawSymbol(t,n),this._earlyReturn}executeEffects(e,t){return e.at(-1)?.type===`CIMGeometricEffectDashes`&&(e=e.slice(0,-1)),super.executeEffects(e,t)}drawSolidFill(e,t,n){n==null?this._hitTestFill(e):this._hittestSvgPath(e,n,!0)}drawHatchFill(e,t){this._hitTestFill(e)}drawPictureFill(e,t){this._hitTestFill(e)}drawGradientFill(e,t){this._hitTestFill(e)}drawSolidStroke(e,t,n,r,i,a,o){o==null?this._hitTestStroke(e,n):this._hittestSvgPath(e,o,!1,n)}drawPictureStroke(e,t){this._hitTestStroke(e,t.width)}drawGradientStroke(e,t){this._hitTestStroke(e,t.width)}drawMarkerLayer(e,t){e.markerPlacement&&(e.markerPlacement.type===`CIMMarkerPlacementInsidePolygon`||e.markerPlacement.type===`CIMMarkerPlacementPolygonCenter`&&e.markerPlacement.clipAtBoundary)?this._hitTestFill(t):super.drawMarkerLayer(e,t)}drawTextSymbol(e,t,n){if(!e||!D(t)||R(e.height,j.CIMTextSymbol.height)<=0)return;let r=J.createIdentity(),i=this.geomUnitsPerPoint();i!==1&&r.scale(i,i),r.translate(t.x,t.y),this.push(r),this.drawText(e,n),this.pop()}pushClipPath(e){}popClipPath(){}drawImage(e,t){let{url:n}=e,r=R(e.scaleX,1),i=this._resourceManager.getResource(n);if(i==null||i.height===0||t===0)return;let a=t*this.geomUnitsPerPoint(),o=a*r*(i.width/i.height);if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]),t=this._searchDistPoint;Math.abs(e[0])<o/2+t&&Math.abs(e[1])<a/2+t&&(this._earlyReturn=!0)}else{let e=o/2,t=a/2,n=[[-e,t],[e,t],[e,-t],[-e,-t],[-e,t]],r=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(r,[n])&&(this._earlyReturn=!0)}}drawText(e,t){let n=this._textInfo;if(!n)return;let r=n.get(e);if(!r||!p(r.glyphMosaicItems))return;let i=ae(R(e.height,j.CIMTextSymbol.height)),{lineGapType:a,lineGap:o}=e,s=a?Z(a,R(o),i):0,c=e.horizontalAlignment??j.CIMTextSymbol.horizontalalignment,l=e.verticalAlignment??j.CIMTextSymbol.verticalalignment,u=e.callout?.type===`CIMBackgroundCallout`,d=ie(r.glyphMosaicItems,{scale:i/k,angle:R(e.angle),xOffset:R(e.offsetX),yOffset:R(e.offsetY),horizontalAlignment:c,verticalAlignment:l,maxLineWidth:oe(e.lineWidth),lineHeight:ne*Math.max(.25,Math.min(s||1,4)),decoration:e.font.decoration||`none`,useCIMAngleBehavior:!1,hasBackground:u}),f=this.reverseScaleText(1);for(let e of d.glyphs){let t=e.offsets,n=[[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(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]);x(e,[n])&&(this._earlyReturn=!0)}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,[n])&&(this._earlyReturn=!0)}}function p(e){return e.type===`glyphs`?e.glyphs.length>0:e.runs.some(e=>e.glyphs.glyphs.length>0)}}_hitTestFill(e){let t=null;if(T(e)){let n=e;t=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(C(e))t=e.rings;else if(w(e))t=e.paths;else return;if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]);if(x(e,t)&&(this._earlyReturn=!0),!this._earlyReturn){let n=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();S(e,t,n)&&(this._earlyReturn=!0)}}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,t)&&(this._earlyReturn=!0)}}_getSvgPath(){return(this._svg==null||this._path==null)&&(this._svg??=ee(),this._path??=te(`path`),this._svg.appendChild(this._path)),this._path}_getCanvasContext(e,t){return this._canvas??=document.createElement(`canvas`),this._canvas.width=e,this._canvas.height=t,this._canvas.getContext(`2d`,{willReadFrequently:!0})}_hittestSvgPath(e,t,n,r=0){let i=_();v(i,e);let a={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute(`d`,t);let s=o.getBBox();if(this._hittestType===`point`){let e=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]),o=Math.max(s.width/a.width,s.height/a.height),c=1,l=2*e*o;l<1&&(c=2/l,o*=c,s.x*=c,s.y*=c,s.width*=c,s.height*=c);let u=1+r*o/2,d=this._getCanvasContext(s.width+u*2,s.height+u*2);d.setTransform(c,0,0,c,-s.x+u,-s.y+u);let f=new Path2D(t);n?d.fill(f):(d.lineWidth=o/c*r,d.stroke(f));let p=(a.width*o-s.width)/2,m=(a.height*o-s.height)/2,h=Math.floor((i[0]-a.x-e)*o-p+u),g=Math.floor((a.height-(i[1]-a.y)-e)*o+m+u),_=Math.ceil(2*e*o),v=Math.ceil(2*e*o),y=d.getImageData(h,g,_,v).data;for(let e=3;e<y.length;e+=4)if(y[e]>127.5){this._earlyReturn=!0;return}}else{let e=[[a.x,a.y],[a.x,a.y+a.height],[a.x+a.width,a.y+a.height],[a.x+a.width,a.y],[a.x,a.y]],t=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;if(b(t,[e])){this._earlyReturn=!0;return}}}_hitTestStroke(e,t){let n=null;if(T(e)){let t=e;n=[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}else if(C(e))n=e.rings;else if(w(e))n=e.paths;else return;if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]),r=R(t,j.CIMSolidStroke.width)*this.geomUnitsPerPoint(),i=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();S(e,n,r/2+i)&&(this._earlyReturn=!0)}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,n)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType=`point`,this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class Ce extends Y{constructor(e,t,n,r){super(t,n),this._applyAdditionalRenderProps=r,this._colorSubstitutionHelper=new ce,this._ctx=e}drawSolidFill(e,t){if(!e)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else if(E(e))console.log(`CanvasDrawHelper.drawSolidFill - No implementation!`);else return;let n=this._ctx;n.fillStyle=typeof t==`string`?t:`rgba(`+Math.round(t[0])+`,`+Math.round(t[1])+`,`+Math.round(t[2])+`,`+(t[3]??255)/255+`)`,n.fill(`evenodd`)}drawSolidStroke(e,t,n,r,i,a){if(!e||!t||n===0)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!1);else if(T(e))this._buildPath(X(e).rings,!0);else{console.log(`CanvasDrawHelper.drawSolidStroke isn't implemented!`);return}let o=this._ctx;o.strokeStyle=typeof t==`string`?t:`rgba(`+Math.round(t[0])+`,`+Math.round(t[1])+`,`+Math.round(t[2])+`,`+(t[3]??255)/255+`)`,o.lineWidth=Math.max(this.transformSize(n),K),this._setCapStyle(r),this._setJoinStyle(i),o.miterLimit=a,o.stroke()}pushClipPath(e){if(this._ctx.save(),C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else return;this._ctx.clip(`evenodd`)}popClipPath(){this._ctx.restore()}drawImage(e,t){let{colorSubstitutions:n,url:r,tintColor:i}=e,a=R(e.scaleX,1),o=this._resourceManager.getResource(r);if(o==null)return;let s=t*(o.width/o.height),c=t;t||(s=o.width,c=o.height);let l=z(r)||`src`in o&&z(o.src),u=`getFrame`in o?M(o):o;n&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,n)),this._applyAdditionalRenderProps&&!l&&i&&(u=this._colorSubstitutionHelper.tintImageData(u,i));let d=this.transformPt([0,0]),[f,p]=this.getTransformAngle(),m=this.transformSize(1),h=this._ctx;h.save(),h.setTransform({m11:a*m*f,m12:a*m*p,m21:-m*p,m22:m*f,m41:d[0],m42:d[1]}),h.drawImage(u,-s/2,-c/2,s,c),h.restore()}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||=new L;let n=Q(e,this.transformSize(a)),r=F({textString:t,font:n.font,symbol:e,supportsRichText:I(t)}),i=r?this._textRasterizer.rasterizeRichText(r,n):this._textRasterizer.rasterizeText(t,n);if(!i)return;let{size:o,anchorX:s,anchorY:c,canvas:l}=i,u=o[0]*(s+.5),d=o[1]*(c-.5),f=this._ctx,p=this.transformPt([0,0]),[m,h]=this.getTransformAngle();f.save(),f.setTransform({m11:1*m,m12:1*h,m21:-1*h,m22:1*m,m41:p[0]-1*u,m42:p[1]+1*d}),f.drawImage(l,0,0),f.restore()}drawPictureFill(e,t){if(!e)return;let{colorSubstitutions:n,height:r,offsetX:i,offsetY:a,rotation:o,scaleX:s,tintColor:c,url:l}=t,u=this._resourceManager.getResource(l);if(u==null)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else if(E(e))console.log(`CanvasDrawHelper.drawPictureFill - No implementation!`);else return;let d=this._ctx,f=z(l)||`src`in u&&z(u.src),p=`getFrame`in u?M(u):u;n&&(p=this._colorSubstitutionHelper.applyColorSubstitution(p,n));let m;if(this._applyAdditionalRenderProps){f||c&&(p=this._colorSubstitutionHelper.tintImageData(p,c)),m=d.createPattern(p,`repeat`);let e=this.transformSize(1);o||=0,i=i?e*i:0,a=a?e*a:0,r&&=e*r;let t=r?r/u.height:1,n=s&&r?s*r/u.width:1;if(o!==0||t!==1||n!==1||i!==0||a!==0){let e=new DOMMatrix;e.rotateSelf(0,0,-o).translateSelf(i,a).scaleSelf(n,t,1),m.setTransform(e)}}else m=d.createPattern(p,`repeat`);d.save(),d.fillStyle=m,d.fill(`evenodd`),d.restore()}drawPictureStroke(e,n){if(!e)return;let{colorSubstitutions:r,capStyle:i,joinStyle:a,miterLimit:s,tintColor:c,url:l,width:u}=n,d=this._resourceManager.getResource(l);if(d==null)return;let f;if(C(e))f=e.rings;else if(w(e))f=e.paths;else if(T(e))f=X(e).rings;else if(E(e)){console.log(`CanvasDrawHelper.drawPictureStroke - No implementation!`);return}else return;u||=d.width;let p=z(l)||`src`in d&&z(d.src),m=`getFrame`in d?M(d):d;r&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,r)),this._applyAdditionalRenderProps&&(p||c&&(m=this._colorSubstitutionHelper.tintImageData(m,c)));let h=Math.max(this.transformSize(o(u)),.5),g=h/m.width,_=this._ctx,v=_.createPattern(m,`repeat-y`);_.save(),this._setCapStyle(i),this._setJoinStyle(a),s!==void 0&&(_.miterLimit=s),_.lineWidth=h;let y,b;for(let e of f)if(e=t(e),$(e),!(!e||e.length<=1)){y=this.transformPt(e[0]);for(let t=1;t<e.length;t++){b=this.transformPt(e[t]);let n=Te(y,b),r=new DOMMatrix;r.translateSelf(0,y[1]-h/2).scaleSelf(g,g,1).rotateSelf(0,0,90-n),v.setTransform(r),_.strokeStyle=v,_.beginPath(),_.moveTo(y[0],y[1]),_.lineTo(b[0],b[1]),_.stroke(),y=b}}_.restore()}drawGradientFill(e,t){if(!e)return;let n;if(C(e))n=e.rings;else if(w(e))n=e.paths;else if(T(e))n=X(e).rings;else{q().error(`Unable to draw gradient fill`);return}this._buildPath(n,!0);let{angle:i,gradientMethod:a,gradientSize:s,gradientSizeUnits:c}=t,l=j.CIMGradientFill,g=t.gradientType??l.gradientType,_=-r(i??0),v=u();for(let e of n){let t=e?e.length:0;if(t>1)for(let n=0;n<t;n++){let t=this.transformPt(e[n]);(a===`Linear`||a===`Rectangular`)&&(t=N(t,-_)),d(v,t)}}let[y,b,x,S]=v,E=this._ctx;switch(E.save(),a){case`Buffered`:q().error(`Gradient method "${a}" currently unsupported.`);break;case`Linear`:{let e=(b+S)/2,n=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(x-y),[r,i]=g===`Discrete`?[x,x-n]:[y+n,y],a=N([r,e],_),u=N([i,e],_),d=E.createLinearGradient(a[0],a[1],u[0],u[1]);P(d,t),E.fillStyle=d,E.fill(`evenodd`);break}case`Circular`:{let e=f(v),n=h(v)/2,r=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*n,[i,a]=g===`Discrete`?[n,n-r]:[r,0],u=E.createRadialGradient(e[0],e[1],i,e[0],e[1],a);P(u,t),E.fillStyle=u,E.fill(`evenodd`);break}case`Rectangular`:{let n=f(v),r=n[0],i=n[1],a=N(n,_),u=(n,r,i,o,s,c,l,u)=>{E.save(),this.pushClipPath(e);let d=N([s,c],_),f=N([l,u],_);E.beginPath(),E.moveTo(a[0],a[1]),E.lineTo(d[0],d[1]),E.lineTo(f[0],f[1]),E.lineTo(a[0],a[1]),E.clip();let p=N([n,r],_),m=N([i,o],_),h=E.createLinearGradient(p[0],p[1],m[0],m[1]);P(h,t),E.fillStyle=h,E.fill(`evenodd`),E.restore()},d=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(p(v)/2),[h,C]=g===`Discrete`?[x,x-d]:[r+d,r];u(h,i,C,i,x,b,x,S),[h,C]=g===`Discrete`?[y,y+d]:[r-d,r],u(h,i,C,i,y,S,y,b),d=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(m(v)/2);let[w,T]=g===`Discrete`?[S,S-d]:[i+d,i];u(r,w,r,T,x,S,y,S),[w,T]=g===`Discrete`?[b,b+d]:[i-d,i],u(r,w,r,T,y,b,x,b);break}}E.restore()}drawGradientStroke(e,n){let{capStyle:r,gradientMethod:i,gradientSize:a,gradientSizeUnits:s,joinStyle:c,miterLimit:l,width:u}=n;if(!e||u===0)return;let d;if(C(e))d=e.rings;else if(w(e))d=e.paths;else if(T(e))d=X(e).rings;else{q().error(`Unable to draw gradient stroke`);return}let f=n.gradientType??j.CIMGradientStroke.gradientType,p=Math.max(this.transformSize(o(u)),.5),m=this._ctx;m.save(),this._setCapStyle(r),this._setJoinStyle(c),l!==void 0&&(m.miterLimit=l),m.lineWidth=p;let h,g;for(let e of d){if(e=t(e),$(e),!e||e.length<=1)continue;let r=0;h=this.transformPt(e[0]);for(let t=1;t<e.length;t++){g=this.transformPt(e[t]);let n=g[0]-h[0],i=g[1]-h[1];r+=Math.sqrt(n*n+i*i),h=g}let c=s===`Absolute`?this.transformSize(o(a)):B(a,j.CIMGradientStroke.gradientSize)*(i===`AcrossLine`?p:r),l=0;h=this.transformPt(e[0]);for(let t=1;t<e.length;t++){g=this.transformPt(e[t]);let a=g[0]-h[0],o=g[1]-h[1],s=Math.sqrt(a*a+o*o),u,d,_,v;switch(i){case`AcrossLine`:{let[e,t]=N([a/s,o/s],-Math.PI/2),n=p/2,r=f===`Discrete`?n:c-n;u=(h[0]+g[0])/2+e*r,d=(h[1]+g[1])/2+t*r,_=u-e*c,v=d-t*c;break}case`AlongLine`:{let e=a/s,t=o/s;f===`Discrete`?(u=h[0]-e*l,d=h[1]-t*l,_=u+e*c,v=d+t*c):(_=h[0]+e*(r-l),v=h[1]+t*(r-l),u=_-e*c,d=v-t*c);break}default:q().error(`Unrecognized gradient method:`,i),m.restore();return}let y=m.createLinearGradient(u,d,_,v);P(y,n),m.strokeStyle=y,m.beginPath(),m.moveTo(h[0],h[1]),m.lineTo(g[0],g[1]),m.stroke(),l+=s,h=g}}m.restore()}_buildPath(e,t){let n=this._ctx;if(n.beginPath(),e)for(let r of e){let e=r?r.length:0;if(e>1){let i=this.transformPt(r[0]);n.moveTo(i[0],i[1]);for(let t=1;t<e;t++)i=this.transformPt(r[t]),n.lineTo(i[0],i[1]);t&&n.closePath()}}}_setCapStyle(e){switch(e){case`Butt`:this._ctx.lineCap=`butt`;break;case`Round`:this._ctx.lineCap=`round`;break;case`Square`:this._ctx.lineCap=`square`}}_setJoinStyle(e){switch(e){case`Bevel`:this._ctx.lineJoin=`bevel`;break;case`Round`:this._ctx.lineJoin=`round`;break;case`Miter`:this._ctx.lineJoin=`miter`}}}function we(e,t,n){let r=R(e.separation,j.CIMHatchFill.separation)*n,i=R(e.rotation);if(r===0)return null;r<0&&(r=-r);let a=0,o=.5*r;for(;a>o;)a-=r;for(;a<-o;)a+=r;let s=_();v(s,t),s[0]-=o,s[1]-=o,s[2]+=o,s[3]+=o;let c=[[s[0],s[1]],[s[0],s[3]],[s[2],s[3]],[s[2],s[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;let l=Math.cos(i*G),u=Math.sin(i*G),d=-r*u,f=r*l,p=R(e.offsetX)*n,m=R(e.offsetY)*n;a=p*u-m*l;let h,g,y,b;h=y=Number.MAX_VALUE,g=b=-Number.MAX_VALUE;for(let e of c){let t=e[0],n=e[1],r=l*t+u*n,i=-u*t+l*n;h=Math.min(h,r),y=Math.min(y,i),g=Math.max(g,r),b=Math.max(b,i)}y=Math.floor(y/r)*r;let x=l*h-u*y-d*a/r,S=u*h+l*y-f*a/r,C=l*g-u*y-d*a/r,w=u*g+l*y-f*a/r,T=1+Math.round((b-y)/r),E=[];for(let e=0;e<T;e++)x+=d,S+=f,C+=d,w+=f,E.push([[x,S],[C,w]]);return{paths:E}}function Te(e,t){let n=t[0]-e[0],r=t[1]-e[1];return 180/Math.PI*Math.atan2(r,n)}const X=e=>e?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Z=(e,t,n)=>{switch(e){case`ExtraLeading`:return 1+t/n;case`Multiple`:return t;case`Exact`:return t/n}};function Q(t,n=1){let r=he(t),i=fe(t.fontStyleName),a=t.fontFamilyName??e,{weight:o,style:s}=i,c=n*(t.height||5),l=ge(t.horizontalAlignment),u=V(t.verticalAlignment),d=H(t),f=H(t.haloSymbol),p=f==null?0:n*(t.haloSize??0),m=U(t.symbol),h=n*(W(t.symbol)||0),g=t.callout?.type===`CIMBackgroundCallout`?t.callout.backgroundSymbol:null,_=H(g),v=W(g),y=U(g);return{color:d,size:c,horizontalAlignment:l,verticalAlignment:u,font:{family:a,style:ve(s),weight:_e(o),decoration:r},outline:{size:h||0,color:m},halo:{size:p||0,color:f,style:s},backgroundColor:_,borderLine:v!=null&&y!=null?{size:v,color:y}:null,pixelRatio:1,premultiplyColors:!0}}function $(e){let t=e[0],n=1,r,i,a,o,s;for(;n<e.length;)r=e[n][0]-t[0],i=e[n][1]-t[1],o=r===0?Math.PI/2:i/r,a!==void 0&&Math.abs(o-a)<=1e-4?(e.splice(n-1,1),t=s):(s=t,t=e[n],n++),a=o}export{Y as CIMSymbolDrawHelper,Ce as CanvasDrawHelper,xe as EnvDrawHelper,Se as HittestDrawHelper,J as Transformation,G as cDegToRad,Z as lineGapType2LineHeight};
2
+ import{defaultFontFamily as e}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as t}from"../../core/lang.js";import n from"../../core/Logger.js";import{deg2rad as r}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{onePixelInPoints as a,pt2px as o,px2pt as s,onePointInPixels as c}from"../../core/screenUtils.js";import{GeometryCursor as l}from"../../geometry/GeometryCursor.js";import{empty as u,expandPointInPlace as d,center as f,width as p,height as m,diagonal as h,fromValues as g,create as _}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as v}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as y}from"../../geometry/support/centroid.js";import{targetIntersectsPolygon as b,pointInPolygon as x,nearLine as S}from"../../geometry/support/intersectsBase.js";import{isPolygon as C,isPolyline as w,isExtent as T,isMultipoint as E,isPoint as D}from"../../geometry/support/jsonTypeUtils.js";import{destroyHiddenSvg as O,createHiddenSvg as ee,createSvgElement as te}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as ne,glyphSize as k,hittestToleranceSmallSymbol as A,hittestSmallSymbolThreshold as re}from"../../views/2d/engine/webgl/definitions.js";import{shapeTextResource as ie}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as ae,getLineWidth as oe}from"../../views/2d/layers/graphics/graphicsUtils.js";import{SimpleEffectCursor as se}from"./CIMEffects.js";import ce from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as le,getPlacementOperator as ue}from"./CIMOperators.js";import{Placement as de}from"./CIMPlacements.js";import{defaultCIMValues as j}from"./defaultCIMValues.js";import{fromCIMFontStyle as fe}from"./fromCIMFontStyle.js";import{getFirstFrame as M}from"./imageUtils.js";import{rotate as N}from"./mathUtils.js";import{addColorStops as P}from"./rasterizingUtils.js";import pe from"./Rect.js";import{parseRichTextRuns as F,hasRichTextFormattingTags as I}from"./richTextUtils.js";import L from"./TextRasterizer.js";import{getNumericValue as R,isSVGImage as z,getRelativeGradientSize as B,getEffectsInflateSize as me,fromCIMFontDecoration as he,fromCIMHorizontalAlignment as ge,fromCIMVerticalAlignment as V,getFillColor as H,getStrokeColor as U,getStrokeWidth as W,getFontWeight as _e,getFontStyle as ve,isCIMFill as ye,getSize as be}from"./utils.js";const G=Math.PI/180,K=.5,q=()=>n.getLogger(`esri.symbols.cim.CIMSymbolDrawHelper`);class J{constructor(e){this._t=e}static createIdentity(){return new J([1,0,0,0,1,0])}clone(){let e=this._t;return new J(e.slice())}transform(e){let t=this._t;return[t[0]*e[0]+t[1]*e[1]+t[2],t[3]*e[0]+t[4]*e[1]+t[5]]}static createScale(e,t){return new J([e,0,0,0,t,0])}scale(e,t){let n=this._t;return n[0]*=e,n[1]*=e,n[2]*=e,n[3]*=t,n[4]*=t,n[5]*=t,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(e,t){return new J([0,0,e,0,0,t])}translate(e,t){let n=this._t;return n[2]+=e,n[5]+=t,this}static createRotate(e){let t=Math.cos(e),n=Math.sin(e);return new J([t,-n,0,n,t,0])}rotate(e){return J.multiply(this,J.createRotate(e),this)}angle(){let e=this._t[0],t=this._t[3],n=Math.sqrt(e*e+t*t);return[e/n,t/n]}static multiply(e,t,n){let r=e._t,i=t._t,a=r[0]*i[0]+r[3]*i[1],o=r[1]*i[0]+r[4]*i[1],s=r[2]*i[0]+r[5]*i[1]+i[2],c=r[0]*i[3]+r[3]*i[4],l=r[1]*i[3]+r[4]*i[4],u=r[2]*i[3]+r[5]*i[4]+i[5],d=n._t;return d[0]=a,d[1]=o,d[2]=s,d[3]=c,d[4]=l,d[5]=u,n}invert(){let e=this._t,t=e[0]*e[4]-e[1]*e[3];if(t===0)return new J([0,0,0,0,0,0]);t=1/t;let n=(e[1]*e[5]-e[2]*e[4])*t,r=(e[2]*e[3]-e[0]*e[5])*t,i=e[4]*t,a=-e[1]*t,o=-e[3]*t,s=e[0]*t;return new J([i,a,n,o,s,r])}}class Y{constructor(e,t){this._resourceManager=e,this._transfos=[],this._sizeTransfos=[],this._textScaling=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new de,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(t||J.createIdentity()),this._sizeTransfos.push(t?t.scaleRatio():1),this._textScaling.push(1)}setTransform(e,t){this._transfos=[e||J.createIdentity()],this._sizeTransfos=[t||(e?e.scaleRatio():1)],this._textScaling=[1]}setGeomUnitsPerPoint(e){this._geomUnitsPerPoint=e}transformPt(e){return this._transfos[this._transfos.length-1].transform(e)}transformSize(e){return e*this._sizeTransfos[this._sizeTransfos.length-1]}scaleText(e){return e*this._textScaling[this._textScaling.length-1]}reverseTransformPt(e){return this._transfos[this._transfos.length-1].invert().transform(e)}reverseTransformSize(e){return e/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(e){return e/this._transfos[this._transfos.length-1].scaleRatio()}reverseScaleText(e){return e/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(e,t=!1,n=1){let r=t?e.scaleRatio():1;J.multiply(e,this.back(),e),this._transfos.push(e),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r),this._textScaling.push(this._textScaling[this._textScaling.length-1]*n)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1),this._textScaling.splice(-1,1)}drawSymbol(e,t,n){if(e)switch(e.type){case`CIMPointSymbol`:case`CIMLineSymbol`:case`CIMPolygonSymbol`:this.drawMultiLayerSymbol(e,t);break;case`CIMTextSymbol`:this.drawTextSymbol(e,t,n)}}drawMultiLayerSymbol(e,t){if(!e||!t)return;let n=e.symbolLayers;if(!n)return;let r=e.effects;if(r&&r.length>0){let e=this.executeEffects(r,t);if(e){let t=e.next();for(;t;)this.drawSymbolLayers(n,t.asJSON()),t=e.next()}}else this.drawSymbolLayers(n,t)}executeEffects(e,t){let n=this.geomUnitsPerPoint(),r=me(e),i=new se(l.fromJSONCIM(t));for(let a of e){let e=le(a);e&&(i=e.execute(i,a,{geomUnitsPerPoint:n,tileKey:null,maxInflateSize:r,scale:null,spatialReference:t.spatialReference,preventClipping:!1}))}return i}drawSymbolLayers(e,t){let n=e.length;for(;n--;){let r=e[n];if(!r||r.enable===!1)continue;let i=r.effects;if(i&&i.length>0){let e=this.executeEffects(i,t);if(e){let t=null;for(;(t=e.next())&&(this.drawSymbolLayer(r,t.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(r,t);if(this._earlyReturn)return}}drawSymbolLayer(e,t){switch(e.type){case`CIMSolidFill`:this.drawSolidFill(t,e.color,e.path);break;case`CIMHatchFill`:this.drawHatchFill(t,e);break;case`CIMPictureFill`:this.drawPictureFill(t,e);break;case`CIMGradientFill`:this.drawGradientFill(t,e);break;case`CIMSolidStroke`:this.drawSolidStroke(t,e.color,e.width,e.capStyle,e.joinStyle,e.miterLimit,e.path);break;case`CIMPictureStroke`:this.drawPictureStroke(t,e);break;case`CIMGradientStroke`:this.drawGradientStroke(t,e);break;case`CIMCharacterMarker`:case`CIMPictureMarker`:case`CIMVectorMarker`:this.drawMarkerLayer(e,t)}}drawHatchFill(e,t){let n=we(t,e,this.geomUnitsPerPoint());n&&(this.pushClipPath(e),this.drawMultiLayerSymbol(t.lineSymbol,n),this.popClipPath())}drawPictureFill(e,t){}drawGradientFill(e,t){}drawPictureStroke(e,t){}drawGradientStroke(e,t){}drawMarkerLayer(e,t){let n=e.markerPlacement;if(n){let r=ue(n);if(r){let i=n.type===`CIMMarkerPlacementInsidePolygon`||n.type===`CIMMarkerPlacementPolygonCenter`&&n.clipAtBoundary;i&&this.pushClipPath(t);let a=r.execute(l.fromJSONCIM(t),n,this.geomUnitsPerPoint(),null);if(a){let t=null;for(;(t=a.next())&&(this.drawMarker(e,t),!this._earlyReturn););}i&&this.popClipPath()}}else{let n=this._placementPool.acquire();if(D(t))n.tx=t.x,n.ty=t.y,this.drawMarker(e,n);else if(C(t)){let r=y(t);r&&([n.tx,n.ty]=r,this.drawMarker(e,n))}else if(w(t)){for(let r of t.paths)for(let t of r)if(n.tx=t[0],n.ty=t[1],this.drawMarker(e,n),this._earlyReturn)break}else for(let r of t.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(e,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(e,t){switch(e.type){case`CIMCharacterMarker`:case`CIMPictureMarker`:this.drawPictureMarker(e,t);break;case`CIMVectorMarker`:this.drawVectorMarker(e,t)}}drawPictureMarker(e,t){if(!e)return;let n=this._resourceManager.getResource(e.url),r=R(e.size,j.CIMPictureMarker.size);if(n==null||r<=0)return;let i=n.width,a=n.height;if(!i||!a)return;let o=i/a,s=R(e.scaleX,1),c=J.createIdentity(),l=e.anchorPoint;if(l){let t=l.x,n=l.y;e.anchorPointUnits!==`Absolute`&&(t*=r*o*s,n*=r),c.translate(-t,-n)}let u=R(e.rotation);e.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&c.rotate(u*G);let d=R(e.offsetX),f=R(e.offsetY);if(d||f){if(this._mapRotation){let e=G*this._mapRotation,t=Math.cos(e),n=Math.sin(e),r=d*t-f*n,i=d*n+f*t;d=r,f=i}c.translate(d,f)}let p=this.geomUnitsPerPoint();p!==1&&c.scale(p,p);let m=t.getAngle();m&&c.rotate(m),c.translate(t.tx,t.ty),this.push(c),this.drawImage(e,r),this.pop()}drawVectorMarker(e,t){if(!e)return;let n=e.markerGraphics;if(!n)return;let r=R(e.size,j.CIMVectorMarker.size),i=e.frame,a=i?i.ymax-i.ymin:0,o=r&&a?r/a:1,s=J.createIdentity();i&&s.translate(-(i.xmax+i.xmin)*.5,-(i.ymax+i.ymin)*.5);let c=e.anchorPoint;if(c){let t=c.x,n=c.y;e.anchorPointUnits===`Absolute`?(t/=o,n/=o):i&&(t*=i.xmax-i.xmin,n*=i.ymax-i.ymin),s.translate(-t,-n)}o!==1&&s.scale(o,o);let l=R(e.rotation);e.rotateClockwise&&(l=-l),this._mapRotation&&(l+=this._mapRotation),l&&s.rotate(l*G);let u=R(e.offsetX),d=R(e.offsetY);if(u||d){if(this._mapRotation){let e=G*this._mapRotation,t=Math.cos(e),n=Math.sin(e),r=u*t-d*n,i=u*n+d*t;u=r,d=i}s.translate(u,d)}let f=this.geomUnitsPerPoint();f!==1&&s.scale(f,f);let p=t.getAngle();p&&s.rotate(p),s.translate(t.tx,t.ty);let m=e.scaleSymbolsProportionally?1:o;this.push(s,e.scaleSymbolsProportionally,m);for(let e of n){e?.symbol&&e.geometry||q().error(`Invalid marker graphic`,e);let t=e.textString;if(typeof t==`number`&&(t=t.toString()),this.drawSymbol(e.symbol,e.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(e,t,n){if(!e||!D(t)||R(e.height,j.CIMTextSymbol.height)<=0)return;let r=J.createIdentity(),i=R(e.angle);i=-i,i&&r.rotate(i*G);let a=R(e.offsetX),o=R(e.offsetY);(a||o)&&r.translate(a,o);let s=this.geomUnitsPerPoint();s!==1&&r.scale(s,s),r.translate(t.x,t.y),this.push(r),this.drawText(e,n),this.pop()}}class xe extends Y{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new pe(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return g(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(!(!e||this._clipCount>0)){if(C(e))this._processPath(e.rings,0);else if(w(e))this._processPath(e.paths,0);else if(T(e)){let t=X(e);t&&this._processPath(t.rings,0)}else console.error(`drawSolidFill Unexpected geometry type!`)}}drawSolidStroke(e,t,n){if(!e||this._clipCount>0||n==null||n<=0)return;let r=Math.max(this.transformSize(R(n,j.CIMSolidStroke.width))*.5,.5*K);if(C(e))this._processPath(e.rings,r);else if(w(e))this._processPath(e.paths,r);else if(T(e)){let t=X(e);t&&this._processPath(t.rings,r)}else console.error(`drawSolidStroke unexpected geometry type!`)}drawMarkerLayer(e,t){C(t)&&e.markerPlacement&&(e.markerPlacement.type===`CIMMarkerPlacementInsidePolygon`||e.markerPlacement.type===`CIMMarkerPlacementPolygonCenter`&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){let{url:n}=e,r=R(e.scaleX,1),i=r*t,a=t,o=this._resourceManager.getResource(n);if(o!=null){let e=o.height/o.width;i=r*(t?e>1?t:t/e:o.width),a=t?e>1?t*e:t:o.height}this._merge(this.transformPt([-i/2,-a/2]),0),this._merge(this.transformPt([-i/2,a/2]),0),this._merge(this.transformPt([i/2,-a/2]),0),this._merge(this.transformPt([i/2,a/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||=new L;let n=Q(e),r=F({textString:t,font:n.font,symbol:e,supportsRichText:I(t)}),[i,a]=r?this._textRasterizer.computeRichTextSize(r,n):this._textRasterizer.computeTextSize(t,n);i=s(i),a=s(a);let o=this.transformSize(1)*this.reverseTransformScalar(1);i*=o,a*=o;let c=e.horizontalAlignment??j.CIMTextSymbol.horizontalalignment,l=e.verticalAlignment??j.CIMTextSymbol.verticalalignment,u=0;switch(c){case`Left`:u=i/2;break;case`Right`:u=-i/2}let d=0;switch(l){case`Bottom`:d=a/2;break;case`Top`:d=-a/2;break;case`Baseline`:d=a/6}this._merge(this.transformPt([-i/2+u,-a/2+d]),0),this._merge(this.transformPt([-i/2+u,a/2+d]),0),this._merge(this.transformPt([i/2+u,-a/2+d]),0),this._merge(this.transformPt([i/2+u,a/2+d]),0)}_processPath(e,t){if(e)for(let n of e){let e=n?n.length:0;if(e>1){this._merge(this.transformPt(n[0]),t);for(let r=1;r<e;r++)this._merge(this.transformPt(n[r]),t)}}}_merge(e,t){e[0]-t<this._xmin&&(this._xmin=e[0]-t),e[0]+t>this._xmax&&(this._xmax=e[0]+t),e[1]-t<this._ymin&&(this._ymin=e[1]-t),e[1]+t>this._ymax&&(this._ymax=e[1]+t)}}class Se extends Y{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=O(this._svg),this._path=null,this._canvas=null}hitTest(e,t,n,r){let{textInfo:i,mapRotation:a,resolution:o,searchDist:l,hittestType:u,isScreenAligned:d}=r;this._resetHittest();let f=o*c;switch(this.setGeomUnitsPerPoint(f),u){case`point`:if(e.length!==1)return q().error(`Unexpected hittest area`,e),!1;this._hittestType=`point`,this._searchDistPoint=l/2/f,this._searchTarget=[[e[0].x,e[0].y]];break;case`rect`:if(e.length!==4)return q().error(`Unexpected hittest area`,e),!1;this._hittestType=`rect`,this._searchDistPoint=0,this._searchTarget=e.map(e=>[e.x,e.y]);break;case`polygon`:this._hittestType=`polygon`,this._searchDistPoint=0,this._searchTarget=e.map(e=>[e.x,e.y])}if(this._textInfo=i,this._mapRotation=d?a:0,!has(`esri-mobile`)){let e=s(A*window.devicePixelRatio),n=s(re);(t?.type!==`CIMLineSymbol`&&t?.type!==`CIMPolygonSymbol`||!t.symbolLayers?.some(ye))&&t?.type!==`CIMMeshSymbol`&&(be(t)??0)<n&&(this._searchDistPoint=e)}return this._earlyReturn=!1,this.drawSymbol(t,n),this._earlyReturn}executeEffects(e,t){return e.at(-1)?.type===`CIMGeometricEffectDashes`&&(e=e.slice(0,-1)),super.executeEffects(e,t)}drawSolidFill(e,t,n){n==null?this._hitTestFill(e):this._hittestSvgPath(e,n,!0)}drawHatchFill(e,t){this._hitTestFill(e)}drawPictureFill(e,t){this._hitTestFill(e)}drawGradientFill(e,t){this._hitTestFill(e)}drawSolidStroke(e,t,n,r,i,a,o){o==null?this._hitTestStroke(e,n):this._hittestSvgPath(e,o,!1,n)}drawPictureStroke(e,t){this._hitTestStroke(e,t.width)}drawGradientStroke(e,t){this._hitTestStroke(e,t.width)}drawMarkerLayer(e,t){e.markerPlacement&&(e.markerPlacement.type===`CIMMarkerPlacementInsidePolygon`||e.markerPlacement.type===`CIMMarkerPlacementPolygonCenter`&&e.markerPlacement.clipAtBoundary)?this._hitTestFill(t):super.drawMarkerLayer(e,t)}drawTextSymbol(e,t,n){if(!e||!D(t)||R(e.height,j.CIMTextSymbol.height)<=0)return;let r=J.createIdentity(),i=this.geomUnitsPerPoint();i!==1&&r.scale(i,i),r.translate(t.x,t.y),this.push(r),this.drawText(e,n),this.pop()}pushClipPath(e){}popClipPath(){}drawImage(e,t){let{url:n}=e,r=R(e.scaleX,1),i=this._resourceManager.getResource(n);if(i==null||i.height===0||t===0)return;let a=t*this.geomUnitsPerPoint(),o=a*r*(i.width/i.height);if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]),t=this._searchDistPoint;Math.abs(e[0])<o/2+t&&Math.abs(e[1])<a/2+t&&(this._earlyReturn=!0)}else{let e=o/2,t=a/2,n=[[-e,t],[e,t],[e,-t],[-e,-t],[-e,t]],r=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(r,[n])&&(this._earlyReturn=!0)}}drawText(e,t){let n=this._textInfo;if(!n)return;let r=n.get(e);if(!r||!p(r.glyphMosaicItems))return;let i=ae(R(e.height,j.CIMTextSymbol.height)),{lineGapType:a,lineGap:o}=e,s=a?Z(a,R(o),i):0,c=e.horizontalAlignment??j.CIMTextSymbol.horizontalalignment,l=e.verticalAlignment??j.CIMTextSymbol.verticalalignment,u=e.callout?.type===`CIMBackgroundCallout`,d=ie(r.glyphMosaicItems,{scale:i/k,angle:R(e.angle),xOffset:R(e.offsetX),yOffset:R(e.offsetY),horizontalAlignment:c,verticalAlignment:l,maxLineWidth:oe(e.lineWidth),lineHeight:ne*Math.max(.25,Math.min(s||1,4)),decoration:e.font.decoration||`none`,useCIMAngleBehavior:!1,hasBackground:u}),f=this.reverseScaleText(1);for(let e of d.glyphs){let t=e.offsets,n=[[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(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]);x(e,[n])&&(this._earlyReturn=!0)}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,[n])&&(this._earlyReturn=!0)}}function p(e){return e.type===`glyphs`?e.glyphs.length>0:e.runs.some(e=>e.glyphs.glyphs.length>0)}}_hitTestFill(e){let t=null;if(T(e)){let n=e;t=[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]}else if(C(e))t=e.rings;else if(w(e))t=e.paths;else return;if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]);if(x(e,t)&&(this._earlyReturn=!0),!this._earlyReturn){let n=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();S(e,t,n)&&(this._earlyReturn=!0)}}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,t)&&(this._earlyReturn=!0)}}_getSvgPath(){return(this._svg==null||this._path==null)&&(this._svg??=ee(),this._path??=te(`path`),this._svg.appendChild(this._path)),this._path}_getCanvasContext(e,t){return this._canvas??=document.createElement(`canvas`),this._canvas.width=e,this._canvas.height=t,this._canvas.getContext(`2d`,{willReadFrequently:!0})}_hittestSvgPath(e,t,n,r=0){let i=_();v(i,e);let a={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute(`d`,t);let s=o.getBBox();if(this._hittestType===`point`){let e=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]),o=Math.max(s.width/a.width,s.height/a.height),c=1,l=2*e*o;l<1&&(c=2/l,o*=c,s.x*=c,s.y*=c,s.width*=c,s.height*=c);let u=1+r*o/2,d=this._getCanvasContext(s.width+u*2,s.height+u*2);d.setTransform(c,0,0,c,-s.x+u,-s.y+u);let f=new Path2D(t);n?d.fill(f):(d.lineWidth=o/c*r,d.stroke(f));let p=(a.width*o-s.width)/2,m=(a.height*o-s.height)/2,h=Math.floor((i[0]-a.x-e)*o-p+u),g=Math.floor((a.height-(i[1]-a.y)-e)*o+m+u),_=Math.ceil(2*e*o),v=Math.ceil(2*e*o),y=d.getImageData(h,g,_,v).data;for(let e=3;e<y.length;e+=4)if(y[e]>127.5){this._earlyReturn=!0;return}}else{let e=[[a.x,a.y],[a.x,a.y+a.height],[a.x+a.width,a.y+a.height],[a.x+a.width,a.y],[a.x,a.y]],t=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;if(b(t,[e])){this._earlyReturn=!0;return}}}_hitTestStroke(e,t){let n=null;if(T(e)){let t=e;n=[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}else if(C(e))n=e.rings;else if(w(e))n=e.paths;else return;if(this._hittestType===`point`){let e=this.reverseTransformPt(this._searchTarget[0]),r=R(t,j.CIMSolidStroke.width)*this.geomUnitsPerPoint(),i=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();S(e,n,r/2+i)&&(this._earlyReturn=!0)}else{let e=this.isEmbedded()?this._searchTarget.map(e=>this.reverseTransformPt(e)):this._searchTarget;b(e,n)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType=`point`,this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class Ce extends Y{constructor(e,t,n,r){super(t,n),this._applyAdditionalRenderProps=r,this._colorSubstitutionHelper=new ce,this._ctx=e}drawSolidFill(e,t){if(!e)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else if(E(e))console.log(`CanvasDrawHelper.drawSolidFill - No implementation!`);else return;let n=this._ctx;n.fillStyle=typeof t==`string`?t:`rgba(`+Math.round(t[0])+`,`+Math.round(t[1])+`,`+Math.round(t[2])+`,`+(t[3]??255)/255+`)`,n.fill(`evenodd`)}drawSolidStroke(e,t,n,r,i,a){if(!e||!t||n===0)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!1);else if(T(e))this._buildPath(X(e).rings,!0);else{console.log(`CanvasDrawHelper.drawSolidStroke isn't implemented!`);return}let o=this._ctx;o.strokeStyle=typeof t==`string`?t:`rgba(`+Math.round(t[0])+`,`+Math.round(t[1])+`,`+Math.round(t[2])+`,`+(t[3]??255)/255+`)`,o.lineWidth=Math.max(this.transformSize(n),K),this._setCapStyle(r),this._setJoinStyle(i),o.miterLimit=a,o.stroke()}pushClipPath(e){if(this._ctx.save(),C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else return;this._ctx.clip(`evenodd`)}popClipPath(){this._ctx.restore()}drawImage(e,t){let{colorSubstitutions:n,url:r,tintColor:i}=e,a=R(e.scaleX,1),o=this._resourceManager.getResource(r);if(o==null)return;let s=t*(o.width/o.height),c=t;t||(s=o.width,c=o.height);let l=z(r)||`src`in o&&z(o.src),u=`getFrame`in o?M(o):o;n&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,n)),this._applyAdditionalRenderProps&&!l&&i&&(u=this._colorSubstitutionHelper.tintImageData(u,i));let d=this.transformPt([0,0]),[f,p]=this.getTransformAngle(),m=this.transformSize(1),h=this._ctx;h.save(),h.setTransform({m11:a*m*f,m12:a*m*p,m21:-m*p,m22:m*f,m41:d[0],m42:d[1]}),h.drawImage(u,-s/2,-c/2,s,c),h.restore()}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||=new L;let n=Q(e,this.transformSize(a)),r=F({textString:t,font:n.font,symbol:e,supportsRichText:I(t)}),i=r?this._textRasterizer.rasterizeRichText(r,n):this._textRasterizer.rasterizeText(t,n);if(!i)return;let{size:o,anchorX:s,anchorY:c,canvas:l}=i,u=o[0]*(s+.5),d=o[1]*(c-.5),f=this._ctx,p=this.transformPt([0,0]),[m,h]=this.getTransformAngle();f.save(),f.setTransform({m11:+m,m12:+h,m21:-1*h,m22:+m,m41:p[0]-+u,m42:p[1]+1*d}),f.drawImage(l,0,0),f.restore()}drawPictureFill(e,t){if(!e)return;let{colorSubstitutions:n,height:r,offsetX:i,offsetY:a,rotation:o,scaleX:s,tintColor:c,url:l}=t,u=this._resourceManager.getResource(l);if(u==null)return;if(C(e))this._buildPath(e.rings,!0);else if(w(e))this._buildPath(e.paths,!0);else if(T(e))this._buildPath(X(e).rings,!0);else if(E(e))console.log(`CanvasDrawHelper.drawPictureFill - No implementation!`);else return;let d=this._ctx,f=z(l)||`src`in u&&z(u.src),p=`getFrame`in u?M(u):u;n&&(p=this._colorSubstitutionHelper.applyColorSubstitution(p,n));let m;if(this._applyAdditionalRenderProps){f||c&&(p=this._colorSubstitutionHelper.tintImageData(p,c)),m=d.createPattern(p,`repeat`);let e=this.transformSize(1);o||=0,i=i?e*i:0,a=a?e*a:0,r&&=e*r;let t=r?r/u.height:1,n=s&&r?s*r/u.width:1;if(o!==0||t!==1||n!==1||i!==0||a!==0){let e=new DOMMatrix;e.rotateSelf(0,0,-o).translateSelf(i,a).scaleSelf(n,t,1),m.setTransform(e)}}else m=d.createPattern(p,`repeat`);d.save(),d.fillStyle=m,d.fill(`evenodd`),d.restore()}drawPictureStroke(e,n){if(!e)return;let{colorSubstitutions:r,capStyle:i,joinStyle:a,miterLimit:s,tintColor:c,url:l,width:u}=n,d=this._resourceManager.getResource(l);if(d==null)return;let f;if(C(e))f=e.rings;else if(w(e))f=e.paths;else if(T(e))f=X(e).rings;else if(E(e)){console.log(`CanvasDrawHelper.drawPictureStroke - No implementation!`);return}else return;u||=d.width;let p=z(l)||`src`in d&&z(d.src),m=`getFrame`in d?M(d):d;r&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,r)),this._applyAdditionalRenderProps&&(p||c&&(m=this._colorSubstitutionHelper.tintImageData(m,c)));let h=Math.max(this.transformSize(o(u)),.5),g=h/m.width,_=this._ctx,v=_.createPattern(m,`repeat-y`);_.save(),this._setCapStyle(i),this._setJoinStyle(a),s!==void 0&&(_.miterLimit=s),_.lineWidth=h;let y,b;for(let e of f)if(e=t(e),$(e),!(!e||e.length<=1)){y=this.transformPt(e[0]);for(let t=1;t<e.length;t++){b=this.transformPt(e[t]);let n=Te(y,b),r=new DOMMatrix;r.translateSelf(0,y[1]-h/2).scaleSelf(g,g,1).rotateSelf(0,0,90-n),v.setTransform(r),_.strokeStyle=v,_.beginPath(),_.moveTo(y[0],y[1]),_.lineTo(b[0],b[1]),_.stroke(),y=b}}_.restore()}drawGradientFill(e,t){if(!e)return;let n;if(C(e))n=e.rings;else if(w(e))n=e.paths;else if(T(e))n=X(e).rings;else{q().error(`Unable to draw gradient fill`);return}this._buildPath(n,!0);let{angle:i,gradientMethod:a,gradientSize:s,gradientSizeUnits:c}=t,l=j.CIMGradientFill,g=t.gradientType??l.gradientType,_=-r(i??0),v=u();for(let e of n){let t=e?e.length:0;if(t>1)for(let n=0;n<t;n++){let t=this.transformPt(e[n]);(a===`Linear`||a===`Rectangular`)&&(t=N(t,-_)),d(v,t)}}let[y,b,x,S]=v,E=this._ctx;switch(E.save(),a){case`Buffered`:q().error(`Gradient method "${a}" currently unsupported.`);break;case`Linear`:{let e=(b+S)/2,n=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(x-y),[r,i]=g===`Discrete`?[x,x-n]:[y+n,y],a=N([r,e],_),u=N([i,e],_),d=E.createLinearGradient(a[0],a[1],u[0],u[1]);P(d,t),E.fillStyle=d,E.fill(`evenodd`);break}case`Circular`:{let e=f(v),n=h(v)/2,r=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*n,[i,a]=g===`Discrete`?[n,n-r]:[r,0],u=E.createRadialGradient(e[0],e[1],i,e[0],e[1],a);P(u,t),E.fillStyle=u,E.fill(`evenodd`);break}case`Rectangular`:{let n=f(v),r=n[0],i=n[1],a=N(n,_),u=(n,r,i,o,s,c,l,u)=>{E.save(),this.pushClipPath(e);let d=N([s,c],_),f=N([l,u],_);E.beginPath(),E.moveTo(a[0],a[1]),E.lineTo(d[0],d[1]),E.lineTo(f[0],f[1]),E.lineTo(a[0],a[1]),E.clip();let p=N([n,r],_),m=N([i,o],_),h=E.createLinearGradient(p[0],p[1],m[0],m[1]);P(h,t),E.fillStyle=h,E.fill(`evenodd`),E.restore()},d=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(p(v)/2),[h,C]=g===`Discrete`?[x,x-d]:[r+d,r];u(h,i,C,i,x,b,x,S),[h,C]=g===`Discrete`?[y,y+d]:[r-d,r],u(h,i,C,i,y,S,y,b),d=c===`Absolute`?this.transformSize(o(s)):B(s,l.gradientSize)*(m(v)/2);let[w,T]=g===`Discrete`?[S,S-d]:[i+d,i];u(r,w,r,T,x,S,y,S),[w,T]=g===`Discrete`?[b,b+d]:[i-d,i],u(r,w,r,T,y,b,x,b);break}}E.restore()}drawGradientStroke(e,n){let{capStyle:r,gradientMethod:i,gradientSize:a,gradientSizeUnits:s,joinStyle:c,miterLimit:l,width:u}=n;if(!e||u===0)return;let d;if(C(e))d=e.rings;else if(w(e))d=e.paths;else if(T(e))d=X(e).rings;else{q().error(`Unable to draw gradient stroke`);return}let f=n.gradientType??j.CIMGradientStroke.gradientType,p=Math.max(this.transformSize(o(u)),.5),m=this._ctx;m.save(),this._setCapStyle(r),this._setJoinStyle(c),l!==void 0&&(m.miterLimit=l),m.lineWidth=p;let h,g;for(let e of d){if(e=t(e),$(e),!e||e.length<=1)continue;let r=0;h=this.transformPt(e[0]);for(let t=1;t<e.length;t++){g=this.transformPt(e[t]);let n=g[0]-h[0],i=g[1]-h[1];r+=Math.sqrt(n*n+i*i),h=g}let c=s===`Absolute`?this.transformSize(o(a)):B(a,j.CIMGradientStroke.gradientSize)*(i===`AcrossLine`?p:r),l=0;h=this.transformPt(e[0]);for(let t=1;t<e.length;t++){g=this.transformPt(e[t]);let a=g[0]-h[0],o=g[1]-h[1],s=Math.sqrt(a*a+o*o),u,d,_,v;switch(i){case`AcrossLine`:{let[e,t]=N([a/s,o/s],-Math.PI/2),n=p/2,r=f===`Discrete`?n:c-n;u=(h[0]+g[0])/2+e*r,d=(h[1]+g[1])/2+t*r,_=u-e*c,v=d-t*c;break}case`AlongLine`:{let e=a/s,t=o/s;f===`Discrete`?(u=h[0]-e*l,d=h[1]-t*l,_=u+e*c,v=d+t*c):(_=h[0]+e*(r-l),v=h[1]+t*(r-l),u=_-e*c,d=v-t*c);break}default:q().error(`Unrecognized gradient method:`,i),m.restore();return}let y=m.createLinearGradient(u,d,_,v);P(y,n),m.strokeStyle=y,m.beginPath(),m.moveTo(h[0],h[1]),m.lineTo(g[0],g[1]),m.stroke(),l+=s,h=g}}m.restore()}_buildPath(e,t){let n=this._ctx;if(n.beginPath(),e)for(let r of e){let e=r?r.length:0;if(e>1){let i=this.transformPt(r[0]);n.moveTo(i[0],i[1]);for(let t=1;t<e;t++)i=this.transformPt(r[t]),n.lineTo(i[0],i[1]);t&&n.closePath()}}}_setCapStyle(e){switch(e){case`Butt`:this._ctx.lineCap=`butt`;break;case`Round`:this._ctx.lineCap=`round`;break;case`Square`:this._ctx.lineCap=`square`}}_setJoinStyle(e){switch(e){case`Bevel`:this._ctx.lineJoin=`bevel`;break;case`Round`:this._ctx.lineJoin=`round`;break;case`Miter`:this._ctx.lineJoin=`miter`}}}function we(e,t,n){let r=R(e.separation,j.CIMHatchFill.separation)*n,i=R(e.rotation);if(r===0)return null;r<0&&(r=-r);let a=0,o=.5*r;for(;a>o;)a-=r;for(;a<-o;)a+=r;let s=_();v(s,t),s[0]-=o,s[1]-=o,s[2]+=o,s[3]+=o;let c=[[s[0],s[1]],[s[0],s[3]],[s[2],s[3]],[s[2],s[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;let l=Math.cos(i*G),u=Math.sin(i*G),d=-r*u,f=r*l,p=R(e.offsetX)*n,m=R(e.offsetY)*n;a=p*u-m*l;let h,g,y,b;h=y=Number.MAX_VALUE,g=b=-Number.MAX_VALUE;for(let e of c){let t=e[0],n=e[1],r=l*t+u*n,i=-u*t+l*n;h=Math.min(h,r),y=Math.min(y,i),g=Math.max(g,r),b=Math.max(b,i)}y=Math.floor(y/r)*r;let x=l*h-u*y-d*a/r,S=u*h+l*y-f*a/r,C=l*g-u*y-d*a/r,w=u*g+l*y-f*a/r,T=1+Math.round((b-y)/r),E=[];for(let e=0;e<T;e++)x+=d,S+=f,C+=d,w+=f,E.push([[x,S],[C,w]]);return{paths:E}}function Te(e,t){let n=t[0]-e[0],r=t[1]-e[1];return 180/Math.PI*Math.atan2(r,n)}const X=e=>e?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Z=(e,t,n)=>{switch(e){case`ExtraLeading`:return 1+t/n;case`Multiple`:return t;case`Exact`:return t/n}};function Q(t,n=1){let r=he(t),i=fe(t.fontStyleName),a=t.fontFamilyName??e,{weight:o,style:s}=i,c=n*(t.height||5),l=ge(t.horizontalAlignment),u=V(t.verticalAlignment),d=H(t),f=H(t.haloSymbol),p=f==null?0:n*(t.haloSize??0),m=U(t.symbol),h=n*(W(t.symbol)||0),g=t.callout?.type===`CIMBackgroundCallout`?t.callout.backgroundSymbol:null,_=H(g),v=W(g),y=U(g);return{color:d,size:c,horizontalAlignment:l,verticalAlignment:u,font:{family:a,style:ve(s),weight:_e(o),decoration:r},outline:{size:h||0,color:m},halo:{size:p||0,color:f,style:s},backgroundColor:_,borderLine:v!=null&&y!=null?{size:v,color:y}:null,pixelRatio:1,premultiplyColors:!0}}function $(e){let t=e[0],n=1,r,i,a,o,s;for(;n<e.length;)r=e[n][0]-t[0],i=e[n][1]-t[1],o=r===0?Math.PI/2:i/r,a!==void 0&&Math.abs(o-a)<=1e-4?(e.splice(n-1,1),t=s):(s=t,t=e[n],n++),a=o}export{Y as CIMSymbolDrawHelper,Ce as CanvasDrawHelper,xe as EnvDrawHelper,Se as HittestDrawHelper,J as Transformation,G as cDegToRad,Z as lineGapType2LineHeight};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{inchesPerMeter as e}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as n}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as a}from"../CIMCursor.js";import{lazyOffsetOperator as o}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return s.instance===null&&(s.instance=new s),s.instance}execute(e,t,n){return new c(e,t,n)}}class c{constructor(e,t,n){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=n.geomUnitsPerPoint??1,this._scale=n?.scale,this._rule=t.rule??`FullGeometry`,this._spatialReference=n?.spatialReference??r.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let e;for(;e=this._inputGeometries.next();){let r=this._processGeom(n(e));if(r?.length)return t.fromJSONCIM({paths:r})}return null}_computeWidth(t){if(!l(this._rule)||this._scale==null||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;let n=this._scale/(96*e*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*n)}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,n,r){return[e[0]*t+n[0]*r,e[1]*t+n[1]*r]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,n){return[e[0]+t,e[1]+n]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){let n=t/this._norm(e);e[0]*=n,e[1]*=n}_leftPerpendicular(e){let t=-e[1],n=e[0];e[0]=t,e[1]=n}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){let t=e[1],n=-e[0];e[0]=t,e[1]=n}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,n){let r=e[0]*t-e[1]*n,i=e[0]*n+e[1]*t;e[0]=r,e[1]=i}_makeCtrlPt(e){let t=[e[0],e[1]];return a(t,1),t}_addAngledTicks(e,t,n,r){let i=this._sub(n,t);this._normalize(i);let a=this._crossProduct(i,this._sub(r,t)),o;o=a>0?this._rightPerp(i):this._leftPerp(i);let s=Math.abs(a)/2,c=[];c.push([t[0]+(o[0]-i[0])*s,t[1]+(o[1]-i[1])*s]),c.push(t),c.push(n),c.push([n[0]+(o[0]+i[0])*s,n[1]+(o[1]+i[1])*s]),e.push(c)}_addBezier2(e,t,n,r,i){if(i--===0){e.push(r);return}let a=this._mid(t,n),o=this._mid(n,r),s=this._mid(a,o);this._addBezier2(e,t,a,s,i),this._addBezier2(e,s,o,r,i)}_addBezier3(e,t,n,r,i,a){if(a--===0){e.push(i);return}let o=this._mid(t,n),s=this._mid(n,r),c=this._mid(r,i),l=this._mid(o,s),u=this._mid(s,c),d=this._mid(l,u);this._addBezier3(e,t,o,l,d,a),this._addBezier3(e,d,u,c,i,a)}_add90DegArc(e,t,n,r,i){let a=i??this._crossProduct(this._sub(n,t),this._sub(r,t))>0,o=this._mid(t,n),s=this._sub(o,t);a?this._leftPerpendicular(s):this._rightPerpendicular(s),o[0]+=s[0],o[1]+=s[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(n,.33333,o,.66667),n,4)}_addArrow(e,t,n){let r=t[0],i=t[1],a=t[t.length-1],o=this._sub(r,i),s=this._norm(o);this._normalize(o);let c=Math.abs(this._crossProduct(o,this._sub(a,i))),l=this._dotProduct(o,this._sub(a,i));l<s*.05?l=s*.05:l>s*.95&&(l=s*.95);let u=c*.5,d=this._leftPerp(o),f=[i[0]+o[0]*l,i[1]+o[1]*l],p=t.length-1,m=[];m.push(n?[-d[0],-d[1]]:d);let h=[-o[0],-o[1]];for(let e=1;e<p-1;e++){let n=this._sub(t[e+1],t[e]);this._normalize(n);let r=this._dotProduct(n,h),i=this._crossProduct(n,h),a=Math.sqrt((1+r)/2),o=this._sub(n,h);this._normalize(o),o[0]/=a,o[1]/=a,m.push(i<0?[-o[0],-o[1]]:o),h=n}m.push(this._rightPerp(h));for(let n=m.length-1;n>0;n--)e.push([t[n][0]+m[n][0]*u,t[n][1]+m[n][1]*u]);e.push([f[0]+m[0][0]*u,f[1]+m[0][1]*u]),e.push([f[0]+m[0][0]*c,f[1]+m[0][1]*c]),e.push(r),e.push([f[0]-m[0][0]*c,f[1]-m[0][1]*c]),e.push([f[0]-m[0][0]*u,f[1]-m[0][1]*u]);for(let n=1;n<m.length;n++)e.push([t[n][0]-m[n][0]*u,t[n][1]-m[n][1]*u])}_addDash(e,t,n){let r=this._norm(n)/7;this._normalize(n);let i=[];for(let a=0;a<=7;a++)i.push([t[0]+n[0]*a*r,t[1]+n[1]*a*r]),a&1&&(e.push(i),i=[])}_cp2(e,t,n){return e.length>=2?e[1]:this._add2(e[0],t*this._defaultSize,n*this._defaultSize)}_cp3(e,t,n,r){if(e.length>=3)return e[2];let i=this._mix(e[0],1-n,t,n),a=this._sub(t,e[0]);return this._normalize(a),this._rightPerpendicular(a),[i[0]+a[0]*r*this._defaultSize,i[1]+a[1]*r*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;let t=e[0],n=this._cp2(e,-4,0),r=this._sub(t,n);this._normalize(r);let i=this._rightPerp(r);return[t,n,[t[0]+(i[0]-r[0])*this._defaultSize,t[1]+(i[1]-r[1])*this._defaultSize]]}_arrowLastSeg(e){let t=e[0],n=this._cp2(e,-4,0),r;if(e.length>=3)r=e[e.length-1];else{let e=this._sub(t,n);this._normalize(e);let i=this._rightPerp(e);r=[t[0]+(i[0]-e[0])*this._defaultSize,t[1]+(i[1]-e[1])*this._defaultSize]}return[n,r]}_offsetPath(e,r){let{offsetExecute:i}=o.module,a=i({paths:[e],spatialReference:this._spatialReference.toJSON()},r,{joins:`miter`,miterLimit:4}),[s]=n(t.fromJSONCIM(a));return s?.length?s:null}_processGeom(e){if(!e)return null;let t=[];for(let n of e){let e=n.length>1&&i(n)<this._defaultSize;if(!n||n.length===0||e)continue;let r=n.length,o=n[0];switch(this._rule){case`PerpendicularFromFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=[];i.push(r),i.push(this._mid(o,e)),t.push(i);break}case`ReversedFirstSegment`:{let e=this._cp2(n,0,-1);t.push([e,o]);break}case`PerpendicularToSecondSegment`:{if(n.length<3)return[];let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=[];i.push(this._mid(e,r)),i.push(o),t.push(i);break}case`SecondSegmentWithTicks`:{if(n.length<3)return[];let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e),a;a=this._crossProduct(i,this._sub(o,e))>0?this._rightPerp(i):this._leftPerp(i);let s=[];s.push([e[0]+(a[0]-i[0])/3,e[1]+(a[1]-i[1])/3]),s.push(e),s.push(r),s.push([r[0]+(a[0]+i[0])/3,r[1]+(a[1]+i[1])/3]),t.push(s);break}case`DoublePerpendicular`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push(o),c.push([r[0]+a[0]*s,r[1]+a[1]*s]),t.push(c);let l=[];l.push([r[0]-a[0]*s,r[1]-a[1]*s]),l.push(e),t.push(l);break}case`OppositeToFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push([r[0]+a[0]*s,r[1]+a[1]*s]),c.push([r[0]-a[0]*s,r[1]-a[1]*s]),t.push(c);break}case`TriplePerpendicular`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push([r[0]+a[0]*s*.8,r[1]+a[1]*s*.8]),c.push([i[0]+(o[0]-i[0])*.8,i[1]+(o[1]-i[1])*.8]),t.push(c),t.push([r,i]);let l=[];l.push([r[0]-a[0]*s*.8,r[1]-a[1]*s*.8]),l.push([i[0]+(e[0]-i[0])*.8,i[1]+(e[1]-i[1])*.8]),t.push(l);break}case`HalfCircleFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=this._mid(o,e),a=this._sub(e,o),s=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),l=Math.sqrt((1+s)/2),u=Math.sqrt((1-s)/2),d=[],f;this._crossProduct(a,this._sub(r,o))>0?(d.push(o),a=this._sub(o,i),f=e):(d.push(e),a=this._sub(e,i),f=o),this._rotateDirect(a,l,u),a[0]/=l,a[1]/=l;for(let e=1;e<=18;e++)d.push(this._add(i,a)),this._rotateDirect(a,s,c);d.push(f),t.push(d);break}case`HalfCircleSecondSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,1,-1),i=this._sub(o,e);this._normalize(i);let a=this._crossProduct(i,this._sub(r,e))/2;this._leftPerpendicular(i);let s=[e[0]+i[0]*a,e[1]+i[1]*a];i=this._sub(e,s);let c=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);a>0&&(l=-l);let u=[e];for(let e=1;e<=18;e++)this._rotateDirect(i,c,l),u.push(this._add(s,i));t.push(u);break}case`HalfCircleExtended`:{let e=this._cp2(n,0,-2),i=this._cp3(n,e,1,-1),a;if(r>=4)a=n[3];else{let t=this._sub(o,e);a=this._add(i,t)}let s=this._dist(e,i)/2/.75,c=this._sub(e,o);this._normalize(c,s);let l=this._sub(i,a);this._normalize(l,s);let u=[a,i];t.push(u);let d=[this._clone(i)];this._addBezier3(d,i,this._add(i,l),this._add(e,c),e,4),d.push(o),t.push(d);break}case`OpenCircle`:{let e=this._cp2(n,-2,0),r=this._sub(e,o),i=Math.cos(Math.PI/18),a=-Math.sin(Math.PI/18),s=[e];for(let e=1;e<=33;e++)this._rotateDirect(r,i,a),s.push(this._add(o,r));t.push(s);break}case`CoverageEdgesWithTicks`:{let e=this._cp2(n,0,-1),i;if(r>=3)i=n[2];else{let t=this._sub(e,o),n=this._leftPerp(t);i=[o[0]+n[0]-t[0]*.25,o[1]+n[1]-t[1]*.25]}let a;if(r>=4)a=n[3];else{let t=this._mid(o,e),n=this._sub(o,e);this._normalize(n),this._leftPerpendicular(n);let r=this._crossProduct(n,this._sub(i,t));this._rightPerpendicular(n),a=[i[0]+n[0]*r*2,i[1]+n[1]*r*2]}let s=this._sub(e,o),c,l;c=this._crossProduct(s,this._sub(i,o))>0?this._rightPerp(s):this._leftPerp(s),l=[],l.push(i),l.push(o),l.push([o[0]+(c[0]-s[0])/3,o[1]+(c[1]-s[1])/3]),t.push(l),c=this._crossProduct(s,this._sub(a,e))>0?this._rightPerp(s):this._leftPerp(s),l=[],l.push([e[0]+(c[0]+s[0])/3,e[1]+(c[1]+s[1])/3]),l.push(e),l.push(a),t.push(l);break}case`GapExtentWithDoubleTicks`:{let e=this._cp2(n,0,2),i=this._cp3(n,e,0,1),a;if(r>=4)a=n[3];else{let t=this._sub(e,o);a=this._add(i,t)}this._addAngledTicks(t,o,e,this._mid(i,a)),this._addAngledTicks(t,i,a,this._mid(o,e));break}case`GapExtentMidline`:{let e=this._cp2(n,2,0),i=this._cp3(n,e,0,1),a;if(r>=4)a=n[3];else{let t=this._sub(e,o);a=this._add(i,t)}let s=[];s.push(this._mid(o,i)),s.push(this._mid(e,a)),t.push(s);break}case`Chevron`:{let e=this._cp2(n,-1,-1),i;if(r>=3)i=n[2];else{let t=this._sub(e,o);this._leftPerpendicular(t),i=this._add(o,t)}t.push([e,this._makeCtrlPt(o),i]);break}case`PerpendicularWithArc`:{let e=this._cp2(n,0,-2),i=this._cp3(n,e,.5,-1),a=this._sub(e,o),s=this._norm(a);a[0]/=s,a[1]/=s;let c=this._crossProduct(a,this._sub(i,o)),l=this._dotProduct(a,this._sub(i,o));l<s*.05?l=s*.05:l>s*.95&&(l=s*.95);let u=[o[0]+a[0]*l,o[1]+a[1]*l],d=this._leftPerp(a),f=[];if(f.push([u[0]-d[0]*c,u[1]-d[1]*c]),f.push([u[0]+d[0]*c,u[1]+d[1]*c]),t.push(f),r>=4){let e=n[3],r=this._dotProduct(a,this._sub(e,o));r<s*.1?r=s*.1:r>s*.9&&(r=s*.9);let i=[o[0]+a[0]*r,o[1]+a[1]*r],c=this._crossProduct(a,this._sub(e,o)),l=[];l.push([i[0]-d[0]*c,i[1]-d[1]*c]),l.push([i[0]+d[0]*c,i[1]+d[1]*c]),t.push(l)}let p=[e[0]+d[0]*c,e[1]+d[1]*c];d=this._sub(e,p);let m=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18);c<0&&(h=-h),f=[o,e];for(let e=1;e<=9;e++)this._rotateDirect(d,m,h),f.push(this._add(p,d));t.push(f);break}case`ClosedHalfCircle`:{let e=this._cp2(n,2,0),r=this._mid(o,e),i=this._sub(e,r),a=Math.cos(Math.PI/18),s=Math.sin(Math.PI/18),c=[o,e];for(let e=1;e<=18;e++)this._rotateDirect(i,a,s),c.push(this._add(r,i));t.push(c);break}case`TripleParallelExtended`:{let e=this._cp2(n,0,-2),r=this._cp3(n,e,1,-2),i=this._mid(o,e),s=this._sub(r,e);this._normalize(s);let c=Math.abs(this._crossProduct(s,this._sub(i,e)))/2,l=this._dist(e,r),u=[e,o];u.push([o[0]+s[0]*l*.5,o[1]+s[1]*l*.5]),t.push(u);let d=[];d.push([i[0]-s[0]*c,i[1]-s[1]*c]),d.push([i[0]+s[0]*l*.375,i[1]+s[1]*l*.375]),a(d[d.length-1],1),d.push([i[0]+s[0]*l*.75,i[1]+s[1]*l*.75]),t.push(d);let f=[e,r];t.push(f);break}case`ParallelWithTicks`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o)),s=this._leftPerp(i);this._addAngledTicks(t,o,e,r),this._addAngledTicks(t,this._add2(o,s[0]*a,s[1]*a),this._add2(e,s[0]*a,s[1]*a),this._mid(o,e));break}case`Parallel`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._leftPerp(i),s=this._crossProduct(i,this._sub(r,o)),c=[o,e];t.push(c),c=[],c.push([o[0]+a[0]*s,o[1]+a[1]*s]),c.push([e[0]+a[0]*s,e[1]+a[1]*s]),t.push(c);break}case`PerpendicularToFirstSegment`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._mid(o,e),a=this._sub(e,o);this._normalize(a);let s=this._crossProduct(a,this._sub(r,o));this._leftPerpendicular(a);let c=[];c.push([i[0]-a[0]*s*.25,i[1]-a[1]*s*.25]),c.push([i[0]+a[0]*s*1.25,i[1]+a[1]*s*1.25]),t.push(c);break}case`ParallelOffset`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]-i[0]*a,o[1]-i[1]*a]),s.push([e[0]-i[0]*a,e[1]-i[1]*a]),t.push(s);let c=[];c.push([o[0]+i[0]*a,o[1]+i[1]*a]),c.push([e[0]+i[0]*a,e[1]+i[1]*a]),t.push(c);break}case`OffsetOpposite`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]-i[0]*a,o[1]-i[1]*a]),s.push([e[0]-i[0]*a,e[1]-i[1]*a]),t.push(s);break}case`OffsetSame`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]+i[0]*a,o[1]+i[1]*a]),s.push([e[0]+i[0]*a,e[1]+i[1]*a]),t.push(s);break}case`CircleWithArc`:{let e=this._cp2(n,3,0),i=this._cp3(n,e,.5,-1),s,c;if(r>=4)s=n[3],c=this._crossProduct(this._sub(s,e),this._sub(i,e))>0;else{s=e,c=this._crossProduct(this._sub(s,o),this._sub(i,o))>0;let t=24*this._geomUnitsPerPoint,n=this._sub(s,o);this._normalize(n,t);let r=Math.sqrt(2)/2;this._rotateDirect(n,r,c?r:-r),e=this._add(o,n)}let l=this._sub(e,o),u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18),f=[e];for(let e=1;e<=36;e++)this._rotateDirect(l,u,d),f.push(this._add(o,l));this._add90DegArc(f,e,s,i,c),a(f[f.length-8],1),t.push(f);break}case`DoubleJog`:{let e=this._cp2(n,-3,1),i=this._cp3(n,e,-1,-.5),a;if(r>=4)a=n[3];else{let t=o;o=e,a=i;let n=this._dist(o,t),r=this._dist(a,t),s=30*this._geomUnitsPerPoint;n*.5<s&&(s=n*.5),r*.5<s&&(s=r*.5),e=this._mix(o,s/n,t,(n-s)/n),i=this._mix(a,s/r,t,(r-s)/r)}let s=this._mid(o,e),c=this._mid(a,i),l=this._dist(o,e),u=this._dist(i,a),d=Math.min(l,u)/8;d=Math.min(d,24*this._geomUnitsPerPoint);let f=Math.cos(Math.PI/4),p=this._sub(o,e);this._normalize(p,d),this._crossProduct(p,this._sub(a,e))>0?this._rotateDirect(p,f,-f):this._rotateDirect(p,f,f);let m=[];m.push(e),m.push(this._add(s,p)),m.push(this._sub(s,p)),m.push(o),t.push(m),p=this._sub(a,i),this._normalize(p,d),this._crossProduct(p,this._sub(o,i))<0?this._rotateDirect(p,f,f):this._rotateDirect(p,f,-f),m=[],m.push(i),m.push(this._add(c,p)),m.push(this._sub(c,p)),m.push(a),t.push(m);break}case`PerpendicularOffset`:{let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e);this._crossProduct(i,this._sub(o,e))>0?this._rightPerpendicular(i):this._leftPerpendicular(i);let a=[i[0]/8,i[1]/8],s=this._sub(this._mid(e,r),a);t.push([s,o]);break}case`LineExcludingLastSegment`:{let e=this._arrowPath(n),r=[],i=e.length-2;for(;i--;)r.push(e[i]);t.push(r);break}case`MultivertexArrow`:{let e=this._arrowPath(n),r=[];this._addArrow(r,e,!1),t.push(r);break}case`CrossedArrow`:{let e=this._arrowPath(n),r=[];this._addArrow(r,e,!0),t.push(r);break}case`ChevronArrow`:{let[e,r]=this._arrowLastSeg(n),i=10*this._geomUnitsPerPoint,a=this._sub(o,e),s=this._norm(a);this._normalize(a);let c=this._crossProduct(a,this._sub(r,e)),l=this._dotProduct(a,this._sub(r,e));l<s*.05?l=s*.05:l>s*.95-i&&(l=s*.95-i);let u=[e[0]+a[0]*l,e[1]+a[1]*l],d=this._leftPerp(a),f=[];f.push([u[0]+d[0]*c+a[0]*i,u[1]+d[1]*c+a[1]*i]),f.push(o),f.push([u[0]-d[0]*c+a[0]*i,u[1]-d[1]*c+a[1]*i]),t.push(f);break}case`ChevronArrowOffset`:{let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=this._crossProduct(i,this._sub(r,e)),c=this._dotProduct(i,this._sub(r,e));c<a*.05?c=a*.05:c>a*.95&&(c=a*.95);let l=[e[0]+i[0]*c,e[1]+i[1]*c];this._leftPerpendicular(i);let u=[];u.push([l[0]+i[0]*s*.5,l[1]+i[1]*s*.5]),u.push(this._mid(l,o)),u.push([l[0]-i[0]*s*.5,l[1]-i[1]*s*.5]),t.push(u);break}case`PartialFirstSegment`:{let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=this._dotProduct(i,this._sub(r,e));s<a*.05?s=a*.05:s>a*.95&&(s=a*.95);let c=[e[0]+i[0]*s,e[1]+i[1]*s];t.push([e,c]);break}case`Arch`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,1),i=this._sub(o,e),a=this._mix(r,1,i,.55),s=this._mix(r,1,i,-.55),c=[o];this._addBezier2(c,o,a,r,4),this._addBezier2(c,r,s,e,4),t.push(c);break}case`CurvedParallelTicks`:{let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e);this._crossProduct(i,this._sub(o,e))>0?this._rightPerpendicular(i):this._leftPerpendicular(i);let a=[i[0]/8,i[1]/8],s=this._sub(this._mid(e,r),a),c=this._sub(this._mix(e,.75,r,.25),a),l=this._sub(this._mix(e,.25,r,.75),a),u=[e];this._addBezier2(u,e,c,s,3),this._addBezier2(u,s,l,r,3),t.push(u);for(let e=0;e<8;e++){let n=u[e*2+1],r=[this._clone(n)];r.push(this._add(n,[i[0]/4,i[1]/4])),t.push(r)}break}case`Arc90Degrees`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,1),i=[e];this._add90DegArc(i,e,o,r),t.push(i);break}case`TipWithPerpendicularAndTicks`:{let[e,r]=this._arrowLastSeg(n),i=10*this._geomUnitsPerPoint,a=this._sub(o,e),s=this._norm(a);this._normalize(a);let c=this._crossProduct(a,this._sub(r,e)),l=this._dotProduct(a,this._sub(r,e));l<s*.05?l=s*.05:l>s*.95-i&&(l=s*.95-i);let u=this._leftPerp(a),d=[o[0]-a[0]*i,o[1]-a[1]*i],f=Math.max(s-l-i,i)*.5;c=Math.abs(c);let p=[];p.push([d[0]+u[0]*(c+f)-a[0]*f,d[1]+u[1]*(c+f)-a[1]*f]),p.push([d[0]+u[0]*c,d[1]+u[1]*c]),p.push([d[0]-u[0]*c,d[1]-u[1]*c]),p.push([d[0]-u[0]*(c+f)-a[0]*f,d[1]-u[1]*(c+f)-a[1]*f]),t.push(p),t.push([d,o]);break}case`ConcentricCircles`:{let e=this._cp2(n,1,0),i=this._cp3(n,e,2,0),s=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),l=this._dist(e,o),u=[l,0],d=[];for(let e=0;e<=36;e++)d.push(this._add(o,u)),this._rotateDirect(u,s,c);if(t.push(d),r>=4){d=[];let e=n[3];l=this._dist(e,o),u=[l,0];for(let e=0;e<=36;e++)d.push(this._add(o,u)),e===0&&(d.push(this._add(o,u)),a(d[1],1)),this._rotateDirect(u,s,c);t.push(d)}d=[],l=this._dist(i,o),u=[l,0];for(let e=0;e<=36;e++)d.push(this._add(o,u)),this._rotateDirect(u,s,c);t.push(d);break}case`DoubleJogArrow`:{o=this._arrowPath(n)[0];let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=Math.abs(this._crossProduct(i,this._sub(r,o))),c=Math.abs(this._dotProduct(i,this._sub(r,o)));c<a*.05?c=a*.05:c>a*.95&&(c=a*.95);let l=Math.max(s,c),u=this._leftPerp(i),d=[],f=[o[0]-i[0]*c*.5+u[0]*s*.5,o[1]-i[1]*c*.5+u[1]*s*.5];d.push([f[0],f[1]]),f[0]+=i[0]*l*.5+u[0]*l*.4,f[1]+=i[1]*l*.5+u[1]*l*.4,d.push([f[0],f[1]]),f[0]-=u[0]*l*.25,f[1]-=u[1]*l*.25,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5+u[0]*l*.4,f[1]+=i[1]*l*.5+u[1]*l*.4,d.push([f[0],f[1]]),t.push(d),d=[],f[0]=o[0]-i[0]*c*.5-u[0]*s*.5,f[1]=o[1]-i[1]*c*.5-u[1]*s*.5,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5-u[0]*l*.4,f[1]+=i[1]*l*.5-u[1]*l*.4,d.push([f[0],f[1]]),f[0]+=u[0]*l*.25,f[1]+=u[1]*l*.25,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5-u[0]*l*.4,f[1]+=i[1]*l*.5-u[1]*l*.4,d.push([f[0],f[1]]),t.push(d);break}case`LinkedChevrons`:{let e=this._cp2(n,-5,0),r=this._cp3(n,e,-.2,1),i=this._sub(o,e);this._normalize(i);let a=this._leftPerp(i),s=Math.abs(this._crossProduct(i,this._sub(r,e)));t.push([e,o]);let c=[];c.push([o[0]-i[0]*s+a[0]*s,o[1]-i[1]*s+a[1]*s]),c.push(o),c.push([o[0]-i[0]*s-a[0]*s,o[1]-i[1]*s-a[1]*s]),t.push(c),this._addDash(t,e,[-i[0]*s+a[0]*s,-i[1]*s+a[1]*s]),this._addDash(t,e,[-i[0]*s-a[0]*s,-i[1]*s-a[1]*s]);break}case`SegmentThenHalfCircle`:{let e=this._cp2(n,2,0),i=this._cp3(n,e,1.5,0),a;a=r>=4?n[3]:this._cp3(n,e,1.25,-.5);let s=this._sub(e,o);this._normalize(s);let c=this._dist(e,i)*.5,l=this._crossProduct(s,this._sub(a,o))>0,u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18);l&&(d=-d);let f=[o,e];s[0]*=c,s[1]*=c;let p=this._add(e,s);s[0]=-s[0],s[1]=-s[1];for(let e=1;e<=18;e++)this._rotateDirect(s,u,d),f.push(this._add(p,s));t.push(f);break}case`LineWithStraightTicks`:{let e=this._cp2(n,-2,1),r=this._cp3(n,e,-1,-.5),i=this._sub(r,e);this._normalize(i);let a=this._dotProduct(i,this._sub(e,o)),s=this._dotProduct(i,this._sub(r,o)),c=[o];c.push([o[0]+i[0]*a,o[1]+i[1]*a]),c.push(e),t.push(c),c=[o],c.push([o[0]+i[0]*s,o[1]+i[1]*s]),c.push(r),t.push(c);break}case`DoubleCurve`:{let e=this._cp2(n,-5,-1),r=this._cp3(n,e,2,0),i=Math.atan2(1,5),s=Math.cos(i),c=Math.sin(i),l=this._sub(e,o),u=this._dist(o,e);this._normalize(l),this._rotateDirect(l,s,-c);let d=[o];d.push([o[0]+l[0]*u*.5,o[1]+l[1]*u*.5]),a(d[1],1),d.push([o[0]+l[0]*u*.8,o[1]+l[1]*u*.8]),this._addBezier2(d,d[2],[o[0]+l[0]*u,o[1]+l[1]*u],e,3);let f=this._sub(r,e),p=this._dist(e,r);this._normalize(f),this._rotateDirect(f,s,-c),this._addBezier2(d,e,[r[0]-f[0]*p,r[1]-f[1]*p],[r[0]-f[0]*p*.8,r[1]-f[1]*p*.8],3),d.push(r),t.push(d);break}case`ParallelWithTicksByWidth`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i),a>0?(this._addAngledTicks(t,o,[o[0]+i[0]*a,o[1]+i[1]*a],e),this._addAngledTicks(t,e,[e[0]+i[0]*a,e[1]+i[1]*a],o)):(this._addAngledTicks(t,[o[0]+i[0]*a,o[1]+i[1]*a],o,e),this._addAngledTicks(t,[e[0]+i[0]*a,e[1]+i[1]*a],o,e));break}case`EnclosingRoundedRectangle`:{let e=this._cp2(n,3,-2),t=[Math.min(o[0],e[0]),Math.max(o[1],e[1])],r=[Math.max(o[0],e[0]),Math.min(o[1],e[1])],i=r[0]-t[0],a=t[1]-r[1],s=Math.min(i,a)/10,c=[];c.push([t[0]+s+(i-s*2)*.75,t[1]]),c.push([r[0]-s,t[1]]),this._add90DegArc(c,[r[0]-s,t[1]],[r[0],t[1]-s],[r[0],t[1]]),c.push([r[0],r[1]+s]),this._add90DegArc(c,[r[0],r[1]+s],[r[0]-s,r[1]],r),c.push([t[0]+s,r[1]]),this._add90DegArc(c,[t[0]+s,r[1]],[t[0],r[1]+s],[t[0],r[1]]),c.push([t[0],t[1]-s]),this._add90DegArc(c,[t[0],t[1]-s],[t[0]+s,t[1]],t),c.push([t[0]+s+(i-s*2)*.75,t[1]]);break}case`ParallelOffsetByValue`:{if(n.length<2||this._width===0)break;let e=this._offsetPath(n,this._width*.5);e&&t.push(e);let r=this._offsetPath(n,-this._width*.5);r&&t.push(r);break}default:t.push(n)}}return t}}function l(e){switch(e){case`ParallelOffsetByValue`:return!0;default:return!1}}export{s as EffectControlMeasureLine};
2
+ import{inchesPerMeter as e}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as n}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{getPathLength as i}from"../../../geometry/support/coordsUtils.js";import{setId as a}from"../CIMCursor.js";import{lazyOffsetOperator as o}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return s.instance===null&&(s.instance=new s),s.instance}execute(e,t,n){return new c(e,t,n)}}class c{constructor(e,t,n){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=n.geomUnitsPerPoint??1,this._scale=n?.scale,this._rule=t.rule??`FullGeometry`,this._spatialReference=n?.spatialReference??r.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let e;for(;e=this._inputGeometries.next();){let r=this._processGeom(n(e));if(r?.length)return t.fromJSONCIM({paths:r})}return null}_computeWidth(t){if(!l(this._rule)||this._scale==null||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;let n=this._scale/(96*e*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*n)}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,n,r){return[e[0]*t+n[0]*r,e[1]*t+n[1]*r]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,n){return[e[0]+t,e[1]+n]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){let n=t/this._norm(e);e[0]*=n,e[1]*=n}_leftPerpendicular(e){let t=-e[1],n=e[0];e[0]=t,e[1]=n}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){let t=e[1],n=-e[0];e[0]=t,e[1]=n}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,n){let r=e[0]*t-e[1]*n,i=e[0]*n+e[1]*t;e[0]=r,e[1]=i}_makeCtrlPt(e){let t=[e[0],e[1]];return a(t,1),t}_addAngledTicks(e,t,n,r){let i=this._sub(n,t);this._normalize(i);let a=this._crossProduct(i,this._sub(r,t)),o;o=a>0?this._rightPerp(i):this._leftPerp(i);let s=Math.abs(a)/2,c=[];c.push([t[0]+(o[0]-i[0])*s,t[1]+(o[1]-i[1])*s]),c.push(t),c.push(n),c.push([n[0]+(o[0]+i[0])*s,n[1]+(o[1]+i[1])*s]),e.push(c)}_addBezier2(e,t,n,r,i){if(i--===0){e.push(r);return}let a=this._mid(t,n),o=this._mid(n,r),s=this._mid(a,o);this._addBezier2(e,t,a,s,i),this._addBezier2(e,s,o,r,i)}_addBezier3(e,t,n,r,i,a){if(a--===0){e.push(i);return}let o=this._mid(t,n),s=this._mid(n,r),c=this._mid(r,i),l=this._mid(o,s),u=this._mid(s,c),d=this._mid(l,u);this._addBezier3(e,t,o,l,d,a),this._addBezier3(e,d,u,c,i,a)}_add90DegArc(e,t,n,r,i){let a=i??this._crossProduct(this._sub(n,t),this._sub(r,t))>0,o=this._mid(t,n),s=this._sub(o,t);a?this._leftPerpendicular(s):this._rightPerpendicular(s),o[0]+=s[0],o[1]+=s[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(n,.33333,o,.66667),n,4)}_addArrow(e,t,n){let r=t[0],i=t[1],a=t[t.length-1],o=this._sub(r,i),s=this._norm(o);this._normalize(o);let c=Math.abs(this._crossProduct(o,this._sub(a,i))),l=this._dotProduct(o,this._sub(a,i));l<s*.05?l=s*.05:l>s*.95&&(l=s*.95);let u=c*.5,d=this._leftPerp(o),f=[i[0]+o[0]*l,i[1]+o[1]*l],p=t.length-1,m=[];m.push(n?[-d[0],-d[1]]:d);let h=[-o[0],-o[1]];for(let e=1;e<p-1;e++){let n=this._sub(t[e+1],t[e]);this._normalize(n);let r=this._dotProduct(n,h),i=this._crossProduct(n,h),a=Math.sqrt((1+r)/2),o=this._sub(n,h);this._normalize(o),o[0]/=a,o[1]/=a,m.push(i<0?[-o[0],-o[1]]:o),h=n}m.push(this._rightPerp(h));for(let n=m.length-1;n>0;n--)e.push([t[n][0]+m[n][0]*u,t[n][1]+m[n][1]*u]);e.push([f[0]+m[0][0]*u,f[1]+m[0][1]*u]),e.push([f[0]+m[0][0]*c,f[1]+m[0][1]*c]),e.push(r),e.push([f[0]-m[0][0]*c,f[1]-m[0][1]*c]),e.push([f[0]-m[0][0]*u,f[1]-m[0][1]*u]);for(let n=1;n<m.length;n++)e.push([t[n][0]-m[n][0]*u,t[n][1]-m[n][1]*u])}_addDash(e,t,n){let r=this._norm(n)/7;this._normalize(n);let i=[];for(let a=0;a<=7;a++)i.push([t[0]+n[0]*a*r,t[1]+n[1]*a*r]),a&1&&(e.push(i),i=[])}_cp2(e,t,n){return e.length>=2?e[1]:this._add2(e[0],t*this._defaultSize,n*this._defaultSize)}_cp3(e,t,n,r){if(e.length>=3)return e[2];let i=this._mix(e[0],1-n,t,n),a=this._sub(t,e[0]);return this._normalize(a),this._rightPerpendicular(a),[i[0]+a[0]*r*this._defaultSize,i[1]+a[1]*r*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;let t=e[0],n=this._cp2(e,-4,0),r=this._sub(t,n);this._normalize(r);let i=this._rightPerp(r);return[t,n,[t[0]+(i[0]-r[0])*this._defaultSize,t[1]+(i[1]-r[1])*this._defaultSize]]}_arrowLastSeg(e){let t=e[0],n=this._cp2(e,-4,0),r;if(e.length>=3)r=e[e.length-1];else{let e=this._sub(t,n);this._normalize(e);let i=this._rightPerp(e);r=[t[0]+(i[0]-e[0])*this._defaultSize,t[1]+(i[1]-e[1])*this._defaultSize]}return[n,r]}_offsetPath(e,r){let{offsetExecute:i}=o.module,a=i({paths:[e],spatialReference:this._spatialReference.toJSON()},r,{joins:`miter`,miterLimit:4}),[s]=n(t.fromJSONCIM(a));return s?.length?s:null}_processGeom(e){if(!e)return null;let t=[];for(let n of e){let e=n.length>1&&i(n)<this._defaultSize;if(!n||n.length===0||e)continue;let r=n.length,o=n[0];switch(this._rule){case`PerpendicularFromFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=[];i.push(r),i.push(this._mid(o,e)),t.push(i);break}case`ReversedFirstSegment`:{let e=this._cp2(n,0,-1);t.push([e,o]);break}case`PerpendicularToSecondSegment`:{if(n.length<3)return[];let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=[];i.push(this._mid(e,r)),i.push(o),t.push(i);break}case`SecondSegmentWithTicks`:{if(n.length<3)return[];let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e),a;a=this._crossProduct(i,this._sub(o,e))>0?this._rightPerp(i):this._leftPerp(i);let s=[];s.push([e[0]+(a[0]-i[0])/3,e[1]+(a[1]-i[1])/3]),s.push(e),s.push(r),s.push([r[0]+(a[0]+i[0])/3,r[1]+(a[1]+i[1])/3]),t.push(s);break}case`DoublePerpendicular`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push(o),c.push([r[0]+a[0]*s,r[1]+a[1]*s]),t.push(c);let l=[];l.push([r[0]-a[0]*s,r[1]-a[1]*s]),l.push(e),t.push(l);break}case`OppositeToFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push([r[0]+a[0]*s,r[1]+a[1]*s]),c.push([r[0]-a[0]*s,r[1]-a[1]*s]),t.push(c);break}case`TriplePerpendicular`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=this._mid(o,e),a=this._sub(i,r);this._normalize(a);let s=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);let c=[];c.push([r[0]+a[0]*s*.8,r[1]+a[1]*s*.8]),c.push([i[0]+(o[0]-i[0])*.8,i[1]+(o[1]-i[1])*.8]),t.push(c),t.push([r,i]);let l=[];l.push([r[0]-a[0]*s*.8,r[1]-a[1]*s*.8]),l.push([i[0]+(e[0]-i[0])*.8,i[1]+(e[1]-i[1])*.8]),t.push(l);break}case`HalfCircleFirstSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,4),i=this._mid(o,e),a=this._sub(e,o),s=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),l=Math.sqrt((1+s)/2),u=Math.sqrt((1-s)/2),d=[],f;this._crossProduct(a,this._sub(r,o))>0?(d.push(o),a=this._sub(o,i),f=e):(d.push(e),a=this._sub(e,i),f=o),this._rotateDirect(a,l,u),a[0]/=l,a[1]/=l;for(let e=1;e<=18;e++)d.push(this._add(i,a)),this._rotateDirect(a,s,c);d.push(f),t.push(d);break}case`HalfCircleSecondSegment`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,1,-1),i=this._sub(o,e);this._normalize(i);let a=this._crossProduct(i,this._sub(r,e))/2;this._leftPerpendicular(i);let s=[e[0]+i[0]*a,e[1]+i[1]*a];i=this._sub(e,s);let c=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);a>0&&(l=-l);let u=[e];for(let e=1;e<=18;e++)this._rotateDirect(i,c,l),u.push(this._add(s,i));t.push(u);break}case`HalfCircleExtended`:{let e=this._cp2(n,0,-2),i=this._cp3(n,e,1,-1),a;if(r>=4)a=n[3];else{let t=this._sub(o,e);a=this._add(i,t)}let s=this._dist(e,i)/2/.75,c=this._sub(e,o);this._normalize(c,s);let l=this._sub(i,a);this._normalize(l,s);let u=[a,i];t.push(u);let d=[this._clone(i)];this._addBezier3(d,i,this._add(i,l),this._add(e,c),e,4),d.push(o),t.push(d);break}case`OpenCircle`:{let e=this._cp2(n,-2,0),r=this._sub(e,o),i=Math.cos(Math.PI/18),a=-Math.sin(Math.PI/18),s=[e];for(let e=1;e<=33;e++)this._rotateDirect(r,i,a),s.push(this._add(o,r));t.push(s);break}case`CoverageEdgesWithTicks`:{let e=this._cp2(n,0,-1),i;if(r>=3)i=n[2];else{let t=this._sub(e,o),n=this._leftPerp(t);i=[o[0]+n[0]-t[0]*.25,o[1]+n[1]-t[1]*.25]}let a;if(r>=4)a=n[3];else{let t=this._mid(o,e),n=this._sub(o,e);this._normalize(n),this._leftPerpendicular(n);let r=this._crossProduct(n,this._sub(i,t));this._rightPerpendicular(n),a=[i[0]+n[0]*r*2,i[1]+n[1]*r*2]}let s=this._sub(e,o),c,l;c=this._crossProduct(s,this._sub(i,o))>0?this._rightPerp(s):this._leftPerp(s),l=[],l.push(i),l.push(o),l.push([o[0]+(c[0]-s[0])/3,o[1]+(c[1]-s[1])/3]),t.push(l),c=this._crossProduct(s,this._sub(a,e))>0?this._rightPerp(s):this._leftPerp(s),l=[],l.push([e[0]+(c[0]+s[0])/3,e[1]+(c[1]+s[1])/3]),l.push(e),l.push(a),t.push(l);break}case`GapExtentWithDoubleTicks`:{let e=this._cp2(n,0,2),i=this._cp3(n,e,0,1),a;if(r>=4)a=n[3];else{let t=this._sub(e,o);a=this._add(i,t)}this._addAngledTicks(t,o,e,this._mid(i,a)),this._addAngledTicks(t,i,a,this._mid(o,e));break}case`GapExtentMidline`:{let e=this._cp2(n,2,0),i=this._cp3(n,e,0,1),a;if(r>=4)a=n[3];else{let t=this._sub(e,o);a=this._add(i,t)}let s=[];s.push(this._mid(o,i)),s.push(this._mid(e,a)),t.push(s);break}case`Chevron`:{let e=this._cp2(n,-1,-1),i;if(r>=3)i=n[2];else{let t=this._sub(e,o);this._leftPerpendicular(t),i=this._add(o,t)}t.push([e,this._makeCtrlPt(o),i]);break}case`PerpendicularWithArc`:{let e=this._cp2(n,0,-2),i=this._cp3(n,e,.5,-1),a=this._sub(e,o),s=this._norm(a);a[0]/=s,a[1]/=s;let c=this._crossProduct(a,this._sub(i,o)),l=this._dotProduct(a,this._sub(i,o));l<s*.05?l=s*.05:l>s*.95&&(l=s*.95);let u=[o[0]+a[0]*l,o[1]+a[1]*l],d=this._leftPerp(a),f=[];if(f.push([u[0]-d[0]*c,u[1]-d[1]*c]),f.push([u[0]+d[0]*c,u[1]+d[1]*c]),t.push(f),r>=4){let e=n[3],r=this._dotProduct(a,this._sub(e,o));r<s*.1?r=s*.1:r>s*.9&&(r=s*.9);let i=[o[0]+a[0]*r,o[1]+a[1]*r],c=this._crossProduct(a,this._sub(e,o)),l=[];l.push([i[0]-d[0]*c,i[1]-d[1]*c]),l.push([i[0]+d[0]*c,i[1]+d[1]*c]),t.push(l)}let p=[e[0]+d[0]*c,e[1]+d[1]*c];d=this._sub(e,p);let m=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18);c<0&&(h=-h),f=[o,e];for(let e=1;e<=9;e++)this._rotateDirect(d,m,h),f.push(this._add(p,d));t.push(f);break}case`ClosedHalfCircle`:{let e=this._cp2(n,2,0),r=this._mid(o,e),i=this._sub(e,r),a=Math.cos(Math.PI/18),s=Math.sin(Math.PI/18),c=[o,e];for(let e=1;e<=18;e++)this._rotateDirect(i,a,s),c.push(this._add(r,i));t.push(c);break}case`TripleParallelExtended`:{let e=this._cp2(n,0,-2),r=this._cp3(n,e,1,-2),i=this._mid(o,e),s=this._sub(r,e);this._normalize(s);let c=Math.abs(this._crossProduct(s,this._sub(i,e)))/2,l=this._dist(e,r),u=[e,o];u.push([o[0]+s[0]*l*.5,o[1]+s[1]*l*.5]),t.push(u);let d=[];d.push([i[0]-s[0]*c,i[1]-s[1]*c]),d.push([i[0]+s[0]*l*.375,i[1]+s[1]*l*.375]),a(d[d.length-1],1),d.push([i[0]+s[0]*l*.75,i[1]+s[1]*l*.75]),t.push(d);let f=[e,r];t.push(f);break}case`ParallelWithTicks`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o)),s=this._leftPerp(i);this._addAngledTicks(t,o,e,r),this._addAngledTicks(t,this._add2(o,s[0]*a,s[1]*a),this._add2(e,s[0]*a,s[1]*a),this._mid(o,e));break}case`Parallel`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._leftPerp(i),s=this._crossProduct(i,this._sub(r,o)),c=[o,e];t.push(c),c=[],c.push([o[0]+a[0]*s,o[1]+a[1]*s]),c.push([e[0]+a[0]*s,e[1]+a[1]*s]),t.push(c);break}case`PerpendicularToFirstSegment`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._mid(o,e),a=this._sub(e,o);this._normalize(a);let s=this._crossProduct(a,this._sub(r,o));this._leftPerpendicular(a);let c=[];c.push([i[0]-a[0]*s*.25,i[1]-a[1]*s*.25]),c.push([i[0]+a[0]*s*1.25,i[1]+a[1]*s*1.25]),t.push(c);break}case`ParallelOffset`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]-i[0]*a,o[1]-i[1]*a]),s.push([e[0]-i[0]*a,e[1]-i[1]*a]),t.push(s);let c=[];c.push([o[0]+i[0]*a,o[1]+i[1]*a]),c.push([e[0]+i[0]*a,e[1]+i[1]*a]),t.push(c);break}case`OffsetOpposite`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]-i[0]*a,o[1]-i[1]*a]),s.push([e[0]-i[0]*a,e[1]-i[1]*a]),t.push(s);break}case`OffsetSame`:{let e=this._cp2(n,3,0),r=this._cp3(n,e,.5,-1),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i);let s=[];s.push([o[0]+i[0]*a,o[1]+i[1]*a]),s.push([e[0]+i[0]*a,e[1]+i[1]*a]),t.push(s);break}case`CircleWithArc`:{let e=this._cp2(n,3,0),i=this._cp3(n,e,.5,-1),s,c;if(r>=4)s=n[3],c=this._crossProduct(this._sub(s,e),this._sub(i,e))>0;else{s=e,c=this._crossProduct(this._sub(s,o),this._sub(i,o))>0;let t=24*this._geomUnitsPerPoint,n=this._sub(s,o);this._normalize(n,t);let r=Math.sqrt(2)/2;this._rotateDirect(n,r,c?r:-r),e=this._add(o,n)}let l=this._sub(e,o),u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18),f=[e];for(let e=1;e<=36;e++)this._rotateDirect(l,u,d),f.push(this._add(o,l));this._add90DegArc(f,e,s,i,c),a(f[f.length-8],1),t.push(f);break}case`DoubleJog`:{let e=this._cp2(n,-3,1),i=this._cp3(n,e,-1,-.5),a;if(r>=4)a=n[3];else{let t=o;o=e,a=i;let n=this._dist(o,t),r=this._dist(a,t),s=30*this._geomUnitsPerPoint;n*.5<s&&(s=n*.5),r*.5<s&&(s=r*.5),e=this._mix(o,s/n,t,(n-s)/n),i=this._mix(a,s/r,t,(r-s)/r)}let s=this._mid(o,e),c=this._mid(a,i),l=this._dist(o,e),u=this._dist(i,a),d=Math.min(l,u)/8;d=Math.min(d,24*this._geomUnitsPerPoint);let f=Math.cos(Math.PI/4),p=this._sub(o,e);this._normalize(p,d),this._crossProduct(p,this._sub(a,e))>0?this._rotateDirect(p,f,-f):this._rotateDirect(p,f,f);let m=[];m.push(e),m.push(this._add(s,p)),m.push(this._sub(s,p)),m.push(o),t.push(m),p=this._sub(a,i),this._normalize(p,d),this._crossProduct(p,this._sub(o,i))<0?this._rotateDirect(p,f,f):this._rotateDirect(p,f,-f),m=[],m.push(i),m.push(this._add(c,p)),m.push(this._sub(c,p)),m.push(a),t.push(m);break}case`PerpendicularOffset`:{let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e);this._crossProduct(i,this._sub(o,e))>0?this._rightPerpendicular(i):this._leftPerpendicular(i);let a=[i[0]/8,i[1]/8],s=this._sub(this._mid(e,r),a);t.push([s,o]);break}case`LineExcludingLastSegment`:{let e=this._arrowPath(n),r=[],i=e.length-2;for(;i--;)r.push(e[i]);t.push(r);break}case`MultivertexArrow`:{let e=this._arrowPath(n),r=[];this._addArrow(r,e,!1),t.push(r);break}case`CrossedArrow`:{let e=this._arrowPath(n),r=[];this._addArrow(r,e,!0),t.push(r);break}case`ChevronArrow`:{let[e,r]=this._arrowLastSeg(n),i=10*this._geomUnitsPerPoint,a=this._sub(o,e),s=this._norm(a);this._normalize(a);let c=this._crossProduct(a,this._sub(r,e)),l=this._dotProduct(a,this._sub(r,e));l<s*.05?l=s*.05:l>s*.95-i&&(l=s*.95-i);let u=[e[0]+a[0]*l,e[1]+a[1]*l],d=this._leftPerp(a),f=[];f.push([u[0]+d[0]*c+a[0]*i,u[1]+d[1]*c+a[1]*i]),f.push(o),f.push([u[0]-d[0]*c+a[0]*i,u[1]-d[1]*c+a[1]*i]),t.push(f);break}case`ChevronArrowOffset`:{let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=this._crossProduct(i,this._sub(r,e)),c=this._dotProduct(i,this._sub(r,e));c<a*.05?c=a*.05:c>a*.95&&(c=a*.95);let l=[e[0]+i[0]*c,e[1]+i[1]*c];this._leftPerpendicular(i);let u=[];u.push([l[0]+i[0]*s*.5,l[1]+i[1]*s*.5]),u.push(this._mid(l,o)),u.push([l[0]-i[0]*s*.5,l[1]-i[1]*s*.5]),t.push(u);break}case`PartialFirstSegment`:{let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=this._dotProduct(i,this._sub(r,e));s<a*.05?s=a*.05:s>a*.95&&(s=a*.95);let c=[e[0]+i[0]*s,e[1]+i[1]*s];t.push([e,c]);break}case`Arch`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,1),i=this._sub(o,e),a=this._mix(r,1,i,.55),s=this._mix(r,1,i,-.55),c=[o];this._addBezier2(c,o,a,r,4),this._addBezier2(c,r,s,e,4),t.push(c);break}case`CurvedParallelTicks`:{let e=this._cp2(n,-4,1),r=this._cp3(n,e,.882353,-1.94),i=this._sub(r,e);this._crossProduct(i,this._sub(o,e))>0?this._rightPerpendicular(i):this._leftPerpendicular(i);let a=[i[0]/8,i[1]/8],s=this._sub(this._mid(e,r),a),c=this._sub(this._mix(e,.75,r,.25),a),l=this._sub(this._mix(e,.25,r,.75),a),u=[e];this._addBezier2(u,e,c,s,3),this._addBezier2(u,s,l,r,3),t.push(u);for(let e=0;e<8;e++){let n=u[e*2+1],r=[this._clone(n)];r.push(this._add(n,[i[0]/4,i[1]/4])),t.push(r)}break}case`Arc90Degrees`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,1),i=[e];this._add90DegArc(i,e,o,r),t.push(i);break}case`TipWithPerpendicularAndTicks`:{let[e,r]=this._arrowLastSeg(n),i=10*this._geomUnitsPerPoint,a=this._sub(o,e),s=this._norm(a);this._normalize(a);let c=this._crossProduct(a,this._sub(r,e)),l=this._dotProduct(a,this._sub(r,e));l<s*.05?l=s*.05:l>s*.95-i&&(l=s*.95-i);let u=this._leftPerp(a),d=[o[0]-a[0]*i,o[1]-a[1]*i],f=Math.max(s-l-i,i)*.5;c=Math.abs(c);let p=[];p.push([d[0]+u[0]*(c+f)-a[0]*f,d[1]+u[1]*(c+f)-a[1]*f]),p.push([d[0]+u[0]*c,d[1]+u[1]*c]),p.push([d[0]-u[0]*c,d[1]-u[1]*c]),p.push([d[0]-u[0]*(c+f)-a[0]*f,d[1]-u[1]*(c+f)-a[1]*f]),t.push(p),t.push([d,o]);break}case`ConcentricCircles`:{let e=this._cp2(n,1,0),i=this._cp3(n,e,2,0),s=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),l=this._dist(e,o),u=[l,0],d=[];for(let e=0;e<=36;e++)d.push(this._add(o,u)),this._rotateDirect(u,s,c);if(t.push(d),r>=4){d=[];let e=n[3];l=this._dist(e,o),u=[l,0];for(let e=0;e<=36;e++)d.push(this._add(o,u)),e===0&&(d.push(this._add(o,u)),a(d[1],1)),this._rotateDirect(u,s,c);t.push(d)}d=[],l=this._dist(i,o),u=[l,0];for(let e=0;e<=36;e++)d.push(this._add(o,u)),this._rotateDirect(u,s,c);t.push(d);break}case`DoubleJogArrow`:{o=this._arrowPath(n)[0];let[e,r]=this._arrowLastSeg(n),i=this._sub(o,e),a=this._norm(i);this._normalize(i);let s=Math.abs(this._crossProduct(i,this._sub(r,o))),c=Math.abs(this._dotProduct(i,this._sub(r,o)));c<a*.05?c=a*.05:c>a*.95&&(c=a*.95);let l=Math.max(s,c),u=this._leftPerp(i),d=[],f=[o[0]-i[0]*c*.5+u[0]*s*.5,o[1]-i[1]*c*.5+u[1]*s*.5];d.push([f[0],f[1]]),f[0]+=i[0]*l*.5+u[0]*l*.4,f[1]+=i[1]*l*.5+u[1]*l*.4,d.push([f[0],f[1]]),f[0]-=u[0]*l*.25,f[1]-=u[1]*l*.25,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5+u[0]*l*.4,f[1]+=i[1]*l*.5+u[1]*l*.4,d.push([f[0],f[1]]),t.push(d),d=[],f[0]=o[0]-i[0]*c*.5-u[0]*s*.5,f[1]=o[1]-i[1]*c*.5-u[1]*s*.5,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5-u[0]*l*.4,f[1]+=i[1]*l*.5-u[1]*l*.4,d.push([f[0],f[1]]),f[0]+=u[0]*l*.25,f[1]+=u[1]*l*.25,d.push([f[0],f[1]]),f[0]+=i[0]*l*.5-u[0]*l*.4,f[1]+=i[1]*l*.5-u[1]*l*.4,d.push([f[0],f[1]]),t.push(d);break}case`LinkedChevrons`:{let e=this._cp2(n,-5,0),r=this._cp3(n,e,-.2,1),i=this._sub(o,e);this._normalize(i);let a=this._leftPerp(i),s=Math.abs(this._crossProduct(i,this._sub(r,e)));t.push([e,o]);let c=[];c.push([o[0]-i[0]*s+a[0]*s,o[1]-i[1]*s+a[1]*s]),c.push(o),c.push([o[0]-i[0]*s-a[0]*s,o[1]-i[1]*s-a[1]*s]),t.push(c),this._addDash(t,e,[-i[0]*s+a[0]*s,-i[1]*s+a[1]*s]),this._addDash(t,e,[-i[0]*s-a[0]*s,-i[1]*s-a[1]*s]);break}case`SegmentThenHalfCircle`:{let e=this._cp2(n,2,0),i=this._cp3(n,e,1.5,0),a;a=r>=4?n[3]:this._cp3(n,e,1.25,-.5);let s=this._sub(e,o);this._normalize(s);let c=this._dist(e,i)*.5,l=this._crossProduct(s,this._sub(a,o))>0,u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18);l&&(d=-d);let f=[o,e];s[0]*=c,s[1]*=c;let p=this._add(e,s);s[0]=-s[0],s[1]=-s[1];for(let e=1;e<=18;e++)this._rotateDirect(s,u,d),f.push(this._add(p,s));t.push(f);break}case`LineWithStraightTicks`:{let e=this._cp2(n,-2,1),r=this._cp3(n,e,-1,-.5),i=this._sub(r,e);this._normalize(i);let a=this._dotProduct(i,this._sub(e,o)),s=this._dotProduct(i,this._sub(r,o)),c=[o];c.push([o[0]+i[0]*a,o[1]+i[1]*a]),c.push(e),t.push(c),c=[o],c.push([o[0]+i[0]*s,o[1]+i[1]*s]),c.push(r),t.push(c);break}case`DoubleCurve`:{let e=this._cp2(n,-5,-1),r=this._cp3(n,e,2,0),i=Math.atan2(1,5),s=Math.cos(i),c=Math.sin(i),l=this._sub(e,o),u=this._dist(o,e);this._normalize(l),this._rotateDirect(l,s,-c);let d=[o];d.push([o[0]+l[0]*u*.5,o[1]+l[1]*u*.5]),a(d[1],1),d.push([o[0]+l[0]*u*.8,o[1]+l[1]*u*.8]),this._addBezier2(d,d[2],[o[0]+l[0]*u,o[1]+l[1]*u],e,3);let f=this._sub(r,e),p=this._dist(e,r);this._normalize(f),this._rotateDirect(f,s,-c),this._addBezier2(d,e,[r[0]-f[0]*p,r[1]-f[1]*p],[r[0]-f[0]*p*.8,r[1]-f[1]*p*.8],3),d.push(r),t.push(d);break}case`ParallelWithTicksByWidth`:{let e=this._cp2(n,0,-1),r=this._cp3(n,e,.5,3),i=this._sub(e,o);this._normalize(i);let a=this._crossProduct(i,this._sub(r,o));this._leftPerpendicular(i),a>0?(this._addAngledTicks(t,o,[o[0]+i[0]*a,o[1]+i[1]*a],e),this._addAngledTicks(t,e,[e[0]+i[0]*a,e[1]+i[1]*a],o)):(this._addAngledTicks(t,[o[0]+i[0]*a,o[1]+i[1]*a],o,e),this._addAngledTicks(t,[e[0]+i[0]*a,e[1]+i[1]*a],o,e));break}case`EnclosingRoundedRectangle`:{let e=this._cp2(n,3,-2),t=[Math.min(o[0],e[0]),Math.max(o[1],e[1])],r=[Math.max(o[0],e[0]),Math.min(o[1],e[1])],i=r[0]-t[0],a=t[1]-r[1],s=Math.min(i,a)/10,c=[];c.push([t[0]+s+(i-s*2)*.75,t[1]]),c.push([r[0]-s,t[1]]),this._add90DegArc(c,[r[0]-s,t[1]],[r[0],t[1]-s],[r[0],t[1]]),c.push([r[0],r[1]+s]),this._add90DegArc(c,[r[0],r[1]+s],[r[0]-s,r[1]],r),c.push([t[0]+s,r[1]]),this._add90DegArc(c,[t[0]+s,r[1]],[t[0],r[1]+s],[t[0],r[1]]),c.push([t[0],t[1]-s]),this._add90DegArc(c,[t[0],t[1]-s],[t[0]+s,t[1]],t),c.push([t[0]+s+(i-s*2)*.75,t[1]]);break}case`ParallelOffsetByValue`:{if(n.length<2||this._width===0)break;let e=this._offsetPath(n,this._width*.5);e&&t.push(e);let r=this._offsetPath(n,-this._width*.5);r&&t.push(r);break}default:t.push(n)}}return t}}function l(e){return e===`ParallelOffsetByValue`}export{s as EffectControlMeasureLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../core/RandomLCG.js";import{Placement as t}from"../CIMPlacements.js";const n=1e-6;class r{static{this.instance=null}static local(){return r.instance===null&&(r.instance=new r),r.instance}execute(e,t,n,r){return new i(e,t,n,r)}}class i{constructor(n,r,i,a){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(r.stepX??16)*i,this._stepY=Math.abs(r.stepY??16)*i,this._stepX=Math.round(this._stepX*128)/128,this._stepY=Math.round(this._stepY*128)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=r.gridType??`Fixed`,this._gridType===`Random`){let t=r.seed??13;this._randomLCG=new e(t*1),this._randomness=(r.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=r.gridAngle??0,this._shiftOddRows=r.shiftOddRows??!1,this._offsetX=(r.offsetX??0)*i,this._offsetY=(r.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX){if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX}if(this._stepY){if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}}if(this._graphicOriginX=0,this._graphicOriginY=0,a!=null){let[e,t,n,r]=a.split(`/`,4),i=parseFloat(e),o=parseFloat(t),s=parseFloat(n),c=parseFloat(r);this._graphicOriginX=-(c*2**i+s)*512,this._graphicOriginY=o*512,this._testInsidePolygon=!0}this._internalPlacement=new t,this._calculateMinMax(n),this._geometryCursor=n}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!i._randValues){i._randValues=[];for(let e=0;e<24;e++)for(let e=0;e<24;e++)i._randValues.push(this._randomLCG.getFloat()),i._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(e){this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0;let t,n,r,i,a,o,s,c,l,u,d,f,p,m;s=c=p=d=Number.MAX_VALUE,l=u=m=f=-Number.MAX_VALUE;let h=this._cosAngle!==1;for(e.reset();e.nextPath();)for(;e.nextPoint();)o=e.x,a=e.y,t=o-this._graphicOriginX-this._offsetX,n=a-this._graphicOriginY-this._offsetY,h?(r=this._cosAngle*t-this._sinAngle*n,i=this._sinAngle*t+this._cosAngle*n):(r=t,i=n),s=Math.min(s,r),l=Math.max(l,r),c=Math.min(c,i),u=Math.max(u,i),d=Math.min(d,a),f=Math.max(f,a),p=Math.min(p,o),m=Math.max(m,o);d=d===Number.MAX_VALUE?-512-this._stepY:d,f=f===-Number.MAX_VALUE?this._stepY:f,p=p===Number.MAX_VALUE?-this._stepX:p,m=m===-Number.MAX_VALUE?512+this._stepX:m;let g=f-d,_=m-p;if(this._verticalSubdivision=g>=_,this._polygonMin=this._verticalSubdivision?d:p,this._testInsidePolygon){let e=0-this._graphicOriginX-this._offsetX-this._stepX,t=512-this._graphicOriginX-this._offsetX+this._stepX,n=-512-this._graphicOriginY-this._offsetY-this._stepY,r=0-this._graphicOriginY-this._offsetY+this._stepY;if(h){let i=[[e,n],[e,r],[t,n],[t,r]];e=n=Number.MAX_VALUE,t=r=-Number.MAX_VALUE;for(let a of i){let i=this._cosAngle*a[0]-this._sinAngle*a[1],o=this._sinAngle*a[0]+this._cosAngle*a[1];e=Math.min(e,i),t=Math.max(t,i),n=Math.min(n,o),r=Math.max(r,o)}}s=s===Number.MAX_VALUE?e:Math.max(s,e),c=c===Number.MAX_VALUE?n:Math.max(c,n),l=l===-Number.MAX_VALUE?t:Math.min(l,t),u=u===-Number.MAX_VALUE?r:Math.min(u,r)}this._xMin=Math.round(s/this._stepX),this._xMax=Math.round(l/this._stepX),this._yMin=Math.round(c/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(e,p,m,d,f)}_buildAccelerationMap(e,t,n,r,i){e.reset();let a=new Map,s=this._verticalSubdivision,c=s?i-r:n-t,l=Math.ceil(c/10);if(l<=1)return;let u=Math.floor(c/l);l++,this._delta=u;let d,f,p,m,h,g,_,v,y,b,x;for(s?(y=-512-2*this._stepY,b=2*this._stepY,x=r):(y=-2*this._stepX,b=512+2*this._stepX,x=t);e.nextPath();)if(!(e.pathSize<2)&&e.nextPoint())for(d=e.x,f=e.y;e.nextPoint();d=p,f=m){if(p=e.x,m=e.y,s){if(f===m||f<y&&m<y||f>b&&m>b)continue;h=Math.min(f,m),g=Math.max(f,m)}else{if(d===p||d<y&&p<y||d>b&&p>b)continue;h=Math.min(d,p),g=Math.max(d,p)}for(;h<g;)_=Math.floor((h-x)/u),o(_,d,f,p,m,a),h+=u;v=Math.floor((g-x)/u),v>_&&o(v,d,f,p,m,a)}this._accelerationMap=a}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);let t=this._currentY*this._stepY+this._offsetY;this._currentX++;let n,r;if(this._gridType===`Random`){let a=(this._currentX%24+24)%24,o=(this._currentY%24+24)%24;n=this._graphicOriginX+e+this._stepX*this._randomness*(.5-i._randValues[o*24+a])*2/3,r=this._graphicOriginY+t+this._stepY*this._randomness*(.5-i._randValues[o*24+a+1])*2/3}else n=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,r=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t;if(!this._testInsidePolygon||this._isInsidePolygon(n,r,this._geometryCursor))return this._internalPlacement.setTranslate(n,r),this._internalPlacement}}_isInsidePolygon(e,t,r){if(this._accelerationMap==null)return a(e,t,r);e+=n,t+=n;let i=this._verticalSubdivision,o=Math.floor(((i?t:e)-this._polygonMin)/this._delta),s=this._accelerationMap.get(o);if(!s)return!1;let c=0,l,u,d;for(let n of s){if(l=n[0],u=n[1],i){if(l[1]>t==u[1]>t)continue;d=(u[0]-l[0])*(t-l[1])-(u[1]-l[1])*(e-l[0])}else{if(l[0]>e==u[0]>e)continue;d=(u[1]-l[1])*(e-l[0])-(u[0]-l[0])*(t-l[1])}d>0?c++:c--}return c!==0}}function a(e,t,r){let i=0,a,o,s,c;for(e+=n,t+=n,r.reset();r.nextPath();)if(r.nextPoint())for(a=r.x,o=r.y;r.nextPoint();a=s,o=c)s=r.x,c=r.y,o>t!=c>t&&((s-a)*(t-o)-(c-o)*(e-a)>0?i++:i--);return i!==0}function o(e,t,n,r,i,a){let o=a.get(e);o||(o=[],a.set(e,o)),o.push([[t,n],[r,i]])}export{r as PlacementInsidePolygon};
2
+ import e from"../../../core/RandomLCG.js";import{Placement as t}from"../CIMPlacements.js";const n=1e-6;class r{static{this.instance=null}static local(){return r.instance===null&&(r.instance=new r),r.instance}execute(e,t,n,r){return new i(e,t,n,r)}}class i{constructor(n,r,i,a){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(r.stepX??16)*i,this._stepY=Math.abs(r.stepY??16)*i,this._stepX=Math.round(this._stepX*128)/128,this._stepY=Math.round(this._stepY*128)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=r.gridType??`Fixed`,this._gridType===`Random`){let t=r.seed??13;this._randomLCG=new e(+t),this._randomness=(r.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=r.gridAngle??0,this._shiftOddRows=r.shiftOddRows??!1,this._offsetX=(r.offsetX??0)*i,this._offsetY=(r.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX){if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX}if(this._stepY){if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}}if(this._graphicOriginX=0,this._graphicOriginY=0,a!=null){let[e,t,n,r]=a.split(`/`,4),i=parseFloat(e),o=parseFloat(t),s=parseFloat(n),c=parseFloat(r);this._graphicOriginX=-(c*2**i+s)*512,this._graphicOriginY=o*512,this._testInsidePolygon=!0}this._internalPlacement=new t,this._calculateMinMax(n),this._geometryCursor=n}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!i._randValues){i._randValues=[];for(let e=0;e<24;e++)for(let e=0;e<24;e++)i._randValues.push(this._randomLCG.getFloat()),i._randValues.push(this._randomLCG.getFloat())}}_calculateMinMax(e){this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0;let t,n,r,i,a,o,s,c,l,u,d,f,p,m;s=c=p=d=Number.MAX_VALUE,l=u=m=f=-Number.MAX_VALUE;let h=this._cosAngle!==1;for(e.reset();e.nextPath();)for(;e.nextPoint();)o=e.x,a=e.y,t=o-this._graphicOriginX-this._offsetX,n=a-this._graphicOriginY-this._offsetY,h?(r=this._cosAngle*t-this._sinAngle*n,i=this._sinAngle*t+this._cosAngle*n):(r=t,i=n),s=Math.min(s,r),l=Math.max(l,r),c=Math.min(c,i),u=Math.max(u,i),d=Math.min(d,a),f=Math.max(f,a),p=Math.min(p,o),m=Math.max(m,o);d=d===Number.MAX_VALUE?-512-this._stepY:d,f=f===-Number.MAX_VALUE?this._stepY:f,p=p===Number.MAX_VALUE?-this._stepX:p,m=m===-Number.MAX_VALUE?512+this._stepX:m;let g=f-d,_=m-p;if(this._verticalSubdivision=g>=_,this._polygonMin=this._verticalSubdivision?d:p,this._testInsidePolygon){let e=0-this._graphicOriginX-this._offsetX-this._stepX,t=512-this._graphicOriginX-this._offsetX+this._stepX,n=-512-this._graphicOriginY-this._offsetY-this._stepY,r=0-this._graphicOriginY-this._offsetY+this._stepY;if(h){let i=[[e,n],[e,r],[t,n],[t,r]];e=n=Number.MAX_VALUE,t=r=-Number.MAX_VALUE;for(let a of i){let i=this._cosAngle*a[0]-this._sinAngle*a[1],o=this._sinAngle*a[0]+this._cosAngle*a[1];e=Math.min(e,i),t=Math.max(t,i),n=Math.min(n,o),r=Math.max(r,o)}}s=s===Number.MAX_VALUE?e:Math.max(s,e),c=c===Number.MAX_VALUE?n:Math.max(c,n),l=l===-Number.MAX_VALUE?t:Math.min(l,t),u=u===-Number.MAX_VALUE?r:Math.min(u,r)}this._xMin=Math.round(s/this._stepX),this._xMax=Math.round(l/this._stepX),this._yMin=Math.round(c/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(e,p,m,d,f)}_buildAccelerationMap(e,t,n,r,i){e.reset();let a=new Map,s=this._verticalSubdivision,c=s?i-r:n-t,l=Math.ceil(c/10);if(l<=1)return;let u=Math.floor(c/l);l++,this._delta=u;let d,f,p,m,h,g,_,v,y,b,x;for(s?(y=-512-2*this._stepY,b=2*this._stepY,x=r):(y=-2*this._stepX,b=512+2*this._stepX,x=t);e.nextPath();)if(!(e.pathSize<2)&&e.nextPoint())for(d=e.x,f=e.y;e.nextPoint();d=p,f=m){if(p=e.x,m=e.y,s){if(f===m||f<y&&m<y||f>b&&m>b)continue;h=Math.min(f,m),g=Math.max(f,m)}else{if(d===p||d<y&&p<y||d>b&&p>b)continue;h=Math.min(d,p),g=Math.max(d,p)}for(;h<g;)_=Math.floor((h-x)/u),o(_,d,f,p,m,a),h+=u;v=Math.floor((g-x)/u),v>_&&o(v,d,f,p,m,a)}this._accelerationMap=a}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let e=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(e+=.5*this._stepX);let t=this._currentY*this._stepY+this._offsetY;this._currentX++;let n,r;if(this._gridType===`Random`){let a=(this._currentX%24+24)%24,o=(this._currentY%24+24)%24;n=this._graphicOriginX+e+this._stepX*this._randomness*(.5-i._randValues[o*24+a])*2/3,r=this._graphicOriginY+t+this._stepY*this._randomness*(.5-i._randValues[o*24+a+1])*2/3}else n=this._graphicOriginX+this._cosAngle*e+this._sinAngle*t,r=this._graphicOriginY-this._sinAngle*e+this._cosAngle*t;if(!this._testInsidePolygon||this._isInsidePolygon(n,r,this._geometryCursor))return this._internalPlacement.setTranslate(n,r),this._internalPlacement}}_isInsidePolygon(e,t,r){if(this._accelerationMap==null)return a(e,t,r);e+=n,t+=n;let i=this._verticalSubdivision,o=Math.floor(((i?t:e)-this._polygonMin)/this._delta),s=this._accelerationMap.get(o);if(!s)return!1;let c=0,l,u,d;for(let n of s){if(l=n[0],u=n[1],i){if(l[1]>t==u[1]>t)continue;d=(u[0]-l[0])*(t-l[1])-(u[1]-l[1])*(e-l[0])}else{if(l[0]>e==u[0]>e)continue;d=(u[1]-l[1])*(e-l[0])-(u[0]-l[0])*(t-l[1])}d>0?c++:c--}return c!==0}}function a(e,t,r){let i=0,a,o,s,c;for(e+=n,t+=n,r.reset();r.nextPath();)if(r.nextPoint())for(a=r.x,o=r.y;r.nextPoint();a=s,o=c)s=r.x,c=r.y,o>t!=c>t&&((s-a)*(t-o)-(c-o)*(e-a)>0?i++:i--);return i!==0}function o(e,t,n,r,i,a){let o=a.get(e);o||(o=[],a.set(e,o)),o.push([[t,n],[r,i]])}export{r as PlacementInsidePolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{EuclideanDistanceTransform as e}from"../../core/EuclideanDistanceTransform.js";import{packFloatRGBA as t}from"../../core/floatRGBA.js";import n from"../../core/Logger.js";import{nextPowerOfTwo as r}from"../../core/mathUtils.js";import{gradientTextureExternalPadding as i}from"../../views/2d/engine/webgl/definitions.js";import{dashSdfRasterizationScale as a,dashSdfDistanceNormalization as o,dashRadius as s}from"./constants.js";import{defaultCIMValues as c}from"./defaultCIMValues.js";const l=()=>n.getLogger(`esri.symbols.cim.rasterizingUtils`),u=e=>e===`vertical`||e===`horizontal`||e===`cross`||e===`esriSFSCross`||e===`esriSFSVertical`||e===`esriSFSHorizontal`;function d(t,n,r,i){let a=n*r,o=new Float64Array(a),s=!1;for(let e=0;e<a;e++){let n=t[4*e+3]/255;s||=n>0,o[e]=n===0?Number.MAX_VALUE:n===1?0:(1-n)*(1-n)}let c=new Uint8Array(a*4);if(!s)return c;new e(Math.max(n,r)).compute(o,n,r);for(let e=0;e<a;e++){let t=Math.min(Math.max(i+.5-o[e],0),1);c[4*e]=255*t,c[4*e+1]=255*t,c[4*e+2]=255*t,c[4*e+3]=255*t}return c}function f(n,r,i,a){let o=r*i,s=new Float64Array(o),c=new Float64Array(o),l=!1;for(let e=0;e<o;e++){let t=n[4*e+3]/255;if(l||=t>0,t===0)s[e]=Number.MAX_VALUE,c[e]=0;else if(t===1)s[e]=0,c[e]=Number.MAX_VALUE;else{let n=.5-t;s[e]=n>0?n*n:0,c[e]=n<0?n*n:0}}let u=new Uint8Array(o*4),d=Math.max(Math.ceil(a)+1,1);if(!l)return{image:u,encodingRadius:d};let f=new e(Math.max(r,i));f.compute(s,r,i),f.compute(c,r,i);for(let e=0;e<o;e++){let n=s[e]-c[e]-a,r=Math.min(Math.max(.5-n/(2*d),0),1);t(r,u,4*e)}return{image:u,encodingRadius:d}}function p(e,t,n,r=128){let i=new Map,a=(e,t,n,r)=>{let a=`${e},${t}`,o=i.get(a),s=[[e,t],[n,r]];o?o.push(s):i.set(a,[s])},o=(i,a)=>i>=0&&i<t&&a>=0&&a<n&&e[4*(a*t+i)+3]>=r;for(let e=0;e<n;e++)for(let n=0;n<t;n++)o(n,e)&&(o(n,e-1)||a(n,e,n+1,e),o(n+1,e)||a(n+1,e,n+1,e+1),o(n,e+1)||a(n+1,e+1,n,e+1),o(n-1,e)||a(n,e+1,n,e));let s=[];for(;i.size>0;){let e=i.entries().next();if(e.done)break;let[t,n]=e.value,r=n.pop();if(!r){i.delete(t);continue}n.length===0&&i.delete(t);let a=[r[0],r[1]],o=r[0],c=r[1];for(;c[0]!==o[0]||c[1]!==o[1];){let e=`${c[0]},${c[1]}`,t=i.get(e);if(!t)break;let n=t.pop();if(!n){i.delete(e);break}t.length===0&&i.delete(e),c=n[1],a.push(c)}a.length>=4&&c[0]===o[0]&&c[1]===o[1]&&s.push(a)}return s}function m(e,t){let n=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let i=e[r+3]*t[r+3]/65025;n[r]=e[r]*i,n[r+1]=e[r+1]*i,n[r+2]=e[r+2]*i,n[r+3]=255*i}return n}function h(e,t,n){let i=t.style,a=r(Math.ceil(n)),o=u(i)?a*8:a*16,s=a*2;e.width=o,e.height=o;let c=e.getContext(`2d`);c.strokeStyle=`#ffffff`,c.lineWidth=a,c.beginPath(),(i===`vertical`||i===`cross`||i===`esriSFSCross`||i===`esriSFSVertical`)&&(c.moveTo(o/2,-s),c.lineTo(o/2,o+s)),(i===`horizontal`||i===`cross`||i===`esriSFSCross`||i===`esriSFSHorizontal`)&&(c.moveTo(-s,o/2),c.lineTo(o+s,o/2)),(i===`backward-diagonal`||i===`diagonal-cross`||i===`esriSFSDiagonalCross`||i===`esriSFSBackwardDiagonal`)&&(c.moveTo(-s,-s),c.lineTo(o+s,o+s),c.moveTo(o-s,-s),c.lineTo(o+s,s),c.moveTo(-s,o-s),c.lineTo(s,o+s)),(i===`forward-diagonal`||i===`diagonal-cross`||i===`esriSFSForwardDiagonal`||i===`esriSFSDiagonalCross`)&&(c.moveTo(o+s,-s),c.lineTo(-s,o+s),c.moveTo(s,-s),c.lineTo(-s,s),c.moveTo(o+s,o-s),c.lineTo(o-s,o+s)),c.stroke();let l=c.getImageData(0,0,e.width,e.height),d=new Uint8Array(l.data),f;for(let e=0;e<d.length;e+=4)f=d[e+3]/255,d[e]=d[e]*f,d[e+1]=d[e+1]*f,d[e+2]=d[e+2]*f;return[d,e.width,e.height,a]}function g(e){e.length%2==1&&(e=[...e,...e]);let n=0,r=e.length-1;for(;n<e.length&&e[n]===0;)n++;for(;r>=0&&e[r]===0;)r--;let i=0,s=[];for(let t=n;t<=r;t++)e[t]===0?i++:i===0?s.push(e[t]):i&1?(s[s.length-1]+=e[t],i=0):(s.push(e[t]),i=0);if(i=n+e.length-1-r,e=s,e.length<=1)return e.length===0||n%2==0?[new Uint8Array,0,1]:[new Uint8Array([255,255,255,255]),1,1];let c=e.reduce((e,t)=>e+t,0),l=Math.round(c*a),u=l*1,d=new Float32Array(u),f=0,p=0,m=.5,h=n%2==0,g=i%2==1;for(let t=0;t<e.length;t++){let n=e[t];for(f=p,p+=n*a,t===0&&g&&(f-=e[e.length-1]*a),t===e.length-1&&g&&(p+=e[0]*a);m<=p&&m-.5<u;){let e=m-.5,t=Math.min(Math.abs(m-f),Math.abs(m-p));d[e]=h?-t:t,m++}h=!h}let _=d.length,v=new Uint8Array(_*4);for(let e=0;e<_;++e){let n=d[e]/a/o*.5+.5;t(n,v,4*e)}return[v,l,1]}function _(e,n){e??=[];let r=n===`Butt`,i=n===`Square`,a=!r&&!i;e.length%2==1&&(e=[...e,...e]);let o=s,c=o*2,l=0;for(let t of e)l+=t;let u=Math.round(l*o),d=u*c,f=new Float32Array(d),p=.5*o,m=0,h=0,g=.5,_=!0;for(let t of e){for(m=h,h+=t*o;g<=h;){let e=.5;for(;e<c;){let t=(e-.5)*u+g-.5,n=a?(e-o)*(e-o):Math.abs(e-o);f[t]=_?r?Math.max(Math.max(m+p-g,n),Math.max(g-h+p,n)):n:a?Math.min((g-m)*(g-m)+n,(g-h)*(g-h)+n):i?Math.min(Math.max(g-m,n),Math.max(h-g,n)):Math.min(Math.max(g-m+p,n),Math.max(h+p-g,n)),e++}g++}_=!_}let v=f.length,y=new Uint8Array(v*4);for(let e=0;e<v;++e){let n=(a?Math.sqrt(f[e]):f[e])/o;t(n,y,4*e)}return[y,u,c]}function v(e,t){let{colorRamp:n,gradientType:r}=t,i=n.type===`CIMFixedColorRamp`,a=t.interval||c.CIMGradientFill.interval,o=x(n);return i&&(o=S(o,a)),r===`Discrete`||i?w(e,o,a):C(e,o)}let y;function b(e,t){let{colorRamp:n,gradientType:r}=t,i=x(n),a=n.type===`CIMFixedColorRamp`;if(r===`Continuous`&&!a)return T(e,i);let o=t.interval??c.CIMGradientFill.interval;if(a)return T(e,S(i,o));let s=[];y??=document.createElement(`canvas`),E(y,i,o,1,0);let l=y.getContext(`2d`).getImageData(0,0,o,1).data;for(let e=0,t=0;e<o;e++,t=e*4){let n=[l[t+0],l[t+1],l[t+2],l[t+3]];s.push({offset:e/o,color:n}),s.push({offset:(e+1)/o,color:n})}return T(e,s)}function x(e){let t=[];switch(e.type){case`CIMPolarContinuousColorRamp`:case`CIMLinearContinuousColorRamp`:{e.type===`CIMPolarContinuousColorRamp`&&l().warnOnce(`CIMPolarContinuousColorRamp is currently unsupported. Falling back to CIMLinearContinuousColorRamp.`);let n=e;t.push({offset:0,color:[n.fromColor[0],n.fromColor[1],n.fromColor[2],n.fromColor[3]/255]}),t.push({offset:1,color:[n.toColor[0],n.toColor[1],n.toColor[2],n.toColor[3]/255]});break}case`CIMFixedColorRamp`:{let n=e,r=1/(n.colors.length-1),i=0;for(let e of n.colors)t.push({offset:i,color:[e[0],e[1],e[2],e[3]/255]}),i+=r;break}case`CIMMultipartColorRamp`:{let n=e,r=n.weights.reduce((e,t)=>e+t,0),i=0;for(let e=0;e<n.colorRamps.length;e++){let a=n.colorRamps[e],o=n.weights[e],s=x(a);for(let e of s)t.push({offset:(i+e.offset*o)/r,color:e.color});i+=o}break}default:l().error(`Color ramp "${e.type}" currently unsupported.`)}return t}function S(e,t){let n=[],r=(e.length-1)/(t-1);for(let i=0;i<t;i++){let a=e[Math.round(i*r)].color;n.push({offset:i/t,color:a}),n.push({offset:(i+1)/t,color:a})}return n}function C(e,t){return E(e,t,32,1,i),D(e)}function w(e,t,n){return E(e,t,n,1,i),D(e)}function T(e,t,n=0){for(let{offset:r,color:i}of t)e.addColorStop(Math.min(Math.max(r,n),1-n),`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]})`)}function E(e,t,n,r,i){let a=n+2*i;e.width=a,e.height=r;let o=(i+1)/a,s=e.getContext(`2d`,{willReadFrequently:!0});if(t.length>0){let e=s.createLinearGradient(0,0,a,r);T(e,t,o),s.fillStyle=e}else s.fillStyle=`rgba(128, 128, 128, 1)`;s.fillRect(0,0,a,r)}function D(e){let{width:t,height:n}=e,r=e.getContext(`2d`).getImageData(0,0,t,n),i=new Uint8Array(r.data);for(let e=0;e<i.length;e+=4){let t=i[e+3]/255;i[e]*=t,i[e+1]*=t,i[e+2]*=t}return[i,t,n]}function O(e){let t=e[0]?.[0]?.[0]??0,n=e[0]?.[0]?.[1]??0,r={ymin:n,xmin:t,ymax:n,xmax:t,width:0,height:0};for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.length;e++){let t=n[e][0],i=n[e][1];t<r.xmin&&(r.xmin=t),t>r.xmax&&(r.xmax=t),i<r.ymin&&(r.ymin=i),i>r.ymax&&(r.ymax=i)}}return r.width=Math.abs(r.xmax-r.xmin),r.height=Math.abs(r.ymax-r.ymin),r}function k(e,t){let n=O(e),r=n.width===0?1:n.width,i=n.height===0?1:n.height,a=[];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let a=Math.round(s[e][0]-n.xmin),o=Math.round(s[e][1]-n.ymin);if(a=t.xmin+a*t.width/r,o=t.ymin+o*t.height/i,isNaN(a)||isNaN(o))throw Error(`Scaled shape has NaN values`);c.push([a,o])}a.push(c)}return a}function A(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=[];for(let e=0;e<a.length;e++){let r=a[e][0]+t,i=a[e][1]+n;if(isNaN(r)||isNaN(i))throw Error(`Scaled shape has NaN values`);o.push([r,i])}r.push(o)}return r}export{b as addColorStops,m as applyAlphaMask,p as createAlphaMaskRings,d as createHaloImage,f as createHaloSDF,_ as rasterizeDash,g as rasterizeDash1D,h as rasterizeFillStyle,v as rasterizeGradient,k as scale,A as translate};
2
+ import{EuclideanDistanceTransform as e}from"../../core/EuclideanDistanceTransform.js";import{packFloatRGBA as t}from"../../core/floatRGBA.js";import n from"../../core/Logger.js";import{nextPowerOfTwo as r}from"../../core/mathUtils.js";import{gradientTextureExternalPadding as i}from"../../views/2d/engine/webgl/definitions.js";import{dashSdfRasterizationScale as a,dashSdfDistanceNormalization as o,dashRadius as s}from"./constants.js";import{defaultCIMValues as c}from"./defaultCIMValues.js";const l=()=>n.getLogger(`esri.symbols.cim.rasterizingUtils`),u=e=>e===`vertical`||e===`horizontal`||e===`cross`||e===`esriSFSCross`||e===`esriSFSVertical`||e===`esriSFSHorizontal`;function d(t,n,r,i){let a=n*r,o=new Float64Array(a),s=!1;for(let e=0;e<a;e++){let n=t[4*e+3]/255;s||=n>0,o[e]=n===0?Number.MAX_VALUE:n===1?0:(1-n)*(1-n)}let c=new Uint8Array(a*4);if(!s)return c;new e(Math.max(n,r)).compute(o,n,r);for(let e=0;e<a;e++){let t=Math.min(Math.max(i+.5-o[e],0),1);c[4*e]=255*t,c[4*e+1]=255*t,c[4*e+2]=255*t,c[4*e+3]=255*t}return c}function f(n,r,i,a){let o=r*i,s=new Float64Array(o),c=new Float64Array(o),l=!1;for(let e=0;e<o;e++){let t=n[4*e+3]/255;if(l||=t>0,t===0)s[e]=Number.MAX_VALUE,c[e]=0;else if(t===1)s[e]=0,c[e]=Number.MAX_VALUE;else{let n=.5-t;s[e]=n>0?n*n:0,c[e]=n<0?n*n:0}}let u=new Uint8Array(o*4),d=Math.max(Math.ceil(a)+1,1);if(!l)return{image:u,encodingRadius:d};let f=new e(Math.max(r,i));f.compute(s,r,i),f.compute(c,r,i);for(let e=0;e<o;e++){let n=s[e]-c[e]-a,r=Math.min(Math.max(.5-n/(2*d),0),1);t(r,u,4*e)}return{image:u,encodingRadius:d}}function p(e,t,n,r=128){let i=new Map,a=(e,t,n,r)=>{let a=`${e},${t}`,o=i.get(a),s=[[e,t],[n,r]];o?o.push(s):i.set(a,[s])},o=(i,a)=>i>=0&&i<t&&a>=0&&a<n&&e[4*(a*t+i)+3]>=r;for(let e=0;e<n;e++)for(let n=0;n<t;n++)o(n,e)&&(o(n,e-1)||a(n,e,n+1,e),o(n+1,e)||a(n+1,e,n+1,e+1),o(n,e+1)||a(n+1,e+1,n,e+1),o(n-1,e)||a(n,e+1,n,e));let s=[];for(;i.size>0;){let e=i.entries().next();if(e.done)break;let[t,n]=e.value,r=n.pop();if(!r){i.delete(t);continue}n.length===0&&i.delete(t);let a=[r[0],r[1]],o=r[0],c=r[1];for(;c[0]!==o[0]||c[1]!==o[1];){let e=`${c[0]},${c[1]}`,t=i.get(e);if(!t)break;let n=t.pop();if(!n){i.delete(e);break}t.length===0&&i.delete(e),c=n[1],a.push(c)}a.length>=4&&c[0]===o[0]&&c[1]===o[1]&&s.push(a)}return s}function m(e,t){let n=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let i=e[r+3]*t[r+3]/65025;n[r]=e[r]*i,n[r+1]=e[r+1]*i,n[r+2]=e[r+2]*i,n[r+3]=255*i}return n}function h(e,t,n){let i=t.style,a=r(Math.ceil(n)),o=u(i)?a*8:a*16,s=a*2;e.width=o,e.height=o;let c=e.getContext(`2d`);c.strokeStyle=`#ffffff`,c.lineWidth=a,c.beginPath(),(i===`vertical`||i===`cross`||i===`esriSFSCross`||i===`esriSFSVertical`)&&(c.moveTo(o/2,-s),c.lineTo(o/2,o+s)),(i===`horizontal`||i===`cross`||i===`esriSFSCross`||i===`esriSFSHorizontal`)&&(c.moveTo(-s,o/2),c.lineTo(o+s,o/2)),(i===`backward-diagonal`||i===`diagonal-cross`||i===`esriSFSDiagonalCross`||i===`esriSFSBackwardDiagonal`)&&(c.moveTo(-s,-s),c.lineTo(o+s,o+s),c.moveTo(o-s,-s),c.lineTo(o+s,s),c.moveTo(-s,o-s),c.lineTo(s,o+s)),(i===`forward-diagonal`||i===`diagonal-cross`||i===`esriSFSForwardDiagonal`||i===`esriSFSDiagonalCross`)&&(c.moveTo(o+s,-s),c.lineTo(-s,o+s),c.moveTo(s,-s),c.lineTo(-s,s),c.moveTo(o+s,o-s),c.lineTo(o-s,o+s)),c.stroke();let l=c.getImageData(0,0,e.width,e.height),d=new Uint8Array(l.data),f;for(let e=0;e<d.length;e+=4)f=d[e+3]/255,d[e]=d[e]*f,d[e+1]=d[e+1]*f,d[e+2]=d[e+2]*f;return[d,e.width,e.height,a]}function g(e){e.length%2==1&&(e=[...e,...e]);let n=0,r=e.length-1;for(;n<e.length&&e[n]===0;)n++;for(;r>=0&&e[r]===0;)r--;let i=0,s=[];for(let t=n;t<=r;t++)e[t]===0?i++:i===0?s.push(e[t]):i&1?(s[s.length-1]+=e[t],i=0):(s.push(e[t]),i=0);if(i=n+e.length-1-r,e=s,e.length<=1)return e.length===0||n%2==0?[new Uint8Array,0,1]:[new Uint8Array([255,255,255,255]),1,1];let c=e.reduce((e,t)=>e+t,0),l=Math.round(c*a),u=+l,d=new Float32Array(u),f=0,p=0,m=.5,h=n%2==0,g=i%2==1;for(let t=0;t<e.length;t++){let n=e[t];for(f=p,p+=n*a,t===0&&g&&(f-=e[e.length-1]*a),t===e.length-1&&g&&(p+=e[0]*a);m<=p&&m-.5<u;){let e=m-.5,t=Math.min(Math.abs(m-f),Math.abs(m-p));d[e]=h?-t:t,m++}h=!h}let _=d.length,v=new Uint8Array(_*4);for(let e=0;e<_;++e){let n=d[e]/a/o*.5+.5;t(n,v,4*e)}return[v,l,1]}function _(e,n){e??=[];let r=n===`Butt`,i=n===`Square`,a=!r&&!i;e.length%2==1&&(e=[...e,...e]);let o=s,c=o*2,l=0;for(let t of e)l+=t;let u=Math.round(l*o),d=u*c,f=new Float32Array(d),p=.5*o,m=0,h=0,g=.5,_=!0;for(let t of e){for(m=h,h+=t*o;g<=h;){let e=.5;for(;e<c;){let t=(e-.5)*u+g-.5,n=a?(e-o)*(e-o):Math.abs(e-o);f[t]=_?r?Math.max(Math.max(m+p-g,n),Math.max(g-h+p,n)):n:a?Math.min((g-m)*(g-m)+n,(g-h)*(g-h)+n):i?Math.min(Math.max(g-m,n),Math.max(h-g,n)):Math.min(Math.max(g-m+p,n),Math.max(h+p-g,n)),e++}g++}_=!_}let v=f.length,y=new Uint8Array(v*4);for(let e=0;e<v;++e){let n=(a?Math.sqrt(f[e]):f[e])/o;t(n,y,4*e)}return[y,u,c]}function v(e,t){let{colorRamp:n,gradientType:r}=t,i=n.type===`CIMFixedColorRamp`,a=t.interval||c.CIMGradientFill.interval,o=x(n);return i&&(o=S(o,a)),r===`Discrete`||i?w(e,o,a):C(e,o)}let y;function b(e,t){let{colorRamp:n,gradientType:r}=t,i=x(n),a=n.type===`CIMFixedColorRamp`;if(r===`Continuous`&&!a)return T(e,i);let o=t.interval??c.CIMGradientFill.interval;if(a)return T(e,S(i,o));let s=[];y??=document.createElement(`canvas`),E(y,i,o,1,0);let l=y.getContext(`2d`).getImageData(0,0,o,1).data;for(let e=0,t=0;e<o;e++,t=e*4){let n=[l[t+0],l[t+1],l[t+2],l[t+3]];s.push({offset:e/o,color:n}),s.push({offset:(e+1)/o,color:n})}return T(e,s)}function x(e){let t=[];switch(e.type){case`CIMPolarContinuousColorRamp`:case`CIMLinearContinuousColorRamp`:{e.type===`CIMPolarContinuousColorRamp`&&l().warnOnce(`CIMPolarContinuousColorRamp is currently unsupported. Falling back to CIMLinearContinuousColorRamp.`);let n=e;t.push({offset:0,color:[n.fromColor[0],n.fromColor[1],n.fromColor[2],n.fromColor[3]/255]}),t.push({offset:1,color:[n.toColor[0],n.toColor[1],n.toColor[2],n.toColor[3]/255]});break}case`CIMFixedColorRamp`:{let n=e,r=1/(n.colors.length-1),i=0;for(let e of n.colors)t.push({offset:i,color:[e[0],e[1],e[2],e[3]/255]}),i+=r;break}case`CIMMultipartColorRamp`:{let n=e,r=n.weights.reduce((e,t)=>e+t,0),i=0;for(let e=0;e<n.colorRamps.length;e++){let a=n.colorRamps[e],o=n.weights[e],s=x(a);for(let e of s)t.push({offset:(i+e.offset*o)/r,color:e.color});i+=o}break}default:l().error(`Color ramp "${e.type}" currently unsupported.`)}return t}function S(e,t){let n=[],r=(e.length-1)/(t-1);for(let i=0;i<t;i++){let a=e[Math.round(i*r)].color;n.push({offset:i/t,color:a}),n.push({offset:(i+1)/t,color:a})}return n}function C(e,t){return E(e,t,32,1,i),D(e)}function w(e,t,n){return E(e,t,n,1,i),D(e)}function T(e,t,n=0){for(let{offset:r,color:i}of t)e.addColorStop(Math.min(Math.max(r,n),1-n),`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]})`)}function E(e,t,n,r,i){let a=n+2*i;e.width=a,e.height=r;let o=(i+1)/a,s=e.getContext(`2d`,{willReadFrequently:!0});if(t.length>0){let e=s.createLinearGradient(0,0,a,r);T(e,t,o),s.fillStyle=e}else s.fillStyle=`rgba(128, 128, 128, 1)`;s.fillRect(0,0,a,r)}function D(e){let{width:t,height:n}=e,r=e.getContext(`2d`).getImageData(0,0,t,n),i=new Uint8Array(r.data);for(let e=0;e<i.length;e+=4){let t=i[e+3]/255;i[e]*=t,i[e+1]*=t,i[e+2]*=t}return[i,t,n]}function O(e){let t=e[0]?.[0]?.[0]??0,n=e[0]?.[0]?.[1]??0,r={ymin:n,xmin:t,ymax:n,xmax:t,width:0,height:0};for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.length;e++){let t=n[e][0],i=n[e][1];t<r.xmin&&(r.xmin=t),t>r.xmax&&(r.xmax=t),i<r.ymin&&(r.ymin=i),i>r.ymax&&(r.ymax=i)}}return r.width=Math.abs(r.xmax-r.xmin),r.height=Math.abs(r.ymax-r.ymin),r}function k(e,t){let n=O(e),r=n.width===0?1:n.width,i=n.height===0?1:n.height,a=[];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let a=Math.round(s[e][0]-n.xmin),o=Math.round(s[e][1]-n.ymin);if(a=t.xmin+a*t.width/r,o=t.ymin+o*t.height/i,isNaN(a)||isNaN(o))throw Error(`Scaled shape has NaN values`);c.push([a,o])}a.push(c)}return a}function A(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=e[i],o=[];for(let e=0;e<a.length;e++){let r=a[e][0]+t,i=a[e][1]+n;if(isNaN(r)||isNaN(i))throw Error(`Scaled shape has NaN values`);o.push([r,i])}r.push(o)}return r}export{b as addColorStops,m as applyAlphaMask,p as createAlphaMaskRings,d as createHaloImage,f as createHaloSDF,_ as rasterizeDash,g as rasterizeDash1D,h as rasterizeFillStyle,v as rasterizeGradient,k as scale,A as translate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{set as i,subtract as a,copy as o}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{watch as c,sync as l}from"../../core/reactiveUtils.js";import{addPadding as u}from"./viewpointUtils.js";import d from"./ViewState.js";var f,p;let m=f=class extends t{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new f({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};e([n()],m.prototype,`left`,void 0),e([n()],m.prototype,`top`,void 0),e([n()],m.prototype,`right`,void 0),e([n()],m.prototype,`bottom`,void 0),m=f=e([r(`esri.views.2d.PaddedViewState.Padding`)],m);let h=p=class extends d{constructor(e){super(e),this.paddedViewState=new d,this._updateContent=(()=>{let e=s();return()=>{let t=this._get(`size`),n=this._get(`padding`);if(!t||!n)return;let r=this.paddedViewState;i(e,n.left+n.right,n.top+n.bottom),a(e,t,e),o(r.size,e);let s=r.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(c(()=>[this.size,this.padding],()=>this._updateContent(),l)),this.padding=new m,this.size=[0,0]}get padding(){return this._get(`padding`)}set padding(e){this._set(`padding`,e||new m)}set viewpoint(e){if(e){this.paddedViewState.viewpoint=e;let t=e,n=this._get(`padding`);n&&(t=u(e.clone(),e,this._get(`size`),n));let{targetGeometry:r,rotation:i,scale:a}=t,{x:o,y:s,spatialReference:c}=r,l=this._viewpoint2D;l.center[0]=o,l.center[1]=s,l.rotation=i,l.scale=a,l.spatialReference=c,this._update()}}clone(){return new p({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};e([n()],h.prototype,`paddedViewState`,void 0),e([n({type:m})],h.prototype,`padding`,null),e([n()],h.prototype,`viewpoint`,null),h=p=e([r(`esri.views.2d.PaddedViewState`)],h);const g=h;export{g as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{set as i,subtract as a,copy as o}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{watch as c,sync as l}from"../../core/reactiveUtils.js";import{addPadding as u}from"./viewpointUtils.js";import d from"./ViewState.js";var f,p;let m=f=class extends t{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new f({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};e([n()],m.prototype,`left`,void 0),e([n()],m.prototype,`top`,void 0),e([n()],m.prototype,`right`,void 0),e([n()],m.prototype,`bottom`,void 0),m=f=e([r(`esri.views.2d.PaddedViewState.Padding`)],m);let h=p=class extends d{constructor(e){super(e),this.paddedViewState=new d,this.isGlobal=!1,this._updateContent=(()=>{let e=s();return()=>{let t=this._get(`size`),n=this._get(`padding`);if(!t||!n)return;let r=this.paddedViewState;i(e,n.left+n.right,n.top+n.bottom),a(e,t,e),o(r.size,e);let s=r.viewpoint;s&&(this.viewpoint=s)}})(),this.addHandles(c(()=>[this.size,this.padding],()=>this._updateContent(),l)),this.padding=new m,this.size=[0,0]}get padding(){return this._get(`padding`)}set padding(e){this._set(`padding`,e||new m)}set viewpoint(e){if(e){this.paddedViewState.viewpoint=e;let t=e,n=this._get(`padding`);n&&(t=u(e.clone(),e,this._get(`size`),n));let{targetGeometry:r,rotation:i,scale:a}=t,{x:o,y:s,spatialReference:c}=r,l=this._viewpoint2D;l.center[0]=o,l.center[1]=s,l.rotation=i,l.scale=a,l.spatialReference=c,this._update()}}clone(){return new p({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};e([n()],h.prototype,`paddedViewState`,void 0),e([n({type:m})],h.prototype,`padding`,null),e([n()],h.prototype,`viewpoint`,null),h=p=e([r(`esri.views.2d.PaddedViewState`)],h);const g=h;export{g as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../../core/ArrayPool.js";import{e as t}from"../../../../../chunks/earcut.js";import{triangulateF32 as n}from"../../../../../geometry/libtess.js";import{Point as r}from"../../../../../geometry/support/TileClipper.js";import i from"./BaseBucket.js";class a extends i{constructor(e,t,n,r,i,a,o){super(e,t,n),this.type=1,this._patternMap=new Map,this._fillVertexBuffer=r,this._fillIndexBuffer=i,this._outlineVertexBuffer=a,this._outlineIndexBuffer=o}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,t,n){let r=this.layer,i=this.zoom,a=r.getPaintProperty(`fill-pattern`);if(a){if(!a.isDataDriven)t(a.getValue(i),!0);else for(let e of this._features)t(a.getValue(i,e),!0)}}processFeatures(e){this._fillIndexStart=this._fillIndexBuffer.index*3,this._fillIndexCount=0,this._outlineIndexStart=this._outlineIndexBuffer.index*3,this._outlineIndexCount=0;let t=this.layer,n=this.zoom,{fillMaterial:r,outlineMaterial:i,hasDataDrivenFill:a,hasDataDrivenOutline:o}=t;e&&e.setExtent(this.layerExtent);let s=t.getPaintProperty(`fill-pattern`),c=s?.isDataDriven,l=!s&&t.getPaintValue(`fill-antialias`,n);if(t.outlineUsesFillColor){if(l&&!t.hasDataDrivenOpacity){let e=t.getPaintValue(`fill-opacity`,n),r=t.getPaintValue(`fill-opacity`,n+1);e<1&&r<1&&(l=!1)}if(l&&!t.hasDataDrivenColor){let e=t.getPaintValue(`fill-color`,n),r=t.getPaintValue(`fill-color`,n+1);e[3]<1&&r[3]<1&&(l=!1)}}let u=this._features,d=e?.validateTessellation;if(c){let a=[];for(let c of u){let u=s.getValue(n,c),d=this._spriteInfo[u];if(!d?.rect)continue;let f=r.encodeAttributes(c,n,t,d),p=l&&o?i.encodeAttributes(c,n,t):[],m=c.getGeometry(e);a.push({ddFillAttributes:f,ddOutlineAttributes:p,page:d.page,geometry:m}),a.sort((e,t)=>e.page-t.page)}for(let{ddFillAttributes:e,ddOutlineAttributes:n,page:r,geometry:i}of a)this._processFeature(i,l,t.outlineUsesFillColor,e,n,d,r)}else for(let s of u){let c=a?r.encodeAttributes(s,n,t):null,u=l&&o?i.encodeAttributes(s,n,t):null,f=s.getGeometry(e);this._processFeature(f,l,t.outlineUsesFillColor,c,u,d)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=this._patternMap.size*3+1;let t=new Uint32Array(e),n=new Int32Array(t.buffer),r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[r++]=this.layerUIDs[e];t[r++]=this._fillIndexStart,t[r++]=this._fillIndexCount,t[r++]=this._outlineIndexStart,t[r++]=this._outlineIndexCount;let i=this._patternMap,a=i.size;if(t[r++]=a,a>0)for(let[e,[n,a]]of i)t[r++]=e,t[r++]=n,t[r++]=a;t[r++]=this._fillVertexBuffer.array.length;for(let e=0;e<this._fillVertexBuffer.array.length;e++)n[r++]=this._fillVertexBuffer.array[e];t[r++]=this._fillIndexBuffer.array.length;for(let e=0;e<this._fillIndexBuffer.array.length;e++)t[r++]=this._fillIndexBuffer.array[e];t[r++]=this._outlineVertexBuffer.array.length;for(let e=0;e<this._outlineVertexBuffer.array.length;e++)n[r++]=this._outlineVertexBuffer.array[e];t[r++]=this._outlineIndexBuffer.array.length;for(let e=0;e<this._outlineIndexBuffer.array.length;e++)t[r++]=this._outlineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,n,r,i,o,s){if(!e)return;let c=e.length,l=!i||i.length===0;if(t&&(!n||l))for(let t=0;t<c;t++)this._processOutline(e[t],i);let u;for(let t=0;t<c;t++){let n=a._area(e[t]);n>32?(u!==void 0&&this._processFill(e,u,r,o,s),u=[t]):n<-32&&u!==void 0&&u.push(t)}u!==void 0&&this._processFill(e,u,r,o,s)}_processOutline(e,t){let n=this._outlineVertexBuffer,i=this._outlineIndexBuffer,a=i.index,o,s,c,l=new r(0,0),u=new r(0,0),d=new r(0,0),f=-1,p=-1,m=-1,h=-1,g=-1,_=!1,v=e.length;if(v<2)return;let y=e[0],b=e[v-1];for(;v&&b.isEqual(y);)--v,b=e[v-1];if(!(v-0<2)){for(let r=0;r<v;++r){r===0?(o=e[v-1],s=e[0],c=e[1],l.assignSub(s,o),l.normalize(),l.rightPerpendicular()):(o=s,s=c,c=r===v-1?e[0]:e[r+1],l.assign(u));let a=this._isClipEdge(o,s);h===-1&&(_=a),u.assignSub(c,s),u.normalize(),u.rightPerpendicular();let y=l.x*u.y-l.y*u.x;d.assignAdd(l,u),d.normalize();let b=-d.x*-l.x+-d.y*-l.y,x=Math.abs(b===0?1:1/b);x>8&&(x=8),y>=0?(m=n.add(s.x,s.y,l.x,l.y,0,1,t),h===-1&&(h=m),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,x*-d.x,x*-d.y,0,-1,t),g===-1&&(g=p),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=p,p=m,m=n.add(s.x,s.y,d.x,d.y,0,1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,u.x,u.y,0,1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m)):(m=n.add(s.x,s.y,x*d.x,x*d.y,0,1,t),h===-1&&(h=m),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,-l.x,-l.y,0,-1,t),g===-1&&(g=p),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=p,p=m,m=n.add(s.x,s.y,-d.x,-d.y,0,-1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=n.add(s.x,s.y,-u.x,-u.y,0,-1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m))}f>=0&&p>=0&&h>=0&&!_&&i.add(f,p,h),f>=0&&h>=0&&g>=0&&!_&&i.add(f,g,h),this._outlineIndexCount+=3*(i.index-a)}}_processFill(r,i,a,o,s){o=!0;let c=i.length,l;c>1&&(l=[]);let u=0;for(let e of i)u!==0&&l.push(u),u+=r[e].length;let d=u*2,f=e.acquire();for(let e of i){let t=r[e],n=t.length;for(let e=0;e<n;++e)f.push(t[e].x,t[e].y)}let p=t(f,l,2);if(o&&t.deviation(f,l,2,p)>0){let e=i.map(e=>r[e].length),{buffer:t,vertexCount:o}=n(f,e);if(o>0){let e=this._fillVertexBuffer.index;for(let e=0;e<o;e++)this._fillVertexBuffer.add(t[2*e],t[2*e+1],a);for(let t=0;t<o;t+=3){let n=e+t;this._fillIndexBuffer.add(n,n+1,n+2)}if(s!==void 0){let e=this._patternMap,t=e.get(s);t?t[1]+=o:e.set(s,[this._fillIndexStart+this._fillIndexCount,o])}this._fillIndexCount+=o}}else{let e=p.length;if(e>0){let t=this._fillVertexBuffer.index,n=0;for(;n<d;)this._fillVertexBuffer.add(f[n++],f[n++],a);let r=0;for(;r<e;)this._fillIndexBuffer.add(t+p[r++],t+p[r++],t+p[r++]);if(s!==void 0){let t=this._patternMap,n=t.get(s);n?n[1]+=e:t.set(s,[this._fillIndexStart+this._fillIndexCount,e])}this._fillIndexCount+=e}}e.release(f)}_isClipEdge(e,t){return e.x===t.x?e.x<=-64||e.x>=4160:e.y===t.y?e.y<=-64||e.y>=4160:!1}static _area(e){let t=0,n=e.length-1;for(let r=0;r<n;r++)t+=(e[r].x-e[r+1].x)*(e[r].y+e[r+1].y);return t+=(e[n].x-e[0].x)*(e[n].y+e[0].y),t*.5}}export{a as default};
2
+ import e from"../../../../../core/ArrayPool.js";import{e as t}from"../../../../../chunks/earcut.js";import{triangulateF32 as n}from"../../../../../geometry/libtess.js";import{Point as r}from"../../../../../geometry/support/TileClipper.js";import i from"./BaseBucket.js";class a extends i{constructor(e,t,n,r,i,a,o){super(e,t,n),this.type=1,this._patternMap=new Map,this._fillVertexBuffer=r,this._fillIndexBuffer=i,this._outlineVertexBuffer=a,this._outlineIndexBuffer=o}get fillIndexStart(){return this._fillIndexStart}get fillIndexCount(){return this._fillIndexCount}get outlineIndexStart(){return this._outlineIndexStart}get outlineIndexCount(){return this._outlineIndexCount}getResources(e,t,n){let r=this.layer,i=this.zoom,a=r.getPaintProperty(`fill-pattern`);if(a){if(!a.isDataDriven)t(a.getValue(i),!0);else for(let e of this._features)t(a.getValue(i,e),!0)}}processFeatures(e){this._fillIndexStart=this._fillIndexBuffer.index*3,this._fillIndexCount=0,this._outlineIndexStart=this._outlineIndexBuffer.index*3,this._outlineIndexCount=0;let t=this.layer,n=this.zoom,{fillMaterial:r,outlineMaterial:i,hasDataDrivenFill:a,hasDataDrivenOutline:o}=t;e&&e.setExtent(this.layerExtent);let s=t.getPaintProperty(`fill-pattern`),c=s?.isDataDriven,l=!s&&t.getPaintValue(`fill-antialias`,n);if(t.outlineUsesFillColor){if(l&&!t.hasDataDrivenOpacity){let e=t.getPaintValue(`fill-opacity`,n),r=t.getPaintValue(`fill-opacity`,n+1);e<1&&r<1&&(l=!1)}if(l&&!t.hasDataDrivenColor){let e=t.getPaintValue(`fill-color`,n),r=t.getPaintValue(`fill-color`,n+1);e[3]<1&&r[3]<1&&(l=!1)}}let u=this._features,d=e?.validateTessellation;if(c){let a=[];for(let c of u){let u=s.getValue(n,c),d=this._spriteInfo[u];if(!d?.rect)continue;let f=r.encodeAttributes(c,n,t,d),p=l&&o?i.encodeAttributes(c,n,t):[],m=c.getGeometry(e);a.push({ddFillAttributes:f,ddOutlineAttributes:p,page:d.page,geometry:m}),a.sort((e,t)=>e.page-t.page)}for(let{ddFillAttributes:e,ddOutlineAttributes:n,page:r,geometry:i}of a)this._processFeature(i,l,t.outlineUsesFillColor,e,n,d,r)}else for(let s of u){let c=a?r.encodeAttributes(s,n,t):null,u=l&&o?i.encodeAttributes(s,n,t):null,f=s.getGeometry(e);this._processFeature(f,l,t.outlineUsesFillColor,c,u,d)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=this._patternMap.size*3+1;let t=new Uint32Array(e),n=new Int32Array(t.buffer),r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let e=0;e<this.layerUIDs.length;e++)t[r++]=this.layerUIDs[e];t[r++]=this._fillIndexStart,t[r++]=this._fillIndexCount,t[r++]=this._outlineIndexStart,t[r++]=this._outlineIndexCount;let i=this._patternMap,a=i.size;if(t[r++]=a,a>0)for(let[e,[n,a]]of i)t[r++]=e,t[r++]=n,t[r++]=a;t[r++]=this._fillVertexBuffer.array.length;for(let e=0;e<this._fillVertexBuffer.array.length;e++)n[r++]=this._fillVertexBuffer.array[e];t[r++]=this._fillIndexBuffer.array.length;for(let e=0;e<this._fillIndexBuffer.array.length;e++)t[r++]=this._fillIndexBuffer.array[e];t[r++]=this._outlineVertexBuffer.array.length;for(let e=0;e<this._outlineVertexBuffer.array.length;e++)n[r++]=this._outlineVertexBuffer.array[e];t[r++]=this._outlineIndexBuffer.array.length;for(let e=0;e<this._outlineIndexBuffer.array.length;e++)t[r++]=this._outlineIndexBuffer.array[e];return t.buffer}_processFeature(e,t,n,r,i,o,s){if(!e)return;let c=e.length,l=!i||i.length===0;if(t&&(!n||l))for(let t=0;t<c;t++)this._processOutline(e[t],i);let u;for(let t=0;t<c;t++){let n=a._area(e[t]);n>32?(u!==void 0&&this._processFill(e,u,r,o,s),u=[t]):n<-32&&u!==void 0&&u.push(t)}u!==void 0&&this._processFill(e,u,r,o,s)}_processOutline(e,t){let n=this._outlineVertexBuffer,i=this._outlineIndexBuffer,a=i.index,o,s,c,l=new r(0,0),u=new r(0,0),d=new r(0,0),f=-1,p=-1,m=-1,h=-1,g=-1,_=!1,v=e.length;if(v<2)return;let y=e[0],b=e[v-1];for(;v&&b.isEqual(y);)--v,b=e[v-1];if(!(+v<2)){for(let r=0;r<v;++r){r===0?(o=e[v-1],s=e[0],c=e[1],l.assignSub(s,o),l.normalize(),l.rightPerpendicular()):(o=s,s=c,c=r===v-1?e[0]:e[r+1],l.assign(u));let a=this._isClipEdge(o,s);h===-1&&(_=a),u.assignSub(c,s),u.normalize(),u.rightPerpendicular();let y=l.x*u.y-l.y*u.x;d.assignAdd(l,u),d.normalize();let b=-d.x*-l.x+-d.y*-l.y,x=Math.abs(b===0?1:1/b);x>8&&(x=8),y>=0?(m=n.add(s.x,s.y,l.x,l.y,0,1,t),h===-1&&(h=m),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,x*-d.x,x*-d.y,0,-1,t),g===-1&&(g=p),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=p,p=m,m=n.add(s.x,s.y,d.x,d.y,0,1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,u.x,u.y,0,1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m)):(m=n.add(s.x,s.y,x*d.x,x*d.y,0,1,t),h===-1&&(h=m),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),p=n.add(s.x,s.y,-l.x,-l.y,0,-1,t),g===-1&&(g=p),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=p,p=m,m=n.add(s.x,s.y,-d.x,-d.y,0,-1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m),f=n.add(s.x,s.y,-u.x,-u.y,0,-1,t),f>=0&&p>=0&&m>=0&&!a&&i.add(f,p,m))}f>=0&&p>=0&&h>=0&&!_&&i.add(f,p,h),f>=0&&h>=0&&g>=0&&!_&&i.add(f,g,h),this._outlineIndexCount+=3*(i.index-a)}}_processFill(r,i,a,o,s){o=!0;let c=i.length,l;c>1&&(l=[]);let u=0;for(let e of i)u!==0&&l.push(u),u+=r[e].length;let d=u*2,f=e.acquire();for(let e of i){let t=r[e],n=t.length;for(let e=0;e<n;++e)f.push(t[e].x,t[e].y)}let p=t(f,l,2);if(o&&t.deviation(f,l,2,p)>0){let e=i.map(e=>r[e].length),{buffer:t,vertexCount:o}=n(f,e);if(o>0){let e=this._fillVertexBuffer.index;for(let e=0;e<o;e++)this._fillVertexBuffer.add(t[2*e],t[2*e+1],a);for(let t=0;t<o;t+=3){let n=e+t;this._fillIndexBuffer.add(n,n+1,n+2)}if(s!==void 0){let e=this._patternMap,t=e.get(s);t?t[1]+=o:e.set(s,[this._fillIndexStart+this._fillIndexCount,o])}this._fillIndexCount+=o}}else{let e=p.length;if(e>0){let t=this._fillVertexBuffer.index,n=0;for(;n<d;)this._fillVertexBuffer.add(f[n++],f[n++],a);let r=0;for(;r<e;)this._fillIndexBuffer.add(t+p[r++],t+p[r++],t+p[r++]);if(s!==void 0){let t=this._patternMap,n=t.get(s);n?n[1]+=e:t.set(s,[this._fillIndexStart+this._fillIndexCount,e])}this._fillIndexCount+=e}}e.release(f)}_isClipEdge(e,t){return e.x===t.x?e.x<=-64||e.x>=4160:e.y===t.y?e.y<=-64||e.y>=4160:!1}static _area(e){let t=0,n=e.length-1;for(let r=0;r<n;r++)t+=(e[r].x-e[r+1].x)*(e[r].y+e[r+1].y);return t+=(e[n].x-e[0].x)*(e[n].y+e[0].y),t*.5}}export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- const e=512,t=4096,n=8,r=512/4096;export{r as tileCoordinateScale,n as tilePixelRatio,e as tileSizeInPixels,t as tileSizeInTileUnits};
2
+ const e=512,t=4096,n=8,r=.125;export{r as tileCoordinateScale,n as tilePixelRatio,e as tileSizeInPixels,t as tileSizeInTileUnits};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{getScaleForResolution as e}from"../../../../../geometry/support/scaleUtils.js";import{equals as t,getInfo as n}from"../../../../../geometry/support/spatialReferenceUtils.js";import{project as r}from"../../../../../geometry/support/webMercatorUtils.js";import i from"../../../../../layers/support/TileInfo.js";import a from"../../../tiling/TileInfoViewPOT.js";function o(t,r=22){let a=n(t),o=t.isWGS84?360/512:78271.51696400007,s=t.isWGS84?e(o,t):295828763.7957775;return i.fromJSON({rows:512,cols:512,dpi:96,format:`pbf`,origin:{x:a.origin[0],y:a.origin[1]},spatialReference:t.toJSON(),lods:Array.from({length:r+1},(e,t)=>({level:t,resolution:o/2**t,scale:s/2**t}))})}function s(e,n){return t(e.tileInfo?.spatialReference,n)||l(e)&&(n.isWGS84||n.isWebMercator)}function c(e,n){let i=l(e)&&s(e,n)?o(n,e.tileInfo.lods.length-1):e.tileInfo,c=t(e.spatialReference,i.spatialReference)?e.fullExtent:r(e.fullExtent,i.spatialReference);return c&&i.spatialReference.isWebMercator&&e.spatialReference.isWGS84&&(c.ymin=Math.max(c.ymin,-i.origin.y),c.ymax=Math.min(c.ymax,i.origin.y)),new a(i,c)}function l(e){let t=Object.values(e.sourceNameToSource);return t.length>0&&t.every(e=>e.type===`geojson`)}export{o as createTileInfo,c as createTileInfoView,s as supportsSpatialReference};
2
+ import{getScaleForResolution as e}from"../../../../../geometry/support/scaleUtils.js";import{equals as t,getInfo as n}from"../../../../../geometry/support/spatialReferenceUtils.js";import{project as r}from"../../../../../geometry/support/webMercatorUtils.js";import i from"../../../../../layers/support/TileInfo.js";import a from"../../../tiling/TileInfoViewPOT.js";function o(t,r=22){let a=n(t),o=t.isWGS84?.703125:78271.51696400007,s=t.isWGS84?e(o,t):295828763.7957775;return i.fromJSON({rows:512,cols:512,dpi:96,format:`pbf`,origin:{x:a.origin[0],y:a.origin[1]},spatialReference:t.toJSON(),lods:Array.from({length:r+1},(e,t)=>({level:t,resolution:o/2**t,scale:s/2**t}))})}function s(e,n){return t(e.tileInfo?.spatialReference,n)||l(e)&&(n.isWGS84||n.isWebMercator)}function c(e,n){let i=l(e)&&s(e,n)?o(n,e.tileInfo.lods.length-1):e.tileInfo,c=t(e.spatialReference,i.spatialReference)?e.fullExtent:r(e.fullExtent,i.spatialReference);return c&&i.spatialReference.isWebMercator&&e.spatialReference.isWGS84&&(c.ymin=Math.max(c.ymin,-i.origin.y),c.ymax=Math.min(c.ymax,i.origin.y)),new a(i,c)}function l(e){let t=Object.values(e.sourceNameToSource);return t.length>0&&t.every(e=>e.type===`geojson`)}export{o as createTileInfo,c as createTileInfoView,s as supportsSpatialReference};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{HighlightTechnique as e}from"../shaderGraph/techniques/utility/HighlightTechnique.js";import{Effect as t}from"./Effect.js";import n from"./highlight/HighlightSurfaces.js";class r extends t{constructor(){super(...arguments),this.defines=[`highlight`],this._hlTechnique=new e,this._width=void 0,this._height=void 0,this._hlSurfaces=new n,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._highlightWidth=void 0,this._highlightHeight=void 0}dispose(){this._hlSurfaces?.dispose(),this._hlTechnique.shutdown(),this._boundFBO=null}bind(e){let{context:t,painter:n}=e,{width:r,height:i}=t.getViewport(),a=n.getFbos().effect0;this.setup(e,r,i),t.bindFramebuffer(a),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(16384)}unbind(){}setup({context:e},t,n){this._width=t,this._height=n;let r=t%4,i=n%4;t+=r<2?-r:4-r,n+=i<2?-i:4-i,this._adjustedWidth=t,this._adjustedHeight=n,this._boundFBO=e.boundFramebuffer;let a=Math.round(t*1),o=Math.round(n*1);this._highlightWidth=a,this._highlightHeight=o,this._hlSurfaces.setup(e,a,o)}draw(e){let{context:t,passOptions:n}=e,r=n.activeGradient,i=t.boundFramebuffer,a=[0,0,this._adjustedWidth*1,this._adjustedHeight*1];if(i?.colorTexture==null)throw Error(`InternalError: Highlight source framebuffer is missing a color texture`);t.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),t.setViewport(...a),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(16384),this._hlTechnique.render(e,{sourceTexture:i.colorTexture,maskFbo:this._hlSurfaces.sharedBlur1Fbo,maskTexture:this._hlSurfaces.sharedBlur1Tex,partialMapFbo:this._hlSurfaces.sharedBlur2Fbo,partialMapTexture:this._hlSurfaces.sharedBlur2Tex,highlightWidth:this._highlightWidth,highlightHeight:this._highlightHeight,highlightViewport:a,outputTarget:this._boundFBO,outputViewport:[0,0,this._width,this._height],gradient:r}),this._boundFBO=null}}export{r as default};
2
+ import{HighlightTechnique as e}from"../shaderGraph/techniques/utility/HighlightTechnique.js";import{Effect as t}from"./Effect.js";import n from"./highlight/HighlightSurfaces.js";class r extends t{constructor(){super(...arguments),this.defines=[`highlight`],this._hlTechnique=new e,this._width=void 0,this._height=void 0,this._hlSurfaces=new n,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._highlightWidth=void 0,this._highlightHeight=void 0}dispose(){this._hlSurfaces?.dispose(),this._hlTechnique.shutdown(),this._boundFBO=null}bind(e){let{context:t,painter:n}=e,{width:r,height:i}=t.getViewport(),a=n.getFbos().effect0;this.setup(e,r,i),t.bindFramebuffer(a),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(16384)}unbind(){}setup({context:e},t,n){this._width=t,this._height=n;let r=t%4,i=n%4;t+=r<2?-r:4-r,n+=i<2?-i:4-i,this._adjustedWidth=t,this._adjustedHeight=n,this._boundFBO=e.boundFramebuffer;let a=Math.round(+t),o=Math.round(+n);this._highlightWidth=a,this._highlightHeight=o,this._hlSurfaces.setup(e,a,o)}draw(e){let{context:t,passOptions:n}=e,r=n.activeGradient,i=t.boundFramebuffer,a=[0,0,+this._adjustedWidth,+this._adjustedHeight];if(i?.colorTexture==null)throw Error(`InternalError: Highlight source framebuffer is missing a color texture`);t.bindFramebuffer(this._hlSurfaces.sharedBlur1Fbo),t.setViewport(...a),t.setColorMask(!0,!0,!0,!0),t.setClearColor(0,0,0,0),t.clear(16384),this._hlTechnique.render(e,{sourceTexture:i.colorTexture,maskFbo:this._hlSurfaces.sharedBlur1Fbo,maskTexture:this._hlSurfaces.sharedBlur1Tex,partialMapFbo:this._hlSurfaces.sharedBlur2Fbo,partialMapTexture:this._hlSurfaces.sharedBlur2Tex,highlightWidth:this._highlightWidth,highlightHeight:this._highlightHeight,highlightViewport:a,outputTarget:this._boundFBO,outputViewport:[0,0,this._width,this._height],gradient:r}),this._boundFBO=null}}export{r as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- function e(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function t(e,t){return Math.sqrt(e*e+t*t)}function n(e){let n=t(e[0],e[1]);e[0]/=n,e[1]/=n}function r(e,n){let r=e[0],i=n[0],a=e[1],o=n[1];return t(r-i,a-o)}function i(e,t,n){let r=t,i=n,a=1/0;for(let o of e)for(let e=0;e<o.length;e++){let s=o[e],c=o[e+1];if(!c){let e=t-s[0],o=n-s[1],c=e*e+o*o;c<a&&(r=s[0],i=s[1],a=c);continue}let l=c[0]-s[0],u=c[1]-s[1],d=l*l+u*u,f=d===0?0:Math.max(0,Math.min(1,((t-s[0])*l+(n-s[1])*u)/d)),p=s[0]+f*l,m=s[1]+f*u,h=t-p,g=n-m,_=h*h+g*g;_<a&&(r=p,i=m,a=_)}return[r,i]}function a(e,t){return e[t+1]}function o(e){return e.length-1}function s(e){let t=0;for(let n=0;n<o(e);n++)t+=c(e,n);return t}function c(e,t,n=1){let[r,i]=a(e,t);return[r,i]=[Math.round(r),Math.round(i)],Math.sqrt(r*r+i*i)*n}class l{constructor(e,t,n,r,i){this._segments=e,this._index=t,this._distance=n,this._xStart=r,this._yStart=i,this._done=!1}static create(e){return new l(e,0,0,e[0][0],e[0][1])}clone(){return new l(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._index<e._index||this._index===e._index&&this._distance<=e._distance}geq(e){return this._index>e._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){let e=this.dy,t=-this.dx,n=(0*e+-1*t)/(1*this.length),r=Math.acos(n);return e>0&&(r=2*Math.PI-r),r}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){let{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<o(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(--this._index,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){let n=this.backwardLength;if(e<=n)return this._distance=(n-e)/this.length,this;let r=this.backwardLength;for(;this.prev();){if(r+this.length>e)return this._seekBackwards(e-r);r+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let n=this.remainingLength;for(;this.next();){if(n+this.length>e)return this.seek(e-n,t);n+=this.length}return this._distance=1,t?this:null}}function u(e,t,n,r=!0){let i=s(e);if(i===0)return;let a=l.create(e),o=i/2;if(!r){a.seek(o),n(a.clone(),0,o+0*t,i);return}let c=Math.max((i-t)/2,0),u=Math.floor(c/t),d=o-u*t;a.seek(d);for(let e=-u;e<=u;e++)n(a.clone(),e,o+e*t,i),a.seek(t)}function d(e,t){let n=t;for(let t=0;t<e.length;t++){let r=e[t];f(r,n);let i=[];i.push(r[0]);for(let e=1;e<r.length;e++){let[t,n]=r[e-1],[a,o]=r[e],s=a-t,c=o-n;i.push([s,c])}e[t]=i,r=i}return e}function f(t,i){let a=1e-6;if(i<=0)return;let o=t.length;if(o<3)return;let s=[],c=0;s.push(0);for(let e=1;e<o;e++)c+=r(t[e],t[e-1]),s.push(c);i=Math.min(i,.2*c);let l=[];l.push(t[0][0]),l.push(t[0][1]);let u=t[o-1][0],d=t[o-1][1],f=e([0,0],t[0],t[1]);n(f),t[0][0]+=i*f[0],t[0][1]+=i*f[1],e(f,t[o-1],t[o-2]),n(f),t[o-1][0]+=i*f[0],t[o-1][1]+=i*f[1];for(let e=1;e<o;e++)s[e]+=i;s[o-1]+=i;let p=.5*i;for(let e=1;e<o-1;e++){let n=0,r=0,c=0;for(let o=e-1;o>=0&&!(s[o+1]<s[e]-p);o--){let l=p+s[o+1]-s[e],u=s[o+1]-s[o],d=s[e]-s[o]<p?1:l/u;if(Math.abs(d)<a)break;let f=d*d,m=d*l-.5*f*u,h=d*u/i,g=t[o+1],_=t[o][0]-g[0],v=t[o][1]-g[1];n+=h/m*(g[0]*d*l+.5*f*(l*_-u*g[0])-f*d*u*_/3),r+=h/m*(g[1]*d*l+.5*f*(l*v-u*g[1])-f*d*u*v/3),c+=h}for(let l=e+1;l<o&&!(s[l-1]>s[e]+p);l++){let o=p-s[l-1]+s[e],u=s[l]-s[l-1],d=s[l]-s[e]<p?1:o/u;if(Math.abs(d)<a)break;let f=d*d,m=d*o-.5*f*u,h=d*u/i,g=t[l-1],_=t[l][0]-g[0],v=t[l][1]-g[1];n+=h/m*(g[0]*d*o+.5*f*(o*_-u*g[0])-f*d*u*_/3),r+=h/m*(g[1]*d*o+.5*f*(o*v-u*g[1])-f*d*u*v/3),c+=h}l.push(n/c),l.push(r/c)}l.push(u),l.push(d);for(let e=0,n=0;e<o;e++)t[e][0]=l[n++],t[e][1]=l[n++]}export{l as SegmentCursor,i as closestPointOnPaths,u as pathDivide,s as pathLength,a as segmentAt,o as segmentCount,c as segmentLength,d as smoothPaths};
2
+ function e(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function t(e,t){return Math.sqrt(e*e+t*t)}function n(e){let n=t(e[0],e[1]);e[0]/=n,e[1]/=n}function r(e,n){let r=e[0],i=n[0],a=e[1],o=n[1];return t(r-i,a-o)}function i(e,t,n){let r=t,i=n,a=1/0;for(let o of e)for(let e=0;e<o.length;e++){let s=o[e],c=o[e+1];if(!c){let e=t-s[0],o=n-s[1],c=e*e+o*o;c<a&&(r=s[0],i=s[1],a=c);continue}let l=c[0]-s[0],u=c[1]-s[1],d=l*l+u*u,f=d===0?0:Math.max(0,Math.min(1,((t-s[0])*l+(n-s[1])*u)/d)),p=s[0]+f*l,m=s[1]+f*u,h=t-p,g=n-m,_=h*h+g*g;_<a&&(r=p,i=m,a=_)}return[r,i]}function a(e,t){return e[t+1]}function o(e){return e.length-1}function s(e){let t=0;for(let n=0;n<o(e);n++)t+=c(e,n);return t}function c(e,t,n=1){let[r,i]=a(e,t);return[r,i]=[Math.round(r),Math.round(i)],Math.sqrt(r*r+i*i)*n}class l{constructor(e,t,n,r,i){this._segments=e,this._index=t,this._distance=n,this._xStart=r,this._yStart=i,this._done=!1}static create(e){return new l(e,0,0,e[0][0],e[0][1])}clone(){return new l(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._index<e._index||this._index===e._index&&this._distance<=e._distance}geq(e){return this._index>e._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){let e=this.dy,t=-this.dx,n=(0*e+-1*t)/this.length,r=Math.acos(n);return e>0&&(r=2*Math.PI-r),r}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){let{dx:e,dy:t}=this;return Math.sqrt(e*e+t*t)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<o(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(--this._index,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){let n=this.backwardLength;if(e<=n)return this._distance=(n-e)/this.length,this;let r=this.backwardLength;for(;this.prev();){if(r+this.length>e)return this._seekBackwards(e-r);r+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let n=this.remainingLength;for(;this.next();){if(n+this.length>e)return this.seek(e-n,t);n+=this.length}return this._distance=1,t?this:null}}function u(e,t,n,r=!0){let i=s(e);if(i===0)return;let a=l.create(e),o=i/2;if(!r){a.seek(o),n(a.clone(),0,o+0*t,i);return}let c=Math.max((i-t)/2,0),u=Math.floor(c/t),d=o-u*t;a.seek(d);for(let e=-u;e<=u;e++)n(a.clone(),e,o+e*t,i),a.seek(t)}function d(e,t){let n=t;for(let t=0;t<e.length;t++){let r=e[t];f(r,n);let i=[];i.push(r[0]);for(let e=1;e<r.length;e++){let[t,n]=r[e-1],[a,o]=r[e],s=a-t,c=o-n;i.push([s,c])}e[t]=i,r=i}return e}function f(t,i){let a=1e-6;if(i<=0)return;let o=t.length;if(o<3)return;let s=[],c=0;s.push(0);for(let e=1;e<o;e++)c+=r(t[e],t[e-1]),s.push(c);i=Math.min(i,.2*c);let l=[];l.push(t[0][0]),l.push(t[0][1]);let u=t[o-1][0],d=t[o-1][1],f=e([0,0],t[0],t[1]);n(f),t[0][0]+=i*f[0],t[0][1]+=i*f[1],e(f,t[o-1],t[o-2]),n(f),t[o-1][0]+=i*f[0],t[o-1][1]+=i*f[1];for(let e=1;e<o;e++)s[e]+=i;s[o-1]+=i;let p=.5*i;for(let e=1;e<o-1;e++){let n=0,r=0,c=0;for(let o=e-1;o>=0&&!(s[o+1]<s[e]-p);o--){let l=p+s[o+1]-s[e],u=s[o+1]-s[o],d=s[e]-s[o]<p?1:l/u;if(Math.abs(d)<a)break;let f=d*d,m=d*l-.5*f*u,h=d*u/i,g=t[o+1],_=t[o][0]-g[0],v=t[o][1]-g[1];n+=h/m*(g[0]*d*l+.5*f*(l*_-u*g[0])-f*d*u*_/3),r+=h/m*(g[1]*d*l+.5*f*(l*v-u*g[1])-f*d*u*v/3),c+=h}for(let l=e+1;l<o&&!(s[l-1]>s[e]+p);l++){let o=p-s[l-1]+s[e],u=s[l]-s[l-1],d=s[l]-s[e]<p?1:o/u;if(Math.abs(d)<a)break;let f=d*d,m=d*o-.5*f*u,h=d*u/i,g=t[l-1],_=t[l][0]-g[0],v=t[l][1]-g[1];n+=h/m*(g[0]*d*o+.5*f*(o*_-u*g[0])-f*d*u*_/3),r+=h/m*(g[1]*d*o+.5*f*(o*v-u*g[1])-f*d*u*v/3),c+=h}l.push(n/c),l.push(r/c)}l.push(u),l.push(d);for(let e=0,n=0;e<o;e++)t[e][0]=l[n++],t[e][1]=l[n++]}export{l as SegmentCursor,i as closestPointOnPaths,u as pathDivide,s as pathLength,a as segmentAt,o as segmentCount,c as segmentLength,d as smoothPaths};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{fromRotation as e,multiply as t,translate as n,rotate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a,set as o}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{pt2px as c}from"../../../../../../core/screenUtils.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import d from"../../collisions/BoundingBox.js";import{magicLabelLineHeight as f}from"../../definitions.js";import p from"../../Rect.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureKey:a.textureKey,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=i(),this._transform=i(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureKey=e.textureKey,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(t){this._angle=t,e(this._rotationT,-t),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:n,y:r,width:o,height:s}=this,c=e(i(),-this.angle),l=t(i(),c,this._transform);this._offsets={topLeft:a([0,0],[n,r],l),topRight:a([0,0],[n+o,r],l),bottomLeft:a([0,0],[n,r+s],l),bottomRight:a([0,0],[n+o,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new d(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new p(0,0,11,8),sdf:!0,page:0,textureKey:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(e){return e===`underline`?c(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>a(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(n){if(n===0&&this._rotation===0)return;this._rotation=n;let r=this._transform,a=e(i(),n);t(r,a,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureKey;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,f=[r-8,i-8],p=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[f[0]-t,f[1]-t],[p[0]+t,p[1]-t],[f[0]+n,f[1]+n],[p[0]-n,p[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[f[0]-t,f[1]-t],[f[0]+n,f[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[p[0]-n,p[1]+n],[p[0]+t,p[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([f,p,m,h],e),top:g,bot:_,left:v,right:b};return[new d(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=o(s(),e.x,e.y);if(a(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new d(t[0],t[1],n,n)}return new d(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new d(s,c,a,o)}_createGlyphTransform(e,t){let a=m*t.angle,c=i(),l=s();return n(c,c,o(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?r(c,c,a):(n(c,c,o(l,e.x,e.y)),r(c,c,a),n(c,c,o(l,-e.x,-e.y))),c}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.endsParagraph=!1,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t)){if(s!==0){let t=new x(e,u,s-1,c,p===1/0?0:p,m);t.endsParagraph=!0,r.push(t),p=1/0,m=0}c=0,u=s+1,d=s+1,l=0}else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2),D=0,O=0;for(let e=0;e<d.length;e++){if(s&&e===O)for(D=e,O=e+1;O<d.length&&!d[O-1].endsParagraph;)O++;let{start:a,end:l,width:u}=d[e],m=c&&e<d.length-1?E(o,a,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(s?D+O-1-e:e)*t.lineHeight+x-i;d[e].startX=v,d[e].startY=y;for(let e=a;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>!S(e.code)&&e.mosaicItem.textureKey).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureKey:i.mosaicItem.textureKey,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureKey=p.textureKey??i.mosaicItem.textureKey),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>!S(e.glyph.code)&&e.glyph.mosaicItem.textureKey).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(e,t){let n=t.lineHeightRatio??1,r=[];for(let t of e.runs){let e=c(t.fontSize),i=e/t.glyphs.sdfSize,a=f/24*e*n,o=(t.glyphs.faceInfo?.baseline??22)*i,s=(t.glyphs.faceInfo?.midline??16)*i,l=4*i+_(t.decoration),u=1+(t.characterSpacing??0);for(let n of t.glyphs.glyphs){let c=n.shaping.xAdvance*i,d=Math.abs(n.rect.top)*i,f=d+n.rect.height*i;r.push({glyph:n,scale:i,fontSize:e,decoration:t.decoration,underlineOffset:l,color:t.color,xAdvance:!S(n.code)&&!C(n.code)?c*u:c,top:d,bottom:f,lineHeight:a,baseline:o,midline:s})}}return r}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),S(n.glyph.code)||C(n.glyph.code)||(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin;return{x:0,y:n,height:L(e[e.length-1])-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureKey),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
2
+ import{fromRotation as e,multiply as t,translate as n,rotate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a,set as o}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as s}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{pt2px as c}from"../../../../../../core/screenUtils.js";import{getXAnchorDirection as l,getYAnchorDirection as u}from"../../alignmentUtils.js";import d from"../../collisions/BoundingBox.js";import{magicLabelLineHeight as f}from"../../definitions.js";import p from"../../Rect.js";const m=Math.PI/180;class h{static fromGlyph(e,t,n,r,i){let{mosaicItem:a,rect:o,shaping:s,code:c}=n,l=a.rect;return new h({width:c===0?o.width:l.width*r,height:c===0?o.height:l.height*r,x:r*(e+s.xOffset+o.left),y:r*(t+s.yOffset-o.top),textureKey:a.textureKey,texcoords:{topLeft:[l.x,l.y],topRight:[l.x+l.width,l.y],bottomLeft:[l.x,l.y+l.height],bottomRight:[l.x+l.width,l.y+l.height]},fontSize:i?.fontSize,color:i?.color})}constructor(e){this._rotationT=i(),this._transform=i(),this._angle=0,this._bounds=null,this.width=e.width,this.height=e.height,this.x=e.x,this.y=e.y,this.textureKey=e.textureKey,this.texcoords=e.texcoords,this.fontSize=e.fontSize,this.color=e.color}set angle(t){this._angle=t,e(this._rotationT,-t),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){let{x:n,y:r,width:o,height:s}=this,c=e(i(),-this.angle),l=t(i(),c,this._transform);this._offsets={topLeft:a([0,0],[n,r],l),topRight:a([0,0],[n+o,r],l),bottomLeft:a([0,0],[n,r+s],l),bottomRight:a([0,0],[n+o,r+s],l)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){let e=this.offsets,t=1/0,n=1/0,r=-1/0,i=-1/0;for(let[a,o]of[e.topLeft,e.topRight,e.bottomLeft,e.bottomRight])t=Math.min(t,a),n=Math.min(n,o),r=Math.max(r,a),i=Math.max(i,o);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;this._bounds=new d(s,c,a,o)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}}const g=(e,t)=>({code:0,mosaicItem:{rect:new p(0,0,11,8),sdf:!0,page:0,textureKey:t},rect:{height:4,width:e,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function _(e){return e===`underline`?c(2):0}function v(e,t,n,r,i){switch(e){case`underline`:return(n??i?.baseline??22)+4+_(e)/t;case`line-through`:return r??i?.midline??16;default:return 0}}function y(e,t){return e.forEach(e=>a(e,e,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}class b{constructor(e,t,n,r){this._rotation=0,this._decorate(e,t,n,r),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=n.angle!==0,this._transform=this._createGlyphTransform(this.bounds,n),this._borderLineSizePx=n.borderLineSizePx,(n.borderLineSizePx||n.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(let t of e)t.setTransform(this._transform)}setRotation(n){if(n===0&&this._rotation===0)return;this._rotation=n;let r=this._transform,a=e(i(),n);t(r,a,r);for(let e of this.glyphs)e.setTransform(this._transform)}_decorate(e,t,n,r){if(!n.decoration||n.decoration===`none`||!e.length)return;let i=n.scale,a=e[0].textureKey;for(let o of t){let t=o.scale??i,s=v(n.decoration,t,o.baseline,o.midline,r),c=o.startX*t,l=o.startY*t,u=(o.width+o.glyphWidthEnd)*t;e.push(h.fromGlyph(c,l+s*t,g(u,a),1))}}shapeBackground(e){let t=(1.5+(this._borderLineSizePx||0))/2,n=this._borderLineSizePx?t:0,{xmin:r,ymin:i,xmax:a,ymax:o,x:s,y:c,width:l,height:u}=this.bounds,f=[r-8,i-8],p=[a+8,i-8],m=[r-8,o+8],h=[a+8,o+8],g=y([[f[0]-t,f[1]-t],[p[0]+t,p[1]-t],[f[0]+n,f[1]+n],[p[0]-n,p[1]+n]],e),_=y([[m[0]+n,m[1]-n],[h[0]-n,h[1]-n],[m[0]-t,m[1]+t],[h[0]+t,h[1]+t]],e),v=y([[f[0]-t,f[1]-t],[f[0]+n,f[1]+n],[m[0]-t,m[1]+t],[m[0]+n,m[1]-n]],e),b=y([[p[0]-n,p[1]+n],[p[0]+t,p[1]-t],[h[0]-n,h[1]-n],[h[0]+t,h[1]+t]],e),x={main:y([f,p,m,h],e),top:g,bot:_,left:v,right:b};return[new d(s,c,l+t*2,u+t*2),x]}get boundsT(){let e=this.bounds,t=o(s(),e.x,e.y);if(a(t,t,this._transform),this._hasRotation){let n=Math.max(e.width,e.height);return new d(t[0],t[1],n,n)}return new d(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,n=1/0,r=0,i=0;for(let a of e)t=Math.min(t,a.offsets.topLeft[0]),n=Math.min(n,a.offsets.topLeft[1]),r=Math.max(r,a.offsets.bottomRight[0]),i=Math.max(i,a.offsets.bottomRight[1]);let a=r-t,o=i-n,s=t+a/2,c=n+o/2;return new d(s,c,a,o)}_createGlyphTransform(e,t){let a=m*t.angle,c=i(),l=s();return n(c,c,o(l,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?r(c,c,a):(n(c,c,o(l,e.x,e.y)),r(c,c,a),n(c,c,o(l,-e.x,-e.y))),c}}class x{constructor(e,t,n,r,i,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.endsParagraph=!1,this.start=Math.max(0,Math.min(t,n)),this.end=Math.max(0,Math.max(t,n)),this.end<e.length&&(this.glyphWidthEnd=e[this.end].rect.width),this.width=r,this.yMin=i,this.yMax=a}}const S=e=>e===10,C=e=>e===32;function w(e,t,n){let r=[],i=1/n.scale,a=n.maxLineWidth*i,o=e.length,s=0,c=0,l=0,u=s,d=u,f=0,p=1/0,m=0;for(;s!==o;){let{code:t,rect:n,shaping:i}=e[s],o=Math.abs(n.top);if(!S(t)&&!C(t)&&(p=Math.min(p,o),m=Math.max(m,o+n.height)),S(t)){if(s!==0){let t=new x(e,u,s-1,c,p===1/0?0:p,m);t.endsParagraph=!0,r.push(t),p=1/0,m=0}c=0,u=s+1,d=s+1,l=0}else if(C(t))d=s+1,l=0,f=i.xAdvance,c+=i.xAdvance;else if(c>a){if(d!==u){let t=d-2;c-=f,r.push(new x(e,u,t,c-l,p,m)),p=1/0,m=0,u=d,c=l}else r.push(new x(e,u,s-1,c,p,m)),p=1/0,m=0,u=s,d=s,c=0;c+=i.xAdvance,l+=i.xAdvance}else c+=i.xAdvance,l+=i.xAdvance;s+=1}let h=new x(e,u,s-1,c,p,m);return h.start>=0&&h.end<e.length&&r.push(h),r}function T(e,t){let n=0;for(let t=0;t<e.length;t++){let{width:r}=e[t];n=Math.max(r,n)}let r=t.decoration===`underline`?4:0,i=e[0].yMin;return{x:0,y:i,height:e[e.length-1].yMax+t.lineHeight*(e.length-1)+r-i,width:n}}function E(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].code)&&!S(e[i+1].code)&&r++;return r}function D(e,t){let n=t.scale,r=[],i=e.sdfPadding,{faceInfo:a,glyphs:o,isRightToLeft:s}=e,c=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,d=w(o,!1,t),f=d.length?T(d,t):{y:0,height:0,width:0},p=c?s?1:-1:l(t.horizontalAlignment),m=u(t.verticalAlignment),g=+(m===2),_=g?0:m-1,v=a?.baseline??22,y=d.length>1,x=g?y?-f.y-f.height:-v:-f.y+_*(f.height/2),D=0,O=0;for(let e=0;e<d.length;e++){if(s&&e===O)for(D=e,O=e+1;O<d.length&&!d[O-1].endsParagraph;)O++;let{start:a,end:l,width:u}=d[e],m=c&&e<d.length-1?E(o,a,l):0,g=m>0?(f.width-u)/m:0,_=g>0?f.width:u,v=(p+1)*-1*(_/2)-i,y=(s?D+O-1-e:e)*t.lineHeight+x-i;d[e].startX=v,d[e].startY=y;for(let e=a;e<=l;e++){let t=o[e];if(S(t.code))continue;let i=h.fromGlyph(v,y,t,n);v+=t.shaping.xAdvance,g>0&&C(t.code)&&(v+=g),r.push(i)}}return new b(r,d,t,a)}function O(e,t){let n=t.scale,{faceInfo:r,glyphs:i}=e,a=i.reduce((e,t)=>Math.max(e,t.rect.height),0),o=i.filter(e=>e.mosaicItem.textureKey).map(e=>h.fromGlyph(-e.rect.width/2,-a,e,n));return new b(o,[],t,r)}function k(e,t){return e.type===`glyphs`?D(e,t):j(e,t)}function A(e,t){return e.type===`glyphs`?O(e,t):M(e,t)}function j(e,t){let n=N(e,t),r=P(n,t),i=r.length?I(r):{width:0},a=[],o=t.decoration===`underline`?`none`:t.decoration,s=t.horizontalAlignment===`justify`||t.horizontalAlignment===`Justify`,c=s?-1:l(t.horizontalAlignment),d=u(t.verticalAlignment),f=d===2,p=r.length?r[0].yMin:0,m=r.length?L(r[r.length-1]):0,g=m-p,_=f?r.length>1?-m:-(r[0]?.baseline??0):d===1?-p:d===-1?-m:-(p+g/2);for(let e=0;e<r.length;e++){let t=r[e],o=s&&e<r.length-1?R(n,t.start,t.end):0,l=o>0?(i.width-t.width)/o:0,u=l>0?i.width:t.width,d=(c+1)*-1*(u/2),f=t.startY+_,p=null;t.startX=d,t.startY=f;for(let e=t.start;e<=t.end;e++){let r=n[e],{glyph:i,scale:o,fontSize:s}=r,c=d;if(S(i.code)){p=z(a,p,f,t.baseline);continue}r.decoration===`underline`?(p&&p.underlineOffset!==r.underlineOffset||p&&!B(p.color,r.color))&&(p=z(a,p,f,t.baseline)):p=z(a,p,f,t.baseline);let u=f+t.baseline-r.baseline;a.push(h.fromGlyph(d/o,u/o,i,o,{fontSize:s,color:r.color})),d+=r.xAdvance,r.decoration===`underline`&&(p??={startX:c,endX:d,glyphWidthEnd:i.rect.width*o,textureKey:i.mosaicItem.textureKey,underlineOffset:r.underlineOffset,color:r.color},p.endX=d,p.glyphWidthEnd=i.rect.width*o,p.textureKey=p.textureKey??i.mosaicItem.textureKey),l>0&&C(i.code)&&(d+=l,p&&(p.endX=d))}z(a,p,f,t.baseline)}return new b(a,r,{...t,decoration:o})}function M(e,t){let n=N(e,t),r=n.reduce((e,t)=>Math.max(e,t.glyph.rect.height*t.scale),0),i=n.filter(e=>e.glyph.mosaicItem.textureKey).map(e=>h.fromGlyph(-e.glyph.rect.width/2,-r/e.scale,e.glyph,e.scale,{fontSize:e.fontSize,color:e.color}));return new b(i,[],t)}function N(e,t){let n=t.lineHeightRatio??1,r=[];for(let t of e.runs){let e=c(t.fontSize),i=e/t.glyphs.sdfSize,a=f/24*e*n,o=(t.glyphs.faceInfo?.baseline??22)*i,s=(t.glyphs.faceInfo?.midline??16)*i,l=4*i+_(t.decoration),u=1+(t.characterSpacing??0);for(let n of t.glyphs.glyphs){let c=n.shaping.xAdvance*i,d=Math.abs(n.rect.top)*i,f=d+n.rect.height*i;r.push({glyph:n,scale:i,fontSize:e,decoration:t.decoration,underlineOffset:l,color:t.color,xAdvance:!S(n.code)&&!C(n.code)?c*u:c,top:d,bottom:f,lineHeight:a,baseline:o,midline:s})}}return r}function P(e,t){let n=[],r=t.maxLineWidth,i=0,a=0,o=0,s=0,c=0,l=0;for(;i<e.length;){let t=e[i],{glyph:u}=t;if(S(u.code))i!==0&&n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),a=0,s=i+1,c=s,o=0,l=0;else if(C(u.code))c=i+1,o=0,l=t.xAdvance,a+=t.xAdvance;else if(a>r){if(c!==s){let t=c-2;a-=l,n.push({width:a-o,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=c,a=o}else n.push({width:a,start:s,end:i-1,glyphWidthEnd:e[i-1]?.glyph.rect.width*e[i-1]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1}),s=i,c=i,a=0;a+=t.xAdvance,o+=t.xAdvance}else a+=t.xAdvance,o+=t.xAdvance;i++}if(s<e.length){let t=e.length-1;n.push({width:a,start:s,end:t,glyphWidthEnd:e[t]?.glyph.rect.width*e[t]?.scale||0,yMin:0,yMax:0,lineHeight:0,baseline:0,midline:0,startX:0,startY:0,scale:1})}return F(e,n)}function F(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=0,a=1/0,o=0,s=0;for(let t=r.start;t<=r.end;t++){let n=e[t];n.decoration===`underline`&&(s=Math.max(s,n.underlineOffset)),S(n.glyph.code)||C(n.glyph.code)||(i=Math.max(i,n.baseline),o=Math.max(o,n.lineHeight))}let c=1/0,l=-1/0;for(let t=r.start;t<=r.end;t++){let n=e[t];S(n.glyph.code)||C(n.glyph.code)||(c=Math.min(c,i-n.baseline+n.top),l=Math.max(l,i-n.baseline+n.bottom),a=Math.min(a,i-n.baseline+n.midline))}s>0&&(l=Math.max(l,i+s)),r.baseline=i,r.midline=a===1/0?i:a,r.lineHeight=Math.max(o,l),r.yMin=c===1/0?0:c,r.yMax=l===-1/0?0:l,r.startY=n>0?t[n-1].startY+t[n-1].lineHeight:0}return t}function I(e){let t=0;for(let n of e)t=Math.max(n.width+n.glyphWidthEnd,t);let n=e[0].yMin;return{x:0,y:n,height:L(e[e.length-1])-n,width:t}}function L(e){return e.startY+e.lineHeight}function R(e,t,n){let r=0;for(let i=t;i<n;i++)C(e[i].glyph.code)&&!S(e[i+1].glyph.code)&&r++;return r}function z(e,t,n,r){return t&&e.push(h.fromGlyph(t.startX,n+r+t.underlineOffset,g(t.endX-t.startX+t.glyphWidthEnd,t.textureKey),1,{color:t.color})),null}function B(e,t){return e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}export{h as ShapedGlyph,b as ShapingInfo,D as shapeGlyphs,O as shapeGlyphsForMultipoint,j as shapeRichText,M as shapeRichTextForMultipoint,k as shapeTextResource,A as shapeTextResourceForMultipoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- const e=3.14159265359/180,t=3.14159265359/128,n=180/3.141592654,r=1/8,i=1,a=1,o=1.1,s=1,c=1/4,l=1/8,u=1/5,d=8,f=1e-5,p=.05,m=2,h=0,g=1,_=2,v=3,y=1e-30,b=1,x=4,S=7,C=0,w=2,T=3,E=0,D=2,O=2,k=3,A=0,j=3,M=16777216,N=1.1,P=16,F=128,I=1,L=0,R=1,z=2;export{g as attrVvColor,_ as attrVvOpacity,v as attrVvRotation,h as attrVvSize,D as bitsetFillRandomPatternOffset,x as bitsetGenericConsiderAlphaOnly,S as bitsetGenericLabelInstance,b as bitsetGenericLockColor,k as bitsetLineIsSdf,O as bitsetLineScaleDash,C as bitsetMarkerAlignmentMap,w as bitsetMarkerOutlineAllowColorOverride,T as bitsetMarkerScaleSymbolsProportionally,I as bitsetOutlineUsesColorVV,A as bitsetTextIsBackground,j as bitsetTextIsMapAligned,E as bitsetTypeFillOutline,t as c256ToRad,e as cDegToRad,n as cRadToDeg,R as candidateHit,f as epsilon,p as epsilonHitTest,c as extrudeScalePlacementPadding,i as fillPositionPrecision,N as magnifierBarrelFactor,m as maxFilterCount,M as maxRepresentableInt,y as nanMagicNumber,L as noHit,l as offsetPrecision,u as outlineScale,P as packPrecision,d as placementPadding,r as positionPrecision,F as signedToUnsignedByte,a as softEdgeRatio,s as thinLineHalfWidth,o as thinLineWidthFactor,z as trueHit};
2
+ const e=3.14159265359/180,t=3.14159265359/128,n=180/3.141592654,r=1/8,i=1,a=1,o=1.1,s=1,c=.25,l=1/8,u=.2,d=8,f=1e-5,p=.05,m=2,h=0,g=1,_=2,v=3,y=1e-30,b=1,x=4,S=7,C=0,w=2,T=3,E=0,D=2,O=2,k=3,A=0,j=3,M=16777216,N=1.1,P=16,F=128,I=1,L=0,R=1,z=2;export{g as attrVvColor,_ as attrVvOpacity,v as attrVvRotation,h as attrVvSize,D as bitsetFillRandomPatternOffset,x as bitsetGenericConsiderAlphaOnly,S as bitsetGenericLabelInstance,b as bitsetGenericLockColor,k as bitsetLineIsSdf,O as bitsetLineScaleDash,C as bitsetMarkerAlignmentMap,w as bitsetMarkerOutlineAllowColorOverride,T as bitsetMarkerScaleSymbolsProportionally,I as bitsetOutlineUsesColorVV,A as bitsetTextIsBackground,j as bitsetTextIsMapAligned,E as bitsetTypeFillOutline,t as c256ToRad,e as cDegToRad,n as cRadToDeg,R as candidateHit,f as epsilon,p as epsilonHitTest,c as extrudeScalePlacementPadding,i as fillPositionPrecision,N as magnifierBarrelFactor,m as maxFilterCount,M as maxRepresentableInt,y as nanMagicNumber,L as noHit,l as offsetPrecision,u as outlineScale,P as packPrecision,d as placementPadding,r as positionPrecision,F as signedToUnsignedByte,a as softEdgeRatio,s as thinLineHalfWidth,o as thinLineWidthFactor,z as trueHit};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{Vec4 as a,Vec2 as o,Float as s,Sampler2D as c,mod as l,floor as u,step as d,and as f,lessThan as p,greaterThanEqual as m,Vec3 as h,Mat3 as g,equal as _,ifElse as v,greaterThan as y,Bool as b,texture2D as x,smoothstep as S,Int as C,bitRShift as w,bitAnd as T}from"../../graph/glsl.js";import{location as E,option as D,uniform as O,texture as k,define as A,input as j,ComputeVertexInput as M}from"../../GraphShaderModule.js";import{FeatureVertexInput as N,AFeatureShader as ee,FeatureFragmentInput as te}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as P,bitsetTextIsMapAligned as F,noHit as I,trueHit as ne}from"../shaders/constants.js";import{isPointHittest as re,distPointTriangle as ie,isRectHittest as ae,hittestRect as L,isPolygonHittest as R,hittestLabelPolygon as z,hittestPolygon as B}from"../shaders/hittestUtils.js";import{MosaicInfo as V}from"../shaders/MosaicInfo.js";import{getBit as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as oe}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as se}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as J,getVisualVariableRotation as Y}from"../shaders/vvUtils.js";const ce=1/i;class X extends N{}e([E(3,a)],X.prototype,`color`,void 0),e([E(4,o)],X.prototype,`offset`,void 0),e([E(5,o)],X.prototype,`textureUV`,void 0),e([E(6,a)],X.prototype,`fontAndReferenceSize`,void 0),e([E(7,a)],X.prototype,`outlineColor`,void 0),e([E(8,a)],X.prototype,`haloColor`,void 0),e([E(9,o)],X.prototype,`outlineAndHaloSize`,void 0),e([E(10,o)],X.prototype,`zoomRange`,void 0),e([E(11,s)],X.prototype,`clipAngle`,void 0),e([E(12,a)],X.prototype,`referenceSymbol`,void 0);class Z extends M{}e([E(13,o)],Z.prototype,`offsetNextVertex1`,void 0),e([E(14,o)],Z.prototype,`offsetNextVertex2`,void 0);class Q extends te{}class $ extends ee{constructor(){super(...arguments),this.type=`TextShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t){let{clipAngle:r,zoomRange:i}=e,a=r.multiply(ce),o=l(a.subtract(this.view.getRotation()),new s(360)),c=new s(0),h=n,g=u(this.tileInfo.currentZoom.multiply(h)).divide(h),_=i.x,v=i.y,y=new s(1).subtract(d(_,g)).multiply(2),b=new s(f(m(o,new s(90)),p(o,new s(270)))).multiply(2),x=new s(2).multiply(new s(1).subtract(d(g,v)));return c=c.add(t.multiply(y)),c=c.add(t.multiply(b)),c=c.add(x),c=c.add(new s(2).multiply(this.getLabelHidden(e.id,e.bitset))),c}vertex(e,t){let n=H(e.bitset,P),i=new s(1).subtract(n),c=this.getFeatureId(e.id,e.bitset),l=e.fontAndReferenceSize[0],u=e.fontAndReferenceSize[1],d=e.fontAndReferenceSize[2],f=e.fontAndReferenceSize[3],p=l.divide(d),m=this.textRenderPassType===1?e.outlineColor:this.textRenderPassType===2?e.haloColor:this._getVertexColor(e,c),x=this.getCalloutTransform(this.isAnchoredLabel(e.bitset)).multiply(new h(this.getLabelTextPos(e.pos,e.id,e.bitset),1)).xy,S=e.offset,C=new s(1),w=g.identity(),T=new o(0);if(this.isLabel){if(!e.referenceSymbol)throw Error(`InternalError: Optional attribute 'referenceSymbol' expected for labels`);let t=e.referenceSymbol,n=t.xy,i=t.z,a=this._unpackDirection(t.w),o=this.getLabelReferenceSymbolVVOffset(e.id),l=_(o.x,new s(0)).and(_(o.y,new s(0))),u=v(l,J(this,c,i).divide(2),i.divide(2)),d=a.multiply(u.add(r)).add(o);T=n.add(d),S=S.add(T)}else C=J(this,c,u).divide(u),l=l.multiply(C),p=p.multiply(C),S=S.multiply(C),w=Y(this,c),S=w.multiply(new h(S,0)).xy;let E=H(e.bitset,F),D=this._getViewRotationMatrix(E).multiply(new h(S,0)).multiply(this.tileInfo.scaleFactor).xy,O=this.isLabel?this.clipLabel(e,E):this.clip(e.id,e.bitset,e.zoomRange);O=this.isBackgroundPass?O.add(i.multiply(2)):O.add(n.multiply(2));let k=new s(0);if(this.textRenderPassType===1&&(O=O.add(v(_(e.outlineAndHaloSize.x,new s(0)),new s(2),new s(0))),k=new s(e.outlineAndHaloSize.x).divide(p).divide(f)),this.textRenderPassType===2){let t=e.outlineAndHaloSize.x,n=new s(e.outlineAndHaloSize.y);O=O.add(v(_(n,new s(0)),new s(2),new s(0))),k=n.add(t).divide(p).divide(f)}let A=this.isLabel?y(O,new s(1)):new b(!1),j=new a(x.add(D),O,1),M=e.textureUV.divide(this.mosaicInfo.size),N=new s(.105).multiply(d).divide(l).divide(this.view.pixelRatio);return{glPosition:j,color:m,size:p,textureUV:M,antialiasingWidth:N,outlineDistanceOffset:k,...this.maybeRunHittest(e,t,{vvSizeAdjustment:C,vvRotation:w,labelOffset:T,labelClipped:A,scaleFactor:this.tileInfo.scaleFactor})}}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new s(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getHittestAlignmentMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new s(1).subtract(e);return n.multiply(e).add(r.multiply(i))}fragment(e){let t=new s(2/8),n=new s(1).subtract(t),r=x(this.mosaicTexture,e.textureUV).a,i=n.subtract(e.outlineDistanceOffset);this.highlight&&(i=i.divide(2));let a=e.antialiasingWidth,o=S(i.subtract(a),i.add(a),r);return this.getFragmentOutput(e.color.multiply(o),e)}computeHittestTriangle(e,t,{vvSizeAdjustment:n,vvRotation:r,labelOffset:i,scaleFactor:a}){let o,s,c;this.isLabel?(o=new h(e.offset.multiply(a).add(i),0),s=new h(t.offsetNextVertex1.multiply(a).add(i),0),c=new h(t.offsetNextVertex2.multiply(a).add(i),0)):(o=r.multiply(new h(e.offset.multiply(a).multiply(n),0)),s=r.multiply(new h(t.offsetNextVertex1.multiply(a).multiply(n),0)),c=r.multiply(new h(t.offsetNextVertex2.multiply(a).multiply(n),0)));let l=this.tile.getViewScreenMat3(this.view).multiply(new h(e.pos,1)),u=H(e.bitset,F),d=this._getHittestAlignmentMatrix(u);return{pos0:l.add(d.multiply(o)).xy,pos1:l.add(d.multiply(s)).xy,pos2:l.add(d.multiply(c)).xy}}hittest(e,t,n){let{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,labelClipped:o,scaleFactor:c}=n,{pos0:l,pos1:u,pos2:d}=this.computeHittestTriangle(e,t,{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,scaleFactor:c}),f={pos0:l,pos1:u,pos2:d},p=this.isLabel?o:new b(!1);return v(p,new s(I),()=>v(re(this.hittestRequest),()=>{let e=ie(this.hittestRequest.position,l,u,d);return v(y(e,this.hittestRequest.distance),new s(I),new s(ne))},()=>v(ae(this.hittestRequest),L(f,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),v(R(this.hittestRequest),this.isLabel?z(f,this.hittestRequest.viewSize,this.hittestMaskTexture):B(f,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(I)))))}_unpackDirection(e){let t=new C(e),n=w(t,new C(2)),r=T(t,new C(3));return new o(new s(n).subtract(1),new s(r).subtract(1))}_getVertexColor(e,t){let n=e.color;if(this.visualVariableColor){let r=this.getColorValue(t);n=this.visualVariableColor.getColor(r,e.color,new b(!1))}if(this.visualVariableOpacity){let e=this.getOpacityValue(t),r=this.visualVariableOpacity.getOpacity(e);n=n.multiply(r)}return n}}e([D(U)],$.prototype,`visualVariableColor`,void 0),e([D(W)],$.prototype,`visualVariableOpacity`,void 0),e([D(G)],$.prototype,`visualVariableRotation`,void 0),e([D(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([D(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([D(oe)],$.prototype,`visualVariableSizeStops`,void 0),e([D(se)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([O(V)],$.prototype,`mosaicInfo`,void 0),e([k(c)],$.prototype,`mosaicTexture`,void 0),e([A],$.prototype,`textRenderPassType`,void 0),e([A],$.prototype,`isBackgroundPass`,void 0),e([A],$.prototype,`isLabel`,void 0),e([t(0,j(X)),t(1,j(Z))],$.prototype,`vertex`,null),e([t(0,j(Q))],$.prototype,`fragment`,null);export{Q as TextFragmentInput,$ as TextShader,X as TextVertexInput};
2
+ import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{Vec4 as a,Vec2 as o,Float as s,Sampler2D as c,mod as l,floor as u,step as d,and as f,lessThan as p,greaterThanEqual as m,Vec3 as h,Mat3 as g,equal as _,ifElse as v,greaterThan as y,Bool as b,texture2D as x,smoothstep as S,Int as C,bitRShift as w,bitAnd as T}from"../../graph/glsl.js";import{location as E,option as D,uniform as O,texture as k,define as A,input as j,ComputeVertexInput as M}from"../../GraphShaderModule.js";import{FeatureVertexInput as N,AFeatureShader as ee,FeatureFragmentInput as te}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as P,bitsetTextIsMapAligned as F,noHit as I,trueHit as ne}from"../shaders/constants.js";import{isPointHittest as re,distPointTriangle as ie,isRectHittest as ae,hittestRect as L,isPolygonHittest as R,hittestLabelPolygon as z,hittestPolygon as B}from"../shaders/hittestUtils.js";import{MosaicInfo as V}from"../shaders/MosaicInfo.js";import{getBit as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as oe}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as se}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as J,getVisualVariableRotation as Y}from"../shaders/vvUtils.js";const ce=1/i;class X extends N{}e([E(3,a)],X.prototype,`color`,void 0),e([E(4,o)],X.prototype,`offset`,void 0),e([E(5,o)],X.prototype,`textureUV`,void 0),e([E(6,a)],X.prototype,`fontAndReferenceSize`,void 0),e([E(7,a)],X.prototype,`outlineColor`,void 0),e([E(8,a)],X.prototype,`haloColor`,void 0),e([E(9,o)],X.prototype,`outlineAndHaloSize`,void 0),e([E(10,o)],X.prototype,`zoomRange`,void 0),e([E(11,s)],X.prototype,`clipAngle`,void 0),e([E(12,a)],X.prototype,`referenceSymbol`,void 0);class Z extends M{}e([E(13,o)],Z.prototype,`offsetNextVertex1`,void 0),e([E(14,o)],Z.prototype,`offsetNextVertex2`,void 0);class Q extends te{}class $ extends ee{constructor(){super(...arguments),this.type=`TextShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t){let{clipAngle:r,zoomRange:i}=e,a=r.multiply(ce),o=l(a.subtract(this.view.getRotation()),new s(360)),c=new s(0),h=n,g=u(this.tileInfo.currentZoom.multiply(h)).divide(h),_=i.x,v=i.y,y=new s(1).subtract(d(_,g)).multiply(2),b=new s(f(m(o,new s(90)),p(o,new s(270)))).multiply(2),x=new s(2).multiply(new s(1).subtract(d(g,v)));return c=c.add(t.multiply(y)),c=c.add(t.multiply(b)),c=c.add(x),c=c.add(new s(2).multiply(this.getLabelHidden(e.id,e.bitset))),c}vertex(e,t){let n=H(e.bitset,P),i=new s(1).subtract(n),c=this.getFeatureId(e.id,e.bitset),l=e.fontAndReferenceSize[0],u=e.fontAndReferenceSize[1],d=e.fontAndReferenceSize[2],f=e.fontAndReferenceSize[3],p=l.divide(d),m=this.textRenderPassType===1?e.outlineColor:this.textRenderPassType===2?e.haloColor:this._getVertexColor(e,c),x=this.getCalloutTransform(this.isAnchoredLabel(e.bitset)).multiply(new h(this.getLabelTextPos(e.pos,e.id,e.bitset),1)).xy,S=e.offset,C=new s(1),w=g.identity(),T=new o(0);if(this.isLabel){if(!e.referenceSymbol)throw Error(`InternalError: Optional attribute 'referenceSymbol' expected for labels`);let t=e.referenceSymbol,n=t.xy,i=t.z,a=this._unpackDirection(t.w),o=this.getLabelReferenceSymbolVVOffset(e.id),l=_(o.x,new s(0)).and(_(o.y,new s(0))),u=v(l,J(this,c,i).divide(2),i.divide(2)),d=a.multiply(u.add(r)).add(o);T=n.add(d),S=S.add(T)}else C=J(this,c,u).divide(u),l=l.multiply(C),p=p.multiply(C),S=S.multiply(C),w=Y(this,c),S=w.multiply(new h(S,0)).xy;let E=H(e.bitset,F),D=this._getViewRotationMatrix(E).multiply(new h(S,0)).multiply(this.tileInfo.scaleFactor).xy,O=this.isLabel?this.clipLabel(e,E):this.clip(e.id,e.bitset,e.zoomRange);O=this.isBackgroundPass?O.add(i.multiply(2)):O.add(n.multiply(2));let k=new s(0);if(this.textRenderPassType===1&&(O=O.add(v(_(e.outlineAndHaloSize.x,new s(0)),new s(2),new s(0))),k=new s(e.outlineAndHaloSize.x).divide(p).divide(f)),this.textRenderPassType===2){let t=e.outlineAndHaloSize.x,n=new s(e.outlineAndHaloSize.y);O=O.add(v(_(n,new s(0)),new s(2),new s(0))),k=n.add(t).divide(p).divide(f)}let A=this.isLabel?y(O,new s(1)):new b(!1),j=new a(x.add(D),O,1),M=e.textureUV.divide(this.mosaicInfo.size),N=new s(.105).multiply(d).divide(l).divide(this.view.pixelRatio);return{glPosition:j,color:m,size:p,textureUV:M,antialiasingWidth:N,outlineDistanceOffset:k,...this.maybeRunHittest(e,t,{vvSizeAdjustment:C,vvRotation:w,labelOffset:T,labelClipped:A,scaleFactor:this.tileInfo.scaleFactor})}}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new s(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getHittestAlignmentMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new s(1).subtract(e);return n.multiply(e).add(r.multiply(i))}fragment(e){let t=new s(.25),n=new s(1).subtract(t),r=x(this.mosaicTexture,e.textureUV).a,i=n.subtract(e.outlineDistanceOffset);this.highlight&&(i=i.divide(2));let a=e.antialiasingWidth,o=S(i.subtract(a),i.add(a),r);return this.getFragmentOutput(e.color.multiply(o),e)}computeHittestTriangle(e,t,{vvSizeAdjustment:n,vvRotation:r,labelOffset:i,scaleFactor:a}){let o,s,c;this.isLabel?(o=new h(e.offset.multiply(a).add(i),0),s=new h(t.offsetNextVertex1.multiply(a).add(i),0),c=new h(t.offsetNextVertex2.multiply(a).add(i),0)):(o=r.multiply(new h(e.offset.multiply(a).multiply(n),0)),s=r.multiply(new h(t.offsetNextVertex1.multiply(a).multiply(n),0)),c=r.multiply(new h(t.offsetNextVertex2.multiply(a).multiply(n),0)));let l=this.tile.getViewScreenMat3(this.view).multiply(new h(e.pos,1)),u=H(e.bitset,F),d=this._getHittestAlignmentMatrix(u);return{pos0:l.add(d.multiply(o)).xy,pos1:l.add(d.multiply(s)).xy,pos2:l.add(d.multiply(c)).xy}}hittest(e,t,n){let{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,labelClipped:o,scaleFactor:c}=n,{pos0:l,pos1:u,pos2:d}=this.computeHittestTriangle(e,t,{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,scaleFactor:c}),f={pos0:l,pos1:u,pos2:d},p=this.isLabel?o:new b(!1);return v(p,new s(I),()=>v(re(this.hittestRequest),()=>{let e=ie(this.hittestRequest.position,l,u,d);return v(y(e,this.hittestRequest.distance),new s(I),new s(ne))},()=>v(ae(this.hittestRequest),L(f,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),v(R(this.hittestRequest),this.isLabel?z(f,this.hittestRequest.viewSize,this.hittestMaskTexture):B(f,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(I)))))}_unpackDirection(e){let t=new C(e),n=w(t,new C(2)),r=T(t,new C(3));return new o(new s(n).subtract(1),new s(r).subtract(1))}_getVertexColor(e,t){let n=e.color;if(this.visualVariableColor){let r=this.getColorValue(t);n=this.visualVariableColor.getColor(r,e.color,new b(!1))}if(this.visualVariableOpacity){let e=this.getOpacityValue(t),r=this.visualVariableOpacity.getOpacity(e);n=n.multiply(r)}return n}}e([D(U)],$.prototype,`visualVariableColor`,void 0),e([D(W)],$.prototype,`visualVariableOpacity`,void 0),e([D(G)],$.prototype,`visualVariableRotation`,void 0),e([D(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([D(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([D(oe)],$.prototype,`visualVariableSizeStops`,void 0),e([D(se)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([O(V)],$.prototype,`mosaicInfo`,void 0),e([k(c)],$.prototype,`mosaicTexture`,void 0),e([A],$.prototype,`textRenderPassType`,void 0),e([A],$.prototype,`isBackgroundPass`,void 0),e([A],$.prototype,`isLabel`,void 0),e([t(0,j(X)),t(1,j(Z))],$.prototype,`vertex`,null),e([t(0,j(Q))],$.prototype,`fragment`,null);export{Q as TextFragmentInput,$ as TextShader,X as TextVertexInput};