@arcgis/core 5.1.0-next.114 → 5.1.0-next.115

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 (294) hide show
  1. package/Map.js +1 -1
  2. package/analysis/ShadowCast/MinDurationOptions.d.ts +3 -5
  3. package/analysis/ShadowCastAnalysis.d.ts +1 -1
  4. package/arcgisGlobal.d.ts +4 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/05c47ca3a266a271974b.js +1 -0
  7. package/assets/esri/core/workers/chunks/{29bbc0d6d847b065d10e.js → 062aadf426fe97a76bbb.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0954e82f739d25001bcb.js +1 -0
  9. package/assets/esri/core/workers/chunks/0aaee272520c6e5bb617.js +1 -0
  10. package/assets/esri/core/workers/chunks/{12053c1213465d07d2f6.js → 0b445c1cf281f158c1f1.js} +1 -1
  11. package/assets/esri/core/workers/chunks/102ff3710db4ba5f083d.js +1 -0
  12. package/assets/esri/core/workers/chunks/163ce1be8bfe20e77f97.js +1 -0
  13. package/assets/esri/core/workers/chunks/{e87d02af6d6b05e19d93.js → 16713986893adfbc9331.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{9bd713d96502ddc2ce25.js → 1765042635084f75d2b3.js} +1 -1
  15. package/assets/esri/core/workers/chunks/185c670eb99474906836.js +1 -0
  16. package/assets/esri/core/workers/chunks/18ebf1d3ed05c8057f7d.js +1 -0
  17. package/assets/esri/core/workers/chunks/1da2c34743897d1b6a24.js +1 -0
  18. package/assets/esri/core/workers/chunks/22d4521637806a8b828f.js +1 -0
  19. package/assets/esri/core/workers/chunks/233ff588798c8a5eedf4.js +1 -0
  20. package/assets/esri/core/workers/chunks/24d9e4f1c7b8ff0d2cce.js +1 -0
  21. package/assets/esri/core/workers/chunks/2562d8905bd05ef6fd07.js +1 -0
  22. package/assets/esri/core/workers/chunks/{e5d969214d9eda5c0b4c.js → 2a5dbed88bbd96cfac9f.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2bcd4d395bfe6a19ccc8.js +1 -0
  24. package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +1 -0
  25. package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +1 -0
  26. package/assets/esri/core/workers/chunks/3b10a962e4ff2f3da5bc.js +1 -0
  27. package/assets/esri/core/workers/chunks/3e9709e61015993b1c7d.js +1 -0
  28. package/assets/esri/core/workers/chunks/425c04b26a6ec6d04b08.js +1 -0
  29. package/assets/esri/core/workers/chunks/4364a3e706294bb6ae41.js +1 -0
  30. package/assets/esri/core/workers/chunks/44e52fe98ffafe6a2807.js +1 -0
  31. package/assets/esri/core/workers/chunks/4cecc582513b8a83f194.js +1 -0
  32. package/assets/esri/core/workers/chunks/5022413f5a41b5d435ea.js +1 -0
  33. package/assets/esri/core/workers/chunks/{8ade869fa9bae446266a.js → 51816d79c6be15e4bfcf.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{cf9b0ba30a75c030ca92.js → 5524a71d1abc9568ce26.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{ba31616de9d73d83d867.js → 557e39e5156b313597f9.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5ef37f37e405b3bb5450.js → 59dafa1e1340ea4043e6.js} +1 -1
  37. package/assets/esri/core/workers/chunks/624b1bb269744142b835.js +1 -0
  38. package/assets/esri/core/workers/chunks/{39987c06636e757d1f00.js → 62b5972d0ef9bf173308.js} +1 -1
  39. package/assets/esri/core/workers/chunks/641b8622fbb93c84671d.js +1 -0
  40. package/assets/esri/core/workers/chunks/643c7506f8fe8e06acd2.js +1 -0
  41. package/assets/esri/core/workers/chunks/65f02eca694cc1c9f5a7.js +1 -0
  42. package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +1 -0
  43. package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +1 -0
  44. package/assets/esri/core/workers/chunks/{0d2bc1be5802681666a4.js → 77859a61d059738d057f.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{03a4543b94f9adeb1852.js → 7a3b05e25de2ff150f38.js} +1 -1
  46. package/assets/esri/core/workers/chunks/7bbffe07e62897928773.js +1 -0
  47. package/assets/esri/core/workers/chunks/{14a241b07baa67743248.js → 7c292f7b181f3b93352b.js} +1 -1
  48. package/assets/esri/core/workers/chunks/7c2d7df4ef4d775cd648.js +1 -0
  49. package/assets/esri/core/workers/chunks/{6d20d741b8ae1a45b422.js → 7dc2c21d61ba66a3f461.js} +1 -1
  50. package/assets/esri/core/workers/chunks/7df05c3c82cd27b77300.js +1 -0
  51. package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +1 -0
  52. package/assets/esri/core/workers/chunks/8461f50e9875db4ccfec.js +1 -0
  53. package/assets/esri/core/workers/chunks/{71e12db99589c98a4357.js → 8477b5fdd99c6ac5c27b.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{be1e4c3ec53fc92a26f1.js → 8598997340682113a2a5.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{548c34ea88f113d03c93.js → 86229634bf008f53dad4.js} +1 -1
  56. package/assets/esri/core/workers/chunks/86443e47ad99e555753a.js +1 -0
  57. package/assets/esri/core/workers/chunks/87a40e7f79f97ca637a9.js +1 -0
  58. package/assets/esri/core/workers/chunks/{27d6ad4ca5ab8c9d62cd.js → 8c443c52c846a096a250.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{86161025b53b916328ff.js → 8ca88cfc0b9f84dc5832.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{340f2c996f62f7f5ceae.js → 8e7ce4835b3106349684.js} +1 -1
  61. package/assets/esri/core/workers/chunks/90b0fe5584fb6fc99766.js +1 -0
  62. package/assets/esri/core/workers/chunks/9133c1b7cc1c9da27deb.js +1 -0
  63. package/assets/esri/core/workers/chunks/{d4749eb8a47869477037.js → 9250615c78f8570a9cda.js} +1 -1
  64. package/assets/esri/core/workers/chunks/92a7735973b2f82a66ce.js +1 -0
  65. package/assets/esri/core/workers/chunks/94a5a834e32fc6cc6ed4.js +1 -0
  66. package/assets/esri/core/workers/chunks/986d8c3907aeeb18c4f6.js +1 -0
  67. package/assets/esri/core/workers/chunks/98e489c2b85feded7776.js +1 -0
  68. package/assets/esri/core/workers/chunks/{271e42b7cd3c3441839e.js → 9eab1e1535494ff2050d.js} +10 -22
  69. package/assets/esri/core/workers/chunks/{466c250537415f12eb59.js → a01f0ffbe555f690bdca.js} +1 -1
  70. package/assets/esri/core/workers/chunks/a03c4c0bf138734a002e.js +1 -0
  71. package/assets/esri/core/workers/chunks/a814069325125466506b.js +1 -0
  72. package/assets/esri/core/workers/chunks/{e4b2120d7ee1c998b1fc.js → aa03f770178693167aa0.js} +1 -1
  73. package/assets/esri/core/workers/chunks/aea439d4c2308f88b295.js +1 -0
  74. package/assets/esri/core/workers/chunks/{7995e6983456c779adf9.js → b002304a45856b024b46.js} +1 -1
  75. package/assets/esri/core/workers/chunks/b0c242c4f5412e4cce73.js +1 -0
  76. package/assets/esri/core/workers/chunks/b44f1d08784f2e50c853.js +1 -0
  77. package/assets/esri/core/workers/chunks/c1b6de0d728d25d7905a.js +1 -0
  78. package/assets/esri/core/workers/chunks/{f8b884b529064df4a30a.js → caf80facb0322be054ab.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{25d795a1697803d77e56.js → ce0e627a5e1cb78adce8.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{63378b0b4265a547656b.js → d8ec0afb2b91ccf32e55.js} +1 -1
  81. package/assets/esri/core/workers/chunks/d97c0c18202b8c578f8c.js +1 -0
  82. package/assets/esri/core/workers/chunks/{2f99a95facddc44319a9.js → da3c54e27a808f4fcc18.js} +1 -1
  83. package/assets/esri/core/workers/chunks/db012650fb34c10cecd0.js +1 -0
  84. package/assets/esri/core/workers/chunks/dc6d50e1097a920ff820.js +1 -0
  85. package/assets/esri/core/workers/chunks/dce37324a2382d2eef0d.js +1 -0
  86. package/assets/esri/core/workers/chunks/e0bd550b10dd402c48f1.js +1 -0
  87. package/assets/esri/core/workers/chunks/e2ba57f7119b7182ba02.js +279 -0
  88. package/assets/esri/core/workers/chunks/e755477dc78e9d6038d4.js +1 -0
  89. package/assets/esri/core/workers/chunks/ea4057090cf15d602585.js +1 -0
  90. package/assets/esri/core/workers/chunks/ea8f642b1db933d2c26f.js +1 -0
  91. package/assets/esri/core/workers/chunks/eabd4a78221b7e733793.js +1 -0
  92. package/assets/esri/core/workers/chunks/eb16976b4eb7f1300f4a.js +1 -0
  93. package/assets/esri/core/workers/chunks/efae58f746b108163a50.js +1 -0
  94. package/assets/esri/core/workers/chunks/f231548c8ac7ecb59927.js +1 -0
  95. package/assets/esri/core/workers/chunks/fe2325efd0d8ad8369ed.js +1 -0
  96. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +26 -3
  97. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -13
  98. package/assets/esri/themes/dark/main.css +1 -1
  99. package/assets/esri/themes/light/main.css +1 -1
  100. package/assets/esri/themes/light/view.css +1 -1
  101. package/chunks/GlobalIllumination.glsl.js +22 -34
  102. package/config.js +1 -1
  103. package/core/screenUtils.js +1 -1
  104. package/core/typedArrayUtil.js +1 -1
  105. package/editing/templates/TemplateListing.d.ts +32 -0
  106. package/editing/templates/TemplateListing.js +2 -0
  107. package/geometry/support/buffer/BufferView.js +1 -1
  108. package/geometry/support/heightModelInfoUtils.js +1 -1
  109. package/interfaces.d.ts +14 -0
  110. package/kernel.js +1 -1
  111. package/layers/AnnotationLayer.d.ts +42 -0
  112. package/layers/AnnotationLayer.js +2 -0
  113. package/layers/DimensionFeatureLayer.d.ts +36 -1
  114. package/layers/DimensionFeatureLayer.js +1 -1
  115. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  116. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  117. package/layers/types.d.ts +1 -1
  118. package/networks/support/networkFieldUtils.js +1 -1
  119. package/package.json +1 -1
  120. package/rest/support/OutDistance.js +1 -1
  121. package/rest/support/Query.js +1 -1
  122. package/support/basemapEnsureType.js +1 -1
  123. package/support/revision.js +1 -1
  124. package/symbols/cim/CIMOperators.js +1 -1
  125. package/symbols/cim/CIMSymbolHelper.js +1 -1
  126. package/symbols/cim/utils.js +1 -1
  127. package/views/2d/engine/webgl/mesh/factories/FeatureMeshFactory.js +1 -1
  128. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  129. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
  132. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  133. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  134. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  138. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  139. package/views/2d/engine/webgl/util/AnnotationMatcher.js +2 -0
  140. package/views/2d/engine/webgl/util/DimensionMatcher.js +2 -0
  141. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  142. package/views/2d/engine/webgl/util/createMatcher.js +1 -1
  143. package/views/2d/layerViewModuleImportUtils.js +1 -1
  144. package/views/2d/layers/AnnotationLayerView2D.js +2 -0
  145. package/views/2d/layers/{DimensionLayerView2D.js → DimensionFeatureLayerView2D.js} +1 -1
  146. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  147. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  148. package/views/2d/layers/RouteLayerView2D.js +1 -1
  149. package/views/2d/layers/TileLayerView2D.js +1 -1
  150. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  151. package/views/2d/layers/features/FeatureContainer.js +1 -1
  152. package/views/2d/layers/features/Processor.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +2 -0
  154. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  155. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  156. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  157. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  158. package/views/2d/layers/features/support/FeatureSetReaderAnnotationJSON.js +2 -0
  159. package/views/2d/layers/features/support/FeatureSetReaderDimensionJSON.js +2 -0
  160. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  161. package/views/2d/layers/support/annodime/DimensionInfo.js +2 -0
  162. package/views/2d/layers/support/annodime/DimensionMatcherSchema.js +2 -0
  163. package/views/2d/layers/support/annodime/PrivateDimensionEffect.js +2 -0
  164. package/views/2d/layers/support/annodime/PrivatePlacementMultipoint.js +2 -0
  165. package/views/2d/layers/support/annodime/annotationGraphic.js +2 -0
  166. package/views/2d/layers/support/annodime/annotationSchema.js +2 -0
  167. package/views/2d/layers/support/annodime/annotationUtils.js +2 -0
  168. package/views/2d/layers/support/annodime/cimAnnotations.js +2 -0
  169. package/views/2d/layers/support/annodime/dimensionSchema.js +2 -0
  170. package/views/2d/layers/support/annodime/dimensionSymbols.js +2 -0
  171. package/views/2d/layers/support/annodime/dimensionUtils.js +2 -0
  172. package/views/2d/layers/support/annodime/fields.js +2 -0
  173. package/views/2d/layers/support/annodime/unsupported.js +2 -0
  174. package/views/2d/layers/support/annodime/utils.js +2 -0
  175. package/views/2d/layers/support/annodime/virtualFields.js +2 -0
  176. package/views/2d/support/clippingUtils.js +1 -1
  177. package/views/2d/support/hitTestUtils.js +1 -1
  178. package/views/2d/types.d.ts +5 -1
  179. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  180. package/views/3d/layerViewModuleImportUtils.js +1 -1
  181. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  182. package/views/3d/layers/TileLayerView3D.js +1 -1
  183. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  184. package/views/3d/types.d.ts +2 -0
  185. package/views/3d/webgl-engine/collections/Component/RenderSubmitSystem.js +1 -1
  186. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  187. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +8 -8
  188. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +53 -61
  189. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +23 -32
  190. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  191. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  192. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  193. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  194. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  195. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  196. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  197. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  198. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  199. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  200. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  201. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  202. package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +18 -1
  203. package/views/PopupView.d.ts +3 -3
  204. package/views/PopupView.js +1 -1
  205. package/views/SceneView.js +1 -1
  206. package/views/View2D.js +1 -1
  207. package/views/layers/AnnotationLayerView.d.ts +18 -0
  208. package/views/layers/AnnotationLayerView.js +2 -0
  209. package/views/layers/DimensionFeatureLayerView.d.ts +18 -0
  210. package/views/layers/DimensionFeatureLayerView.js +2 -0
  211. package/views/layers/FeatureLikeLayerView.d.ts +2 -1
  212. package/views/layers/FeatureLikeLayerView.js +1 -1
  213. package/views/layers/ImageryLayerView.js +1 -1
  214. package/views/layers/ImageryTileLayerView.js +1 -1
  215. package/views/layers/WMSLayerView.js +1 -1
  216. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  217. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  218. package/widgets/BatchAttributeForm/css.js +1 -1
  219. package/widgets/BatchAttributeForm/rendered-content/RelationshipDetails.js +2 -0
  220. package/widgets/BatchAttributeForm.js +1 -1
  221. package/widgets/FeatureForm.js +1 -1
  222. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  223. package/widgets/OrientedImageryViewer/css.js +1 -1
  224. package/widgets/OrientedImageryViewer.js +1 -1
  225. package/widgets/support/iconUtils.js +1 -1
  226. package/assets/esri/core/workers/chunks/0175098da590a7109539.js +0 -1
  227. package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +0 -1
  228. package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +0 -1
  229. package/assets/esri/core/workers/chunks/03c46880b69ce75a010f.js +0 -1
  230. package/assets/esri/core/workers/chunks/040884cec4b84dd1bb17.js +0 -1
  231. package/assets/esri/core/workers/chunks/04ea806b933d4dd41609.js +0 -1
  232. package/assets/esri/core/workers/chunks/0e549d942d6cba1608cf.js +0 -1
  233. package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +0 -1
  234. package/assets/esri/core/workers/chunks/13d43a0683c42b94feb6.js +0 -1
  235. package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +0 -1
  236. package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +0 -1
  237. package/assets/esri/core/workers/chunks/27d7c701306efeea6b82.js +0 -1
  238. package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +0 -1
  239. package/assets/esri/core/workers/chunks/2bdfae998371e3aa9f2d.js +0 -1
  240. package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +0 -1
  241. package/assets/esri/core/workers/chunks/3835097520296b0517af.js +0 -1
  242. package/assets/esri/core/workers/chunks/4605a68e40c5c3ac6e3e.js +0 -1
  243. package/assets/esri/core/workers/chunks/4b130db9b7b4e2e32ea4.js +0 -1
  244. package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +0 -1
  245. package/assets/esri/core/workers/chunks/4c5cdd2712c938fafc5d.js +0 -1
  246. package/assets/esri/core/workers/chunks/4fa3840672c33adb9171.js +0 -1
  247. package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +0 -1
  248. package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +0 -1
  249. package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +0 -1
  250. package/assets/esri/core/workers/chunks/66fe1634c6e8f72fc653.js +0 -1
  251. package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +0 -1
  252. package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +0 -1
  253. package/assets/esri/core/workers/chunks/6b66a6f69aa03338c346.js +0 -1
  254. package/assets/esri/core/workers/chunks/6d59a9cf533ebc590f70.js +0 -1
  255. package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +0 -1
  256. package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +0 -1
  257. package/assets/esri/core/workers/chunks/817fd88fe9a48caf69fb.js +0 -1
  258. package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +0 -1
  259. package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +0 -1
  260. package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +0 -1
  261. package/assets/esri/core/workers/chunks/8c8fed53c12fb80ef2ed.js +0 -1
  262. package/assets/esri/core/workers/chunks/8ff83c59462dea6e3427.js +0 -1
  263. package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +0 -1
  264. package/assets/esri/core/workers/chunks/a9c9c00432ee41ec91ba.js +0 -1
  265. package/assets/esri/core/workers/chunks/af762422a65c551dcd54.js +0 -1
  266. package/assets/esri/core/workers/chunks/b041c22885193bdd3004.js +0 -1
  267. package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +0 -1
  268. package/assets/esri/core/workers/chunks/b684ff4bc93bd60d6a19.js +0 -1
  269. package/assets/esri/core/workers/chunks/bb2f6b0fcdfb8b158e26.js +0 -1
  270. package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +0 -1
  271. package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +0 -1
  272. package/assets/esri/core/workers/chunks/cedf3e316d6f89cf7005.js +0 -1
  273. package/assets/esri/core/workers/chunks/d39f5590022d910ee951.js +0 -1
  274. package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +0 -1
  275. package/assets/esri/core/workers/chunks/d41b847d08c42e5329d6.js +0 -262
  276. package/assets/esri/core/workers/chunks/d52172439db02a349542.js +0 -1
  277. package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +0 -1
  278. package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +0 -1
  279. package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +0 -1
  280. package/assets/esri/core/workers/chunks/eda51e512eff551ad858.js +0 -1
  281. package/assets/esri/core/workers/chunks/f14e3693cd644265f909.js +0 -1
  282. package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +0 -1
  283. package/assets/esri/core/workers/chunks/f635a8e3b0bfeda99ed5.js +0 -1
  284. package/assets/esri/core/workers/chunks/f9f331c76c96743d8522.js +0 -1
  285. package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +0 -1
  286. package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +0 -2
  287. package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +0 -2
  288. package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +0 -2
  289. package/symbols/dimensions/effects/LinearDimensionLineEffect.js +0 -2
  290. package/symbols/dimensions/effects/LinearDimensionPointEffect.js +0 -2
  291. package/symbols/dimensions/effects/LinearDimensionTextEffect.js +0 -2
  292. package/views/2d/layers/features/support/FeatureSetReaderDimension.js +0 -2
  293. package/views/3d/webgl-engine/effects/globalIllumination/BlueNoise.js +0 -2
  294. package/views/layers/support/dimensionUtils.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import{getJsonType as t,isPoint as i}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as n,convertToFeature as r,convertFromFeature as a}from"../../featureConversionUtils.js";import{initialObjectId as o,findLastObjectIdFromFeatures as u}from"../../objectIdUtils.js";import l from"../../data/FeatureStore.js";import{checkProjectionSupport as d,project as p}from"../../data/projectionSupport.js";import{QueryEngine as f}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as c,createDefaultTemplate as y,createDrawingInfo as m}from"./clientSideDefaults.js";import{queryBinsCapabilities as h,loadGeometryEngineForSimplify as g,createFeatureEditErrorResult as I,mixAttributes as b,createFeatureEditSuccessResult as F,simplify as j}from"./sourceUtils.js";import _ from"../../../support/FieldsIndex.js";import{kebabDict as q}from"../../../support/fieldType.js";import{getFieldDefaultLength as E,getFieldDefaultValue as T}from"../../../support/fieldUtils.js";import{utc as x}from"../../../../time/constants.js";const R=s,O={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:s},v={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:h};function S(e){return i(e)?null!=e.z:!!e.hasZ}function w(e){return i(e)?null!=e.m:!!e.hasM}function D(e,t){let i;const s=[];if("unique-id-composite"===t.type){const n=[];for(const i of t.fieldNames)e.attributes[i]?n.push(e.attributes[i]):s.push(i);i=0===s.length?JSON.stringify(n):null}else i=e.attributes[t.fieldName],i||s.push(t.fieldName);return{objectId:i,missingFields:s}}class Q{constructor(){this._uniqueIdInfo=null,this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(t){const i=[],{features:s}=t,n=this._inferLayerProperties(s,t.fields),r=t.fields||[],a=null!=t.hasM?t.hasM:!!n.hasM,p=null!=t.hasZ?t.hasZ:!!n.hasZ,h=!t.spatialReference&&!n.spatialReference,g=h?R:t.spatialReference||n.spatialReference,I=h?O:null,b=t.geometryType||n.geometryType,F=!b,j=t.uniqueIdInfo;let S=t.objectIdField??n.objectIdField,w=t.timeInfo;const D=new _(r);if(!F&&(h&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new e("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(j){const t=new Set(r.map(({name:e})=>e));if(!j.fields.every(e=>t.has(e))){const i=j.fields.filter(e=>!t.has(e));throw new e("feature-layer:missing-property","UniqueIdFields not set and couldn't be found in the provided fields. Fields: "+i+" are mssing.")}S=null}else if(!S)throw new e("feature-layer:missing-property","objectIdField not set and uniqueIdInfo not provided.");if(n.objectIdField&&S!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${S}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),S=n.objectIdField),S&&!n.objectIdField){const e=D.get(S);e?(S=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:S,name:S,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const o of r){if(null==o.name&&(o.name=o.alias),null==o.alias&&(o.alias=o.name),!o.name)throw new e("feature-layer:invalid-field-name","field name is missing",{field:o});if(o.name===S&&(o.type="esriFieldTypeOID"),!q.jsonValues.includes(o.type))throw new e("feature-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});null==o.length&&(o.length=E(o))}const Q={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=T(e);void 0!==t&&(Q[e.name]=t)}if(w){if(w.startTimeField){const e=D.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=D.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=D.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const A=D.dateFields.length?{timeZoneIANA:t.dateFieldsTimeZone??x}:null;this._createDefaultAttributes=c(Q,S),this._uniqueIdInfo=t.uniqueIdInfo??void 0;const M={warnings:i,featureErrors:[],layerDefinition:{...v,drawingInfo:m(b),templates:y(Q),extent:I,geometryType:b,objectIdField:S,fields:r,hasZ:p,hasM:a,timeInfo:w,dateFieldsTimeReference:A,uniqueIdInfo:this._uniqueIdInfo??void 0},assignedObjectIds:{}},C=this._uniqueIdInfo?.OIDFieldContainsHashValue?"simple"===this._uniqueIdInfo.type?{type:"unique-id-simple",fieldName:this._uniqueIdInfo.fields[0]}:{type:"unique-id-composite",fieldNames:this._uniqueIdInfo.fields}:{type:"object-id",fieldName:S};if(this._queryEngine=new f({fieldsIndex:_.fromLayerJSON({fields:r,timeInfo:w,dateFieldsTimeReference:A}),geometryType:b,hasM:a,hasZ:p,featureIdInfo:C,spatialReference:g,featureStore:new l({geometryType:b,hasM:a,hasZ:p}),timeInfo:w}),!s?.length)return this._nextObjectId=o,M;if(S){const e=u(S,s);this._nextObjectId=e+1}return await d(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([g(t,i),d(e.adds,t),d(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,i){let s,n,r=null,a=null,o=null;for(const u of e){const e=u.geometry;if(null!=e&&(r||(r=t(e)),a||(a=e.spatialReference),null==s&&(s=S(e)),null==n&&(n=w(e)),r&&a&&null!=s&&null!=n))break}if(i&&i.length){let e=null;i.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:r,spatialReference:a,objectIdField:o,hasM:n,hasZ:s}}async _loadInitialFeatures(e,i){const{geometryType:s,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l,featureIdInfo:d}=this._queryEngine,f=[];for(const n of i){if(null!=n.uid&&(e.assignedObjectIds[n.uid]=-1),n.geometry&&s!==t(n.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),r=b(l,i,n.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(i,n.attributes,!0),n.attributes=i,n.uid&&(e.assignedObjectIds[n.uid]=D(n,d).objectId),null!=n.geometry&&(n.geometry=p(n.geometry,n.geometry.spatialReference,o)),f.push(n))}u.addMany(n([],f,s,a,r,d));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push(F(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:a,featureEditResults:n}}_applyAddEdits(e,i){const{addResults:s,updateResults:r}=e,{geometryType:a,hasM:o,hasZ:u,spatialReference:l,featureStore:d,featureIdInfo:f,fieldsIndex:c}=this._queryEngine,y=[];for(const n of i){if(n.geometry&&a!==t(n.geometry)){s.push(I("Incorrect geometry type."));continue}const i=this._createDefaultAttributes(),o=b(c,i,n.attributes);if(o){s.push(o);continue}this._assignObjectId(i,n.attributes),n.attributes=i;const{objectId:u,missingFields:m}=D(n,f);if(u){if(null!=n.uid&&(e.uidToObjectId[n.uid]=u),null!=n.geometry){const e=n.geometry.spatialReference??l;n.geometry=p(j(n.geometry,e),e,l)}y.push(n);const t=F(u);d.has(u)?r.push(t):s.push(t)}else s.push(I(`Missing unique id field value for fields: ${m.join()}`))}d.addMany(n([],y,a,u,o,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:s,hasM:n,hasZ:o,spatialReference:u,featureStore:l,fieldsIndex:d,featureIdInfo:f}=this._queryEngine;for(const c of i){const{attributes:i,geometry:y}=c,{objectId:m,missingFields:h}=D(c,f);if(null==m){const t="unique-id-composite"===f.type?h:f.fieldName;e.push(I(`Identifier fields: ${t} missing`));continue}if(!l.has(m)){e.push(I(`Feature with object id ${m} missing`));continue}const g=r(l.getFeature(m),s,o,n);if(null!=y){if(s!==t(y)){e.push(I("Incorrect geometry type."));continue}const i=y.spatialReference??u;g.geometry=p(j(y,i),i,u)}if(i){const t=b(d,g.attributes,i);if(t){e.push(t);continue}}l.add(a(g,s,o,n,f)),e.push(F(m))}}_assignObjectId(e,t,i=!1){if("object-id"===this._queryEngine.featureIdInfo.type){const s=this._queryEngine.featureIdInfo.fieldName;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}}export{Q as default};
2
+ import{remove as e}from"../../../../core/arrayUtils.js";import t from"../../../../core/Error.js";import{getJsonType as i,isPoint as s}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as n}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromFeatures as r,convertToFeature as a,convertFromFeature as o}from"../../featureConversionUtils.js";import{initialObjectId as u,findLastObjectIdFromFeatures as l}from"../../objectIdUtils.js";import d from"../../data/FeatureStore.js";import{checkProjectionSupport as p,project as f}from"../../data/projectionSupport.js";import{QueryEngine as c}from"../../data/QueryEngine.js";import{createDefaultAttributesFunction as y,createDefaultTemplate as m,createDrawingInfo as h}from"./clientSideDefaults.js";import{queryBinsCapabilities as g,loadGeometryEngineForSimplify as I,createFeatureEditErrorResult as b,mixAttributes as F,createFeatureEditSuccessResult as j,simplify as _}from"./sourceUtils.js";import q from"../../../support/FieldsIndex.js";import{kebabDict as E}from"../../../support/fieldType.js";import{getFieldDefaultLength as T,getFieldDefaultValue as x}from"../../../support/fieldUtils.js";import{utc as R}from"../../../../time/constants.js";const O=n,v={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:n},S={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:g};function w(e){return s(e)?null!=e.z:!!e.hasZ}function D(e){return s(e)?null!=e.m:!!e.hasM}function Q(e,t){let i;const s=[];if("unique-id-composite"===t.type){const n=[];for(const i of t.fieldNames)e.attributes[i]?n.push(e.attributes[i]):s.push(i);i=0===s.length?JSON.stringify(n):null}else i=e.attributes[t.fieldName],i||s.push(t.fieldName);return{objectId:i,missingFields:s}}class A{constructor(){this._uniqueIdInfo=null,this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const i=[],{features:s}=e,n=this._inferLayerProperties(s,e.fields),r=e.fields||[],a=null!=e.hasM?e.hasM:!!n.hasM,o=null!=e.hasZ?e.hasZ:!!n.hasZ,f=!e.spatialReference&&!n.spatialReference,g=f?O:e.spatialReference||n.spatialReference,I=f?v:null,b=e.geometryType||n.geometryType,F=!b,j=e.uniqueIdInfo;let _=e.objectIdField??n.objectIdField,w=e.timeInfo;const D=new q(r);if(!F&&(f&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!b))throw new t("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(j){const e=new Set(r.map(({name:e})=>e));if(!j.fields.every(t=>e.has(t))){const i=j.fields.filter(t=>!e.has(t));throw new t("feature-layer:missing-property","UniqueIdFields not set and couldn't be found in the provided fields. Fields: "+i+" are mssing.")}_=null}else if(!_)throw new t("feature-layer:missing-property","objectIdField not set and uniqueIdInfo not provided.");if(n.objectIdField&&_!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${_}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),_=n.objectIdField),_&&!n.objectIdField){const e=D.get(_);e?(_=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:_,name:_,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const u of r){if(null==u.name&&(u.name=u.alias),null==u.alias&&(u.alias=u.name),!u.name)throw new t("feature-layer:invalid-field-name","field name is missing",{field:u});if(u.name===_&&(u.type="esriFieldTypeOID"),!E.jsonValues.includes(u.type))throw new t("feature-layer:invalid-field-type",`invalid type for field "${u.name}"`,{field:u});null==u.length&&(u.length=T(u))}const Q={};for(const t of r)if("esriFieldTypeOID"!==t.type&&"esriFieldTypeGlobalID"!==t.type){const e=x(t);void 0!==e&&(Q[t.name]=e)}if(w){if(w.startTimeField){const e=D.get(w.startTimeField);e?(w.startTimeField=e.name,e.type="esriFieldTypeDate"):w.startTimeField=null}if(w.endTimeField){const e=D.get(w.endTimeField);e?(w.endTimeField=e.name,e.type="esriFieldTypeDate"):w.endTimeField=null}if(w.trackIdField){const e=D.get(w.trackIdField);e?w.trackIdField=e.name:(w.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:w}}))}w.startTimeField||w.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:w}}),w=null)}const A=D.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??R}:null;this._createDefaultAttributes=y(Q,_),this._uniqueIdInfo=e.uniqueIdInfo??void 0;const M={warnings:i,featureErrors:[],layerDefinition:{...S,drawingInfo:h(b),templates:m(Q),extent:I,geometryType:b,objectIdField:_,fields:r,hasZ:o,hasM:a,timeInfo:w,dateFieldsTimeReference:A,uniqueIdInfo:this._uniqueIdInfo??void 0},assignedObjectIds:{}},C=this._uniqueIdInfo?.OIDFieldContainsHashValue?"simple"===this._uniqueIdInfo.type?{type:"unique-id-simple",fieldName:this._uniqueIdInfo.fields[0]}:{type:"unique-id-composite",fieldNames:this._uniqueIdInfo.fields}:{type:"object-id",fieldName:_};if(this._queryEngine=new c({fieldsIndex:q.fromLayerJSON({fields:r,timeInfo:w,dateFieldsTimeReference:A}),geometryType:b,hasM:a,hasZ:o,featureIdInfo:C,spatialReference:g,featureStore:new d({geometryType:b,hasM:a,hasZ:o}),timeInfo:w}),!s?.length)return this._nextObjectId=u,M;if(_){const e=l(_,s);this._nextObjectId=e+1}return await p(s,g),this._loadInitialFeatures(M,s)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([I(t,i),p(e.adds,t),p(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,t){let s,n,r=null,a=null,o=null;for(const u of e){const e=u.geometry;if(null!=e&&(r||(r=i(e)),a||(a=e.spatialReference),null==s&&(s=w(e)),null==n&&(n=D(e)),r&&a&&null!=s&&null!=n))break}if(t&&t.length){let e=null;t.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(o=e.name)}return{geometryType:r,spatialReference:a,objectIdField:o,hasM:n,hasZ:s}}async _loadInitialFeatures(e,t){const{geometryType:s,hasM:n,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l,featureIdInfo:d}=this._queryEngine,p=[];for(const r of t){if(null!=r.uid&&(e.assignedObjectIds[r.uid]=-1),r.geometry&&s!==i(r.geometry)){e.featureErrors.push(b("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),n=F(l,t,r.attributes,!0);n?e.featureErrors.push(n):(this._assignObjectId(t,r.attributes,!0),r.attributes=t,r.uid&&(e.assignedObjectIds[r.uid]=Q(r,d).objectId),null!=r.geometry&&(r.geometry=f(r.geometry,r.geometry.spatialReference,o)),p.push(r))}u.addMany(r([],p,s,a,n,d));const{fullExtent:c,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push(j(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:a,featureEditResults:n}}_applyAddEdits(t,s){const{addResults:n,updateResults:a}=t,{geometryType:o,hasM:u,hasZ:l,spatialReference:d,featureStore:p,featureIdInfo:c,fieldsIndex:y}=this._queryEngine,m=[],h=new Map;for(const r of s){if(r.geometry&&o!==i(r.geometry)){n.push(b("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),u=F(y,s,r.attributes);if(u){n.push(u);continue}this._assignObjectId(s,r.attributes),r.attributes=s;const{objectId:l,missingFields:g}=Q(r,c);if(l){if(null!=r.uid&&(t.uidToObjectId[r.uid]=l),null!=r.geometry){const e=r.geometry.spatialReference??d;r.geometry=f(_(r.geometry,e),e,d)}m.push(r);const i=j(l);h.has(l)?e(m,h.get(l)):p.has(l)?a.push(i):n.push(i),h.set(l,r)}else n.push(b(`Missing unique id field value for fields: ${g.join()}`))}p.addMany(r([],m,o,l,u,c))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:n,hasZ:r,spatialReference:u,featureStore:l,fieldsIndex:d,featureIdInfo:p}=this._queryEngine;for(const c of t){const{attributes:t,geometry:y}=c,{objectId:m,missingFields:h}=Q(c,p);if(null==m){const t="unique-id-composite"===p.type?h:p.fieldName;e.push(b(`Identifier fields: ${t} missing`));continue}if(!l.has(m)){e.push(b(`Feature with object id ${m} missing`));continue}const g=a(l.getFeature(m),s,r,n);if(null!=y){if(s!==i(y)){e.push(b("Incorrect geometry type."));continue}const t=y.spatialReference??u;g.geometry=f(_(y,t),t,u)}if(t){const i=F(d,g.attributes,t);if(i){e.push(i);continue}}l.add(o(g,s,r,n,p)),e.push(j(m))}}_assignObjectId(e,t,i=!1){if("object-id"===this._queryEngine.featureIdInfo.type){const s=this._queryEngine.featureIdInfo.fieldName;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}}export{A as default};
package/layers/types.d.ts CHANGED
@@ -33,7 +33,7 @@ import type { TimeZone } from "../time/types.js";
33
33
  * @see [Layer.type](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#type)
34
34
  * @since 5.0
35
35
  */
36
- export type LayerType = "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
36
+ export type LayerType = "annotation" | "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
37
37
 
38
38
  /**
39
39
  * Indicates how the layer should display in the [Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/) component.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",g="tofirstunit",u="tolastunit",f="status",d="associationtype",c="iscontentvisible",p="percentalong",y="globalid";return{fromNetworkSourceId:e?.get(n)?.name??n,fromGlobalId:e?.get(o)?.name??o,fromTerminalId:e?.get(i)?.name??i,fromFirstUnit:e?.get(r)?.name??r,fromLastUnit:e?.get(a)?.name??a,toNetworkSourceId:e?.get(s)?.name??s,toGlobalId:e?.get(l)?.name??l,toTerminalId:e?.get(m)?.name??m,toFirstUnit:e?.get(g)?.name??g,toLastUnit:e?.get(u)?.name??u,status:e?.get(f)?.name??f,associationType:e?.get(d)?.name??d,isContentVisible:e?.get(c)?.name??c,percentAlong:e?.get(p)?.name??p,globalId:e?.get(t?.globalIdField??y)?.name??y}}function e(t,e){if("feature"!==e.type&&"subtype-group"!==e.type&&"dimension-feature"!==e.type)return[];if(!e.url)return[];const n="utilityNetworks"in t.map?t.map.utilityNetworks??[]:[];for(const o of n)if(o.isUtilityLayer(e)){const t=e.fieldsIndex.get("assetgroup"),n=e.fieldsIndex.get("assettype");return[t?.name,n?.name].filter(t=>null!=t)}return[]}export{t as getAssociationsTableFields,e as getUtilityNetworkFields};
2
+ function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",g="tofirstunit",u="tolastunit",f="status",d="associationtype",c="iscontentvisible",p="percentalong",y="globalid";return{fromNetworkSourceId:e?.get(n)?.name??n,fromGlobalId:e?.get(o)?.name??o,fromTerminalId:e?.get(i)?.name??i,fromFirstUnit:e?.get(r)?.name??r,fromLastUnit:e?.get(a)?.name??a,toNetworkSourceId:e?.get(s)?.name??s,toGlobalId:e?.get(l)?.name??l,toTerminalId:e?.get(m)?.name??m,toFirstUnit:e?.get(g)?.name??g,toLastUnit:e?.get(u)?.name??u,status:e?.get(f)?.name??f,associationType:e?.get(d)?.name??d,isContentVisible:e?.get(c)?.name??c,percentAlong:e?.get(p)?.name??p,globalId:e?.get(t?.globalIdField??y)?.name??y}}function e(t,e){if("feature"!==e.type&&"subtype-group"!==e.type&&"dimension-feature"!==e.type&&"annotation"!==e.type)return[];if(!e.url)return[];const n="utilityNetworks"in t.map?t.map.utilityNetworks??[]:[];for(const o of n)if(o.isUtilityLayer(e)){const t=e.fieldsIndex.get("assetgroup"),n=e.fieldsIndex.get("assettype");return[t?.name,n?.name].filter(t=>null!=t)}return[]}export{t as getAssociationsTableFields,e as getUtilityNetworkFields};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.114",
3
+ "version": "5.1.0-next.115",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as r}from"tslib";import{ClonableMixin as t}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as e,subclass as s}from"../../core/accessorSupport/decorators.js";let i=class extends(t(o)){constructor(){super(...arguments),this.returnDistance=!0,this.ascendingOrder=!0}};r([e({json:{write:!0}})],i.prototype,"returnDistance",void 0),r([e({json:{write:!0}})],i.prototype,"ascendingOrder",void 0),i=r([s("esri.rest.support.OutDistance")],i);const p=i;export{p as default};
2
+ import{__decorate as t}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{enumeration as n}from"../../core/accessorSupport/decorators/enumeration.js";const c=new r({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let a=class extends(e(o)){constructor(){super(...arguments),this.returnDistance=!0,this.ascendingOrder=!0,this.outDistanceUnit=null}};t([i({json:{write:!0}})],a.prototype,"returnDistance",void 0),t([i({json:{write:!0}})],a.prototype,"ascendingOrder",void 0),t([n(c,{ignoreUnknown:!1}),i({json:{write:{isRequired:!0}}})],a.prototype,"outDistanceUnit",void 0),a=t([s("esri.rest.support.OutDistance")],a);const p=a;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as j}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as v}from"../../core/accessorSupport/decorators/enumeration.js";var w;const S=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=class extends r{static{w=this}static from(t){return a(w,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const i=t[e];Array.isArray(i)?r[e]=i.map(t=>t instanceof Date?t.getTime():t):i instanceof Date?r[e]=i.getTime():r[e]=i}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new w(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([o({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([o({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([o({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([s("datumTransformation")],R.prototype,"castDatumTransformation",null),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([o({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([o({type:m,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([o({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([o({types:d,json:{read:u,write:!0}})],R.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([o({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([o({type:Date})],R.prototype,"historicMoment",void 0),t([j("historicMoment")],R.prototype,"writeHistoricMoment",null),t([o({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([o({type:Number,cast:t=>t<1?1:t>R.MAX_MAX_RECORD_COUNT_FACTOR?R.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],R.prototype,"maxRecordCountFactor",void 0),t([o({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([o({json:{write:!0}})],R.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([o({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([o({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([o({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([j("parameterValues")],R.prototype,"writeParameterValues",null),t([o({type:l,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([o({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([o({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([o({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([o({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],R.prototype,"returnStatisticsAggregatedIds",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitGeometries",void 0),t([o({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([o({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([o({type:p,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([v(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([j("start"),j("num")],R.prototype,"writeStart",null),t([o({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([o({type:g,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([v(S,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([o({json:{write:!0}})],R.prototype,"outDistance",void 0),t([o({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([j("where")],R.prototype,"writeWhere",null),R=w=t([n("esri.rest.support.Query")],R);export{R as default};
2
+ import{__decorate as t}from"tslib";import{JSONMap as e}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as i}from"../../core/lang.js";import{property as o,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{fromJSON as u}from"../../geometry/support/jsonUtils.js";import{geometryTypes as d}from"../../geometry/support/typeUtils.js";import m from"../layerSources/DynamicDataLayer.js";import c from"./FullTextSearch.js";import y from"./OutDistance.js";import h from"./QuantizationParameters.js";import{spatialRelKebabDict as f}from"./spatialRelationships.js";import j from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as w}from"../../core/accessorSupport/decorators/enumeration.js";var S;const R=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let b=class extends r{static{S=this}static from(t){return a(S,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnStatisticsAggregatedIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnExceededLimitGeometries=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.returnTrueCurves=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.outDistance=null,this.where=null}castDatumTransformation(t){return"number"==typeof t||"object"==typeof t?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const r={};for(const e in t){const i=t[e];Array.isArray(i)?r[e]=i.map(t=>t instanceof Date?t.getTime():t):i instanceof Date?r[e]=i.getTime():r[e]=i}e.parameterValues=r}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new S(i({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:null!=this.historicMoment?new Date(this.historicMoment):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnStatisticsAggregatedIds:this.returnStatisticsAggregatedIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnExceededLimitGeometries:this.returnExceededLimitGeometries,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,returnTrueCurves:this.returnTrueCurves,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,outDistance:this.outDistance,where:this.where}))}static{this.MAX_MAX_RECORD_COUNT_FACTOR=5}};t([o({json:{write:!0}})],b.prototype,"aggregateIds",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"cacheHint",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"compactGeometryEnabled",void 0),t([o({json:{write:!0}})],b.prototype,"datumTransformation",void 0),t([s("datumTransformation")],b.prototype,"castDatumTransformation",null),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"defaultSpatialReferenceEnabled",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"distance",void 0),t([o({type:m,json:{write:!0}})],b.prototype,"dynamicDataSource",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"formatOf3DObjects",void 0),t([o({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],b.prototype,"fullText",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),t([o({types:d,json:{read:u,write:!0}})],b.prototype,"geometry",void 0),t([o({type:Number,json:{write:!0}})],b.prototype,"geometryPrecision",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"groupByFieldsForStatistics",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"having",void 0),t([o({type:Date})],b.prototype,"historicMoment",void 0),t([v("historicMoment")],b.prototype,"writeHistoricMoment",null),t([o({type:Number,json:{write:!0}})],b.prototype,"maxAllowableOffset",void 0),t([o({type:Number,cast:t=>t<1?1:t>b.MAX_MAX_RECORD_COUNT_FACTOR?b.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],b.prototype,"maxRecordCountFactor",void 0),t([o({type:["xyFootprint"],json:{write:!0}})],b.prototype,"multipatchOption",void 0),t([o({type:Number,json:{read:{source:"resultRecordCount"}}})],b.prototype,"num",void 0),t([o({json:{write:!0}})],b.prototype,"objectIds",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"orderByFields",void 0),t([o({type:[String],json:{write:!0}})],b.prototype,"outFields",void 0),t([o({type:p,json:{name:"outSR",write:!0}})],b.prototype,"outSpatialReference",void 0),t([o({type:[j],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],b.prototype,"outStatistics",void 0),t([o({json:{write:!0}})],b.prototype,"parameterValues",void 0),t([v("parameterValues")],b.prototype,"writeParameterValues",null),t([o({type:l,json:{write:!0}})],b.prototype,"pixelSize",void 0),t([o({type:h,json:{write:!0}})],b.prototype,"quantizationParameters",void 0),t([o({type:[Object],json:{write:!0}})],b.prototype,"rangeValues",void 0),t([o({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],b.prototype,"relationParameter",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"resultType",void 0),t([o({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],b.prototype,"returnStatisticsAggregatedIds",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnCentroid",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnDistinctValues",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitFeatures",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"returnExceededLimitGeometries",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnQueryGeometry",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"returnM",void 0),t([o({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],b.prototype,"returnZ",void 0),t([o({type:Boolean,json:{write:!0}})],b.prototype,"returnTrueCurves",void 0),t([o({type:p,json:{write:!0}})],b.prototype,"sourceSpatialReference",void 0),t([w(f,{ignoreUnknown:!1,name:"spatialRel"})],b.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],b.prototype,"start",void 0),t([v("start"),v("num")],b.prototype,"writeStart",null),t([o({type:String,json:{write:!0}})],b.prototype,"sqlFormat",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"text",void 0),t([o({type:g,json:{write:!0}})],b.prototype,"timeExtent",void 0),t([o({type:Boolean,json:{default:!1,write:!0}})],b.prototype,"timeReferenceUnknownClient",void 0),t([w(R,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],b.prototype,"units",void 0),t([o({type:y,json:{write:!0}})],b.prototype,"outDistance",void 0),t([o({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],b.prototype,"where",void 0),t([v("where")],b.prototype,"writeWhere",null),b=S=t([n("esri.rest.support.Query")],b);export{b as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const c=()=>s.getLogger("esri.support.basemapUtils");function f(){return{}}function l(e){for(const r in e){const s=e[r];s&&!s.destroyed&&s.destroy(),delete e[r]}}function p(r,s){let i;if("string"==typeof r){const o=r in n,a=!o&&r.includes("/");if(!o&&!a){if(t())c().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,r])=>r.classic||r.is3d).map(([e])=>`"${e}"`).sort().join(", ");c().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(i=s[r]),i||(i=o?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=i))}else i=o(e,r);return i?.destroyed&&(c().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function m(e,r=null){const s=p(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach(e=>{const r=s.find(r=>"scene"!==r.type&&i(a(e),a(r)))||e;o.includes(r)?o.push(e):o.push(r)}),o}export{p as basemapEnsureType,m as clonePreservingTiledLayers,f as createCache,l as destroyCache};
2
+ import e from"../Basemap.js";import s from"../core/Collection.js";import r from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const p=()=>r.getLogger("esri.support.basemapUtils");function f(s){let r;if("string"==typeof s){const o=s in n,i=!o&&s.includes("/");if(!o&&!i){if(t())p().warn(`Unable to find basemap definition for: ${s}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,s])=>s.classic||s.is3d).map(([e])=>`"${e}"`).sort().join(", ");p().warn(`Unable to find basemap definition for: ${s}. Try one of these: ${e}`)}return null}r=o?e.fromId(s):new e({style:{id:s}})}else r=o(e,s);return r?.destroyed&&(p().warn("The provided basemap is already destroyed",{basemap:r}),r=null),r}function l(e,s=null){const r=f(e);if(!r)return null;const o=r.clone();return s&&(o.baseLayers=c(o.baseLayers,s.baseLayers),o.referenceLayers=c(o.referenceLayers,s.referenceLayers)),o}function c(e,r){const o=new s;return e.forEach(e=>{const s=r.find(s=>"scene"!==s.type&&i(a(e),a(s)))||e;o.includes(s)?o.push(e):o.push(s)}),o}export{f as basemapEnsureType,l as clonePreservingTiledLayers};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const b="20260529",e="185565f08aebb728d6723e786706d41673f85beb";export{b as buildDate,e as commitHash};
2
+ const e="20260530",c="743991c57ed087b0dfa6bdce972e4139ef463c08";export{e as buildDate,c as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as f}from"./effects/EffectCut.js";import{EffectDashes as o}from"./effects/EffectDashes.js";import{EffectDonut as n}from"./effects/EffectDonut.js";import{EffectEnclosingPolygon as s}from"./effects/EffectEnclosingPolygon.js";import{EffectJog as i}from"./effects/EffectJog.js";import{EffectMove as a}from"./effects/EffectMove.js";import{EffectOffset as m}from"./effects/EffectOffset.js";import{EffectRadial as l}from"./effects/EffectRadial.js";import{EffectReverse as u}from"./effects/EffectReverse.js";import{EffectRotate as E}from"./effects/EffectRotate.js";import{EffectScale as p}from"./effects/EffectScale.js";import{EffectSuppress as M}from"./effects/EffectSuppress.js";import{EffectTaperedPolygon as C}from"./effects/EffectTaperedPolygon.js";import{EffectWave as j}from"./effects/EffectWave.js";import{PlacementAlongLineSameSize as P}from"./placements/PlacementAlongLineSameSize.js";import{PlacementAtExtremities as I}from"./placements/PlacementAtExtremities.js";import{PlacementAtMeasuredUnits as L}from"./placements/PlacementAtMeasuredUnits.js";import{PlacementAtRatioPositions as d}from"./placements/PlacementAtRatioPositions.js";import{PlacementInsidePolygon as G}from"./placements/PlacementInsidePolygon.js";import{PlacementOnLine as D}from"./placements/PlacementOnLine.js";import{PlacementOnVertices as g}from"./placements/PlacementOnVertices.js";import{PlacementPolygonCenter as A}from"./placements/PlacementPolygonCenter.js";import y from"../dimensions/effects/LinearDimensionArrowEffect.js";import k from"../dimensions/effects/LinearDimensionExtensionLineEffect.js";import R from"../dimensions/effects/LinearDimensionLeaderLineEffect.js";import S from"../dimensions/effects/LinearDimensionLineEffect.js";import x from"../dimensions/effects/LinearDimensionPointEffect.js";import v from"../dimensions/effects/LinearDimensionTextEffect.js";function w(P){if(!P)return null;switch(P.type){case"CIMGeometricEffectAddControlPoints":return e.local();case"CIMGeometricEffectArrow":return t.local();case"CIMGeometricEffectBuffer":return r.local();case"CIMGeometricEffectControlMeasureLine":return c.local();case"CIMGeometricEffectCut":return f.local();case"CIMGeometricEffectDashes":return o.local();case"CIMGeometricEffectDonut":return n.local();case"CIMGeometricEffectJog":return i.local();case"CIMGeometricEffectMove":return a.local();case"CIMGeometricEffectOffset":return m.local();case"CIMGeometricEffectRadial":return l.local();case"CIMGeometricEffectReverse":return u.local();case"CIMGeometricEffectRotate":return E.local();case"CIMGeometricEffectScale":return p.local();case"CIMGeometricEffectSuppress":return M.local();case"CIMGeometricEffectTaperedPolygon":return C.local();case"CIMGeometricEffectWave":return j.local();case"CIMGeometricEffectEnclosingPolygon":return s.local();case"LinearDimensionLineEffect":return S.local();case"LinearDimensionLeaderLineEffect":return R.local();case"LinearDimensionPointEffect":return x.local();case"LinearDimensionArrowEffect":return y.local();case"LinearDimensionTextEffect":return v.local();case"LinearDimensionExtensionLineEffect":return k.local()}return null}function O(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return P.local();case"CIMMarkerPlacementAtExtremities":return I.local();case"CIMMarkerPlacementAtMeasuredUnits":return L.local();case"CIMMarkerPlacementAtRatioPositions":return d.local();case"CIMMarkerPlacementInsidePolygon":return G.local();case"CIMMarkerPlacementOnLine":return D.local();case"CIMMarkerPlacementOnVertices":return g.local();case"CIMMarkerPlacementPolygonCenter":return A.local()}return null}export{w as getEffectOperator,O as getPlacementOperator};
2
+ import{EffectAddControlPoints as e}from"./effects/EffectAddControlPoints.js";import{EffectArrow as t}from"./effects/EffectArrow.js";import{EffectBuffer as r}from"./effects/EffectBuffer.js";import{EffectControlMeasureLine as c}from"./effects/EffectControlMeasureLine.js";import{EffectCut as o}from"./effects/EffectCut.js";import{EffectDashes as f}from"./effects/EffectDashes.js";import{EffectDonut as s}from"./effects/EffectDonut.js";import{EffectEnclosingPolygon as a}from"./effects/EffectEnclosingPolygon.js";import{EffectJog as n}from"./effects/EffectJog.js";import{EffectMove as l}from"./effects/EffectMove.js";import{EffectOffset as m}from"./effects/EffectOffset.js";import{EffectRadial as i}from"./effects/EffectRadial.js";import{EffectReverse as u}from"./effects/EffectReverse.js";import{EffectRotate as p}from"./effects/EffectRotate.js";import{EffectScale as E}from"./effects/EffectScale.js";import{EffectSuppress as M}from"./effects/EffectSuppress.js";import{EffectTaperedPolygon as C}from"./effects/EffectTaperedPolygon.js";import{EffectWave as P}from"./effects/EffectWave.js";import{PlacementAlongLineSameSize as j}from"./placements/PlacementAlongLineSameSize.js";import{PlacementAtExtremities as I}from"./placements/PlacementAtExtremities.js";import{PlacementAtMeasuredUnits as G}from"./placements/PlacementAtMeasuredUnits.js";import{PlacementAtRatioPositions as d}from"./placements/PlacementAtRatioPositions.js";import{PlacementInsidePolygon as g}from"./placements/PlacementInsidePolygon.js";import{PlacementOnLine as v}from"./placements/PlacementOnLine.js";import{PlacementOnVertices as y}from"./placements/PlacementOnVertices.js";import{PlacementPolygonCenter as A}from"./placements/PlacementPolygonCenter.js";import{PrivateDimensionEffect as k}from"../../views/2d/layers/support/annodime/PrivateDimensionEffect.js";import{PrivatePlacementMultipoint as R}from"../../views/2d/layers/support/annodime/PrivatePlacementMultipoint.js";function S(j){if(!j)return null;switch(j.type){case"CIMGeometricEffectAddControlPoints":return e.local();case"CIMGeometricEffectArrow":return t.local();case"CIMGeometricEffectBuffer":return r.local();case"CIMGeometricEffectControlMeasureLine":return c.local();case"CIMGeometricEffectCut":return o.local();case"CIMGeometricEffectDashes":return f.local();case"CIMGeometricEffectDonut":return s.local();case"CIMGeometricEffectJog":return n.local();case"CIMGeometricEffectMove":return l.local();case"CIMGeometricEffectOffset":return m.local();case"CIMGeometricEffectRadial":return i.local();case"CIMGeometricEffectReverse":return u.local();case"CIMGeometricEffectRotate":return p.local();case"CIMGeometricEffectScale":return E.local();case"CIMGeometricEffectSuppress":return M.local();case"CIMGeometricEffectTaperedPolygon":return C.local();case"CIMGeometricEffectWave":return P.local();case"CIMGeometricEffectEnclosingPolygon":return a.local();case"PrivateDimensionEffect":return k.local()}return null}function w(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return j.local();case"CIMMarkerPlacementAtExtremities":return I.local();case"CIMMarkerPlacementAtMeasuredUnits":return G.local();case"CIMMarkerPlacementAtRatioPositions":return d.local();case"CIMMarkerPlacementInsidePolygon":return g.local();case"CIMMarkerPlacementOnLine":return v.local();case"PrivatePlacementMultipoint":return R.local();case"CIMMarkerPlacementOnVertices":return y.local();case"CIMMarkerPlacementPolygonCenter":return A.local()}return null}export{S as getEffectOperator,w as getPlacementOperator};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import{isCurvedGeometry as l}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import m from"../Font.js";import{loadGeometryOperatorsForEffect as f,loadGeometryOperatorsForPlacement as y}from"./CIMEffects.js";import{Placement as h}from"./CIMPlacements.js";import{EnvDrawHelper as u,CanvasDrawHelper as p,lineGapType2LineHeight as S,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as d}from"./defaultCIMValues.js";import{getEffectsInflateSize as g,getNumericValue as b,fromCIMFontStyle as x,fromCIMFontDecoration as C}from"./utils.js";import{defaultPolylineSymbol2D as I}from"../support/defaults.js";import{cInfinity as k}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as w,glyphSize as P,randomInsidePolygonTextureSize as L}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as z}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as F,getLineWidth as D}from"../../views/2d/layers/graphics/graphicsUtils.js";const T=Math.PI,v=T/2,A=Math.PI/180,G=96/72,j=1.4142135623730951,E=2,R=4,B=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function X(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function V(e,t,r){switch(t.type){case"CIMSymbolReference":return V(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new h;e.drawMarker(t,r);break}}return e.envelope()}function N(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset??0);default:return 0}}class Y{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=g(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=j:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*(o.scaleX??1)/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=b(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=A*n,r=Math.cos(e),o=Math.sin(e),a=s([k,k,-k,-k]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=b(e.offsetX),m=b(e.offsetY);if(o){const e=A*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=N(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=g(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=F(t.height??d.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?S(s,i??0,o):0,l=t.horizontalAlignment??d.CIMTextSymbol.horizontalalignment,c=t.verticalAlignment??d.CIMTextSymbol.verticalalignment,m="CIMBackgroundCallout"===t.callout?.type,f=z(a.glyphMosaicItems,{scale:o/P,angle:b(t.angle),xOffset:b(t.offsetX),yOffset:b(t.offsetY),horizontalAlignment:l,verticalAlignment:c,maxLineWidth:D(t.lineWidth),lineHeight:w*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:m}).boundsT,y=Math.sqrt(f.width*f.width+f.height*f.height);return e[0]-=f.x+y,e[1]-=f.y-y,e[2]+=f.x+y,e[3]+=-f.y+y,e}}class _{static getEnvelope(e,t,r){if(!e)return null;const o=new u(r);if(Array.isArray(e)){let r;for(const a of e)r?r.union(V(o,a,t)):r=V(o,a,t);return r}return V(o,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*G;let n=null!=a?Math.max(a/i,1):1;n*=G,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,E,null,r);return[-s/o,-i/a,a/n*G]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,E,r,s);e.width=i,e.height=n;const f=e.getContext("2d",{willReadFrequently:!0}),y=M.createScale(m,-m);y.translate(.5*i-l,.5*n+c);const u=new p(f,o,y);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};u.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new h;u.drawMarker(t,e);break}}const S=f.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(i),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:W(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:W(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,keepUpright:!1,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?W(r):[0,0,0,0],capStyle:q(t),joinStyle:H(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:p,borderLineSize:S}=t;let M,d,g,x,C,I;a&&(M=a.family,d=a.style,g=a.weight,x=a.size,C=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||S)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(u)},{type:"CIMSolidStroke",enable:!0,color:W(p),width:S??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:M||"Arial",fontStyleName:J(d,g),fontType:0,haloSize:i,height:x,hinting:1,horizontalAlignment:O(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:b(y),offsetY:b(h),strikethrough:"line-through"===C,underline:"underline"===C,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:$(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",enable:!0,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:b(o),offsetY:b(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:W(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:W(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-b(e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??I.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:W(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:W(a)}));s.push({type:"CIMSolidFill",enable:!0,color:W(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(l||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??d.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||R;for(;i<R;)i*=2;const n=i/2;return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static async normalizeSymbolAndFetchResources(e,t,r=null){if(!e)return;const o=[];if("effects"in e&&e.effects)for(const s of e.effects)o.push(f(s));async function a(e){if("CIMTextSymbol"!==e.type)return;const{fontFamilyName:r,fontStyleName:o}=e;if("calcitewebcoreicons"===r?.toLowerCase())return;const{style:a,weight:s}=x(o),i=C(e),n=new m({family:r,style:a,weight:s,decoration:i});try{await t.loadFont(n)}catch{B().error(`Unsupported font ${r} in CIM symbol`)}}o.push(a(e)),U(e,e=>{if(e.effects)for(const t of e.effects)o.push(f(t));if("CIMVectorMarker"===e.type){for(const t of e.markerGraphics)l(t.geometry)&&(t.geometry=c(t.geometry,{maxDeviation:.01}));e.markerPlacement&&o.push(y(e.markerPlacement))}"url"in e&&e.url&&o.push(t.fetchResource(e.url,{signal:r})),"symbol"in e&&o.push(a(e.symbol))}),await Promise.all(o)}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:B().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(L),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,p=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+p*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function U(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&U(r,t)}}break}}}const q=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},H=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},O=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},$=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return B().error("Unexpected: style does not require rasterization"),[0,0];default:return B().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(T/t/4);0===s&&(s=1),t=v/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?W(o):[0,0,0,0],capStyle:q(r),joinStyle:H(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,Y as CIMSymbolInflatedSizeHelper,q as capTypeToEnum,U as forEachSymbolLayer,Z as slsDashToTemplateArray,X as symbolToCIM};
2
+ import{bidiText as e}from"../../core/BidiText.js";import{clone as t}from"../../core/lang.js";import r from"../../core/Logger.js";import o from"../../core/RandomLCG.js";import{px2pt as a}from"../../core/screenUtils.js";import{create as s,expandPointInPlace as i}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as n}from"../../geometry/support/boundsUtils.js";import{isCurvedGeometry as l}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as c}from"../../geometry/support/curves/densifyCurvedGeometry.js";import m from"../Font.js";import{loadGeometryOperatorsForEffect as f,loadGeometryOperatorsForPlacement as y}from"./CIMEffects.js";import{Placement as h}from"./CIMPlacements.js";import{EnvDrawHelper as u,CanvasDrawHelper as p,lineGapType2LineHeight as S,Transformation as M}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as d}from"./defaultCIMValues.js";import{getEffectsInflateSize as g,getNumericValue as b,fromCIMFontStyle as x,fromCIMFontDecoration as C}from"./utils.js";import{defaultPolylineSymbol2D as I}from"../support/defaults.js";import{cInfinity as k}from"../../views/2d/engine/vectorTiles/GeometryUtils.js";import{magicLabelLineHeight as w,glyphSize as P,randomInsidePolygonTextureSize as L}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as z}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as F,getLineWidth as D}from"../../views/2d/layers/graphics/graphicsUtils.js";const T=Math.PI,v=T/2,A=Math.PI/180,G=96/72,j=1.4142135623730951,E=2,R=4,B=()=>r.getLogger("esri.symbols.cim.CIMSymbolHelper");function X(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const r=_.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=_.fromPictureMarker(e);break;case"simple-line":t=_.fromSimpleLineSymbol(e);break;case"simple-fill":t=_.fromSimpleFillSymbol(e);break;case"picture-fill":t=_.fromPictureFillSymbol(e);break;case"text":t=_.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function V(e,t,r){switch(t.type){case"CIMSymbolReference":return V(e,t.symbol,r);case"CIMPointSymbol":null==r&&(r={x:0,y:0}),e.drawSymbol(t,r);break;case"CIMLineSymbol":null==r&&(r={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,r);break;case"CIMPolygonSymbol":null==r&&(r={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,r);break;case"CIMTextSymbol":{const r={x:0,y:0};e.drawSymbol(t,r);break}case"CIMVectorMarker":{const r=new h;e.drawMarker(t,r);break}}return e.envelope()}function N(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset??0);default:return 0}}class Y{static getSymbolInflateSize(e,t,r,o,a){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,r,o,a):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),r=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+r*r)}static _vectorMarkerBounds(e,t,r,o){let a=!0;const i=s();if(t?.markerGraphics)for(const s of t.markerGraphics){const t=[0,0,0,0];s.geometry&&(n(i,s.geometry),t[0]=0,t[1]=0,t[2]=0,t[3]=0,this.getSymbolInflateSize(t,s.symbol,r,0,o),i[0]+=t[0],i[1]+=t[1],i[2]+=t[2],i[3]+=t[3],a?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],a=!1):(e[0]=Math.min(e[0],i[0]),e[1]=Math.min(e[1],i[1]),e[2]=Math.max(e[2],i[2]),e[3]=Math.max(e[3],i[3])))}return e}static _getInflateSize(e,t,r,o,a){if(ee(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=g(t.effects);return i>0&&(s[0]-=i,s[1]-=i,s[2]+=i,s[3]+=i),s}return this._getTextInflatedSize(e,t,a)}static _getLayersInflateSize(e,t,r,o,a){let n=!0;if(!t)return e;for(const l of t){if(!l)continue;let t=[0,0,0,0];switch(l.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=l;let r=e.width;null!=r&&("Square"===e.capStyle||"Miter"===e.joinStyle?r/=j:r/=2,t[0]=-r,t[1]=-r,t[2]=r,t[3]=r);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const e=l;if("CIMVectorMarker"===l.type){const e=l;if(t=this._vectorMarkerBounds(t,e,r,a),e.frame){const r=(e.frame.xmin+e.frame.xmax)/2,o=(e.frame.ymin+e.frame.ymax)/2;if(t[0]-=r,t[1]-=o,t[2]-=r,t[3]-=o,null!=e.size){const r=e.size/(e.frame.ymax-e.frame.ymin);t[0]*=r,t[1]*=r,t[2]*=r,t[3]*=r}}}else if("CIMPictureMarker"===l.type){const o=l,a=r.getResource(o.url);let s=1;if(null!=a&&a.height&&(s=a.width/a.height),null!=e.size){const r=e.size/2,a=e.size*s*(o.scaleX??1)/2;t=[-a,-r,a,r]}}else if(null!=e.size){const r=e.size/2;t=[-r,-r,r,r]}if(e.anchorPoint){let r,o;"Absolute"===e.anchorPointUnits?(r=e.anchorPoint.x,o=e.anchorPoint.y):(r=e.anchorPoint.x*(t[2]-t[0]),o=e.anchorPoint.y*(t[3]-t[1]));const a=1.25*Math.sqrt(r*r+o*o);t[0]-=a,t[1]-=a,t[2]+=a,t[3]+=a}let n=b(e.rotation);if(e.rotateClockwise&&(n=-n),o&&(n-=o),n){const e=A*n,r=Math.cos(e),o=Math.sin(e),a=s([k,k,-k,-k]);i(a,[t[0]*r-t[1]*o,t[0]*o+t[1]*r]),i(a,[t[0]*r-t[3]*o,t[0]*o+t[3]*r]),i(a,[t[2]*r-t[1]*o,t[2]*o+t[1]*r]),i(a,[t[2]*r-t[3]*o,t[2]*o+t[3]*r]),t=a}let c=b(e.offsetX),m=b(e.offsetY);if(o){const e=A*o,t=Math.cos(e),r=Math.sin(e),a=c*r+m*t;c=c*t-m*r,m=a}t[0]+=c,t[1]+=m,t[2]+=c,t[3]+=m;const f=N(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=g(l.effects);c>0&&(t[0]-=c,t[1]-=c,t[2]+=c,t[3]+=c),n?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],n=!1):(e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[2]),e[3]=Math.max(e[3],t[3]))}return e}static _getTextInflatedSize(e,t,r){const o=F(t.height??d.CIMTextSymbol.height);if(e[0]=-o/2,e[1]=-o/2,e[2]=o/2,e[3]=o/2,!r)return e;const a=r.get(t);if(!a)return e;if(!a.glyphMosaicItems.glyphs.length)return e;const{lineGapType:s,lineGap:i}=t,n=s?S(s,i??0,o):0,l=t.horizontalAlignment??d.CIMTextSymbol.horizontalalignment,c=t.verticalAlignment??d.CIMTextSymbol.verticalalignment,m="CIMBackgroundCallout"===t.callout?.type,f=z(a.glyphMosaicItems,{scale:o/P,angle:b(t.angle),xOffset:b(t.offsetX),yOffset:b(t.offsetY),horizontalAlignment:l,verticalAlignment:c,maxLineWidth:D(t.lineWidth),lineHeight:w*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:m}).boundsT,y=Math.sqrt(f.width*f.width+f.height*f.height);return e[0]-=f.x+y,e[1]-=f.y-y,e[2]+=f.x+y,e[3]+=-f.y+y,e}}class _{static getEnvelope(e,t,r,o){if(!e)return null;const a=new u(r,o);if(Array.isArray(e)){let r;for(const o of e)r?r.union(V(a,o,t)):r=V(a,o,t);return r}return V(a,e,t)}static getTextureInfo(e,t,r,o,a){const s=o??this.getEnvelope(e,null,t);if(!s)return[0,0,0,0,1];const i=Math.max(s.width,s.height)*G;let n=null!=a?Math.max(a/i,1):1;n*=G,s.x*=n,s.y*=n,s.width*=n,s.height*=n,s.width=Math.max(Math.ceil(s.x+s.width)-Math.floor(s.x),1)-1,s.height=Math.max(Math.ceil(s.y+s.height)-Math.floor(s.y),1)-1;let l=s.x+.5*s.width,c=s.y+.5*s.height;return l+=s.x-Math.floor(s.x),c+=s.y-Math.floor(s.y),o||(s.width+=r,s.height+=r,l+=r/2,c+=r/2),[s.width,s.height,l,c,n]}static getTextureAnchor(e,t,r){const[o,a,s,i,n]=this.getTextureInfo(e,t,E,null,r);return[-s/o,-i/a,a/n*G]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,E,r,s);e.width=i,e.height=n;const f=e.getContext("2d",{willReadFrequently:!0}),y=M.createScale(m,-m);y.translate(.5*i-l,.5*n+c);const u=new p(f,o,y);switch(t.type){case"CIMPointSymbol":{const e={type:"point",x:0,y:0};u.drawSymbol(t,e);break}case"CIMVectorMarker":{const e=new h;u.drawMarker(t,e);break}}const S=f.getImageData(0,0,e.width,e.height),d=new Uint8Array(S.data);if(a){let e;for(let t=0;t<d.length;t+=4)e=d[t+3]/255,d[t]=d[t]*e,d[t+1]=d[t+1]*e,d[t+2]=d[t+2]*e}return[d,e.width,e.height,-l/i,-c/n]}static fromTextSymbol(e){const{text:t}=e;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:_.createCIMTextSymbolfromTextSymbol(e),textString:t}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(e){const{height:t,outline:r,width:o,xoffset:a,xscale:s,yoffset:i,yscale:n}=e,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(r){const e=oe(r);e&&l.push(e)}let m=e.url;"esriPFS"===e.type&&e.imageData&&(m=e.imageData);const f="angle"in e?e.angle??0:0,y=(o??0)*(s||1),h=(t??0)*(n||1);return l.push({type:"CIMPictureFill",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:m,height:h,width:y,offsetX:b(a),offsetY:b(i),rotation:b(-f),colorSubstitutions:null}),c}static fromSimpleFillSymbol(e){const{color:r,style:o,outline:s}=e,i=[],n={type:"CIMPolygonSymbol",symbolLayers:i};if(s){const e=oe(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:W(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(re(o)?8:10);switch(o){case"vertical":case"esriSFSVertical":s=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":s=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":s=45;break;case"cross":case"esriSFSCross":s=0}i.push({type:"CIMHatchFill",lineSymbol:e,offsetX:0,offsetY:0,rotation:s,separation:n}),"cross"===o||"esriSFSCross"===o?i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==o&&"esriSFSDiagonalCross"!==o||i.push({type:"CIMHatchFill",lineSymbol:t(e),offsetX:0,offsetY:0,rotation:45,separation:n})}else!o||"solid"!==o&&"esriSFSSolid"!==o||i.push({type:"CIMSolidFill",enable:!0,color:W(r)});return n}static fromSimpleLineSymbol(e){const{cap:t,color:r,join:o,marker:a,miterLimit:s,style:i,width:n}=e;let l=null;"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(a){let e;switch(a.placement){case"begin-end":e="Both";break;case"begin":e="JustBegin";break;case"end":e="JustEnd";break;default:e="None"}const t=_.fromSimpleMarker(a,n,r).symbolLayers[0];t.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,keepUpright:!1,offset:0,extremityPlacement:e,offsetAlongLine:0},c.push(t)}return c.push({type:"CIMSolidStroke",color:"none"!==i&&"esriSLSNull"!==i?W(r):[0,0,0,0],capStyle:q(t),joinStyle:H(o),miterLimit:s,width:n,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e;let i=e.url;return"esriPMS"===e.type&&e.imageData&&(i=e.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:r,color:o,font:a,haloColor:s,haloSize:i,horizontalAlignment:n,kerning:l,lineWidth:c,text:m,verticalAlignment:f,xoffset:y,yoffset:h,backgroundColor:u,borderLineColor:p,borderLineSize:S}=t;let M,d,g,x,C,I;a&&(M=a.family,d=a.style,g=a.weight,x=a.size,C=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||S)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(u)},{type:"CIMSolidStroke",enable:!0,color:W(p),width:S??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:M||"Arial",fontStyleName:J(d,g),fontType:0,haloSize:i,height:x,hinting:1,horizontalAlignment:O(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:b(y),offsetY:b(h),strikethrough:"line-through"===C,underline:"underline"===C,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:W(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:$(f??"baseline"),verticalGlyphOrientation:0,wordSpacing:100,billboardMode3D:2,callout:I}}static createPictureMarkerRasterizationParam(e){const{angle:t,height:r,width:o,xoffset:a,yoffset:s}=e,i=e.url??e.source?.url??e.source?.imageData;return i?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",enable:!0,invertBackfaceTexture:!1,scaleX:1,textureFilter:"Picture",tintColor:null,url:i,size:r,width:o,offsetX:b(a),offsetY:b(s),rotation:b(-t)}}:null}static createPictureFillRasterizationParam(e){const{width:t,height:r,xoffset:o,yoffset:a,url:s}=e;return s?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",enable:!0,scaleX:1,textureFilter:"Picture",tintColor:null,url:s,width:t,height:r,offsetX:b(o),offsetY:b(a),rotation:0}}:null}static fromSimpleMarker(e,t,r){const{style:o}=e,a=e.color??r;if("path"===o||"esriSMSPath"===o){const t=[];if("outline"in e&&e.outline){const r=e.outline;t.push({type:"CIMSolidStroke",enable:!0,width:r.width,color:W(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:W(a),path:e.path});const[r,o]=te("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-b(e.angle),size:b(e.size||6),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:r,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:{type:"CIMPolygonSymbol",symbolLayers:t}}]}]}}const s=[];let i,n,l=e.size;if("outline"in e&&e.outline&&"none"!==e.outline.style&&"esriSLSNull"!==e.outline.style){const t=e.outline,r="solid"!==t.style&&"esriSLSSolid"!==t.style;[i,n]=r?te(o,e.size):te(o);const a=t.width??I.width;if(r){const t=a/e.size,r=(i.xmax-i.xmin)*t/2,o=(i.ymax-i.ymin)*t/2;i.xmin-=r,i.xmax+=r,i.ymin-=o,i.ymax+=o,l&&(l+=a)}const c="cross"!==e.style&&"x"!==e.style||"dot"===e?.outline.style||"short-dot"===e?.outline.style?"HalfGap":"FullPattern",m=r?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Z(t.style,null).map(e=>t.width&&t.width>0?e*t.width:e),lineDashEnding:c,controlPointEnding:"FullPattern"}]:void 0;s.push({type:"CIMSolidStroke",capStyle:r?"Round":"Butt",enable:!0,width:a,color:W(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=te(o):([i,n]=te(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:W(a)}));s.push({type:"CIMSolidFill",enable:!0,color:W(a)});const c={type:"CIMPolygonSymbol",symbolLayers:s};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:b(-e.angle),size:b(l||6*t),offsetX:b(e.xoffset),offsetY:b(e.yoffset),scaleSymbolsProportionally:!1,frame:i,markerGraphics:[{type:"CIMMarkerGraphic",geometry:n,symbol:c}]}]}}static fromCIMHatchFill(e,r){const o=r*(e.separation??d.CIMHatchFill.separation),a=o/2,s=t(e.lineSymbol);s.symbolLayers?.forEach(e=>{switch(e.type){case"CIMSolidStroke":null!=e.width&&(e.width*=r),e.effects?.forEach(e=>{if("CIMGeometricEffectDashes"===e.type){const t=e.dashTemplate;e.dashTemplate=t?.map(e=>e*r)}});break;case"CIMVectorMarker":{null!=e.size&&(e.size*=r);const t=e.markerPlacement;null!=t&&"placementTemplate"in t&&(t.placementTemplate=t.placementTemplate.map(e=>e*r));break}}});let i=this._getLineSymbolPeriod(s)||R;for(;i<R;)i*=2;const n=i/2;return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-n,xmax:n,ymin:-a,ymax:a},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-n,0],[n,0]]]},symbol:s}],size:o}}static async normalizeSymbolAndFetchResources(e,t,r=null){if(!e)return;const o=[];if("effects"in e&&e.effects)for(const s of e.effects)o.push(f(s));async function a(e){if("CIMTextSymbol"!==e.type)return;const{fontFamilyName:r,fontStyleName:o}=e;if("calcitewebcoreicons"===r?.toLowerCase())return;const{style:a,weight:s}=x(o),i=C(e),n=new m({family:r,style:a,weight:s,decoration:i});try{await t.loadFont(n)}catch{B().error(`Unsupported font ${r} in CIM symbol`)}}o.push(a(e)),U(e,e=>{if(e.effects)for(const t of e.effects)o.push(f(t));if("CIMVectorMarker"===e.type){for(const t of e.markerGraphics)l(t.geometry)&&(t.geometry=c(t.geometry,{maxDeviation:.01}));e.markerPlacement&&o.push(y(e.markerPlacement))}"url"in e&&e.url&&o.push(t.fetchResource(e.url,{signal:r})),"symbol"in e&&o.push(a(e.symbol))}),await Promise.all(o)}static _getLineSymbolPeriod(e){if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;if(e.symbolLayers)for(const r of e.symbolLayers)if(r){const e=this._getEffectsRepeat(r.effects);if(e)return e;switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const e=this._getPlacementRepeat(r.markerPlacement);if(e)return e}}}}return 0}static _getEffectsRepeat(e){if(e)for(const t of e)if(t)switch(t.type){case"CIMGeometricEffectDashes":{const e=t.dashTemplate;if(e&&e.length){let t=0;for(const r of e)t+=r;return 1&e.length&&(t*=2),t}break}case"CIMGeometricEffectWave":return t.period;default:B().error(`unsupported geometric effect type ${t.type}`)}return 0}static _getPlacementRepeat(e){if(e)switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const t=e.placementTemplate;if(t&&t.length){let e=0;for(const r of t)e+=+r;return 1&t.length&&(e*=2),e}break}}return 0}static fromCIMInsidePolygon(e){const t=e.markerPlacement,r={...e};r.markerPlacement=null,r.anchorPoint=null;const s=Math.abs(t.stepX),i=Math.abs(t.stepY),n=(t.randomness??100)/100;let l,c,m,f;if("Random"===t.gridType){const e=a(L),r=Math.max(Math.floor(e/s),1),y=Math.max(Math.floor(e/i),1);l=r*s/2,c=y*i/2,m=2*c;const h=new o(t.seed),u=n*s/1.5,p=n*i/1.5;f=[];for(let t=0;t<r;t++)for(let e=0;e<y;e++){const r=t*s-l+u*(.5-h.getFloat()),o=e*i-c+p*(.5-h.getFloat());f.push({x:r,y:o}),0===t&&f.push({x:r+2*l,y:o}),0===e&&f.push({x:r,y:o+2*c})}}else!0===t.shiftOddRows?(l=s/2,c=i,m=2*i,f=[{x:-l,y:0},{x:l,y:0},{x:0,y:c},{x:0,y:-c}]):(l=s/2,c=i/2,m=i,f=[{x:-s,y:0},{x:0,y:-i},{x:-s,y:-i},{x:0,y:0},{x:s,y:0},{x:0,y:i},{x:s,y:i},{x:-s,y:i},{x:s,y:-i}]);return{type:"CIMVectorMarker",enable:!0,frame:{xmin:-l,xmax:l,ymin:-c,ymax:c},markerGraphics:f.map(e=>({type:"CIMMarkerGraphic",geometry:e,symbol:{type:"CIMPointSymbol",symbolLayers:[r]}})),size:m}}}function U(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const r=e.symbolLayers;if(!r)return;for(const e of r)if(t(e),"CIMVectorMarker"===e.type){const r=e.markerGraphics;if(!r)continue;for(const e of r)if(e){const r=e.symbol;r&&U(r,t)}}break}}}const q=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},H=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},O=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center";case"justify":return"Justify"}},$=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},J=(e,t)=>{const r=K(t),o=Q(e);return r&&o?`${r}-${o}`:`${r}${o}`},K=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Q=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Z=(e,t)=>{const r=.001,o="butt"===t;switch(e){case"dash":case"esriSLSDash":return o?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return o?[4,3,1,3]:[3,4,r,4];case"dot":case"esriSLSDot":return o?[1,3]:[r,4];case"long-dash":case"esriSLSLongDash":return o?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return o?[8,3,1,3]:[7,4,r,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return o?[8,3,1,3,1,3]:[7,4,r,4,r,4];case"short-dash":case"esriSLSShortDash":return o?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return o?[4,1,1,1]:[3,2,r,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return o?[4,1,1,1,1,1]:[3,2,r,2,r,2];case"short-dot":case"esriSLSShortDot":return o?[1,1]:[r,2];case"solid":case"esriSLSSolid":case"none":return B().error("Unexpected: style does not require rasterization"),[0,0];default:return B().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function ee(e){return void 0!==e.symbolLayers}const te=(e,t=100)=>{const r=t/2;let o,a;const s=e;if("circle"===s||"esriSMSCircle"===s){const e=.25;let t=Math.acos(1-e/r),s=Math.ceil(T/t/4);0===s&&(s=1),t=v/s,s*=4;const i=[];i.push([r,0]);for(let o=1;o<s;o++)i.push([r*Math.cos(o*t),-r*Math.sin(o*t)]);i.push([r,0]),o={rings:[i]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("cross"===s||"esriSMSCross"===s){const e=0;o={paths:[[[e,r],[e,-r]],[[r,e],[-r,e]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r}}else if("diamond"===s||"esriSMSDiamond"===s)o={rings:[[[-r,0],[0,r],[r,0],[0,-r],[-r,0]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("square"===s||"esriSMSSquare"===s)o={rings:[[[-r,-r],[-r,r],[r,r],[r,-r],[-r,-r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("x"===s||"esriSMSX"===s)o={paths:[[[r,r],[-r,-r]],[[r,-r],[-r,r]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r};else if("triangle"===s||"esriSMSTriangle"===s){const e=t*.5773502691896257,r=-e,s=2/3*t,i=s-t;o={rings:[[[r,i],[0,s],[e,i],[r,i]]]},a={xmin:r,ymin:i,xmax:e,ymax:s}}else"arrow"===s&&(o={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},a={xmin:-r,ymin:-r,xmax:r,ymax:r});return[a,o]},re=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function oe(e){if(!e)return null;let t=null;const{cap:r,color:o,join:a,miterLimit:s,style:i,width:n}=e;return"solid"!==i&&"none"!==i&&"esriSLSSolid"!==i&&"esriSLSNull"!==i&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Z(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?W(o):[0,0,0,0],capStyle:q(r),joinStyle:H(a),miterLimit:s,width:n,effects:t}}export{_ as CIMSymbolHelper,Y as CIMSymbolInflatedSizeHelper,q as capTypeToEnum,U as forEachSymbolLayer,Z as slsDashToTemplateArray,X as symbolToCIM};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function a(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function l(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,a(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,a(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,a]=i;if(null!=t&&""!==t)a?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const a of t){const[t,n,l]=a;if(null!=t&&""!==t)l?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const a=e.attributes[t];null!=a&&""!==a&&(null!=i&&(o+=i,i=null),o+=a)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,a=!0){const l=t/o,c=r/i,s=Math.ceil(l/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(a?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*l,a=o*o;for(let c=Math.floor(r*l);c<(r+1)*l;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function S(e){return new g(e)}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function E(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function G(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=G(t);if(null!=e)return e}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidFill":return e.color}return null}function x(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=x(e);if(null!=t)return t}break}case"CIMTextSymbol":return x(e.symbol);case"CIMSolidStroke":return e.color}}function T(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=A(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function N(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function z(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const F=e=>e.includes("data:image/svg+xml");function V(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function B(e,t,r,n,o,i,a=!0){const{infos:l}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of l){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||a)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>R(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function D(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function j(e){return e.split(" ").map(e=>Number(e))}function q(e){return"string"==typeof e?j(e):e}function W(e){return e?.dashTemplate&&(e.dashTemplate=q(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(le(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=D(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const a=e[t.primitiveName];if(null!=a){const e=a[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){if(!e)return 3;switch(e){case"Begin":return 0;case"End":return 2;case"Both":return 1;default:return 3}}function oe(e){if(!e)return 2;switch(e){case"Tolerance":return 0;case"Text":return 1;default:return 2}}function ie(e){if(!e)return 2;switch(e){case"MoveBegin":return 0;case"MoveEnd":return 1;default:return 2}}function ae(e){if(!e)return 3;switch(e){case"Only":return 0;case"Suffix":return 1;case"Expression":return 2;default:return 3}}function le(e){return null!=e&&"inflateSize"in e&&null!=e.inflateSize}function ce(e){return null!=e&&se(e)?e:void 0}function se(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,l as analyzeTextParts,B as applyParentTransform,ce as asCIMGeometryCursor,s as assignTextValuesFromFeature,z as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,E as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,N as fromCIMVerticalAlignment,D as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,G as getFillColor,P as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,x as getStrokeColor,A as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,T as hasStrokeLayer,S as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,le as isGeometricLinearEffect,F as isSVGImage,R as isValidCIMValue,V as mapCIMSymbolToGeometryType,M as normalizeAlpha,W as normalizeDashEffectTemplate,q as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,j as parseDashTemplate,f as resampleHermite,oe as stringToDimensionMarkerFit,ne as stringToDimensionPartOptions,ie as stringToDimensionTextFit,ae as stringToDimensionTextOptions,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
2
+ import{defaultCIMValues as e,defaultCIMColor as t}from"./defaultCIMValues.js";function r(e){return"function"==typeof e}function n(e,t,n,o){return r(e)?e(t,n,o):e}function o(e){return[e.r,e.g,e.b,e.a]}const i=" /-,\n";function a(e){let t=e.length;for(;t--;)if(!i.includes(e.charAt(t)))return!1;return!0}function l(e,t){const r=[];let n=0,o=-1;do{if(o=e.indexOf("[",n),o>=n){if(o>n){const t=e.slice(n,o);r.push([t,null,a(t)])}if(n=o+1,o=e.indexOf("]",n),o>=n){if(o>n){const i=t[e.slice(n,o)];i&&r.push([null,i,!1])}n=o+1}}}while(-1!==o);if(n<e.length){const t=e.slice(n);r.push([t,null,a(t)])}return r}function c(e,t,r){let n="",o=null;for(const i of t){const[t,r,a]=i;if(null!=t&&""!==t)a?o=t:(null!=o&&(n+=o,o=null),n+=t);else{const t=e.readAttribute(r);null!=t&&""!==t&&(null!==o&&(n+=o,o=null),n+=t)}}return u(n,r)}function s(e,t,r,n){let o="",i=null;for(const a of t){const[t,n,l]=a;if(null!=t&&""!==t)l?i=t:(null!=i&&(o+=i,i=null),o+=t);else{let t=n;null!=r&&(t=Y(n,r));const a=e.attributes[t];null!=a&&""!==a&&(null!=i&&(o+=i,i=null),o+=a)}}return u(o,n)}function u(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function f(e,t,r,n,o,i,a=!0){const l=t/o,c=r/i,s=Math.ceil(l/2),u=Math.ceil(c/2);for(let f=0;f<i;f++)for(let r=0;r<o;r++){const M=4*(r+(a?i-f-1:f)*o);let m=0,y=0,C=0,h=0,I=0,p=0,b=0;const d=(f+.5)*c;for(let n=Math.floor(f*c);n<(f+1)*c;n++){const o=Math.abs(d-(n+.5))/u,i=(r+.5)*l,a=o*o;for(let c=Math.floor(r*l);c<(r+1)*l;c++){let r=Math.abs(i-(c+.5))/s;const o=Math.sqrt(a+r*r);o>=-1&&o<=1&&(m=2*o*o*o-3*o*o+1,m>0&&(r=4*(c+n*t),b+=m*e[r+3],C+=m,e[r+3]<255&&(m=m*e[r+3]/250),h+=m*e[r],I+=m*e[r+1],p+=m*e[r+2],y+=m))}}n[M]=h/y,n[M+1]=I/y,n[M+2]=p/y,n[M+3]=b/C}}function M(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function m(e){return e.data?.symbol??null}function y(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function C(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function h(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function I(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const p=(e,t=0)=>null==e||isNaN(e)?t:e,b=(e,t)=>null!=e?e:t,d=(e,t)=>e??t,k=e=>e.tintColor?M(e.tintColor):[255,255,255,1];class g{constructor(e){this._import=e}getImportPromise(){return null==this._promise&&(this._promise=this._import().then(e=>this.module=e)),this._promise}}function S(e){return new g(e)}function P(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function w(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function L(e){let t="normal",r="normal";if(e){const n=e.toLowerCase();n.includes("italic")?t="italic":n.includes("oblique")&&(t="oblique"),n.includes("bold")?r="bold":n.includes("light")&&(r="lighter")}return{style:t,weight:r}}function E(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function x(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=x(t);if(null!=e)return e}break;case"CIMTextSymbol":return x(e.symbol);case"CIMSolidFill":return e.color}return null}function G(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const e of t){const t=G(e);if(null!=t)return t}break}case"CIMTextSymbol":return G(e.symbol);case"CIMSolidStroke":return e.color}}function N(e){for(const t of e)if(t.enable)switch(t.type){case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return!0}return!1}function T(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const e=T(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return T(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function v(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function A(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function F(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}const z=e=>e.includes("data:image/svg+xml");function B(e){if(!e)return null;switch(e.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function O(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}function V(e,t,r,n,o,i,a=!0){const{infos:l}=i;let c=1,s=0,u=0,f=0,M=1;for(const{absoluteAnchorPoint:C,offsetX:h,offsetY:I,rotation:p,size:b,frameHeight:d,rotateClockWise:k,scaleSymbolsProportionally:g}of l){M=C?1:c;u=Q(h,I,s,M,u),f=K(h,I,s,M,f),d&&(g||a)&&(c*=b/d),s=Z(p,k,s)}const m=Q(n,o,s,M,u),y=K(n,o,s,M,f);return{size:e*c,rotation:Z(t,r,s),offsetX:m,offsetY:y}}function R(e){if(null==e)return!1;if(Array.isArray(e))return e.every(e=>R(e));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function D(r,n){if("color"===n||"outlinecolor"===n||"backgroundcolor"===n||"borderlinecolor"===n||"tintcolor"===n)return[...t[n]];const o=e[r];if(!o)throw new Error(`InternalError: default value for type ${r}.`);return o[n]}function W(e){return e.split(" ").map(e=>Number(e))}function j(e){return"string"==typeof e?W(e):e}function q(e){return e?.dashTemplate&&(e.dashTemplate=j(e.dashTemplate)),e}function _(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const e of t)if("CIMVectorMarker"===e.type)return _(e)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const e of t)if(e.symbol)return _(e.symbol)}}return"Normal"}function X(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t);break}}return r}case"CIMLineSymbol":case"CIMPolygonSymbol":{let r=0;if(t.symbolLayers)for(const n of t.symbolLayers)if(n)switch(n.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const e=n.width;null!=e&&e>r&&(r=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(n.markerPlacement&&I(n.markerPlacement)){const t=n.size??e.CIMVectorMarker.size;t>r&&(r=t)}break;case"CIMPictureFill":{const e=n.height;null!=e&&e>r&&(r=e)}}return r}}}function Y(e,t){if(null!==t){const r=t.get(e);return r?r.name:e}return e}function H(e){return e.map(e=>({...e,propertyName:O(e.propertyName)}))}function J(e){const t={};for(const r in e){const n=e[r];t[O(r)]=n}return t}function U(e){if(!e)return 0;let t=0;for(const r of e)t+=$(r);return t}function $(e){if(!e)return 0;if(le(e))return e.inflateSize??256;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(p(e.offsetX)),Math.abs(p(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function K(e,t,r,n,o){const i=r*Math.PI/180;if(i){const r=Math.cos(i);return(Math.sin(i)*e+r*t)*n+o}return t*n+o}function Q(e,t,r,n,o){const i=r*Math.PI/180;if(i){return(Math.cos(i)*e-Math.sin(i)*t)*n+o}return e*n+o}function Z(e,t,r){return t?r-e:r+e}function ee(e,t,r){const n="Color"===r||"TintColor"===r||"ToColor"===r,o="Rotation"===r||"Angle"===r||"ToRotation"===r;let i=t[O(r)];if(null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180)),null==i&&(i=D(t.type,r.toLowerCase()),null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]]:o&&(i*=Math.PI/180))),null!=t.primitiveName){const a=e[t.primitiveName];if(null!=a){const e=a[r];null==e||("string"==typeof e||"number"==typeof e||Array.isArray(e)?(i=e,null!=i&&(n?i=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]:o&&(i*=Math.PI/180))):(i={valueExpressionInfo:e,defaultValue:i},null!=i&&(n?i={type:"Process",op:"ArcadeColor",value:i}:o&&(i={type:"Process",op:"Divide",left:i,right:180/Math.PI}))))}}if(null==i)throw new Error(`Failed to derive a value or an expression for "${r}".`);return i}function te(e,t,r){if(null!=t[O(r)])return!0;if(null!=t.primitiveName){const n=e[t.primitiveName];if(null!=n){if(null!=n[r])return!0}}return!1}function re(e,t){return Math.max(Math.min((e??t)/100,1),0)}function ne(e){if(!e)return"None";switch(e){case"Begin":return"Begin";case"End":return"End";case"Both":return"Both";default:return"None"}}function oe(e){if(!e)return"None";switch(e){case"Tolerance":return"Tolerance";case"Text":return"Text";default:return"None"}}function ie(e){if(!e)return"None";switch(e){case"MoveBegin":return"MoveBegin";case"MoveEnd":return"MoveEnd";default:return"None"}}function ae(e){if(!e)return"None";switch(e){case"Only":return"Only";case"Suffix":return"Suffix";case"Expression":return"Expression";default:return"None"}}function le(e){return e.type.startsWith("PRI")}function ce(e){return null!=e&&se(e)?e:void 0}function se(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}export{u as adjustTextCase,l as analyzeTextParts,V as applyParentTransform,ce as asCIMGeometryCursor,s as assignTextValuesFromFeature,F as attributesToFields,o as colorToArray,n as evaluateValueOrFunction,E as fromCIMFontDecoration,L as fromCIMFontStyle,v as fromCIMHorizontalAlignment,A as fromCIMVerticalAlignment,D as getDefaultCIMValue,U as getEffectsInflateSize,d as getEnum,Y as getFieldName,x as getFillColor,P as getFontStyle,w as getFontWeight,p as getNumericValue,ee as getProcessParam,re as getRelativeGradientSize,X as getSize,G as getStrokeColor,T as getStrokeWidth,_ as getTextCasing,c as getTextValuesFromFeatureHandle,k as getTintColor,b as getValue,te as hasProcessParam,N as hasStrokeLayer,S as importLazily,h as isCIMFill,y as isCIMMarker,I as isCIMMarkerStrokePlacement,C as isCIMStroke,r as isFeatureValueFn,le as isPrivateEffect,z as isSVGImage,R as isValidCIMValue,B as mapCIMSymbolToGeometryType,M as normalizeAlpha,q as normalizeDashEffectTemplate,j as normalizeDashTemplate,H as normalizePrimitiveOverrideProps,W as parseDashTemplate,f as resampleHermite,oe as stringToDimensionMarkerFit,ne as stringToDimensionPartOptions,ie as stringToDimensionTextFit,ae as stringToDimensionTextOptions,m as toCIMSymbolJSON,J as toLowerCaseProps,O as uncapitalize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{AMeshFactory as e}from"./MeshFactory.js";import{createMatcher as t}from"../../util/createMatcher.js";class s extends e{static async create(e,o){const r=await t(e,o.symbology),c=o.labels?await t(e,o.labels):null;return new s(r,c)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,s,o){const r=this._symbology.match(t,s,o);if(r){for(const o of r)o.enqueueRequest(e,t,s);if(this._labels){const r=this._labels.match(t,s,o);if(!r)return;for(const o of r)o.enqueueRequest(e,t,s)}}}write(e,t,s,o,r,c,a){const n=this._symbology.match(s,o,r);if(!n)return;for(const i of n)i.write(e,t,s,o,c);if(e.entityRecordCount()>=1&&this._labels){const i=this._labels.match(s,o,r);if(!i)return;for(const r of i)r.setReferences(n),r.write(e,t,s,o,c,a)}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}hasArcadeDependency(e){return!(!this._symbology.hasArcadeDependency(e)&&!this._labels?.hasArcadeDependency(e))}}export{s as FeatureMeshFactory};
2
+ import{AMeshFactory as e}from"./MeshFactory.js";import{createMatcher as s}from"../../util/createMatcher.js";class t extends e{static async create(e,o){const r=await s(e,o.symbology),c=o.labels?await s(e,o.labels):null;return new t(r,c)}constructor(e,s){super(),this._symbology=e,this._labels=s}destroy(){}async enqueueMatcherRequests(e,s,t,o){await Promise.all([this._symbology.fetchResources(e,s,t,o),this._labels?.fetchResources(e,s,t,o)])}enqueueWriterRequests(e,s,t,o){const r=this._symbology.match(s,t,o);if(r){for(const o of r)o.enqueueRequest(e,s,t);if(this._labels){const r=this._labels.match(s,t,o);if(!r)return;for(const o of r)o.enqueueRequest(e,s,t)}}}write(e,s,t,o,r,c,a,i){const l=null!=i?i/o.$view.scale:void 0,n=this._symbology.match(t,o,r);if(!n)return;for(const y of n)y.write(e,s,t,o,c,a,l,this._symbology);this._symbology.cleanup(s,t,e.id,o,r);if(e.entityRecordCount()>=1&&this._labels){const i=this._labels.match(t,o,r);if(!i)return;for(const r of i)r.setReferences(n),r.write(e,s,t,o,c,a,l)}}getSortKey(e,s){return this._symbology.getSortKey(e,s)}hasArcadeDependency(e){return!(!this._symbology.hasArcadeDependency(e)&&!this._labels?.hasArcadeDependency(e))}}export{t as FeatureMeshFactory};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{cyrb53 as e}from"../../../../../../core/string.js";import{discardUrlIfHasUrlHash as t}from"../../urlUtils.js";import{AResourceProxy as r}from"../../shaderGraph/techniques/mesh/AResourceProxy.js";class s extends r{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingRequests=new Map,this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(r){const s=t(r.resource),o=e(JSON.stringify(s));return this._pendingRequests.has(o)||this._pendingRequests.set(o,r),o}async fetchEnqueuedResources(){const e=Array.from(this._pendingRequests.entries()),t=e.map(e=>e[1]);if(0===t.length)return;const r=await this._fetcher.fetch(t,this._abortOptions);for(let s=0;s<r.length;s++){const t=e[s][0];this._resourceIdToResource.set(t,r[s])}this._pendingRequests.clear()}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}getResource(e){return this._resourceIdToResource.get(e)}}export{s as ResourceProxy};
2
+ import{cyrb53 as e}from"../../../../../../core/string.js";import{discardUrlIfHasUrlHash as t}from"../../urlUtils.js";import{AResourceProxy as r}from"../../shaderGraph/techniques/mesh/AResourceProxy.js";class s extends r{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingRequests=new Map,this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(r){const s=t(r.resource),o=e(JSON.stringify(s));return this._pendingRequests.has(o)||this._pendingRequests.set(o,r),o}async fetchEnqueuedResources(){const e=Array.from(this._pendingRequests.entries()),t=e.map(e=>e[1]);if(0===t.length)return;const r=await this._fetcher.fetch(t,this._abortOptions);for(let s=0;s<r.length;s++){const t=e[s][0];this._resourceIdToResource.set(t,r[s])}this._pendingRequests.clear()}async fetchResourceImmediate(e){const t=await this._fetcher.fetch([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch resources");return t[0]}async fetchDictionaryResourceImmediate(e){const t=await this._fetcher.fetchDictionary([e]);if(1!==t.length)throw new Error("FeaturePipelineResourceProxy: failed to fetch dictionary resources");return t[0]}async fetchMeshResourceImmediate(e){const t=await this._fetcher.fetchMesh([e]),[r]=t;if(!r)throw new Error("FeaturePipelineResourceProxy: failed to fetch mesh resources");return r}getResource(e){return this._resourceIdToResource.get(e)}}export{s as ResourceProxy};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{fromRotation as t,multiply as e,translate as i,rotate as s}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import d from"../../collisions/BoundingBox.js";const l=22,g=4,m=l+g,u=l-6,x=Math.PI/180,p=8,_=1.5;class y{constructor(t,e,i,s){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=i,f=o.rect;this.width=0===a?h.width:f.width*s,this.height=0===a?h.height:f.height*s,this.x=s*(t+r.xOffset+h.left),this.y=s*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:i,y:s,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[i,s],f),topRight:o([0,0],[i+h,s],f),bottomLeft:o([0,0],[i,s+r],f),bottomRight:o([0,0],[i+h,s+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,i=1/0,s=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),i=Math.min(i,c),s=Math.max(s,f),n=Math.max(n,c);const o=s-e,h=n-i,r=e+o/2,a=i+h/2;this._bounds=new d(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const b=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function w(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,i,s){this._rotation=0,this._decorate(t,e,i,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==i.angle,this._transform=this._createGlyphTransform(this.bounds,i),this._borderLineSizePx=i.borderLineSizePx,(i.borderLineSizePx||i.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(i){if(0===i&&0===this._rotation)return;this._rotation=i;const s=this._transform,o=t(n(),i);e(s,o,s);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,i,s){if(!i.decoration||"none"===i.decoration||!t.length)return;const n=i.scale,o="underline"===i.decoration?s?.baseline??m:s?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,i=r.startY*n,s=(r.width+r.glyphWidthEnd)*n;t.push(new y(e,i+o*n,b(s,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,i=(_+e)/2,s=this._borderLineSizePx?i:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:l}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],y=w([[g[0]-i,g[1]-i],[m[0]+i,m[1]-i],[g[0]+s,g[1]+s],[m[0]-s,m[1]+s]],t),b=w([[u[0]+s,u[1]-s],[x[0]-s,x[1]-s],[u[0]-i,u[1]+i],[x[0]+i,x[1]+i]],t),M=w([[g[0]-i,g[1]-i],[g[0]+s,g[1]+s],[u[0]-i,u[1]+i],[u[0]+s,u[1]-s]],t),L=w([[m[0]-s,m[1]+s],[m[0]+i,m[1]-i],[x[0]-s,x[1]-s],[x[0]+i,x[1]+i]],t),A={main:w([g,m,u,x],t),top:y,bot:b,left:M,right:L};return[new d(a,f,c+2*i,l+2*i),A]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const i=Math.max(t.width,t.height);return new d(e[0],e[1],i,i)}return new d(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,s=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),i=Math.min(i,r.offsets.topLeft[1]),s=Math.max(s,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=s-e,h=n-i;return new d(e+o/2,i+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return i(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?s(a,a,o):(i(a,a,h(f,t.x,t.y)),s(a,a,o),i(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,i,s,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=s,this.yMin=n,this.yMax=o}}const A=t=>10===t,R=t=>32===t;function v(t,e,i){const s=new Array,n=1/i.scale,o=i.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,d=0,l=f,g=l,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:i,shaping:n}=t[f],r=Math.abs(i.top);if(A(e)||R(e)||(u=Math.min(u,r),x=Math.max(x,r+i.height)),A(e))f!==h&&(s.push(new L(t,l,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,l=f+a,g=f+a,d=0;else if(R(e))g=f+a,d=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==l){const e=g-2*a;c-=m,s.push(new L(t,l,e,c-d,u,x)),u=1/0,x=0,l=g,c=d}else s.push(new L(t,l,f-a,c,u,x)),u=1/0,x=0,l=f,g=f,c=0;c+=n.xAdvance,d+=n.xAdvance}else c+=n.xAdvance,d+=n.xAdvance;f+=a}const p=new L(t,l,f-a,c,u,x);return p.start>=0&&p.end<t.length&&s.push(p),s}function B(t,e){let i=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];i=Math.max(e,i)}const s="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+s-n,width:i}}function T(t,e,i){let s=0;for(let n=e;n<i;n++)R(t[n].code)&&!A(t[n+1].code)&&s++;return s}function j(t,e){const i=e.scale,s=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,d=v(h,r,e),g=d.length?B(d,e):{y:0,height:0,width:0},m=c?r?1:-1:a(e.horizontalAlignment),u=f(e.verticalAlignment),x=2===u?1:0,p=x?0:u-1,_=o?.baseline??l,b=d.length>1,w=x?b?-g.y-g.height:-_:-g.y+p*(g.height/2);for(let a=0;a<d.length;a++){const{start:o,end:r,width:f}=d[a],l=c&&a<d.length-1?T(h,o,r):0,u=l>0?(g.width-f)/l:0;let x=-1*(m+1)*((u>0?g.width:f)/2)-n;const p=(t.isRightToLeft?d.length-1-a:a)*e.lineHeight+w-n;d[a].startX=x,d[a].startY=p;for(let t=o;t<=r;t++){const e=h[t];if(A(e.code))continue;const n=new y(x,p,e,i);x+=e.shaping.xAdvance,u>0&&R(e.code)&&(x+=u),s.push(n)}}return new M(s,d,e,o)}export{y as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs};
2
+ import{fromRotation as t,multiply as e,translate as s,rotate as i}from"../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as o,set as h}from"../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{getXAnchorDirection as a,getYAnchorDirection as f}from"../../alignmentUtils.js";import c from"../../Rect.js";import l from"../../collisions/BoundingBox.js";const d=22,g=4,m=d+g,u=d-6,x=Math.PI/180,p=8,_=1.5;class w{constructor(t,e,s,i){this._rotationT=n(),this._transform=n(),this._angle=0,this._bounds=null;const{mosaicItem:o,rect:h,shaping:r,code:a}=s,f=o.rect;this.width=0===a?h.width:f.width*i,this.height=0===a?h.height:f.height*i,this.x=i*(t+r.xOffset+h.left),this.y=i*(e+r.yOffset-h.top),this.textureBinding=o.textureBinding,this.texcoords={topLeft:[f.x,f.y],topRight:[f.x+f.width,f.y],bottomLeft:[f.x,f.y+f.height],bottomRight:[f.x+f.width,f.y+f.height]}}set angle(e){this._angle=e,t(this._rotationT,-e),this._offsets=this._bounds=null}get angle(){return this._angle}get offsets(){if(!this._offsets){const{x:s,y:i,width:h,height:r}=this,a=t(n(),-this.angle),f=e(n(),a,this._transform);this._offsets={topLeft:o([0,0],[s,i],f),topRight:o([0,0],[s+h,i],f),bottomLeft:o([0,0],[s,i+r],f),bottomRight:o([0,0],[s+h,i+r],f)}}return this._offsets}get bounds(){if(this.width<=0)return null;if(!this._bounds){const t=this.offsets;let e=1/0,s=1/0,i=-1/0,n=-1/0;for(const[f,c]of[t.topLeft,t.topRight,t.bottomLeft,t.bottomRight])e=Math.min(e,f),s=Math.min(s,c),i=Math.max(i,f),n=Math.max(n,c);const o=i-e,h=n-s,r=e+o/2,a=s+h/2;this._bounds=new l(r,a,o,h)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}}const y=(t,e)=>({code:0,mosaicItem:{rect:new c(0,0,11,8),sdf:!0,page:0,textureBinding:e},rect:{height:4,width:t,left:0,top:0},shaping:{xOffset:0,yOffset:0,xAdvance:0,yAdvance:0}});function b(t,e){return t.forEach(t=>o(t,t,e)),{topLeft:t[0],topRight:t[1],bottomLeft:t[2],bottomRight:t[3]}}class M{constructor(t,e,s,i){this._rotation=0,this._decorate(t,e,s,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const n of t)n.setTransform(this._transform)}setRotation(s){if(0===s&&0===this._rotation)return;this._rotation=s;const i=this._transform,o=t(n(),s);e(i,o,i);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s,i){if(!s.decoration||"none"===s.decoration||!t.length)return;const n=s.scale,o="underline"===s.decoration?i?.baseline??m:i?.midline??u,h=t[0].textureBinding;for(const r of e){const e=r.startX*n,s=r.startY*n,i=(r.width+r.glyphWidthEnd)*n;t.push(new w(e,s+o*n,y(i,h),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(_+e)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:h,ymax:r,x:a,y:f,width:c,height:d}=this.bounds,g=[n-p,o-p],m=[h+p,o-p],u=[n-p,r+p],x=[h+p,r+p],w=b([[g[0]-s,g[1]-s],[m[0]+s,m[1]-s],[g[0]+i,g[1]+i],[m[0]-i,m[1]+i]],t),y=b([[u[0]+i,u[1]-i],[x[0]-i,x[1]-i],[u[0]-s,u[1]+s],[x[0]+s,x[1]+s]],t),M=b([[g[0]-s,g[1]-s],[g[0]+i,g[1]+i],[u[0]-s,u[1]+s],[u[0]+i,u[1]-i]],t),L=b([[m[0]-i,m[1]+i],[m[0]+s,m[1]-s],[x[0]-i,x[1]-i],[x[0]+s,x[1]+s]],t),A={main:b([g,m,u,x],t),top:w,bot:y,left:M,right:L};return[new l(a,f,c+2*s,d+2*s),A]}get boundsT(){const t=this.bounds,e=h(r(),t.x,t.y);if(o(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new l(e[0],e[1],s,s)}return new l(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const r of t)e=Math.min(e,r.offsets.topLeft[0]),s=Math.min(s,r.offsets.topLeft[1]),i=Math.max(i,r.offsets.bottomRight[0]),n=Math.max(n,r.offsets.bottomRight[1]);const o=i-e,h=n-s;return new l(e+o/2,s+h/2,o,h)}_createGlyphTransform(t,e){const o=x*e.angle,a=n(),f=r();return s(a,a,h(f,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?i(a,a,o):(s(a,a,h(f,t.x,t.y)),i(a,a,o),s(a,a,h(f,-t.x,-t.y))),a}}class L{constructor(t,e,s,i,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].rect.width),this.width=i,this.yMin=n,this.yMax=o}}const A=t=>10===t,R=t=>32===t;function v(t,e,s){const i=new Array,n=1/s.scale,o=s.maxLineWidth*n,h=e?t.length-1:0,r=e?-1:t.length,a=e?-1:1;let f=h,c=0,l=0,d=f,g=d,m=0,u=1/0,x=0;for(;f!==r;){const{code:e,rect:s,shaping:n}=t[f],r=Math.abs(s.top);if(A(e)||R(e)||(u=Math.min(u,r),x=Math.max(x,r+s.height)),A(e))f!==h&&(i.push(new L(t,d,f-a,c,u===1/0?0:u,x)),u=1/0,x=0),c=0,d=f+a,g=f+a,l=0;else if(R(e))g=f+a,l=0,m=n.xAdvance,c+=n.xAdvance;else if(c>o){if(g!==d){const e=g-2*a;c-=m,i.push(new L(t,d,e,c-l,u,x)),u=1/0,x=0,d=g,c=l}else i.push(new L(t,d,f-a,c,u,x)),u=1/0,x=0,d=f,g=f,c=0;c+=n.xAdvance,l+=n.xAdvance}else c+=n.xAdvance,l+=n.xAdvance;f+=a}const p=new L(t,d,f-a,c,u,x);return p.start>=0&&p.end<t.length&&i.push(p),i}function B(t,e){let s=0;for(let o=0;o<t.length;o++){const{width:e}=t[o];s=Math.max(e,s)}const i="underline"===e.decoration?g:0,n=t[0].yMin;return{x:0,y:n,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-n,width:s}}function T(t,e,s){let i=0;for(let n=e;n<s;n++)R(t[n].code)&&!A(t[n+1].code)&&i++;return i}function j(t,e){const s=e.scale,i=new Array,n=t.sdfPadding,{faceInfo:o,glyphs:h,isRightToLeft:r}=t,c="justify"===e.horizontalAlignment||"Justify"===e.horizontalAlignment,l=v(h,r,e),g=l.length?B(l,e):{y:0,height:0,width:0},m=c?r?1:-1:a(e.horizontalAlignment),u=f(e.verticalAlignment),x=2===u?1:0,p=x?0:u-1,_=o?.baseline??d,y=l.length>1,b=x?y?-g.y-g.height:-_:-g.y+p*(g.height/2);for(let a=0;a<l.length;a++){const{start:o,end:r,width:f}=l[a],d=c&&a<l.length-1?T(h,o,r):0,u=d>0?(g.width-f)/d:0;let x=-1*(m+1)*((u>0?g.width:f)/2)-n;const p=(t.isRightToLeft?l.length-1-a:a)*e.lineHeight+b-n;l[a].startX=x,l[a].startY=p;for(let t=o;t<=r;t++){const e=h[t];if(A(e.code))continue;const n=new w(x,p,e,s);x+=e.shaping.xAdvance,u>0&&R(e.code)&&(x+=u),i.push(n)}}return new M(i,l,e,o)}function z(t,e){const s=e.scale,{faceInfo:i,glyphs:n}=t,o=n.map(t=>new w(0,0,t,s));return new M(o,[],e,i)}export{w as ShapedGlyph,M as ShapingInfo,j as shapeGlyphs,z as shapeGlyphsForMultipoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../../../../geometry/SpatialReference.js";import{getJsonType as t}from"../../../../../../geometry/support/jsonTypeUtils.js";import r from"../../../../../../layers/support/FieldsIndex.js";import{MeshData as o}from"../../mesh/MeshData.js";import{createMeshWriter as s}from"./createMeshWriter.js";import{AResourceProxy as n}from"./mesh/AResourceProxy.js";import{ComputedAttributeStorage as a}from"../../../../layers/features/support/ComputedAttributeStorage.js";import{FeatureMetadata as m}from"../../../../layers/features/support/FeatureMetadata.js";import{FeatureSetReaderJSON as i}from"../../../../layers/features/support/FeatureSetReaderJSON.js";async function u(n){const u=new o("0.0.0.0"),d=new p,l={},c={fields:new r,spatialReference:e.WebMercator},f={$view:{scale:0,timeZone:null,timeProperties:{currentStart:null,currentEnd:null}}},h=new a(c);for(const e of n){const r=await s(h,d,l,e.instanceId,e.meshParams,e.meshWriterClass);e.feature.displayId=e.feature.attributes.objectId;const o=i.fromFeatures([e.feature],m.minimal(t(e.feature.geometry),"objectId",[]));o.next(),u.entityStart(o.getDisplayId(),0),r.write(u,d,o,f,0),u.entityEnd()}return u.serialize().message}class p extends n{fetchDictionaryResourceImmediate(e){throw new Error("Method not implemented.")}fetchResourceImmediate(e){throw new Error("Method not implemented.")}enqueueRequest(e){throw new Error("Method not implemented.")}fetchEnqueuedResources(){throw new Error("Method not implemented.")}getResource(e){throw new Error("Method not implemented.")}}export{u as createTestMeshData};
2
+ import e from"../../../../../../geometry/SpatialReference.js";import{getJsonType as t}from"../../../../../../geometry/support/jsonTypeUtils.js";import r from"../../../../../../layers/support/FieldsIndex.js";import{MeshData as o}from"../../mesh/MeshData.js";import{createMeshWriter as s}from"./createMeshWriter.js";import{AResourceProxy as n}from"./mesh/AResourceProxy.js";import{ComputedAttributeStorage as m}from"../../../../layers/features/support/ComputedAttributeStorage.js";import{FeatureMetadata as a}from"../../../../layers/features/support/FeatureMetadata.js";import{FeatureSetReaderJSON as i}from"../../../../layers/features/support/FeatureSetReaderJSON.js";async function u(n){const u=new o("0.0.0.0"),d=new p,l={},c={fields:new r,spatialReference:e.WebMercator},f={$view:{scale:0,timeZone:null,timeProperties:{currentStart:null,currentEnd:null}}},h=new m(c);for(const e of n){const r=await s(h,d,l,e.instanceId,e.meshParams,e.meshWriterClass);e.feature.displayId=e.feature.attributes.objectId;const o=i.fromFeatures([e.feature],a.minimal(t(e.feature.geometry),"objectId",[]));o.next(),u.entityStart(o.getDisplayId(),0),r.write(u,d,o,f,0,null),u.entityEnd()}return u.serialize().message}class p extends n{fetchMeshResourceImmediate(e){throw new Error("Method not implemented.")}fetchDictionaryResourceImmediate(e){throw new Error("Method not implemented.")}fetchResourceImmediate(e){throw new Error("Method not implemented.")}enqueueRequest(e){throw new Error("Method not implemented.")}fetchEnqueuedResources(){throw new Error("Method not implemented.")}getResource(e){throw new Error("Method not implemented.")}}export{u as createTestMeshData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{getMetersPerUnitForSR as t}from"../../../../../../core/units.js";import{maxRepresentableInt as e,tileSize as i}from"../../definitions.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},n={color:{write:[!0,!0,!0,!0],blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32776,blendMode:"custom"},depth:!1,stencil:!1},s={...o,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function r({pixelRatio:e,state:i,displayLevel:o,requiredLevel:n},s){const r=1/2**(o-s.key.level),l=1/2**(n-s.key.level);return{displayMat3:i.displayMat3,displayViewMat3:i.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:i.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:r,requiredZoomFactor:l,tileOffset:[s.x,s.y],currentScale:i.scale,currentZoom:o,metersPerSRUnit:t(i.spatialReference),rotation:i.rotation,pixelRatio:e}}function l(t){return"highlight"===t.passOptions?.type}function a(t){return"hittest"===t.passOptions?.type}function c(t){if(!a(t))return null;const{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:s}}function u(t){if(!l(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function p(t,e,i){const o={};for(const n in i)"function"!=typeof i[n]?o[n]=i[n]:o[n]=i[n](t,e);return o}function f(t,e){return{storage:t.attributeView.getUniforms(),view:r(t,e),hittestRequest:c(t),highlight:u(t)}}function d(t){return t.attributeView.getTextures(t.context)}function m(t){return{storageTextures:d(t)}}function h(t){return{inside:2===t.selection,outside:3===t.selection}}function y(t){return a(t)?n:l(t)&&"clear"===t.passOptions.stepType?s:o}function M(t){const{row:o,col:n}=t.key,s=n*i,r=o*i;return{tileOffsetFromLocalOrigin:[s%e,r%e],maxIntsToLocalOrigin:[Math.floor(s/e),Math.floor(r/e)]}}export{y as getFeaturePipelineState,d as getFeatureStorageTextures,m as getFeatureTextures,f as getFeatureUniforms,M as getLocalTileOffset,h as getSelectionDefines,r as getViewUniforms,l as isHighlight,a as isHittest,p as resolveDynamicUniforms};
2
+ import{getMetersPerUnitForSR as t}from"../../../../../../core/units.js";import{maxRepresentableInt as e,tileSize as i}from"../../definitions.js";const o={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7681}}}},n={color:{write:[!0,!0,!0,!0],blendParameters:{srcRGB:1,dstRGB:1,srcAlpha:1,dstAlpha:1},blendEquation:32776,blendMode:"custom"},depth:!1,stencil:!1},r={...o,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function s({pixelRatio:e,state:i,displayLevel:o,requiredLevel:n,referenceScale:r},s){const l=1/2**(o-s.key.level),a=1/2**(n-s.key.level),c=null!=r?r/i.scale:1;return{displayMat3:i.displayMat3,displayViewMat3:i.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:i.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:l,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:i.scale,currentZoom:o,metersPerSRUnit:t(i.spatialReference),rotation:i.rotation,pixelRatio:e,scaleFactor:c}}function l(t){return"highlight"===t.passOptions?.type}function a(t){return"hittest"===t.passOptions?.type}function c(t){if(!a(t))return null;const{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:r}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:o,smallSymbolSizeThreshold:n,tlbr:r}}function u(t){if(!l(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function p(t,e,i){const o={};for(const n in i)"function"!=typeof i[n]?o[n]=i[n]:o[n]=i[n](t,e);return o}function f(t,e){return{storage:t.attributeView.getUniforms(),view:s(t,e),hittestRequest:c(t),highlight:u(t)}}function d(t){return t.attributeView.getTextures(t.context)}function m(t){return{storageTextures:d(t)}}function h(t){return{inside:2===t.selection,outside:3===t.selection}}function y(t){return a(t)?n:l(t)&&"clear"===t.passOptions.stepType?r:o}function M(t){const{row:o,col:n}=t.key,r=n*i,s=o*i;return{tileOffsetFromLocalOrigin:[r%e,s%e],maxIntsToLocalOrigin:[Math.floor(r/e),Math.floor(s/e)]}}export{y as getFeaturePipelineState,d as getFeatureStorageTextures,m as getFeatureTextures,f as getFeatureUniforms,M as getLocalTileOffset,h as getSelectionDefines,s as getViewUniforms,l as isHighlight,a as isHittest,p as resolveDynamicUniforms};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as r,input as l,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec3 as p,min as n,max as u,Float as d,Mat3 as m,Vec4 as y,ifElse as h,lessThan as c,greaterThan as x,equal as v,texture2D as V,clamp as f,abs as w,mix as S,distance as b,Vec2 as g,negate as C,step as M,Sampler2D as z}from"../../graph/glsl.js";import{MarkerConstants as _}from"./markerConstants.js";import{AFeatureShader as R,FeatureVertexInput as j,FeatureFragmentInput as U}from"../shaders/AFeatureShader.js";import{c256ToRad as N,noHit as T,trueHit as D,softEdgeRatio as q}from"../shaders/constants.js";import{isRectHittest as F,hittestScreenRect as O,distPointTriangle as k,xyToBarycentric as A,inTriangle as P,failHittest as I}from"../shaders/hittestUtils.js";import{MosaicInfo as H}from"../shaders/MosaicInfo.js";import{getBit as G,getBitBool as L,rgba2float as B}from"../shaders/utils.js";import{VisualVariableColor as E}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as J}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as K}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as Q}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as X}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as Y}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as Z,getVisualVariableColor as $,getVisualVariableSize as tt,getVisualVariableRotation as et}from"../shaders/vvUtils.js";class it extends j{}t([i(3,y)],it.prototype,"color",void 0),t([i(4,y)],it.prototype,"outlineColor",void 0),t([i(5,g)],it.prototype,"offset",void 0),t([i(6,g)],it.prototype,"textureUV",void 0),t([i(7,y)],it.prototype,"sizing",void 0),t([i(8,d)],it.prototype,"placementAngle",void 0),t([i(9,d)],it.prototype,"sdfDecodeCoeff",void 0),t([i(10,g)],it.prototype,"zoomRange",void 0);class ot extends a{}t([i(11,g)],ot.prototype,"offsetNextVertex1",void 0),t([i(12,g)],ot.prototype,"offsetNextVertex2",void 0),t([i(13,g)],ot.prototype,"textureUVNextVertex1",void 0),t([i(14,g)],ot.prototype,"textureUVNextVertex2",void 0);class st extends U{}function rt(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function lt(t){return t.multiply(t).divide(128)}class at extends R{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=lt(t.sizing.x),o=lt(t.sizing.y),s=lt(t.sizing.z),r=t.placementAngle,l=G(t.bitset,_.bitset.isSDF),a=G(t.bitset,_.bitset.isMapAligned),h=G(t.bitset,_.bitset.scaleSymbolsProportionally),c=L(t.bitset,_.bitset.colorLocked),x=Z(this,t.id),v=$(this,t.id,t.color,c).multiply(x),V=this.view.displayViewScreenMat3.multiply(new p(t.pos.xy,1)),f=tt(this,t.id,s).divide(s),w=i.multiply(f),S=t.offset.xy.multiply(f);let b=o.multiply(h.multiply(f.subtract(1)).add(1));b=n(b,u(w.subtract(.99),new d(0)));const g=u(b,new d(1)),C=n(b,new d(1)),M=m.fromRotation(r.multiply(N)),z=et(this,t.id),R=this._getViewRotationMatrix(a).multiply(z).multiply(M).multiply(new p(S.xy,0)),j=this.clip(t.id,t.zoomRange),U=new y(V.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),q=G(t.bitset,_.bitset.overrideOutlineColor),F=t.sdfDecodeCoeff.multiply(w);return{glPosition:U,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:F,isSDF:l,overrideOutlineColor:q,...this.maybeRunHittest(t,e,{pos:t.pos,size:w,sizeCorrection:f,isMapAligned:a,vvRotationMat3:z,placementMat3:M,outlineSize:g,distanceToPx:F,isSDF:l})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=F(this.hittestRequest);return h(l,()=>{const{tlbr:t}=this.hittestRequest;return O(o,s,r,t)},()=>{const o=h(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return h(x(o,this.hittestRequest.distance),new d(T),new d(D))})}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return h(v(e.isSDF,new d(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return V(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=V(this.mosaicTexture,t),o=new d(.5).subtract(B(i)).multiply(e.distanceToPx).multiply(q),s=f(new d(.5).subtract(o),new d(0),new d(1)),r=e.color.multiply(s);let l=e.outlineSize;this.highlight&&(l=u(l,e.overrideOutlineColor.multiply(4)));const a=l.multiply(.5),p=w(o).subtract(a),n=f(new d(.5).subtract(p),new d(0),new d(1)),m=S(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new d(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:r}=this.hittestRequest,l=s.subtract(r),{viewMat3:a,tileMat3:n}=this.view,u=a.multiply(n).multiply(new p(i.pos,1)).xy,d=i.size.multiply(.5);return b(u,o).subtract(d).add(l)}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:r}=this.computeHittestTriangle(t,e,i),l=this.hittestRequest.position,a=this.hittestRequest.distance,p=k(l,o,s,r);return h(x(p,a),p,this._hittestSamples(o,s,r,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:r}=i,l=new p(t.offset.multiply(s),0),a=new p(e.offsetNextVertex1.multiply(s),0),n=new p(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new p(o,1)),y=this._getViewScreenMatrix(r).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:m.add(y.multiply(l)).xy,pos1:m.add(y.multiply(a)).xy,pos2:m.add(y.multiply(n)).xy}}_hittestSamples(t,e,i,o,s,r){const{outlineSize:l,isSDF:a,distanceToPx:p}=r,n=this.hittestRequest.position,u=this.hittestRequest.distance,m=A(n.add(new g(C(u),C(u))),t,e,i),h=A(n.add(new g(0,C(u))),t,e,i),c=A(n.add(new g(u,C(u))),t,e,i),x=A(n.add(new g(C(u),0)),t,e,i),v=A(n,t,e,i),V=A(n.add(new g(u,0)),t,e,i),f=A(n.add(new g(C(u),u)),t,e,i),w=A(n.add(new g(0,u)),t,e,i),S=A(n.add(new g(u,u)),t,e,i),b=o.textureUV.divide(this.mosaicInfo.size),z=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),R={color:new y(1),outlineColor:new y(1),overrideOutlineColor:new d(1),outlineSize:l,distanceToPx:p,isSDF:a};let j=new d(0);return j=j.add(P(m).multiply(this._getColor(rt(m,b,z,_),R).a)),j=j.add(P(h).multiply(this._getColor(rt(h,b,z,_),R).a)),j=j.add(P(c).multiply(this._getColor(rt(c,b,z,_),R).a)),j=j.add(P(x).multiply(this._getColor(rt(x,b,z,_),R).a)),j=j.add(P(v).multiply(this._getColor(rt(v,b,z,_),R).a)),j=j.add(P(V).multiply(this._getColor(rt(V,b,z,_),R).a)),j=j.add(P(f).multiply(this._getColor(rt(f,b,z,_),R).a)),j=j.add(P(w).multiply(this._getColor(rt(w,b,z,_),R).a)),j=j.add(P(S).multiply(this._getColor(rt(S,b,z,_),R).a)),M(j,new d(.05)).multiply(I(this.hittestRequest))}}t([o(E)],at.prototype,"visualVariableColor",void 0),t([o(J)],at.prototype,"visualVariableOpacity",void 0),t([o(K)],at.prototype,"visualVariableRotation",void 0),t([o(Q)],at.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(W)],at.prototype,"visualVariableSizeScaleStops",void 0),t([o(X)],at.prototype,"visualVariableSizeStops",void 0),t([o(Y)],at.prototype,"visualVariableSizeUnitValue",void 0),t([s(H)],at.prototype,"mosaicInfo",void 0),t([r(z)],at.prototype,"mosaicTexture",void 0),t([e(0,l(it)),e(1,l(ot))],at.prototype,"vertex",null),t([e(0,l(st))],at.prototype,"fragment",null);export{st as MarkerFragmentInput,at as MarkerShader,it as MarkerVertexInput};
2
+ import{__decorate as t,__param as e}from"tslib";import{location as i,option as o,uniform as s,texture as l,input as r,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec3 as p,min as n,max as u,Float as d,Mat3 as m,Vec4 as y,ifElse as h,lessThan as c,greaterThan as x,equal as v,texture2D as w,clamp as V,abs as f,mix as S,distance as b,Vec2 as g,negate as C,step as M,Sampler2D as z}from"../../graph/glsl.js";import{MarkerConstants as _}from"./markerConstants.js";import{AFeatureShader as R,FeatureVertexInput as j,FeatureFragmentInput as U}from"../shaders/AFeatureShader.js";import{c256ToRad as N,noHit as T,trueHit as D,softEdgeRatio as F}from"../shaders/constants.js";import{isRectHittest as q,hittestScreenRect as O,distPointTriangle as k,xyToBarycentric as A,inTriangle as P,failHittest as I}from"../shaders/hittestUtils.js";import{MosaicInfo as H}from"../shaders/MosaicInfo.js";import{getBit as G,getBitBool as L,rgba2float as B}from"../shaders/utils.js";import{VisualVariableColor as E}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as J}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as K}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as Q}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as W}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as X}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as Y}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as Z,getVisualVariableColor as $,getVisualVariableSize as tt,getVisualVariableRotation as et}from"../shaders/vvUtils.js";class it extends j{}t([i(3,y)],it.prototype,"color",void 0),t([i(4,y)],it.prototype,"outlineColor",void 0),t([i(5,g)],it.prototype,"offset",void 0),t([i(6,g)],it.prototype,"textureUV",void 0),t([i(7,y)],it.prototype,"sizing",void 0),t([i(8,d)],it.prototype,"placementAngle",void 0),t([i(9,d)],it.prototype,"sdfDecodeCoeff",void 0),t([i(10,g)],it.prototype,"zoomRange",void 0);class ot extends a{}t([i(11,g)],ot.prototype,"offsetNextVertex1",void 0),t([i(12,g)],ot.prototype,"offsetNextVertex2",void 0),t([i(13,g)],ot.prototype,"textureUVNextVertex1",void 0),t([i(14,g)],ot.prototype,"textureUVNextVertex2",void 0);class st extends U{}function lt(t,e,i,o){return e.multiply(t.x).add(i.multiply(t.y)).add(o.multiply(t.z))}function rt(t){return t.multiply(t).divide(128)}class at extends R{constructor(){super(...arguments),this.type="MarkerShader",this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,e){const i=rt(t.sizing.x),o=rt(t.sizing.y),s=rt(t.sizing.z),l=t.placementAngle,r=G(t.bitset,_.bitset.isSDF),a=G(t.bitset,_.bitset.isMapAligned),h=G(t.bitset,_.bitset.scaleSymbolsProportionally),c=L(t.bitset,_.bitset.colorLocked),x=Z(this,t.id),v=$(this,t.id,t.color,c).multiply(x),w=this.view.displayViewScreenMat3.multiply(new p(t.pos.xy,1)),V=tt(this,t.id,s).divide(s),f=i.multiply(V),S=t.offset.xy.multiply(V);let b=o.multiply(h.multiply(V.subtract(1)).add(1));b=n(b,u(f.subtract(.99),new d(0)));const g=u(b,new d(1)),C=n(b,new d(1)),M=m.fromRotation(l.multiply(N)),z=et(this,t.id),R=this._getViewRotationMatrix(a).multiply(z).multiply(M).multiply(new p(S.xy,0)).multiply(this.view.scaleFactor),j=this.clip(t.id,t.zoomRange),U=new y(w.xy.add(R.xy),j,1),T=t.textureUV.divide(this.mosaicInfo.size),D=t.outlineColor.multiply(C),F=G(t.bitset,_.bitset.overrideOutlineColor),q=t.sdfDecodeCoeff.multiply(f);return{glPosition:U,color:v,textureUV:T,outlineColor:D,outlineSize:g,distanceToPx:q,isSDF:r,overrideOutlineColor:F,...this.maybeRunHittest(t,e,{pos:t.pos,size:f,sizeCorrection:V,isMapAligned:a,vvRotationMat3:z,placementMat3:M,outlineSize:g,distanceToPx:q,isSDF:r})}}fragment(t){const e=this._getColor(t.textureUV,t);return this.getFragmentOutput(e,t)}hittest(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=q(this.hittestRequest);return h(r,()=>{const{tlbr:t}=this.hittestRequest;return O(o,s,l,t)},()=>{const o=h(c(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,e,i),this._hittestMarker(t,e,i));return h(x(o,this.hittestRequest.distance),new d(T),new d(D))})}_getViewRotationMatrix(t){const e=this.view.displayViewMat3,i=this.view.displayMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getViewScreenMatrix(t){const e=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,o=new d(1).subtract(t);return e.multiply(t).add(i.multiply(o))}_getColor(t,e){return h(v(e.isSDF,new d(1)),this._getSDFColor(t,e),this._getSpriteColor(t,e))}_getSpriteColor(t,e){return w(this.mosaicTexture,t).multiply(e.color)}_getSDFColor(t,e){const i=w(this.mosaicTexture,t),o=new d(.5).subtract(B(i)).multiply(e.distanceToPx).multiply(F),s=V(new d(.5).subtract(o),new d(0),new d(1)),l=e.color.multiply(s);let r=e.outlineSize;this.highlight&&(r=u(r,e.overrideOutlineColor.multiply(4)));const a=r.multiply(.5),p=f(o).subtract(a),n=V(new d(.5).subtract(p),new d(0),new d(1)),m=S(e.outlineColor,e.color,e.overrideOutlineColor).multiply(n);return new d(1).subtract(m.a).multiply(l).add(m)}_hittestSmallMarker(t,e,i){const{position:o,distance:s,smallSymbolDistance:l}=this.hittestRequest,r=s.subtract(l),{viewMat3:a,tileMat3:n}=this.view,u=a.multiply(n).multiply(new p(i.pos,1)).xy,d=i.size.multiply(.5);return b(u,o).subtract(d).add(r)}_hittestMarker(t,e,i){const{pos0:o,pos1:s,pos2:l}=this.computeHittestTriangle(t,e,i),r=this.hittestRequest.position,a=this.hittestRequest.distance,p=k(r,o,s,l);return h(x(p,a),p,this._hittestSamples(o,s,l,t,e,i))}computeHittestTriangle(t,e,i){const{pos:o,sizeCorrection:s,isMapAligned:l}=i,r=new p(t.offset.multiply(s),0),a=new p(e.offsetNextVertex1.multiply(s),0),n=new p(e.offsetNextVertex2.multiply(s),0),{viewMat3:u,tileMat3:d}=this.view,m=u.multiply(d).multiply(new p(o,1)),y=this._getViewScreenMatrix(l).multiply(i.vvRotationMat3).multiply(i.placementMat3);return{pos0:m.add(y.multiply(r)).xy,pos1:m.add(y.multiply(a)).xy,pos2:m.add(y.multiply(n)).xy}}_hittestSamples(t,e,i,o,s,l){const{outlineSize:r,isSDF:a,distanceToPx:p}=l,n=this.hittestRequest.position,u=this.hittestRequest.distance,m=A(n.add(new g(C(u),C(u))),t,e,i),h=A(n.add(new g(0,C(u))),t,e,i),c=A(n.add(new g(u,C(u))),t,e,i),x=A(n.add(new g(C(u),0)),t,e,i),v=A(n,t,e,i),w=A(n.add(new g(u,0)),t,e,i),V=A(n.add(new g(C(u),u)),t,e,i),f=A(n.add(new g(0,u)),t,e,i),S=A(n.add(new g(u,u)),t,e,i),b=o.textureUV.divide(this.mosaicInfo.size),z=s.textureUVNextVertex1.divide(this.mosaicInfo.size),_=s.textureUVNextVertex2.divide(this.mosaicInfo.size),R={color:new y(1),outlineColor:new y(1),overrideOutlineColor:new d(1),outlineSize:r,distanceToPx:p,isSDF:a};let j=new d(0);return j=j.add(P(m).multiply(this._getColor(lt(m,b,z,_),R).a)),j=j.add(P(h).multiply(this._getColor(lt(h,b,z,_),R).a)),j=j.add(P(c).multiply(this._getColor(lt(c,b,z,_),R).a)),j=j.add(P(x).multiply(this._getColor(lt(x,b,z,_),R).a)),j=j.add(P(v).multiply(this._getColor(lt(v,b,z,_),R).a)),j=j.add(P(w).multiply(this._getColor(lt(w,b,z,_),R).a)),j=j.add(P(V).multiply(this._getColor(lt(V,b,z,_),R).a)),j=j.add(P(f).multiply(this._getColor(lt(f,b,z,_),R).a)),j=j.add(P(S).multiply(this._getColor(lt(S,b,z,_),R).a)),M(j,new d(.05)).multiply(I(this.hittestRequest))}}t([o(E)],at.prototype,"visualVariableColor",void 0),t([o(J)],at.prototype,"visualVariableOpacity",void 0),t([o(K)],at.prototype,"visualVariableRotation",void 0),t([o(Q)],at.prototype,"visualVariableSizeMinMaxValue",void 0),t([o(W)],at.prototype,"visualVariableSizeScaleStops",void 0),t([o(X)],at.prototype,"visualVariableSizeStops",void 0),t([o(Y)],at.prototype,"visualVariableSizeUnitValue",void 0),t([s(H)],at.prototype,"mosaicInfo",void 0),t([l(z)],at.prototype,"mosaicTexture",void 0),t([e(0,r(it)),e(1,r(ot))],at.prototype,"vertex",null),t([e(0,r(st))],at.prototype,"fragment",null);export{st as MarkerFragmentInput,at as MarkerShader,it as MarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{loadGeometryOperatorsForEffect as t,loadGeometryOperatorsForPlacement as a}from"../../../../../../../symbols/cim/CIMEffects.js";import{getEffectsInflateSize as r}from"../../../../../../../symbols/cim/utils.js";import{EffectHelper as s}from"../../../../../../../symbols/cim/effects/EffectHelper.js";import{MeshWriterVertexPack as i}from"./MeshWriterVertexPack.js";const n=96/72;class c{constructor(e,t,a,r){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=a,this._viewParams=r,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=i.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get placementInfo(){return this._evaluator.inputMeshParams.placement}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await t(e);this.placementInfo&&await a(this.placementInfo.placement)}enqueueRequest(e,t,a){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,a)}write(e,t,a,r,s,i){this.ensurePacked(t,a,r);const n=e.id||"",c=this.evaluatedMeshParams.effects,o=this._createEffectExecutionContext(a,r,n),f={target:a,options:r,level:s,viewExtent:i};if(!c||0===c.length)return void this._write(e,f);const u=this.getEffectCursor(a,c,o);if(!u)return;let h;for(;h=u.next();)h.invertY(),this._write(e,{...f,effectGeometry:h})}ensurePacked(e,t,a){if(!this._evaluator.hasDynamicProperties)return;const r=this._evaluator.evaluateMeshParams(e,t,a);this._vertexPack.pack(r,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,a,r,s){const i=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,a,r,i,s)}_createEffectExecutionContext(e,t,a){return{geomUnitsPerPoint:n,maxInflateSize:r(this.evaluatedMeshParams.effects),scale:t.$view.scale,spatialReference:e.metadata.outSpatialReference??e.metadata.spatialReference,preventClipping:this._preventEffectClipping,tileKey:a}}getEffectCursor(t,a,r){const i=t.readGeometryForDisplay()?.clone();if(!i)return;const n=e.fromOptimizedCIM(i,t.geometryType);return n.invertY(),s.executeEffects(a,n,r)}}export{c as MeshWriter};
2
+ import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{loadGeometryOperatorsForEffect as t,loadGeometryOperatorsForPlacement as a}from"../../../../../../../symbols/cim/CIMEffects.js";import{getEffectsInflateSize as r}from"../../../../../../../symbols/cim/utils.js";import{EffectHelper as s}from"../../../../../../../symbols/cim/effects/EffectHelper.js";import{MeshWriterVertexPack as i}from"./MeshWriterVertexPack.js";const n=96/72;class c{constructor(e,t,a,r){this._instanceId=e,this._evaluator=t,this._enabledOptionalAttributes=a,this._viewParams=r,this._evaluator.evaluator=e=>this.vertexSpec.createComputedParams(e)}get _vertexPack(){if(!this._cachedVertexPack){const e=i.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||e.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=e}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get effectInfos(){return this._evaluator.inputMeshParams.effects?.effectInfos}get placementInfo(){return this._evaluator.inputMeshParams.placement}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}get _preventEffectClipping(){return!1}setReferences(e){this._references=e}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){for(const{effect:e}of this.effectInfos||[])await t(e);this.placementInfo&&await a(this.placementInfo.placement)}enqueueRequest(e,t,a){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(e,t,a)}write(e,t,a,r,s,i,n,c){this.ensurePacked(t,a,r);const o=e.id||"",f=this.evaluatedMeshParams.effects,u=this._createEffectExecutionContext(a,r,o,n,c),h={target:a,options:r,level:s,viewExtent:i};if(!f||0===f.length)return void this._write(e,h);const l=this.getEffectCursor(a,f,u);if(!l)return;let m;for(;m=l.next();)m.invertY(),this._write(e,{...h,effectGeometry:m})}ensurePacked(e,t,a){if(!this._evaluator.hasDynamicProperties)return;const r=this._evaluator.evaluateMeshParams(e,t,a);this._vertexPack.pack(r,this._viewParams)}hasArcadeDependency(e){return this._evaluator.hasArcadeDependency(e)}_writeVertex(e,t,a,r,s){const i=this.evaluatedMeshParams;this._vertexPack.writeVertex(e,t,a,r,i,s)}_createEffectExecutionContext(e,t,a,s,i){return{geomUnitsPerPoint:n,maxInflateSize:r(this.evaluatedMeshParams.effects),scale:t.$view.scale,spatialReference:e.metadata.outSpatialReference??e.metadata.spatialReference,preventClipping:this._preventEffectClipping,tileKey:a,scaleFactor:s,matcher:i,target:e}}getEffectCursor(t,a,r){null==r.scaleFactor&&(r={...r,scaleFactor:1});const i=t.readGeometryForDisplay()?.clone();if(!i)return;const n=e.fromOptimizedCIM(i,t.geometryType);return n.invertY(),s.executeEffects(a,n,r)}}export{c as MeshWriter};