@arcgis/core 5.1.0-next.93 → 5.1.0-next.95

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 (499) hide show
  1. package/Graphic.js +1 -1
  2. package/analysis/Viewshed.js +1 -1
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/compilerUtils.js +1 -1
  7. package/arcade/debug.d.ts +10 -1
  8. package/arcade.js +1 -1
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +1 -0
  11. package/assets/esri/core/workers/chunks/031ea31bbdb7f1be791e.js +1 -0
  12. package/assets/esri/core/workers/chunks/03a4543b94f9adeb1852.js +1 -0
  13. package/assets/esri/core/workers/chunks/05c52e8f187740da9b36.js +1 -0
  14. package/assets/esri/core/workers/chunks/0630ce1975c91ae362d9.js +1 -0
  15. package/assets/esri/core/workers/chunks/{7f0f10946f05a09b5654.js → 07ddf1b1f7602063ceb0.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0ab1384282afc8731857.js +1 -0
  17. package/assets/esri/core/workers/chunks/{be47e42c6c8c0820efd8.js → 0e6b24e8864940ed9877.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0f527961805cd45c14e2.js +1 -0
  19. package/assets/esri/core/workers/chunks/11a99ee68409a641810e.js +1 -0
  20. package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +1 -0
  21. package/assets/esri/core/workers/chunks/130abc6a353e4d79a1b1.js +1 -0
  22. package/assets/esri/core/workers/chunks/16006dc0cb95f7c291a5.js +1 -0
  23. package/assets/esri/core/workers/chunks/177472a6a9beb1590934.js +1 -0
  24. package/assets/esri/core/workers/chunks/19a9a555365a8363d34b.js +1 -0
  25. package/assets/esri/core/workers/chunks/1a68a249540fda9083a9.js +1 -0
  26. package/assets/esri/core/workers/chunks/1ae016e4f5e39c34a941.js +1 -0
  27. package/assets/esri/core/workers/chunks/{43f58604ba4a94a9167c.js → 1f3a676e7a4eae5ad566.js} +1 -1
  28. package/assets/esri/core/workers/chunks/23241e6093e245f9c774.js +1 -0
  29. package/assets/esri/core/workers/chunks/{172228d1a392ca7a5b21.js → 246253fbbb2ecea48f91.js} +1 -1
  30. package/assets/esri/core/workers/chunks/25d795a1697803d77e56.js +1 -0
  31. package/assets/esri/core/workers/chunks/268ed861c882740c805b.js +1 -0
  32. package/assets/esri/core/workers/chunks/{da008d6a3afb30d18392.js → 299b4eecd0288348c971.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{df8a3d3cac454d42e14d.js → 29aba121db7f00e0cf81.js} +1 -1
  34. package/assets/esri/core/workers/chunks/2b52c1c01cf568ba01fb.js +1 -0
  35. package/assets/esri/core/workers/chunks/2f6ba01ea8b8f193bea5.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f52443cd203e687551da.js → 2fda38219d778f0447b5.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +1 -0
  38. package/assets/esri/core/workers/chunks/3116a1c2b67a296ba86e.js +1 -0
  39. package/assets/esri/core/workers/chunks/31837f2f8859e2cf2efd.js +1 -0
  40. package/assets/esri/core/workers/chunks/3241e0ed26aff61ec213.js +1 -0
  41. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +1 -0
  42. package/assets/esri/core/workers/chunks/359465b9726edcc70c83.js +1 -0
  43. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +1 -0
  44. package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +1 -0
  45. package/assets/esri/core/workers/chunks/38b1d2ffcc318ac0119d.js +1 -0
  46. package/assets/esri/core/workers/chunks/390717f079def83a0d9c.js +1 -0
  47. package/assets/esri/core/workers/chunks/{3397eae416622c64e628.js → 3f0483cbcd893acf240c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{77c2d8d0ce1c1ab469e9.js → 40afdb74517a7df59e0d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{41cbde4738ae4adf973d.js → 4142d5232c99d8aa943d.js} +5 -5
  50. package/assets/esri/core/workers/chunks/41e811138c96d85fd3e8.js +1 -0
  51. package/assets/esri/core/workers/chunks/43b5cfb34b11c4124b51.js +1 -0
  52. package/assets/esri/core/workers/chunks/{747e258f57f0543c836e.js → 43cc82373be791b7cb4c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{8a370cc1a99ddc7ce70b.js → 4456bbb4b7dfe80c7477.js} +1 -1
  54. package/assets/esri/core/workers/chunks/44b30dfce12824ee1f33.js +1 -0
  55. package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +1 -0
  56. package/assets/esri/core/workers/chunks/4644e1b00fd4e628219d.js +1 -0
  57. package/assets/esri/core/workers/chunks/47dd2bfecc5c4b5f10f0.js +1 -0
  58. package/assets/esri/core/workers/chunks/4b19acf8bde5b2e80692.js +1 -0
  59. package/assets/esri/core/workers/chunks/4faaf61d20e20fcf6c18.js +1 -0
  60. package/assets/esri/core/workers/chunks/{a169d9fe66b5865911d9.js → 503439246250d9e1cbd5.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{f8072a4cf1b25d8b93f9.js → 509beae195c900a85e0b.js} +1 -1
  62. package/assets/esri/core/workers/chunks/5217d676749bca59d90f.js +1 -0
  63. package/assets/esri/core/workers/chunks/{1e3fe89970c57a883fe5.js → 53ff47c06ccfc0be885c.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{53750e85f3128993a43a.js → 545c38789267e3487dbd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/54dad475dc806a38c287.js +1 -0
  66. package/assets/esri/core/workers/chunks/5648379d1ed4ca02eedd.js +1 -0
  67. package/assets/esri/core/workers/chunks/{12f41c1c66fb446b6286.js → 5853925d2f7fb550bd2e.js} +11 -11
  68. package/assets/esri/core/workers/chunks/58579c53be1a44bd08d2.js +1 -0
  69. package/assets/esri/core/workers/chunks/598271956c46e21e5c09.js +1 -0
  70. package/assets/esri/core/workers/chunks/{d82da31dc702b8fd6a07.js → 59a64d72eed8c40c63cf.js} +1 -1
  71. package/assets/esri/core/workers/chunks/5ea0096a282e87a269bd.js +1 -0
  72. package/assets/esri/core/workers/chunks/63378b0b4265a547656b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{394812e19b6915d560b0.js → 642be1619c0e76355cb6.js} +1 -1
  74. package/assets/esri/core/workers/chunks/65b0b4e808479187da00.js +1 -0
  75. package/assets/esri/core/workers/chunks/6666cd3bf1a3d175dc8c.js +1 -0
  76. package/assets/esri/core/workers/chunks/69a1cbf0af059548f96a.js +1 -0
  77. package/assets/esri/core/workers/chunks/6ae2408ac075b974e887.js +1 -0
  78. package/assets/esri/core/workers/chunks/{19a0cb2d335d97ad9488.js → 6b4c99c7648f37feec00.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6b79c254897ece95b7a3.js +1 -0
  80. package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +1 -0
  81. package/assets/esri/core/workers/chunks/71119398ec91f1b209d7.js +1 -0
  82. package/assets/esri/core/workers/chunks/71e12db99589c98a4357.js +1 -0
  83. package/assets/esri/core/workers/chunks/7536f0683e488159d8bd.js +1 -0
  84. package/assets/esri/core/workers/chunks/76589434d573111a8fb4.js +1 -0
  85. package/assets/esri/core/workers/chunks/{6f67c9f68101a084b683.js → 765bc49e58e9d0caa496.js} +6 -6
  86. package/assets/esri/core/workers/chunks/7c2d2f22df057ba8cb50.js +1 -0
  87. package/assets/esri/core/workers/chunks/7d6299ab7b0db23ab961.js +1 -0
  88. package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +1 -0
  89. package/assets/esri/core/workers/chunks/82b2acc6f181927de89c.js +1 -0
  90. package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +1 -0
  91. package/assets/esri/core/workers/chunks/89250d268dc2554a9ece.js +1 -0
  92. package/assets/esri/core/workers/chunks/8a23a62cbf1c5b4019c5.js +1 -0
  93. package/assets/esri/core/workers/chunks/8ac8ef856ed9592c433b.js +1 -0
  94. package/assets/esri/core/workers/chunks/8bfe4841c83eb3abfbe8.js +1 -0
  95. package/assets/esri/core/workers/chunks/{6aed2e42e65ac80f1fab.js → 8de61993e114f453579b.js} +1 -1
  96. package/assets/esri/core/workers/chunks/8e374ce47256a567ae11.js +1 -0
  97. package/assets/esri/core/workers/chunks/8f992ff87173a3ca1621.js +640 -0
  98. package/assets/esri/core/workers/chunks/{d7e7f3efd1d28617b808.js → 92e7067960549733f8e6.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{f1673e723b336204ad77.js → 9b23d999db902d25ba58.js} +1 -1
  100. package/assets/esri/core/workers/chunks/9bb2251ba58932f85d13.js +1 -0
  101. package/assets/esri/core/workers/chunks/{d8ccc713c5ad93e7a0c3.js → 9bd713d96502ddc2ce25.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{8351012ceb466f01b8fd.js → 9d8e7839772029d83c93.js} +1 -1
  103. package/assets/esri/core/workers/chunks/a12fd6a445f42326642f.js +1 -0
  104. package/assets/esri/core/workers/chunks/a50fd0e66b01fe205033.js +1 -0
  105. package/assets/esri/core/workers/chunks/{51716e411fad624ac21c.js → a567d001fcfa1f1cdeea.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{5eff240a0e41a4f80e61.js → a68b5cb66c2c5e6b46e0.js} +1 -1
  107. package/assets/esri/core/workers/chunks/a8e2fbbfbdf1c3203d5e.js +1 -0
  108. package/assets/esri/core/workers/chunks/a94674826e5893c9d197.js +1 -0
  109. package/assets/esri/core/workers/chunks/aad02c7417648d881129.js +1 -0
  110. package/assets/esri/core/workers/chunks/ad329226c8b579d0964c.js +1 -0
  111. package/assets/esri/core/workers/chunks/afdc6fc453157528cf9b.js +1 -0
  112. package/assets/esri/core/workers/chunks/b2504657d3ef8769005e.js +1 -0
  113. package/assets/esri/core/workers/chunks/b7f5d51ac26f37837b3b.js +1 -0
  114. package/assets/esri/core/workers/chunks/b90db0829da3f96e4a19.js +1 -0
  115. package/assets/esri/core/workers/chunks/{359d3acb3953e64e5a78.js → ba7fe21a78ea37a02b7c.js} +1 -1
  116. package/assets/esri/core/workers/chunks/bd17ac2e6f1eb8cf7abf.js +1 -0
  117. package/assets/esri/core/workers/chunks/bd721bbc7afc75d3bddb.js +1 -0
  118. package/assets/esri/core/workers/chunks/bd9dae2d5ec199f8e9ba.js +1 -0
  119. package/assets/esri/core/workers/chunks/{75c09a2fa4c34b4844c5.js → be0eab592db0e651b023.js} +6 -6
  120. package/assets/esri/core/workers/chunks/be19d4a6fb9b1c923127.js +1 -0
  121. package/assets/esri/core/workers/chunks/beba9f2213d8a850ddb6.js +1 -0
  122. package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js → bf6c6bc15b0d2d82d1a4.js} +2 -2
  123. package/assets/esri/core/workers/chunks/bf706a5d065a357de51b.js +1 -0
  124. package/assets/esri/core/workers/chunks/{baea6f86b2dbe067940e.js → bf73232057ebc1ecc0ad.js} +1 -1
  125. package/assets/esri/core/workers/chunks/c2589e5e0e0f81a378c2.js +1 -0
  126. package/assets/esri/core/workers/chunks/c321bcda8e8893577948.js +1 -0
  127. package/assets/esri/core/workers/chunks/c33f1f722499a5c6fc11.js +1 -0
  128. package/assets/esri/core/workers/chunks/c452c74ba9de218c3e57.js +1 -0
  129. package/assets/esri/core/workers/chunks/{fade7b878a9498382bb2.js → c514135bf7703ba69a47.js} +1 -1
  130. package/assets/esri/core/workers/chunks/c798a40418e7ff38042a.js +1 -0
  131. package/assets/esri/core/workers/chunks/{969f58a2de4ebe63619d.js → c88fd4f69cb2b53b48ec.js} +1 -1
  132. package/assets/esri/core/workers/chunks/ca6c128940ddbebcaaab.js +1 -0
  133. package/assets/esri/core/workers/chunks/{c7ee05f46b26b17f9414.js → ce2ed9405ff1b704d35c.js} +1 -1
  134. package/assets/esri/core/workers/chunks/ce3e51c799a80648e46d.js +1 -0
  135. package/assets/esri/core/workers/chunks/{e81afc8a058a8ecc9b24.js → ce4e09b623ebb640c46c.js} +1 -1
  136. package/assets/esri/core/workers/chunks/cf7acf5acb6d322fd996.js +1 -0
  137. package/assets/esri/core/workers/chunks/{e0b27bceb397482bd0e8.js → d122431f3b0b88dcb488.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js → d87e504082e293640ece.js} +2 -2
  139. package/assets/esri/core/workers/chunks/d8c4fb66c733ab2f66d3.js +1 -0
  140. package/assets/esri/core/workers/chunks/d8d338665fe00494c826.js +1 -0
  141. package/assets/esri/core/workers/chunks/d93a4ccf8f0208dc6ad7.js +1 -0
  142. package/assets/esri/core/workers/chunks/de11ebcea2b8f9dfe65d.js +1 -0
  143. package/assets/esri/core/workers/chunks/e03713dee3205c96d53f.js +1 -0
  144. package/assets/esri/core/workers/chunks/e133840540abf20262a4.js +1 -0
  145. package/assets/esri/core/workers/chunks/e54ad3683ad992682deb.js +1 -0
  146. package/assets/esri/core/workers/chunks/{3092184350d66c79f610.js → e5d969214d9eda5c0b4c.js} +1 -1
  147. package/assets/esri/core/workers/chunks/e63e24101e7e92c62d98.js +1 -0
  148. package/assets/esri/core/workers/chunks/e7e7c7cbfd8542bd7a46.js +1 -0
  149. package/assets/esri/core/workers/chunks/ead6e4d0a515c0913bee.js +1 -0
  150. package/assets/esri/core/workers/chunks/ee635172be7fdea69367.js +1 -0
  151. package/assets/esri/core/workers/chunks/{aefeb5a17bb481c95da3.js → eeb847bfea558566adf6.js} +1 -1
  152. package/assets/esri/core/workers/chunks/{d11de13537b623739e14.js → f14e3693cd644265f909.js} +1 -1
  153. package/assets/esri/core/workers/chunks/f196ad0c7dbcbf632776.js +1 -0
  154. package/assets/esri/core/workers/chunks/f31deeedb2508e81293b.js +2 -0
  155. package/assets/esri/core/workers/chunks/f618ee43581e8de6ad0c.js +1 -0
  156. package/assets/esri/core/workers/chunks/{2fd4220131bfc3f5e2dd.js → f635a8e3b0bfeda99ed5.js} +1 -1
  157. package/assets/esri/core/workers/chunks/f66262f8582909157f01.js +1 -0
  158. package/assets/esri/core/workers/chunks/f69c44479ee3fd8c831d.js +1 -0
  159. package/assets/esri/core/workers/chunks/{ea97619a4470f1540b99.js → f6ebec8d2248c719b89f.js} +1 -1
  160. package/assets/esri/core/workers/chunks/f948e4a80a7dbda70f2e.js +1 -0
  161. package/assets/esri/core/workers/chunks/f95e3333a65a0c09fd1e.js +1 -0
  162. package/assets/esri/core/workers/chunks/fa3138dd8139008b430d.js +1 -0
  163. package/assets/esri/core/workers/chunks/fa9ab152ea785b5e97e0.js +1 -0
  164. package/assets/esri/core/workers/chunks/fae147d03ed723ab234d.js +1 -0
  165. package/assets/esri/core/workers/chunks/fae79769df54eb4c4154.js +1 -0
  166. package/assets/esri/core/workers/chunks/fd2afff07aaac8203c18.js +1 -0
  167. package/assets/esri/core/workers/chunks/fdb7851e98e8d2ba48d3.js +1 -0
  168. package/assets/esri/core/workers/chunks/ff7708aaa2de720e3a47.js +1 -0
  169. package/assets/esri/core/workers/chunks/ffb8fa77297578afef7c.js +1 -0
  170. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  171. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  172. package/chunks/GaussianSplat.glsl.js +8 -8
  173. package/chunks/GlobalIllumination.glsl.js +31 -31
  174. package/chunks/GlowComposition.glsl.js +4 -4
  175. package/chunks/OITBlend.glsl.js +3 -7
  176. package/chunks/OITBlendEmission.glsl.js +22 -0
  177. package/chunks/{OITDim.glsl.js → OITDimOpaque.glsl.js} +2 -2
  178. package/chunks/RibbonLine.glsl.js +57 -53
  179. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  180. package/chunks/arcgis-knowledge-client-core.js +1 -1
  181. package/config.js +1 -1
  182. package/core/has.js +1 -1
  183. package/geometry/support/geometryUtils.js +1 -1
  184. package/geometry/support/heightModelInfoUtils.js +1 -1
  185. package/kernel.js +1 -1
  186. package/layers/DimensionFeatureLayer.d.ts +7 -0
  187. package/layers/DimensionFeatureLayer.js +2 -0
  188. package/layers/FeatureLayer.d.ts +27 -1
  189. package/layers/FeatureLayer.js +1 -1
  190. package/layers/catalog/CatalogFootprintLayer.js +1 -1
  191. package/layers/graphics/OptimizedFeature.js +1 -1
  192. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  193. package/layers/graphics/data/optimizedFeatureQueryEngineAdapter.js +1 -1
  194. package/layers/graphics/featureConversionUtils.js +1 -1
  195. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  196. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  197. package/layers/mixins/ArcGISImageService.js +1 -1
  198. package/layers/mixins/FeatureReductionLayer.js +1 -1
  199. package/layers/mixins/PortalLayer.js +1 -1
  200. package/layers/raster/datasets/ImageAuxRaster.js +1 -1
  201. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  202. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  203. package/layers/raster/formats/RasterCodec.js +1 -1
  204. package/layers/support/RasterJobHandler.js +1 -1
  205. package/layers/support/capabilities.js +1 -1
  206. package/layers/support/layerUtils.js +1 -1
  207. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  208. package/layers/types.d.ts +1 -1
  209. package/networks/support/CircuitPathConnectivityElement.js +1 -1
  210. package/networks/support/networkFieldUtils.js +1 -1
  211. package/package.json +2 -2
  212. package/popup/Features.js +1 -1
  213. package/portal/schemas/definitions.js +1 -1
  214. package/portal/support/layersLoader.js +1 -1
  215. package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -3
  216. package/rest/knowledgeGraph/types.d.ts +1 -1
  217. package/rest/knowledgeGraph/wasmInterface/queryToWasmEncodedFactories.js +1 -1
  218. package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
  219. package/rest/support/Query.js +1 -1
  220. package/rest/versionManagement/gdbVersion/support/ConflictsParameters.js +1 -1
  221. package/rest/versionManagement/gdbVersion/support/DifferencesParameters.js +1 -1
  222. package/rest/versionManagement/gdbVersion/support/DifferencesResult.d.ts +25 -0
  223. package/rest/versionManagement/gdbVersion/support/InspectConflictsParameters.js +1 -1
  224. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +3 -5
  225. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.js +1 -1
  226. package/support/revision.js +1 -1
  227. package/symbols/cim/CIMEffects.js +1 -1
  228. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  229. package/symbols/cim/CIMSymbolHelper.js +1 -1
  230. package/symbols/cim/defaultCIMValues.js +1 -1
  231. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  232. package/symbols/cim/effects/EffectArrow.js +1 -1
  233. package/symbols/cim/effects/EffectBuffer.js +1 -1
  234. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  235. package/symbols/cim/effects/EffectCut.js +1 -1
  236. package/symbols/cim/effects/EffectDashes.js +1 -1
  237. package/symbols/cim/effects/EffectDonut.js +1 -1
  238. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  239. package/symbols/cim/effects/EffectHelper.js +1 -1
  240. package/symbols/cim/effects/EffectJog.js +1 -1
  241. package/symbols/cim/effects/EffectMove.js +1 -1
  242. package/symbols/cim/effects/EffectOffset.js +1 -1
  243. package/symbols/cim/effects/EffectRadial.js +1 -1
  244. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  245. package/symbols/cim/effects/EffectWave.js +1 -1
  246. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  247. package/symbols/cim/types.d.ts +34 -1
  248. package/symbols/cim/utils.js +1 -1
  249. package/symbols/dimensions/effects/LinearDimensionArrowEffect.js +1 -1
  250. package/symbols/dimensions/effects/LinearDimensionExtensionLineEffect.js +1 -1
  251. package/symbols/dimensions/effects/LinearDimensionLeaderLineEffect.js +1 -1
  252. package/symbols/dimensions/effects/LinearDimensionLineEffect.js +1 -1
  253. package/symbols/dimensions/effects/LinearDimensionPointEffect.js +1 -1
  254. package/symbols/dimensions/effects/LinearDimensionTextEffect.js +1 -1
  255. package/symbols/types.d.ts +1 -1
  256. package/views/2d/engine/vectorTiles/decluttering/SymbolDeclutterer.js +1 -1
  257. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  258. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  259. package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
  260. package/views/2d/engine/webgl/alignmentUtils.js +1 -1
  261. package/views/2d/engine/webgl/definitions.js +1 -1
  262. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  263. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  264. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  265. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  266. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  267. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  268. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  269. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  270. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  271. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  272. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js +1 -1
  273. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  274. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  282. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  283. package/views/2d/layerViewModuleImportUtils.js +1 -1
  284. package/views/2d/layers/DimensionLayerView2D.js +2 -0
  285. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  286. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  287. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +2 -0
  288. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  289. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  290. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  291. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  292. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  293. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  294. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  295. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  296. package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
  297. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +2 -0
  298. package/views/2d/layers/features/sources/strategies/chunks/ByReferenceTileSourceChunk.js +2 -0
  299. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  300. package/views/2d/layers/features/support/DisplayIdGenerator.js +1 -1
  301. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  302. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  303. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  304. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  305. package/views/2d/layers/features/support/RefCounted.js +2 -0
  306. package/views/2d/types.d.ts +2 -0
  307. package/views/3d/layerViewModuleImportUtils.js +1 -1
  308. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  309. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  310. package/views/3d/support/QualityProfile.js +1 -1
  311. package/views/3d/support/QualitySettings.js +1 -1
  312. package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
  313. package/views/3d/types.d.ts +2 -0
  314. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -12
  315. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  316. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -1
  317. package/views/3d/webgl-engine/core/shaderLibrary/util/{ComputeCovariance.glsl.js → GaussianSplatCovariance.glsl.js} +15 -9
  318. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatEvaluation.glsl.js +43 -0
  319. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +36 -0
  320. package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
  321. package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
  322. package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
  323. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
  324. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  325. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  326. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  327. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  328. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  329. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  330. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  331. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  332. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  333. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  334. package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
  335. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  336. package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
  337. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  338. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  339. package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
  340. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  341. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  342. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +2 -0
  343. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechnique.js +2 -0
  344. package/views/3d/webgl-engine/effects/transparency/OITBlendEmissionTechniqueConfiguration.js +2 -0
  345. package/views/3d/webgl-engine/effects/transparency/OITBlendTechniqueConfiguration.js +1 -1
  346. package/views/3d/webgl-engine/effects/transparency/{OITDim.glsl.js → OITDimOpaque.glsl.js} +1 -1
  347. package/views/3d/webgl-engine/effects/transparency/OITDimOpaqueTechnique.js +2 -0
  348. package/views/3d/webgl-engine/effects/transparency/{OITDimTechniqueConfiguration.js → OITDimOpaqueTechniqueConfiguration.js} +1 -1
  349. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  350. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  351. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  352. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  353. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  354. package/views/3d/webgl-engine/shaders/oitResolution.glsl.js +1 -1
  355. package/views/PopupView.js +1 -1
  356. package/views/SceneView.d.ts +3 -3
  357. package/views/layers/FeatureLikeLayerView.d.ts +2 -1
  358. package/views/layers/FeatureLikeLayerView.js +1 -1
  359. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +12 -12
  360. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  361. package/widgets/FeatureTable/Grid/Column.d.ts +2 -17
  362. package/widgets/FeatureTable/Grid/Column.js +1 -1
  363. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  364. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  365. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -7
  366. package/widgets/FeatureTable/Grid/GroupColumn.js +1 -1
  367. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -9
  368. package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
  369. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  370. package/widgets/FeatureTable/support/types.d.ts +0 -8
  371. package/widgets/FeatureTable.d.ts +18 -3
  372. package/widgets/FeatureTable.js +1 -1
  373. package/widgets/Features/FeaturesViewModel.js +1 -1
  374. package/widgets/Search/support/layerSearchUtils.js +1 -1
  375. package/widgets/Search/support/locatorUtils.js +1 -1
  376. package/assets/esri/core/workers/chunks/00e9e25269d5776f8645.js +0 -1
  377. package/assets/esri/core/workers/chunks/014a5fad55f97b9b5166.js +0 -1
  378. package/assets/esri/core/workers/chunks/015fc0a17b17d69cc3bb.js +0 -1
  379. package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +0 -1
  380. package/assets/esri/core/workers/chunks/06003996a378c45bc605.js +0 -1
  381. package/assets/esri/core/workers/chunks/0a6df243b18acae471be.js +0 -1
  382. package/assets/esri/core/workers/chunks/127cd8fee3717a473fc5.js +0 -1
  383. package/assets/esri/core/workers/chunks/146424b5717d0a645ee1.js +0 -1
  384. package/assets/esri/core/workers/chunks/169ca3724053fc046d1b.js +0 -1
  385. package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +0 -1
  386. package/assets/esri/core/workers/chunks/1765dfeac20e34ce25b7.js +0 -1
  387. package/assets/esri/core/workers/chunks/1768f1a7e3caa6074d91.js +0 -1
  388. package/assets/esri/core/workers/chunks/1906416c84bab369bbd6.js +0 -1
  389. package/assets/esri/core/workers/chunks/1a35121a0c2595a41fdb.js +0 -1
  390. package/assets/esri/core/workers/chunks/1f85646936200a399c15.js +0 -1
  391. package/assets/esri/core/workers/chunks/1ff3c15a51c4dc991806.js +0 -1
  392. package/assets/esri/core/workers/chunks/206bdfd868a9ef88f3a8.js +0 -1
  393. package/assets/esri/core/workers/chunks/2343b1105bc4c1b4a086.js +0 -1
  394. package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +0 -1
  395. package/assets/esri/core/workers/chunks/2b0b398180ed98c2c84c.js +0 -1
  396. package/assets/esri/core/workers/chunks/3469df5c4846b0cee012.js +0 -1
  397. package/assets/esri/core/workers/chunks/34b6b5dd415c68f0b0d1.js +0 -1
  398. package/assets/esri/core/workers/chunks/34f7450769826e8b7069.js +0 -636
  399. package/assets/esri/core/workers/chunks/36f6673b23579b88d8f7.js +0 -1
  400. package/assets/esri/core/workers/chunks/384c235d36f32769e32b.js +0 -1
  401. package/assets/esri/core/workers/chunks/38c28189f273636e4017.js +0 -1
  402. package/assets/esri/core/workers/chunks/3a183259805638c25363.js +0 -1
  403. package/assets/esri/core/workers/chunks/3d9032217347dadcbe41.js +0 -1
  404. package/assets/esri/core/workers/chunks/3efbb684c0409955186d.js +0 -1
  405. package/assets/esri/core/workers/chunks/3feec3d08424b94e1bcf.js +0 -1
  406. package/assets/esri/core/workers/chunks/412745bfacef23e3b702.js +0 -1
  407. package/assets/esri/core/workers/chunks/46b16501db6681dc467b.js +0 -1
  408. package/assets/esri/core/workers/chunks/47b3a5213539548ff3a6.js +0 -1
  409. package/assets/esri/core/workers/chunks/48549d3d7bf0154c0afa.js +0 -1
  410. package/assets/esri/core/workers/chunks/4b79ebfb3328f9483147.js +0 -1
  411. package/assets/esri/core/workers/chunks/4c97cc922eece3a91b6b.js +0 -1
  412. package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +0 -1
  413. package/assets/esri/core/workers/chunks/4e206957b28253ddc1a3.js +0 -1
  414. package/assets/esri/core/workers/chunks/52b3a11c962810bc6dbe.js +0 -1
  415. package/assets/esri/core/workers/chunks/53ef72edc3ed80bf558c.js +0 -1
  416. package/assets/esri/core/workers/chunks/54c035cdc171998d0776.js +0 -1
  417. package/assets/esri/core/workers/chunks/54c6e870262469d0d702.js +0 -1
  418. package/assets/esri/core/workers/chunks/55fd201ca5e10c6e4761.js +0 -1
  419. package/assets/esri/core/workers/chunks/566f6319ded0634769e0.js +0 -1
  420. package/assets/esri/core/workers/chunks/56717ff315c6ec874142.js +0 -1
  421. package/assets/esri/core/workers/chunks/56941e8bbd2d49bf2656.js +0 -1
  422. package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +0 -1
  423. package/assets/esri/core/workers/chunks/60cee9a44929decd2474.js +0 -1
  424. package/assets/esri/core/workers/chunks/6124141ac642e4ce1454.js +0 -1
  425. package/assets/esri/core/workers/chunks/61fada8942b65fa0b5e1.js +0 -1
  426. package/assets/esri/core/workers/chunks/65c61171e6c6be5c5c2f.js +0 -1
  427. package/assets/esri/core/workers/chunks/6a3d207308b29651f397.js +0 -1
  428. package/assets/esri/core/workers/chunks/6d696beddcc5fbed5875.js +0 -1
  429. package/assets/esri/core/workers/chunks/6dac8dfcd63fc757ae2d.js +0 -1
  430. package/assets/esri/core/workers/chunks/71cfab6305f275cfb04e.js +0 -1
  431. package/assets/esri/core/workers/chunks/728ad5bbbcbf88d6249f.js +0 -1
  432. package/assets/esri/core/workers/chunks/7b505112c7e6d9b7a239.js +0 -1
  433. package/assets/esri/core/workers/chunks/7b6c8be59ed87e386aa4.js +0 -1
  434. package/assets/esri/core/workers/chunks/7ba67f1d7831a5576a5a.js +0 -1
  435. package/assets/esri/core/workers/chunks/7c820c5f6f05480d5050.js +0 -1
  436. package/assets/esri/core/workers/chunks/7ef51b0ebd560113ae7e.js +0 -1
  437. package/assets/esri/core/workers/chunks/80f4f686ce403cb2693f.js +0 -1
  438. package/assets/esri/core/workers/chunks/81d761c837b7456ec99f.js +0 -1
  439. package/assets/esri/core/workers/chunks/83f1871d04c979fa23b7.js +0 -1
  440. package/assets/esri/core/workers/chunks/85da2987e17b6755a94e.js +0 -1
  441. package/assets/esri/core/workers/chunks/8a3bff0f58483c1665f9.js +0 -1
  442. package/assets/esri/core/workers/chunks/8a5a827ee557d9f9a66e.js +0 -1
  443. package/assets/esri/core/workers/chunks/8a7a99533d02eb9cb058.js +0 -2
  444. package/assets/esri/core/workers/chunks/8b046e28f879079caada.js +0 -1
  445. package/assets/esri/core/workers/chunks/8d738e9acc2f222235ea.js +0 -1
  446. package/assets/esri/core/workers/chunks/915e2711d3a2cfa402b2.js +0 -1
  447. package/assets/esri/core/workers/chunks/9a5ef33d99a8f89956ff.js +0 -1
  448. package/assets/esri/core/workers/chunks/9c09097e390985bbac58.js +0 -1
  449. package/assets/esri/core/workers/chunks/9c402657f63a4d5668d0.js +0 -1
  450. package/assets/esri/core/workers/chunks/9f51a69b8f1937a8794a.js +0 -1
  451. package/assets/esri/core/workers/chunks/a015c2f54eb91e43a1f4.js +0 -1
  452. package/assets/esri/core/workers/chunks/a232d05c0a055f398c6e.js +0 -1
  453. package/assets/esri/core/workers/chunks/a242ec19a7508de436da.js +0 -1
  454. package/assets/esri/core/workers/chunks/a25acccda8febac71a3d.js +0 -1
  455. package/assets/esri/core/workers/chunks/a432219de6a873f88776.js +0 -1
  456. package/assets/esri/core/workers/chunks/a6b75576d598ec161cc4.js +0 -1
  457. package/assets/esri/core/workers/chunks/a7f9f478bd1493fc3c76.js +0 -1
  458. package/assets/esri/core/workers/chunks/aac6a57edd7494125204.js +0 -1
  459. package/assets/esri/core/workers/chunks/afc0baf86ece710ef867.js +0 -1
  460. package/assets/esri/core/workers/chunks/b2662bfdbd1e3623ceb9.js +0 -1
  461. package/assets/esri/core/workers/chunks/b4bac22467e96be7a974.js +0 -1
  462. package/assets/esri/core/workers/chunks/b73c146d3e550eaf07eb.js +0 -1
  463. package/assets/esri/core/workers/chunks/b7af0e6b9aadbcaf6a0b.js +0 -1
  464. package/assets/esri/core/workers/chunks/bc78937986854e500b8e.js +0 -1
  465. package/assets/esri/core/workers/chunks/bd10d21545bca9a49de0.js +0 -1
  466. package/assets/esri/core/workers/chunks/bea170f08f5261e22d29.js +0 -1
  467. package/assets/esri/core/workers/chunks/bec3ee5ea945e1e07a35.js +0 -1
  468. package/assets/esri/core/workers/chunks/bf4dd8e50704e4040966.js +0 -1
  469. package/assets/esri/core/workers/chunks/c31ee5617c61a933cb0e.js +0 -1
  470. package/assets/esri/core/workers/chunks/c3e89c7c7b677bd18557.js +0 -1
  471. package/assets/esri/core/workers/chunks/cb81d524f12edcadb9bb.js +0 -1
  472. package/assets/esri/core/workers/chunks/cc0f3b9b153a0c232afe.js +0 -1
  473. package/assets/esri/core/workers/chunks/cd0c232f4e3868d91a05.js +0 -1
  474. package/assets/esri/core/workers/chunks/ce7ef7c4ca14d66d96f6.js +0 -1
  475. package/assets/esri/core/workers/chunks/d3d9d40556c847bba1a7.js +0 -1
  476. package/assets/esri/core/workers/chunks/d55cef8199b8246fea3f.js +0 -1
  477. package/assets/esri/core/workers/chunks/d8decaee2c780e1b5e35.js +0 -1
  478. package/assets/esri/core/workers/chunks/dc54d4a9fe1691862356.js +0 -1
  479. package/assets/esri/core/workers/chunks/dd5b362bded458afa2d6.js +0 -1
  480. package/assets/esri/core/workers/chunks/dde94664110ff231a52d.js +0 -1
  481. package/assets/esri/core/workers/chunks/de3e5d82502ee15b7eae.js +0 -1
  482. package/assets/esri/core/workers/chunks/e18badd11f360cc2912b.js +0 -1
  483. package/assets/esri/core/workers/chunks/e6f1ed5e56f1d9862821.js +0 -1
  484. package/assets/esri/core/workers/chunks/e6fe8b5fbe95de01453b.js +0 -1
  485. package/assets/esri/core/workers/chunks/eaab5ac049622986e3bc.js +0 -1
  486. package/assets/esri/core/workers/chunks/ee7e9bca57160694b3c4.js +0 -1
  487. package/assets/esri/core/workers/chunks/ef0085aa743b33cb549f.js +0 -1
  488. package/assets/esri/core/workers/chunks/f0250cecb243b32cdba7.js +0 -1
  489. package/assets/esri/core/workers/chunks/f1e5626a0cc1631a1efb.js +0 -1
  490. package/assets/esri/core/workers/chunks/f36345ebb9851ab92453.js +0 -1
  491. package/assets/esri/core/workers/chunks/f468c6ea2818a1f97e19.js +0 -1
  492. package/assets/esri/core/workers/chunks/f49c7bb5d134bcb22155.js +0 -1
  493. package/assets/esri/core/workers/chunks/f6c8e93ca2987e83f925.js +0 -1
  494. package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +0 -1
  495. package/assets/esri/themes/base/fonts/cdn.scss +0 -3
  496. package/views/3d/webgl-engine/effects/transparency/OITDimTechnique.js +0 -2
  497. /package/assets/esri/core/workers/chunks/{f706bfea34d22539b46a.js.LICENSE.txt → bf6c6bc15b0d2d82d1a4.js.LICENSE.txt} +0 -0
  498. /package/assets/esri/core/workers/chunks/{2647c739cda29361a463.js.LICENSE.txt → d87e504082e293640ece.js.LICENSE.txt} +0 -0
  499. /package/assets/esri/core/workers/chunks/{8a7a99533d02eb9cb058.js.LICENSE.txt → f31deeedb2508e81293b.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{applyPreferredHostToPortalItem as o,isPreferredUrlApplicable as n,getPreferredHost as s}from"../../layers/support/layerUtils.js";import l from"../Portal.js";import{createForItemRead as i}from"./jsonContext.js";import{instanceTypeToLayerTypes as p,getSublayersByLayerType as u,getFirstLayerOrTable as c,preprocessFSItemData as y,populateSceneServiceItemData as d,getNumLayersAndTables as f,layerTypeToLayerModuleType as m,createSublayerData as w}from"./loadUtils.js";import{hasTypeKeyword as h}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{requestServiceJSON as I}from"../../request/serviceJSON.js";async function b(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),v(e),e.validateItem&&e.validateItem(r),L(e,t)}function v(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function L(e,t){const r=e.instance,o=r.portalItem;if(!o)return;let{url:n}=o;const{title:s}=o,l=i(o,"portal-item");if("group"===r.type)return S(r,l,e);n&&"media"!==r.type&&r.read({url:n},l);const p=new a,{data:u,preferredHost:c}=await x(e,p,t);return n=o.url,"isUrlHostModified"in r&&(c?r.applyPreferredHost({preferredHost:c}):r.applyHostFromPortalItem()),u&&r.read(u,l),r.resourceReferences={portalItem:o,paths:l.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},l),g(r,l)}async function S(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!h(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return T(t,a)}return t.read({title:n},r),j(t,a)}async function T(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const n=i(a,"web-map");t.read(o,n),await r.populateGroupLayer(t,o,{context:n}),t.resourceReferences={portalItem:a,paths:n.readResourcePaths??[]}}async function j(t,r){let n;const{portalItem:s}=t;if(!s)return;const l=s.type,i=r.layerModuleTypeMap;if(!i)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(l){case"Feature Service":case"Feature Collection":n=i.FeatureLayer;break;case"Stream Service":n=i.StreamLayer;break;case"Scene Service":n=i.SceneLayer;break;case"Video Service":n=i.VideoLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${l}' is not supported as a 'GroupLayer'`)}const p="Video Service"===l,u=new a;let[m,{data:w}]=await Promise.all([n(),p?{data:null}:x(r,u)]),h=()=>m;if(p)return H(t,h,i);if("Feature Service"===l){const e=c(w)?.customParameters;w=s.url?(await y(w,s.url,u)).data:{},h=await E(w,i)||h;const{provider:r,preferredHost:a}=await U(s.url,{customParameters:e,loadContext:u});return o(s,a),await M(t,h,h,w,i,r)}return"Scene Service"===l&&s.url&&(w=await d(s,w,u)),f(w)>0?await M(t,h,null,w,i):await F(t,h,i)}async function F(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&M(e,t,null,{layers:o.layers?.map(w),tables:o.tables?.map(w)},r)}async function H(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&M(e,t,null,{layers:o.layers?.map(({id:e,name:t})=>({id:e,name:t}))},r)}async function M(e,t,r,a,o,n){let s=a.layers||[];const l=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&l.push(e)}),s=s.filter(e=>"Table"!==e?.layerDefinition?.type)):(s.reverse(),l.reverse()),s.forEach(r=>{const o=n?.(r);if(o||!n){const n=P(e,t(r),a,r,o);e.add(n)}}),l.length){const t=r?null:await o.FeatureLayer();l.forEach(o=>{const s=n?.(o);if(s||!n){const n=P(e,r?r(o):t,a,o,s);e.tables.add(n)}})}}function P(e,t,r,a,o){const n=e.portalItem,s={portalItem:n.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const i=new t(s);if("sourceJSON"in i&&(i.sourceJSON=o),"subtype-group"!==i.type&&"catalog"!==i.type&&(i.sublayerTitleMode="service-name"),"Feature Collection"===n.type){const e={origin:"portal-item",portal:n.portal||l.getDefault()};i.read(a,e);const t=r.showLegend;null!=t&&i.read({showLegend:t},e)}return i}async function x(e,t,r){if(!1===e.supportsData)return{data:void 0};const a=e.instance,n=a.portalItem;if(!n)return{data:void 0};let s=null;try{s="video"===a.type?null:await n.fetchData("json",r)}catch(l){}if(C(a)){let e=null;const{count:r,preferredHost:l}=await G(n,s,t);if(o(n,l),(s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=p(a.type),t=e?.length?u(s,e)[0]:c(s);t&&(a.layerId=t.id)}e=k(s,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),{data:e,preferredHost:l}}return{data:s}}async function G(e,r,a){if(r?.layers&&r?.tables)return{count:f(r)};const o=t(e.url);if(!o)return{count:1};const l=o.url.path,i=await a.fetchServiceMetadata(l,{customParameters:c(r)?.customParameters}).catch(()=>null);return{count:(r?.layers?.length??i?.layers?.length??0)+(r?.tables?.length??i?.tables?.length??0),preferredHost:n(e)?s():null}}function k(e,t){const{layerId:r}=t,a=e.layers?.find(e=>e.id===r)||e.tables?.find(e=>e.id===r);return a&&D(a,t)?a:null}function C(e){return"stream"!==e.type&&"layerId"in e}function D(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function U(e,t){const{layersJSON:a,preferredHost:o}=await r(e,t);if(!a)return{provider:null,preferredHost:o};const n=[...a.layers,...a.tables];return{provider:e=>n.find(t=>t.id===e.id),preferredHost:o}}async function E(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:p}of o){const e=p??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const l=await Promise.all(s),i=new Map;return Array.from(n).forEach((e,t)=>{i.set(e,l[t])}),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return i.get(t)}}export{b as load};
2
+ import e from"../../core/Error.js";import{parse as t}from"../../layers/support/arcgisLayerUrl.js";import{fetchFeatureService as r}from"../../layers/support/fetchService.js";import{LayerLoadContext as a}from"../../layers/support/LayerLoadContext.js";import{applyPreferredHostToPortalItem as o,isPreferredUrlApplicable as n,getPreferredHost as s}from"../../layers/support/layerUtils.js";import i from"../Portal.js";import{createForItemRead as l}from"./jsonContext.js";import{instanceTypeToLayerTypes as u,getSublayersByLayerType as p,getFirstLayerOrTable as c,preprocessFSItemData as y,populateSceneServiceItemData as d,getNumLayersAndTables as f,layerTypeToLayerModuleType as m,createSublayerData as w}from"./loadUtils.js";import{hasTypeKeyword as h}from"./portalItemUtils.js";import{loadStyleRenderer as g}from"../../renderers/support/styleUtils.js";import{requestServiceJSON as I}from"../../request/serviceJSON.js";async function v(e,t){const r=e.instance.portalItem;if(r?.id)return await r.load(t),L(e),e.validateItem&&e.validateItem(r),S(e,t)}async function b(e,t){const r=e.instance.portalItem;if(!r?.id)return!1;if(!r.loaded)return!1;const a=r.modified;return await r.reload(),t?.signal?.throwIfAborted(),a?.getTime()!==r.modified?.getTime()&&(L(e),e.validateItem&&e.validateItem(r),await S(e,t),!0)}function L(t){const r=t.instance.portalItem;if(!r?.type||!t.supportedTypes.includes(r.type))throw new e("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r?.type,expectedType:t.supportedTypes.join(", ")})}async function S(e,t){const r=e.instance,o=r.portalItem;if(!o)return;let{url:n}=o;const{title:s}=o,i=l(o,"portal-item");if("group"===r.type)return T(r,i,e);n&&"media"!==r.type&&r.read({url:n},i);const u=new a,{data:p,preferredHost:c}=await G(e,u,t);return n=o.url,"isUrlHostModified"in r&&(c?r.applyPreferredHost({preferredHost:c}):r.applyHostFromPortalItem()),p&&r.read(p,i),r.resourceReferences={portalItem:o,paths:i.readResourcePaths??[]},"subtype-group"!==r.type&&r.read({title:s},i),g(r,i)}async function T(t,r,a){const o=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:n,type:s}=o;if("Group Layer"===s){if(!h(o,"Map"))throw new e("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return j(t,a)}return t.read({title:n},r),F(t,a)}async function j(t,r){const a=t.portalItem,o=await a.fetchData("json");if(!o)return;if(!r.populateGroupLayer)throw new e("portal:missing-populate-group-layer","Missing populate group layer");const n=l(a,"web-map");t.read(o,n),await r.populateGroupLayer(t,o,{context:n}),t.resourceReferences={portalItem:a,paths:n.readResourcePaths??[]}}async function F(t,r){let n;const{portalItem:s}=t;if(!s)return;const i=s.type,l=r.layerModuleTypeMap;if(!l)throw new e("portal:missing-layer-module-type-map","Layer module type map is required to construct sub layers");switch(i){case"Feature Service":case"Feature Collection":n=l.FeatureLayer;break;case"Stream Service":n=l.StreamLayer;break;case"Scene Service":n=l.SceneLayer;break;case"Video Service":n=l.VideoLayer;break;default:throw new e("portal:unsupported-item-type-as-group",`The item type '${i}' is not supported as a 'GroupLayer'`)}const u="Video Service"===i,p=new a;let[m,{data:w}]=await Promise.all([n(),u?{data:null}:G(r,p)]),h=()=>m;if(u)return M(t,h,l);if("Feature Service"===i){const e=c(w)?.customParameters;w=s.url?(await y(w,s.url,p)).data:{},h=await E(w,l)||h;const{provider:r,preferredHost:a}=await A(s.url,{customParameters:e,loadContext:p});return o(s,a),await P(t,h,h,w,l,r)}return"Scene Service"===i&&s.url&&(w=await d(s,w,p)),f(w)>0?await P(t,h,null,w,l):await H(t,h,l)}async function H(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&P(e,t,null,{layers:o.layers?.map(w),tables:o.tables?.map(w)},r)}async function M(e,t,r){const{portalItem:a}=e;if(!a?.url)return;const o=await I(a.url);o&&P(e,t,null,{layers:o.layers?.map(({id:e,name:t})=>({id:e,name:t}))},r)}async function P(e,t,r,a,o,n){let s=a.layers||[];const i=a.tables||[];if("Feature Collection"===e.portalItem?.type?(s.forEach((e,t)=>{e.id=t,"Table"===e?.layerDefinition?.type&&i.push(e)}),s=s.filter(e=>"Table"!==e?.layerDefinition?.type)):(s.reverse(),i.reverse()),s.forEach(r=>{const o=n?.(r);if(o||!n){const n=x(e,t(r),a,r,o);e.add(n)}}),i.length){const t=r?null:await o.FeatureLayer();i.forEach(o=>{const s=n?.(o);if(s||!n){const n=x(e,r?r(o):t,a,o,s);e.tables.add(n)}})}}function x(e,t,r,a,o){const n=e.portalItem,s={portalItem:n.clone(),layerId:a.id};null!=a.url&&(s.url=a.url);const l=new t(s);if("sourceJSON"in l&&(l.sourceJSON=o),"subtype-group"!==l.type&&"catalog"!==l.type&&(l.sublayerTitleMode="service-name"),"Feature Collection"===n.type){const e={origin:"portal-item",portal:n.portal||i.getDefault()};l.read(a,e);const t=r.showLegend;null!=t&&l.read({showLegend:t},e)}return l}async function G(e,t,r){if(!1===e.supportsData)return{data:void 0};const a=e.instance,n=a.portalItem;if(!n)return{data:void 0};let s=null;try{s="video"===a.type?null:await n.fetchData("json",r)}catch(i){}if(D(a)){let e=null;const{count:r,preferredHost:i}=await k(n,s,t);if(o(n,i),(s?.layers||s?.tables)&&r>0){if(null==a.layerId){const e=u(a.type),t=e?.length?p(s,e)[0]:c(s);t&&(a.layerId=t.id)}e=C(s,a),"OrientedImageryLayer"===e?.layerType&&"oriented-imagery"===a.type&&a.supportedSourceTypes.add("Feature Layer"),e&&null!=s.showLegend&&(e.showLegend=s.showLegend)}return r>1&&"sublayerTitleMode"in a&&"service-name"!==a.sublayerTitleMode&&(a.sublayerTitleMode="item-title-and-service-name"),{data:e,preferredHost:i}}return{data:s}}async function k(e,r,a){if(r?.layers&&r?.tables)return{count:f(r)};const o=t(e.url);if(!o)return{count:1};const i=o.url.path,l=await a.fetchServiceMetadata(i,{customParameters:c(r)?.customParameters}).catch(()=>null);return{count:(r?.layers?.length??l?.layers?.length??0)+(r?.tables?.length??l?.tables?.length??0),preferredHost:n(e)?s():null}}function C(e,t){const{layerId:r}=t,a=e.layers?.find(e=>e.id===r)||e.tables?.find(e=>e.id===r);return a&&U(a,t)?a:null}function D(e){return"stream"!==e.type&&"layerId"in e}function U(e,t){const r="layerType"in e&&e.layerType,{type:a}=t;return!("feature"===a&&r&&"ArcGISFeatureLayer"!==e.layerType||"catalog"===a&&!r||"oriented-imagery"===a&&!r||"subtype-group"===a&&!r)}async function A(e,t){const{layersJSON:a,preferredHost:o}=await r(e,t);if(!a)return{provider:null,preferredHost:o};const n=[...a.layers,...a.tables];return{provider:e=>n.find(t=>t.id===e.id),preferredHost:o}}async function E(e,t){const{layers:r,tables:a}=e,o=[...r??[],...a??[]];if(!o.length)return;const n=new Set,s=[];for(const{layerType:u}of o){const e=u??"ArcGISFeatureLayer";if(n.has(e))continue;n.add(e);const r=t[m(e)];s.push(r())}const i=await Promise.all(s),l=new Map;return Array.from(n).forEach((e,t)=>{l.set(e,i[t])}),({layerType:e})=>{const t=e??"ArcGISFeatureLayer";return l.get(t)}}export{v as load,b as reload};
@@ -1,5 +1,4 @@
1
1
  import type Accessor from "../../core/Accessor.js";
2
- import type { ValidBindParameterType } from "./types.js";
3
2
 
4
3
  export interface ReplicaDefinitionProperties extends Partial<Pick<ReplicaDefinition, "creationDate" | "lastSyncDate" | "replicaFilters" | "replicaId" | "replicaName" | "replicaOwner" | "syncDirection">> {}
5
4
 
@@ -54,8 +53,6 @@ export interface ReplicaStaticDefinition {}
54
53
 
55
54
  export interface ReplicaFilters {}
56
55
 
57
- export type ReplicaParameterValue = ValidBindParameterType | boolean | null;
58
-
59
56
  export type ReplicaSyncDirection = "bidirectional" | "upload" | "download";
60
57
 
61
58
  export type ReplicaSyncDataFormat = "pbf" | "spbf" | "geoparquet" | "sqlite";
@@ -25,4 +25,4 @@ export type EsriGeometryType = "esriGeometryNull" | "esriGeometryPoint" | "esriG
25
25
  export type EsriFieldType = "esriFieldTypeSmallInteger" | "esriFieldTypeInteger" | "esriFieldTypeSingle" | "esriFieldTypeDouble" | "esriFieldTypeString" | "esriFieldTypeDate" | "esriFieldTypeOID" | "esriFieldTypeGeometry" | "esriFieldTypeBlob" | "esriFieldTypeRaster" | "esriFieldTypeGUID" | "esriFieldTypeGlobalID" | "esriFieldTypeXML" | "esriFieldTypeBigInteger" | "esriFieldTypeDateOnly" | "esriFieldTypeTimeOnly" | "esriFieldTypeTimestampOffset";
26
26
 
27
27
  /** @since 5.0 */
28
- export type ValidBindParameterType = Record<string, any> | number | bigint | string | Date | BaseGeometry | Array<ValidBindParameterType>;
28
+ export type ValidBindParameterType = Record<string, any> | number | bigint | string | Date | BaseGeometry | boolean | Array<ValidBindParameterType>;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../geometry/Geometry.js";import n from"../../../geometry/Multipoint.js";import o from"../../../geometry/Point.js";import r from"../../../geometry/Polygon.js";import a from"../../../geometry/Polyline.js";import{WasmProvenanceBehaviorValues as i}from"./WasmQueryWrapperInterfaces.js";function l(e,t){const n=new t.ArrayValue;return n.deleteLater(),e.forEach(e=>{n.add_value(f(e,t))}),n}function s(e,t){const n=new t.ObjectValue;n.deleteLater();for(const[o,r]of Object.entries(e))n.set_key_value(o,f(r,t));return n}function u(t,i){if(t instanceof n)return g(t,i);if(t instanceof o)return h(t,i);if(t instanceof a||t instanceof r)return p(t,i);throw new e("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:t})}function y(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function m(t,n,o){if(!t.extent)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",t.extent);if(!t.quantizeMode)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",t.quantizeMode);if(!t.tolerance)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",t.quantizeMode);n.output_quantization_parameters={extent:{xmax:t.extent.xmax,ymax:t.extent.ymax,xmin:t.extent.xmin,ymin:t.extent.ymin},quantize_mode:o.esriQuantizeMode[t.quantizeMode],tolerance:t.tolerance}}function c(e,t){t.provenance_behavior={value:i[e]}}function f(e,n){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof t)return u(e,n);if(Array.isArray(e)){const t=new n.ArrayValue;return t.deleteLater(),e.forEach(e=>{t.add_value(f(e,n))}),t}return s(e,n)}function p(e,t){const n=new t.GeometryValue;n.deleteLater(),n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],i=[];let l=[];e instanceof a?(n.geometry_type=t.esriGeometryType.esriGeometryPolyline,l=e.paths):e instanceof r&&(n.geometry_type=t.esriGeometryType.esriGeometryPolygon,l=e.rings);let s=0,u=0;return l.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{o[u]=e,u++})}),i[s]=t,s++}),n.coords=new Float64Array(o),n.lengths=new Uint32Array(i),n}function g(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=n.geometry_type=t.esriGeometryType.esriGeometryMultipoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=e.points.length;let a=0;return e.points.forEach(e=>{e.forEach(e=>{o[a]=e,a++})}),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}function h(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=t.esriGeometryType.esriGeometryPoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=1,o[0]=e.x,o[1]=e.y;let a=2;return e.hasZ&&(o[a]=e.z,a++),e.hasM&&(o[a]=e.m,a++),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}export{l as bindParamArrayToWasm,s as bindParamObjectToWasm,u as geometryToWasm,y as setInputQuantizationParametersOnEncoder,m as setOutputQuantizationParametersOnEncoder,c as setProvenanceBehaviorOnEncoder};
2
+ import e from"../../../core/Error.js";import t from"../../../geometry/Geometry.js";import n from"../../../geometry/Multipoint.js";import o from"../../../geometry/Point.js";import r from"../../../geometry/Polygon.js";import a from"../../../geometry/Polyline.js";import{WasmProvenanceBehaviorValues as i}from"./WasmQueryWrapperInterfaces.js";function l(e,t){const n=new t.ArrayValue;return n.deleteLater(),e.forEach(e=>{n.add_value(f(e,t))}),n}function s(e,t){const n=new t.ObjectValue;n.deleteLater();for(const[o,r]of Object.entries(e))n.set_key_value(o,f(r,t));return n}function u(t,i){if(t instanceof n)return g(t,i);if(t instanceof o)return h(t,i);if(t instanceof a||t instanceof r)return p(t,i);throw new e("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:t})}function y(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function m(t,n,o){if(!t.extent)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",t.extent);if(!t.quantizeMode)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",t.quantizeMode);if(!t.tolerance)throw new e("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",t.quantizeMode);n.output_quantization_parameters={extent:{xmax:t.extent.xmax,ymax:t.extent.ymax,xmin:t.extent.xmin,ymin:t.extent.ymin},quantize_mode:o.esriQuantizeMode[t.quantizeMode],tolerance:t.tolerance}}function c(e,t){t.provenance_behavior={value:i[e]}}function f(e,n){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof t)return u(e,n);if(Array.isArray(e)){const t=new n.ArrayValue;return t.deleteLater(),e.forEach(e=>{t.add_value(f(e,n))}),t}return s(e,n)}function p(e,t){const n=new t.GeometryValue;n.deleteLater(),n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],i=[];let l=[];e instanceof a?(n.geometry_type=t.esriGeometryType.esriGeometryPolyline,l=e.paths):e instanceof r&&(n.geometry_type=t.esriGeometryType.esriGeometryPolygon,l=e.rings);let s=0,u=0;return l.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{o[u]=e,u++})}),i[s]=t,s++}),n.coords=new Float64Array(o),n.lengths=new Uint32Array(i),n}function g(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=n.geometry_type=t.esriGeometryType.esriGeometryMultipoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=e.points.length;let a=0;return e.points.forEach(e=>{e.forEach(e=>{o[a]=e,a++})}),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}function h(e,t){const n=new t.GeometryValue;n.deleteLater(),n.geometry_type=t.esriGeometryType.esriGeometryPoint,n.has_z=e.hasZ,n.has_m=e.hasM;const o=[],r=[];r[0]=1,o[0]=e.x,o[1]=e.y;let a=2;return e.hasZ&&(o[a]=e.z,a++),e.hasM&&(o[a]=e.m,a++),n.coords=new Float64Array(o),n.lengths=new Uint32Array(r),n}export{l as bindParamArrayToWasm,s as bindParamObjectToWasm,f as convertRecursiveBindParam,u as geometryToWasm,y as setInputQuantizationParametersOnEncoder,m as setOutputQuantizationParametersOnEncoder,c as setProvenanceBehaviorOnEncoder};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../../core/Error.js";import n from"../../../geometry/Geometry.js";import{geometryToWasm as t,bindParamArrayToWasm as r,bindParamObjectToWasm as i}from"./queryToWasmEncodedFactories.js";import{WasmQuantizeOriginPositionTypeCode as a}from"./WasmSerializedLayerData.js";function o(e,n){const t=new n.UnregisterReplicaRequestEncoder;if(t.deleteLater(),e.unregisterAll)t.set_unregister_all();else{const{replicaIds:n=[]}=e;n.forEach(e=>t.add_replica_id(e))}return t}function c(e,n){const t=new n.CreateReplicaRequestEncoder;return t.deleteLater(),e.requestedReplicaId&&(t.replica_id=e.requestedReplicaId),e.requestedReplicaName&&(t.requested_replica_name=e.requestedReplicaName),t.sync_direction=h(e.syncDirection,n),t.sync_data_format=g(e.syncDataFormat,n),t.async=!1,"reference"===e.type&&(t.reference_replica=l(e.referenceReplica,n)),"filter"===e.type&&(t.replica_filters=s(e.replicaFilters,n)),t}function l(e,n){const t=new n.ReferenceReplica;return t.deleteLater(),t.replica_id=e.replicaId,t}function s(e,n){const t=d(e.staticDefinition,n),r=new n.ReplicaFilters(t);return r.deleteLater(),e.transform&&(r.transform=p(e.transform)),e.inputSpatialReference&&(r.input_spatial_reference=e.inputSpatialReference),r}function p(e){return{quantizeOriginPosition:{value:u(e?.quantizeOriginPosition)},scale:{xScale:e.scale.xScale,yScale:e.scale.yScale,mScale:e.scale.mScale,zScale:e.scale.zScale},translate:{xTranslate:e.translate.xTranslate,yTranslate:e.translate.yTranslate,mTranslate:e.translate.mTranslate,zTranslate:e.translate.zTranslate}}}function u(e){return"lower-left"===e?a.lowerLeft:a.upperLeft}function d(n,t){const r=new t.StaticDefinition;r.deleteLater();const i=n.entityTypeReplicaDefinitions??[],a=n.relationshipTypeReplicaDefinitions??[];if(i.length<1&&a.length<1)throw new e("knowledge-graph:replica-invalid-static-definition","A Filter Replica static definition must include at least one entity type or relationship type replica definition");for(const e of i)r.add_entity_type_replica_definition(f(e,t));for(const e of a)r.add_relationship_type_replica_definition(m(e,t));return r}function f(e,n){const t=new n.EntityTypeReplicaDefinition;return t.deleteLater(),y(e,n,t),e.documentOptions&&(t.document_options=_(e.documentOptions,n)),t}function m(e,n){const t=new n.RelationshipTypeReplicaDefinition;return t.deleteLater(),y(e,n,t),t}function y(e,n,t){if(t.type_name=e.typeName,t.open_cypher_where_clause=e.openCypherWhereClause??"",e.provenanceOptions&&(t.provenance_options=D(e.provenanceOptions,n)),e.parameters)for(const[r,i]of Object.entries(e.parameters))void 0!==i&&t.add_parameter(r,v(i,n));return t}function _(e,n){const t=e.includeConnectedDocuments?w(e,n):void 0,r=new n.DocumentOptions(t);return r.deleteLater(),r}function w(e,n){const t=D(e.includeDocumentProvenance?{includeProvenance:!0,includeSourceDocuments:e.includeDocumentSourceDocuments}:{includeProvenance:!1},n),r=new n.IncludeConnectedDocuments(t);return r.deleteLater(),r}function D(e,n){const t=R(e,n),r=new n.ProvenanceOptions(t);return r.deleteLater(),r}function R(e,n){const t=new n.IncludeProvenance("includeSourceDocuments"in e&&e.includeSourceDocuments);return t.deleteLater(),t}function h(n,t){const r=t.SyncDirection,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction: ${n}`);return a}function g(n,t){const r=t.SyncDataFormat,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format: ${n}`);return a}function v(a,o){if(null==a)return null;if("boolean"==typeof a||"string"==typeof a||"number"==typeof a||"bigint"==typeof a)return a;if(a instanceof Date)return a;if(a instanceof n)return t(a,o);if(Array.isArray(a))return r(a,o);if("object"==typeof a)return i(a,o);throw new e("knowledge-graph:replica-invalid-parameter-value","A replica parameter contains an unsupported value type",{value:a})}export{v as convertReplicaParameterValue,_ as documentOptionsToWasm,f as entityTypeReplicaDefinitionToWasm,w as includeConnectedDocumentsToWasm,R as includeProvenanceToWasm,y as namedTypeReplicaDefinitionToWasm,D as provenanceOptionsToWasm,l as referenceReplicaToWasm,m as relationshipTypeReplicaDefinitionToWasm,s as replicaFiltersToWasm,o as replicaIdsToWasmUnregisterReplicaRequestEncoder,c as replicaToWasmCreateReplicaRequestEncoder,d as staticDefinitionToWasm,u as toWasmQuantizeOriginPosition,g as toWasmSyncDataFormatEnum,h as toWasmSyncDirectionEnum,p as transformToWasm};
2
+ import e from"../../../core/Error.js";import{convertRecursiveBindParam as n}from"./queryToWasmEncodedFactories.js";import{WasmQuantizeOriginPositionTypeCode as t}from"./WasmSerializedLayerData.js";function r(e,n){const t=new n.UnregisterReplicaRequestEncoder;if(t.deleteLater(),e.unregisterAll)t.set_unregister_all();else{const{replicaIds:n=[]}=e;n.forEach(e=>t.add_replica_id(e))}return t}function i(e,n){const t=new n.CreateReplicaRequestEncoder;return t.deleteLater(),e.requestedReplicaId&&(t.replica_id=e.requestedReplicaId),e.requestedReplicaName&&(t.requested_replica_name=e.requestedReplicaName),t.sync_direction=w(e.syncDirection,n),t.sync_data_format=D(e.syncDataFormat,n),t.async=!1,"reference"===e.type&&(t.reference_replica=a(e.referenceReplica,n)),"filter"===e.type&&(t.replica_filters=c(e.replicaFilters,n)),t}function a(e,n){const t=new n.ReferenceReplica;return t.deleteLater(),t.replica_id=e.replicaId,t}function c(e,n){const t=s(e.staticDefinition,n),r=new n.ReplicaFilters(t);return r.deleteLater(),e.transform&&(r.transform=o(e.transform)),e.inputSpatialReference&&(r.input_spatial_reference=e.inputSpatialReference),r}function o(e){return{quantizeOriginPosition:{value:l(e?.quantizeOriginPosition)},scale:{xScale:e.scale.xScale,yScale:e.scale.yScale,mScale:e.scale.mScale,zScale:e.scale.zScale},translate:{xTranslate:e.translate.xTranslate,yTranslate:e.translate.yTranslate,mTranslate:e.translate.mTranslate,zTranslate:e.translate.zTranslate}}}function l(e){return"lower-left"===e?t.lowerLeft:t.upperLeft}function s(n,t){const r=new t.StaticDefinition;r.deleteLater();const i=n.entityTypeReplicaDefinitions??[],a=n.relationshipTypeReplicaDefinitions??[];if(i.length<1&&a.length<1)throw new e("knowledge-graph:replica-invalid-static-definition","A Filter Replica static definition must include at least one entity type or relationship type replica definition");for(const e of i)r.add_entity_type_replica_definition(p(e,t));for(const e of a)r.add_relationship_type_replica_definition(u(e,t));return r}function p(e,n){const t=new n.EntityTypeReplicaDefinition;return t.deleteLater(),d(e,n,t),e.documentOptions&&(t.document_options=f(e.documentOptions,n)),t}function u(e,n){const t=new n.RelationshipTypeReplicaDefinition;return t.deleteLater(),d(e,n,t),t}function d(e,t,r){if(r.type_name=e.typeName,r.open_cypher_where_clause=e.openCypherWhereClause??"",e.provenanceOptions&&(r.provenance_options=y(e.provenanceOptions,t)),e.parameters)for(const[i,a]of Object.entries(e.parameters))void 0!==a&&r.add_parameter(i,n(a,t));return r}function f(e,n){const t=e.includeConnectedDocuments?m(e,n):void 0,r=new n.DocumentOptions(t);return r.deleteLater(),r}function m(e,n){const t=y(e.includeDocumentProvenance?{includeProvenance:!0,includeSourceDocuments:e.includeDocumentSourceDocuments}:{includeProvenance:!1},n),r=new n.IncludeConnectedDocuments(t);return r.deleteLater(),r}function y(e,n){const t=_(e,n),r=new n.ProvenanceOptions(t);return r.deleteLater(),r}function _(e,n){const t=new n.IncludeProvenance("includeSourceDocuments"in e&&e.includeSourceDocuments);return t.deleteLater(),t}function w(n,t){const r=t.SyncDirection,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-direction",`Unsupported replica sync direction: ${n}`);return a}function D(n,t){const r=t.SyncDataFormat,i=n.toUpperCase(),a=r?.[i];if(!a)throw new e("knowledge-graph:replica-invalid-sync-data-format",`Unsupported replica sync data format: ${n}`);return a}export{f as documentOptionsToWasm,p as entityTypeReplicaDefinitionToWasm,m as includeConnectedDocumentsToWasm,_ as includeProvenanceToWasm,d as namedTypeReplicaDefinitionToWasm,y as provenanceOptionsToWasm,a as referenceReplicaToWasm,u as relationshipTypeReplicaDefinitionToWasm,c as replicaFiltersToWasm,r as replicaIdsToWasmUnregisterReplicaRequestEncoder,i as replicaToWasmCreateReplicaRequestEncoder,s as staticDefinitionToWasm,l as toWasmQuantizeOriginPosition,D as toWasmSyncDataFormatEnum,w as toWasmSyncDirectionEnum,o as transformToWasm};
@@ -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 o}from"../../core/lang.js";import{property as i,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 m}from"../../geometry/support/typeUtils.js";import d 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 v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as j}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.returnAggregateIds=!1,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!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 o=t[e];Array.isArray(o)?r[e]=o.map(t=>t instanceof Date?t.getTime():t):o instanceof Date?r[e]=o.getTime():r[e]=o}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(o({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,returnAggregateIds:this.returnAggregateIds,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,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([i({json:{write:!0}})],R.prototype,"aggregateIds",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"compactGeometryEnabled",void 0),t([i({json:{write:!0}})],R.prototype,"datumTransformation",void 0),t([s("datumTransformation")],R.prototype,"castDatumTransformation",null),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"defaultSpatialReferenceEnabled",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"distance",void 0),t([i({type:d,json:{write:!0}})],R.prototype,"dynamicDataSource",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"formatOf3DObjects",void 0),t([i({type:[c],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.fullText&&this.fullText.length>0}}}}})],R.prototype,"fullText",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"gdbVersion",void 0),t([i({types:m,json:{read:u,write:!0}})],R.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"groupByFieldsForStatistics",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"having",void 0),t([i({type:Date})],R.prototype,"historicMoment",void 0),t([v("historicMoment")],R.prototype,"writeHistoricMoment",null),t([i({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),t([i({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([i({type:["xyFootprint"],json:{write:!0}})],R.prototype,"multipatchOption",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),t([i({json:{write:!0}})],R.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),t([i({type:p,json:{name:"outSR",write:!0}})],R.prototype,"outSpatialReference",void 0),t([i({type:[f],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],R.prototype,"outStatistics",void 0),t([i({json:{write:!0}})],R.prototype,"parameterValues",void 0),t([v("parameterValues")],R.prototype,"writeParameterValues",null),t([i({type:l,json:{write:!0}})],R.prototype,"pixelSize",void 0),t([i({type:y,json:{write:!0}})],R.prototype,"quantizationParameters",void 0),t([i({type:[Object],json:{write:!0}})],R.prototype,"rangeValues",void 0),t([i({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:"relation"===this.spatialRelationship}}}}})],R.prototype,"relationParameter",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),t([i({type:Boolean,json:{name:"returnAggIds",write:{overridePolicy(t){return{enabled:t&&!!this.groupByFieldsForStatistics?.length&&!!this.outStatistics?.length}}}}})],R.prototype,"returnAggregateIds",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnCentroid",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnDistinctValues",void 0),t([i({type:Boolean,json:{default:!0,write:!0}})],R.prototype,"returnExceededLimitFeatures",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnQueryGeometry",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],R.prototype,"returnZ",void 0),t([i({type:Boolean,json:{write:!0}})],R.prototype,"returnTrueCurves",void 0),t([i({type:p,json:{write:!0}})],R.prototype,"sourceSpatialReference",void 0),t([j(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([v("start"),v("num")],R.prototype,"writeStart",null),t([i({type:String,json:{write:!0}})],R.prototype,"sqlFormat",void 0),t([i({type:String,json:{write:!0}})],R.prototype,"text",void 0),t([i({type:g,json:{write:!0}})],R.prototype,"timeExtent",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],R.prototype,"timeReferenceUnknownClient",void 0),t([j(S,{ignoreUnknown:!1}),i({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([i()],R.prototype,"outDistance",void 0),t([i({type:String,json:{write:{overridePolicy(t){return{enabled:null!=t||null!=this.start&&this.start>0}}}}})],R.prototype,"where",void 0),t([v("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"./QuantizationParameters.js";import{spatialRelKebabDict as h}from"./spatialRelationships.js";import f from"./StatisticDefinition.js";import g from"../../time/TimeExtent.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import{enumeration as j}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.returnAggregateIds=!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,returnAggregateIds:this.returnAggregateIds,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([v("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([v("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,"returnAggregateIds",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([j(h,{ignoreUnknown:!1,name:"spatialRel"})],R.prototype,"spatialRelationship",void 0),t([o({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),t([v("start"),v("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([j(S,{ignoreUnknown:!1}),o({json:{write:{overridePolicy(t){return{enabled:!!t&&null!=this.distance}}}}})],R.prototype,"units",void 0),t([o()],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([v("where")],R.prototype,"writeWhere",null),R=w=t([n("esri.rest.support.Query")],R);export{R 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{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as o,subclass as r}from"../../../../core/accessorSupport/decorators.js";import s from"../../../../geometry/SpatialReference.js";import{writer as i}from"../../../../core/accessorSupport/decorators/writer.js";let p=class extends e{constructor(t){super(t),this.sessionId=void 0,this.outSpatialReference=null}writeOutSR(t,e,o){if(null!=t){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=t;e[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};t([o({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),t([o({type:s,json:{write:{target:"outSR"}}})],p.prototype,"outSpatialReference",void 0),t([i("outSpatialReference")],p.prototype,"writeOutSR",null),p=t([r("esri.rest.versionManagement.gdbVersion.support.ConflictsParameters")],p);const a=p;export{a as default};
2
+ import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";import s from"../../../../geometry/SpatialReference.js";import{writer as i}from"../../../../core/accessorSupport/decorators/writer.js";let p=class extends o{constructor(t){super(t)}writeOutSR(t,o,e){if(null!=t){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=t;o[e]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};t([e({type:String,json:{write:!0}})],p.prototype,"sessionId",void 0),t([e({type:s,json:{write:{target:"outSR"}}})],p.prototype,"outSpatialReference",void 0),t([i("outSpatialReference")],p.prototype,"writeOutSR",null),p=t([r("esri.rest.versionManagement.gdbVersion.support.ConflictsParameters")],p);const a=p;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import i from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";const n=new t({objectIds:"object-ids",features:"features"});let a=class extends o{constructor(e){super(e),this.sessionId=null,this.resultType="object-ids",this.layers=null,this.outSpatialReference=null,this.fromMoment=null,this.moment=null}writeOutSR(e,t,o){if(null!=e){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=e;t[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};e([r({type:String,json:{write:!0}})],a.prototype,"sessionId",void 0),e([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],a.prototype,"resultType",void 0),e([r({type:[Number],json:{write:!0}})],a.prototype,"layers",void 0),e([r({type:i,json:{write:{target:"outSR"}}})],a.prototype,"outSpatialReference",void 0),e([p("outSpatialReference")],a.prototype,"writeOutSR",null),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"fromMoment",void 0),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"moment",void 0),a=e([s("esri.rest.versionManagement.gdbVersion.support.DifferencesParameters")],a);const l=a;export{l as default};
2
+ import{__decorate as e}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import i from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";const n=new t({objectIds:"object-ids",features:"features"});let a=class extends o{constructor(e){super(e)}writeOutSR(e,t,o){if(null!=e){const{wkid:r,latestWkid:s,wkt:i,wkt2:p}=e;t[o]=JSON.stringify({wkid:r??void 0,latestWkid:s??void 0,wkt:i??void 0,wkt2:p??void 0})}}};e([r({type:String,json:{write:!0}})],a.prototype,"sessionId",void 0),e([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],a.prototype,"resultType",void 0),e([r({type:[Number],json:{write:!0}})],a.prototype,"layers",void 0),e([r({type:i,json:{write:{target:"outSR"}}})],a.prototype,"outSpatialReference",void 0),e([p("outSpatialReference")],a.prototype,"writeOutSR",null),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"fromMoment",void 0),e([r({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?e.getTime():null}}}})],a.prototype,"moment",void 0),a=e([s("esri.rest.versionManagement.gdbVersion.support.DifferencesParameters")],a);const m=a;export{m as default};
@@ -0,0 +1,25 @@
1
+ import type Graphic from "../../../../Graphic.js";
2
+
3
+ /** Represents the object IDs that were inserted, updated, or deleted to/from a layer. */
4
+ export interface DifferencesType {
5
+ /** The ID of the layer with differences. */
6
+ layerId: number;
7
+ /** The IDs of objects inserted into this layer. */
8
+ inserts: number[];
9
+ /** The IDs of objects updated in this layer. */
10
+ updates: number[];
11
+ /** The IDs of objects deleted from this layer. */
12
+ deletes: number[];
13
+ }
14
+
15
+ /** Represents the Graphic objects (features) that were inserted, updated, or deleted to/from a layer. */
16
+ export interface FeaturesType {
17
+ /** The ID of the layer with differences. */
18
+ layerId: number;
19
+ /** The Graphic objects (features) inserted into this layer. */
20
+ inserts: Graphic[];
21
+ /** The Graphic objects (features) updated in this layer. */
22
+ updates: Graphic[];
23
+ /** The Graphic objects (features) deleted from this layer. */
24
+ deletes: Graphic[];
25
+ }
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{JSONSupport as o}from"../../../../core/JSONSupport.js";import{property as s,subclass as e}from"../../../../core/accessorSupport/decorators.js";let r=class extends o{constructor(t){super(t),this.sessionId=void 0,this.setInspected=void 0,this.conflicts=void 0}};t([s({type:String,json:{write:!0}})],r.prototype,"sessionId",void 0),t([s({type:Boolean,json:{write:!0}})],r.prototype,"setInspected",void 0),t([s({type:[Object],json:{write:!0}})],r.prototype,"conflicts",void 0),r=t([e("esri.rest.versionManagement.gdbVersion.support.InspectConflictsParameters")],r);const i=r;export{i as default};
2
+ import{__decorate as o}from"tslib";import{JSONSupport as t}from"../../../../core/JSONSupport.js";import{property as e,subclass as r}from"../../../../core/accessorSupport/decorators.js";let s=class extends t{constructor(o){super(o)}};o([e({type:String,json:{write:!0}})],s.prototype,"sessionId",void 0),o([e({type:Boolean,json:{write:!0}})],s.prototype,"setInspected",void 0),o([e({type:Boolean,json:{write:!0}})],s.prototype,"inspectAll",void 0),o([e({type:[Object],json:{write:!0}})],s.prototype,"conflicts",void 0),s=o([r("esri.rest.versionManagement.gdbVersion.support.InspectConflictsParameters")],s);const p=s;export{p as default};
@@ -12,21 +12,19 @@ export default class ReconcileParameters extends JSONSupport {
12
12
  /**
13
13
  * Specifies whether the reconcile should be aborted if conflicts are found. The default is false
14
14
  *
15
- * @default false
16
15
  * @since 5.0
17
16
  */
18
- accessor abortIfConflicts: boolean;
17
+ accessor abortIfConflicts: boolean | null | undefined;
19
18
  /**
20
19
  * Specifies the conditions required for conflicts to occur are defined by object (row) or attribute (column).
21
20
  *
22
21
  * @since 5.0
23
22
  */
24
- accessor conflictDetection: DetectionType | null;
23
+ accessor conflictDetection: DetectionType | null | undefined;
25
24
  /**
26
25
  * Specifies if post will occur after calling reconcile. Causes post to occur immediately after reconcile, false by default.
27
26
  *
28
- * @default false
29
27
  * @since 5.0
30
28
  */
31
- accessor withPost: boolean;
29
+ accessor withPost: boolean | null | undefined;
32
30
  }
@@ -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 o}from"../../../../core/jsonMap.js";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as i}from"../../../../core/accessorSupport/ensureType.js";var p;const n=new o({byObject:"by-object",byAttribute:"by-attribute"});let c=p=class extends e{static from(t){return i(p,t)}constructor(t){super(t),this.sessionId=void 0,this.abortIfConflicts=!1,this.conflictDetection=null,this.withPost=!1}};t([r({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"abortIfConflicts",void 0),t([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],c.prototype,"conflictDetection",void 0),t([r({type:Boolean,json:{write:!0}})],c.prototype,"withPost",void 0),c=p=t([s("esri.rest.versionManagement.gdbVersion.support.ReconcileParameters")],c);const a=c;export{a as default};
2
+ import{__decorate as o}from"tslib";import{JSONMap as t}from"../../../../core/jsonMap.js";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as r,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as p}from"../../../../core/accessorSupport/ensureType.js";var i;const n=new t({byObject:"by-object",byAttribute:"by-attribute"});let c=i=class extends e{static from(o){return p(i,o)}constructor(o){super(o)}};o([r({type:String,json:{write:!0}})],c.prototype,"sessionId",void 0),o([r({type:Boolean,json:{write:!0}})],c.prototype,"abortIfConflicts",void 0),o([r({type:n.apiValues,json:{type:n.jsonValues,read:n.read,write:n.write}})],c.prototype,"conflictDetection",void 0),o([r({type:Boolean,json:{write:!0}})],c.prototype,"withPost",void 0),c=i=o([s("esri.rest.versionManagement.gdbVersion.support.ReconcileParameters")],c);const a=c;export{a as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const c="20260505",d="d1fbdf944a1168b076cc9dfe308e740d09c37527";export{c as buildDate,d as commitHash};
2
+ const c="20260508",d="9e7933d5cd6930bf4c1cd5c92346bcc204c32206";export{c as buildDate,d as commitHash};
@@ -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{TileClipper as r}from"../../geometry/support/TileClipper.js";import{importLazily as t}from"./utils.js";const o=t(()=>import("../../geometry/operators/json/bufferOperator.js")),s=t(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=t(()=>import("../../geometry/operators/json/lengthOperator.js")),n=t(()=>import("../../geometry/operators/json/generalizeOperator.js")),i=t(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=t(()=>import("../../geometry/operators/json/offsetOperator.js")),f=t(()=>import("../../geometry/operators/json/simplifyOperator.js")),a=t(()=>import("../../geometry/operators/support/jsonConverter.js")),c=512;let l;function g(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([p.getImportPromise(),i.getImportPromise()]);case"CIMGeometricEffectTaperedPolygon":return Promise.all([f.getImportPromise(),m.getImportPromise(),n.getImportPromise()]);default:return Promise.resolve()}}function u(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?a.getImportPromise():Promise.resolve()}class y{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function P(t,o,s){if(!t)return null;l||(l=new r(0,0,0,1));const m=s?-1:1,n="esriGeometryPolygon"===t.geometryType,i=n?3:2,p=n?3:2;let f,a;for(l.reset(i),l.setPixelMargin(o+1),l.setExtent(c);t.nextPath();)if(!(t.pathSize<p)){for(t.nextPoint(),f=t.x,a=m*t.y,l.moveTo(f,a);t.nextPoint();)f=t.x,a=m*t.y,l.lineTo(f,a);n&&l.close()}const g=l.result(!1);if(g){const r=e.createEmptyOptimizedCIM(t.geometryType);for(const e of g){r.startPath();for(const t of e)r.pushXY(t.x,m*t.y)}return r.reset(),r}return null}export{y as SimpleEffectCursor,P as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,n as lazyGeneralizeOperator,i as lazyGraphicBufferOperator,a as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOperator,g as loadGeometryOperatorsForEffect,u as loadGeometryOperatorsForPlacement};
2
+ import{GeometryCursor as e}from"../../geometry/GeometryCursor.js";import{TileClipper as r}from"../../geometry/support/TileClipper.js";import{importLazily as t}from"./utils.js";const o=t(()=>import("../../geometry/operators/json/bufferOperator.js")),s=t(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=t(()=>import("../../geometry/operators/json/lengthOperator.js")),n=t(()=>import("../../geometry/operators/json/generalizeOperator.js")),i=t(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=t(()=>import("../../geometry/operators/json/offsetOperator.js")),f=t(()=>import("../../geometry/operators/json/simplifyOperator.js")),a=t(()=>import("../../geometry/operators/support/jsonConverter.js")),c=512;let l;function g(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([p.getImportPromise(),i.getImportPromise()]);case"CIMGeometricEffectControlMeasureLine":return p.getImportPromise();case"CIMGeometricEffectTaperedPolygon":return Promise.all([f.getImportPromise(),m.getImportPromise(),n.getImportPromise()]);default:return Promise.resolve()}}function u(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?a.getImportPromise():Promise.resolve()}class y{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function P(t,o,s){if(!t)return null;l||(l=new r(0,0,0,1));const m=s?-1:1,n="esriGeometryPolygon"===t.geometryType,i=n?3:2,p=n?3:2;let f,a;for(l.reset(i),l.setPixelMargin(o+1),l.setExtent(c);t.nextPath();)if(!(t.pathSize<p)){for(t.nextPoint(),f=t.x,a=m*t.y,l.moveTo(f,a);t.nextPoint();)f=t.x,a=m*t.y,l.lineTo(f,a);n&&l.close()}const g=l.result(!1);if(g){const r=e.createEmptyOptimizedCIM(t.geometryType);for(const e of g){r.startPath();for(const t of e)r.pushXY(t.x,m*t.y)}return r.reset(),r}return null}export{y as SimpleEffectCursor,P as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,n as lazyGeneralizeOperator,i as lazyGraphicBufferOperator,a as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOperator,g as loadGeometryOperatorsForEffect,u as loadGeometryOperatorsForPlacement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{pt2px as o,px2pt as n}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isExtent as P,isPolygon as S,isPolyline as w,isPoint as x,isMultipoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import F from"./Rect.js";import U from"./TextRasterizer.js";import{isMarkerScreenAligned as A,isCIMFill as j,getSize as G,getNumericValue as D,isSVGImage as H,getRelativeGradientSize as E,fromCIMFontDecoration as B,fromCIMFontStyle as X,fromCIMHorizontalAlignment as J,fromCIMVerticalAlignment as N,getFillColor as O,getStrokeColor as q,getStrokeWidth as V,getFontWeight as W,getFontStyle as Y}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as K,createSvgElement as Q}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as Z,glyphSize as tt,hittestToleranceSmallSymbol as et,hittestSmallSymbolThreshold as rt}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as st}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as it,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const nt=Math.PI/180,at=.5,lt=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ht{constructor(t){this._t=t}static createIdentity(){return new ht([1,0,0,0,1,0])}clone(){const t=this._t;return new ht(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ht([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ht([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ht([e,-r,0,r,e,0])}rotate(t){return ht.multiply(this,ht.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,o=s[0]*i[0]+s[3]*i[1],n=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=o,m[1]=n,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ht([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,o=-t[1]*e,n=-t[3]*e,a=t[0]*e;return new ht([i,o,r,n,a,s])}}class ct{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ht.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ht.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ht.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){let r=new b(a.fromJSONCIM(e));for(const s of t){const t=T(s);t&&(r=t.execute(r,s,this.geomUnitsPerPoint(),null))}return r}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=dt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const o=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(o){let e=null;for(;(e=o.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(x(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(S(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(w(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=D(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,o=r.height;if(!i||!o)return;const n=i/o,a=D(t.scaleX,1),l=ht.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*n*a,r*=s),l.translate(-e,-r)}let c=D(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*nt);let m=D(t.offsetX),f=D(t.offsetY);if(m||f){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=D(t.size,I.CIMVectorMarker.size),i=t.frame,o=i?i.ymax-i.ymin:0,n=s&&o?s/o:1,a=ht.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=n,r/=n),a.translate(-e,-r)}1!==n&&a.scale(n,n);let h=D(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*nt);let c=D(t.offsetX),m=D(t.offsetY);if(c||m){if(this._mapRotation){const t=nt*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||lt().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!x(e))return;if(D(t.height,I.CIMTextSymbol.height)<=0)return;const s=ht.createIdentity();let i=D(t.angle);i=-i,i&&s.rotate(i*nt);const o=D(t.offsetX),n=D(t.offsetY);(o||n)&&s.translate(o,n);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class mt extends ct{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new F(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(S(t))this._processPath(t.rings,0);else if(w(t))this._processPath(t.paths,0);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(D(r,I.CIMSolidStroke.width)),.5*at);if(S(t))this._processPath(t.rings,s);else if(w(t))this._processPath(t.paths,s);else if(P(t)){const e=yt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){S(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1);let i=s*e,o=e;const n=this._resourceManager.getResource(r);if(null!=n){const t=n.height/n.width;i=s*(e?t>1?e:e/t:n.width),o=e?t>1?e*t:e:n.height}this._merge(this.transformPt([-i/2,-o/2]),0),this._merge(this.transformPt([-i/2,o/2]),0),this._merge(this.transformPt([i/2,-o/2]),0),this._merge(this.transformPt([i/2,o/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=St(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=n(s),i=n(i);const o=this.transformSize(1)*this.reverseTransformScalar(1);s*=o,i*=o;let a=0;switch(t.horizontalAlignment){case"Left":a=s/2;break;case"Right":a=-s/2}let l=0;switch(t.verticalAlignment){case"Bottom":l=i/2;break;case"Top":l=-i/2;break;case"Baseline":l=i/6}this._merge(this.transformPt([-s/2+a,-i/2+l]),0),this._merge(this.transformPt([-s/2+a,i/2+l]),0),this._merge(this.transformPt([s/2+a,-i/2+l]),0),this._merge(this.transformPt([s/2+a,i/2+l]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ft extends ct{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*o(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return lt().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type||e.symbolLayers?.some(t=>A(t)));if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=n(et*window.devicePixelRatio),r=n(rt);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,o,n){null!=n?this._hittestSvgPath(t,n,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const o=e*this.geomUnitsPerPoint(),n=o*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<n/2+e&&Math.abs(t[1])<o/2+e&&(this._earlyReturn=!0)}else{const t=n/2,e=o/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=it(D(t.height,I.CIMTextSymbol.height)),{lineGapType:o,lineGap:n}=t,a=o?Pt(o,D(n),i):0,l="CIMBackgroundCallout"===t.callout?.type,h=st(s.glyphMosaicItems,{scale:i/tt,angle:0,xOffset:0,yOffset:0,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:ot(t.lineWidth),lineHeight:Z*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of h.glyphs){const[t,i]=s.offsets.topLeft,[o,n]=s.offsets.bottomRight;if(e>t&&e<o&&r>-n&&r<-i){this._earlyReturn=!0;break}}}else for(const c of h.glyphs){const[t,e]=c.offsets.topLeft,[r,s]=c.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(P(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(S(t))e=t.rings;else{if(!w(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(gt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){pt(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=K(),this._path??=Q("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=l();p(i,t);const o={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},n=this._getSvgPath();n.setAttribute("d",e);const a=n.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let n=Math.max(a.width/o.width,a.height/o.height),l=1;const h=2*t*n;h<1&&(l=2/h,n*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*n/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(n/l),m.stroke(f));const u=(o.width*n-a.width)/2,d=(o.height*n-a.height)/2,g=Math.floor((i[0]-o.x-t)*n-u+c),p=Math.floor((o.height-(i[1]-o.y)-t)*n+d+c),_=Math.ceil(2*t*n),y=Math.ceil(2*t*n),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[o.x,o.y],[o.x,o.y+o.height],[o.x+o.width,o.y+o.height],[o.x+o.width,o.y],[o.x,o.y]];if(bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(P(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(S(t))r=t.rings;else{if(!w(t))return;r=t.paths}if("point"===this._hittestType){pt(this.reverseTransformPt(this._searchTarget[0]),r,D(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{bt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class ut extends ct{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,o){if(!t||!e||0===r)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!1);else{if(!P(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(yt(t).rings,!0)}const n=this._ctx;n.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",n.lineWidth=Math.max(this.transformSize(r),at),this._setCapStyle(s),this._setJoinStyle(i),n.miterLimit=o,n.stroke()}pushClipPath(t){if(this._ctx.save(),S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else{if(!P(t))return;this._buildPath(yt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,o=D(t.scaleX,1),n=this._resourceManager.getResource(s);if(null==n)return;let a=e*(n.width/n.height),l=e;e||(a=n.width,l=n.height);const h=H(s)||"src"in n&&H(n.src);let c="getFrame"in n?R(n):n;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:o*d*f,m12:o*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new U);const r=St(t,this.transformSize(n(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:o,anchorY:a,canvas:l}=s,h=i[0]*(o+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:o,rotation:n,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(S(t))this._buildPath(t.rings,!0);else if(w(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(yt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=H(h)||"src"in c&&H(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);n||(n=0),i?i*=t:i=0,o?o*=t:o=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==n||1!==e||1!==r||0!==i||0!==o){const t=new DOMMatrix;t.rotateSelf(0,0,-n).translateSelf(i,o).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:n,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(S(t))f=t.rings;else if(w(t))f=t.paths;else{if(!P(t))return M(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=yt(t).rings}c||(c=m.width);const u=H(h)||"src"in m&&H(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(o(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let x,b;_.save(),this._setCapStyle(i),this._setJoinStyle(n),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let o of f)if(o=e(o),xt(o),o&&!(o.length<=1)){x=this.transformPt(o[0]);for(let t=1;t<o.length;t++){b=this.transformPt(o[t]);const e=_t(x,b),r=new DOMMatrix;r.translateSelf(0,x[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(x[0],x[1]),_.lineTo(b[0],b[1]),_.stroke(),x=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(S(t))r=t.rings;else if(w(t))r=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient fill");r=yt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:n,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-s(i??0),y=c();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==n&&"Rectangular"!==n||(t=z(t,-_)),m(y,t)}}const[x,M,b,k]=y,T=this._ctx;switch(T.save(),n){case"Buffered":lt().error(`Gradient method "${n}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(b-x),[s,i]="Discrete"===p?[b,b-r]:[x+r,x],n=z([s,t],_),c=z([i,t],_),m=T.createLinearGradient(n[0],n[1],c[0],c[1]);L(m,e),T.fillStyle=m,T.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,s="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*r,[i,n]="Discrete"===p?[r,r-s]:[s,0],c=T.createRadialGradient(t[0],t[1],i,t[0],t[1],n);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Rectangular":{const r=f(y),s=r[0],i=r[1],n=z(r,_),c=(r,s,i,o,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(n[0],n[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(n[0],n[1]),T.clip();const u=z([r,s],_),d=z([i,o],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let m="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[s+m,s];c(g,i,P,i,b,M,b,k),[g,P]="Discrete"===p?[x,x+m]:[s-m,s],c(g,i,P,i,x,k,x,M),m="Absolute"===l?this.transformSize(o(a)):E(a,h.gradientSize)*(d(y)/2);let[S,w]="Discrete"===p?[k,k-m]:[i+m,i];c(s,S,s,w,b,k,x,k),[S,w]="Discrete"===p?[M,M+m]:[i-m,i],c(s,S,s,w,x,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:n,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(S(t))m=t.rings;else if(w(t))m=t.paths;else{if(!P(t))return void lt().error("Unable to draw gradient stroke");m=yt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(o(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),xt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(o(n)):E(n,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const o=p[0]-g[0],n=p[1]-g[1],a=Math.sqrt(o*o+n*n);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([o/a,n/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=o/a,r=n/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return lt().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function dt(t,e,r){let s=D(t.separation,I.CIMHatchFill.separation)*r,i=D(t.rotation);if(0===s)return null;s<0&&(s=-s);let o=0;const n=.5*s;for(;o>n;)o-=s;for(;o<-n;)o+=s;const a=l();p(a,e),a[0]-=n,a[1]-=n,a[2]+=n,a[3]+=n;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*nt),m=Math.sin(i*nt),f=-s*m,u=s*c;let d,g,_,y;o=D(t.offsetX)*r*m-D(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,s=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,s),g=Math.max(g,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=c*d-m*_-f*o/s,S=m*d+c*_-u*o/s,w=c*g-m*_-f*o/s,x=m*g+c*_-u*o/s;const M=1+Math.round((y-_)/s),b=[];for(let l=0;l<M;l++)P+=f,S+=u,w+=f,x+=u,b.push([[P,S],[w,x]]);return{paths:b}}function gt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];if(e[1]>t[1]==o[1]>t[1])continue;(o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function pt(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],o=s[i];let n=(o[0]-e[0])*(o[0]-e[0])+(o[1]-e[1])*(o[1]-e[1]);if(0===n)continue;n=Math.sqrt(n);const a=((o[0]-e[0])*(t[1]-e[1])-(o[1]-e[1])*(t[0]-e[0]))/n;if(Math.abs(a)<r){const s=((o[0]-e[0])*(t[0]-e[0])+(o[1]-e[1])*(t[1]-e[1]))/n;if(s>-r&&s<n+r)return!0}}}return!1}function _t(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const yt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,Pt=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function St(e,r=1){const s=B(e),i=X(e.fontStyleName),o=e.fontFamilyName??t,{weight:n,style:a}=i,l=r*(e.height||5),h=J(e.horizontalAlignment),c=N(e.verticalAlignment),m=O(e),f=O(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=q(e.symbol),g=r*(V(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=O(p),y=V(p),P=q(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:o,style:Y(a),weight:W(n),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function xt(t){let e,r,s,i,o,n=t[0],a=1;for(;a<t.length;)e=t[a][0]-n[0],r=t[a][1]-n[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=wt?(t.splice(a-1,1),n=o):(o=n,n=t[a],a++),s=i}function Mt(t){const e=t[0],r=t[t.length-1];return e[0]===r[0]&&e[1]===r[1]}function bt(t,e){t.length>1&&!Mt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(gt(e,[t]))return!0;if(Mt(s))for(const r of t)if(gt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],o=t[(e+1)%t.length];if(y(r,i,s,o))return!0}}}return!1}export{ct as CIMSymbolDrawHelper,ut as CanvasDrawHelper,mt as EnvDrawHelper,ft as HittestDrawHelper,ht as Transformation,nt as cDegToRad,Pt as lineGapType2LineHeight};
2
+ import{defaultFontFamily as t}from"../../core/fontUtils.js";import has from"../../core/has.js";import{clone as e}from"../../core/lang.js";import r from"../../core/Logger.js";import{deg2rad as s}from"../../core/mathUtils.js";import i from"../../core/ObjectPool.js";import{pt2px as n,px2pt as o}from"../../core/screenUtils.js";import{GeometryCursor as a}from"../../geometry/GeometryCursor.js";import{create as l,fromValues as h,empty as c,expandPointInPlace as m,center as f,width as u,height as d,diagonal as g}from"../../geometry/support/aaBoundingRect.js";import{getBoundsXY as p}from"../../geometry/support/boundsUtils.js";import{polygonCentroid as _}from"../../geometry/support/centroid.js";import{segmentIntersects as y}from"../../geometry/support/intersectsBase.js";import{isExtent as P,isPolygon as S,isPolyline as x,isPoint as w,isMultipoint as M}from"../../geometry/support/jsonTypeUtils.js";import{SimpleEffectCursor as b}from"./CIMEffects.js";import k from"./CIMImageColorSubstitutionHelper.js";import{getEffectOperator as T,getPlacementOperator as C}from"./CIMOperators.js";import{Placement as v}from"./CIMPlacements.js";import{defaultCIMValues as I}from"./defaultCIMValues.js";import{getFirstFrame as R}from"./imageUtils.js";import{rotate as z}from"./mathUtils.js";import{addColorStops as L}from"./rasterizingUtils.js";import U from"./Rect.js";import F from"./TextRasterizer.js";import{isMarkerScreenAligned as A,isCIMFill as j,getSize as G,getNumericValue as D,getEffectsInflateSize as H,isSVGImage as E,getRelativeGradientSize as B,fromCIMFontDecoration as X,fromCIMFontStyle as J,fromCIMHorizontalAlignment as N,fromCIMVerticalAlignment as O,getFillColor as q,getStrokeColor as V,getStrokeWidth as W,getFontWeight as Y,getFontStyle as K}from"./utils.js";import{destroyHiddenSvg as $,createHiddenSvg as Q,createSvgElement as Z}from"../../views/2d/engine/svgUtils.js";import{magicLabelLineHeight as tt,glyphSize as et,hittestToleranceSmallSymbol as rt,hittestSmallSymbolThreshold as st}from"../../views/2d/engine/webgl/definitions.js";import{shapeGlyphs as it}from"../../views/2d/engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as nt,getLineWidth as ot}from"../../views/2d/layers/graphics/graphicsUtils.js";const at=Math.PI/180,lt=.5,ht=()=>r.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class ct{constructor(t){this._t=t}static createIdentity(){return new ct([1,0,0,0,1,0])}clone(){const t=this._t;return new ct(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new ct([t,0,0,0,e,0])}scale(t,e){const r=this._t;return r[0]*=t,r[1]*=t,r[2]*=t,r[3]*=e,r[4]*=e,r[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new ct([0,0,t,0,0,e])}translate(t,e){const r=this._t;return r[2]+=t,r[5]+=e,this}static createRotate(t){const e=Math.cos(t),r=Math.sin(t);return new ct([e,-r,0,r,e,0])}rotate(t){return ct.multiply(this,ct.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],r=Math.sqrt(t*t+e*e);return[t/r,e/r]}static multiply(t,e,r){const s=t._t,i=e._t,n=s[0]*i[0]+s[3]*i[1],o=s[1]*i[0]+s[4]*i[1],a=s[2]*i[0]+s[5]*i[1]+i[2],l=s[0]*i[3]+s[3]*i[4],h=s[1]*i[3]+s[4]*i[4],c=s[2]*i[3]+s[5]*i[4]+i[5],m=r._t;return m[0]=n,m[1]=o,m[2]=a,m[3]=l,m[4]=h,m[5]=c,r}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new ct([0,0,0,0,0,0]);e=1/e;const r=(t[1]*t[5]-t[2]*t[4])*e,s=(t[2]*t[3]-t[0]*t[5])*e,i=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new ct([i,n,r,o,a,s])}}class mt{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new i(()=>new v,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||ct.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||ct.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const r=e?t.scaleRatio():1;ct.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*r)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,r){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,r)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const r=t.symbolLayers;if(!r)return;const s=t.effects;if(s&&s.length>0){const t=this.executeEffects(s,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(r,e.asJSON()),e=t.next()}}else this.drawSymbolLayers(r,e)}executeEffects(t,e){const r=this.geomUnitsPerPoint(),s=null,i=H(t),n=!1;let o=new b(a.fromJSONCIM(e));for(const a of t){const t=T(a);t&&(o=t.execute(o,a,{geomUnitsPerPoint:r,tileKey:s,maxInflateSize:i,scale:null,spatialReference:e.spatialReference,preventClipping:n}))}return o}drawSymbolLayers(t,e){let r=t.length;for(;r--;){const s=t[r];if(!s||!1===s.enable)continue;const i=s.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(s,e.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(s,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const r=gt(e,t,this.geomUnitsPerPoint());r&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,r),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const r=t.markerPlacement;if(r){const s=C(r);if(s){const i="CIMMarkerPlacementInsidePolygon"===r.type||"CIMMarkerPlacementPolygonCenter"===r.type&&r.clipAtBoundary;i&&this.pushClipPath(e);const n=s.execute(a.fromJSONCIM(e),r,this.geomUnitsPerPoint(),null);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}i&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(w(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(S(e)){const s=_(e);s&&([r.tx,r.ty]=s,this.drawMarker(t,r))}else if(x(e)){for(const s of e.paths)for(const e of s)if(r.tx=e[0],r.ty=e[1],this.drawMarker(t,r),this._earlyReturn)break}else for(const s of e.points)if(r.tx=s[0],r.ty=s[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const r=this._resourceManager.getResource(t.url),s=D(t.size,I.CIMPictureMarker.size);if(null==r||s<=0)return;const i=r.width,n=r.height;if(!i||!n)return;const o=i/n,a=D(t.scaleX,1),l=ct.createIdentity(),h=t.anchorPoint;if(h){let e=h.x,r=h.y;"Absolute"!==t.anchorPointUnits&&(e*=s*o*a,r*=s),l.translate(-e,-r)}let c=D(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*at);let m=D(t.offsetX),f=D(t.offsetY);if(m||f){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=m*r+f*e;m=m*e-f*r,f=s}l.translate(m,f)}const u=this.geomUnitsPerPoint();1!==u&&l.scale(u,u);const d=e.getAngle();d&&l.rotate(d),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,s),this.pop()}drawVectorMarker(t,e){if(!t)return;const r=t.markerGraphics;if(!r)return;const s=D(t.size,I.CIMVectorMarker.size),i=t.frame,n=i?i.ymax-i.ymin:0,o=s&&n?s/n:1,a=ct.createIdentity();i&&a.translate(.5*-(i.xmax+i.xmin),.5*-(i.ymax+i.ymin));const l=t.anchorPoint;if(l){let e=l.x,r=l.y;"Absolute"!==t.anchorPointUnits?i&&(e*=i.xmax-i.xmin,r*=i.ymax-i.ymin):(e/=o,r/=o),a.translate(-e,-r)}1!==o&&a.scale(o,o);let h=D(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*at);let c=D(t.offsetX),m=D(t.offsetY);if(c||m){if(this._mapRotation){const t=at*this._mapRotation,e=Math.cos(t),r=Math.sin(t),s=c*r+m*e;c=c*e-m*r,m=s}a.translate(c,m)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const u=e.getAngle();u&&a.rotate(u),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const d of r){d?.symbol&&d.geometry||ht().error("Invalid marker graphic",d);let t=d.textString;if("number"==typeof t&&(t=t.toString()),this.drawSymbol(d.symbol,d.geometry,t),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,r){if(!t)return;if(!w(e))return;if(D(t.height,I.CIMTextSymbol.height)<=0)return;const s=ct.createIdentity();let i=D(t.angle);i=-i,i&&s.rotate(i*at);const n=D(t.offsetX),o=D(t.offsetY);(n||o)&&s.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&s.scale(a,a),s.translate(e.x,e.y),this.push(s,!1),this.drawText(t,r),this.pop()}}class ft extends mt{constructor(t,e){super(t,e),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new U(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return h(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if(S(t))this._processPath(t.rings,0);else if(x(t))this._processPath(t.paths,0);else if(P(t)){const e=Pt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,r){if(!t||this._clipCount>0||null==r||r<=0)return;const s=Math.max(.5*this.transformSize(D(r,I.CIMSolidStroke.width)),.5*lt);if(S(t))this._processPath(t.rings,s);else if(x(t))this._processPath(t.paths,s);else if(P(t)){const e=Pt(t);e&&this._processPath(e.rings,s)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){S(e)&&t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1);let i=s*e,n=e;const o=this._resourceManager.getResource(r);if(null!=o){const t=o.height/o.width;i=s*(e?t>1?e:e/t:o.width),n=e?t>1?e*t:e:o.height}this._merge(this.transformPt([-i/2,-n/2]),0),this._merge(this.transformPt([-i/2,n/2]),0),this._merge(this.transformPt([i/2,-n/2]),0),this._merge(this.transformPt([i/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=xt(t);let[s,i]=this._textRasterizer.computeTextSize(e,r);s=o(s),i=o(i);const n=this.transformSize(1)*this.reverseTransformScalar(1);s*=n,i*=n;const a=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,l=t.verticalAlignment??I.CIMTextSymbol.verticalalignment;let h=0;switch(a){case"Left":h=s/2;break;case"Right":h=-s/2}let c=0;switch(l){case"Bottom":c=i/2;break;case"Top":c=-i/2;break;case"Baseline":c=i/6}this._merge(this.transformPt([-s/2+h,-i/2+c]),0),this._merge(this.transformPt([-s/2+h,i/2+c]),0),this._merge(this.transformPt([s/2+h,-i/2+c]),0),this._merge(this.transformPt([s/2+h,i/2+c]),0)}_processPath(t,e){if(t)for(const r of t){const t=r?r.length:0;if(t>1){this._merge(this.transformPt(r[0]),e);for(let s=1;s<t;s++)this._merge(this.transformPt(r[s]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class ut extends mt{constructor(){super(...arguments),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=$(this._svg),this._path=null,this._canvas=null}hitTest(t,e,r,s,i,a,l,h){this._resetHittest();const c=a*n(1);switch(this.setGeomUnitsPerPoint(c),h){case"point":if(1!==t.length)return ht().error("Unexpected hittest area",t),!1;this._hittestType="point",this._searchDistPoint=l/2/c,this._searchTarget=[[t[0].x,t[0].y]];break;case"rect":if(4!==t.length)return ht().error("Unexpected hittest area",t),!1;this._hittestType="rect",this._searchDistPoint=0,this._searchTarget=t.map(t=>[t.x,t.y])}this._textInfo=s;const m=e&&("CIMPointSymbol"===e.type&&"Map"!==e.angleAlignment||"CIMTextSymbol"===e.type||e.symbolLayers?.some(t=>A(t)));if(this._mapRotation=m?i:0,!has("esri-mobile")){const t=o(rt*window.devicePixelRatio),r=o(st);!(("CIMLineSymbol"===e?.type||"CIMPolygonSymbol"===e?.type)&&e.symbolLayers?.some(j))&&"CIMMeshSymbol"!==e?.type&&(G(e)??0)<r&&(this._searchDistPoint=t)}return this._earlyReturn=!1,this.drawSymbol(e,r),this._earlyReturn}executeEffects(t,e){return"CIMGeometricEffectDashes"===t.at(-1)?.type&&(t=t.slice(0,-1)),super.executeEffects(t,e)}drawSolidFill(t,e,r){null!=r?this._hittestSvgPath(t,r,!0):this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,r,s,i,n,o){null!=o?this._hittestSvgPath(t,o,!1,r):this._hitTestStroke(t,r)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&("CIMMarkerPlacementInsidePolygon"===t.markerPlacement.type||"CIMMarkerPlacementPolygonCenter"===t.markerPlacement.type&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){const{url:r}=t,s=D(t.scaleX,1),i=this._resourceManager.getResource(r);if(null==i||0===i.height||0===e)return;const n=e*this.geomUnitsPerPoint(),o=n*s*(i.width/i.height);if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=this._searchDistPoint;Math.abs(t[0])<o/2+e&&Math.abs(t[1])<n/2+e&&(this._earlyReturn=!0)}else{const t=o/2,e=n/2,r=[[-t,e],[t,e],[t,-e],[-t,-e],[-t,e]];kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[r])&&(this._earlyReturn=!0)}}drawText(t,e){const r=this._textInfo;if(!r)return;const s=r.get(t);if(!s)return;if(!s.glyphMosaicItems.glyphs.length)return;const i=nt(D(t.height,I.CIMTextSymbol.height)),{lineGapType:n,lineGap:o}=t,a=n?St(n,D(o),i):0,l=t.horizontalAlignment??I.CIMTextSymbol.horizontalalignment,h=t.verticalAlignment??I.CIMTextSymbol.verticalalignment,c="CIMBackgroundCallout"===t.callout?.type,m=it(s.glyphMosaicItems,{scale:i/et,angle:0,xOffset:0,yOffset:0,horizontalAlignment:l,verticalAlignment:h,maxLineWidth:ot(t.lineWidth),lineHeight:tt*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:c});if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]),e=t[0],r=t[1];for(const s of m.glyphs){const[t,i]=s.offsets.topLeft,[n,o]=s.offsets.bottomRight;if(e>t&&e<n&&r>-o&&r<-i){this._earlyReturn=!0;break}}}else for(const f of m.glyphs){const[t,e]=f.offsets.topLeft,[r,s]=f.offsets.bottomRight,i=[[t,-e],[r,-e],[r,-s],[t,-s],[t,-e]];if(kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[i])){this._earlyReturn=!0;break}}}_hitTestFill(t){let e=null;if(P(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(S(t))e=t.rings;else{if(!x(t))return;e=t.paths}if("point"===this._hittestType){const t=this.reverseTransformPt(this._searchTarget[0]);if(pt(t,e)&&(this._earlyReturn=!0),!this._earlyReturn){_t(t,e,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}}else{kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,e)&&(this._earlyReturn=!0)}}_getSvgPath(){return null!=this._svg&&null!=this._path||(this._svg??=Q(),this._path??=Z("path"),this._svg.appendChild(this._path)),this._path}_getCanvasContext(t,e){return this._canvas??=document.createElement("canvas"),this._canvas.width=t,this._canvas.height=e,this._canvas.getContext("2d",{willReadFrequently:!0})}_hittestSvgPath(t,e,r,s=0){const i=l();p(i,t);const n={x:i[0],y:i[1],width:i[2]-i[0],height:i[3]-i[1]},o=this._getSvgPath();o.setAttribute("d",e);const a=o.getBBox();if("point"===this._hittestType){const t=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),i=this.reverseTransformPt(this._searchTarget[0]);let o=Math.max(a.width/n.width,a.height/n.height),l=1;const h=2*t*o;h<1&&(l=2/h,o*=l,a.x*=l,a.y*=l,a.width*=l,a.height*=l);const c=1+s*o/2,m=this._getCanvasContext(a.width+2*c,a.height+2*c);m.setTransform(l,0,0,l,-a.x+c,-a.y+c);const f=new Path2D(e);r?m.fill(f):(m.lineWidth=s*(o/l),m.stroke(f));const u=(n.width*o-a.width)/2,d=(n.height*o-a.height)/2,g=Math.floor((i[0]-n.x-t)*o-u+c),p=Math.floor((n.height-(i[1]-n.y)-t)*o+d+c),_=Math.ceil(2*t*o),y=Math.ceil(2*t*o),P=m.getImageData(g,p,_,y).data;for(let e=3;e<P.length;e+=4)if(P[e]>127.5)return void(this._earlyReturn=!0)}else{const t=[[n.x,n.y],[n.x,n.y+n.height],[n.x+n.width,n.y+n.height],[n.x+n.width,n.y],[n.x,n.y]];if(kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,[t]))return void(this._earlyReturn=!0)}}_hitTestStroke(t,e){let r=null;if(P(t)){const e=t;r=[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}else if(S(t))r=t.rings;else{if(!x(t))return;r=t.paths}if("point"===this._hittestType){_t(this.reverseTransformPt(this._searchTarget[0]),r,D(e,I.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}else{kt(this.isEmbedded()?this._searchTarget.map(t=>this.reverseTransformPt(t)):this._searchTarget,r)&&(this._earlyReturn=!0)}}_resetHittest(){this.setTransform(),this._hittestType="point",this._searchTarget=[],this._searchDistPoint=0,this._textInfo=null}}class dt extends mt{constructor(t,e,r,s){super(e,r),this._applyAdditionalRenderProps=s,this._colorSubstitutionHelper=new k,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(Pt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const r=this._ctx;r.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",r.fill("evenodd")}drawSolidStroke(t,e,r,s,i,n){if(!t||!e||0===r)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!1);else{if(!P(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(Pt(t).rings,!0)}const o=this._ctx;o.strokeStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(r),lt),this._setCapStyle(s),this._setJoinStyle(i),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else{if(!P(t))return;this._buildPath(Pt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:r,url:s,tintColor:i}=t,n=D(t.scaleX,1),o=this._resourceManager.getResource(s);if(null==o)return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const h=E(s)||"src"in o&&E(o.src);let c="getFrame"in o?R(o):o;r&&(c=this._colorSubstitutionHelper.applyColorSubstitution(c,r)),this._applyAdditionalRenderProps&&!h&&i&&(c=this._colorSubstitutionHelper.tintImageData(c,i));const m=this.transformPt([0,0]),[f,u]=this.getTransformAngle(),d=this.transformSize(1),g=this._ctx;g.save(),g.setTransform({m11:n*d*f,m12:n*d*u,m21:-d*u,m22:d*f,m41:m[0],m42:m[1]}),g.drawImage(c,-a/2,-l/2,a,l),g.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new F);const r=xt(t,this.transformSize(o(1))),s=this._textRasterizer.rasterizeText(e,r);if(!s)return;const{size:i,anchorX:n,anchorY:a,canvas:l}=s,h=i[0]*(n+.5),c=i[1]*(a-.5),m=this._ctx,f=this.transformPt([0,0]),[u,d]=this.getTransformAngle(),g=1;m.save(),m.setTransform({m11:g*u,m12:g*d,m21:-g*d,m22:g*u,m41:f[0]-g*h,m42:f[1]+g*c}),m.drawImage(l,0,0),m.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:r,height:s,offsetX:i,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(null==c)return;if(S(t))this._buildPath(t.rings,!0);else if(x(t))this._buildPath(t.paths,!0);else if(P(t))this._buildPath(Pt(t).rings,!0);else{if(!M(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=E(h)||"src"in c&&E(c.src);let u,d="getFrame"in c?R(c):c;if(r&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,r)),this._applyAdditionalRenderProps){f||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)),u=m.createPattern(d,"repeat");const t=this.transformSize(1);o||(o=0),i?i*=t:i=0,n?n*=t:n=0,s&&(s*=t);const e=s?s/c.height:1,r=a&&s?a*s/c.width:1;if(0!==o||1!==e||1!==r||0!==i||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(i,n).scaleSelf(r,e,1),u.setTransform(t)}}else u=m.createPattern(d,"repeat");m.save(),m.fillStyle=u,m.fill("evenodd"),m.restore()}drawPictureStroke(t,r){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:o,miterLimit:a,tintColor:l,url:h,width:c}=r;const m=this._resourceManager.getResource(h);if(null==m)return;let f;if(S(t))f=t.rings;else if(x(t))f=t.paths;else{if(!P(t))return M(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;f=Pt(t).rings}c||(c=m.width);const u=E(h)||"src"in m&&E(m.src);let d="getFrame"in m?R(m):m;s&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,s)),this._applyAdditionalRenderProps&&(u||l&&(d=this._colorSubstitutionHelper.tintImageData(d,l)));const g=Math.max(this.transformSize(n(c)),.5),p=g/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let w,b;_.save(),this._setCapStyle(i),this._setJoinStyle(o),void 0!==a&&(_.miterLimit=a),_.lineWidth=g;for(let n of f)if(n=e(n),Mt(n),n&&!(n.length<=1)){w=this.transformPt(n[0]);for(let t=1;t<n.length;t++){b=this.transformPt(n[t]);const e=yt(w,b),r=new DOMMatrix;r.translateSelf(0,w[1]-g/2).scaleSelf(p,p,1).rotateSelf(0,0,90-e),y.setTransform(r),_.strokeStyle=y,_.beginPath(),_.moveTo(w[0],w[1]),_.lineTo(b[0],b[1]),_.stroke(),w=b}}_.restore()}drawGradientFill(t,e){if(!t)return;let r;if(S(t))r=t.rings;else if(x(t))r=t.paths;else{if(!P(t))return void ht().error("Unable to draw gradient fill");r=Pt(t).rings}this._buildPath(r,!0);const{angle:i,gradientMethod:o,gradientSize:a,gradientSizeUnits:l}=e,h=I.CIMGradientFill,p=e.gradientType??h.gradientType,_=-s(i??0),y=c();for(const s of r){const t=s?s.length:0;if(t>1)for(let e=0;e<t;e++){let t=this.transformPt(s[e]);"Linear"!==o&&"Rectangular"!==o||(t=z(t,-_)),m(y,t)}}const[w,M,b,k]=y,T=this._ctx;switch(T.save(),o){case"Buffered":ht().error(`Gradient method "${o}" currently unsupported.`);break;case"Linear":{const t=(M+k)/2,r="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(b-w),[s,i]="Discrete"===p?[b,b-r]:[w+r,w],o=z([s,t],_),c=z([i,t],_),m=T.createLinearGradient(o[0],o[1],c[0],c[1]);L(m,e),T.fillStyle=m,T.fill("evenodd");break}case"Circular":{const t=f(y),r=g(y)/2,s="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*r,[i,o]="Discrete"===p?[r,r-s]:[s,0],c=T.createRadialGradient(t[0],t[1],i,t[0],t[1],o);L(c,e),T.fillStyle=c,T.fill("evenodd");break}case"Rectangular":{const r=f(y),s=r[0],i=r[1],o=z(r,_),c=(r,s,i,n,a,l,h,c)=>{T.save(),this.pushClipPath(t);const m=z([a,l],_),f=z([h,c],_);T.beginPath(),T.moveTo(o[0],o[1]),T.lineTo(m[0],m[1]),T.lineTo(f[0],f[1]),T.lineTo(o[0],o[1]),T.clip();const u=z([r,s],_),d=z([i,n],_),g=T.createLinearGradient(u[0],u[1],d[0],d[1]);L(g,e),T.fillStyle=g,T.fill("evenodd"),T.restore()};let m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(u(y)/2),[g,P]="Discrete"===p?[b,b-m]:[s+m,s];c(g,i,P,i,b,M,b,k),[g,P]="Discrete"===p?[w,w+m]:[s-m,s],c(g,i,P,i,w,k,w,M),m="Absolute"===l?this.transformSize(n(a)):B(a,h.gradientSize)*(d(y)/2);let[S,x]="Discrete"===p?[k,k-m]:[i+m,i];c(s,S,s,x,b,k,w,k),[S,x]="Discrete"===p?[M,M+m]:[i-m,i],c(s,S,s,x,w,M,b,M);break}}T.restore()}drawGradientStroke(t,r){const{capStyle:s,gradientMethod:i,gradientSize:o,gradientSizeUnits:a,joinStyle:l,miterLimit:h,width:c}=r;if(!t||0===c)return;let m;if(S(t))m=t.rings;else if(x(t))m=t.paths;else{if(!P(t))return void ht().error("Unable to draw gradient stroke");m=Pt(t).rings}const f=r.gradientType??I.CIMGradientStroke.gradientType,u=Math.max(this.transformSize(n(c)),.5),d=this._ctx;let g,p;d.save(),this._setCapStyle(s),this._setJoinStyle(l),void 0!==h&&(d.miterLimit=h),d.lineWidth=u;for(let _ of m){if(_=e(_),Mt(_),!_||_.length<=1)continue;let t=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const r=p[0]-g[0],s=p[1]-g[1];t+=Math.sqrt(r*r+s*s),g=p}const s="Absolute"===a?this.transformSize(n(o)):B(o,I.CIMGradientStroke.gradientSize)*("AcrossLine"===i?u:t);let l=0;g=this.transformPt(_[0]);for(let e=1;e<_.length;e++){p=this.transformPt(_[e]);const n=p[0]-g[0],o=p[1]-g[1],a=Math.sqrt(n*n+o*o);let h,c,m,y;switch(i){case"AcrossLine":{const[t,e]=z([n/a,o/a],-Math.PI/2),r=u/2,i="Discrete"===f?r:s-r;h=(g[0]+p[0])/2+t*i,c=(g[1]+p[1])/2+e*i,m=h-t*s,y=c-e*s;break}case"AlongLine":{const e=n/a,r=o/a;"Discrete"===f?(h=g[0]-e*l,c=g[1]-r*l,m=h+e*s,y=c+r*s):(m=g[0]+e*(t-l),y=g[1]+r*(t-l),h=m-e*s,c=y-r*s);break}default:return ht().error("Unrecognized gradient method:",i),void d.restore()}const P=d.createLinearGradient(h,c,m,y);L(P,r),d.strokeStyle=P,d.beginPath(),d.moveTo(g[0],g[1]),d.lineTo(p[0],p[1]),d.stroke(),l+=a,g=p}}d.restore()}_buildPath(t,e){const r=this._ctx;if(r.beginPath(),t)for(const s of t){const t=s?s.length:0;if(t>1){let i=this.transformPt(s[0]);r.moveTo(i[0],i[1]);for(let e=1;e<t;e++)i=this.transformPt(s[e]),r.lineTo(i[0],i[1]);e&&r.closePath()}}}_setCapStyle(t){switch(t){case"Butt":this._ctx.lineCap="butt";break;case"Round":this._ctx.lineCap="round";break;case"Square":this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case"Bevel":this._ctx.lineJoin="bevel";break;case"Round":this._ctx.lineJoin="round";break;case"Miter":this._ctx.lineJoin="miter"}}}function gt(t,e,r){let s=D(t.separation,I.CIMHatchFill.separation)*r,i=D(t.rotation);if(0===s)return null;s<0&&(s=-s);let n=0;const o=.5*s;for(;n>o;)n-=s;for(;n<-o;)n+=s;const a=l();p(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;i>180;)i-=180;for(;i<0;)i+=180;const c=Math.cos(i*at),m=Math.sin(i*at),f=-s*m,u=s*c;let d,g,_,y;n=D(t.offsetX)*r*m-D(t.offsetY)*r*c,d=_=Number.MAX_VALUE,g=y=-Number.MAX_VALUE;for(const l of h){const t=l[0],e=l[1],r=c*t+m*e,s=-m*t+c*e;d=Math.min(d,r),_=Math.min(_,s),g=Math.max(g,r),y=Math.max(y,s)}_=Math.floor(_/s)*s;let P=c*d-m*_-f*n/s,S=m*d+c*_-u*n/s,x=c*g-m*_-f*n/s,w=m*g+c*_-u*n/s;const M=1+Math.round((y-_)/s),b=[];for(let l=0;l<M;l++)P+=f,S+=u,x+=f,w+=u,b.push([[P,S],[x,w]]);return{paths:b}}function pt(t,e){let r=0;for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];if(e[1]>t[1]==n[1]>t[1])continue;(n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0])>0?r++:r--}}return 0!==r}function _t(t,e,r){for(const s of e){const e=s.length;for(let i=1;i<e;i++){const e=s[i-1],n=s[i];let o=(n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1]);if(0===o)continue;o=Math.sqrt(o);const a=((n[0]-e[0])*(t[1]-e[1])-(n[1]-e[1])*(t[0]-e[0]))/o;if(Math.abs(a)<r){const s=((n[0]-e[0])*(t[0]-e[0])+(n[1]-e[1])*(t[1]-e[1]))/o;if(s>-r&&s<o+r)return!0}}}return!1}function yt(t,e){const r=e[0]-t[0],s=e[1]-t[1];return 180/Math.PI*Math.atan2(s,r)}const Pt=t=>t?{spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:null,St=(t,e,r)=>{switch(t){case"ExtraLeading":return 1+e/r;case"Multiple":return e;case"Exact":return e/r}};function xt(e,r=1){const s=X(e),i=J(e.fontStyleName),n=e.fontFamilyName??t,{weight:o,style:a}=i,l=r*(e.height||5),h=N(e.horizontalAlignment),c=O(e.verticalAlignment),m=q(e),f=q(e.haloSymbol),u=null!=f?r*(e.haloSize??0):0,d=V(e.symbol),g=r*(W(e.symbol)||0),p="CIMBackgroundCallout"===e.callout?.type?e.callout.backgroundSymbol:null,_=q(p),y=W(p),P=V(p);return{color:m,size:l,horizontalAlignment:h,verticalAlignment:c,font:{family:n,style:K(a),weight:Y(o),decoration:s},outline:{size:g||0,color:d},halo:{size:u||0,color:f,style:a},backgroundColor:_,borderLine:null!=y&&null!=P?{size:y,color:P}:null,pixelRatio:1,premultiplyColors:!0}}const wt=1e-4;function Mt(t){let e,r,s,i,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],r=t[a][1]-o[1],i=0!==e?r/e:Math.PI/2,void 0!==s&&Math.abs(i-s)<=wt?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),s=i}function bt(t){const e=t[0],r=t[t.length-1];return e[0]===r[0]&&e[1]===r[1]}function kt(t,e){t.length>1&&!bt(t)&&(t=[...t,t[0]]);for(let r=0;r<e.length;r++){const s=e[r],i=s.length;for(const e of s)if(pt(e,[t]))return!0;if(bt(s))for(const r of t)if(pt(r,e))return!0;for(let e=1;e<i;e++){const r=s[e-1],i=s[e];for(let e=0;e<t.length;e++){const s=t[e],n=t[(e+1)%t.length];if(y(r,i,s,n))return!0}}}return!1}export{mt as CIMSymbolDrawHelper,dt as CanvasDrawHelper,ft as EnvDrawHelper,ut as HittestDrawHelper,ct as Transformation,at as cDegToRad,St as lineGapType2LineHeight};
@@ -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 M,Transformation as S}from"./CIMSymbolDrawHelper.js";import{defaultCIMValues as d}from"./defaultCIMValues.js";import{isGeometricLinearEffect as g,getNumericValue as b,fromCIMFontStyle as C,fromCIMFontDecoration as x}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 G=Math.PI,T=G/2,E=Math.PI/180,v=96/72,A=1.4142135623730951,R=2,j=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=q.fromSimpleMarker(e);if(!r)throw new Error("InternalError: Cannot convert symbol to CIM");t=r;break}case"picture-marker":t=q.fromPictureMarker(e);break;case"simple-line":t=q.fromSimpleLineSymbol(e);break;case"simple-fill":t=q.fromSimpleFillSymbol(e);break;case"picture-fill":t=q.fromPictureFillSymbol(e);break;case"text":t=q.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 Y(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}}function N(e){if(!e)return 0;let t=0;for(const r of e)t+=_(r);return t}function _(e){if(!e)return 0;if(g(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(b(e.offsetX)),Math.abs(b(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)}}class U{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(re(t)){const s=this._getLayersInflateSize(e,t.symbolLayers,r,o,a),i=N(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/=A: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=E*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=E*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=Y(e.markerPlacement);f>0&&(t[0]-=f,t[1]-=f,t[2]+=f,t[3]+=f);break}}const c=N(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?M(s,i??0,o):0,l="CIMBackgroundCallout"===t.callout?.type,c=z(a.glyphMosaicItems,{scale:o/P,angle:b(t.angle),xOffset:b(t.offsetX),yOffset:b(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:D(t.lineWidth),lineHeight:w*Math.max(.25,Math.min(n||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}).boundsT,m=Math.sqrt(c.width*c.width+c.height*c.height);return e[0]-=c.x+m,e[1]-=c.y-m,e[2]+=c.x+m,e[3]+=-c.y+m,e}}class q{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)*v;let n=null!=a?Math.max(a/i,1):1;n*=v,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,R,null,r);return[-s/o,-i/a,a/n*v]}static rasterize(e,t,r,o,a=!0,s){const[i,n,l,c,m]=this.getTextureInfo(t,o,R,r,s);e.width=i,e.height=n;const f=e.getContext("2d",{willReadFrequently:!0}),y=S.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 M=f.getImageData(0,0,e.width,e.height),d=new Uint8Array(M.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:q.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=se(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=se(s);e&&i.push(e)}if(o&&"solid"!==o&&"none"!==o&&"esriSFSSolid"!==o&&"esriSFSNull"!==o){const e={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:K(r),capStyle:"Butt",joinStyle:"Miter",width:.75}]};let s=0;const n=a(ae(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:K(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:te(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=q.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?K(r):[0,0,0,0],capStyle:O(t),joinStyle:W(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:M}=t;let S,d,g,C,x,I;a&&(S=a.family,d=a.style,g=a.weight,C=a.size,x=a.decoration);let k=!1;if(m){k=e(m)[1]}return(u||M)&&(I={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:K(u)},{type:"CIMSolidStroke",enable:!0,color:K(p),width:M??0}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:r,blockProgression:2,depth3D:1,extrapolateBaselines:!0,fontEffects:0,fontEncoding:1,fontFamilyName:S||"Arial",fontStyleName:Q(d,g),fontType:0,haloSize:i,height:C,hinting:1,horizontalAlignment:$(n??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:c,offsetX:b(y),offsetY:b(h),strikethrough:"line-through"===x,underline:"underline"===x,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:K(o)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:K(s)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:k?1:0,verticalAlignment:J(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:K(r.color),path:e.path})}t.push({type:"CIMSolidFill",enable:!0,color:K(a),path:e.path});const[r,o]=oe("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?oe(o,e.size):oe(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:te(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:K(t.color),effects:m})}else!t||"line-marker"!==e.type||"cross"!==e.style&&"x"!==e.style?[i,n]=oe(o):([i,n]=oe(o),s.push({type:"CIMSolidStroke",enable:!0,width:t,color:K(a)}));s.push({type:"CIMSolidFill",enable:!0,color:K(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)||j;for(;i<j;)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}=C(o),i=x(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)),H(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 H(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&&H(r,t)}}break}}}const O=e=>{if(!e)return"Butt";switch(e){case"butt":return"Butt";case"square":return"Square";case"round":return"Round"}},W=e=>{if(!e)return"Miter";switch(e){case"miter":return"Miter";case"round":return"Round";case"bevel":return"Bevel"}},$=e=>{if(null==e)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},J=e=>{if(null==e)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},K=e=>{if(!e)return[0,0,0,0];const{r:t,g:r,b:o,a}=e;return[t,r,o,255*a]},Q=(e,t)=>{const r=Z(t),o=ee(e);return r&&o?`${r}-${o}`:`${r}${o}`},Z=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},ee=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},te=(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 re(e){return void 0!==e.symbolLayers}const oe=(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(G/t/4);0===s&&(s=1),t=T/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]},ae=e=>"vertical"===e||"horizontal"===e||"cross"===e||"esriSFSCross"===e||"esriSFSVertical"===e||"esriSFSHorizontal"===e;function se(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:te(i,r),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:"esriSLSNull"!==i&&"none"!==i?K(o):[0,0,0,0],capStyle:O(r),joinStyle:W(a),miterLimit:s,width:n,effects:t}}export{q as CIMSymbolHelper,U as CIMSymbolInflatedSizeHelper,O as capTypeToEnum,H as forEachSymbolLayer,N as getEffectsInflateSize,te 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){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};