@arcgis/core 4.25.0 → 4.25.2

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 (1127) hide show
  1. package/Basemap.d.ts +1 -1
  2. package/Camera.d.ts +1 -1
  3. package/Color.d.ts +1 -1
  4. package/Graphic.d.ts +1 -1
  5. package/Ground.d.ts +1 -1
  6. package/Map.d.ts +1 -1
  7. package/PopupTemplate.d.ts +1 -1
  8. package/README.md +158 -158
  9. package/TimeExtent.d.ts +1 -1
  10. package/TimeInterval.d.ts +1 -1
  11. package/Viewpoint.d.ts +1 -1
  12. package/WebMap.d.ts +1 -1
  13. package/WebScene.d.ts +1 -1
  14. package/analysis/AreaMeasurementAnalysis.d.ts +1 -1
  15. package/analysis/DimensionAnalysis.d.ts +1 -1
  16. package/analysis/DimensionSimpleStyle.d.ts +1 -1
  17. package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
  18. package/analysis/LengthDimension.d.ts +1 -1
  19. package/analysis/LineOfSightAnalysis.d.ts +1 -1
  20. package/analysis/LineOfSightAnalysisObserver.d.ts +1 -1
  21. package/analysis/LineOfSightAnalysisTarget.d.ts +1 -1
  22. package/analysis/SliceAnalysis.d.ts +1 -1
  23. package/analysis/SlicePlane.d.ts +1 -1
  24. package/applications/SceneViewer/colorUtils.d.ts +1 -1
  25. package/applications/SceneViewer/sceneViewerUtils.d.ts +1 -1
  26. package/arcade/Dictionary.js +1 -1
  27. package/arcade/Feature.js +1 -1
  28. package/arcade/arcadeAsyncRuntime.js +1 -1
  29. package/arcade/arcadeCompiler.js +1 -1
  30. package/arcade/arcadeRuntime.js +1 -1
  31. package/arcade/functions/convertdirection.js +1 -1
  32. package/arcade/functions/date.js +1 -1
  33. package/arcade/functions/featuresetbase.js +1 -1
  34. package/arcade/functions/featuresetgeom.js +1 -1
  35. package/arcade/functions/featuresetstats.js +1 -1
  36. package/arcade/functions/featuresetstring.js +1 -1
  37. package/arcade/functions/fieldStats.js +1 -1
  38. package/arcade/functions/geomasync.js +1 -1
  39. package/arcade/functions/geometry.js +1 -1
  40. package/arcade/functions/geomsync.js +1 -1
  41. package/arcade/functions/maths.js +1 -1
  42. package/arcade/functions/stats.js +1 -1
  43. package/arcade/functions/string.js +1 -1
  44. package/arcade/languageUtils.js +1 -1
  45. package/arcade.d.ts +1 -1
  46. package/arcade.js +1 -1
  47. package/assets/esri/core/libs/libtess/libtess.wasm +0 -0
  48. package/assets/esri/core/workers/RemoteClient.js +1 -1
  49. package/assets/esri/core/workers/chunks/{c90bca033e64cfad8b43.js → 04dbebaeb2d4d778f0e1.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{4726c869d80257488a38.js → 0690434cb3d7df4188aa.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{9d7a75f6a078d899fb67.js → 073fdfd01d940c7b1da1.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{bf097a329b91fcd7a300.js → 0a9813558c89a8824080.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{33ea3449d32ac21adc91.js → 0d10010d8db4ebd20356.js} +1 -1
  54. package/assets/esri/core/workers/chunks/0ea80e26c937441c2bc5.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e6ed9ad383b1c1867f66.js → 1dcdde67304e8fe11fc0.js} +1 -1
  56. package/assets/esri/core/workers/chunks/253d5c44f6cfd32b6548.js +1 -0
  57. package/assets/esri/core/workers/chunks/{4827f8f9cfb07d523b9c.js → 2eb2d49c549e53934b8b.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{820bab0252bb0c7815cf.js → 3a0268b5d0bb8ead8622.js} +1 -1
  59. package/assets/esri/core/workers/chunks/4ef7d9c19bc3a95748a4.js +1 -0
  60. package/assets/esri/core/workers/chunks/52b6711572ac7e058ce6.js +1 -0
  61. package/assets/esri/core/workers/chunks/5e71fb59cff1ca8b6adb.js +1 -0
  62. package/assets/esri/core/workers/chunks/{ab05015ded44c1f8f0e2.js → 60ff321a20b3f8c0bb3c.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{e031a2fee155aa168858.js → 61959a85261218b22376.js} +1 -1
  64. package/assets/esri/core/workers/chunks/7495f2a9713eb8e5ccc5.js +1 -0
  65. package/assets/esri/core/workers/chunks/{a7e19cd543b5836c018d.js → 77cc27d60c79df45dbc2.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{363700f66277a9176991.js → 7c255fe7a231d93a2048.js} +1 -1
  67. package/assets/esri/core/workers/chunks/803492088780e18de801.js +1 -0
  68. package/assets/esri/core/workers/chunks/85f56a2bc01b611533d9.js +1 -0
  69. package/assets/esri/core/workers/chunks/8750c7463968f0c183ba.js +1 -0
  70. package/assets/esri/core/workers/chunks/{6ec223bcd2c3bd40ffee.js → 92f4e92aa7398ca58265.js} +1 -1
  71. package/assets/esri/core/workers/chunks/a16641c79f56012b0d66.js +1 -0
  72. package/assets/esri/core/workers/chunks/a83274fd379b4fc73728.js +1 -0
  73. package/assets/esri/core/workers/chunks/{211ad79ff0b187c52449.js → afd87bc92895517b0877.js} +1 -1
  74. package/assets/esri/core/workers/chunks/b04984f048b75b2b4dd2.js +1 -0
  75. package/assets/esri/core/workers/chunks/{7f96fd3844cd6eda0ec3.js → b766aa60a1cc728042c9.js} +1 -1
  76. package/assets/esri/core/workers/chunks/bc878858cf5fb3237206.js +1 -0
  77. package/assets/esri/core/workers/chunks/{73d73ace57e10c70477c.js → e967ffca641947212992.js} +1 -1
  78. package/assets/esri/core/workers/chunks/ee261fdc2a82d05e458e.js +1 -0
  79. package/assets/esri/core/workers/chunks/f29c6965e9e8f904be40.js +1 -0
  80. package/assets/esri/core/workers/chunks/fa962030bc7e24036aaf.js +1 -0
  81. package/assets/esri/core/workers/chunks/{63ce5262d97c2afb4464.js → ffdb5c1133a45787cd63.js} +1 -1
  82. package/assets/esri/css/main.scss +1 -1
  83. package/assets/esri/css/view.scss +1 -1
  84. package/assets/esri/images/support/loading-throb.gif +0 -0
  85. package/assets/esri/themes/base/_Overlay.scss +14 -14
  86. package/assets/esri/themes/base/_OverlayItem.scss +52 -52
  87. package/assets/esri/themes/base/_Ui.scss +149 -149
  88. package/assets/esri/themes/base/_View.scss +194 -194
  89. package/assets/esri/themes/base/_animation.scss +128 -128
  90. package/assets/esri/themes/base/_color.scss +58 -58
  91. package/assets/esri/themes/base/_colorVariables.scss +1 -1
  92. package/assets/esri/themes/base/_core.scss +172 -172
  93. package/assets/esri/themes/base/_functions.scss +23 -23
  94. package/assets/esri/themes/base/_layout.scss +11 -11
  95. package/assets/esri/themes/base/_mixins.scss +665 -665
  96. package/assets/esri/themes/base/_sizes.scss +130 -130
  97. package/assets/esri/themes/base/_type.scss +27 -27
  98. package/assets/esri/themes/base/colors/css/scss/brand_colors.scss +0 -0
  99. package/assets/esri/themes/base/colors/css/scss/calcite_core_colors.scss +0 -0
  100. package/assets/esri/themes/base/colors/css/scss/calcite_core_colors_dark.scss +0 -0
  101. package/assets/esri/themes/base/colors/css/scss/calcite_gray_colors.scss +0 -0
  102. package/assets/esri/themes/base/colors/css/scss/calcite_gray_colors_dark.scss +0 -0
  103. package/assets/esri/themes/base/colors/css/scss/calcite_highlight_colors.scss +0 -0
  104. package/assets/esri/themes/base/colors/css/scss/calcite_highlight_colors_dark.scss +0 -0
  105. package/assets/esri/themes/base/colors/css/scss/calcite_vibrant_colors.scss +0 -0
  106. package/assets/esri/themes/base/colors/css/scss/calcite_vibrant_colors_dark.scss +0 -0
  107. package/assets/esri/themes/base/colors/css/scss/complete.scss +0 -0
  108. package/assets/esri/themes/base/colors/patterns_json/scss/brand_colors.scss +0 -0
  109. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_core_colors.scss +0 -0
  110. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_core_colors_dark.scss +0 -0
  111. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_gray_colors.scss +0 -0
  112. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_gray_colors_dark.scss +0 -0
  113. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_highlight_colors.scss +0 -0
  114. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_highlight_colors_dark.scss +0 -0
  115. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_vibrant_colors.scss +0 -0
  116. package/assets/esri/themes/base/colors/patterns_json/scss/calcite_vibrant_colors_dark.scss +0 -0
  117. package/assets/esri/themes/base/colors/patterns_json/scss/complete.scss +0 -0
  118. package/assets/esri/themes/base/fonts/fonts/014f2daa-c310-4a36-b9fd-79a8e0c48d44-ext.woff2 +0 -0
  119. package/assets/esri/themes/base/fonts/fonts/014f2daa-c310-4a36-b9fd-79a8e0c48d44-greek.woff2 +0 -0
  120. package/assets/esri/themes/base/fonts/fonts/014f2daa-c310-4a36-b9fd-79a8e0c48d44.woff2 +0 -0
  121. package/assets/esri/themes/base/fonts/fonts/0763eab1-d6ed-4c73-afb0-895f930df099.woff +0 -0
  122. package/assets/esri/themes/base/fonts/fonts/121524c1-8d82-4155-bfb3-fd2f15f09e93.woff +0 -0
  123. package/assets/esri/themes/base/fonts/fonts/12b00842-ec20-4c7f-aa72-802fb00f6cc4-ext.woff +0 -0
  124. package/assets/esri/themes/base/fonts/fonts/12b00842-ec20-4c7f-aa72-802fb00f6cc4-greek.woff +0 -0
  125. package/assets/esri/themes/base/fonts/fonts/12b00842-ec20-4c7f-aa72-802fb00f6cc4.woff +0 -0
  126. package/assets/esri/themes/base/fonts/fonts/13faf0ae-dcab-4d1c-9c08-f9ca339b6023-greek.woff +0 -0
  127. package/assets/esri/themes/base/fonts/fonts/13faf0ae-dcab-4d1c-9c08-f9ca339b6023.woff +0 -0
  128. package/assets/esri/themes/base/fonts/fonts/15e2e15a-2f36-4a01-b529-677d575bf76d.woff2 +0 -0
  129. package/assets/esri/themes/base/fonts/fonts/174d458a-81e0-4174-9473-35e3bf0a613c.woff2 +0 -0
  130. package/assets/esri/themes/base/fonts/fonts/18629a56-2ec3-4470-a65f-f82d7ec4d41b.woff2 +0 -0
  131. package/assets/esri/themes/base/fonts/fonts/1b3078ef-2971-4c95-b6ca-13ab528758cb.woff +0 -0
  132. package/assets/esri/themes/base/fonts/fonts/1fed34fa-250a-4d32-9f1d-42f978a2e0b2.woff2 +0 -0
  133. package/assets/esri/themes/base/fonts/fonts/2200dfff-da50-40b0-bc12-5e4b872a1998.woff2 +0 -0
  134. package/assets/esri/themes/base/fonts/fonts/281f890c-8412-4ee3-84ed-8b5d062d2ab8.woff2 +0 -0
  135. package/assets/esri/themes/base/fonts/fonts/2a1ae9a5-b6b5-405c-b660-bbdf1b356952.woff2 +0 -0
  136. package/assets/esri/themes/base/fonts/fonts/31da4b04-f98a-4b5f-b545-a31d26da99e5.woff2 +0 -0
  137. package/assets/esri/themes/base/fonts/fonts/31e0c094-e345-4a54-a797-d5f1a5885572.woff +0 -0
  138. package/assets/esri/themes/base/fonts/fonts/32a2c5cf-6736-44a6-a276-49ba7e030944.woff2 +0 -0
  139. package/assets/esri/themes/base/fonts/fonts/341bcc5e-7ac0-44ff-819d-5887892eab1b.woff +0 -0
  140. package/assets/esri/themes/base/fonts/fonts/390cea11-2b11-47ac-b3e8-43ded6ae89ee.woff +0 -0
  141. package/assets/esri/themes/base/fonts/fonts/394a711e-3459-44f3-85c7-e99c01e4b55c.woff +0 -0
  142. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  143. package/assets/esri/themes/base/fonts/fonts/3d5260a1-e4cd-4567-80ed-69d23c40355f-ext.woff +0 -0
  144. package/assets/esri/themes/base/fonts/fonts/3d5260a1-e4cd-4567-80ed-69d23c40355f-greek.woff +0 -0
  145. package/assets/esri/themes/base/fonts/fonts/3d5260a1-e4cd-4567-80ed-69d23c40355f.woff +0 -0
  146. package/assets/esri/themes/base/fonts/fonts/40d36b4a-60c6-460a-bf43-4c948c23563e.woff2 +0 -0
  147. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  148. package/assets/esri/themes/base/fonts/fonts/439a2ded-d7a4-42d4-8660-ef8765fa7486.woff +0 -0
  149. package/assets/esri/themes/base/fonts/fonts/45b78f45-e639-4836-8612-e0892e120f14.woff +0 -0
  150. package/assets/esri/themes/base/fonts/fonts/46947883-147e-48dd-97c2-5a8ca675b998.woff2 +0 -0
  151. package/assets/esri/themes/base/fonts/fonts/4ab86b35-c0c2-42b5-98ad-4b6eba66b197.woff +0 -0
  152. package/assets/esri/themes/base/fonts/fonts/4d1d0d0d-9ea6-4117-901f-8b32ca1ab936.woff +0 -0
  153. package/assets/esri/themes/base/fonts/fonts/4daa2125-53c6-4da8-9614-8a1049eaccc2.woff2 +0 -0
  154. package/assets/esri/themes/base/fonts/fonts/4e4befe6-3f94-41d8-886c-1a6831818c6a.woff2 +0 -0
  155. package/assets/esri/themes/base/fonts/fonts/5729f02e-f6b0-4f35-8ee5-c2cffa65fa76.woff +0 -0
  156. package/assets/esri/themes/base/fonts/fonts/57a79aa3-9b06-4ba7-a9a4-2b766d826ecf.woff +0 -0
  157. package/assets/esri/themes/base/fonts/fonts/61f13f40-3829-413c-b6f5-b11abb272edc.woff +0 -0
  158. package/assets/esri/themes/base/fonts/fonts/6ea5fa46-5311-450b-8744-288a30c55348.woff2 +0 -0
  159. package/assets/esri/themes/base/fonts/fonts/75e2f3b1-1402-4916-8392-4db9ababea7b.woff2 +0 -0
  160. package/assets/esri/themes/base/fonts/fonts/77156710-6a58-4606-b189-b4185e75967b-ext.woff2 +0 -0
  161. package/assets/esri/themes/base/fonts/fonts/77156710-6a58-4606-b189-b4185e75967b-greek.woff2 +0 -0
  162. package/assets/esri/themes/base/fonts/fonts/77156710-6a58-4606-b189-b4185e75967b.woff2 +0 -0
  163. package/assets/esri/themes/base/fonts/fonts/77caabd3-1877-4634-85c8-8e398a093b99-ext.woff2 +0 -0
  164. package/assets/esri/themes/base/fonts/fonts/77caabd3-1877-4634-85c8-8e398a093b99-greek.woff2 +0 -0
  165. package/assets/esri/themes/base/fonts/fonts/77caabd3-1877-4634-85c8-8e398a093b99.woff2 +0 -0
  166. package/assets/esri/themes/base/fonts/fonts/7db1f672-3a8f-4d19-9c49-7f61aed450b5.woff2 +0 -0
  167. package/assets/esri/themes/base/fonts/fonts/89370128-6a74-471d-ba04-fa0b59bc8ed3.woff +0 -0
  168. package/assets/esri/themes/base/fonts/fonts/8a65abc7-6463-4895-b3e6-5e203b80b7e2.woff2 +0 -0
  169. package/assets/esri/themes/base/fonts/fonts/8b01637a-f445-4f10-92ea-b84a355f7690.woff +0 -0
  170. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  171. package/assets/esri/themes/base/fonts/fonts/97694c53-4e94-4f9e-969b-a148adfcdcfd.woff2 +0 -0
  172. package/assets/esri/themes/base/fonts/fonts/97b330aa-d7fa-4f85-830f-b11a5041b157.woff +0 -0
  173. package/assets/esri/themes/base/fonts/fonts/9851da0a-2481-4687-bbeb-ed4ab170dc38-ext.woff2 +0 -0
  174. package/assets/esri/themes/base/fonts/fonts/9851da0a-2481-4687-bbeb-ed4ab170dc38.woff2 +0 -0
  175. package/assets/esri/themes/base/fonts/fonts/9c1ab088-0cb0-402f-9cea-170f0fea14a8.woff2 +0 -0
  176. package/assets/esri/themes/base/fonts/fonts/a1049d00-54ad-4589-95b8-d353f7ab52f0-greek.woff2 +0 -0
  177. package/assets/esri/themes/base/fonts/fonts/a1049d00-54ad-4589-95b8-d353f7ab52f0.woff2 +0 -0
  178. package/assets/esri/themes/base/fonts/fonts/a8aeea1b-1a9d-45b7-8ad9-7c71824599e2.woff +0 -0
  179. package/assets/esri/themes/base/fonts/fonts/a9eaf4d3-6427-42df-9306-3ea1270f7b1a.woff2 +0 -0
  180. package/assets/esri/themes/base/fonts/fonts/ae454969-59fb-4d42-aecb-dea30459bc7e.woff +0 -0
  181. package/assets/esri/themes/base/fonts/fonts/b0b84e4d-2164-45c7-a674-1662f19f3ba6-basic.woff2 +0 -0
  182. package/assets/esri/themes/base/fonts/fonts/b0b84e4d-2164-45c7-a674-1662f19f3ba6-ext.woff2 +0 -0
  183. package/assets/esri/themes/base/fonts/fonts/b0b84e4d-2164-45c7-a674-1662f19f3ba6.woff2 +0 -0
  184. package/assets/esri/themes/base/fonts/fonts/b17468ea-cf53-4635-984b-4d930a68ed4d.woff2 +0 -0
  185. package/assets/esri/themes/base/fonts/fonts/bb93c563-55f6-494f-8e1e-448538d95df1.woff +0 -0
  186. package/assets/esri/themes/base/fonts/fonts/c1905e2e-a1cb-49de-9bb0-ce3c5ffc85ae.woff2 +0 -0
  187. package/assets/esri/themes/base/fonts/fonts/c4cc9032-7eee-4a6e-ae8b-f384b1349bcf.woff2 +0 -0
  188. package/assets/esri/themes/base/fonts/fonts/c744f2a2-d6a9-4c18-b0ec-f17376acde3e.woff +0 -0
  189. package/assets/esri/themes/base/fonts/fonts/cebce072-9561-4c6d-8c89-f0cefec63289-ext.woff +0 -0
  190. package/assets/esri/themes/base/fonts/fonts/cebce072-9561-4c6d-8c89-f0cefec63289.woff +0 -0
  191. package/assets/esri/themes/base/fonts/fonts/d4ffabb3-dd7c-472a-bdfb-6700383c6354-ext.woff +0 -0
  192. package/assets/esri/themes/base/fonts/fonts/d4ffabb3-dd7c-472a-bdfb-6700383c6354-greek.woff +0 -0
  193. package/assets/esri/themes/base/fonts/fonts/d4ffabb3-dd7c-472a-bdfb-6700383c6354.woff +0 -0
  194. package/assets/esri/themes/base/fonts/fonts/d824d78b-aab0-44e3-8c56-6c3dcf551952.woff2 +0 -0
  195. package/assets/esri/themes/base/fonts/fonts/d98fb015-7ef6-404f-a58a-5c9242d79770.woff +0 -0
  196. package/assets/esri/themes/base/fonts/fonts/d9e4040d-32ff-4a1c-ac04-927a781da1f5.woff +0 -0
  197. package/assets/esri/themes/base/fonts/fonts/dc10b3bd-5076-4df5-a5f5-e5961f4a6938.woff +0 -0
  198. package/assets/esri/themes/base/fonts/fonts/dd7b7d4e-21ab-4ac0-b26a-d032c992f3c5.woff2 +0 -0
  199. package/assets/esri/themes/base/fonts/fonts/e388ac99-8c6a-4451-8690-1d15b4d45adb-ext.woff +0 -0
  200. package/assets/esri/themes/base/fonts/fonts/e388ac99-8c6a-4451-8690-1d15b4d45adb-greek.woff +0 -0
  201. package/assets/esri/themes/base/fonts/fonts/e388ac99-8c6a-4451-8690-1d15b4d45adb.woff +0 -0
  202. package/assets/esri/themes/base/fonts/fonts/e57662ff-b1ef-4122-88c1-61bbdabeb365.woff +0 -0
  203. package/assets/esri/themes/base/fonts/fonts/e78b17bb-11fb-4860-8d66-4ee0d0c1e117-ext.woff2 +0 -0
  204. package/assets/esri/themes/base/fonts/fonts/e78b17bb-11fb-4860-8d66-4ee0d0c1e117-greek.woff2 +0 -0
  205. package/assets/esri/themes/base/fonts/fonts/e78b17bb-11fb-4860-8d66-4ee0d0c1e117.woff2 +0 -0
  206. package/assets/esri/themes/base/fonts/fonts/e91d1bbf-3fea-45e2-b003-a22b12ce6e5f-basic.woff +0 -0
  207. package/assets/esri/themes/base/fonts/fonts/e91d1bbf-3fea-45e2-b003-a22b12ce6e5f-ext.woff +0 -0
  208. package/assets/esri/themes/base/fonts/fonts/e91d1bbf-3fea-45e2-b003-a22b12ce6e5f.woff +0 -0
  209. package/assets/esri/themes/base/fonts/fonts/f1799750-0952-403f-8108-b2402eed0f62.woff +0 -0
  210. package/assets/esri/themes/base/fonts/fonts/f4a085c3-1c64-4fc0-a598-26f3e658c2b0.woff +0 -0
  211. package/assets/esri/themes/base/fonts/fonts/fa71df11-7b19-4baf-8ff7-3537dea718f0.woff +0 -0
  212. package/assets/esri/themes/base/icons/style.css +0 -0
  213. package/assets/esri/themes/base/icons/style.scss +0 -0
  214. package/assets/esri/themes/base/icons/variables.scss +0 -0
  215. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  216. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  217. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  218. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  219. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  220. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  221. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  222. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  223. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  224. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  225. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  226. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  227. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  228. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  229. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  230. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  231. package/assets/esri/themes/base/widgets/_AreaMeasurement2D.scss +14 -14
  232. package/assets/esri/themes/base/widgets/_AreaMeasurement3D.scss +14 -14
  233. package/assets/esri/themes/base/widgets/_Attachments.scss +286 -286
  234. package/assets/esri/themes/base/widgets/_Attribution.scss +57 -57
  235. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +168 -168
  236. package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +530 -530
  237. package/assets/esri/themes/base/widgets/_BasemapToggle.scss +123 -123
  238. package/assets/esri/themes/base/widgets/_BinaryColorSizeSlider.scss +7 -7
  239. package/assets/esri/themes/base/widgets/_Bookmarks.scss +349 -349
  240. package/assets/esri/themes/base/widgets/_BuildingDisciplinesTree.scss +151 -151
  241. package/assets/esri/themes/base/widgets/_BuildingExplorer.scss +51 -51
  242. package/assets/esri/themes/base/widgets/_BuildingLevelPicker.scss +253 -253
  243. package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +92 -92
  244. package/assets/esri/themes/base/widgets/_ButtonMenu.scss +129 -129
  245. package/assets/esri/themes/base/widgets/_ClassedColorSlider.scss +7 -7
  246. package/assets/esri/themes/base/widgets/_ClassedSizeSlider.scss +7 -7
  247. package/assets/esri/themes/base/widgets/_ColorPicker.scss +70 -70
  248. package/assets/esri/themes/base/widgets/_ColorSizeSlider.scss +7 -7
  249. package/assets/esri/themes/base/widgets/_ColorSlider.scss +7 -7
  250. package/assets/esri/themes/base/widgets/_Compass.scss +16 -16
  251. package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +236 -236
  252. package/assets/esri/themes/base/widgets/_DatePicker.scss +169 -169
  253. package/assets/esri/themes/base/widgets/_Daylight.scss +270 -270
  254. package/assets/esri/themes/base/widgets/_DirectLineMeasurement3D.scss +7 -7
  255. package/assets/esri/themes/base/widgets/_Directions.scss +472 -472
  256. package/assets/esri/themes/base/widgets/_DistanceMeasurement2D.scss +7 -7
  257. package/assets/esri/themes/base/widgets/_Editor.scss +260 -260
  258. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +439 -439
  259. package/assets/esri/themes/base/widgets/_Expand.scss +264 -264
  260. package/assets/esri/themes/base/widgets/_Feature.scss +94 -94
  261. package/assets/esri/themes/base/widgets/_FeatureContent.scss +97 -97
  262. package/assets/esri/themes/base/widgets/_FeatureForm.scss +236 -236
  263. package/assets/esri/themes/base/widgets/_FeatureMedia.scss +86 -86
  264. package/assets/esri/themes/base/widgets/_FeatureTable.scss +247 -247
  265. package/assets/esri/themes/base/widgets/_FeatureTemplates.scss +44 -44
  266. package/assets/esri/themes/base/widgets/_FloorFilter.scss +480 -480
  267. package/assets/esri/themes/base/widgets/_Grid.scss +71 -71
  268. package/assets/esri/themes/base/widgets/_HeatmapSlider.scss +7 -7
  269. package/assets/esri/themes/base/widgets/_Histogram.scss +56 -56
  270. package/assets/esri/themes/base/widgets/_HistogramRangeSlider.scss +105 -105
  271. package/assets/esri/themes/base/widgets/_IdentityForm.scss +22 -22
  272. package/assets/esri/themes/base/widgets/_IdentityModal.scss +105 -105
  273. package/assets/esri/themes/base/widgets/_ItemList.scss +143 -143
  274. package/assets/esri/themes/base/widgets/_LayerList.scss +453 -453
  275. package/assets/esri/themes/base/widgets/_Legend.scss +551 -551
  276. package/assets/esri/themes/base/widgets/_LineOfSight.scss +41 -41
  277. package/assets/esri/themes/base/widgets/_Measurement.scss +6 -6
  278. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +99 -99
  279. package/assets/esri/themes/base/widgets/_OpacitySlider.scss +7 -7
  280. package/assets/esri/themes/base/widgets/_Popup.scss +759 -759
  281. package/assets/esri/themes/base/widgets/_Print.scss +269 -269
  282. package/assets/esri/themes/base/widgets/_SaveLayer.scss +40 -40
  283. package/assets/esri/themes/base/widgets/_ScaleBar.scss +160 -160
  284. package/assets/esri/themes/base/widgets/_ScaleRangeSlider.scss +211 -211
  285. package/assets/esri/themes/base/widgets/_Search.scss +193 -193
  286. package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +34 -34
  287. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +18 -18
  288. package/assets/esri/themes/base/widgets/_ShadowCast.scss +202 -202
  289. package/assets/esri/themes/base/widgets/_SizeSlider.scss +7 -7
  290. package/assets/esri/themes/base/widgets/_Sketch.scss +151 -151
  291. package/assets/esri/themes/base/widgets/_Slice.scss +80 -80
  292. package/assets/esri/themes/base/widgets/_Slider.scss +367 -367
  293. package/assets/esri/themes/base/widgets/_SnappingControls.scss +143 -143
  294. package/assets/esri/themes/base/widgets/_Spinner.scss +76 -76
  295. package/assets/esri/themes/base/widgets/_Swipe.scss +105 -105
  296. package/assets/esri/themes/base/widgets/_TableList.scss +325 -325
  297. package/assets/esri/themes/base/widgets/_TimePicker.scss +15 -15
  298. package/assets/esri/themes/base/widgets/_TimeSlider.scss +404 -404
  299. package/assets/esri/themes/base/widgets/_Tooltip.scss +61 -61
  300. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +47 -47
  301. package/assets/esri/themes/base/widgets/_Weather.scss +59 -59
  302. package/assets/esri/themes/base/widgets/_Widget.scss +688 -688
  303. package/assets/esri/themes/base/widgets/_Zoom.scss +45 -45
  304. package/assets/esri/themes/dark/main.scss +34 -34
  305. package/assets/esri/themes/light/main.scss +9 -9
  306. package/assets/esri/themes/light/view.scss +9 -9
  307. package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.svg +4 -4
  308. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +80 -80
  309. package/assets/esri/views/3d/webgl-engine/lib/intersectorUtils.svg +117 -117
  310. package/assets/esri/views/magnifier/mask.ts.svg +5 -5
  311. package/assets/esri/views/magnifier/overlay.ts.svg +36 -36
  312. package/chunks/array.js +1 -1
  313. package/chunks/languageUtils.js +1 -1
  314. package/config.d.ts +1 -1
  315. package/config.js +1 -1
  316. package/copyright.txt +1278 -1278
  317. package/core/Accessor.d.ts +1 -1
  318. package/core/Collection.d.ts +1 -1
  319. package/core/Error.d.ts +1 -1
  320. package/core/Evented.d.ts +1 -1
  321. package/core/HandleOwner.d.ts +1 -1
  322. package/core/Handles.d.ts +1 -1
  323. package/core/Identifiable.d.ts +1 -1
  324. package/core/JSONSupport.d.ts +1 -1
  325. package/core/Loadable.d.ts +1 -1
  326. package/core/Promise.d.ts +1 -1
  327. package/core/accessorSupport/decorators.d.ts +1 -1
  328. package/core/lang.d.ts +1 -1
  329. package/core/promiseUtils.d.ts +1 -1
  330. package/core/quantity.d.ts +1 -1
  331. package/core/reactiveUtils.d.ts +1 -1
  332. package/core/scheduling.d.ts +1 -1
  333. package/core/sql/WhereClause.d.ts +1 -1
  334. package/core/sql.d.ts +1 -1
  335. package/core/units.d.ts +1 -1
  336. package/core/urlUtils.d.ts +1 -1
  337. package/core/watchUtils.d.ts +1 -1
  338. package/core/workers/Connection.d.ts +1 -1
  339. package/core/workers.d.ts +1 -1
  340. package/form/ExpressionInfo.d.ts +1 -1
  341. package/form/FormTemplate.d.ts +1 -1
  342. package/form/elements/Element.d.ts +1 -1
  343. package/form/elements/FieldElement.d.ts +1 -1
  344. package/form/elements/GroupElement.d.ts +1 -1
  345. package/form/elements/inputs/BarcodeScannerInput.d.ts +1 -1
  346. package/form/elements/inputs/ComboBoxInput.d.ts +1 -1
  347. package/form/elements/inputs/DateTimePickerInput.d.ts +1 -1
  348. package/form/elements/inputs/RadioButtonsInput.d.ts +1 -1
  349. package/form/elements/inputs/SwitchInput.d.ts +1 -1
  350. package/form/elements/inputs/TextAreaInput.d.ts +1 -1
  351. package/form/elements/inputs/TextBoxInput.d.ts +1 -1
  352. package/form/elements/inputs/TextInput.d.ts +1 -1
  353. package/form/elements/support/inputs.d.ts +1 -1
  354. package/form/support/elements.d.ts +1 -1
  355. package/geometry/Circle.d.ts +1 -1
  356. package/geometry/Extent.d.ts +1 -1
  357. package/geometry/Geometry.d.ts +1 -1
  358. package/geometry/HeightModelInfo.d.ts +1 -1
  359. package/geometry/Mesh.d.ts +1 -1
  360. package/geometry/Multipoint.d.ts +1 -1
  361. package/geometry/Point.d.ts +1 -1
  362. package/geometry/Polygon.d.ts +1 -1
  363. package/geometry/Polyline.d.ts +1 -1
  364. package/geometry/SpatialReference.d.ts +1 -1
  365. package/geometry/coordinateFormatter.d.ts +1 -1
  366. package/geometry/geometryEngine.d.ts +1 -1
  367. package/geometry/geometryEngineAsync.d.ts +1 -1
  368. package/geometry/projection.d.ts +1 -1
  369. package/geometry/support/GeographicTransformation.d.ts +1 -1
  370. package/geometry/support/GeographicTransformationStep.d.ts +1 -1
  371. package/geometry/support/MeshComponent.d.ts +1 -1
  372. package/geometry/support/MeshMaterial.d.ts +1 -1
  373. package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
  374. package/geometry/support/MeshTexture.d.ts +1 -1
  375. package/geometry/support/geodesicUtils.d.ts +1 -1
  376. package/geometry/support/jsonUtils.d.ts +1 -1
  377. package/geometry/support/meshUtils.d.ts +1 -1
  378. package/geometry/support/normalizeUtils.d.ts +1 -1
  379. package/geometry/support/webMercatorUtils.d.ts +1 -1
  380. package/geometry.d.ts +1 -1
  381. package/identity/Credential.d.ts +1 -1
  382. package/identity/IdentityManager.d.ts +1 -1
  383. package/identity/IdentityManagerBase.js +1 -1
  384. package/identity/OAuthInfo.d.ts +1 -1
  385. package/identity/ServerInfo.d.ts +1 -1
  386. package/interfaces.d.ts +6 -0
  387. package/intl.d.ts +1 -1
  388. package/kernel.d.ts +1 -1
  389. package/layers/BaseDynamicLayer.d.ts +1 -1
  390. package/layers/BaseElevationLayer.d.ts +1 -1
  391. package/layers/BaseTileLayer.d.ts +1 -1
  392. package/layers/BingMapsLayer.d.ts +1 -1
  393. package/layers/BuildingSceneLayer.d.ts +1 -1
  394. package/layers/CSVLayer.d.ts +1 -1
  395. package/layers/DimensionLayer.d.ts +1 -1
  396. package/layers/ElevationLayer.d.ts +1 -1
  397. package/layers/FeatureLayer.d.ts +1 -1
  398. package/layers/GeoJSONLayer.d.ts +1 -1
  399. package/layers/GeoRSSLayer.d.ts +1 -1
  400. package/layers/GraphicsLayer.d.ts +1 -1
  401. package/layers/GroupLayer.d.ts +1 -1
  402. package/layers/ImageryLayer.d.ts +1 -1
  403. package/layers/ImageryTileLayer.d.ts +1 -1
  404. package/layers/IntegratedMeshLayer.d.ts +1 -1
  405. package/layers/KMLLayer.d.ts +1 -1
  406. package/layers/Layer.d.ts +1 -1
  407. package/layers/LineOfSightLayer.d.ts +1 -1
  408. package/layers/MapImageLayer.d.ts +1 -1
  409. package/layers/MapNotesLayer.d.ts +1 -1
  410. package/layers/MediaLayer.d.ts +1 -1
  411. package/layers/OGCFeatureLayer.d.ts +1 -1
  412. package/layers/OpenStreetMapLayer.d.ts +1 -1
  413. package/layers/PointCloudLayer.d.ts +1 -1
  414. package/layers/RouteLayer.d.ts +1 -1
  415. package/layers/SceneLayer.d.ts +1 -1
  416. package/layers/StreamLayer.d.ts +1 -1
  417. package/layers/SubtypeGroupLayer.d.ts +1 -1
  418. package/layers/TileLayer.d.ts +1 -1
  419. package/layers/UnknownLayer.d.ts +1 -1
  420. package/layers/UnsupportedLayer.d.ts +1 -1
  421. package/layers/VectorTileLayer.d.ts +1 -1
  422. package/layers/VoxelLayer.d.ts +1 -1
  423. package/layers/WCSLayer.d.ts +1 -1
  424. package/layers/WFSLayer.d.ts +1 -1
  425. package/layers/WMSLayer.d.ts +1 -1
  426. package/layers/WMTSLayer.d.ts +1 -1
  427. package/layers/WebTileLayer.d.ts +1 -1
  428. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +1 -1
  429. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
  430. package/layers/buildingSublayers/BuildingSublayer.d.ts +1 -1
  431. package/layers/graphics/sources/csv/csv.js +1 -1
  432. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  433. package/layers/graphics/sources/geojson/geojson.js +1 -1
  434. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  435. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  436. package/layers/mixins/APIKeyMixin.d.ts +1 -1
  437. package/layers/mixins/ArcGISCachedService.d.ts +1 -1
  438. package/layers/mixins/ArcGISImageService.d.ts +1 -1
  439. package/layers/mixins/ArcGISMapService.d.ts +1 -1
  440. package/layers/mixins/BlendLayer.d.ts +1 -1
  441. package/layers/mixins/CustomParametersMixin.d.ts +1 -1
  442. package/layers/mixins/EditBusLayer.js +1 -1
  443. package/layers/mixins/FeatureEffectLayer.d.ts +1 -1
  444. package/layers/mixins/FeatureLayerBase.d.ts +1 -1
  445. package/layers/mixins/FeatureReductionLayer.d.ts +1 -1
  446. package/layers/mixins/ImageryTileMixin.d.ts +1 -1
  447. package/layers/mixins/OrderedLayer.d.ts +1 -1
  448. package/layers/mixins/PortalLayer.d.ts +1 -1
  449. package/layers/mixins/PublishableLayer.d.ts +1 -1
  450. package/layers/mixins/RefreshableLayer.d.ts +1 -1
  451. package/layers/mixins/ScaleRangeLayer.d.ts +1 -1
  452. package/layers/mixins/SceneService.d.ts +1 -1
  453. package/layers/mixins/SublayersOwner.d.ts +1 -1
  454. package/layers/mixins/TemporalLayer.d.ts +1 -1
  455. package/layers/ogc/wfsUtils.d.ts +1 -1
  456. package/layers/pointCloudFilters/PointCloudFilter.d.ts +1 -1
  457. package/layers/pointCloudFilters/PointCloudReturnFilter.d.ts +1 -1
  458. package/layers/pointCloudFilters/PointCloudValueFilter.d.ts +1 -1
  459. package/layers/support/AggregateField.d.ts +1 -1
  460. package/layers/support/BuildingFilter.d.ts +1 -1
  461. package/layers/support/BuildingSummaryStatistics.d.ts +1 -1
  462. package/layers/support/CodedValueDomain.d.ts +1 -1
  463. package/layers/support/ControlPointsGeoreference.d.ts +1 -1
  464. package/layers/support/CornersGeoreference.d.ts +1 -1
  465. package/layers/support/DimensionalDefinition.d.ts +1 -1
  466. package/layers/support/Domain.d.ts +1 -1
  467. package/layers/support/ElevationSampler.d.ts +1 -1
  468. package/layers/support/ExpressionInfo.d.ts +1 -1
  469. package/layers/support/ExtentAndRotationGeoreference.d.ts +1 -1
  470. package/layers/support/FacilityLayerInfo.d.ts +1 -1
  471. package/layers/support/FeatureEffect.d.ts +1 -1
  472. package/layers/support/FeatureFilter.d.ts +1 -1
  473. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  474. package/layers/support/FeatureReductionCluster.d.ts +1 -1
  475. package/layers/support/FeatureReductionSelection.d.ts +1 -1
  476. package/layers/support/FeatureTemplate.d.ts +1 -1
  477. package/layers/support/FeatureType.d.ts +1 -1
  478. package/layers/support/Field.d.ts +1 -1
  479. package/layers/support/FieldsIndex.d.ts +1 -1
  480. package/layers/support/FieldsIndex.js +1 -1
  481. package/layers/support/GeometryFieldsInfo.d.ts +1 -1
  482. package/layers/support/ImageElement.d.ts +1 -1
  483. package/layers/support/ImageParameters.d.ts +1 -1
  484. package/layers/support/InheritedDomain.d.ts +1 -1
  485. package/layers/support/KMLSublayer.d.ts +1 -1
  486. package/layers/support/LOD.d.ts +1 -1
  487. package/layers/support/LabelClass.d.ts +1 -1
  488. package/layers/support/LayerFloorInfo.d.ts +1 -1
  489. package/layers/support/LevelLayerInfo.d.ts +1 -1
  490. package/layers/support/LocalMediaElementSource.d.ts +1 -1
  491. package/layers/support/MapImage.d.ts +1 -1
  492. package/layers/support/MediaElementBase.d.ts +1 -1
  493. package/layers/support/MosaicRule.d.ts +1 -1
  494. package/layers/support/MultidimensionalSubset.d.ts +1 -1
  495. package/layers/support/PixelBlock.d.ts +1 -1
  496. package/layers/support/PublishingInfo.d.ts +1 -1
  497. package/layers/support/RangeDomain.d.ts +1 -1
  498. package/layers/support/RasterFunction.d.ts +1 -1
  499. package/layers/support/RasterInfo.d.ts +1 -1
  500. package/layers/support/Relationship.d.ts +1 -1
  501. package/layers/support/RouteStopSymbols.d.ts +1 -1
  502. package/layers/support/RouteSymbols.d.ts +1 -1
  503. package/layers/support/SceneFilter.d.ts +1 -1
  504. package/layers/support/SceneModification.d.ts +1 -1
  505. package/layers/support/SceneModifications.d.ts +1 -1
  506. package/layers/support/SiteLayerInfo.d.ts +1 -1
  507. package/layers/support/StreamConnection.d.ts +1 -1
  508. package/layers/support/Sublayer.d.ts +1 -1
  509. package/layers/support/SubtypeSublayer.d.ts +1 -1
  510. package/layers/support/TileInfo.d.ts +1 -1
  511. package/layers/support/TileMatrixSet.d.ts +1 -1
  512. package/layers/support/TimeInfo.d.ts +1 -1
  513. package/layers/support/TimeReference.d.ts +1 -1
  514. package/layers/support/VideoElement.d.ts +1 -1
  515. package/layers/support/VoxelVariable.d.ts +1 -1
  516. package/layers/support/VoxelVolumeStyle.d.ts +1 -1
  517. package/layers/support/WMSSublayer.d.ts +1 -1
  518. package/layers/support/WMTSStyle.d.ts +1 -1
  519. package/layers/support/WMTSSublayer.d.ts +1 -1
  520. package/layers/support/arcadeUtils.d.ts +1 -1
  521. package/layers/support/fieldUtils.d.ts +1 -1
  522. package/layers/support/fieldUtils.js +1 -1
  523. package/layers/voxel/VoxelDynamicSection.d.ts +1 -1
  524. package/layers/voxel/VoxelSlice.d.ts +1 -1
  525. package/layers/voxel/VoxelTransferFunctionStyle.d.ts +1 -1
  526. package/layers/voxel/VoxelVariable.d.ts +1 -1
  527. package/layers/voxel/VoxelVariableStyle.d.ts +1 -1
  528. package/layers/voxel/VoxelVolume.d.ts +1 -1
  529. package/layers/voxel/VoxelVolumeStyle.d.ts +1 -1
  530. package/networks/Network.d.ts +1 -1
  531. package/networks/UtilityNetwork.d.ts +1 -1
  532. package/networks/support/NamedTraceConfiguration.d.ts +1 -1
  533. package/networks/support/NetworkSystemLayers.d.ts +1 -1
  534. package/networks/support/Terminal.d.ts +1 -1
  535. package/networks/support/TerminalConfiguration.d.ts +1 -1
  536. package/networks/support/TraceConfiguration.d.ts +1 -1
  537. package/networks/support/UNTraceConfiguration.d.ts +1 -1
  538. package/package.json +1 -1
  539. package/pointCloudRenderers.d.ts +1 -1
  540. package/popup/ElementExpressionInfo.d.ts +1 -1
  541. package/popup/ExpressionInfo.d.ts +1 -1
  542. package/popup/FieldInfo.d.ts +1 -1
  543. package/popup/LayerOptions.d.ts +1 -1
  544. package/popup/RelatedRecordsInfo.d.ts +1 -1
  545. package/popup/content/AttachmentsContent.d.ts +1 -1
  546. package/popup/content/BarChartMediaInfo.d.ts +1 -1
  547. package/popup/content/ColumnChartMediaInfo.d.ts +1 -1
  548. package/popup/content/Content.d.ts +1 -1
  549. package/popup/content/CustomContent.d.ts +1 -1
  550. package/popup/content/ExpressionContent.d.ts +1 -1
  551. package/popup/content/FieldsContent.d.ts +1 -1
  552. package/popup/content/ImageMediaInfo.d.ts +1 -1
  553. package/popup/content/LineChartMediaInfo.d.ts +1 -1
  554. package/popup/content/MediaContent.d.ts +1 -1
  555. package/popup/content/PieChartMediaInfo.d.ts +1 -1
  556. package/popup/content/RelationshipContent.d.ts +1 -1
  557. package/popup/content/TextContent.d.ts +1 -1
  558. package/popup/content/mixins/ChartMediaInfo.d.ts +1 -1
  559. package/popup/content/mixins/MediaInfo.d.ts +1 -1
  560. package/popup/content/support/ChartMediaInfoValue.d.ts +1 -1
  561. package/popup/content/support/ChartMediaInfoValueSeries.d.ts +1 -1
  562. package/popup/content/support/ImageMediaInfoValue.d.ts +1 -1
  563. package/popup/content.d.ts +1 -1
  564. package/popup/support/FieldInfoFormat.d.ts +1 -1
  565. package/popup/support/RelatedRecordsInfoFieldOrder.d.ts +1 -1
  566. package/portal/Portal.d.ts +1 -1
  567. package/portal/PortalFolder.d.ts +1 -1
  568. package/portal/PortalGroup.d.ts +1 -1
  569. package/portal/PortalItem.d.ts +1 -1
  570. package/portal/PortalItemResource.d.ts +1 -1
  571. package/portal/PortalQueryParams.d.ts +1 -1
  572. package/portal/PortalQueryResult.d.ts +1 -1
  573. package/portal/PortalRating.d.ts +1 -1
  574. package/portal/PortalUser.d.ts +1 -1
  575. package/portal/support/urlUtils.js +1 -1
  576. package/rasterRenderers.d.ts +1 -1
  577. package/renderers/ClassBreaksRenderer.d.ts +1 -1
  578. package/renderers/DictionaryRenderer.d.ts +1 -1
  579. package/renderers/DotDensityRenderer.d.ts +1 -1
  580. package/renderers/FlowRenderer.d.ts +1 -1
  581. package/renderers/HeatmapRenderer.d.ts +1 -1
  582. package/renderers/PieChartRenderer.d.ts +1 -1
  583. package/renderers/PointCloudClassBreaksRenderer.d.ts +1 -1
  584. package/renderers/PointCloudRGBRenderer.d.ts +1 -1
  585. package/renderers/PointCloudRenderer.d.ts +1 -1
  586. package/renderers/PointCloudStretchRenderer.d.ts +1 -1
  587. package/renderers/PointCloudUniqueValueRenderer.d.ts +1 -1
  588. package/renderers/RasterColormapRenderer.d.ts +1 -1
  589. package/renderers/RasterShadedReliefRenderer.d.ts +1 -1
  590. package/renderers/RasterStretchRenderer.d.ts +1 -1
  591. package/renderers/Renderer.d.ts +1 -1
  592. package/renderers/SimpleRenderer.d.ts +1 -1
  593. package/renderers/UniqueValueRenderer.d.ts +1 -1
  594. package/renderers/VectorFieldRenderer.d.ts +1 -1
  595. package/renderers/mixins/VisualVariablesMixin.d.ts +1 -1
  596. package/renderers/support/AttributeColorInfo.d.ts +1 -1
  597. package/renderers/support/AuthoringInfo.d.ts +1 -1
  598. package/renderers/support/AuthoringInfoVisualVariable.d.ts +1 -1
  599. package/renderers/support/ClassBreakInfo.d.ts +1 -1
  600. package/renderers/support/ColormapInfo.d.ts +1 -1
  601. package/renderers/support/HeatmapColorStop.d.ts +1 -1
  602. package/renderers/support/UniqueValue.d.ts +1 -1
  603. package/renderers/support/UniqueValueClass.d.ts +1 -1
  604. package/renderers/support/UniqueValueGroup.d.ts +1 -1
  605. package/renderers/support/UniqueValueInfo.d.ts +1 -1
  606. package/renderers/support/jsonUtils.d.ts +1 -1
  607. package/renderers/visualVariables/ColorVariable.d.ts +1 -1
  608. package/renderers/visualVariables/OpacityVariable.d.ts +1 -1
  609. package/renderers/visualVariables/RotationVariable.d.ts +1 -1
  610. package/renderers/visualVariables/SizeVariable.d.ts +1 -1
  611. package/renderers/visualVariables/VisualVariable.d.ts +1 -1
  612. package/renderers/visualVariables/support/ColorSizeStop.d.ts +1 -1
  613. package/renderers/visualVariables/support/ColorStop.d.ts +1 -1
  614. package/renderers/visualVariables/support/OpacityStop.d.ts +1 -1
  615. package/renderers/visualVariables/support/SizeStop.d.ts +1 -1
  616. package/renderers.d.ts +1 -1
  617. package/request.d.ts +1 -1
  618. package/request.js +1 -1
  619. package/rest/closestFacility.d.ts +1 -1
  620. package/rest/find.d.ts +1 -1
  621. package/rest/geometryService.d.ts +1 -1
  622. package/rest/geoprocessor/GPOptions.d.ts +1 -1
  623. package/rest/geoprocessor.d.ts +1 -1
  624. package/rest/identify.d.ts +1 -1
  625. package/rest/imageService.d.ts +1 -1
  626. package/rest/knowledgeGraph/DataModel.d.ts +1 -1
  627. package/rest/knowledgeGraph/Entity.d.ts +1 -1
  628. package/rest/knowledgeGraph/EntityType.d.ts +1 -1
  629. package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
  630. package/rest/knowledgeGraph/GraphApplyEdits.d.ts +1 -1
  631. package/rest/knowledgeGraph/GraphApplyEditsResult.d.ts +1 -1
  632. package/rest/knowledgeGraph/GraphNamedObject.d.ts +1 -1
  633. package/rest/knowledgeGraph/GraphObject.d.ts +1 -1
  634. package/rest/knowledgeGraph/GraphObjectType.d.ts +1 -1
  635. package/rest/knowledgeGraph/GraphProperty.d.ts +1 -1
  636. package/rest/knowledgeGraph/GraphQuery.d.ts +1 -1
  637. package/rest/knowledgeGraph/GraphQueryResult.d.ts +1 -1
  638. package/rest/knowledgeGraph/GraphQueryStreaming.d.ts +1 -1
  639. package/rest/knowledgeGraph/GraphQueryStreamingResult.d.ts +1 -1
  640. package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
  641. package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
  642. package/rest/knowledgeGraph/InputQuantizationParameters.d.ts +1 -1
  643. package/rest/knowledgeGraph/KnowledgeGraph.d.ts +1 -1
  644. package/rest/knowledgeGraph/OutputQuantizationParameters.d.ts +1 -1
  645. package/rest/knowledgeGraph/Path.d.ts +1 -1
  646. package/rest/knowledgeGraph/Relationship.d.ts +1 -1
  647. package/rest/knowledgeGraph/RelationshipType.d.ts +1 -1
  648. package/rest/knowledgeGraphService.d.ts +1 -1
  649. package/rest/locator.d.ts +1 -1
  650. package/rest/networkService.d.ts +1 -1
  651. package/rest/networks/support/AggregatedGeometry.d.ts +1 -1
  652. package/rest/networks/support/Association.d.ts +1 -1
  653. package/rest/networks/support/AssociationGeometriesResult.d.ts +1 -1
  654. package/rest/networks/support/FunctionResult.d.ts +1 -1
  655. package/rest/networks/support/NetworkElement.d.ts +1 -1
  656. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +1 -1
  657. package/rest/networks/support/TraceLocation.d.ts +1 -1
  658. package/rest/networks/support/TraceParameters.d.ts +1 -1
  659. package/rest/networks/support/TraceResult.d.ts +1 -1
  660. package/rest/networks/synthesizeAssociationGeometries.d.ts +1 -1
  661. package/rest/networks/trace.d.ts +1 -1
  662. package/rest/networks/validateNetworkTopology.js +1 -1
  663. package/rest/print.d.ts +1 -1
  664. package/rest/query/support/AttachmentInfo.d.ts +1 -1
  665. package/rest/query.d.ts +1 -1
  666. package/rest/route.d.ts +1 -1
  667. package/rest/serviceArea.d.ts +1 -1
  668. package/rest/support/AddressCandidate.d.ts +1 -1
  669. package/rest/support/AlgorithmicColorRamp.d.ts +1 -1
  670. package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
  671. package/rest/support/AttachmentQuery.d.ts +1 -1
  672. package/rest/support/BufferParameters.d.ts +1 -1
  673. package/rest/support/ClosestFacilityParameters.d.ts +1 -1
  674. package/rest/support/ClosestFacilitySolveResult.d.ts +1 -1
  675. package/rest/support/ColorRamp.d.ts +1 -1
  676. package/rest/support/DataFile.d.ts +1 -1
  677. package/rest/support/DataLayer.d.ts +1 -1
  678. package/rest/support/DensifyParameters.d.ts +1 -1
  679. package/rest/support/DirectionLine.d.ts +1 -1
  680. package/rest/support/DirectionPoint.d.ts +1 -1
  681. package/rest/support/DirectionsEvent.d.ts +1 -1
  682. package/rest/support/DirectionsFeature.d.ts +1 -1
  683. package/rest/support/DirectionsFeatureSet.d.ts +1 -1
  684. package/rest/support/DistanceParameters.d.ts +1 -1
  685. package/rest/support/FeatureSet.d.ts +1 -1
  686. package/rest/support/FindParameters.d.ts +1 -1
  687. package/rest/support/FindResult.d.ts +1 -1
  688. package/rest/support/GPMessage.d.ts +1 -1
  689. package/rest/support/GeneralizeParameters.d.ts +1 -1
  690. package/rest/support/IdentifyParameters.d.ts +1 -1
  691. package/rest/support/IdentifyResult.d.ts +1 -1
  692. package/rest/support/ImageAngleParameters.d.ts +1 -1
  693. package/rest/support/ImageAngleResult.d.ts +1 -1
  694. package/rest/support/ImageHistogramParameters.d.ts +1 -1
  695. package/rest/support/ImageIdentifyParameters.d.ts +1 -1
  696. package/rest/support/ImageIdentifyResult.d.ts +1 -1
  697. package/rest/support/ImageParameters.d.ts +1 -1
  698. package/rest/support/ImagePixelLocationParameters.d.ts +1 -1
  699. package/rest/support/ImagePixelLocationResult.d.ts +1 -1
  700. package/rest/support/ImageSample.d.ts +1 -1
  701. package/rest/support/ImageSampleParameters.d.ts +1 -1
  702. package/rest/support/ImageSampleResult.d.ts +1 -1
  703. package/rest/support/JobInfo.d.ts +1 -1
  704. package/rest/support/LegendLayer.d.ts +1 -1
  705. package/rest/support/LengthsParameters.d.ts +1 -1
  706. package/rest/support/LinearUnit.d.ts +1 -1
  707. package/rest/support/MultipartColorRamp.d.ts +1 -1
  708. package/rest/support/NAMessage.d.ts +1 -1
  709. package/rest/support/NetworkFeatureSet.d.ts +1 -1
  710. package/rest/support/NetworkUrl.d.ts +1 -1
  711. package/rest/support/OffsetParameters.d.ts +1 -1
  712. package/rest/support/ParameterValue.d.ts +1 -1
  713. package/rest/support/PointBarrier.d.ts +1 -1
  714. package/rest/support/PolygonBarrier.d.ts +1 -1
  715. package/rest/support/PolylineBarrier.d.ts +1 -1
  716. package/rest/support/PrintParameters.d.ts +1 -1
  717. package/rest/support/PrintTemplate.d.ts +1 -1
  718. package/rest/support/ProjectParameters.d.ts +1 -1
  719. package/rest/support/Query.d.ts +1 -1
  720. package/rest/support/RasterData.d.ts +1 -1
  721. package/rest/support/RelationParameters.d.ts +1 -1
  722. package/rest/support/RelationshipQuery.d.ts +1 -1
  723. package/rest/support/RouteInfo.d.ts +1 -1
  724. package/rest/support/RouteParameters.d.ts +1 -1
  725. package/rest/support/RouteResult.d.ts +1 -1
  726. package/rest/support/RouteSolveResult.d.ts +1 -1
  727. package/rest/support/ServiceAreaParameters.d.ts +1 -1
  728. package/rest/support/ServiceAreaSolveResult.d.ts +1 -1
  729. package/rest/support/StatisticDefinition.d.ts +1 -1
  730. package/rest/support/Stop.d.ts +1 -1
  731. package/rest/support/TopFeaturesQuery.d.ts +1 -1
  732. package/rest/support/TopFilter.d.ts +1 -1
  733. package/rest/support/TravelMode.d.ts +1 -1
  734. package/rest/support/TrimExtendParameters.d.ts +1 -1
  735. package/rest/symbolService.d.ts +1 -1
  736. package/smartMapping/heuristics/binLevel.d.ts +1 -1
  737. package/smartMapping/heuristics/scaleRange.d.ts +1 -1
  738. package/smartMapping/heuristics/sizeRange.d.ts +1 -1
  739. package/smartMapping/labels/clusters.d.ts +1 -1
  740. package/smartMapping/popup/clusters.d.ts +1 -1
  741. package/smartMapping/popup/templates.d.ts +1 -1
  742. package/smartMapping/raster/renderers/classBreaks.d.ts +1 -1
  743. package/smartMapping/raster/renderers/colormap.d.ts +1 -1
  744. package/smartMapping/raster/renderers/flow.d.ts +1 -1
  745. package/smartMapping/raster/renderers/rgb.d.ts +1 -1
  746. package/smartMapping/raster/renderers/shadedRelief.d.ts +1 -1
  747. package/smartMapping/raster/renderers/stretch.d.ts +1 -1
  748. package/smartMapping/raster/renderers/uniqueValue.d.ts +1 -1
  749. package/smartMapping/raster/renderers/vectorField.d.ts +1 -1
  750. package/smartMapping/raster/support/utils.d.ts +1 -1
  751. package/smartMapping/renderers/color.d.ts +1 -1
  752. package/smartMapping/renderers/dotDensity.d.ts +1 -1
  753. package/smartMapping/renderers/heatmap.d.ts +1 -1
  754. package/smartMapping/renderers/location.d.ts +1 -1
  755. package/smartMapping/renderers/opacity.d.ts +1 -1
  756. package/smartMapping/renderers/pieChart.d.ts +1 -1
  757. package/smartMapping/renderers/predominance.d.ts +1 -1
  758. package/smartMapping/renderers/relationship.d.ts +1 -1
  759. package/smartMapping/renderers/size.d.ts +1 -1
  760. package/smartMapping/renderers/type.d.ts +1 -1
  761. package/smartMapping/renderers/univariateColorSize.d.ts +1 -1
  762. package/smartMapping/statistics/classBreaks.d.ts +1 -1
  763. package/smartMapping/statistics/heatmapStatistics.d.ts +1 -1
  764. package/smartMapping/statistics/histogram.d.ts +1 -1
  765. package/smartMapping/statistics/predominantCategories.d.ts +1 -1
  766. package/smartMapping/statistics/summaryStatistics.d.ts +1 -1
  767. package/smartMapping/statistics/summaryStatisticsForAge.d.ts +1 -1
  768. package/smartMapping/statistics/support/ageUtils.d.ts +1 -1
  769. package/smartMapping/statistics/support/predominanceUtils.d.ts +1 -1
  770. package/smartMapping/statistics/uniqueValues.d.ts +1 -1
  771. package/smartMapping/symbology/color.d.ts +1 -1
  772. package/smartMapping/symbology/dotDensity.d.ts +1 -1
  773. package/smartMapping/symbology/flow.d.ts +1 -1
  774. package/smartMapping/symbology/heatmap.d.ts +1 -1
  775. package/smartMapping/symbology/location.d.ts +1 -1
  776. package/smartMapping/symbology/pieChart.d.ts +1 -1
  777. package/smartMapping/symbology/predominance.d.ts +1 -1
  778. package/smartMapping/symbology/relationship.d.ts +1 -1
  779. package/smartMapping/symbology/size.d.ts +1 -1
  780. package/smartMapping/symbology/support/colorRamps.d.ts +1 -1
  781. package/smartMapping/symbology/type.d.ts +1 -1
  782. package/support/LayersMixin.d.ts +1 -1
  783. package/support/MapFloorInfo.d.ts +1 -1
  784. package/support/TablesMixin.d.ts +1 -1
  785. package/support/actions/ActionBase.d.ts +1 -1
  786. package/support/actions/ActionButton.d.ts +1 -1
  787. package/support/actions/ActionToggle.d.ts +1 -1
  788. package/support/arcadeUtils.js +1 -1
  789. package/support/popupUtils.d.ts +1 -1
  790. package/support/revision.js +1 -1
  791. package/support/timeUtils.d.ts +1 -1
  792. package/symbols/CIMSymbol.d.ts +1 -1
  793. package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
  794. package/symbols/FillSymbol.d.ts +1 -1
  795. package/symbols/FillSymbol3DLayer.d.ts +1 -1
  796. package/symbols/Font.d.ts +1 -1
  797. package/symbols/IconSymbol3DLayer.d.ts +1 -1
  798. package/symbols/LabelSymbol3D.d.ts +1 -1
  799. package/symbols/LineStyleMarker3D.d.ts +1 -1
  800. package/symbols/LineSymbol.d.ts +1 -1
  801. package/symbols/LineSymbol3D.d.ts +1 -1
  802. package/symbols/LineSymbol3DLayer.d.ts +1 -1
  803. package/symbols/LineSymbolMarker.d.ts +1 -1
  804. package/symbols/MarkerSymbol.d.ts +1 -1
  805. package/symbols/MeshSymbol3D.d.ts +1 -1
  806. package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
  807. package/symbols/PathSymbol3DLayer.d.ts +1 -1
  808. package/symbols/PictureFillSymbol.d.ts +1 -1
  809. package/symbols/PictureMarkerSymbol.d.ts +1 -1
  810. package/symbols/PointSymbol3D.d.ts +1 -1
  811. package/symbols/PolygonSymbol3D.d.ts +1 -1
  812. package/symbols/SimpleFillSymbol.d.ts +1 -1
  813. package/symbols/SimpleLineSymbol.d.ts +1 -1
  814. package/symbols/SimpleMarkerSymbol.d.ts +1 -1
  815. package/symbols/Symbol.d.ts +1 -1
  816. package/symbols/Symbol3D.d.ts +1 -1
  817. package/symbols/Symbol3DLayer.d.ts +1 -1
  818. package/symbols/TextSymbol.d.ts +1 -1
  819. package/symbols/TextSymbol3DLayer.d.ts +1 -1
  820. package/symbols/WaterSymbol3DLayer.d.ts +1 -1
  821. package/symbols/WebStyleSymbol.d.ts +1 -1
  822. package/symbols/callouts/Callout3D.d.ts +1 -1
  823. package/symbols/callouts/LineCallout3D.d.ts +1 -1
  824. package/symbols/cim/CIMImageColorSubstitutionHelper.js +1 -1
  825. package/symbols/edges/Edges3D.d.ts +1 -1
  826. package/symbols/edges/SketchEdges3D.d.ts +1 -1
  827. package/symbols/edges/SolidEdges3D.d.ts +1 -1
  828. package/symbols/patterns/LineStylePattern3D.d.ts +1 -1
  829. package/symbols/patterns/StylePattern3D.d.ts +1 -1
  830. package/symbols/support/StyleOrigin.d.ts +1 -1
  831. package/symbols/support/Symbol3DVerticalOffset.d.ts +1 -1
  832. package/symbols/support/cimSymbolUtils.d.ts +1 -1
  833. package/symbols/support/jsonUtils.d.ts +1 -1
  834. package/symbols/support/symbolUtils.d.ts +1 -1
  835. package/symbols.d.ts +1 -1
  836. package/views/2d/ViewState.d.ts +1 -1
  837. package/views/2d/layers/BaseLayerView2D.d.ts +1 -1
  838. package/views/2d/layers/BaseLayerViewGL2D.d.ts +1 -1
  839. package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -1
  840. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +1 -1
  841. package/views/3d/analysis/LineOfSightAnalysisResult.d.ts +1 -1
  842. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +1 -1
  843. package/views/3d/analysis/SliceAnalysisView3D.d.ts +1 -1
  844. package/views/3d/environment/CloudyWeather.d.ts +1 -1
  845. package/views/3d/environment/FoggyWeather.d.ts +1 -1
  846. package/views/3d/environment/RainyWeather.d.ts +1 -1
  847. package/views/3d/environment/SnowyWeather.d.ts +1 -1
  848. package/views/3d/environment/SunLighting.d.ts +1 -1
  849. package/views/3d/environment/SunnyWeather.d.ts +1 -1
  850. package/views/3d/environment/VirtualLighting.d.ts +1 -1
  851. package/views/3d/externalRenderers.d.ts +1 -1
  852. package/views/3d/support/LayerPerformanceInfo.d.ts +1 -1
  853. package/views/3d/support/SceneViewPerformanceInfo.d.ts +1 -1
  854. package/views/BasemapView.d.ts +1 -1
  855. package/views/BreakpointsOwner.d.ts +1 -1
  856. package/views/DOMContainer.d.ts +1 -1
  857. package/views/GroundView.d.ts +1 -1
  858. package/views/Magnifier.d.ts +1 -1
  859. package/views/MapView.d.ts +1 -1
  860. package/views/SceneView.d.ts +1 -1
  861. package/views/View.d.ts +1 -1
  862. package/views/ViewAnimation.d.ts +1 -1
  863. package/views/analysis/DimensionAnalysisView.d.ts +1 -1
  864. package/views/analysis/LengthDimensionResult.d.ts +1 -1
  865. package/views/draw/Draw.d.ts +1 -1
  866. package/views/draw/DrawAction.d.ts +1 -1
  867. package/views/draw/MultipointDrawAction.d.ts +1 -1
  868. package/views/draw/PointDrawAction.d.ts +1 -1
  869. package/views/draw/PolygonDrawAction.d.ts +1 -1
  870. package/views/draw/PolylineDrawAction.d.ts +1 -1
  871. package/views/draw/SegmentDrawAction.d.ts +1 -1
  872. package/views/input/Input.d.ts +1 -1
  873. package/views/input/gamepad/GamepadInputDevice.d.ts +1 -1
  874. package/views/input/gamepad/GamepadSettings.d.ts +1 -1
  875. package/views/interactive/sketch/SketchLabelOptions.d.ts +1 -1
  876. package/views/interactive/sketch/SketchTooltipOptions.d.ts +1 -1
  877. package/views/interactive/snapping/FeatureSnappingLayerSource.d.ts +1 -1
  878. package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
  879. package/views/layers/BuildingComponentSublayerView.d.ts +1 -1
  880. package/views/layers/BuildingSceneLayerView.d.ts +1 -1
  881. package/views/layers/CSVLayerView.d.ts +1 -1
  882. package/views/layers/DimensionLayerView.d.ts +1 -1
  883. package/views/layers/FeatureLayerView.d.ts +1 -1
  884. package/views/layers/GeoJSONLayerView.d.ts +1 -1
  885. package/views/layers/GeoRSSLayerView.d.ts +1 -1
  886. package/views/layers/GraphicsLayerView.d.ts +1 -1
  887. package/views/layers/ImageryLayerView.d.ts +1 -1
  888. package/views/layers/KMLLayerView.d.ts +1 -1
  889. package/views/layers/LayerView.d.ts +1 -1
  890. package/views/layers/OGCFeatureLayerView.d.ts +1 -1
  891. package/views/layers/PointCloudLayerView.d.ts +1 -1
  892. package/views/layers/SceneLayerView.d.ts +1 -1
  893. package/views/layers/StreamLayerView.d.ts +1 -1
  894. package/views/layers/WFSLayerView.d.ts +1 -1
  895. package/views/navigation/Navigation.d.ts +1 -1
  896. package/views/navigation/gamepad/GamepadSettings.d.ts +1 -1
  897. package/views/support/colorUtils.d.ts +1 -1
  898. package/views/ui/DefaultUI.d.ts +1 -1
  899. package/views/ui/UI.d.ts +1 -1
  900. package/webdoc/GeotriggersInfo.d.ts +1 -1
  901. package/webdoc/applicationProperties/Search.d.ts +1 -1
  902. package/webdoc/applicationProperties/SearchLayer.d.ts +1 -1
  903. package/webdoc/applicationProperties/SearchLayerField.d.ts +1 -1
  904. package/webdoc/applicationProperties/SearchTable.d.ts +1 -1
  905. package/webdoc/applicationProperties/SearchTableField.d.ts +1 -1
  906. package/webdoc/applicationProperties/Viewing.d.ts +1 -1
  907. package/webdoc/geotriggersInfo/DeviceLocationFeed.d.ts +1 -1
  908. package/webdoc/geotriggersInfo/ExpressionInfo.d.ts +1 -1
  909. package/webdoc/geotriggersInfo/FeatureFenceParameters.d.ts +1 -1
  910. package/webdoc/geotriggersInfo/FeatureFilter.d.ts +1 -1
  911. package/webdoc/geotriggersInfo/FeatureLayerSource.d.ts +1 -1
  912. package/webdoc/geotriggersInfo/FenceGeotrigger.d.ts +1 -1
  913. package/webdoc/geotriggersInfo/Geotrigger.d.ts +1 -1
  914. package/webdoc/geotriggersInfo/GeotriggerNotificationOptions.d.ts +1 -1
  915. package/webmap/ApplicationProperties.d.ts +1 -1
  916. package/webmap/Bookmark.d.ts +1 -1
  917. package/webmap/InitialViewProperties.d.ts +1 -1
  918. package/webmap/background/ColorBackground.d.ts +1 -1
  919. package/webscene/ApplicationProperties.d.ts +1 -1
  920. package/webscene/Environment.d.ts +1 -1
  921. package/webscene/InitialViewProperties.d.ts +1 -1
  922. package/webscene/Lighting.d.ts +1 -1
  923. package/webscene/Presentation.d.ts +1 -1
  924. package/webscene/Slide.d.ts +1 -1
  925. package/webscene/SunLighting.d.ts +1 -1
  926. package/webscene/VirtualLighting.d.ts +1 -1
  927. package/webscene/background/Background.d.ts +1 -1
  928. package/webscene/background/ColorBackground.d.ts +1 -1
  929. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +1 -1
  930. package/widgets/AreaMeasurement2D.d.ts +1 -1
  931. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.d.ts +1 -1
  932. package/widgets/AreaMeasurement3D.d.ts +1 -1
  933. package/widgets/Attachments/AttachmentsViewModel.d.ts +1 -1
  934. package/widgets/Attachments.d.ts +1 -1
  935. package/widgets/Attribution/AttributionViewModel.d.ts +1 -1
  936. package/widgets/Attribution.d.ts +1 -1
  937. package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +1 -1
  938. package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +1 -1
  939. package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +1 -1
  940. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +1 -1
  941. package/widgets/BasemapGallery.d.ts +1 -1
  942. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -1
  943. package/widgets/BasemapLayerList.d.ts +1 -1
  944. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +1 -1
  945. package/widgets/BasemapToggle.d.ts +1 -1
  946. package/widgets/Bookmarks/BookmarksViewModel.d.ts +1 -1
  947. package/widgets/Bookmarks.d.ts +1 -1
  948. package/widgets/BuildingExplorer/BuildingExplorerViewModel.d.ts +1 -1
  949. package/widgets/BuildingExplorer/BuildingLevel.d.ts +1 -1
  950. package/widgets/BuildingExplorer/BuildingPhase.d.ts +1 -1
  951. package/widgets/BuildingExplorer.d.ts +1 -1
  952. package/widgets/Compass/CompassViewModel.d.ts +1 -1
  953. package/widgets/Compass.d.ts +1 -1
  954. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +1 -1
  955. package/widgets/CoordinateConversion/support/Conversion.d.ts +1 -1
  956. package/widgets/CoordinateConversion/support/Format.d.ts +1 -1
  957. package/widgets/CoordinateConversion.d.ts +1 -1
  958. package/widgets/Daylight/DaylightViewModel.d.ts +1 -1
  959. package/widgets/Daylight.d.ts +1 -1
  960. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.d.ts +1 -1
  961. package/widgets/DirectLineMeasurement3D.d.ts +1 -1
  962. package/widgets/Directions/DirectionsViewModel.d.ts +1 -1
  963. package/widgets/Directions.d.ts +1 -1
  964. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +1 -1
  965. package/widgets/DistanceMeasurement2D.d.ts +1 -1
  966. package/widgets/Editor/CreateFeaturesWorkflow.d.ts +1 -1
  967. package/widgets/Editor/CreateFeaturesWorkflowData.d.ts +1 -1
  968. package/widgets/Editor/CreateWorkflow.d.ts +1 -1
  969. package/widgets/Editor/CreateWorkflowData.d.ts +1 -1
  970. package/widgets/Editor/EditorViewModel.d.ts +1 -1
  971. package/widgets/Editor/Edits.d.ts +1 -1
  972. package/widgets/Editor/UpdateWorkflow.d.ts +1 -1
  973. package/widgets/Editor/UpdateWorkflowData.d.ts +1 -1
  974. package/widgets/Editor/Workflow.d.ts +1 -1
  975. package/widgets/Editor.d.ts +1 -1
  976. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +1 -1
  977. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +1 -1
  978. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +1 -1
  979. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  980. package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +1 -1
  981. package/widgets/ElevationProfile/ElevationProfileViewModel.d.ts +1 -1
  982. package/widgets/ElevationProfile.d.ts +1 -1
  983. package/widgets/Expand/ExpandViewModel.d.ts +1 -1
  984. package/widgets/Expand.d.ts +1 -1
  985. package/widgets/Feature/FeatureViewModel.d.ts +1 -1
  986. package/widgets/Feature.d.ts +1 -1
  987. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +1 -1
  988. package/widgets/FeatureForm/FieldConfig.d.ts +1 -1
  989. package/widgets/FeatureForm/FieldGroupConfig.d.ts +1 -1
  990. package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
  991. package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
  992. package/widgets/FeatureForm/InputField.d.ts +1 -1
  993. package/widgets/FeatureForm/InputField.js +1 -1
  994. package/widgets/FeatureForm/InputFieldGroup.d.ts +1 -1
  995. package/widgets/FeatureForm.d.ts +1 -1
  996. package/widgets/FeatureForm.js +1 -1
  997. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +1 -1
  998. package/widgets/FeatureTable/FieldColumn.d.ts +1 -1
  999. package/widgets/FeatureTable/FieldColumnConfig.d.ts +1 -1
  1000. package/widgets/FeatureTable/Grid/Column.d.ts +1 -1
  1001. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -1
  1002. package/widgets/FeatureTable/Grid/support/ButtonMenu.d.ts +1 -1
  1003. package/widgets/FeatureTable/Grid/support/ButtonMenuItem.d.ts +1 -1
  1004. package/widgets/FeatureTable/Grid/support/ButtonMenuViewModel.d.ts +1 -1
  1005. package/widgets/FeatureTable/support/ColumnTemplate.d.ts +1 -1
  1006. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +1 -1
  1007. package/widgets/FeatureTable/support/FieldColumnTemplate.d.ts +1 -1
  1008. package/widgets/FeatureTable/support/GroupColumnTemplate.d.ts +1 -1
  1009. package/widgets/FeatureTable/support/TableTemplate.d.ts +1 -1
  1010. package/widgets/FeatureTable.d.ts +1 -1
  1011. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +1 -1
  1012. package/widgets/FeatureTemplates/TemplateItem.d.ts +1 -1
  1013. package/widgets/FeatureTemplates/TemplateItemGroup.d.ts +1 -1
  1014. package/widgets/FeatureTemplates.d.ts +1 -1
  1015. package/widgets/FloorFilter/FloorFilterViewModel.d.ts +1 -1
  1016. package/widgets/FloorFilter.d.ts +1 -1
  1017. package/widgets/Fullscreen/FullscreenViewModel.d.ts +1 -1
  1018. package/widgets/Fullscreen.d.ts +1 -1
  1019. package/widgets/Histogram/HistogramViewModel.d.ts +1 -1
  1020. package/widgets/Histogram.d.ts +1 -1
  1021. package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.d.ts +1 -1
  1022. package/widgets/HistogramRangeSlider.d.ts +1 -1
  1023. package/widgets/Home/HomeViewModel.d.ts +1 -1
  1024. package/widgets/Home.d.ts +1 -1
  1025. package/widgets/LayerList/LayerListViewModel.d.ts +1 -1
  1026. package/widgets/LayerList/ListItem.d.ts +1 -1
  1027. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  1028. package/widgets/LayerList.d.ts +1 -1
  1029. package/widgets/Legend/LegendViewModel.d.ts +1 -1
  1030. package/widgets/Legend/support/ActiveLayerInfo.d.ts +1 -1
  1031. package/widgets/Legend.d.ts +1 -1
  1032. package/widgets/LineOfSight/LineOfSightTarget.d.ts +1 -1
  1033. package/widgets/LineOfSight/LineOfSightViewModel.d.ts +1 -1
  1034. package/widgets/LineOfSight.d.ts +1 -1
  1035. package/widgets/Locate/LocateViewModel.d.ts +1 -1
  1036. package/widgets/Locate.d.ts +1 -1
  1037. package/widgets/Measurement/MeasurementViewModel.d.ts +1 -1
  1038. package/widgets/Measurement.d.ts +1 -1
  1039. package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
  1040. package/widgets/NavigationToggle.d.ts +1 -1
  1041. package/widgets/Popup/PopupViewModel.d.ts +1 -1
  1042. package/widgets/Popup.d.ts +1 -1
  1043. package/widgets/Print/CustomTemplate.d.ts +1 -1
  1044. package/widgets/Print/PrintViewModel.d.ts +1 -1
  1045. package/widgets/Print/TemplateOptions.d.ts +1 -1
  1046. package/widgets/Print.d.ts +1 -1
  1047. package/widgets/ScaleBar/ScaleBarViewModel.d.ts +1 -1
  1048. package/widgets/ScaleBar.d.ts +1 -1
  1049. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +1 -1
  1050. package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +1 -1
  1051. package/widgets/ScaleRangeSlider.d.ts +1 -1
  1052. package/widgets/Search/LayerSearchSource.d.ts +1 -1
  1053. package/widgets/Search/LocatorSearchSource.d.ts +1 -1
  1054. package/widgets/Search/SearchResultRenderer.d.ts +1 -1
  1055. package/widgets/Search/SearchSource.d.ts +1 -1
  1056. package/widgets/Search/SearchViewModel.d.ts +1 -1
  1057. package/widgets/Search.d.ts +1 -1
  1058. package/widgets/ShadowCast/ShadowCastViewModel.d.ts +1 -1
  1059. package/widgets/ShadowCast.d.ts +1 -1
  1060. package/widgets/Sketch/SketchViewModel.d.ts +1 -1
  1061. package/widgets/Sketch.d.ts +1 -1
  1062. package/widgets/Slice/SlicePlane.d.ts +1 -1
  1063. package/widgets/Slice/SliceViewModel.d.ts +1 -1
  1064. package/widgets/Slice.d.ts +1 -1
  1065. package/widgets/Slider/SliderViewModel.d.ts +1 -1
  1066. package/widgets/Slider.d.ts +1 -1
  1067. package/widgets/Swipe/SwipeViewModel.d.ts +1 -1
  1068. package/widgets/Swipe.d.ts +1 -1
  1069. package/widgets/TableList/ListItem.d.ts +1 -1
  1070. package/widgets/TableList/TableListViewModel.d.ts +1 -1
  1071. package/widgets/TableList.d.ts +1 -1
  1072. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +1 -1
  1073. package/widgets/TimeSlider.d.ts +1 -1
  1074. package/widgets/Track/TrackViewModel.d.ts +1 -1
  1075. package/widgets/Track.d.ts +1 -1
  1076. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +1 -1
  1077. package/widgets/UtilityNetworkTrace.d.ts +1 -1
  1078. package/widgets/UtilityNetworkTrace.js +1 -1
  1079. package/widgets/Weather/WeatherViewModel.d.ts +1 -1
  1080. package/widgets/Weather.d.ts +1 -1
  1081. package/widgets/Widget.d.ts +1 -1
  1082. package/widgets/Zoom/ZoomViewModel.d.ts +1 -1
  1083. package/widgets/Zoom.d.ts +1 -1
  1084. package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.d.ts +1 -1
  1085. package/widgets/smartMapping/ClassedColorSlider.d.ts +1 -1
  1086. package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.d.ts +1 -1
  1087. package/widgets/smartMapping/ClassedSizeSlider.d.ts +1 -1
  1088. package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.d.ts +1 -1
  1089. package/widgets/smartMapping/ColorSizeSlider.d.ts +1 -1
  1090. package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.d.ts +1 -1
  1091. package/widgets/smartMapping/ColorSlider.d.ts +1 -1
  1092. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.d.ts +1 -1
  1093. package/widgets/smartMapping/HeatmapSlider.d.ts +1 -1
  1094. package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.d.ts +1 -1
  1095. package/widgets/smartMapping/OpacitySlider.d.ts +1 -1
  1096. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.d.ts +1 -1
  1097. package/widgets/smartMapping/SizeSlider.d.ts +1 -1
  1098. package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.d.ts +1 -1
  1099. package/widgets/smartMapping/SmartMappingSliderBase.d.ts +1 -1
  1100. package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +1 -1
  1101. package/widgets/smartMapping/support/utils.d.ts +1 -1
  1102. package/widgets/support/DatePicker.d.ts +1 -1
  1103. package/widgets/support/DatePickerViewModel.d.ts +1 -1
  1104. package/widgets/support/DateTimeElementViewModel.d.ts +1 -1
  1105. package/widgets/support/GeolocationPositioning.d.ts +1 -1
  1106. package/widgets/support/GoTo.d.ts +1 -1
  1107. package/widgets/support/SnappingControls/SnappingControlsViewModel.d.ts +1 -1
  1108. package/widgets/support/SnappingControls.d.ts +1 -1
  1109. package/widgets/support/TimePicker.d.ts +1 -1
  1110. package/widgets/support/TimePickerViewModel.d.ts +1 -1
  1111. package/widgets/support/widget.d.ts +1 -1
  1112. package/assets/esri/core/workers/chunks/0db5f8ff5323194e784e.js +0 -1
  1113. package/assets/esri/core/workers/chunks/17d6c243ca6269b0f7ef.js +0 -1
  1114. package/assets/esri/core/workers/chunks/60ff0086832d6fc6d610.js +0 -1
  1115. package/assets/esri/core/workers/chunks/6316bea2130bb9cb515d.js +0 -1
  1116. package/assets/esri/core/workers/chunks/6dfb2ddfd72009564a34.js +0 -1
  1117. package/assets/esri/core/workers/chunks/7125c94ba8ef5efd63b0.js +0 -1
  1118. package/assets/esri/core/workers/chunks/83879da1ff7938a76574.js +0 -1
  1119. package/assets/esri/core/workers/chunks/878bc2b24cc45418e819.js +0 -1
  1120. package/assets/esri/core/workers/chunks/95ee476d101968ff4925.js +0 -1
  1121. package/assets/esri/core/workers/chunks/96933809f486480aae0d.js +0 -1
  1122. package/assets/esri/core/workers/chunks/b5e6a868256c5aae6d5e.js +0 -1
  1123. package/assets/esri/core/workers/chunks/c2a8813b618f98d0016d.js +0 -1
  1124. package/assets/esri/core/workers/chunks/d573ec98401fbae26383.js +0 -1
  1125. package/assets/esri/core/workers/chunks/e1cd29288dd358fc47f3.js +0 -1
  1126. package/assets/esri/core/workers/chunks/f23d8ec18740eb2e5e8f.js +0 -1
  1127. package/assets/esri/core/workers/chunks/fa76467bfd7b1829b995.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6785],{4307:(t,e,s)=>{s.d(e,{d:()=>l,s:()=>r,t:()=>f});var i=s(46851);function r(t,e,s){return t[0]=e,t[1]=s,t}function n(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function o(t,e,s){return t[0]=e[0]*s[0],t[1]=e[1]*s[1],t}function a(t,e,s){return t[0]=e[0]/s[0],t[1]=e[1]/s[1],t}function l(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}function h(t,e){const s=e[0]-t[0],i=e[1]-t[1];return s*s+i*i}function c(t){const e=t[0],s=t[1];return Math.sqrt(e*e+s*s)}function u(t){const e=t[0],s=t[1];return e*e+s*s}function f(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r+s[4],t[1]=s[1]*i+s[3]*r+s[5],t}const m=c,_=n,p=o,d=a,g=l,y=h,x=u;Object.freeze(Object.defineProperty({__proto__:null,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:r,add:function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t},subtract:n,multiply:o,divide:a,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},min:function(t,e,s){return t[0]=Math.min(e[0],s[0]),t[1]=Math.min(e[1],s[1]),t},max:function(t,e,s){return t[0]=Math.max(e[0],s[0]),t[1]=Math.max(e[1],s[1]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t},scaleAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t},distance:l,squaredDistance:h,length:c,squaredLength:u,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},normalize:function(t,e){const s=e[0],i=e[1];let r=s*s+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},cross:function(t,e,s){const i=e[0]*s[1]-e[1]*s[0];return t[0]=t[1]=0,t[2]=i,t},lerp:function(t,e,s,i){const r=e[0],n=e[1];return t[0]=r+i*(s[0]-r),t[1]=n+i*(s[1]-n),t},random:function(t,e){e=e||1;const s=2*(0,i.R)()*Math.PI;return t[0]=Math.cos(s)*e,t[1]=Math.sin(s)*e,t},transformMat2:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r,t[1]=s[1]*i+s[3]*r,t},transformMat2d:f,transformMat3:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[3]*r+s[6],t[1]=s[1]*i+s[4]*r+s[7],t},transformMat4:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[4]*r+s[12],t[1]=s[1]*i+s[5]*r+s[13],t},rotate:function(t,e,s,i){const r=e[0]-s[0],n=e[1]-s[1],o=Math.sin(i),a=Math.cos(i);return t[0]=r*a-n*o+s[0],t[1]=r*o+n*a+s[1],t},angle:function(t,e){const s=t[0],i=t[1],r=e[0],n=e[1];let o=s*s+i*i;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const l=(s*r+i*n)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},equals:function(t,e){const s=t[0],r=t[1],n=e[0],o=e[1],a=(0,i.g)();return Math.abs(s-n)<=a*Math.max(1,Math.abs(s),Math.abs(n))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},projectAndScale:function(t,e,s,i,r){let n=e[0]-s[0],o=e[1]-s[1];const a=(i[0]*n+i[1]*o)*(r-1);return n=i[0]*a,o=i[1]*a,t[0]=e[0]+n,t[1]=e[1]+o,t},len:m,sub:_,mul:p,div:d,dist:g,sqrDist:y,sqrLen:x},Symbol.toStringTag,{value:"Module"}))},1265:(t,e,s)=>{function i(){return new Float32Array(2)}function r(t,e){const s=new Float32Array(2);return s[0]=t,s[1]=e,s}function n(){return i()}function o(){return r(1,1)}function a(){return r(1,0)}function l(){return r(0,1)}s.d(e,{O:()=>c,Z:()=>h,c:()=>i,f:()=>r});const h=n(),c=o(),u=a(),f=l();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e},fromValues:r,createView:function(t,e){return new Float32Array(t,e,2)},zeros:n,ones:o,unitX:a,unitY:l,ZEROS:h,ONES:c,UNIT_X:u,UNIT_Y:f},Symbol.toStringTag,{value:"Module"}))},13867:(t,e,s)=>{s.d(e,{Z:()=>r});var i=s(69801);class r{constructor(t,e){this._storage=new i.WJ,this._storage.maxSize=t,e&&this._storage.registerRemoveFunc("",e)}put(t,e,s){this._storage.put(t,e,s,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}}},32243:(t,e,s)=>{function i(t){return t=t||globalThis.location.hostname,h.some((e=>null!=t?.match(e)))}function r(t,e){return t&&(e=e||globalThis.location.hostname)?null!=e.match(n)||null!=e.match(a)?t.replace("static.arcgis.com","staticdev.arcgis.com"):null!=e.match(o)||null!=e.match(l)?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}s.d(e,{XO:()=>i,pJ:()=>r});const n=/^devext.arcgis.com$/,o=/^qaext.arcgis.com$/,a=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,h=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,o,/^jsapps.esri.com$/,a,l]},62357:(t,e,s)=>{s.d(e,{F2:()=>r,Wz:()=>n,t_:()=>o});const i=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i;function r(t){return t?t/72*96:0}function n(t){return t?72*t/96:0}function o(t){if("string"==typeof t){const e=t.match(i);if(e){const s=Number(e[1]),i=e[3]&&e[3].toLowerCase(),r="-"===t.charAt(0),o="px"===i?n(s):s;return r?-o:o}return console.warn("screenUtils.toPt: input not recognized!"),null}return t}},72245:(t,e,s)=>{s.d(e,{K3:()=>r,Rx:()=>n});var i=s(80442);const r=()=>!!(0,i.Z)("enable-feature:force-wosr"),n=()=>!!(0,i.Z)("enable-feature:SceneLayer-editing")},27883:(t,e,s)=>{s.d(e,{EJ:()=>p,KV:()=>m,n2:()=>f,v9:()=>_,wm:()=>y});var i=s(3172),r=s(20102),n=s(70586),o=s(95330),a=s(17452),l=s(65587),h=s(41253),c=s(72245);const u={};function f(t,e,s){return t&&(0,n.pC)(t.styleUrl)?async function(t,e){try{return{data:(await p(t,e)).data,baseUrl:(0,a.Yd)(t),styleUrl:t}}catch(t){return(0,o.r9)(t),null}}(t.styleUrl,s):t&&(0,n.pC)(t.styleName)?function(t,e,s){const i=(0,n.pC)(e.portal)?e.portal:l.Z.getDefault();let o;const a=`${i.url} - ${i.user&&i.user.username} - ${t}`;return u[a]||(u[a]=function(t,e,s){return e.load(s).then((()=>{const i=new h.Z({disableExtraQuery:!0,query:`owner:${d} AND type:${g} AND typekeywords:"${t}"`});return e.queryItems(i,s)})).then((({results:e})=>{let i=null;const n=t.toLowerCase();if(e&&Array.isArray(e))for(const t of e){const e=t.typeKeywords?.some((t=>t.toLowerCase()===n));if(e&&t.type===g&&t.owner===d){i=t;break}}if(!i)throw new r.Z("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return i.load(s)}))}(t,i,s).then((t=>(o=t,t.fetchData()))).then((e=>({data:e,baseUrl:o.itemUrl??"",styleName:t})))),u[a]}(t.styleName,e,s):Promise.reject(new r.Z("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(t){return null===t||"CIMSymbolReference"===t.type?t:{type:"CIMSymbolReference",symbol:t}}function _(t,e){if("cimRef"===e)return t.cimRef;if(t.formatInfos&&!(0,c.K3)())for(const e of t.formatInfos)if("gltf"===e.type)return e.href;return t.webRef}function p(t,e){const s={responseType:"json",query:{f:"json"},...e};return(0,i.default)((0,a.Fv)(t),s)}const d="esri_en",g="Style",y="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},31363:(t,e,s)=>{s.d(e,{B1:()=>i,DQ:()=>h,DT:()=>a,JJ:()=>r,Or:()=>c,_U:()=>n,k3:()=>u,sX:()=>f});const i=Number.POSITIVE_INFINITY,r=Math.PI,n=2*r,o=128/r,a=r/180,l=1/Math.LN2;function h(t,e){return(t%=e)>=0?t:t+e}function c(t){return h(t*o,256)}function u(t){return Math.log(t)*l}function f(t,e,s){return t*(1-s)+e*s}},35362:(t,e,s)=>{s.d(e,{E:()=>i,V:()=>r});class i{constructor(t,e){this.x=t,this.y=e}clone(){return new i(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,s=Math.sqrt(t*t+e*e);this.x/=s,this.y/=s}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const s=this.x,i=this.y;this.x=s*t-i*e,this.y=s*e+i*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const s=e.x-t.x,i=e.y-t.y;return Math.sqrt(s*s+i*i)}static add(t,e){return new i(t.x+e.x,t.y+e.y)}static sub(t,e){return new i(t.x-e.x,t.y-e.y)}}var r;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(r||(r={}))},30729:(t,e,s)=>{var i,r;function n(t){switch(t){case"left":return i.Left;case"right":return i.Right;case"center":return i.Center}}function o(t){switch(t){case"top":return r.Top;case"middle":return r.Center;case"baseline":return r.Baseline;case"bottom":return r.Bottom}}function a(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[i.Right,r.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[i.Center,r.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[i.Left,r.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[i.Right,r.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[i.Center,r.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[i.Left,r.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[i.Right,r.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[i.Center,r.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[i.Left,r.Top];default:return console.debug(`Found invalid placement type ${t}`),[i.Center,r.Center]}}function l(t){switch(t){case i.Right:return-1;case i.Center:return 0;case i.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function h(t){switch(t){case r.Top:return 1;case r.Center:return 0;case r.Bottom:case r.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function c(t){switch(t){case"left":return i.Left;case"right":return i.Right;case"center":return i.Center}}function u(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}s.d(e,{Hd:()=>c,NS:()=>u,TR:()=>r,b7:()=>o,g:()=>l,kH:()=>n,qv:()=>a,tf:()=>h}),function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"}(i||(i={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(r||(r={}))},63523:(t,e,s)=>{s.d(e,{CA:()=>h,Gq:()=>b,Xp:()=>l,a:()=>x,dk:()=>g,hF:()=>u,jj:()=>c,jy:()=>a,m2:()=>f,mE:()=>y,qr:()=>M});var i=s(20102),r=s(30729),n=s(66039);const o=Object.keys(n.mD).filter((t=>"number"==typeof n.mD[t])).reduce(((t,e)=>({...t,[e]:n.mD[e]})),{});function a(t){return t===n.mD.OUTLINE_FILL||t===n.mD.OUTLINE_FILL_SIMPLE}function l(t){return function(t){return t===n.mD.SIMPLE||t===n.mD.OUTLINE_FILL_SIMPLE}(t.symbologyType)}function h(t){return a(t.symbologyType)}function c(t,e){switch(t){case n.LW.FILL:return g.from(e);case n.LW.LINE:return x.from(e);case n.LW.MARKER:return y.from(e);case n.LW.TEXT:return M.from(e);case n.LW.LABEL:return b.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function u(t){switch(f.load(t).geometryType){case n.LW.MARKER:return new y(t);case n.LW.FILL:return new g(t);case n.LW.LINE:return new x(t);case n.LW.TEXT:return new M(t);case n.LW.LABEL:return new b(t)}}class f{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(8,11)}set geometryType(t){this.setBits(t,8,11)}get mapAligned(){return!!this.bit(20)}set mapAligned(t){this.setBit(20,t)}get sdf(){return!!this.bit(11)}set sdf(t){this.setBit(11,t)}get pattern(){return!!this.bit(12)}set pattern(t){this.setBit(12,t)}get textureBinding(){return this.bits(0,8)}set textureBinding(t){this.setBits(t,0,8)}get symbologyType(){return this.bits(21,26)}set symbologyType(t){this.setBits(t,21,26)}get geometryTypeString(){switch(this.geometryType){case n.LW.FILL:return"fill";case n.LW.MARKER:return"marker";case n.LW.LINE:return"line";case n.LW.TEXT:return"text";case n.LW.LABEL:return"label";default:throw new i.Z(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const s=1<<t;e?this._data|=s:this._data&=~s}bit(t){return(this._data&1<<t)>>t}setBits(t,e,s){for(let i=e,r=0;i<s;i++,r++)this.setBit(i,0!=(t&1<<r))}bits(t,e){let s=0;for(let i=t,r=0;i<e;i++,r++)s|=this.bit(i)<<r;return s}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf,symbologyType:{value:n.mD[this.symbologyType],options:o,namespace:"SYMBOLOGY_TYPE"}}}getVariationHash(){return this._data&~(7&this.textureBinding)}}f.shared=new f(0);const m=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(16)}set vvSizeMinMaxValue(t){this.setBit(16,t)}get vvSizeScaleStops(){return 0!==this.bit(17)}set vvSizeScaleStops(t){this.setBit(17,t)}get vvSizeFieldStops(){return 0!==this.bit(18)}set vvSizeFieldStops(t){this.setBit(18,t)}get vvSizeUnitValue(){return 0!==this.bit(19)}set vvSizeUnitValue(t){this.setBit(19,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const s=function(t,e,s){const i=n.X.SIZE_FIELD_STOPS|n.X.SIZE_MINMAX_VALUE|n.X.SIZE_SCALE_STOPS|n.X.SIZE_UNIT_VALUE,r=(e&(n.mf.FIELD_TARGETS_OUTLINE|n.mf.MINMAX_TARGETS_OUTLINE|n.mf.SCALE_TARGETS_OUTLINE|n.mf.UNIT_TARGETS_OUTLINE))>>>4;return t===n.LW.LINE&&s.isOutline||t===n.LW.FILL&&a(s.symbologyType)?i&r:i&~r}(this.geometryType,t,e)&t;this.vvSizeMinMaxValue=!!(s&n.X.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(s&n.X.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(s&n.X.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(s&n.X.SIZE_SCALE_STOPS)}},_=t=>class extends t{get vvRotation(){return 0!==this.bit(15)}set vvRotation(t){this.setBit(15,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&n.X.ROTATION)}},p=t=>class extends t{get vvColor(){return 0!==this.bit(13)}set vvColor(t){this.setBit(13,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&n.X.COLOR)}},d=t=>class extends t{get vvOpacity(){return 0!==this.bit(14)}set vvOpacity(t){this.setBit(14,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&n.X.OPACITY)}};class g extends(p(d(m(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:s}=t,i=this.load(0);return i.geometryType=n.LW.FILL,i.symbologyType=e,e!==n.mD.DOT_DENSITY&&i.setVV(s,t),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}g.shared=new g(0);class y extends(p(d(_(m(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:s}=t,i=this.load(0);return i.geometryType=n.LW.MARKER,i.symbologyType=e,e!==n.mD.HEATMAP&&i.setVV(s,t),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class x extends(p(d(m(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LINE,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}x.shared=new x(0);class M extends(p(d(_(m(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.TEXT,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}M.shared=new M(0);class b extends(m(f)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LABEL,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.mapAligned=(0,r.NS)(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}b.shared=new b(0)},47988:(t,e,s)=>{s.d(e,{Z:()=>l});var i=s(43697),r=s(3920),n=s(5600),o=(s(67676),s(75215),s(52011));let a=class extends r.r{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const t=this.get("tileStore.tileScheme.spatialReference");return t&&t.toJSON()||null}};(0,i._)([(0,n.Cb)({readOnly:!0})],a.prototype,"supportsTileUpdates",null),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"remoteClient",void 0),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"service",void 0),(0,i._)([(0,n.Cb)()],a.prototype,"spatialReference",null),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileInfo",void 0),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileStore",void 0),a=(0,i._)([(0,o.j)("esri.views.2d.layers.features.processors.BaseProcessor")],a);const l=a},6785:(t,e,s)=>{s.r(e),s.d(e,{default:()=>so});var i=s(43697);const r=new(s(79087).Z);function n(t){if(!r.hasBidiChar(t))return[t,!1];let e;return e="rtl"===r.checkContextual(t)?"IDNNN":"ICNNN",[r.bidiTransform(t,e,"VLYSN"),!0]}var o=s(20102),a=s(80442),l=s(92604),h=s(70586),c=s(95330),u=(s(75215),s(67676),s(52011)),f=s(22862),m=s(82971),_=s(61027),p=s(66039),d=s(15923),g=s(5600),y=s(4307),x=s(49733);const M=new Set,b=[],v=new Map,S=[0,0];let w=class extends d.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e}=this;this._queue=new x.e({concurrency:t,process:(t,s)=>{const i=this._keyToItem.get(t);return e(i,{signal:s})},peeker:t=>t.values().next().value})}destroy(){this.clear(),this._queue=(0,h.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t,e){const s=t.key.id+"-"+e;if(this.has(s))return this.get(s);const i=this._queue.push(s),r=()=>{this._keyToItem.delete(s),this.notifyChange("updating")};return this._keyToItem.set(s,t),i.then(r,r),this.notifyChange("updating"),i}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);v.has(r)||(v.set(r,[]),s=Math.max(r,s),i=Math.min(r,i)),v.get(r).push(e.key),M.add(r)}));let r=this.state.scale;v.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(b,M),b.sort(((t,e)=>t-e)),r=b.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),b[0])),r=Math.min(r,s),r=Math.max(r,i);const n=v.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),l=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const s=o.denormalizeCol(t.col,t.world),i=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-s)*(a-s)+(l-t.row)*(l-t.row))-Math.sqrt((a-i)*(a-i)+(l-e.row)*(l-e.row))})),M.clear(),v.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,s=this.state.center;let i,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(S,n.key);const o=(0,y.d)(S,s);o<r&&(r=o,i=n.key)})),i.id}};(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"concurrency",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"process",void 0),(0,i._)([(0,g.Cb)()],w.prototype,"state",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"strategy",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"tileInfoView",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],w.prototype,"updating",null),w=(0,i._)([(0,u.j)("esri.views.2d.tiling.PagedTileQueue")],w),s(83068);var P=s(55415);const C=new Set,L=[],I=new Map,k=[0,0];let T=class extends d.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e,strategy:s}=this;this._queue=new x.e({concurrency:t,process:(t,s)=>{const i=this._keyToItem.get(t);return e(i,{signal:s})},peeker:"scale-first"===s?t=>this._peekByScaleFirst(t):t=>this._peekByCenterFirst(t)})}destroy(){this.clear(),this._queue=(0,h.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const s=this._queue.push(e),i=()=>{this._keyToItem.delete(e),this.notifyChange("updating")};return this._keyToItem.set(e,t),s.then(i,i),this.notifyChange("updating"),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);I.has(r)||(I.set(r,[]),s=Math.max(r,s),i=Math.min(r,i)),I.get(r).push(e.key),C.add(r)}));let r=this.state.scale;I.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(L,C),L.sort(((t,e)=>t-e)),r=L.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),L[0])),r=Math.min(r,s),r=Math.max(r,i);const n=I.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),l=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const s=o.denormalizeCol(t.col,t.world),i=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-s)*(a-s)+(l-t.row)*(l-t.row))-Math.sqrt((a-i)*(a-i)+(l-e.row)*(l-e.row))})),C.clear(),I.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,s=this.state.center;let i,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(k,n.key);const o=(0,y.d)(k,s);o<r&&(r=o,i=n.key)})),i.id}};(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"concurrency",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"process",void 0),(0,i._)([(0,g.Cb)()],T.prototype,"state",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"strategy",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"tileInfoView",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],T.prototype,"updating",null),T=(0,i._)([(0,u.j)("esri.views.2d.tiling.TileQueue")],T);var z=s(24470);s(67524),new P.Z(0,0,0,0),new Map;var A=s(16534),E=s(29996);const F=new Map;F.set(p.LW.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),F.set(p.LW.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),F.set(p.LW.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),F.set(p.LW.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),F.set(p.LW.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});class R{constructor(t,e){this._pos=0;const s=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(s),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const s=Math.round(t);return s+(e-s%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.25*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),s=new ArrayBuffer(e),i=new this._ctor(s);i.set(this._buffer,0),this._array=s,this._buffer=i,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,s){this._i16View[2*t]+=e,this._i16View[2*t+1]+=s}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,s){this._ensureSize(s-e);for(let i=e;i!==s;i++)this.writeFixed(t._buffer[i])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){const t=this._array,e=[];for(let s=0;s<t.byteLength/4;s++)e.push(t[s]);return e}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}class N{constructor(t,e,s){this._start={index:0,vertex:0};const i=function(t,e,s){const{indicesPerRecord:i,multiplier:r,verticesPerRecord:n}=F.get(t);return{recordBytes:s*A.XJ*Uint32Array.BYTES_PER_ELEMENT,indexBytes:r*i*s*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:r*n*s*e}}(t,e,s),r=e/4;this.geometryType=t,this._records=new R(Int32Array,i.recordBytes),this._indices=new R(Uint32Array,i.indexBytes),this._vertices=new R(Uint32Array,i.vertexBytes),this._metrics=new R(Float32Array,0),this._strideInt=r}serialize(t){const e=this._records.buffer(),s=this._indices.buffer(),i=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,s,i),{stride:n,records:e,indices:s,vertices:i,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/A.XJ}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,s,i,r,n,o,a){this._records.push(t),this._records.push(e),this._records.push(s),this._records.push(i),this._records.push(r),this._records.push(n),this._records.push(o),this._records.writeF32(a)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,s){const i=t._records.length-A.XJ,r=t._records.getValue(i),n=t._records.getValue(i+1),o=t._records.getValue(i+2),a=t._records.getValue(i+4),l=t._records.getValue(i+6),h=t._records.getValue(i+7),c=this._vertices.length,u=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,m=this.vertexCount;for(let e=t._start.index;e!==t._indices.length;e++){const s=t._indices.getValue(e);this._indices.push(s-u)}for(let e=t._start.vertex;e!==t._vertices.length;e++){const s=t._vertices.getValue(e);this._vertices.push(s)}for(let t=c;t<=this._vertices.length;t+=this._strideInt)this._vertices.i1616Add(t,e,s);this._records.push(r),this._records.push(n),this._records.push(o),this._records.push(f),this._records.push(a),this._records.push(m),this._records.push(l),this._records.push(h)}}var O=s(14867);function W(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function V(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class D{constructor(t,e,s,i,r,n=0){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._version=0,this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasAggregate=i,this._pixelBufferEnabled=r,this._version=n,this._symbologyType=s}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach(((s,i)=>{const r=1<<i,n=W(r),o=V(r),a=(0,O.M)(new P.Z(this.tileKey),n,o,t),l=this._serializeTileVertexData(this.tileKey,a.id,s.vertexData);l.message.bufferIds=s.displayIds,e.push(l)})),e}_serializeTileVertexData(t,e,s){const i=new Array;return{message:{tileKeyOrigin:t,tileKey:e,data:{[p.LW.MARKER]:s.get(p.LW.MARKER)?.serialize(i),[p.LW.FILL]:s.get(p.LW.FILL)?.serialize(i),[p.LW.LINE]:s.get(p.LW.LINE)?.serialize(i),[p.LW.TEXT]:s.get(p.LW.TEXT)?.serialize(i),[p.LW.LABEL]:s.get(p.LW.LABEL)?.serialize(i)},version:this._version},transferList:i}}featureStart(t,e){this._current.insertAfter=t,this._current.sortKey=e}featureEnd(){}recordStart(t,e,s,i){this._current.writer=this._getVertexWriter(s),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=i,this._current.id=t,this._current.materialKey=e,this._current.geometryType=s,this._current.isDotDensity=!1,this._current.writer.recordStart()}recordCount(){return this._current.writer.recordCount}vertexCount(){return this._current.writer.vertexCount}indexCount(){return this._current.writer.indexCount}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexBounds(t,e,s,i){this._current.bufferingEnabled&&this._addOverlap(t,e,s,i)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(t){this._current.writer.writeIndex(t)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(t,e,s,i,r,n,o,a){this._current.writer=this._getVertexWriter(p.LW.LABEL);const l=this._current.writer.metricWriter;l.push((0,_.jL)(t)),l.push(e),l.push(s),l.push(i),l.push(r),l.push(n),l.push(o),l.push(a),l.push(255),this._current.metricBoxLenPointer=l.push(0)}metricEnd(){const t=this._current.writer.metricWriter;0===t.getValue(this._current.metricBoxLenPointer)&&t.seek(t.length-10)}metricBoxWrite(t,e,s,i){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(t),r.push(e),r.push(s),r.push(i)}recordEnd(){const t=this._current.vertStart,e=this._current.writer.vertexCount-t;if(!e)return!1;this.hasRecords=!0;const s=this._current.indexStart,i=this._current.writer.indexCount-s;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,s,i,t,e,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===p.LW.LABEL)return!0;const r=this._current.writer;for(let t=0;t<8;t++){const e=1<<t;if(this._current.overlaps&e){this._data.neighbors[t]||(this._data.neighbors[t]={vertexData:new Map,displayIds:new Set});const s=this._data.neighbors[t],i=this._current.geometryType;if(!s.vertexData.has(i)){const t=(0,E.$_)(i,this._symbologyType).geometry,e=new N(i,t,A.Ip);s.vertexData.set(i,e)}const n=s.vertexData.get(this._current.geometryType),o=8,a=512*-W(e)*o,l=512*-V(e)*o;n.copyLastFrom(r,a,l),s.displayIds.add(this._current.id)}}return!0}_addOverlap(t,e,s,i){const r=255^((t<0+s?148:t>=A.I_-s?41:189)|(e<0+i?224:e>=A.I_-i?7:231));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,s=(0,E.$_)(t,this._symbologyType).geometry;e.set(t,new N(t,s,this.hint.records))}return this._data.self.get(t)}}var G=s(65390),U=s(22021),B=s(62357),X=s(95648),H=s(30729),Y=s(37720),J=s(12142),q=s(63523);const Z=100;function K(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function j(t,e){return Math.sqrt(t*t+e*e)}function $(t){const e=j(t[0],t[1]);t[0]/=e,t[1]/=e}function Q(t,e){return j(t[0]-e[0],t[1]-e[1])}function tt(t){return"function"==typeof t}function et(t=2){return 1/Math.max(t,1)}function st(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||0,!!t.maxScale&&e.scaleToZoom(t.maxScale)||Z]}function it(t){return t.length-1}function rt(t,e,s=1){const[i,r]=function(t,e){return t[e+1]}(t,e);return Math.sqrt(i*i+r*r)*s}class nt{constructor(t,e,s,i,r){this._segments=t,this._index=e,this._distance=s,this._xStart=i,this._yStart=r,this._done=!1}static create(t){return new nt(t,0,0,t[0][0],t[0][1])}clone(){return new nt(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let s=Math.acos(e);return t>0&&(s=2*Math.PI-s),s}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<it(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const s=this.backwardLength;if(t<=s)return this._distance=(s-t)/this.length,this;let i=this.backwardLength;for(;this.prev();){if(i+this.length>t)return this._seekBackwards(t-i);i+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let s=this.remainingLength;for(;this.next();){if(s+this.length>t)return this.seek(t-s,e);s+=this.length}return this._distance=1,e?this:null}}function ot(t,e,s,i=!0){const r=function(t){let e=0;for(let s=0;s<it(t);s++)e+=rt(t,s);return e}(t),n=nt.create(t),o=r/2;if(!i)return n.seek(o),void s(n.clone(),0,o+0*e,r);const a=Math.max((r-e)/2,0),l=Math.floor(a/e),h=o-l*e;n.seek(h);for(let t=-l;t<=l;t++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&s(n.clone(),t,o+t*e,r),n.seek(e)}function at(t,e){const s=1e-6;if(e<=0)return;const i=t.length;if(i<3)return;const r=[];let n=0;r.push(0);for(let e=1;e<i;e++)n+=Q(t[e],t[e-1]),r.push(n);e=Math.min(e,.2*n);const o=[];o.push(t[0][0]),o.push(t[0][1]);const a=t[i-1][0],l=t[i-1][1],h=K([0,0],t[0],t[1]);$(h),t[0][0]+=e*h[0],t[0][1]+=e*h[1],K(h,t[i-1],t[i-2]),$(h),t[i-1][0]+=e*h[0],t[i-1][1]+=e*h[1];for(let t=1;t<i;t++)r[t]+=e;r[i-1]+=e;const c=.5*e;for(let n=1;n<i-1;n++){let a=0,l=0,h=0;for(let i=n-1;i>=0&&!(r[i+1]<r[n]-c);i--){const o=c+r[i+1]-r[n],u=r[i+1]-r[i],f=r[n]-r[i]<c?1:o/u;if(Math.abs(f)<s)break;const m=f*f,_=f*o-.5*m*u,p=f*u/e,d=t[i+1],g=t[i][0]-d[0],y=t[i][1]-d[1];a+=p/_*(d[0]*f*o+.5*m*(o*g-u*d[0])-m*f*u*g/3),l+=p/_*(d[1]*f*o+.5*m*(o*y-u*d[1])-m*f*u*y/3),h+=p}for(let o=n+1;o<i&&!(r[o-1]>r[n]+c);o++){const i=c-r[o-1]+r[n],u=r[o]-r[o-1],f=r[o]-r[n]<c?1:i/u;if(Math.abs(f)<s)break;const m=f*f,_=f*i-.5*m*u,p=f*u/e,d=t[o-1],g=t[o][0]-d[0],y=t[o][1]-d[1];a+=p/_*(d[0]*f*i+.5*m*(i*g-u*d[0])-m*f*u*g/3),l+=p/_*(d[1]*f*i+.5*m*(i*y-u*d[1])-m*f*u*y/3),h+=p}o.push(a/h),o.push(l/h)}o.push(a),o.push(l);for(let e=0,s=0;e<i;e++)t[e][0]=o[s++],t[e][1]=o[s++]}var lt=s(98732),ht=s(22974),ct=s(33955);class ut{constructor(){this.setIdentity()}getAngle(){return(null==this.rz||0===this.rz&&1!==this.rzCos&&0!==this.rzSin)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}}function ft(t){const e=(0,ht.d9)(t);return(s=e)&&((0,ct.oU)(s)?xt(s.rings):(0,ct.l9)(s)?xt(s.paths):(0,ct.aW)(s)&&yt(s.points),mt(s)),e;var s}function mt(t){t&&((0,ct.wp)(t)?t.y=-t.y:(0,ct.oU)(t)?pt(t.rings):(0,ct.l9)(t)?pt(t.paths):(0,ct.aW)(t)&&_t(t.points))}function _t(t){if(t){const e=t.length;for(let s=0;s<e;s++)t[s][1]=-t[s][1]}}function pt(t){if(t)for(const e of t)_t(e)}function dt(t){if(t)for(let e=t.length-1;e>0;--e)t[e][0]-=t[e-1][0],t[e][1]-=t[e-1][1]}function gt(t){if(t)for(const e of t)dt(e)}function yt(t){if(t){const e=t.length;for(let s=1;s<e;++s)t[s][0]+=t[s-1][0],t[s][1]+=t[s-1][1]}}function xt(t){if(t)for(const e of t)yt(e)}function Mt(t){if(t)for(const e of t)bt(e)}function bt(t){t&&t.reverse()}function vt(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function St(t){return t[4]}function wt(t,e){t[4]=e}class Pt{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1,t&&((0,ct.oU)(t)?e&&(this.multiPath=t.rings,this.isClosed=!0):(0,ct.l9)(t)?s&&(this.multiPath=t.paths,this.isClosed=!1):(0,ct.YX)(t)&&e&&(this.multiPath=Lt(t).rings,this.isClosed=!0),this.multiPath&&(this.pathCount=this.multiPath.length)),this.internalPlacement=new ut}next(){if(!this.multiPath)return null;for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}return this.pathCount=-1,this.pathIndex=-1,this.multiPath=null,null}}class Ct{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1}next(){for(;;){if(!this.multiPath){let t=this.inputGeometries.next();for(;t;){if((0,ct.oU)(t)?this.acceptPolygon&&(this.multiPath=t.rings,this.isClosed=!0):(0,ct.l9)(t)?this.acceptPolyline&&(this.multiPath=t.paths,this.isClosed=!1):(0,ct.YX)(t)&&this.acceptPolygon&&(this.multiPath=Lt(t).rings,this.isClosed=!0),this.multiPath){this.pathCount=this.multiPath.length,this.pathIndex=-1;break}t=this.inputGeometries.next()}if(!this.multiPath)return null}for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}this.pathCount=-1,this.pathIndex=-1,this.multiPath=null}}}function Lt(t){return{rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}}class It{static local(){return null===It.instance&&(It.instance=new It),It.instance}execute(t,e,s,i){return new kt(t,e,s)}}It.instance=null;class kt{constructor(t,e,s){this._inputGeometries=t,this._angleTolerance=void 0!==e.angleTolerance?e.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.oU)(t)){this._isClosed=!0;const e=(0,ht.d9)(t);return this._processMultipath(e.rings),e}if((0,ct.l9)(t)){this._isClosed=!1;const e=(0,ht.d9)(t);return this._processMultipath(e.paths),e}if((0,ct.YX)(t)){if(this._maxCosAngle)return t;this._isClosed=!0;const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];return this._processPath(e),{rings:[e]}}t=this._inputGeometries.next()}return null}_processMultipath(t){if(t)for(const e of t)this._processPath(e)}_processPath(t){if(t){let e,s,i,r,n,o,a=t.length,l=t[0];this._isClosed&&++a;for(let h=1;h<a;++h){let c;c=this._isClosed&&h===a-1?t[0]:t[h];const u=c[0]-l[0],f=c[1]-l[1],m=Math.sqrt(u*u+f*f);h>1&&m>0&&i>0&&(e*u+s*f)/m/i<=this._maxCosAngle&&wt(l,1),1===h&&(r=u,n=f,o=m),m>0&&(l=c,e=u,s=f,i=m)}this._isClosed&&i>0&&o>0&&(e*r+s*n)/o/i<=this._maxCosAngle&&wt(t[0],1)}}}const Tt=.03;class zt{constructor(){this._path=[]}path(){return this._path}addPath(t,e){e||t.reverse(),Array.prototype.push.apply(this._path,t),e||t.reverse()}static mergePath(t,e){e&&Array.prototype.push.apply(t,e)}startPath(t){this._path.push(t)}lineTo(t){this._path.push(t)}close(){const t=this._path;t.length>1&&(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]||t.push([t[0][0],t[0][1]]))}}class At{constructor(t=0,e=!1){}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);0!==e&&(t[0]/=e,t[1]/=e)}calculateLength(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}calculateSegLength(t,e){return this.calculateLength(t[e],t[e+1])}calculatePathLength(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=this.calculateSegLength(t,i);return e}calculatePathArea(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=(t[i+1][0]-t[i][0])*(t[i+1][1]+t[i][1]);return e/2}getCoord2D(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}getSegCoord2D(t,e,s){return this.getCoord2D(t[e],t[e+1],s)}getAngle(t,e,s){const i=e[0]-t[0],r=e[1]-t[1];return Math.atan2(r,i)}getSegAngle(t,e,s){return this.getAngle(t[e],t[e+1],s)}getAngleCS(t,e,s){const i=e[0]-t[0],r=e[1]-t[1],n=Math.sqrt(i*i+r*r);return n>0?[i/n,r/n]:[1,0]}getSegAngleCS(t,e,s){return this.getAngleCS(t[e],t[e+1],s)}cut(t,e,s,i){return[s<=0?t[e]:this.getSegCoord2D(t,e,s),i>=1?t[e+1]:this.getSegCoord2D(t,e,i)]}addSegment(t,e,s){s&&t.push(e[0]),t.push(e[1])}getSubCurve(t,e,s){const i=[];return this.appendSubCurve(i,t,e,s)?i:null}appendSubCurve(t,e,s,i){const r=e?e.length-1:0;let n=0,o=!0,a=0;for(;a<r;){const r=this.calculateSegLength(e,a);if(0!==r){if(o){if(n+r>s){const l=(s-n)/r;let h=1,c=!1;n+r>=i&&(h=(i-n)/r,c=!0);const u=this.cut(e,a,l,h);if(u&&this.addSegment(t,u,o),c)break;o=!1}}else{if(n+r>i){const s=this.cut(e,a,0,(i-n)/r);s&&this.addSegment(t,s,o);break}this.addSegment(t,[e[a],e[a+1]],o)}n+=r,++a}else++a}return!0}getCIMPointAlong(t,e){const s=t?t.length-1:0;let i=0,r=-1;for(;r<s;){++r;const s=this.calculateSegLength(t,r);if(0!==s){if(i+s>e){const n=(e-i)/s;return this.getCoord2D(t[r],t[r+1],n)}i+=s}}return null}isEmpty(t,e){if(!t||t.length<=1)return!0;const s=t?t.length-1:0;let i=-1;for(;i<s;){if(++i,t[i+1][0]!==t[i][0]||t[i+1][1]!==t[i][1])return!1;if(e&&t[i+1][2]!==t[i][2])return!1}return!0}offset(t,e,s,i,r){if(!t||t.length<2)return null;let n=0,o=t[n++],a=n;for(;n<t.length;){const e=t[n];e[0]===o[0]&&e[1]===o[1]||(n!==a&&(t[a]=t[n]),o=t[a++]),n++}const l=t[0][0]===t[a-1][0]&&t[0][1]===t[a-1][1];if(l&&--a,a<(l?3:2))return null;const h=[];o=l?t[a-1]:null;let c=t[0];for(let r=0;r<a;r++){const n=r===a-1?l?t[0]:null:t[r+1];if(o)if(n){const t=[n[0]-c[0],n[1]-c[1]];this.normalize(t);const r=[c[0]-o[0],c[1]-o[1]];this.normalize(r);const a=r[0]*t[1]-r[1]*t[0],l=r[0]*t[0]+r[1]*t[1];if(0===a&&1===l){c=n;continue}if(a>=0==e<=0){if(l<1){const s=[t[0]-r[0],t[1]-r[1]];this.normalize(s);const n=Math.sqrt((1+l)/2);if(n>1/i){const t=-Math.abs(e)/n;h.push([c[0]-s[0]*t,c[1]-s[1]*t])}}}else switch(s){case X.id.Mitered:{const s=Math.sqrt((1+l)/2);if(s>0&&1/s<i){const i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=Math.abs(e)/s;h.push([c[0]-i[0]*n,c[1]-i[1]*n]);break}}case X.id.Bevelled:h.push([c[0]+r[1]*e,c[1]-r[0]*e]),h.push([c[0]+t[1]*e,c[1]-t[0]*e]);break;case X.id.Rounded:if(l<1){h.push([c[0]+r[1]*e,c[1]-r[0]*e]);const s=Math.floor(2.5*(1-l));if(s>0){const i=1/s;let n=i;for(let o=1;o<s;o++,n+=i){const s=[r[1]*(1-n)+t[1]*n,-r[0]*(1-n)-t[0]*n];this.normalize(s),h.push([c[0]+s[0]*e,c[1]+s[1]*e])}}h.push([c[0]+t[1]*e,c[1]-t[0]*e])}break;case X.id.Square:default:if(a<0)h.push([c[0]+(r[1]+r[0])*e,c[1]+(r[1]-r[0])*e]),h.push([c[0]+(t[1]-t[0])*e,c[1]-(t[0]+t[1])*e]);else{const s=Math.sqrt((1+Math.abs(l))/2),i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=e/s;h.push([c[0]-i[0]*n,c[1]-i[1]*n])}}}else{const t=[c[0]-o[0],c[1]-o[1]];this.normalize(t),h.push([c[0]+t[1]*e,c[1]-t[0]*e])}else{const t=[n[0]-c[0],n[1]-c[1]];this.normalize(t),h.push([c[0]+t[1]*e,c[1]-t[0]*e])}o=c,c=n}return h.length<(l?3:2)?null:(l&&h.push([h[0][0],h[0][1]]),h)}}const Et=X.TF.OpenEnded;class Ft{static local(){return null===Ft.instance&&(Ft.instance=new Ft),Ft.instance}execute(t,e,s,i){return new Rt(t,e,s)}}Ft.instance=null;class Rt extends Ct{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._width=(void 0!==e.width?e.width:5)*s,this._arrowType=void 0!==e.geometricEffectArrowType?e.geometricEffectArrowType:void 0!==e.arrowType?e.arrowType:Et,this._offsetFlattenError=Tt*s}processPath(t){switch(this._arrowType){case X.TF.OpenEnded:default:return this._constructSimpleArrow(t,!0);case X.TF.Block:return this._constructSimpleArrow(t,!1);case X.TF.Crossed:return this._constructCrossedArrow(t)}}_constructSimpleArrow(t,e){const s=this._curveHelper.calculatePathLength(t);let i=this._width;s<2*i&&(i=s/2);const r=this._curveHelper.getSubCurve(t,0,s-i);if(!r)return null;const n=i/2;if(this._curveHelper.isEmpty(r,!1))return null;const o=this._constructOffset(r,-n);if(!o)return null;const a=this._constructOffset(r,n);if(!a)return null;const l=this._constructArrowBasePoint(o,-n/2);if(!l)return null;const h=this._constructArrowBasePoint(a,n/2);if(!h)return null;const c=t[t.length-1];e||(this._makeControlPoint(a,!0),this._makeControlPoint(o,!0));const u=new zt;return u.addPath(a,!0),u.lineTo(h),this._makeControlPoint(u.path()),u.lineTo(c),this._makeControlPoint(u.path()),u.lineTo(l),this._makeControlPoint(u.path()),u.addPath(o,!1),e?{paths:[u.path()]}:(u.close(),{rings:[u.path()]})}_constructCrossedArrow(t){const e=this._curveHelper.calculatePathLength(t);let s=this._width;e<3.732050807568877*s&&(s=e/3.732050807568877);const i=this._curveHelper.getSubCurve(t,0,e-2.732050807568877*s);if(!i)return null;const r=s/2;if(this._curveHelper.isEmpty(i,!1))return null;const n=this._constructOffset(i,r);if(!n)return null;const o=this._constructOffset(i,-r);if(!o)return null;const a=this._curveHelper.getSubCurve(t,0,e-s);if(!a)return null;if(this._curveHelper.isEmpty(a,!1))return null;const l=this._constructOffset(a,r);if(!l)return null;const h=this._constructOffset(a,-r);if(!h)return null;const c=l[l.length-1],u=this._constructArrowBasePoint(l,r/2);if(!u)return null;const f=h[h.length-1],m=this._constructArrowBasePoint(h,-r/2);if(!m)return null;const _=t[t.length-1];this._makeControlPoint(n,!1),this._makeControlPoint(o,!1);const p=new zt;return p.addPath(n,!0),this._makeControlPoint(p.path()),p.lineTo(f),p.lineTo(m),this._makeControlPoint(p.path()),p.lineTo(_),this._makeControlPoint(p.path()),p.lineTo(u),this._makeControlPoint(p.path()),p.lineTo(c),this._makeControlPoint(p.path()),p.addPath(o,!1),{paths:[p.path()]}}_constructOffset(t,e){return this._curveHelper.offset(t,e,X.id.Rounded,4,this._offsetFlattenError)}_constructArrowBasePoint(t,e){if(!t||t.length<2)return null;const s=t[t.length-2],i=t[t.length-1],r=[i[0]-s[0],i[1]-s[1]];return this._curveHelper.normalize(r),[i[0]+r[1]*e,i[1]-r[0]*e]}_makeControlPoint(t,e=!1){wt(e?t[0]:t[t.length-1],1)}}class Nt{static local(){return null===Nt.instance&&(Nt.instance=new Nt),Nt.instance}execute(t,e,s,i){return new Ot(t,e,s,i)}}Nt.instance=null;class Ot{constructor(t,e,s,i){this._inputGeometries=t,this._curveHelper=new At,this._size=(void 0!==e.size?e.size:1)*s,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t))if(this._size>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,this._size,X.id.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else{if(!(this._size<0))return t;if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return{xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size}}if((0,ct.oU)(t)){if(0===this._size)return t;const e=[];for(const s of t.rings){const t=this._curveHelper.offset(s,this._size,X.id.Rounded,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{rings:e}}if((0,ct.l9)(t)&&this._size>0){const e=[];for(const s of t.paths)if(s&&s.length>1){const t=this._curveHelper.offset(s,this._size,X.id.Rounded,4,this._offsetFlattenError),i=this._curveHelper.offset(s,-this._size,X.id.Rounded,4,this._offsetFlattenError);if(t&&i){for(let e=i.length-1;e>=0;e--)t.push(i[e]);t.push([t[0][0],t[0][1]]),e.push(t)}}if(e.length)return{rings:e}}(0,ct.wp)(t)&&this._size,t=this._inputGeometries.next()}return null}}class Wt{static local(){return null===Wt.instance&&(Wt.instance=new Wt),Wt.instance}execute(t,e,s,i){return new Vt(t,e,s)}}Wt.instance=null;class Vt{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??X.Em.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){let e;if((0,ct.wp)(t)?e=this._processGeom([[[t.x,t.y]]]):(0,ct.aW)(t)?e=this._processGeom([t.points]):(0,ct.l9)(t)?e=this._processGeom(t.paths):(0,ct.oU)(t)&&(e=this._processGeom(t.rings)),e&&e.length)return{paths:e}}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,i){return[t[0]*e+s[0]*i,t[1]*e+s[1]*i]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const i=t[0]*e-t[1]*s,r=t[0]*s+t[1]*e;t[0]=i,t[1]=r}_makeCtrlPt(t){const e=[t[0],t[1]];return wt(e,1),e}_addAngledTicks(t,e,s,i){const r=this._sub(s,e);this._normalize(r);const n=this._crossProduct(r,this._sub(i,e));let o;o=n>0?this._rightPerp(r):this._leftPerp(r);const a=Math.abs(n)/2,l=[];l.push([e[0]+(o[0]-r[0])*a,e[1]+(o[1]-r[1])*a]),l.push(e),l.push(s),l.push([s[0]+(o[0]+r[0])*a,s[1]+(o[1]+r[1])*a]),t.push(l)}_addBezier2(t,e,s,i,r){if(0==r--)return void t.push(i);const n=this._mid(e,s),o=this._mid(s,i),a=this._mid(n,o);this._addBezier2(t,e,n,a,r),this._addBezier2(t,a,o,i,r)}_addBezier3(t,e,s,i,r,n){if(0==n--)return void t.push(r);const o=this._mid(e,s),a=this._mid(s,i),l=this._mid(i,r),h=this._mid(o,a),c=this._mid(a,l),u=this._mid(h,c);this._addBezier3(t,e,o,h,u,n),this._addBezier3(t,u,c,l,r,n)}_add90DegArc(t,e,s,i,r){const n=r??this._crossProduct(this._sub(s,e),this._sub(i,e))>0,o=this._mid(e,s),a=this._sub(o,e);n?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const i=e[0],r=e[1],n=e[e.length-1],o=this._sub(i,r);this._normalize(o);const a=this._crossProduct(o,this._sub(n,r)),l=.5*a,h=this._leftPerp(o),c=[n[0]-h[0]*a,n[1]-h[1]*a],u=e.length-1,f=[];f.push(s?[-h[0],-h[1]]:h);let m=[-o[0],-o[1]];for(let t=1;t<u-1;t++){const s=this._sub(e[t+1],e[t]);this._normalize(s);const i=this._dotProduct(s,m),r=this._crossProduct(s,m),n=Math.sqrt((1+i)/2),o=this._sub(s,m);this._normalize(o),o[0]/=n,o[1]/=n,f.push(r<0?[-o[0],-o[1]]:o),m=s}f.push(this._rightPerp(m));for(let s=f.length-1;s>0;s--)t.push([e[s][0]+f[s][0]*l,e[s][1]+f[s][1]*l]);t.push([c[0]+f[0][0]*l,c[1]+f[0][1]*l]),t.push([c[0]+f[0][0]*a,c[1]+f[0][1]*a]),t.push(i),t.push([c[0]-f[0][0]*a,c[1]-f[0][1]*a]),t.push([c[0]-f[0][0]*l,c[1]-f[0][1]*l]);for(let s=1;s<f.length;s++)t.push([e[s][0]-f[s][0]*l,e[s][1]-f[s][1]*l])}_cp2(t,e,s){return t.length>=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,i){if(t.length>=3)return t[2];const r=this._mix(t[0],1-s,e,s),n=this._sub(e,t[0]);return this._normalize(n),this._rightPerpendicular(n),[r[0]+n[0]*i*this._defaultSize,r[1]+n[1]*i*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),i=this._sub(e,s);this._normalize(i);const r=this._rightPerp(i);return[e,s,[e[0]+(r[0]-i[0])*this._defaultSize,e[1]+(r[1]-i[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let i;if(t.length>=3)i=t[t.length-1];else{const t=this._sub(e,s);this._normalize(t);const r=this._rightPerp(t);i=[e[0]+(r[0]-t[0])*this._defaultSize,e[1]+(r[1]-t[1])*this._defaultSize]}return[s,i]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||0===s.length)continue;const t=s.length;let i=s[0];switch(this._rule){case X.Em.PerpendicularFromFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=[];n.push(r),n.push(this._mid(i,t)),e.push(n);break}case X.Em.ReversedFirstSegment:{const t=this._cp2(s,0,-1);e.push([t,i]);break}case X.Em.PerpendicularToSecondSegment:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=[];n.push(this._mid(t,r)),n.push(i),e.push(n);break}case X.Em.SecondSegmentWithTicks:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);let o;o=this._crossProduct(n,this._sub(i,t))>0?this._rightPerp(o):this._leftPerp(n);const a=[];a.push([t[0]+(o[0]-n[0])/3,t[1]+(o[1]-n[1])/3]),a.push(t),a.push(r),a.push([r[0]+(o[0]+n[0])/3,r[1]+(o[1]+n[1])/3]),e.push(a);break}case X.Em.DoublePerpendicular:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,3),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push(i),l.push([r[0]+o[0]*a,r[1]+o[1]*a]),e.push(l);const h=[];h.push([r[0]-o[0]*a,r[1]-o[1]*a]),h.push(t),e.push(h);break}case X.Em.OppositeToFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,3),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push([r[0]+o[0]*a,r[1]+o[1]*a]),l.push([r[0]-o[0]*a,r[1]-o[1]*a]),e.push(l);break}case X.Em.TriplePerpendicular:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push([r[0]+o[0]*a*.8,r[1]+o[1]*a*.8]),l.push([n[0]+.8*(i[0]-n[0]),n[1]+.8*(i[1]-n[1])]),e.push(l),e.push([r,n]);const h=[];h.push([r[0]-o[0]*a*.8,r[1]-o[1]*a*.8]),h.push([n[0]+.8*(t[0]-n[0]),n[1]+.8*(t[1]-n[1])]),e.push(h);break}case X.Em.HalfCircleFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=this._mid(i,t);let o=this._sub(t,i);const a=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18),h=Math.sqrt((1+a)/2),c=Math.sqrt((1-a)/2),u=[];let f;this._crossProduct(o,this._sub(r,i))>0?(u.push(i),o=this._sub(i,n),f=t):(u.push(t),o=this._sub(t,n),f=i),this._rotateDirect(o,h,c),o[0]/=h,o[1]/=h;for(let t=1;t<=18;t++)u.push(this._add(n,o)),this._rotateDirect(o,a,l);u.push(f),e.push(u);break}case X.Em.HalfCircleSecondSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,1,-1);let n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t))/2;this._leftPerpendicular(n);const a=[t[0]+n[0]*o,t[1]+n[1]*o];n=this._sub(t,a);const l=Math.cos(Math.PI/18);let h=Math.sin(Math.PI/18);o>0&&(h=-h);const c=[t];for(let t=1;t<=18;t++)this._rotateDirect(n,l,h),c.push(this._add(a,n));e.push(c);break}case X.Em.HalfCircleExtended:{const r=this._cp2(s,0,-2),n=this._cp3(s,r,1,-1);let o;if(t>=4)o=s[3];else{const t=this._sub(i,r);o=this._add(n,t)}const a=this._dist(r,n)/2/.75,l=this._sub(r,i);this._normalize(l,a);const h=this._sub(n,o);this._normalize(h,a);const c=[o,n];e.push(c);const u=[this._clone(n)];this._addBezier3(u,n,this._add(n,h),this._add(r,l),r,4),u.push(i),e.push(u);break}case X.Em.OpenCircle:{const t=this._cp2(s,-2,0),r=this._sub(t,i),n=Math.cos(Math.PI/18),o=-Math.sin(Math.PI/18),a=[t];for(let t=1;t<=33;t++)this._rotateDirect(r,n,o),a.push(this._add(i,r));e.push(a);break}case X.Em.CoverageEdgesWithTicks:{const r=this._cp2(s,0,-1);let n,o;if(t>=3)n=s[2];else{const t=this._sub(r,i),e=this._leftPerp(t);n=[i[0]+e[0]-.25*t[0],i[1]+e[1]-.25*t[1]]}if(t>=4)o=s[3];else{const t=this._mid(i,r),e=this._sub(i,r);this._normalize(e),this._leftPerpendicular(e);const s=this._crossProduct(e,this._sub(n,t));this._rightPerpendicular(e),o=[n[0]+e[0]*s*2,n[1]+e[1]*s*2]}const a=this._sub(r,i);let l,h;l=this._crossProduct(a,this._sub(n,i))>0?this._rightPerp(a):this._leftPerp(a),h=[],h.push(n),h.push(i),h.push([i[0]+(l[0]-a[0])/3,i[1]+(l[1]-a[1])/3]),e.push(h),l=this._crossProduct(a,this._sub(o,r))>0?this._rightPerp(l):this._leftPerp(a),h=[],h.push([r[0]+(l[0]+a[0])/3,r[1]+(l[1]+a[1])/3]),h.push(r),h.push(o),e.push(h);break}case X.Em.GapExtentWithDoubleTicks:{const r=this._cp2(s,0,2),n=this._cp3(s,r,0,1);let o;if(t>=4)o=s[3];else{const t=this._sub(r,i);o=this._add(n,t)}this._addAngledTicks(e,i,r,this._mid(n,o)),this._addAngledTicks(e,n,o,this._mid(i,r));break}case X.Em.GapExtentMidline:{const r=this._cp2(s,2,0),n=this._cp3(s,r,0,1);let o;if(t>=4)o=s[3];else{const t=this._sub(r,i);o=this._add(n,t)}const a=[];a.push(this._mid(i,n)),a.push(this._mid(r,o)),e.push(a);break}case X.Em.Chevron:{const r=this._cp2(s,-1,-1);let n;if(t>=3)n=s[2];else{const t=this._sub(r,i);this._leftPerpendicular(t),n=this._add(i,t)}e.push([r,this._makeCtrlPt(i),n]);break}case X.Em.PerpendicularWithArc:{const t=this._cp2(s,0,-2),r=this._cp3(s,t,.5,-1);let n=this._sub(t,i);const o=this._norm(n);n[0]/=o,n[1]/=o;const a=this._crossProduct(n,this._sub(r,i));let l=this._dotProduct(n,this._sub(r,i));l<.05*o?l=.05*o:l>.95*o&&(l=.95*o);const h=[i[0]+n[0]*l,i[1]+n[1]*l];this._leftPerpendicular(n);let c=[];c.push([h[0]-n[0]*a,h[1]-n[1]*a]),c.push([h[0]+n[0]*a,h[1]+n[1]*a]),e.push(c);const u=[t[0]+n[0]*a,t[1]+n[1]*a];n=this._sub(t,u);const f=Math.cos(Math.PI/18);let m=Math.sin(Math.PI/18);a<0&&(m=-m),c=[i,t];for(let t=1;t<=9;t++)this._rotateDirect(n,f,m),c.push(this._add(u,n));e.push(c);break}case X.Em.ClosedHalfCircle:{const t=this._cp2(s,2,0),r=this._mid(i,t),n=this._sub(t,r),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18),l=[i,t];for(let t=1;t<=18;t++)this._rotateDirect(n,o,a),l.push(this._add(r,n));e.push(l);break}case X.Em.TripleParallelExtended:{const t=this._cp2(s,0,-2),r=this._cp3(s,t,1,-2),n=this._mid(i,t),o=this._sub(r,t);this._normalize(o);const a=Math.abs(this._crossProduct(o,this._sub(n,t)))/2,l=this._dist(t,r),h=[t,i];h.push([i[0]+o[0]*l*.5,i[1]+o[1]*l*.5]),e.push(h);const c=[];c.push([n[0]-o[0]*a,n[1]-o[1]*a]),c.push([n[0]+o[0]*l*.375,n[1]+o[1]*l*.375]),wt(c[c.length-1],1),c.push([n[0]+o[0]*l*.75,n[1]+o[1]*l*.75]),e.push(c);const u=[t,r];e.push(u);break}case X.Em.ParallelWithTicks:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(r,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n),this._addAngledTicks(e,i,t,r),this._addAngledTicks(e,this._mix(i,1,n,o),this._mix(t,1,n,o),this._mid(i,t));break}case X.Em.Parallel:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._leftPerp(n),a=this._crossProduct(n,this._sub(r,i));let l=[i,t];e.push(l),l=[],l.push([i[0]+o[0]*a,i[1]+o[1]*a]),l.push([t[0]+o[0]*a,t[1]+o[1]*a]),e.push(l);break}case X.Em.PerpendicularToFirstSegment:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._mid(i,t),o=this._sub(t,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i));this._leftPerpendicular(o);const l=[];l.push([n[0]-o[0]*a*.25,n[1]-o[1]*a*.25]),l.push([n[0]+o[0]*a*1.25,n[1]+o[1]*a*1.25]),e.push(l);break}case X.Em.ParallelOffset:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]-n[0]*o,i[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);const l=[];l.push([i[0]+n[0]*o,i[1]+n[1]*o]),l.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(l);break}case X.Em.OffsetOpposite:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]-n[0]*o,i[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);break}case X.Em.OffsetSame:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]+n[0]*o,i[1]+n[1]*o]),a.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(a);break}case X.Em.CircleWithArc:{let r=this._cp2(s,3,0);const n=this._cp3(s,r,.5,-1);let o,a;if(t>=4)o=s[3],a=this._crossProduct(this._sub(o,r),this._sub(n,r))>0;else{o=r,a=this._crossProduct(this._sub(o,i),this._sub(n,i))>0;const t=24*this._geomUnitsPerPoint,e=this._sub(o,i);this._normalize(e,t);const s=Math.sqrt(2)/2;this._rotateDirect(e,s,a?s:-s),r=this._add(i,e)}const l=this._sub(r,i),h=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r];for(let t=1;t<=36;t++)this._rotateDirect(l,h,c),u.push(this._add(i,l));this._add90DegArc(u,r,o,n,a),wt(u[u.length-8],1),e.push(u);break}case X.Em.DoubleJog:{let r,n,o=this._cp2(s,-3,1);if(r=t>=3?s[2]:this._add(i,this._sub(i,o)),t>=4)n=s[3];else{const t=i;i=o,n=r;const e=this._dist(i,t),s=this._dist(n,t);let a=30*this._geomUnitsPerPoint;.5*e<a&&(a=.5*e),.5*s<a&&(a=.5*s),o=this._mix(i,a/e,t,(e-a)/e),r=this._mix(n,a/s,t,(s-a)/s)}const a=this._mid(i,o),l=this._mid(n,r),h=this._dist(i,o),c=this._dist(r,n);let u=Math.min(h,c)/8;u=Math.min(u,24*this._geomUnitsPerPoint);const f=Math.cos(Math.PI/4);let m=this._sub(i,o);this._normalize(m,u),this._crossProduct(m,this._sub(n,o))>0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(o),_.push(this._add(a,m)),_.push(this._sub(a,m)),_.push(i),e.push(_),m=this._sub(n,r),this._normalize(m,u),this._crossProduct(m,this._sub(i,r))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(r),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(n),e.push(_);break}case X.Em.PerpendicularOffset:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);this._crossProduct(n,this._sub(i,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,r),o);e.push([a,i]);break}case X.Em.LineExcludingLastSegment:{const t=this._arrowPath(s),i=[];let r=t.length-2;for(;r--;)i.push(t[r]);e.push(i);break}case X.Em.MultivertexArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!1),e.push(i);break}case X.Em.CrossedArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!0),e.push(i);break}case X.Em.ChevronArrow:{const[t,r]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(i,t);this._normalize(o);const a=this._crossProduct(o,this._sub(r,t)),l=this._leftPerp(o),h=[r[0]-l[0]*a*2,r[1]-l[1]*a*2],c=[];c.push([r[0]+o[0]*n,r[1]+o[1]*n]),c.push(i),c.push([h[0]+o[0]*n,h[1]+o[1]*n]),e.push(c);break}case X.Em.ChevronArrowOffset:{const[t,r]=this._arrowLastSeg(s),n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t));this._leftPerpendicular(n);const a=[r[0]-n[0]*o,r[1]-n[1]*o],l=[];l.push([a[0]+n[0]*o*.5,a[1]+n[1]*o*.5]),l.push(this._mid(a,i)),l.push([a[0]-n[0]*o*.5,a[1]-n[1]*o*.5]),e.push(l);break}case X.Em.PartialFirstSegment:{const[t,r]=this._arrowLastSeg(s),n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t));this._leftPerpendicular(n);const a=[r[0]-n[0]*o,r[1]-n[1]*o];e.push([t,a]);break}case X.Em.Arch:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,1),n=this._sub(i,t),o=this._mix(r,1,n,.55),a=this._mix(r,1,n,-.55),l=[i];this._addBezier2(l,i,o,r,4),this._addBezier2(l,r,a,t,4),e.push(l);break}case X.Em.CurvedParallelTicks:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);this._crossProduct(n,this._sub(i,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,r),o),l=this._sub(this._mix(t,.75,r,.25),o),h=this._sub(this._mix(t,.25,r,.75),o),c=[t];this._addBezier2(c,t,l,a,3),this._addBezier2(c,a,h,r,3),e.push(c);for(let t=0;t<8;t++){const s=c[2*t+1],i=[this._clone(s)];i.push(this._add(s,[n[0]/4,n[1]/4])),e.push(i)}break}case X.Em.Arc90Degrees:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,1),n=[t];this._add90DegArc(n,t,i,r),e.push(n);break}case X.Em.FullGeometry:default:e.push(s)}}return e}}class Dt{static local(){return null===Dt.instance&&(Dt.instance=new Dt),Dt.instance}execute(t,e,s,i){return new Gt(t,e,s)}}Dt.instance=null;class Gt extends Ct{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._beginCut=(void 0!==e.beginCut?e.beginCut:1)*s,this._endCut=(void 0!==e.endCut?e.endCut:1)*s,this._middleCut=(void 0!==e.middleCut?e.middleCut:0)*s,this._invert=void 0!==e.invert&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const e=this._beginCut,s=this._endCut,i=this._middleCut,r=this._curveHelper.calculatePathLength(t),n=[];if(this._invert)if(0===e&&0===s&&0===i);else if(e+s+i>=r)n.push(t);else{let o=this._curveHelper.getSubCurve(t,0,e);o&&n.push(o),o=this._curveHelper.getSubCurve(t,.5*(r-i),.5*(r+i)),o&&n.push(o),o=this._curveHelper.getSubCurve(t,r-s,s),o&&n.push(o)}else if(0===e&&0===s&&0===i)n.push(t);else if(e+s+i>=r);else if(0===i){const i=this._curveHelper.getSubCurve(t,e,r-s);i&&n.push(i)}else{let o=this._curveHelper.getSubCurve(t,e,.5*(r-i));o&&n.push(o),o=this._curveHelper.getSubCurve(t,.5*(r+i),r-s),o&&n.push(o)}return 0===n.length?null:{paths:n}}}class Ut{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||0===t.length)return!1;for(let e=0;e<t.length;e++){let i=Math.abs(t[e]);s&&i<1e-7&&(i=1e-7),this._values.push(i),this._length+=i}return e&&1&t.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class Bt{constructor(){this.pt=null,this.ca=0,this.sa=0}}var Xt,Ht;(Ht=Xt||(Xt={}))[Ht.FAIL=0]="FAIL",Ht[Ht.END=1]="END",Ht[Ht.CONTINUE=2]="CONTINUE";class Yt{constructor(){this.reset()}reset(){this.segment=-1,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return-1!==this.segment}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class Jt extends At{constructor(t=0,e=!1){super(t,e),this._tolerance=Tt,this._currentPosition=new Yt}updateTolerance(t){this._tolerance=Tt*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._path=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=Xt.FAIL){const s=new Yt;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngle(this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=Xt.FAIL){const i=new Yt;if(!this._nextPosition(t,i,null,s))return!1;i.copyTo(this._currentPosition),e.pt=this._getPoint(i);const[r,n]=this._getAngle(i);return e.ca=r,e.sa=n,!0}nextCurve(t){if(0===t)return null;const e=[],s=new Yt;return this._nextPosition(t,s,e,Xt.END)?(s.copyTo(this._currentPosition),e):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){if(-1===this._currentPosition.segment)throw new Error("missing segment");return this._path[this._currentPosition.segment+1]}_nextPosition(t,e,s,i){if(this._currentPosition.isPathEnd)return!1;let r=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(r/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(0===s.length)if(0===r){const t=this._path[e.segment];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,r));const t=this._path[e.segment+1];s.push([t[0],t[1]])}if(r=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.calculateSegLength(this._path,e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==Xt.FAIL&&(e.segmentLength=this.calculateSegLength(this._path,e.segment),e.isPartEnd=!0,i===Xt.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){if(0===s.length)if(0===r){const t=this._path[e.segment];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,r));const t=e.abscissa/e.segmentLength;if(1===t){const t=this._path[e.segment+1];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,t))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){if(-1===t.segment)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._path,t.segment,e)}_getAngle(t){if(-1===t.segment)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegAngleCS(this._path,t.segment,e)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.calculateSegLength(this._path,this._nextSegment()),this._partSegCount++,1===St(this._path[this._getEndPointIndex()])){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.calculateSegLength(this._path,this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=1===St(this._path[e]);let s=e+this._partSegCount+1;if(s>=this._path.length&&(s=0),this._ctrlPtEnd=1===St(this._path[s]),this._patternLength>0){const t=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,e=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(t+e))/this._patternLength);s<=0&&(s=t+e>0?0:1),this._partLengthRatio=this._partLength/(t+e+s*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._path.length-2}_previousSegment(){return--this._seg}_nextSegment(){return++this._seg}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}class qt{static local(){return null===qt.instance&&(qt.instance=new qt),qt.instance}execute(t,e,s,i){return new Zt(t,e,s)}}qt.instance=null;class Zt extends Ct{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new Jt,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s,this._pattern=new Ut,this._pattern.init(e.dashTemplate,!0),this._pattern.scale(s)}processPath(t){if(0===this._pattern.length())return this.iteratePath=!1,{paths:[t]};if(!this.iteratePath){let e=!0;switch(this._endings){case X.sj.HalfPattern:case X.sj.HalfGap:default:this._pattern.extPtGap=0;break;case X.sj.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case X.sj.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case X.sj.NoConstraint:this.isClosed||(e=!1);break;case X.sj.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const s=this._walker.calculatePathLength(t);if(this._pattern.isEmpty()||s<.1*this._pattern.length())return{paths:[t]};if(!this._walker.init(t,this._pattern,e))return{paths:[t]}}let e;if(this.iteratePath)e=this._pattern.nextValue();else{let t;switch(this._endings){case X.sj.HalfPattern:default:t=.5*this._pattern.firstValue();break;case X.sj.HalfGap:t=.5*-this._pattern.lastValue();break;case X.sj.FullGap:t=-this._pattern.lastValue();break;case X.sj.FullPattern:t=0;break;case X.sj.NoConstraint:case X.sj.Custom:t=-this._customDashPos}let s=t/this._pattern.length();s-=Math.floor(s),t=s*this._pattern.length(),this._pattern.reset(),e=this._pattern.nextValue();let i=!1;for(;t>=e;)t-=e,e=this._pattern.nextValue(),i=!i;e-=t,i?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);return s?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),zt.mergePath(s,this._firstCurve),this._firstCurve=null)):(e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null),{paths:[s]}}}class Kt{static local(){return null===Kt.instance&&(Kt.instance=new Kt),Kt.instance}execute(t,e,s,i){return new jt(t,e,s)}}Kt.instance=null;class jt{constructor(t,e,s){switch(this._inputGeometries=t,this._curveHelper=new At,this._width=(void 0!==e.width?e.width:2)*s,e.method){case X.$y.Mitered:default:this._method=X.id.Mitered;break;case X.$y.Bevelled:this._method=X.id.Bevelled;break;case X.$y.Rounded:case X.$y.TrueBuffer:this._method=X.id.Rounded;break;case X.$y.Square:this._method=X.id.Square}this._option=e.option,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t)&&this._width>0){if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0)return t;const e=[];return e.push([[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]),e.push([[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]]),{rings:e}}if((0,ct.oU)(t)&&this._width>0){const e=[];for(const s of t.rings){const t=this._curveHelper.calculatePathLength(s),i=this._curveHelper.offset(s,this._width,this._method,4,this._offsetFlattenError);i&&(t<0&&i.reverse(),e.push(i))}if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}}class $t{static local(){return null===$t.instance&&($t.instance=new $t),$t.instance}execute(t,e,s,i){return new Qt(t,e,s)}}$t.instance=null;class Qt extends Ct{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._length=(void 0!==e.length?e.length:20)*s,this._angle=void 0!==e.angle?e.angle:225,this._position=void 0!==e.position?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){if(this._curveHelper.isEmpty(t,!1))return null;const e=t[0],s=t[t.length-1],i=[s[0]-e[0],s[1]-e[1]];this._curveHelper.normalize(i);const r=[e[0]+(s[0]-e[0])*this._position/100,e[1]+(s[1]-e[1])*this._position/100],n=Math.cos((90-this._angle)/180*Math.PI);let o=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(o=-o),this._mirror=!this._mirror,{paths:[[e,[r[0]-this._length/2*n,r[1]-this._length/2*o],[r[0]+this._length/2*n,r[1]+this._length/2*o],s]]}}}class te{static local(){return null===te.instance&&(te.instance=new te),te.instance}execute(t,e,s,i){return new ee(t,e,s)}}te.instance=null;class ee{constructor(t,e,s){this._inputGeometries=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?-e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t))return{xmin:t.xmin+this._offsetX,xmax:t.xmax+this._offsetX,ymin:t.ymin+this._offsetY,ymax:t.ymax+this._offsetY};if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._moveMultipath(e.rings,this._offsetX,this._offsetY),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._moveMultipath(e.paths,this._offsetX,this._offsetY),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._movePath(e.points,this._offsetX,this._offsetY),e}if((0,ct.wp)(t))return{x:t.x+this._offsetX,y:t.y+this._offsetY};t=this._inputGeometries.next()}return null}_moveMultipath(t,e,s){if(t)for(const i of t)this._movePath(i,e,s)}_movePath(t,e,s){if(t)for(const i of t)i[0]+=e,i[1]+=s}}class se{static local(){return null===se.instance&&(se.instance=new se),se.instance}execute(t,e,s,i){return new ie(t,e,s)}}se.instance=null;class ie{constructor(t,e,s){this._inputGeometries=t,this._curveHelper=new At,this._offset=(e.offset??1)*s,this._method=e.method,this._option=e.option,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._offset)return t;if((0,ct.YX)(t)){if(this._method===X.id.Rounded&&this._offset>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset>0)return{xmin:t.xmin-this._offset,xmax:t.xmax+this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset}}if((0,ct.oU)(t)){const e=[];for(const s of t.rings){const t=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{rings:e}}if((0,ct.l9)(t)){const e=[];for(const s of t.paths){const t=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{paths:e}}t=this._inputGeometries.next()}return null}}class re{static local(){return null===re.instance&&(re.instance=new re),re.instance}execute(t,e,s,i){return new ne(t,e,s)}}re.instance=null;class ne{constructor(t,e,s){this._inputGeometries=t,this._reverse=void 0===e.reverse||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return Mt(e.paths),e}t=this._inputGeometries.next()}return null}}var oe=s(20322);class ae{static local(){return null===ae.instance&&(ae.instance=new ae),ae.instance}execute(t,e,s,i){return new le(t,e,s)}}ae.instance=null;class le{constructor(t,e,s){this._inputGeometries=t,this._rotateAngle=void 0!==e.angle?e.angle*Math.PI/180:0}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._rotateAngle)return t;const e=(0,z.Ue)();(0,oe.$P)(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if((0,ct.YX)(t)){const e={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._rotateMultipath(e.rings,s,i),e}if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._rotateMultipath(e.rings,s,i),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._rotateMultipath(e.paths,s,i),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._rotatePath(e.points,s,i),e}if((0,ct.wp)(t))return t;t=this._inputGeometries.next()}return null}_rotateMultipath(t,e,s){if(t)for(const i of t)this._rotatePath(i,e,s)}_rotatePath(t,e,s){if(t){const i=Math.cos(this._rotateAngle),r=Math.sin(this._rotateAngle);for(const n of t){const t=n[0]-e,o=n[1]-s;n[0]=e+t*i-o*r,n[1]=s+t*r+o*i}}}}class he{static local(){return null===he.instance&&(he.instance=new he),he.instance}execute(t,e,s,i){return new ce(t,e,s)}}he.instance=null;class ce{constructor(t,e,s){this._inputGeometries=t,this._xFactor=void 0!==e.xScaleFactor?e.xScaleFactor:1.15,this._yFactor=void 0!==e.yScaleFactor?e.yScaleFactor:1.15}next(){let t=this._inputGeometries.next();for(;t;){if(1===this._xFactor&&1===this._yFactor)return t;const e=(0,z.Ue)();(0,oe.$P)(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if((0,ct.YX)(t)){const e={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._scaleMultipath(e.rings,s,i),e}if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._scaleMultipath(e.rings,s,i),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._scaleMultipath(e.paths,s,i),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._scalePath(e.points,s,i),e}if((0,ct.wp)(t))return t;t=this._inputGeometries.next()}return null}_scaleMultipath(t,e,s){if(t)for(const i of t)this._scalePath(i,e,s)}_scalePath(t,e,s){if(t)for(const i of t){const t=(i[0]-e)*this._xFactor,r=(i[1]-s)*this._yFactor;i[0]=e+t,i[1]=s+r}}}class ue{static local(){return null===ue.instance&&(ue.instance=new ue),ue.instance}execute(t,e,s,i){return new fe(t,e,s)}}ue.instance=null;class fe{constructor(t,e,s){this._inputGeometries=t,this._height=(void 0!==e.amplitude?e.amplitude:2)*s,this._period=(void 0!==e.period?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Ut,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Jt,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;if((0,ct.l9)(t)){const e=this._processGeom(t.paths);if(e.length)return{paths:e}}if((0,ct.oU)(t)){const e=this._processGeom(t.rings);if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}_processGeom(t){const e=[];for(const s of t)if(this._walker.init(s,this._pattern))switch(this._style){case X.zQ.Sinus:default:e.push(this._constructCurve(s,!1));break;case X.zQ.Square:e.push(this._constructSquare(s));break;case X.zQ.Triangle:e.push(this._constructTriangle(s));break;case X.zQ.Random:e.push(this._constructCurve(s,!0))}else e.push(s);return e}_constructCurve(t,e){const s=new zt,i=this._walker.calculatePathLength(t);let r=Math.round(i/this._period);0===r&&(r=1);const n=16*r+1,o=i/r,a=this._period/16,l=1/n,h=2*Math.PI*i/o,c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),f=2*Math.PI*Math.random(),m=.75-Math.random()/2,_=.75-Math.random()/2,p=new Bt;this._walker.curPointAndAngle(p),s.startPath(p.pt);let d=0;for(;;){if(!this._walker.nextPointAndAngle(a,p)){s.lineTo(t[t.length-1]);break}{const t=d;let i;if(d+=l,e){const e=this._height/2*(1+.3*Math.sin(m*h*t+c));i=e*Math.sin(h*t+u),i+=e*Math.sin(_*h*t+f),i/=2}else i=.5*this._height*Math.sin(.5*h*t);s.lineTo([p.pt[0]-i*p.sa,p.pt[1]+i*p.ca])}}return s.path()}_constructSquare(t){const e=new zt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const s=new Bt;this._walker.curPointAndAngle(s);const r=new Bt;if(this._walker.nextPointAndAngle(this._period,r)){const n=new Bt;this._walker.nextPointAndAngle(this._period,n)&&(i?(e.startPath(s.pt),i=!1):e.lineTo(s.pt),e.lineTo([s.pt[0]-this._height/2*s.sa,s.pt[1]+this._height/2*s.ca]),e.lineTo([r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca]),e.lineTo([r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca]),e.lineTo([n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca]),t=!0)}}if(!t){e.lineTo(this._walker.getPathEnd());break}}return e.path()}_constructTriangle(t){const e=new zt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const s=new Bt;this._walker.curPointAndAngle(s);const r=new Bt;if(this._walker.nextPointAndAngle(this._period/2,r)){const n=new Bt;this._walker.nextPointAndAngle(this._period,n)&&(this._walker.nextPosition(this._period/2)&&(i?(e.startPath(s.pt),i=!1):e.lineTo(s.pt),e.lineTo([r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca]),e.lineTo([n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca])),t=!0)}}if(!t){e.lineTo(this._walker.getPathEnd());break}}return e.path()}}class me{static local(){return null===me.instance&&(me.instance=new me),me.instance}execute(t,e,s,i){return new _e(t,e,s)}}me.instance=null;class _e extends Pt{constructor(t,e,s){super(t,!0,!0),this._geometryWalker=new Jt,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Ut,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===X.JS.WithFullGap&&this.isClosed?this._endings=X.JS.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case X.JS.NoConstraint:s=-this._position,s=this._adjustPosition(s),i=!1;break;case X.JS.WithHalfGap:default:s=-this._pattern.lastValue()/2;break;case X.JS.WithFullGap:s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case X.JS.WithMarkers:s=0;break;case X.JS.Custom:s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let r=0;for(;s>r;)s-=r,r=this._pattern.nextValue();r-=s,e=r,this.iteratePath=!0}const s=new Bt;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===X.JS.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===X.JS.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}class pe{static local(){return null===pe.instance&&(pe.instance=new pe),pe.instance}execute(t,e,s,i){return new de(t,e,s)}}pe.instance=null;class de extends Pt{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._type=e.extremityPlacement,this._position=void 0!==e.offsetAlongLine?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case X.Tx.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case X.Tx.JustBegin:e=this._atExtremities(t,this._position,!0);break;case X.Tx.JustEnd:e=this._atExtremities(t,this._position,!1);case X.Tx.None:}return e}_atExtremities(t,e,s){const i=t.length;if(i<2)return null;const r=s?1:i-2,n=s?i:-1,o=s?1:-1;let a,l=0,h=s?t[0]:t[i-1];for(let s=r;s!==n;s+=o){a=h,h=t[s];const i=this._curveHelper.calculateLength(a,h);if(l+i>e){const t=(e-l)/i,[s,r]=this._curveHelper.getAngleCS(a,h,t),n=vt(a,h,t);return this.internalPlacement.setTranslate(n[0]-this._offset*r,n[1]+this._offset*s),this._angleToLine&&this.internalPlacement.setRotateCS(-s,-r),this.internalPlacement}l+=i}return null}}class ge{static local(){return null===ge.instance&&(ge.instance=new ge),ge.instance}execute(t,e,s,i){return new ye(t,e,s)}}ge.instance=null;class ye extends Pt{constructor(t,e,s){super(t,!0,!0),this._walker=new Jt,this._walker.updateTolerance(s),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*s:0,this._endGap=void 0!==e.endPosition?e.endPosition*s:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new Ut,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;e=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(t)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+s;e=i-this._prevPos,this._prevPos=i,this.iteratePath=!0}const s=new Bt;if(!this._walker.nextPointAndAngle(e,s,Xt.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let r,n;return this._angleToLine?(r=s.ca,n=s.sa):(r=1,n=0),i&&(r=-r,n=-n),this.internalPlacement.setRotateCS(r,n),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}var xe=s(77734);class Me{static local(){return null===Me.instance&&(Me.instance=new Me),Me.instance}execute(t,e,s,i){return new be(t,e,s,i)}}Me.instance=null;class be{constructor(t,e,s,i){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,0!==this._stepX&&0!==this._stepY&&t&&function(t){return void 0!==t.rings}(t)&&t.rings){if(this._gridType=e.gridType??X.bj.Fixed,this._gridType===X.bj.Random){const t=e.seed??13,s=1;this._randomLCG=new xe.Z(t*s),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginX=0,this._graphicOriginY=0,this._internalPlacement=new ut,this._calculateMinMax(t),this._geometry=t}}next(){return this._geometry?this._nextInside():null}_calculateMinMax(t){let e,s,i,r,n,o,a,l;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,n=o=Number.MAX_VALUE,a=l=-Number.MAX_VALUE;for(const h of t.rings){const t=h?h.length:0;for(let c=0;c<t;++c)e=h[c][0]-this._graphicOriginX-this._offsetX,s=h[c][1]-this._graphicOriginY-this._offsetY,i=this._cosAngle*e-this._sinAngle*s,r=this._sinAngle*e+this._cosAngle*s,n=Math.min(n,i),a=Math.max(a,i),o=Math.min(o,r),l=Math.max(l,r)}n+=this._graphicOriginX,a+=this._graphicOriginX,o+=this._graphicOriginY,l+=this._graphicOriginY,this._xMin=Math.round(n/this._stepX),this._xMax=Math.round(a/this._stepX),this._yMin=Math.round(o/this._stepY),this._yMax=Math.round(l/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,i;return this._currentX++,this._gridType===X.bj.Random?(s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-this._randomLCG.getFloat())*2/3,i=this._graphicOriginY+e+this._stepY*this._randomness*(.5-this._randomLCG.getFloat())*2/3):(s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,i=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e),this._internalPlacement.setTranslate(s,i),this._internalPlacement}}}class ve{static local(){return null===ve.instance&&(ve.instance=new ve),ve.instance}execute(t,e,s,i){return new Se(t,e,s)}}ve.instance=null;class Se extends Pt{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=void 0!==e.startPointOffset?e.startPointOffset*s:0,this._epsilon=.001*s}processPath(t){const e=this._position;if(this._relativeTo===X.CS.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=t.length,this._curSegment=1,this.iteratePath=!0);this._curSegment<this._segmentCount;){const e=this._curSegment;this._curSegment++;const s=t[e-1],i=t[e],r=this._curveHelper.calculateLength(s,i);if(r<this._epsilon)continue;const n=.5+this._position/r,[o,a]=this._curveHelper.getAngleCS(s,i,n),l=vt(s,i,n);return this.internalPlacement.setTranslate(l[0]-this._offset*a,l[1]+this._offset*o),this._angleToLine&&this.internalPlacement.setRotateCS(o,a),this.internalPlacement}return this.iteratePath=!1,null}this._relativeTo===X.CS.LineEnd&&bt(t);const s=this.onLine(t,e);return this._relativeTo===X.CS.LineEnd&&bt(t),s}onLine(t,e){let s,i=!1;switch(this._relativeTo){case X.CS.LineMiddle:default:s=this._curveHelper.calculatePathLength(t)/2+e;break;case X.CS.LineBeginning:s=e;break;case X.CS.LineEnd:s=e,i=!0}const r=t.length;let n,o=0,a=t[0];for(let e=1;e<r;++e){n=a,a=t[e];const r=this._curveHelper.calculateLength(n,a);if(o+r>s){const t=(s-o)/r,[e,l]=this._curveHelper.getAngleCS(n,a,t),h=vt(n,a,t),c=i?-this._offset:this._offset;return this.internalPlacement.setTranslate(h[0]-c*l,h[1]+c*e),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-e,-l):this.internalPlacement.setRotateCS(e,l)),this.internalPlacement}o+=r}return null}}class we{static local(){return null===we.instance&&(we.instance=new we),we.instance}execute(t,e,s,i){return new Pe(t,e,s)}}we.instance=null;class Pe extends Pt{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._endPoints=void 0===e.placeOnEndPoints||e.placeOnEndPoints,this._controlPoints=void 0===e.placeOnControlPoints||e.placeOnControlPoints,this._regularVertices=void 0===e.placeOnRegularVertices||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),r=Math.sin(e[2]);s-=this._offset*r,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0;const e=function(t){return!(!t||0===t.length)&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}(t),s=t.length-1;let i,r,n=0,o=0,a=0,l=0,h=0;for(;n<s;){n++,i=t[n-1],r=t[n];const c=St(i),u=St(r);(this._angleToLine||0!==this._offset)&&(l=this._curveHelper.getAngle(i,r,0)),1===n?e?(o=l,a=c):(this._endPoints||this._controlPoints&&1===c)&&this._tags.push([i[0],i[1],l]):1===c?this._controlPoints&&this._tags.push([i[0],i[1],Ce(h,l)]):this._regularVertices&&this._tags.push([i[0],i[1],Ce(h,l)]),(this._angleToLine||0!==this._offset)&&(h=this._curveHelper.getAngle(i,r,1)),n===s&&(e?1===u||1===a?this._controlPoints&&this._tags.push([r[0],r[1],Ce(h,o)]):this._regularVertices&&this._tags.push([r[0],r[1],Ce(h,o)]):(this._endPoints||this._controlPoints&&1===u)&&this._tags.push([r[0],r[1],h]))}this._tagIterator=0}}function Ce(t,e){const s=Math.PI;for(;Math.abs(e-t)>s+2e-15;)e-t>s?e-=2*s:e+=2*s;return(t+e)/2}var Le=s(35308);class Ie{constructor(t=ke){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(null==t)return;const{_data:e,_compare:s}=this;e.push(t);let i=e.length-1>>>0;const r=e[i];for(;i>0;){const t=i-1>>1,n=e[t];if(!(s(n,r)<=0))break;e[t]=r,e[i]=n,i=t}}dequeue(){const{_data:t,_compare:e}=this,s=t[0],i=t.pop();if(0===t.length)return s;t[0]=i;let r=0;const n=t.length,o=t[0];let a,l,h=null;for(;;){const s=2*r+1,i=2*r+2;if(h=null,s<n&&(a=t[s],e(a,o)>0&&(h=s)),i<n&&(l=t[i],(null===h&&e(l,o)<=0||null!==h&&e(l,a)<=0)&&(h=i)),null===h)break;t[r]=t[h],t[h]=o,r=h}return s}}const ke=(t,e)=>t<e?-1:t>e?1:0;var Te=s(86662),ze=s(87416);function Ae(t,e){const{rings:s}=e;let i=0;for(const e of s){const s=e.length;for(let r=1;r<s;++r){const s=e[r-1],n=e[r];s[1]>t[1]!=n[1]>t[1]&&((n[0]-s[0])*(t[1]-s[1])-(n[1]-s[1])*(t[0]-s[0])>0?i++:i--)}}return 0!==i}function Ee(t,e,s){if(s&&Ae(t,e))return{coord:t,distance:0};let i=1/0,r=0,n=0;const o=[0,0],{rings:a}=e;for(const e of a)if(!(e.length<2))for(let s=0;s<e.length-1;s++){(0,Te.Tx)(o,t,e,s);const a=Ve(t,o);a<i&&(i=a,r=o[0],n=o[1])}return{coord:[r,n],distance:Math.sqrt(i)}}function Fe(t,e,s,i){const r=[e,0];let n=1/0,o=1/0,a=!1,l=!1;const h=[[e,i[1]-1],[e,i[3]+1]],c=[0,0],u=[0,0],f=[0,0],m=[[0,0],[0,0]],_=(0,z.Ue)(),{rings:p}=t;for(const t of p)if(!(t.length<2))for(let e=1;e<t.length;e++){if(m[0][0]=t[e-1][0],m[0][1]=t[e-1][1],m[1][0]=t[e][0],m[1][1]=t[e][1],null===Re(_,m))continue;if(u[0]=h[0][0],u[1]=h[0][1],f[0]=h[1][0],f[1]=h[1][1],0===Ne(_,u,f))continue;if(!(0,ze.UT)(h[0],h[1],m[0],m[1],c))continue;const s=c[1];n>o?s<n&&(n=s,a=!0):s<o&&(o=s,l=!0)}return a&&l?r[1]=(n+o)/2:r[0]=r[1]=NaN,r}function Re(t,e){if(e.length<2)return null;t||(t=(0,z.Ue)());const[s,i]=e[0],[r,n]=e[1];return t[0]=Math.min(s,r),t[1]=Math.min(i,n),t[2]=Math.max(s,r),t[3]=Math.max(i,n),t}function Ne(t,e,s){let i=Oe(e,t),r=Oe(s,t);const n=t[0],o=t[1],a=t[2],l=t[3];if(i&r)return 0;if(!(i|r))return 4;const h=(i?1:0)|(r?2:0);do{const h=s[0]-e[0],c=s[1]-e[1];if(h>c)3&i?(1&i?(e[1]+=c*(n-e[0])/h,e[0]=n):(e[1]+=c*(a-e[0])/h,e[0]=a),i=Oe(e,t)):3&r?(1&r?(s[1]+=c*(n-s[0])/h,s[0]=n):(s[1]+=c*(a-s[0])/h,s[0]=a),r=Oe(s,t)):i?(4&i?(e[0]+=h*(o-e[1])/c,e[1]=o):(e[0]+=h*(l-e[1])/c,e[1]=l),i=Oe(e,t)):(4&r?(s[0]+=h*(o-s[1])/c,s[1]=o):(s[0]+=h*(l-s[1])/c,s[1]=l),r=Oe(s,t));else if(12&i?(4&i?(e[0]+=h*(o-e[1])/c,e[1]=o):(e[0]+=h*(l-e[1])/c,e[1]=l),i=Oe(e,t)):12&r?(4&r?(s[0]+=h*(o-s[1])/c,s[1]=o):(s[0]+=h*(l-s[1])/c,s[1]=l),r=Oe(s,t)):i?(1&i?(e[1]+=c*(n-e[0])/h,e[0]=n):(e[1]+=c*(a-e[0])/h,e[0]=a),i=Oe(e,t)):(1&r?(s[1]+=c*(n-s[0])/h,s[0]=n):(s[1]+=c*(a-s[0])/h,s[0]=a),r=Oe(s,t)),i&r)return 0}while(i|r);return h}function Oe(t,e){return(t[0]<e[0]?1:0)|(t[0]>e[2]?1:0)<<1|(t[1]<e[1]?1:0)<<2|(t[1]>e[3]?1:0)<<3}function We(t,e,s){return t+(e-t)*s}function Ve(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function De(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;const s=isNaN(t),i=isNaN(e);return s<i?-1:s>i?1:0}class Ge{constructor(t,e,s,i){this.x=t,this.y=e,this.cellSize=s,this.distancefromCellCenter=(0,Te.ko)(t,e,i),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}class Ue{static local(){return null===Ue.instance&&(Ue.instance=new Ue),Ue.instance}execute(t,e,s,i){return new Be(t,e,s)}}Ue.instance=null;class Be{constructor(t,e,s){this._geometry=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0,this._method=void 0!==e.method?e.method:X.Lh.OnPolygon,this._internalPlacement=new ut}next(){const t=this._geometry;return this._geometry=null,t&&function(t){return void 0!==t.rings}(t)?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case X.Lh.CenterOfMass:{const s=(0,Le.NA)(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case X.Lh.BoundingBoxCenter:{const s=(0,z.Ue)();(0,oe.$P)(s,t),s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case X.Lh.OnPolygon:default:{let s;s=(0,a.Z)("polylabel-placement-enabled")?function(t){if(!t||!t.rings||0===t.rings.length)return null;const e=(0,oe.lC)((0,z.Ue)(),t.rings[0]);if(!e)return null;const s=e[2]-e[0],i=e[3]-e[1];if(0===s||0===i)return[e[0]+s/2,e[1]+i/2];const r=Math.max(Math.min(s,i)/100,1),n=new Ie(((t,e)=>e.maxDistanceToPolygon-t.maxDistanceToPolygon)),o=Math.min(s,i);let a=o/2,l=0,c=0;for(l=e[0];l<e[2];l+=o)for(c=e[1];c<e[3];c+=o)n.enqueue(new Ge(l+a,c+a,a,t));const u=(0,Le.a)(t.rings,!1);if(null===u)return null;let f,m=new Ge(u[0],u[1],0,t);for(;n.size>0;)f=(0,h.Wg)(n.dequeue()),f.distancefromCellCenter>m.distancefromCellCenter&&(m=f),f.maxDistanceToPolygon-m.distancefromCellCenter<=r||(a=f.cellSize/2,n.enqueue(new Ge(f.x-a,f.y-a,a,t)),n.enqueue(new Ge(f.x+a,f.y-a,a,t)),n.enqueue(new Ge(f.x-a,f.y+a,a,t)),n.enqueue(new Ge(f.x+a,f.y+a,a,t)));return[m.x,m.y]}(t):function(t){const{rings:e}=t;if(!e||0===e.length)return null;const s=(0,oe.$P)((0,z.Ue)(),t);if(!s)return null;const i=4*(Math.abs(s[0])+Math.abs(s[2])+Math.abs(s[1])+Math.abs(s[3])+1)*222045e-19;let r=0,n=0;for(let t=0;t<e.length;t++){const s=(0,Te.Sm)(e[t]);s>n&&(n=s,r=t)}if(Math.abs(n)<=2*i*i){const t=(0,oe.lC)((0,z.Ue)(),e[r]);return[(t[0]+t[2])/2,(t[1]+t[3])/2]}const o=(0,Le.DS)(e[r],!1,(0,z.Ue)());if(null===o)return null;if(1===e.length&&e[0].length<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],h=[NaN,NaN,NaN,NaN];let c=!1,u=Ee(o,t,!0);0===u.distance&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ee(o,t,!1)),l[0]=u.distance,h[0]=0;const f=[NaN,NaN];let m=!1,_=.25,p=-1;const d=(0,oe.lC)((0,z.Ue)(),e[r]);let g=NaN;do{if(g=NaN,a[1]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ee(a[1],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[1],t))m=!0,l[1]=g,h[1]=Ve(a[1],o);else if(!isNaN(g)&&g>p&&(p=g,f[0]=a[1][0],f[1]=a[1][1]),_-=.01,_<.1){if(!(p>=0))break;m=!0,l[1]=p,a[1][0]=f[0],a[1][1]=f[1],h[1]=Ve(a[1],o)}}while(!m);m=!1,_=.5,p=-1;let y=.01,x=1;do{if(g=NaN,a[2]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ee(a[2],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[2],t))m=!0,l[2]=g,h[2]=Ve(a[2],o);else if(!isNaN(g)&&g>p)p=g,f[0]=a[2][0],f[1]=a[2][1];else if(g>p&&(p=g,f[0]=a[2][0],f[1]=a[2][1]),_=.5+y*x,y+=.01,x*=-1,_<.3||_>.7){if(!(p>=0))break;m=!0,l[2]=p,a[2][0]=f[0],a[2][1]=f[1],h[2]=Ve(a[2],o)}}while(!m);m=!1,_=.75,p=-1;do{if(g=NaN,a[3]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ee(a[3],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[3],t))m=!0,l[3]=g,h[3]=Ve(a[3],o);else if(g>p&&(p=g,f[0]=a[3][0],f[1]=a[3][1]),_+=.01,_>.9){if(!(p>=0))break;m=!0,l[3]=p,a[3][0]=f[0],a[3][1]=f[1],h[3]=Ve(a[3],o)}}while(!m);const M=[0,1,2,3],b=c?0:1;let v;for(let t=b;t<4;t++)for(let t=b;t<3;t++){const e=h[t],s=h[t+1];De(e,s)>0&&(v=M[t],M[t]=M[t+1],M[t+1]=v,h[t]=s,h[t+1]=e)}let S=b,w=0,P=0;for(let t=b;t<4;t++){switch(t){case 0:P=2*l[M[t]];break;case 1:P=1.66666666*l[M[t]];break;case 2:P=1.33333333*l[M[t]];break;case 3:P=l[M[t]]}P>w&&(w=P,S=M[t])}return a[S]}(t),null!==s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}}function Xe(t){if(!t)return null;switch(t.type){case"CIMGeometricEffectAddControlPoints":return It.local();case"CIMGeometricEffectArrow":return Ft.local();case"CIMGeometricEffectBuffer":return Nt.local();case"CIMGeometricEffectControlMeasureLine":return Wt.local();case"CIMGeometricEffectCut":return Dt.local();case"CIMGeometricEffectDashes":return qt.local();case"CIMGeometricEffectDonut":return Kt.local();case"CIMGeometricEffectJog":return $t.local();case"CIMGeometricEffectMove":return te.local();case"CIMGeometricEffectOffset":return se.local();case"CIMGeometricEffectReverse":return re.local();case"CIMGeometricEffectRotate":return ae.local();case"CIMGeometricEffectScale":return he.local();case"CIMGeometricEffectWave":return ue.local()}return null}function He(t){if(!t)return null;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":return me.local();case"CIMMarkerPlacementAtExtremities":return pe.local();case"CIMMarkerPlacementAtRatioPositions":return ge.local();case"CIMMarkerPlacementInsidePolygon":return Me.local();case"CIMMarkerPlacementOnLine":return ve.local();case"CIMMarkerPlacementOnVertices":return we.local();case"CIMMarkerPlacementPolygonCenter":return Ue.local()}return null}class Ye{static getPlacement(t,e,s,i){const r=He(e);if(!r)return null;const n=ft(t);return r.execute(n,e,s,i)}}var Je=s(46851);function qe(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1],u=s[2],f=s[3],m=s[4],_=s[5];return t[0]=i*h+n*c,t[1]=r*h+o*c,t[2]=i*u+n*f,t[3]=r*u+o*f,t[4]=i*m+n*_+a,t[5]=r*m+o*_+l,t}function Ze(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=Math.sin(s),c=Math.cos(s);return t[0]=i*c+n*h,t[1]=r*c+o*h,t[2]=i*-h+n*c,t[3]=r*-h+o*c,t[4]=a,t[5]=l,t}function Ke(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=i*h+n*c+a,t[5]=r*h+o*c+l,t}function je(t,e){const s=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=s,t[2]=-s,t[3]=i,t[4]=0,t[5]=0,t}function $e(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Qe(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t[2]=e[2]-s[2],t[3]=e[3]-s[3],t[4]=e[4]-s[4],t[5]=e[5]-s[5],t}const ts=qe,es=Qe;function ss(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function is(t,e,s,i){const r=e[i],n=e[i+1];t[i]=s[0]*r+s[2]*n+s[4],t[i+1]=s[1]*r+s[3]*n+s[5]}function rs(t,e,s,i=0,r=0,n=2){const o=r||e.length/n;for(let r=i;r<o;r++)is(t,e,s,r*n)}Object.freeze(Object.defineProperty({__proto__:null,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},set:function(t,e,s,i,r,n,o){return t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=o,t},invert:function(t,e){const s=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5];let l=s*n-i*r;return l?(l=1/l,t[0]=n*l,t[1]=-i*l,t[2]=-r*l,t[3]=s*l,t[4]=(r*a-n*o)*l,t[5]=(i*o-s*a)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:qe,rotate:Ze,scale:function(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1];return t[0]=i*h,t[1]=r*h,t[2]=n*c,t[3]=o*c,t[4]=a,t[5]=l,t},translate:Ke,fromRotation:je,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},fromTranslation:$e,str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)},add:function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t[3]=e[3]+s[3],t[4]=e[4]+s[4],t[5]=e[5]+s[5],t},subtract:Qe,multiplyScalar:function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*s,t[5]=e[5]*s,t},multiplyScalarAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t[2]=e[2]+s[2]*i,t[3]=e[3]+s[3]*i,t[4]=e[4]+s[4]*i,t[5]=e[5]+s[5]*i,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},equals:function(t,e){const s=t[0],i=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],f=e[4],m=e[5],_=(0,Je.g)();return Math.abs(s-l)<=_*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(i-h)<=_*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(r-c)<=_*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=_*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-f)<=_*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-m)<=_*Math.max(1,Math.abs(a),Math.abs(m))},mul:ts,sub:es},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,create:ss,clone:function(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},fromValues:function(t,e,s,i,r,n){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=s,o[3]=i,o[4]=r,o[5]=n,o},createView:function(t,e){return new Float32Array(t,e,6)},transform:is,transformMany:rs},Symbol.toStringTag,{value:"Module"}));var ns=s(1265),os=s(87893);class as{constructor(t,e,s,i){this.center=(0,ns.f)(t,e),this.centerT=(0,ns.c)(),this.halfWidth=s/2,this.halfHeight=i/2,this.width=s,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new as(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const s=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),r=(t.halfWidth+this.halfWidth+e)/s,n=(t.halfHeight+this.halfHeight+e)/i,o=Math.min(r,n);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),s=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-e,r=Math.max(this.ymax,t.ymax)-s,n=e+i/2,o=s+r/2;this.width=i,this.height=r,this.halfWidth=i/2,this.halfHeight=r/2,this.x=n,this.y=o}static deserialize(t){const e=t.readF32(),s=t.readF32(),i=t.readInt32(),r=t.readInt32();return new as(e,s,i,r)}}const ls=Math.PI/180;class hs{constructor(t,e,s,i){this._rotationT=ss(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const r=s.rect,n=new Float32Array(8);t*=i,e*=i;const o=s.code?r.width*i:s.metrics.width,a=s.code?r.height*i:s.metrics.height;n[0]=t,n[1]=e,n[2]=t+o,n[3]=e,n[4]=t,n[5]=e+a,n[6]=t+o,n[7]=e+a,this._data=n,this._setTextureCoords(r),this._scale=i,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+a)}get width(){return this._mosaic.metrics.width*this._scale}get mosaic(){return this._mosaic}set angle(t){this._angle=t,je(this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,i=Math.abs(t)*this._scale,r=new Float32Array(8);r[0]=this.x,r[1]=this.y,r[2]=this.x+s,r[3]=this.y,r[4]=this.x,r[5]=this.y+i,r[6]=this.x+s,r[7]=this.y+i,rs(r,r,qe(ss(),this._rotationT,this._transform));let n=1/0,o=1/0,a=0,l=0;for(let t=0;t<4;t++){const e=r[2*t],s=r[2*t+1];n=Math.min(n,e),o=Math.min(o,s),a=Math.max(a,e),l=Math.max(l,s)}const h=a-n,c=l-o,u=n+h/2,f=o+c/2;this._bounds=new as(u,f,h,c)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,s=new Float32Array(8);rs(s,t,qe(ss(),this._rotationT,this._transform)),e.upperLeft=(0,J.UJ)(8*s[0],8*s[1]),e.upperRight=(0,J.UJ)(8*s[2],8*s[3]),e.lowerLeft=(0,J.UJ)(8*s[4],8*s[5]),e.lowerRight=(0,J.UJ)(8*s[6],8*s[7])}_setTextureCoords({x:t,y:e,width:s,height:i}){this._texcoords={upperLeft:(0,J.UJ)(t,e),upperRight:(0,J.UJ)(t+s,e),lowerLeft:(0,J.UJ)(t,e+i),lowerRight:(0,J.UJ)(t+s,e+i)}}}const cs=(t,e)=>({code:0,page:0,sdf:!0,rect:new os.Z(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});class us{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s);for(const e of t)e.setTransform(this._transform)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const e=this._transform;qe(e,je(ss(),t),e);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||"none"===s.decoration||!t.length)return;const i=s.scale,r="underline"===s.decoration?30:20,n=t[0].textureBinding;for(const s of e){const e=s.startX*i,o=s.startY*i,a=(s.width+s.glyphWidthEnd)*i;t.push(new hs(e,o+r*i,cs(a,n),1))}}get boundsT(){const t=this.bounds,e=(0,y.s)((0,ns.c)(),t.x,t.y);if((0,y.t)(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new as(e[0],e[1],s,s)}return new as(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,r=0;for(const n of t)e=Math.min(e,n.xTopLeft),s=Math.min(s,n.yTopLeft),i=Math.max(i,n.xTopLeft+n.width),r=Math.max(r,n.yBottomRight);const n=i-e,o=r-s;return new as(e+n/2,s+o/2,n,o)}_createGlyphTransform(t,e){const s=ls*e.angle,i=ss(),r=(0,ns.c)();return Ke(i,i,(0,y.s)(r,e.xOffset,-e.yOffset)),e.isCIM?Ze(i,i,s):(Ke(i,i,(0,y.s)(r,t.x,t.y)),Ze(i,i,s),Ke(i,i,(0,y.s)(r,-t.x,-t.y))),i}}class fs{constructor(t,e,s,i,r,n){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=i,this.yMin=r,this.yMax=n}}const ms=t=>10===t,_s=t=>32===t;const ps=t=>class extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=p.LW.TEXT,this._aux=(0,J.Jz)(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=(0,h.yw)(t,(t=>function(t,e,s){const i=s.scale,r=new Array,n=function(t,e,s){const i=new Array,r=1/s.scale,n=s.maxLineWidth*r,o=e?t.length-1:0,a=e?-1:t.length,l=e?-1:1;let h=o,c=0,u=0,f=h,m=f,_=0,p=1/0,d=0;for(;h!==a;){const{code:e,metrics:s}=t[h],r=Math.abs(s.top);if(ms(e)||_s(e)||(p=Math.min(p,r),d=Math.max(d,r+s.height)),ms(e))h!==o&&(i.push(new fs(t,f,h-l,c,p,d)),p=1/0,d=0),c=0,f=h+l,m=h+l,u=0;else if(_s(e))m=h+l,u=0,_=s.advance,c+=s.advance;else if(c>n){if(m!==f){const e=m-2*l;c-=_,i.push(new fs(t,f,e,c-u,p,d)),p=1/0,d=0,f=m,c=u}else i.push(new fs(t,f,h-l,c,p,d)),p=1/0,d=0,f=h,m=h,c=0;c+=s.advance,u+=s.advance}else c+=s.advance,u+=s.advance;h+=l}const g=new fs(t,f,h-l,c,p,d);return g.start>=0&&g.end<t.length&&i.push(g),i}(t,e,s),o=function(t,e){let s=0;for(let e=0;e<t.length;e++){const{width:i}=t[e];s=Math.max(i,s)}const i="underline"===e.decoration?4:0,r=t[0].yMin;return{x:0,y:r,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-r,width:s}}(n,s),{vAlign:a,hAlign:l}=s,h=a===H.TR.Baseline?1:0,c=h?0:a-1,u=(1-h)*-o.y+c*(o.height/2)+-26*(h?1:0);for(let e=0;e<n.length;e++){const{start:o,end:a,width:h}=n[e];let c=-1*(l+1)*(h/2)-3;const f=e*s.lineHeight+u-3;n[e].startX=c,n[e].startY=f;for(let e=o;e<=a;e++){const s=t[e];if(ms(s.code))continue;const n=new hs(c+s.metrics.left,f-s.metrics.top,s,i);c+=s.metrics.advance,r.push(n)}}return new us(r,n,s)}(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:A.xm*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM}))):this._shapingInfo=null}_write(t,e,s,i){const r=e.getDisplayId();this._writeGeometry(t,e,r,s,i)}_writeGeometry(t,e,s,i,r){const n=this._shapingInfo;if((0,h.Wi)(n))return;if((0,h.pC)(this._textPlacement)){const o=r??e.readLegacyGeometryForDisplay();return this._writePlacedText(t,s,o,n,i)}const o=r?(0,lt.oB)((0,lt.GH)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!(0,h.Wi)(o)){if(o.isPoint){const[e,i]=o.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||i<0||i>=512))return;return this._writeGlyphs(t,s,{x:e,y:i},n)}o.forEachVertex(((e,i)=>this._writeGlyphs(t,s,{x:e,y:i},n)))}}_writePlacedText(t,e,s,i,r){const n=(0,h.Wg)(this._textPlacement),o=Ye.getPlacement(s,n,(0,B.F2)(1),r.geometryEngine);if(!o)return;let a=o.next();for(;null!=a;){const s=-a.getAngle();i.setRotation(s);const r=a.tx,n=-a.ty;r<0||r>=512||n<0||n>=512||(this._writeGlyphs(t,e,{x:r,y:n},i),i.setRotation(-s)),a=o.next()}}_writeGlyphs(t,e,s,i){const r=q.m2.load(this._materialKey),n=(0,J.UJ)(Math.round(8*s.x),Math.round(8*s.y)),o=this._vertexBoundsScale,a=i.bounds,l=2*Math.max(a.width,a.height);for(const h of i.glyphs)r.textureBinding=h.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(s.x+a.x+this._xOffset,s.y+a.y-this._yOffset,l*o,l*o),this._writeVertices(t,e,n,h),t.recordEnd()}_writeGlyph(t,e,s,i,r){const n=q.m2.load(this._materialKey),o=(0,J.UJ)(Math.round(8*s),Math.round(8*i));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!0);const a=r.bounds,l=this._vertexBoundsScale;t.vertexBounds(s+a.x*l,i+a.y*l,a.width*l,a.height*l),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,s,i){const r=t.vertexCount();this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.upperLeft),t.vertexWrite(i.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.upperRight),t.vertexWrite(i.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.lowerLeft),t.vertexWrite(i.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.lowerRight),t.vertexWrite(i.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,s,i){const r=this._color,n=this._haloColor,o=(0,J.Jz)(0,0,this._referenceSize,this._bitset),a=(0,J.Jz)(0,0,this._size,this._haloSize);t.vertexWrite(s),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}};class ds{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}}class gs{static executeEffects(t,e,s){const i=ft(e);let r=new ds(i);for(const e of t){const t=Xe(e);t&&(r=t.execute(r,e,1.3333333333333333,s))}return r}static next(t){const e=t.next();return function(t){t&&(mt(t),(0,ct.oU)(t)?gt(t.rings):(0,ct.l9)(t)?gt(t.paths):(0,ct.aW)(t)&&dt(t.points))}(e),e}static applyEffects(t,e,s){if(!t)return e;let i=new ds(e);for(const e of t){const t=Xe(e);t&&(i=t.execute(i,e,1,s))}let r,n=null;for(;r=i.next();)n?(0,ct.l9)(n)?(0,ct.l9)(r)&&n.paths.push(...r.paths):(0,ct.oU)(n)&&(0,ct.oU)(r)&&n.rings.push(...r.rings):n=r;return n}}class ys{bindFeature(t,e,s){}write(t,e,s,i){if((0,h.Wi)(this._effects)||0===this._effects?.length)return this._write(t,e,i);const r=gs.executeEffects(this._effects,e.readLegacyGeometryForDisplay(),i.geometryEngine);let n=gs.next(r);for(;n;)this._write(t,e,i,n),n=gs.next(r)}_write(t,e,s,i){}}class xs extends(ps(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p,d,g,y=!1,x,M){super(),this._xOffset=(0,B.F2)(f),this._yOffset=(0,B.F2)(m),this._decoration=h||"none",this._color=r,this._haloColor=n,this._haloSize=Math.min(Math.floor(5*(0,B.F2)((0,B.t_)(s))),127),this._size=Math.min(Math.round((0,B.F2)(e)),127);const b=Math.min(Math.round((0,B.F2)(i||e)),127);this._referenceSize=Math.round(Math.sqrt(256*b)),this._scale=this._size/A.Ex,this._angle=u,this._justify=(0,H.Hd)(o||"center"),this._xAlignD=(0,H.kH)(o||"center"),this._yAlignD=(0,H.b7)(a||"baseline"),this._baseline="baseline"===(a||"baseline"),this._bitset=(l===X.v2.MAP?1:0)|(c?1:0)<<1;const v=q.m2.load(t);v.sdf=!0,this._materialKey=v.data,this._lineWidth=(0,B.F2)(_)||512,this._lineHeight=p||1,this._textPlacement=d,this._effects=g,this._isCIM=y,this._minMaxZoom=(0,J.UJ)(Math.round(x*A.MI),Math.round(M*A.MI))}static fromText(t,e){const s=new xs(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&(0,Y.aH)(t.color)||0,t.haloColor&&(0,Y.aH)(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,X.v2.SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,0,Z),[,i]=n(t.text);return s.bindTextInfo(e,i),s._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,s}static fromCIMText(t,e,s){const i=t.scaleFactor||1,r=t.size*t.sizeRatio*i,[o,a]=st(t.scaleInfo,s),l=new xs(t.materialKey,r,t.outlineSize*t.sizeRatio,t.referenceSize,(0,Y.t2)(t.color),(0,Y.t2)(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*i,t.offsetY*t.sizeRatio*i,512,1,t.markerPlacement,t.effects,!0,o,a),[,h]=n(t.text);return l.bindTextInfo(e,h),l._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,l}}const Ms=l.Z.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),bs=function(t){const e=new Map;return t=>(e.has(t)||e.set(t,(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e})(t)),e.get(t))}(),vs=t=>Math.floor(127*t+127),Ss=t=>Math.floor(10*t),ws=t=>Math.round(t*(254/360));class Ps extends xs{constructor(t,e,s,i){super(t,s.font.size,s.haloSize||0,s.font.size,s.color&&(0,Y.aH)(s.color)||0,s.haloColor&&(0,Y.aH)(s.haloColor)||0,s.horizontalAlignment,s.verticalAlignment,(0,H.NS)(e.labelPlacement)?X.v2.MAP:X.v2.SCREEN,s.font.decoration,!1,s.angle||0,s.xoffset,s.yoffset,s.lineWidth,s.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=p.LW.LABEL,this._allowOverrun=e.allowOverrun??!1,this._repeatLabel=e.repeatLabel??!0,this._labelPosition=e.labelPosition??"curved";const r=function(t,e){const s=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return(0,U.uZ)(s,0,25.5)}(e,i),n=function(t,e){const s=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return(0,U.uZ)(s,0,25.5)}(e,i),o=e.labelPlacement,[a,l]=(0,H.qv)(o);this._xAlignD=a,this._yAlignD=l,this._minZoom=r,this._maxZoom=n,this._refPlacementPadding=(0,B.F2)(s.haloSize)+A.Iw,this._repeatLabelDistance=e.repeatLabelDistance?(0,B.F2)(e.repeatLabelDistance):128;const h=q.Gq.load(t);h.sdf=!0,this._materialKey=h.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new Ps(t.materialKey,t,t.symbol,e)}get _shapedBox(){return(0,h.Wg)(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=(0,H.g)(this._xAlignD),s=(0,H.tf)(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,(0,h.Wi)(t))return void(this._refSymbolAndPlacementOffset=(0,J.Jz)(0,0,vs(e),vs(s)));if("circle"===t.boundsType&&(e||s)){const t=Math.sqrt(e*e+s*s);e/=t,s/=t}const i=Math.max(t.height,t.width),r=4*this._refPlacementPadding;this._refSymbolAndPlacementOffset=(0,J.Jz)(r,i,vs(e),vs(s)),this._referenceSize=i,this._refPlacementDirX=e,this._refPlacementDirY=s,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if((0,h.Wi)(this._shapingInfo))return;const s=this._shapingInfo,i=e.getDisplayId(),r="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(r)switch(this._current={out:t,inId:i,inShaping:s,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(r);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(r);break;default:((t,e="mapview-labeling")=>{Ms.error(new o.Z(e,t))})("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const s=Ss(this._current.zoomLevel);return Ss(t)<=s&&s<=Ss(e)}_placePointLabels(t){const{out:e,inId:s,inShaping:i}=this._current;this._writeGlyphs(e,s,t,i)}_placeLineLabels(t){const e=function(t,e){const s=e;for(let e=0;e<t.length;e++){let i=t[e];const r=[];r.push(i[0]);for(let t=1;t<i.length;t++){let[e,s]=r[t-1];e+=i[t][0],s+=i[t][1],r.push([e,s])}at(r,s);const n=[];n.push(r[0]);for(let t=1;t<r.length;t++){const[e,s]=r[t-1],[i,o]=r[t],a=Math.round(i-e),l=Math.round(o-s);n.push([a,l])}t[e]=n,i=n}return t}(t.paths,this._current.inShaping.bounds.width),s=this._placeSubdivGlyphs.bind(this),i=(this._shapedBox.width+this._repeatLabelDistance)/2;for(const t of e)ot(t,i,s,this._repeatLabel)}_placeSubdivGlyphs(t,e,s,i){const r=bs(e),n=this._shapedBox.width/2,o=Math.sqrt(this._repeatLabelDistance)/2,a=Math.min(s,i-s),l=this._current.inShaping.isMultiline?25:Math.log2(a/(o+n/2)),h=0===e?l:Math.min(r,l),c=Math.max(this._minZoom,this._current.zoomLevel+1-h),u=this._current.zoomLevel-c,f=this._shapedBox.width/2*2**u;this._current.inShaping.isMultiline?0===e&&this._placeStraight(t,c):this._allowOverrun&&u<0?this._placeStraightAlong(t,this._minZoom):"parallel"===this._labelPosition?this._placeStraightAlong(t,c):"curved"===this._labelPosition&&this._placeCurved(t,c,f)}_placeStraight(t,e){const{out:s,inId:i,inShaping:r}=this._current,n=Math.ceil(t.angle*(180/Math.PI)%360),o=Math.ceil((t.angle*(180/Math.PI)+180)%360);this._outLineLabelAngle=ws(n),this._writeGlyphs(s,i,t,r,e),this._outLineLabelAngle=ws(o),this._writeGlyphs(s,i,t,r,e)}_placeCurved(t,e,s){const{out:i,inId:r}=this._current;i.metricStart(r,e,t.x,t.y,0,0,0,0);const n=t.clone(),o=t.angle*(180/Math.PI)%360,a=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=ws(o),this._placeFirst(n,e,1),this._placeBack(t,n,e,s,1),this._placeForward(t,n,e,s,1),this._outLineLabelAngle=ws(a),this._placeFirst(n,e,0),this._placeBack(t,n,e,s,0),this._placeForward(t,n,e,s,0),i.metricEnd()}_placeStraightAlong(t,e){const{out:s,inId:i}=this._current;s.metricStart(i,e,t.x,t.y,0,0,0,0);const r=t.clone(),n=t.angle*(180/Math.PI)%360,o=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=ws(n),this._placeFirst(r,e,1,!0),this._outLineLabelAngle=ws(o),this._placeFirst(r,e,0,!0),s.metricEnd()}_placeBack(t,e,s,i,r){const n=t.clone();let o=t.backwardLength+0;for(;n.prev()&&!(o>=i);)this._placeOnSegment(n,e,o,s,-1,r),o+=n.length+0}_placeForward(t,e,s,i,r){const n=t.clone();let o=t.remainingLength+0;for(;n.next()&&!(o>=i);)this._placeOnSegment(n,e,o,s,1,r),o+=n.length+0}_placeFirst(t,e,s,i=!1){const r=t,n=this._current.inShaping,o=n.glyphs,a=this._current.zoomLevel,{out:l,inId:h}=this._current;for(const c of o){const o=c.x>n.bounds.x?s:1-s,u=o*t.remainingLength+(1-o)*t.backwardLength,f=Math.abs(c.x+c.width/2-n.bounds.x),m=Math.max(0,a+Math.log2(f/(u+0))),_=Math.max(e,i?0:m);if(c.maxZoom=25,c.angle=t.angle+(1-s)*Math.PI,c.minZoom=_,this._writeGlyph(l,h,r.x,r.y,c),s&&this._isVisible(c.minZoom,c.maxZoom)){const t=c.bounds;l.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,s,i,r,n){const o=this._current.inShaping.glyphs,{out:a,inId:l}=this._current,h=this._current.inShaping,c=this._current.zoomLevel,u=t.dx/t.length,f=t.dy/t.length,m={x:t.x+s*-r*u,y:t.y+s*-r*f};for(const u of o){const o=u.x>h.bounds.x?n:1-n;if(!(o&&1===r||!o&&-1===r))continue;const f=Math.abs(u.x+u.width/2-h.bounds.x),_=Math.max(0,c+Math.log2(f/s)-.1),p=Math.max(i,c+Math.log2(f/(s+t.length+0)));if(0!==_&&(u.angle=t.angle+(1-n)*Math.PI,u.minZoom=p,u.maxZoom=_,this._writeGlyph(a,l,m.x,m.y,u),n&&this._isVisible(u.minZoom,u.maxZoom))){const s=u.bounds,i=t.x-e.x,r=t.y-e.y;a.metricBoxWrite(s.center[0]+i,s.center[1]+r,s.width,s.height)}}}_writeGlyphs(t,e,s,i,r=this._minZoom){if(s.x<0||s.x>=512||s.y<0||s.y>=512)return;const n=s.x+this._refOffsetX,o=s.y-this._refOffsetY;for(const s of i.glyphs)s.minZoom=r,s.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,o,s);const a=this._refPlacementDirX,l=this._refPlacementDirY,h=i.boundsT;t.metricStart(e,r,n,o,a,l,this._referenceSize,this._materialKey),t.metricBoxWrite(h.center[0],h.center[1],h.width,h.height),t.metricEnd()}_writeVertexCommon(t,e,s,i){const r=this._color,n=this._haloColor,o=(0,J.Jz)(0,0,this._size,this._haloSize),a=Math.max(i.minZoom,this._minZoom),l=Math.min(i.maxZoom,this._maxZoom),h=(0,J.Jz)(Ss(a),Ss(l),this._outLineLabelAngle,0);t.vertexWrite(s),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(h)}}const Cs=3.14159265359/180,Ls=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=p.LW.MARKER}_write(t,e,s,i){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,s,i),t.recordEnd()}_writeGeometry(t,e,s,i,r){if((0,h.pC)(this._markerPlacement))return this._writePlacedMarkers(t,e,i,r);if(!r&&"esriGeometryPoint"===e.geometryType){const i=e.getX(),r=e.getY();if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(i<0||i>=513||r<0||r>=513))return;return this._writeVertices(t,s,this._getPos(i,r),i,r)}const n=r?(0,lt.oB)((0,lt.GH)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!(0,h.Wi)(n)){if(n.isPoint){const[e,i]=n.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||i<0||i>=512))return;return this._writeVertices(t,s,this._getPos(e,i),e,i)}n.forEachVertex(((e,i)=>{const r=2*A.I_;e<-r||e>=r||i<-r||i>=r||this._writeVertices(t,s,this._getPos(e,i),e,i)}))}}_writePlacedMarkers(t,e,s,i){const r=i??e.readLegacyGeometryForDisplay(),n=Ye.getPlacement(r,(0,h.Wg)(this._markerPlacement),(0,B.F2)(1),s.geometryEngine);if(!n)return;const o=e.getDisplayId(),a=(0,ns.c)(),l=ss();let c=n.next();for(;null!=c;){const e=c.tx,s=-c.ty;e>=-128&&e<=640&&s>=-128&&s<=640&&(this._applyTransformation(l,a,-c.getAngle()/Cs),this._writeVertices(t,o,this._getPos(e,s),e,s)),c=n.next()}}_writeVertices(t,e,s,i,r){const n=q.mE.load(this._materialKey);return n.symbologyType===p.mD.HEATMAP?this._writeHeatmapVertices(t,e,s):this._writeMarkerVertices(t,e,n,s,i,r)}_writeMarkerVertices(t,e,s,i,r,n){const o=s.vvRotation,a=t.vertexCount();let l=this._computedWidth*this._vertexBoundsScaleX,h=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const t=Math.max(l,h);l=t,h=t}if(o){const t=Math.max(this.xOffset,this.yOffset);l+=t,h+=t}t.vertexBounds(r+this.xOffset,n-this.yOffset,l,h),t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,a)}_writeHeatmapVertices(t,e,s){const i=t.vertexCount();t.vertexWrite(s),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,i)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,s=0){$e(t,(0,ns.f)(this.xOffset,-this.yOffset)),this.angle+s!==0&&Ze(t,t,Cs*(this.angle+s));const i=this._computedWidth,r=this._computedHeight,n=-(.5+this._anchorX)*i,o=-(.5-this._anchorY)*r;(0,y.s)(e,n,o),(0,y.t)(e,e,t),this._offsetUpperLeft=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],(0,y.s)(e,n+i,o),(0,y.t)(e,e,t),this._offsetUpperRight=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],(0,y.s)(e,n,o+r),(0,y.t)(e,e,t),this._offsetBottomLeft=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],(0,y.s)(e,n+i,o+r),(0,y.t)(e,e,t),this._offsetBottomRight=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return(0,J.UJ)(Math.round(8*t),Math.round(8*e))}};class Is extends(Ls(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,d,g,y,x,M,b,v,S){super(),this.angle=i,this.height=o,this.width=n,this.xOffset=e*x,this.yOffset=s*x,this._markerPlacement=M,this._effects=b,this._anchorX=d,this._anchorY=g,this._minMaxZoom=(0,J.UJ)(Math.round(v*A.MI),Math.round(S*A.MI));const w=(m===X.v2.MAP?A.Tz:A.CQ)|(c?A.Uh:0)|(f?A.oK:0)|(u?A.e0:0),P=_&&_.sdf,C=q.mE.load(t);C.sdf=P,C.pattern=!0,C.textureBinding=_.textureBinding,this._materialKey=C.data,this._fillColor=r,this._outlineColor=l,this._sizeOutlineWidth=(0,J.Jz)(Math.round(Math.min(Math.sqrt(128*n),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*h),255)),Math.round(Math.min(Math.sqrt(128*a),255)));const L=_.rect.x+A.fL,I=_.rect.y+A.fL,k=L+_.width,T=I+_.height;this._offsets.xUpperLeft=L,this._offsets.yUpperLeft=I,this._offsets.xUpperRight=k,this._offsets.yUpperRight=I,this._offsets.xBottomLeft=L,this._offsets.yBottomLeft=T,this._offsets.xBottomRight=k,this._offsets.yBottomRight=T,C.symbologyType===p.mD.PIE_CHART?(this._texUpperLeft=(0,J.UJ)(0,1),this._texUpperRight=(0,J.UJ)(1,1),this._texBottomLeft=(0,J.UJ)(0,0),this._texBottomRight=(0,J.UJ)(1,0)):(this._texUpperLeft=(0,J.UJ)(L,I),this._texUpperRight=(0,J.UJ)(k,I),this._texBottomLeft=(0,J.UJ)(L,T),this._texBottomRight=(0,J.UJ)(k,T)),n*=y,o*=y,n*=x,o*=x;const z=Math.round(64*y);this._bitestAndDistRatio=(0,J.UJ)(w,z),this._computedWidth=n,this._computedHeight=o;const E=(0,ns.c)(),F=ss();this._applyTransformation(F,E)}static fromCIMMarker(t,e,s){const i=e&&e.width||1,r=e&&e.height||1,n=t.size,o=i/r*t.scaleX,a=t.scaleSymbolsProportionally&&t.frameHeight?n/t.frameHeight:1;let l=(0,Y.t2)(t.color);const c=(0,Y.t2)(t.outlineColor),u=(0,B.F2)(n),f=u*o,m=(0,B.F2)(t.offsetX||0),_=(0,B.F2)(t.offsetY||0),p=(0,B.F2)(t.outlineWidth||0)*a,d=t.alignment||X.v2.SCREEN,g=(0,B.F2)(t.referenceSize),[y,x]=st(t.scaleInfo,s);e.sdf||0!==l||(l=-1);let M=t.rotation||0;t.rotateClockwise||(M=-M);let b=0,v=0;const S=t.anchorPoint;S&&(t.isAbsoluteAnchorPoint?n&&(b=S.x/(n*o),v=S.y/n):(b=S.x,v=S.y));const w=new Is(t.materialKey,m,_,M,l,f,u,g,c,p,t.colorLocked,t.scaleSymbolsProportionally,!1,d,e,b,v,t.sizeRatio,(0,h.Pt)(t.scaleFactor,1),t.markerPlacement,t.effects,y,x);return w._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/f:1,w._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/u:1,w}static fromPictureMarker(t,e){const s=Math.round((0,B.F2)(t.width)),i=Math.round((0,B.F2)(t.height)),r=A.ru,n=Math.round((0,B.F2)(t.xoffset||0)),o=Math.round((0,B.F2)(t.yoffset||0)),a=new Is(t.materialKey,n,o,t.angle,r,s,i,i,0,0,!1,!1,!1,X.v2.SCREEN,e,0,0,1,1,null,null,0,Z);return a._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,a._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,a}static fromSimpleMarker(t,e){const s=(0,Y.aH)(t.color),i=Math.round((0,B.F2)(t.size)),r=i,n=Math.round((0,B.F2)(t.xoffset||0)),o=Math.round((0,B.F2)(t.yoffset||0)),a=t.style,l=t.outline,h=0|(l&&l.color&&(0,Y.aH)(l.color)),c=0|(l&&l.width&&Math.round((0,B.F2)(l.width))),u=new Is(t.materialKey,n,o,t.angle,s,i,r,r,h,c,!1,!1,"esriSMSCross"===a||"esriSMSX"===a,X.v2.SCREEN,e,0,0,126/64,1,null,null,0,Z);return u.boundsType="esriSMSCircle"===a?"circle":"square",u._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,u._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,u}static fromLineSymbolMarker(t,e){const s=(0,Y.aH)(t.color),i=Math.round((0,B.F2)(6*t.lineWidth)),r=i,n="cross"===t.style||"x"===t.style;let o;switch(t.placement){case"begin-end":o=X.Tx.Both;break;case"begin":o=X.Tx.JustBegin;break;case"end":o=X.Tx.JustEnd;break;default:o=X.Tx.None}const a={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:o,offsetAlongLine:0},l=new Is(t.materialKey,0,0,0,s,i,r,r/6,s,n?Math.round((0,B.F2)(t.lineWidth)):0,!1,!1,n,X.v2.MAP,e,0,0,126/64,1,a,null,0,Z);return l.boundsType="circle"===t.style?"circle":"square",l}}var ks=s(58333),Ts=s(55987),zs=(s(95401),s(5428)),As=s(35362),Es=s(31294);function Fs(t,e,s,i,r,n,o){ri=0;const a=(i-s)*n,l=r&&r.length,h=l?(r[0]-s)*n:a;let c,u,f,m,_,p=Rs(e,s,0,0,h,n,!0);if(p&&p.next!==p.prev){if(l&&(p=function(t,e,s,i,r,n){const o=new Array;for(let r=0,a=i.length;r<a;r++){const l=Rs(t,e,0,i[r]*n,r<a-1?i[r+1]*n:s*n,n,!1);l===l.next&&(l.steiner=!0),o.push(Us(l))}o.sort(js);for(const t of o)r=Bs(t,r);return r}(e,s,i,r,p,n)),a>80*n){c=f=e[0+s*n],u=m=e[1+s*n];for(let t=n;t<h;t+=n){const i=e[t+s*n],r=e[t+1+s*n];c=Math.min(c,i),u=Math.min(u,r),f=Math.max(f,i),m=Math.max(m,r)}_=Math.max(f-c,m-u),_=0!==_?1/_:0}Os(p,t,n,c,u,_,o,0)}}function Rs(t,e,s,i,r,n,o){let a;if(o===function(t,e,s,i,r,n){let o=0;for(let s=i,a=r-n;s<r;s+=n)o+=(t[a+e*n]-t[s+e*n])*(t[s+1+e*n]+t[a+1+e*n]),a=s;return o}(t,e,0,i,r,n)>0)for(let s=i;s<r;s+=n)a=Ds(s+e*n,t[s+e*n],t[s+1+e*n],a);else for(let s=r-n;s>=i;s-=n)a=Ds(s+e*n,t[s+e*n],t[s+1+e*n],a);return a&&Ks(a,a.next)&&(Gs(a),a=a.next),a}function Ns(t,e=t){if(!t)return t;let s,i=t;do{if(s=!1,i.steiner||!Ks(i,i.next)&&0!==Hs(i.prev,i,i.next))i=i.next;else{if(Gs(i),i=e=i.prev,i===i.next)break;s=!0}}while(s||i!==e);return e}function Os(t,e,s,i,r,n,o,a){if(!t)return;!a&&n&&(t=Xs(t,i,r,n));let l=t;for(;t.prev!==t.next;){const h=t.prev,c=t.next;if(n?Vs(t,i,r,n):Ws(t))e.push(h.index/s+o),e.push(t.index/s+o),e.push(c.index/s+o),Gs(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?Os(t=$s(t,e,s,o),e,s,i,r,n,o,2):2===a&&Qs(t,e,s,i,r,n,o):Os(Ns(t),e,s,i,r,n,o,1);break}}}function Ws(t){const e=t.prev,s=t,i=t.next;if(Hs(e,s,i)>=0)return!1;let r=t.next.next;const n=r;let o=0;for(;r!==t.prev&&(0===o||r!==n);){if(o++,Js(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&Hs(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Vs(t,e,s,i){const r=t.prev,n=t,o=t.next;if(Hs(r,n,o)>=0)return!1;const a=r.x<n.x?r.x<o.x?r.x:o.x:n.x<o.x?n.x:o.x,l=r.y<n.y?r.y<o.y?r.y:o.y:n.y<o.y?n.y:o.y,h=r.x>n.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,c=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=Zs(a,l,e,s,i),f=Zs(h,c,e,s,i);let m=t.prevZ,_=t.nextZ;for(;m&&m.z>=u&&_&&_.z<=f;){if(m!==t.prev&&m!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Hs(m.prev,m,m.next)>=0)return!1;if(m=m.prevZ,_!==t.prev&&_!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&Hs(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;m&&m.z>=u;){if(m!==t.prev&&m!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Hs(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;_&&_.z<=f;){if(_!==t.prev&&_!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&Hs(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Ds(t,e,s,i){const r=si.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Gs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Us(t){let e=t,s=t;do{(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next}while(e!==t);return s}function Bs(t,e){const s=function(t,e){let s=e;const i=t.x,r=t.y;let n,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){const t=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=i&&t>o){if(o=t,t===i){if(r===s.y)return s;if(r===s.next.y)return s.next}n=s.x<s.next.x?s:s.next}}s=s.next}while(s!==e);if(!n)return null;if(i===o)return n.prev;const a=n,l=n.x,h=n.y;let c,u=1/0;for(s=n.next;s!==a;)i>=s.x&&s.x>=l&&i!==s.x&&Js(r<h?i:o,r,l,h,r<h?o:i,r,s.x,s.y)&&(c=Math.abs(r-s.y)/(i-s.x),(c<u||c===u&&s.x>n.x)&&qs(s,t)&&(n=s,u=c)),s=s.next;return n}(t,e);if(!s)return e;const i=ei(s,t);return Ns(i,i.next),Ns(s,s.next)}function Xs(t,e,s,i){for(let r;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=Zs(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Xs(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,function(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let n=0;for(;r;){n++,i=r;let o=0;for(;o<s&&i;o++)i=i.nextZ;let a=s;for(;o>0||a>0&&i;){let s;0===o?(s=i,i=i.nextZ,a--):0!==a&&i?r.z<=i.z?(s=r,r=r.nextZ,o--):(s=i,i=i.nextZ,a--):(s=r,r=r.nextZ,o--),e?e.nextZ=s:t=s,s.prevZ=e,e=s}r=i}if(e.nextZ=null,s*=2,n<2)return t}}(t)}function Hs(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ys(t,e,s,i){return!!(Ks(t,e)&&Ks(s,i)||Ks(t,i)&&Ks(s,e))||Hs(t,e,s)>0!=Hs(t,e,i)>0&&Hs(s,i,t)>0!=Hs(s,i,e)>0}function Js(t,e,s,i,r,n,o,a){return(r-o)*(e-a)-(t-o)*(n-a)>=0&&(t-o)*(i-a)-(s-o)*(e-a)>=0&&(s-o)*(n-a)-(r-o)*(i-a)>=0}function qs(t,e){return Hs(t.prev,t,t.next)<0?Hs(t,e,t.next)>=0&&Hs(t,t.prev,e)>=0:Hs(t,e,t.prev)<0||Hs(t,t.next,e)<0}function Zs(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ks(t,e){return t.x===e.x&&t.y===e.y}function js(t,e){return t.x-e.x}function $s(t,e,s,i){let r=t;do{const n=r.prev,o=r.next.next;!Ks(n,o)&&Ys(n,r,r.next,o)&&qs(n,o)&&qs(o,n)&&(e.push(n.index/s+i),e.push(r.index/s+i),e.push(o.index/s+i),Gs(r),Gs(r.next),r=t=o),r=r.next}while(r!==t);return r}function Qs(t,e,s,i,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.index!==t.index&&ti(a,t)){let l=ei(a,t);return a=Ns(a,a.next),l=Ns(l,l.next),Os(a,e,s,i,r,n,o,0),void Os(l,e,s,i,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function ti(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!function(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ys(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}(t,e)&&qs(t,e)&&qs(e,t)&&function(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next}while(s!==t);return i}(t,e)}function ei(t,e){const s=si.create(t.index,t.x,t.y),i=si.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}class si{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,s){const i=ri<ii.length?ii[ri++]:new si;return i.index=t,i.x=e,i.y=s,i.prev=null,i.next=null,i.z=null,i.prevZ=null,i.nextZ=null,i.steiner=!1,i}}const ii=new Array;let ri=0;for(let t=0;t<8096;t++)ii.push(new si);const ni=new Es.b(0,0,0,1,0),oi=new Es.b(0,0,0,1,0);function ai(t,e,s){let i=0;for(let r=1;r<s;r++){const s=t[2*(e+r-1)],n=t[2*(e+r-1)+1];i+=(t[2*(e+r)]-s)*(t[2*(e+r)+1]+n)}return i}function li(t,e,s,i,r){let n=0;for(let o=s;o<i;o+=3){const s=2*(t[o]-r),i=2*(t[o+1]-r),a=2*(t[o+2]-r);n+=Math.abs((e[s]-e[a])*(e[i+1]-e[s+1])-(e[s]-e[i])*(e[a+1]-e[s+1]))}return n}ni.setExtent(A.I_),oi.setExtent(A.I_);var hi=s(67327);const ci=16,ui=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=p.LW.LINE}writeGeometry(t,e,s,i){this._writeGeometry(t,e,s,i)}_initializeTessellator(t){const e=q.a.load(this._materialKey),s=q.dk.load(this._materialKey),i=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,n=this.tessellationProperties._halfWidth<A.tQ&&!t&&!r;this.tessellationProperties.minMaxZoom=this._minMaxZoom,i.wrapDistance=65535,i.textured=this._isDashed||this._hasPattern,i.offset=this.tessellationProperties.offset,i.halfWidth=this.tessellationProperties._halfWidth;const o=n?0:1,a=(0,q.CA)(s)?mi:fi;this._lineTessellator=new hi.z(a(this.tessellationProperties,o,o),_i(this.tessellationProperties),n)}_write(t,e,s,i){const r="esriGeometryPoint"===e.geometryType;t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,i,r),t.recordEnd()}_writeGeometry(t,e,s,i){const r=s??e.readLegacyGeometryForDisplay(),n=this._getLines(r,i);(0,h.Wi)(n)||this._writeVertices(t,e,n)}_getLines(t,e){if((0,h.Wi)(t))return null;const s=t.paths||t.rings;return(0,h.Wi)(s)?null:function(t,e){oi.setPixelMargin(e);const s=oi,i=-e,r=A.I_+e;let n=[],o=!1,a=0;for(;a<t.length;){const e=[],l=t[a];if(!l)return null;s.reset(As.V.LineString);let[h,c]=l[0];if(o)s.moveTo(h,c);else{if(h<i||h>r||c<i||c>r){o=!0;continue}e.push({x:h,y:c})}let u=!1;const f=l.length;for(let t=1;t<f;++t)if(h+=l[t][0],c+=l[t][1],o)s.lineTo(h,c);else{if(h<i||h>r||c<i||c>r){u=!0;break}e.push({x:h,y:c})}if(u)o=!0;else{if(o){const t=s.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});a++,o=!1}}return n=n.filter((t=>t.line.length>1)),0===n.length?null:n}(s,e?256:16)}_writeVertices(t,e,s){const i=e.getDisplayId(),r=t.vertexCount(),n=this.tessellationProperties,o=this._tessellationOptions;n.out=t,n.id=i,n.indexCount=0,n.vertexCount=0,n.offset=r,o.capType=this._capType,o.joinType=this._joinType;const a=q.dk.load(this._materialKey);this.tessellationProperties.key=(0,q.CA)(a)?a:q.a.load(this._materialKey);for(const{line:t,start:e}of s)o.initialDistance=e%65535,this._lineTessellator.tessellate(t,o)}},fi=(t,e,s)=>(i,r,n,o,a,l,h,c,u,f,m)=>{const _=(0,J.UJ)(m,Math.ceil(ci*t._halfWidth)),p=(0,J.Jz)(Math.round(ci*h),Math.round(ci*c),Math.round(ci*u),Math.round(ci*f)),d=(0,J.Jz)(ci*a,ci*l,0,t._bitset),g=t.out;return g.vertexBounds(i,r,e,s),g.vertexWrite((0,J.UJ)(8*i,8*r)),g.vertexWrite(t.id),g.vertexWrite(t._fillColor),g.vertexWrite(p),g.vertexWrite(_),g.vertexWrite(t._tl),g.vertexWrite(t._br),g.vertexWrite(d),g.vertexWrite((0,J.UJ)(Math.ceil(ci*t._halfReferenceWidth),0)),g.vertexWrite(t.minMaxZoom),g.vertexEnd(),t.offset+t.vertexCount++},mi=(t,e,s)=>(i,r,n,o,a,l,h,c,u,f,m)=>{const _=(0,J.UJ)(ci*t._halfWidth,ci*t._halfReferenceWidth),p=(0,J.Jz)(ci*h+128,ci*c+128,ci*u+128,ci*f+128),d=t.out,g=t._bitset<<24|t.id;d.vertexBounds(i,r,e,s),d.vertexWrite((0,J.UJ)(8*i,8*r)),d.vertexWrite(g),d.vertexWrite(t._fillColor);const y=(0,q.Xp)(t.key);return y||(d.vertexWrite(0),d.vertexWrite(0)),d.vertexWrite(0),d.vertexWrite(_),d.vertexWrite(p),y||d.vertexWrite(t.minMaxZoom),d.vertexEnd(),t.offset+t.vertexCount++},_i=t=>(e,s,i)=>{const r=t.out;r.indexWrite(e),r.indexWrite(s),r.indexWrite(i),t.indexCount+=3};class pi extends(ui(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p,d,g,y,x){super();const M=q.a.load(t);e&&(M.sdf=e.sdf,M.pattern=!0,M.textureBinding=e.textureBinding),this._capType=i,this._joinType=r,this._miterLimitCosine=et(n),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=a,this.tessellationProperties._br=l,this._hasPattern=h,this._isDashed=c,this._zOrder=d,this._effects=g,this._minMaxZoom=(0,J.UJ)(Math.round(y*A.MI),Math.round(x*A.MI)),this._materialKey=M.data;const b=(f?A.Uh:0)|(m?A.SD:0)|(u?A._6:0)|(_?A.Iv:0);this.tessellationProperties._bitset=b,this.tessellationProperties._halfWidth=.5*s,this.tessellationProperties._halfReferenceWidth=.5*p,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,s){const i=t.color,r=t.scaleFactor||1,n=!!t.dashTemplate;let o=t.cap;n&&o===X.RL.ROUND&&(o=X.RL.SQUARE);const a=t.join,l=(0,B.F2)(t.width)*r,h=(0,B.F2)(t.referenceWidth),c=(0,B.F2)(t.miterLimit),u=i&&(0,Y.t2)(i)||0,[f,m]=st(t.scaleInfo,s);if(!e)return new pi(t.materialKey,e,l,o,a,c,u,0,0,!1,n,t.scaleDash,t.colorLocked,!1,t.sampleAlphaOnly,h,t.zOrder,t.effects,f,m);const{rect:_,width:p,height:d}=e,g=_.x+A.fL,y=_.y+A.fL,x=g+p,M=y+d,b=(0,J.UJ)(g,y),v=(0,J.UJ)(x,M);return new pi(t.materialKey,e,l,o,a,c,u,b,v,!0,n,t.scaleDash,t.colorLocked,!1,t.sampleAlphaOnly,h,t.zOrder,t.effects,f,m)}static fromFillOutline(t){const e=q.dk.load(t.materialKey);return(0,q.CA)(e)&&t.outline&&"esriSLSSolid"===t.outline?.style?pi.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,s=!1){const{color:i}=t,r="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,n=(0,E.ws)(t.cap||"round"),o=(0,E.xV)(t.join||"round");let a=i&&"esriSLSNull"!==t.style&&(0,Y.aH)(i)||0;"esriSLSNull"===t.style&&(a=0);const l=(0,B.F2)(t.width),h=t.miterLimit;if(!e)return new pi(t.materialKey,e,l,n,o,h,a,0,0,!1,r,!0,!1,s,!1,l,0,null,0,Z);const{rect:c,width:u,height:f}=e,m=c.x+A.fL,_=c.y+A.fL,p=m+u,d=_+f,g=(0,J.UJ)(m,_),y=(0,J.UJ)(p,d);return new pi(t.materialKey,e,l,n,o,h,a,g,y,!0,r,!0,!1,s,!1,l,0,null,0,Z)}static fromPictureLineSymbol(t,e,s,i){return l.Z.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}}const di=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=p.LW.FILL}_maybeAddLineTemplate(t){this._lineTemplate=pi.fromFillOutline(t)}_write(t,e,s,i){const r="esriGeometryPoint"===e.geometryType,n=q.dk.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,n,i,r),(0,q.CA)(n)&&(0,h.pC)(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,i,r),t.recordEnd()}_writeGeometry(t,e,s,i,r){const n=this._getGeometry(e,i,r);if((0,h.Wi)(n))return;const o=[];if(!(n.maxLength>100)&&!this.forceLibtess&&function(t,e){const{coords:s,lengths:i,hasIndeterminateRingOrder:r}=e,n=t;if(r)return!1;let o=0;for(let t=0;t<i.length;){let e=t,r=i[t],a=ai(s,o,r);const l=[];for(;++e<i.length;){const t=i[e],n=ai(s,o+r,t);if(!(n>0))break;a+=n,l.push(o+r),r+=t}const h=n.length;Fs(n,s,o,o+r,l,2,0);const c=li(n,s,h,n.length,0),u=Math.abs(a);if(Math.abs((c-u)/Math.max(1e-7,u))>1e-5)return n.length=0,!1;t=e,o+=r}return!0}(o,n))return void(o.length&&this._writeVertices(t,e,n.coords,n.lengths,s,o));const a=function(t){const{coords:e,lengths:s}=t,{buffer:i}=(0,G.b)(e,s);return i}(n);this._writeVertices(t,e,a,[a.length/2],s)}_writeVertex(t,e,s,i,r,n){const o=(0,J.UJ)(1*i,1*r);if(t.vertexBounds(i,r,0,0),t.vertexWrite(o),t.vertexWrite(e),s.symbologyType===p.mD.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(n.readGeometryArea()));else{t.vertexWrite(this.fillColor);const e=(0,q.Xp)(s);e||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),e||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,s,i,r,n){const o=e.getDisplayId(),a=this._bitset<<24|o,l=i.reduce(((t,e)=>t+e)),h=(0,E.$_)(r.geometryType,r.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(h*l);let u=0;if(n)for(const i of n){const n=s[2*i],o=s[2*i+1];this._writeVertex(t,a,r,n,o,e),u++}else for(let i=0;i<s.length;i+=2){const n=Math.round(s[i]),o=Math.round(s[i+1]);this._writeVertex(t,a,r,n,o,e),u++}t.indexEnsureSize(u);for(let e=0;e<u;e++)t.indexWrite(e+c)}_getGeometry(t,e,s){const i=e?(0,lt.oB)((0,lt.GH)(e),2):t.readGeometryForDisplay();return i?function(t,e){if((0,h.Wi)(t))return null;if(!function(t,e,s){let i=0;for(let e=0;e<t.lengths.length;e++){const r=t.lengths[e];for(let e=0;e<r;e++){const r=t.coords[2*(e+i)],n=t.coords[2*(e+i)+1];if(r<-128||r>s||n<-128||n>s)return!0}i+=r}return!1}(t,0,A.I_+128))return t;ni.setPixelMargin(e),ni.reset(As.V.Polygon);let s=0;for(let e=0;e<t.lengths.length;e++){const i=t.lengths[e];let r=t.coords[2*(0+s)],n=t.coords[2*(0+s)+1];ni.moveTo(r,n);for(let e=1;e<i;e++)r=t.coords[2*(e+s)],n=t.coords[2*(e+s)+1],ni.lineTo(r,n);ni.close(),s+=i}const i=ni.result(!1);if(!i)return null;const r=[],n=[];for(const t of i){let e=0;for(const s of t)n.push(s.x),n.push(s.y),e++;r.push(e)}return new zs.Z(r,n)}(i,s?256:8):null}};var gi=s(22303);function yi(t){if(!t)return"arial-unicode-ms";const e=t.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}s(68773),new Map;var xi=s(19153),Mi=s(59266),bi=s(71143);class vi{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,r=this._rasterizationCanvas;r.width=s,r.height=i;const n=r.getContext("2d");n.drawImage(t,0,0,s,i);const o=n.getImageData(0,0,s,i).data;if(e)for(const t of e)if(t&&t.oldColor&&4===t.oldColor.length&&t.newColor&&4===t.newColor.length){const[e,s,i,r]=t.oldColor,[n,a,l,h]=t.newColor;if(e===n&&s===a&&i===l&&r===h)continue;for(let t=0;t<o.length;t+=4)e===o[t]&&s===o[t+1]&&i===o[t+2]&&r===o[t+3]&&(o[t]=n,o[t+1]=a,o[t+2]=l,o[t+3]=h)}const a=new ImageData(o,s,i);return n.putImageData(a,0,0),r}tintImageData(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,r=this._rasterizationCanvas;r.width=s,r.height=i;const n=r.getContext("2d");n.drawImage(t,0,0,s,i);const o=n.getImageData(0,0,s,i),a=new Uint8Array(o.data),l=new gi.Z(e),h=[l.r/255,l.g/255,l.b/255,l.a];for(let t=0;t<a.length;t+=4)a[t+0]*=h[0],a[t+1]*=h[1],a[t+2]*=h[2],a[t+3]*=h[3];const c=new ImageData(new Uint8ClampedArray(a.buffer),s,i);return n.putImageData(c,0,0),r}}function Si(t){const e=t.getFrame(0);if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)return e;const s=document.createElement("canvas");s.width=t.width,s.height=t.height;const i=s.getContext("2d");return e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0),s}class wi{constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}}class Pi{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(i,e),{decoration:n,weight:o}=e.font;this._lineThroughWidthOffset=n&&"line-through"===n?.1*this._lineHeight:0;const a=this._lineHeight*this._textLines.length;s.width=r+2*this._lineThroughWidthOffset,s.height=a,this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=e.halo.size*e.pixelRatio,this._renderedWidth=r*e.pixelRatio,this._renderedHeight=a*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const l=e.color??[0,0,0,0],h=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=function(t){return`rgba(${t.slice(0,3).toString()},${t[3]})`}(l),this._haloStyle=function(t){return`rgb(${t.slice(0,3).toString()})`}(h);const c=this._renderedLineHeight,u=this._renderedHaloSize;i.save(),i.clearRect(0,0,s.width,s.height),this._setFontProperties(i,e);const f=function(t,e){return"center"===t?.5*e:"right"===t?e:0}(i.textAlign,this._renderedWidth)+u,m=u,_=u>0;let p=this._lineThroughWidthOffset,d=0;_&&this._renderHalo(i,f,m,p,d,e),d+=m,p+=f;for(const t of this._textLines)_?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(t,p,d),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(t,p,d)):(i.fillStyle=this._fillStyle,i.fillText(t,p,d)),n&&"none"!==n&&this._renderDecoration(i,p,d,n,o),d+=c;i.restore();const g=this._renderedWidth+2*this._lineThroughWidthOffset,y=this._renderedHeight,x=i.getImageData(0,0,g,y),M=new Uint8Array(x.data);if(e.premultiplyColors){let t;for(let e=0;e<M.length;e+=4)t=M[e+3]/255,M[e]=M[e]*t,M[e+1]=M[e+1]*t,M[e+2]=M[e+2]*t}let b,v;switch(e.horizontalAlignment){case"left":b=-.5;break;case"right":b=.5;break;default:b=0}switch(e.verticalAlignment){case"bottom":v=-.5;break;case"top":v=.5;break;default:v=0}return{size:[g,y],image:new Uint32Array(M.buffer),sdf:!1,simplePattern:!1,anchorX:b,anchorY:v,canvas:s}}_renderHalo(t,e,s,i,r,n){const o=this._renderedWidth,a=this._renderedHeight;this._haloRasterizationCanvas||(this._haloRasterizationCanvas=document.createElement("canvas")),this._haloRasterizationCanvas.width=o,this._haloRasterizationCanvas.height=a;const l=this._haloRasterizationCanvas,h=l.getContext("2d");h.clearRect(0,0,o,a),this._setFontProperties(h,n);const{decoration:c,weight:u}=n.font;h.fillStyle=this._haloStyle,h.strokeStyle=this._haloStyle,h.lineJoin="round",this._renderHaloNative(h,e,s,c,u),t.globalAlpha=this._parameters.halo.color[3],t.drawImage(l,0,0,o,a,i,r,o,a),t.globalAlpha=1}_renderHaloNative(t,e,s,i,r){const n=this._renderedLineHeight,o=this._renderedHaloSize;for(const a of this._textLines){const l=2*o,h=5,c=.1;for(let n=0;n<h;n++){const o=(1-(h-1)*c+n*c)*l;t.lineWidth=o,t.strokeText(a,e,s),i&&"none"!==i&&this._renderDecoration(t,e,s,i,r,o)}s+=n}}_setFontProperties(t,e){const s=Math.max(e.size,.5),i=e.font,r=`${i.style} ${i.weight} ${(0,B.F2)(s*e.pixelRatio).toFixed(1)}px ${i.family}, sans-serif`;let n;switch(t.font=r,t.textBaseline="top",e.horizontalAlignment){case"left":default:n="left";break;case"right":n="right";break;case"center":n="center"}t.textAlign=n}computeTextSize(t,e){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(i,e),n=this._lineHeight*this._textLines.length;return s.width=r,s.height=n,[r*e.pixelRatio,n*e.pixelRatio]}_computeTextWidth(t,e){let s=0;for(const e of this._textLines)s=Math.max(s,t.measureText(e).width);const i=e.font;return("italic"===i.style||"oblique"===i.style||"string"==typeof i.weight&&("bold"===i.weight||"bolder"===i.weight)||"number"==typeof i.weight&&i.weight>600)&&(s+=.3*t.measureText("w").width),s+=2*this._parameters.halo.size,Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&"underline"===e&&(t*=1.3),Math.round(t+2*this._parameters.halo.size)}_renderDecoration(t,e,s,i,r,n){const o=.9*this._lineHeight,a="bold"===r?.06:"bolder"===r?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if("underline"===i)switch(l){case"top":s+=o;break;case"middle":s+=o/2}else if("line-through"===i)switch(l){case"top":s+=o/1.5;break;case"middle":s+=o/3}const h=n?1.5*n:Math.ceil(o*a);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=h,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}}function Ci(t,e,s,i){return"function"==typeof t?t(e,s,i):t}function Li(t){let e=t.length;for(;e--;)if(!" /-,\n".includes(t.charAt(e)))return!1;return!0}function Ii(t,e){const s=[];let i=0,r=-1;do{if(r=t.indexOf("[",i),r>=i){if(r>i){const e=t.substr(i,r-i);s.push([e,null,Li(e)])}if(i=r+1,r=t.indexOf("]",i),r>=i){if(r>i){const n=e[t.substr(i,r-i)];n&&s.push([null,n,!1])}i=r+1}}}while(-1!==r);if(i<t.length-1){const e=t.substr(i);s.push([e,null,Li(e)])}return s}function ki(t,e,s){let i="",r=null;for(const s of e){const[e,n,o]=s;if(e)o?r=e:(r&&(i+=r,r=null),i+=e);else{const e=t.attributes[n];e&&(r&&(i+=r,r=null),i+=e)}}return Ti(i,s)}function Ti(t,e){switch("string"!=typeof t&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function zi(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function Ai(t){return"CIMMarkerPlacementAlongLineRandomSize"===t.type||"CIMMarkerPlacementAlongLineSameSize"===t.type||"CIMMarkerPlacementAlongLineVariableSize"===t.type||"CIMMarkerPlacementAtExtremities"===t.type||"CIMMarkerPlacementAtMeasuredUnits"===t.type||"CIMMarkerPlacementAtRatioPositions"===t.type||"CIMMarkerPlacementOnLine"===t.type||"CIMMarkerPlacementOnVertices"===t.type}const Ei=(t,e=0)=>isNaN(t)||null==t?e:t;function Fi(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function Ri(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function Ni(t){let e="",s="";if(t){const i=t.toLowerCase();i.includes("italic")?e="italic":i.includes("oblique")&&(e="oblique"),i.includes("bold")?s="bold":i.includes("light")&&(s="lighter")}return{style:e,weight:s}}function Oi(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function Wi(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Wi(e);if(null!=t)return t}break;case"CIMTextSymbol":return Wi(t.symbol);case"CIMSolidFill":return t.color}}function Vi(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Vi(e);if(void 0!==t)return t}break;case"CIMTextSymbol":return Vi(t.symbol);case"CIMSolidStroke":case"CIMSolidFill":return t.color}}function Di(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Di(e);if(void 0!==t)return t}break;case"CIMTextSymbol":return Di(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function Gi(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function Ui(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}const Bi=t=>t.includes("data:image/svg+xml"),Xi=Math.PI/180,Hi=l.Z.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class Yi{constructor(t){this._t=t}static createIdentity(){return new Yi([1,0,0,0,1,0])}clone(){const t=this._t;return new Yi(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 Yi([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[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 Yi([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new Yi([e,-s,0,s,e,0])}rotate(t){return Yi.multiply(this,Yi.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const i=t._t,r=e._t,n=i[0]*r[0]+i[3]*r[1],o=i[1]*r[0]+i[4]*r[1],a=i[2]*r[0]+i[5]*r[1]+r[2],l=i[0]*r[3]+i[3]*r[4],h=i[1]*r[3]+i[4]*r[4],c=i[2]*r[3]+i[5]*r[4]+r[5],u=s._t;return u[0]=n,u[1]=o,u[2]=a,u[3]=l,u[4]=h,u[5]=c,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new Yi([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,r=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new Yi([r,n,s,o,a,i])}}class Ji{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new bi.Z(ut,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||Yi.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||Yi.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]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;Yi.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t)return;const s=t.symbolLayers;if(!s)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(s,e),e=t.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let i=new ds(e);for(const e of t){const t=Xe(e);t&&(i=t.execute(i,e,this.geomUnitsPerPoint(),s))}return i}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const i=t[s];if(!i||!1===i.enable)continue;const r=i.effects;if(r&&r.length>0){const t=this.executeEffects(r,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);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);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 s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const i=He(s);if(i){const r="CIMMarkerPlacementInsidePolygon"===s.type||"CIMMarkerPlacementPolygonCenter"===s.type&&s.clipAtBoundary;r&&this.pushClipPath(e);const n=i.execute(e,s,this.geomUnitsPerPoint(),this._resourceManager.geometryEngine);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}r&&this.popClipPath()}}else{const s=this._placementPool.acquire();if((0,ct.wp)(e))s.tx=e.x,s.ty=e.y,this.drawMarker(t,s);else if((0,ct.oU)(e))[s.tx,s.ty]=(0,Le.tO)(e),this.drawMarker(t,s);else for(const i of e.points)if(s.tx=i[0],s.ty=i[1],this.drawMarker(t,s),this._earlyReturn)break;this._placementPool.release(s)}}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 s=this._resourceManager.getResource(t.url),i=t.size??10;if((0,h.Wi)(s)||i<=0)return;const r=s.width,n=s.height;if(!r||!n)return;const o=r/n,a=t.scaleX??1,l=Yi.createIdentity(),c=t.anchorPoint;if(c){let e=c.x,s=c.y;"Absolute"!==t.anchorPointUnits&&(e*=i*o*a,s*=i),l.translate(-e,-s)}let u=t.rotation??0;t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Xi);let f=t.offsetX??0,m=t.offsetY??0;if(f||m){if(this._mapRotation){const t=Xi*this._mapRotation,e=Math.cos(t),s=Math.sin(t),i=f*s+m*e;f=f*e-m*s,m=i}l.translate(f,m)}const _=this.geomUnitsPerPoint();1!==_&&l.scale(_,_);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const s=t.markerGraphics;if(!s)return;const i=t.size??10,r=t.frame,n=r?r.ymax-r.ymin:0,o=i&&n?i/n:1,a=Yi.createIdentity();r&&a.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let e=l.x,s=l.y;"Absolute"!==t.anchorPointUnits?r&&(e*=r.xmax-r.xmin,s*=r.ymax-r.ymin):(e/=o,s/=o),a.translate(-e,-s)}1!==o&&a.scale(o,o);let h=t.rotation??0;t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*Xi);let c=t.offsetX??0,u=t.offsetY??0;if(c||u){if(this._mapRotation){const t=Xi*this._mapRotation,e=Math.cos(t),s=Math.sin(t),i=c*s+u*e;c=c*e-u*s,u=i}a.translate(c,u)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const m=e.getAngle();m&&a.rotate(m),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const t of s)if(t&&t.symbol&&t.geometry||Hi.error("Invalid marker graphic",t),this.drawSymbol(t.symbol,t.geometry,t.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,s){if(!t)return;if(!(0,ct.wp)(e))return;if((t.height??10)<=0)return;const i=Yi.createIdentity();let r=t.angle??0;r=-r,r&&i.rotate(r*Xi);const n=t.offsetX??0,o=t.offsetY??0;(n||o)&&i.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let i=(void 0!==t.separation?t.separation:4)*s,r=void 0!==t.rotation?t.rotation:0;if(0===i)return null;i<0&&(i=-i);let n=0;const o=.5*i;for(;n>o;)n-=i;for(;n<-o;)n+=i;const a=(0,z.Ue)();(0,oe.$P)(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;r>180;)r-=180;for(;r<0;)r+=180;const h=Math.cos(r*Xi),c=Math.sin(r*Xi),u=-i*c,f=i*h;let m,_,p,d;n=(void 0!==t.offsetX?t.offsetX*s:0)*c-(void 0!==t.offsetY?t.offsetY*s:0)*h,m=p=Number.MAX_VALUE,_=d=-Number.MAX_VALUE;for(const t of l){const e=t[0],s=t[1],i=h*e+c*s,r=-c*e+h*s;m=Math.min(m,i),p=Math.min(p,r),_=Math.max(_,i),d=Math.max(d,r)}p=Math.floor(p/i)*i;let g=h*m-c*p-u*n/i,y=c*m+h*p-f*n/i,x=h*_-c*p-u*n/i,M=c*_+h*p-f*n/i;const b=1+Math.round((d-p)/i),v=[];for(let t=0;t<b;t++)g+=u,y+=f,x+=u,M+=f,v.push([[g,y],[x,M]]);return{paths:v}}}class qi extends Ji{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 wi(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return(0,z.al)(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if((0,ct.oU)(t))this._processPath(t.rings,0);else if((0,ct.l9)(t))this._processPath(t.paths,0);else if((0,ct.YX)(t)){const e=ji(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0)return;const i=.5*this.transformSize(s);if((0,ct.oU)(t))this._processPath(t.rings,i);else if((0,ct.l9)(t))this._processPath(t.paths,i);else if((0,ct.YX)(t)){const e=ji(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){(0,ct.oU)(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:s}=t,i=t.scaleX??1;let r=i*e,n=e;const o=this._resourceManager.getResource(s);!e&&(0,h.pC)(o)&&(r=i*o.width,n=o.height),this._merge(this.transformPt([-r/2,-n/2]),0),this._merge(this.transformPt([-r/2,n/2]),0),this._merge(this.transformPt([r/2,-n/2]),0),this._merge(this.transformPt([r/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new Pi);const s=$i(t),[i,r]=this._textRasterizer.computeTextSize(e,s);let n=0;switch(t.horizontalAlignment){case"Left":n=i/2;break;case"Right":n=-i/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=r/2;break;case"Top":o=-r/2;break;case"Baseline":o=r/6}this._merge(this.transformPt([-i/2+n,-r/2+o]),0),this._merge(this.transformPt([-i/2+n,r/2+o]),0),this._merge(this.transformPt([i/2+n,-r/2+o]),0),this._merge(this.transformPt([i/2+n,r/2+o]),0)}_processPath(t,e){if(t)for(const s of t){const t=s?s.length:0;if(t>1){this._merge(this.transformPt(s[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(s[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class Zi extends Ji{constructor(t,e,s,i){super(e,s),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new vi,this._ctx=t}drawSolidFill(t,e){if(!t)return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else if((0,ct.YX)(t))this._buildPath(ji(t).rings,!0);else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const s=this._ctx;s.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+e[3]/255+")",s.fill("evenodd")}drawSolidStroke(t,e,s,i,r,n){if(!t||!e||0===s)return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!1);else{if(!(0,ct.YX)(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(ji(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+")",o.lineWidth=Math.max(this.transformSize(s),.5),this._setCapStyle(i),this._setJoinStyle(r),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),(0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else{if(!(0,ct.YX)(t))return;this._buildPath(ji(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:s,url:i,tintColor:r}=t,n=t.scaleX??1,o=this._resourceManager.getResource(i);if((0,h.Wi)(o))return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const c=Bi(i)||"src"in o&&Bi(o.src);let u="getFrame"in o?Si(o):o;s&&(u=this._colorSubstitutionHelper.applyColorSubstituition(u,s)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const f=this.transformPt([0,0]),[m,_]=this.getTransformAngle(),p=this.transformSize(1),d=this._ctx;d.save(),d.setTransform({m11:n*p*m,m12:n*p*_,m21:-p*_,m22:p*m,m41:f[0],m42:f[1]}),d.drawImage(u,-a/2,-l/2,a,l),d.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new Pi);const s=$i(t);s.size*=this.transformSize((0,B.Wz)(1));const i=this._textRasterizer.rasterizeText(e,s);if(!i)return;const{size:r,anchorX:n,anchorY:o,canvas:a}=i,l=r[0]*(n+.5),h=r[1]*(o-.5),c=this._ctx,u=this.transformPt([0,0]),[f,m]=this.getTransformAngle();c.save(),c.setTransform({m11:1*f,m12:1*m,m21:-1*m,m22:1*f,m41:u[0]-1*l,m42:u[1]+1*h}),c.drawImage(a,0,0),c.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:s,height:i,offsetX:r,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:c}=e;const u=this._resourceManager.getResource(c);if((0,h.Wi)(u))return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else if((0,ct.YX)(t))this._buildPath(ji(t).rings,!0);else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const f=this._ctx,m=Bi(c)||"src"in u&&Bi(u.src);let _,p="getFrame"in u?Si(u):u;if(s&&(p=this._colorSubstitutionHelper.applyColorSubstituition(p,s)),this._applyAdditionalRenderProps){m||l&&(p=this._colorSubstitutionHelper.tintImageData(p,l)),_=f.createPattern(p,"repeat");const t=this.transformSize(1);o||(o=0),r?r*=t:r=0,n?n*=t:n=0,i&&(i*=t);const e=i?i/u.height:1,s=a&&i?a*i/u.width:1;if(0!==o||1!==e||1!==s||0!==r||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(r,n).scaleSelf(s,e,1),_.setTransform(t)}}else _=f.createPattern(p,"repeat");f.save(),f.fillStyle=_,f.fill("evenodd"),f.restore()}drawPictureStroke(t,e){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:r,miterLimit:n,tintColor:o,url:a,width:l}=e;const c=this._resourceManager.getResource(a);if((0,h.Wi)(c))return;let u;if((0,ct.oU)(t))u=t.rings;else if((0,ct.l9)(t))u=t.paths;else if((0,ct.YX)(t))u=ji(t).rings;else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawPictureStroke - No implementation!")}l||(l=c.width);const f=Bi(a)||"src"in c&&Bi(c.src);let m="getFrame"in c?Si(c):c;s&&(m=this._colorSubstitutionHelper.applyColorSubstituition(m,s)),this._applyAdditionalRenderProps&&(f||o&&(m=this._colorSubstitutionHelper.tintImageData(m,o)));const _=Math.max(this.transformSize((0,B.F2)(l)),.5),p=_/m.width,d=this._ctx,g=d.createPattern(m,"repeat-y");let y,x;d.save(),this._setCapStyle(i),this._setJoinStyle(r),d.miterLimit=n,d.lineWidth=_;for(let t of u)if(t=(0,ht.d9)(t),Qi(t),t&&!(t.length<=1)){y=this.transformPt(t[0]);for(let e=1;e<t.length;e++){x=this.transformPt(t[e]);const s=Ki(y,x),i=new DOMMatrix;i.translateSelf(0,y[1]-_/2).scaleSelf(p,p,1).rotateSelf(0,0,90-s),g.setTransform(i),d.strokeStyle=g,d.beginPath(),d.moveTo(y[0],y[1]),d.lineTo(x[0],x[1]),d.stroke(),y=x}}d.restore()}_buildPath(t,e){const s=this._ctx;if(s.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let r=this.transformPt(i[0]);s.moveTo(r[0],r[1]);for(let e=1;e<t;e++)r=this.transformPt(i[e]),s.lineTo(r[0],r[1]);e&&s.closePath()}}}_setCapStyle(t){switch(t){case X.kP.Butt:this._ctx.lineCap="butt";break;case X.kP.Round:this._ctx.lineCap="round";break;case X.kP.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case X.r4.Bevel:this._ctx.lineJoin="bevel";break;case X.r4.Round:this._ctx.lineJoin="round";break;case X.r4.Miter:this._ctx.lineJoin="miter"}}}function Ki(t,e){const s=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,s)}const ji=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;function $i(t,e=1){const s=Oi(t),i=Ni(t.fontStyleName),r=yi(t.fontFamilyName),{weight:n,style:o}=i,a=e*(t.height||5),l=Gi(t.horizontalAlignment),h=Ui(t.verticalAlignment),c=Wi(t),u=Vi(t.haloSymbol),f=u?e*(0|t.haloSize):0;return{color:c,size:a,horizontalAlignment:l,verticalAlignment:h,font:{family:r,style:Fi(o),weight:Ri(n),decoration:s},halo:{size:f||0,color:u,style:o},pixelRatio:1,premultiplyColors:!0}}function Qi(t){let e,s,i,r,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],s=t[a][1]-o[1],r=0!==e?s/e:Math.PI/2,void 0!==i&&r-i<=1e-4?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),i=r}var tr=s(82397);function er(t,e,s,i,r){if((0,h.Wi)(t))return null;const n=t.referencesGeometry()&&r?function(t,e,s){const{transform:i,hasZ:r,hasM:n}=s;sr.has(e)||sr.set(e,function(t){const e={};switch(t){case"esriGeometryPoint":return(t,s,i,r)=>(0,tr.U1)(s,e,t,i,r);case"esriGeometryPolygon":return(t,s,i,r)=>(0,tr.Ie)(s,e,t,i,r);case"esriGeometryPolyline":return(t,s,i,r)=>(0,tr.G6)(s,e,t,i,r);case"esriGeometryMultipoint":return(t,s,i,r)=>(0,tr.J9)(s,e,t,i,r);default:return l.Z.getLogger("esri.views.2d.support.arcadeOnDemand").error(new o.Z("mapview-arcade",`Unable to handle geometryType: ${t}`)),t=>t}}(e));const a=sr.get(e)(t.geometry,i,r,n);return{...t,geometry:a}}(e,i,r):e,a=t.repurposeFeature(n);try{return t.evaluate({...s,$feature:a})}catch(t){return l.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",t),null}}const sr=new Map;s(31363);const ir=Math.PI,rr=ir/2,nr=96/72,or=(Math.PI,l.Z.getLogger("esri.symbols.cim.CIMSymbolHelper"));function ar(t,e,s){switch(e.type){case"CIMSymbolReference":return ar(t,e.symbol,s);case"CIMPointSymbol":null==s&&(s={x:0,y:0}),t.drawSymbol(e,s);break;case"CIMLineSymbol":null==s&&(s={paths:[[[0,0],[10,0]]]}),t.drawSymbol(e,s);break;case"CIMPolygonSymbol":null==s&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),t.drawSymbol(e,s);break;case"CIMTextSymbol":{const s={x:0,y:0};t.drawSymbol(e,s);break}case"CIMVectorMarker":{const s=new ut;t.drawMarker(e,s);break}}return t.envelope()}class lr{static getEnvelope(t,e,s){const i=new qi(s);if(Array.isArray(t)){let s;for(const r of t)s?s.union(ar(i,r,e)):s=ar(i,r,e);return s}return ar(i,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const i=(s.x+.5*s.width)*nr,r=(s.y+.5*s.height)*nr,n=s.width*nr+2,o=s.height*nr+2;return[-i/n,-r/o,o]}static rasterize(t,e,s,i,r=!0){const n=s||this.getEnvelope(e,null,i);if(!n)return[null,0,0,0,0];const o=(n.x+.5*n.width)*nr,a=(n.y+.5*n.height)*nr;t.width=n.width*nr,t.height=n.height*nr,s||(t.width+=2,t.height+=2);const l=t.getContext("2d"),h=Yi.createScale(nr,-nr);h.translate(.5*t.width-o,.5*t.height+a);const c=new Zi(l,i,h);switch(e.type){case"CIMPointSymbol":{const t={type:"point",x:0,y:0};c.drawSymbol(e,t);break}case"CIMVectorMarker":{const t=new ut;c.drawMarker(e,t);break}}const u=l.getImageData(0,0,t.width,t.height),f=new Uint8Array(u.data);if(r){let t;for(let e=0;e<f.length;e+=4)t=f[e+3]/255,f[e]=f[e]*t,f[e+1]=f[e+1]*t,f[e+2]=f[e+2]*t}return[f,t.width,t.height,-o/t.width,-a/t.height]}static fromTextSymbol(t){const{angle:e,color:s,font:i,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:l,text:h,verticalAlignment:c,xoffset:u,yoffset:f}=t;let m,_,p,d,g;i&&(m=i.family,_=i.style,p=i.weight,d=i.size,g=i.decoration);let y=!1;return h&&(y=n(h)[1]),{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:{type:"CIMTextSymbol",angle:e,blockProgression:X.zV.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:X.eZ.Normal,fontEncoding:X.DD.Unicode,fontFamilyName:m||"Arial",fontStyleName:pr(_,p),fontType:X.Ky.Unspecified,haloSize:o,height:d,hinting:X.Dd.Default,horizontalAlignment:fr(a??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:Ei(u),offsetY:Ei(f),strikethrough:"line-through"===g,underline:"underline"===g,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_r(s)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_r(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:y?X.UX.RTL:X.UX.LTR,verticalAlignment:mr(c??"baseline"),verticalGlyphOrientation:X.RS.Right,wordSpacing:100,billboardMode3D:X.UR.FaceNearPlane},textString:h}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:e,outline:s,width:i,xoffset:r,xscale:n,yoffset:o,yscale:a}=t,l=[],h={type:"CIMPolygonSymbol",symbolLayers:l};if(s){const{cap:t,join:e,miterLimit:i,width:r}=s;l.push({type:"CIMSolidStroke",color:_r(s.color),capStyle:cr(t),joinStyle:ur(e),miterLimit:i,width:r})}let c=t.url;"esriPFS"===t.type&&t.imageData&&(c=t.imageData);const u="angle"in t?t.angle:0,f=i*(n||1),m=e*(a||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:X.Qb.Picture,tintColor:null,url:c,height:m,width:f,offsetX:Ei(r),offsetY:Ei(o),rotation:Ei(-u),colorSubstitutions:null}),h}static fromSimpleFillSymbol(t){const{color:e,style:s,outline:i}=t,r=[],n={type:"CIMPolygonSymbol",symbolLayers:r};let o=null;if(i){const{cap:t,join:e,style:s}=i;"solid"!==s&&"none"!==s&&"esriSLSSolid"!==s&&"esriSLSNull"!==s&&(o=[{type:"CIMGeometricEffectDashes",dashTemplate:yr(s,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),r.push({type:"CIMSolidStroke",color:_r(i.color),capStyle:cr(t),joinStyle:ur(e),miterLimit:i.miterLimit,width:i.width,effects:o})}if(s&&"solid"!==s&&"none"!==s&&"esriSFSSolid"!==s&&"esriSFSNull"!==s){const t={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:_r(e),capStyle:X.kP.Butt,joinStyle:X.r4.Miter,width:.75}]};let i=0;const n=(0,B.Wz)(Mr(s)?8:10);switch(s){case"vertical":case"esriSFSVertical":i=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":i=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":i=45;break;case"cross":case"esriSFSCross":i=0}r.push({type:"CIMHatchFill",lineSymbol:t,offsetX:0,offsetY:0,rotation:i,separation:n}),"cross"===s||"esriSFSCross"===s?r.push({type:"CIMHatchFill",lineSymbol:(0,ht.d9)(t),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==s&&"esriSFSDiagonalCross"!==s||r.push({type:"CIMHatchFill",lineSymbol:(0,ht.d9)(t),offsetX:0,offsetY:0,rotation:45,separation:n})}else!s||"solid"!==s&&"esriSFSSolid"!==s||r.push({type:"CIMSolidFill",enable:!0,color:_r(e)});return n}static fromSimpleLineSymbol(t){const{cap:e,color:s,join:i,marker:r,miterLimit:n,style:o,width:a}=t;let l=null;"solid"!==o&&"none"!==o&&"esriSLSSolid"!==o&&"esriSLSNull"!==o&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:yr(o,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const h=[];if(r){let t;switch(r.placement){case"begin-end":t=X.Tx.Both;break;case"begin":t=X.Tx.JustBegin;break;case"end":t=X.Tx.JustEnd;break;default:t=X.Tx.None}const e=lr.fromSimpleMarker(r,a,s).symbolLayers[0];e.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:t,offsetAlongLine:0},h.push(e)}return"none"!==o&&"esriSLSNull"!==o&&h.push({type:"CIMSolidStroke",color:_r(s),capStyle:cr(e),joinStyle:ur(i),miterLimit:n,width:a,effects:l}),{type:"CIMLineSymbol",symbolLayers:h}}static fromPictureMarker(t){const{angle:e,height:s,width:i,xoffset:r,yoffset:n}=t;let o=t.url;return"esriPMS"===t.type&&t.imageData&&(o=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:X.Qb.Picture,tintColor:null,url:o,size:s,width:i,offsetX:Ei(r),offsetY:Ei(n),rotation:Ei(-e)}]}}static fromSimpleMarker(t,e,s){const{style:i}=t,r=t.color??s;if("path"===i){const e=[];if("outline"in t&&t.outline){const s=t.outline;e.push({type:"CIMSolidStroke",enable:!0,width:(0,B.F2)(Math.round((0,B.Wz)(s.width))),color:_r(s.color)})}e.push({type:"CIMSolidFill",enable:!0,color:_r(r),path:t.path});const[s,i]=xr("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Ei(-t.angle),size:Ei(t.size||6),offsetX:Ei(t.xoffset),offsetY:Ei(t.yoffset),frame:s,markerGraphics:[{type:"CIMMarkerGraphic",geometry:i,symbol:{type:"CIMPolygonSymbol",symbolLayers:e}}]}]}}const[n,o]=xr(i);let a;if(o&&n){const s=[];if("outline"in t&&t.outline){const e=t.outline;s.push({type:"CIMSolidStroke",enable:!0,width:e.width>.667?(0,B.F2)(Math.round((0,B.Wz)(e.width))):e.width,color:_r(e.color)})}else!e||"line-marker"!==t.type||"cross"!==t.style&&"x"!==t.style||s.push({type:"CIMSolidStroke",enable:!0,width:e,color:_r(r)});s.push({type:"CIMSolidFill",enable:!0,color:_r(r)});const i={type:"CIMPolygonSymbol",symbolLayers:s};a={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Ei(-t.angle),size:Ei(t.size||6*e),offsetX:Ei(t.xoffset),offsetY:Ei(t.yoffset),frame:n,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:i}]}]}}return a}static fromCIMHatchFill(t,e){const s=e*(t.separation??4),i=s/2,r=(0,ht.d9)(t.lineSymbol);let n=this._getLineSymbolPeriod(r)||4;for(;n<4;)n*=2;const o=n/2,a={xmin:-o,xmax:o,ymin:-i,ymax:i},l=r.symbolLayers.find((t=>"CIMSolidStroke"===t.type));return l&&(l.width*=e),{type:"CIMVectorMarker",frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-o,0],[o,0]]]},symbol:r}],size:s}}static fetchResources(t,e,s){if(t&&e)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const i=t.symbolLayers;if(!i)return;for(const t of i)switch(Sr(t,e,s),t.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in t&&t.url&&s.push(e.fetchResource(t.url,null));break;case"CIMVectorMarker":{const i=t.markerGraphics;if(!i)continue;for(const t of i)if(t){const i=t.symbol;i&&lr.fetchResources(i,e,s)}}}}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers)for(const e of t.symbolLayers)if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=this._getPlacementRepeat(e.markerPlacement);if(t)return t}}}}return 0}static _getEffectsRepeat(t){if(t)for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const t=e.dashTemplate;if(t&&t.length){let e=0;for(const s of t)e+=s;return 1&t.length&&(e*=2),e}break}case"CIMGeometricEffectWave":return e.period;default:or.error(`unsupported geometric effect type ${e.type}`)}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let t=0;for(const s of e)t+=s;return 1&e.length&&(t*=2),t}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,s={type:t.type,...t};s.markerPlacement=null,s.anchorPoint=null;const i=Math.abs(e.stepX),r=Math.abs(e.stepY),n=(e.randomness??100)/100;let o,a,l,h;if("Random"===e.gridType){const t=(0,B.Wz)(A.C1),s=Math.max(Math.floor(t/i),1),c=Math.max(Math.floor(t/r),1);o=s*i/2,a=c*r/2,l=2*a;const u=new xe.Z(e.seed),f=n*i/1.5,m=n*r/1.5;h=[];for(let t=0;t<s;t++)for(let e=0;e<c;e++){const s=t*i-o+f*(.5-u.getFloat()),n=e*r-a+m*(.5-u.getFloat());h.push({x:s,y:n}),0===t&&h.push({x:s+2*o,y:n}),0===e&&h.push({x:s,y:n+2*a})}}else!0===e.shiftOddRows?(o=i/2,a=r,l=2*r,h=[{x:-o,y:0},{x:o,y:0},{x:0,y:a},{x:0,y:-a}]):(o=i/2,a=r/2,l=r,h=[{x:-i,y:0},{x:0,y:-r},{x:-i,y:-r},{x:0,y:0},{x:i,y:0},{x:0,y:r},{x:i,y:r},{x:-i,y:r},{x:i,y:-r}]);return{type:"CIMVectorMarker",frame:{xmin:-o,xmax:o,ymin:-a,ymax:a},markerGraphics:h.map((t=>({type:"CIMMarkerGraphic",geometry:t,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}}))),size:l}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers)for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=s.size;t>e&&(e=t);break}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers)for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const t=s.width;t>e&&(e=t);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(Ai(s.markerPlacement)){const t=s.size;t>e&&(e=t)}}return e}}}static getMarkerScaleRatio(t){if(t&&"CIMVectorMarker"===t.type&&!1!==t.scaleSymbolsProportionally&&t.frame){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class hr{static findApplicableOverrides(t,e,s){if(t&&e){if(t.primitiveName){let i=!1;for(const e of s)if(e.primitiveName===t.primitiveName){i=!0;break}if(!i)for(const i of e)i.primitiveName===t.primitiveName&&s.push(i)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const i of t.effects)hr.findApplicableOverrides(i,e,s);if(t.symbolLayers)for(const i of t.symbolLayers)hr.findApplicableOverrides(i,e,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects)for(const i of t.effects)hr.findApplicableOverrides(i,e,s);if(t.markerPlacement&&hr.findApplicableOverrides(t.markerPlacement,e,s),"CIMVectorMarker"===t.type){if(t.markerGraphics)for(const i of t.markerGraphics)hr.findApplicableOverrides(i,e,s),hr.findApplicableOverrides(i.symbol,e,s)}else"CIMCharacterMarker"===t.type?hr.findApplicableOverrides(t.symbol,e,s):"CIMHatchFill"===t.type?hr.findApplicableOverrides(t.lineSymbol,e,s):"CIMPictureMarker"===t.type&&hr.findApplicableOverrides(t.animatedSymbolProperties,e,s)}}}static findEffectOverrides(t,e,s){if(!e||!t)return;const i=t.length;for(let r=0;r<i;r++){const i=t[r]?.primitiveName;if(i){let t=!1;for(const e of s)if(e.primitiveName===i){t=!0;break}if(!t)for(const t of e)t.primitiveName===i&&s.push(t)}}}static async resolveSymbolOverrides(t,e,s,i,r,n,o){if(!t||!t.symbol)return null;let{symbol:a,primitiveOverrides:l}=t;const h=!!l;if(!h&&!i)return a;a=(0,ht.d9)(a);let c=!0;if(e||(e={attributes:{}},c=!1),h){if(c||(l=l.filter((t=>!t.valueExpressionInfo?.expression.includes("$feature")))),o||(l=l.filter((t=>!t.valueExpressionInfo?.expression.includes("$view")))),l.length>0){const t=function(t){return(t?Object.keys(t):[]).map((e=>({name:e,alias:e,type:"string"==typeof t[e]?"esriFieldTypeString":"esriFieldTypeDouble"})))}(e.attributes);await hr.evaluateOverrides(l,e,{spatialReference:s,fields:t,geometryType:r},n,o)}hr.applyOverrides(a,l)}return i&&hr.applyDictionaryTextOverrides(a,e,i),a}static async evaluateOverrides(t,e,s,i,r){if(!e)return;let n;for(const o of t){const t=o.valueExpressionInfo;if(t&&s){n||(n=[]),o.value=void 0;const a=(0,Mi.Yi)(t.expression,s.spatialReference,s.fields).then((t=>{o.value=er(t,e,{$view:r},s.geometryType,i)}));n.push(a)}}void 0!==n&&n.length>0&&await Promise.all(n)}static applyDictionaryTextOverrides(t,e,s,i="Normal"){if(t&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const r=t.symbolLayers;if(!r)return;for(const n of r)n&&"CIMVectorMarker"===n.type&&hr.applyDictionaryTextOverrides(n,e,s,"CIMTextSymbol"===t.type?t.textCase:i)}break;case"CIMVectorMarker":{const i=t.markerGraphics;if(!i)return;for(const t of i)t&&hr.applyDictionaryTextOverrides(t,e,s)}break;case"CIMMarkerGraphic":{const r=t.textString;if(r&&r.includes("[")){const n=Ii(r,s);t.textString=ki(e,n,i)}}}}static applyOverrides(t,e,s,i){if(t.primitiveName)for(const r of e)if(r.primitiveName===t.primitiveName){const e=br(r.propertyName);if(i&&i.push({cim:t,nocapPropertyName:e,value:t[e]}),r.expression&&(r.value=hr.toValue(r.propertyName,r.expression)),s){let e=!1;for(const i of s)i.primitiveName===t.primitiveName&&(e=!0);e||s.push(r)}(0,h.pC)(r.value)&&(t[e]=r.value)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const r of t.effects)hr.applyOverrides(r,e,s,i);if(t.symbolLayers)for(const r of t.symbolLayers)hr.applyOverrides(r,e,s,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const r of t.effects)hr.applyOverrides(r,e,s,i);if("CIMVectorMarker"===t.type&&t.markerGraphics)for(const r of t.markerGraphics)hr.applyOverrides(r,e,s,i),hr.applyOverrides(r.symbol,e,s,i)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const s of t)void 0!==s.value&&(e+=`${s.primitiveName}${s.propertyName}${JSON.stringify(s.value)}`);return e}static toValue(t,e){if("DashTemplate"===t)return e.split(" ").map((t=>Number(t)));if("Color"===t){const t=new gi.Z(e).toRgba();return t[3]*=255,t}return e}}const cr=t=>{if(!t)return X.kP.Butt;switch(t){case"butt":return X.kP.Butt;case"square":return X.kP.Square;case"round":return X.kP.Round}},ur=t=>{if(!t)return X.r4.Miter;switch(t){case"miter":return X.r4.Miter;case"round":return X.r4.Round;case"bevel":return X.r4.Bevel}},fr=t=>{if((0,h.Wi)(t))return"Center";switch(t){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},mr=t=>{if((0,h.Wi)(t))return"Center";switch(t){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},_r=t=>{if(!t)return[0,0,0,0];const{r:e,g:s,b:i,a:r}=t;return[e,s,i,255*r]},pr=(t,e)=>{const s=dr(e),i=gr(t);return s&&i?`${s}-${i}`:`${s}${i}`},dr=t=>{if(!t)return"";switch(t.toLowerCase()){case"bold":case"bolder":return"bold"}return""},gr=t=>{if(!t)return"";switch(t.toLowerCase()){case"italic":case"oblique":return"italic"}return""},yr=(t,e)=>{const s="butt"===e;switch(t){case"dash":case"esriSLSDash":return s?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return s?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return s?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return s?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return s?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return s?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return s?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return s?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return s?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return s?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return or.error("Unexpected: style does not require rasterization"),[0,0];default:return or.error(`Tried to rasterize SLS, but found an unexpected style: ${t}!`),[0,0]}},xr=t=>{const e=50;let s,i;const r=t;if("circle"===r||"esriSMSCircle"===r){const t=.25;let r=Math.acos(1-t/e),n=Math.ceil(ir/r/4);0===n&&(n=1),r=rr/n,n*=4;const o=[];o.push([e,0]);for(let t=1;t<n;t++)o.push([e*Math.cos(t*r),-e*Math.sin(t*r)]);o.push([e,0]),s={rings:[o]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("cross"===r||"esriSMSCross"===r){const t=0;s={rings:[[[t,e],[t,t],[e,t],[e,-t],[t,-t],[t,-e],[-t,-e],[-t,-t],[-e,-t],[-e,t],[-t,t],[-t,e],[t,e]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("diamond"===r||"esriSMSDiamond"===r)s={rings:[[[-e,0],[0,e],[e,0],[0,-e],[-e,0]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e};else if("square"===r||"esriSMSSquare"===r)s={rings:[[[-e,-e],[-e,e],[e,e],[e,-e],[-e,-e]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e};else if("x"===r||"esriSMSX"===r){const t=0;s={rings:[[[0,t],[e-t,e],[e,e-t],[t,0],[e,t-e],[e-t,-e],[0,-t],[t-e,-e],[-e,t-e],[-t,0],[-e,e-t],[t-e,e],[0,t]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("triangle"===r||"esriSMSTriangle"===r){const t=57.735026918962575,e=-t,r=2/3*100,n=r-100;s={rings:[[[e,n],[0,r],[t,n],[e,n]]]},i={xmin:e,ymin:n,xmax:t,ymax:r}}else"arrow"===r&&(s={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e});return[i,s]},Mr=t=>"vertical"===t||"horizontal"===t||"cross"===t||"esriSFSCross"===t||"esriSFSVertical"===t||"esriSFSHorizontal"===t,br=t=>t?t.charAt(0).toLowerCase()+t.substr(1):t;let vr;function Sr(t,e,i){t.effects&&!(0,h.pC)(e.geometryEngine)&&(vr?i.push(vr):(t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":return!0}return!1})(t.effects)&&(vr=Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),i.push(vr),vr.then((t=>e.geometryEngine=t))))}const wr=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function Pr(t,e){return wr.has(e)?(s=t,.05*Math.max(Math.round(s/.05),1)):t;var s}const Cr=[1/256,1/65536,1/16777216,1/4294967296];function Lr(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;for(const n of t)for(const t of n)t[0]<e&&(e=t[0]),t[0]>s&&(s=t[0]),t[1]<i&&(i=t[1]),t[1]>r&&(r=t[1]);return[e,i,s,r]}function Ir(t){return t?t.rings?Lr(t.rings):t.paths?Lr(t.paths):(0,ct.YX)(t)?[t.xmin,t.ymin,t.xmax,t.ymax]:null:null}function kr(t,e,s,i,r){const[n,o,a,l]=t;if(a<n||l<o)return[0,0,0];const h=a-n,c=l-o,u=Math.floor(31.5),f=(128-2*(u+1))/Math.max(h,c),m=Math.round(h*f)+2*u,_=Math.round(c*f)+2*u;let p=1;e&&(p=_/f/(e.ymax-e.ymin));let d=0,g=0,y=1;i&&(r?e&&s&&e.ymax-e.ymin>0&&(y=(e.xmax-e.xmin)/(e.ymax-e.ymin),d=i.x/(s*y),g=i.y/s):(d=i.x,g=i.y)),d=.5*(e.xmax+e.xmin)+d*(e.xmax-e.xmin),g=.5*(e.ymax+e.ymin)+g*(e.ymax-e.ymin),d-=n,g-=o,d*=f,g*=f,d+=u,g+=u;let x=d/m-.5,M=g/_-.5;return r&&(x*=s*y,M*=s),[p,x,M]}!function(t,e=0){let s=0;for(let i=0;i<4;i++)s+=t[e+i]*Cr[i]}(new Uint8ClampedArray([255,255,255,255]));const Tr=53290320,zr=10,Ar=l.Z.getLogger("esri.symbols.cim.cimAnalyzer");function Er(t){switch(t){case"Butt":return X.RL.BUTT;case"Square":return X.RL.SQUARE;default:return X.RL.ROUND}}function Fr(t){switch(t){case"Bevel":return X.AH.BEVEL;case"Miter":return X.AH.MITER;default:return X.AH.ROUND}}function Rr(t,e,s,i){let r;t[e]?r=t[e]:(r={},t[e]=r),r[s]=i}function Nr(t){const e=t.markerPlacement;return e&&e.angleToLine?X.v2.MAP:X.v2.SCREEN}function Or(t,e,s,i,r,n){const o=t.primitiveName,a=zi(t.color),[l,h]=rn(i,o,e,null,null),c=(0,xi.hP)(JSON.stringify(t)+h).toString();n.push({type:"fill",templateHash:c,materialHash:l?()=>c:c,cim:t,materialOverrides:null,colorLocked:t.colorLocked,color:$r(o,s,"Color",r,a,jr),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}function Wr(t,e,s,i,r,n,o){const a=t.primitiveName,l=t.tintColor?zi(t.tintColor):{r:255,g:255,b:255,a:1},[c,u]=rn(i,a,e,null,null),f=(0,xi.hP)(JSON.stringify(t)+u).toString(),m=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();let _=Ei(t.scaleX);if("width"in t){const e=t.width;let s=1;const i=n.getResource(t.url);(0,h.pC)(i)&&(s=i.width/i.height),_/=s*(t.height/e)}o.push({type:"fill",templateHash:f,materialHash:c?()=>m:m,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:$r(a,s,"TintColor",r,l,jr),height:$r(a,s,"Height",r,t.height),scaleX:$r(a,s,"ScaleX",r,_),angle:$r(a,s,"Rotation",r,Ei(t.rotation)),offsetX:$r(a,s,"OffsetX",r,Ei(t.offsetX)),offsetY:$r(a,s,"OffsetY",r,Ei(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Vr(t,e,s,i,r,n){const o=["Rotation","OffsetX","OffsetY"],a=i.filter((e=>e.primitiveName!==t.primitiveName||!o.includes(e.propertyName))),l=t.primitiveName,[h,c]=rn(i,l,e,null,null),u=(0,xi.hP)(JSON.stringify(t)+c).toString(),f=(0,xi.hP)(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let m={r:255,g:255,b:255,a:1};if(t.lineSymbol){const e=t.lineSymbol?.symbolLayers.find((t=>"CIMSolidStroke"===t.type));e&&(m=zi(e.color))}n.push({type:"fill",templateHash:u,materialHash:h?sn(f,s,a,r):f,cim:t,materialOverrides:a,colorLocked:t.colorLocked,effects:e,color:m,height:$r(l,s,"Separation",r,t.separation),scaleX:1,angle:$r(l,s,"Rotation",r,Ei(t.rotation)),offsetX:$r(l,s,"OffsetX",r,Ei(t.offsetX)),offsetY:$r(l,s,"OffsetY",r,Ei(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0})}function Dr(t,e,s,i,r,n){const o=t.primitiveName,[a,l]=rn(i,o,e,null,null),h=(0,xi.hP)(JSON.stringify(t)+l).toString();n.push({type:"fill",templateHash:h,materialHash:a?sn(h,s,i,r):h,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Gr(t,e,s,i,r,n,o,a){const l=t.primitiveName,h=zi(t.color),c=void 0!==t.width?t.width:4,u=Er(t.capStyle),f=Fr(t.joinStyle),m=t.miterLimit,[_,p]=rn(i,l,e,null,null),d=(0,xi.hP)(JSON.stringify(t)+p).toString();let g,y;if(e&&e instanceof Array&&e.length>0){const t=e[e.length-1];if("CIMGeometricEffectDashes"===t.type&&"NoConstraint"===t.lineDashEnding&&null===t.offsetAlongLine){const t=(e=[...e]).pop();g=t.dashTemplate,y=t.scaleDash}}n.push({type:"line",templateHash:d,materialHash:_?()=>d:d,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:$r(l,s,"Color",r,h,jr),width:$r(l,s,"Width",r,c),cap:$r(l,s,"CapStyle",r,u),join:$r(l,s,"JoinStyle",r,f),miterLimit:$r(l,s,"MiterLimit",r,m),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:g,scaleDash:y,sampleAlphaOnly:!0})}function Ur(t,e,s,i,r,n,o,a){const l=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),h=t.primitiveName,c=zi(t.tintColor),u=void 0!==t.width?t.width:4,f=Er(t.capStyle),m=Fr(t.joinStyle),_=t.miterLimit,[p,d]=rn(i,h,e,null,null),g=(0,xi.hP)(JSON.stringify(t)+d).toString();n.push({type:"line",templateHash:g,materialHash:p?()=>l:l,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:$r(h,s,"TintColor",r,c,jr),width:$r(h,s,"Width",r,u),cap:$r(h,s,"CapStyle",r,f),join:$r(h,s,"JoinStyle",r,m),miterLimit:$r(h,s,"MiterLimit",r,_),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}function Br(t,e,s,i,r,n,o,a){const l=t.primitiveName,h=void 0!==t.width?t.width:4,c=Er(t.capStyle),u=Fr(t.joinStyle),f=t.miterLimit,[m,_]=rn(i,l,e,null,null),p=(0,xi.hP)(JSON.stringify(t)+_).toString();n.push({type:"line",templateHash:p,materialHash:m?sn(p,s,i,r):p,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:$r(l,s,"Width",r,h),cap:$r(l,s,"CapStyle",r,c),join:$r(l,s,"JoinStyle",r,u),miterLimit:$r(l,s,"MiterLimit",r,f),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function Xr(t,e,s,i,r,n){const o=t.markerPlacement;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type)return!1;const a=o,l=Math.abs(a.stepX),h=Math.abs(a.stepY);if(0===l||0===h)return!0;const c=["Rotation","OffsetX","OffsetY"],u=i.filter((e=>e.primitiveName!==t.primitiveName||!c.includes(e.propertyName))),f="url"in t?t.url:null,[m,_]=rn(i,a.primitiveName,e,null,null),p=(0,xi.hP)(JSON.stringify(t)+_).toString();let d,g,y=null;if("Random"===o.gridType){const t=(0,B.Wz)(A.C1),e=Math.max(Math.floor(t/l),1),s=Math.max(Math.floor(t/h),1);d=h*s,y=t=>t?t*s:0,g=e*l/d}else o.shiftOddRows?(d=2*h,y=t=>t?2*t:0,g=l/h*.5):(d=h,y=null,g=l/h);let x={r:255,g:255,b:255,a:1};return"tintColor"in t&&(x=zi(t.tintColor)),n.push({type:"fill",templateHash:p,materialHash:m?sn(p,s,u,r):p,cim:t,materialOverrides:u,colorLocked:t.colorLocked,effects:e,color:$r(a.primitiveName,s,"TintColor",r,x,jr),height:$r(a.primitiveName,s,"StepY",r,d,y),scaleX:g,angle:$r(a.primitiveName,s,"GridAngle",r,a.gridAngle),offsetX:$r(a.primitiveName,s,"OffsetX",r,Ei(a.offsetX)),offsetY:$r(a.primitiveName,s,"OffsetY",r,Ei(a.offsetY)),url:f,applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:!f}),!0}function Hr(t,e,s,i,r,n,o,a,l){const c=t.primitiveName,u=Ei(t.size);let f=Ei(t.scaleX,1);const m=Ei(t.rotation),_=Ei(t.offsetX),p=Ei(t.offsetY),d=t.tintColor?zi(t.tintColor):{r:255,g:255,b:255,a:1},g=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString(),y=en(t.markerPlacement,i,s,r),x=function(t,e,s,i){const r=[];if(hr.findApplicableOverrides(t,e,r),0===r.length)return t;for(const t of r)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(e,s,i)=>{for(const t of r)t.fn&&(t.value=t.fn(e,s,i));const n=(0,ht.d9)(t),o=t.primitiveName;for(const t of r)if(t.primitiveName===o){const e=Qr(t.propertyName);if(null!=t.value){const s=Pr(t.value,t.propertyName);s!==n[e]&&(n[e]=s)}}return n}}(t.animatedSymbolProperties,i,s,r),[M,b]=rn(i,c,e,y,x),v=(0,xi.hP)(JSON.stringify(t)+b).toString(),S=t.anchorPoint??{x:0,y:0};if("width"in t){const e=t.width;let s=1;const i=n.getResource(t.url);(0,h.pC)(i)&&(s=i.width/i.height),f/=s*(u/e)}function w(t,e){return Ci(x,t,e)}const P=t.animatedSymbolProperties&&!0===t.animatedSymbolProperties.randomizeStartTime?(t,e,s,i)=>{const r=function(t){return Math.floor(function(t,e){let s;if("string"==typeof t)s=(0,xi.hP)(t+`-seed(${e})`);else{let i=12;s=t^e;do{s=107*(s>>8^s)+i|0}while(0!=--i)}return(1+s/(1<<31))/2}(t,Tr)*zr)}(i),n=w(t,e);return g+`-MATERIALGROUP(${r})`+`-ASP(${JSON.stringify(n)})`}:M?(t,e)=>{const s=w(t,e);return g+`-ASP(${JSON.stringify(s)})`}:g;o.push({type:"marker",templateHash:v,materialHash:P,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:!1,alignment:a,size:$r(c,s,"Size",r,u),scaleX:$r(c,s,"ScaleX",r,f),rotation:$r(c,s,"Rotation",r,m),offsetX:$r(c,s,"OffsetX",r,_),offsetY:$r(c,s,"OffsetY",r,p),color:$r(c,s,"TintColor",r,d,jr),anchorPoint:{x:S.x,y:-S.y},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:t.rotateClockwise,referenceSize:l,sizeRatio:1,markerPlacement:y,url:t.url,animatedSymbolProperties:x})}function Yr(t,e,s,i,r,n,o,a,l,h){const c=t.markerGraphics;if(!c)return;let u=0;if(t.scaleSymbolsProportionally){const e=t.frame;e&&(u=e.ymax-e.ymin)}const f=en(t.markerPlacement,i,s,r);for(const m of c)if(m){const c=m.symbol;if(!c)continue;switch(c.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":qr(t,e,f,null,m,i,s,r,n,o,a,l,u,h);break;case"CIMTextSymbol":Jr(t,e,f,m,s,i,r,n,a,l,u)}}}function Jr(t,e,s,i,r,n,o,a,l,h,c){hr.findApplicableOverrides(i,n,[]);const u=i.geometry;if(!("x"in u)||!("y"in u))return;const f=i.symbol,m=Oi(f),_=Ni(f.fontStyleName),p=yi(f.fontFamilyName);f.font={family:p,decoration:m,..._};const d=t.frame,g=u.x-.5*(d.xmin+d.xmax),y=u.y-.5*(d.ymin+d.ymax),x=t.size/c,M=t.primitiveName,b=Ei(f.height)*x,v=Ei(f.angle),S=Ei(t.offsetX)+(Ei(f.offsetX)+g)*x,w=Ei(t.offsetY)+(Ei(f.offsetY)+y)*x,P=zi(Wi(f));let C=zi(Vi(f)),L=Di(f);L||(C=zi(Wi(f.haloSymbol)),L=f.haloSize*x);const[I,k]=rn(n,M,e,s,null),T=JSON.stringify(t.effects)+Number(t.colorLocked).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),z=(0,xi.hP)(JSON.stringify(i)+T+k).toString();let A=$r(i.primitiveName,r,"TextString",o,i.textString,Ti,f.textCase);if(null==A)return;const{fontStyleName:E}=f,F=p+(E?"-"+E.toLowerCase():"-regular"),R=F;"string"==typeof A&&A.includes("[")&&f.fieldMap&&(A=function(t,e,s){const i=Ii(e,t);return t=>ki(t,i,s)}(f.fieldMap,A,f.textCase)),a.push({type:"text",templateHash:z,materialHash:I||"function"==typeof A||A.match(/\[(.*?)\]/)?(t,e,s)=>R+"-"+Ci(A,t,e,s):R+"-"+(0,xi.hP)(A),cim:f,materialOverrides:null,colorLocked:t.colorLocked,effects:e,alignment:l,anchorPoint:{x:t.anchorPoint?t.anchorPoint.x:0,y:t.anchorPoint?t.anchorPoint.y:0},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,fontName:F,decoration:m,weight:$r(M,r,"Weight",o,_.weight),style:$r(M,r,"Size",o,_.style),size:$r(M,r,"Size",o,b),angle:$r(M,r,"Rotation",o,v),offsetX:$r(M,r,"OffsetX",o,S),offsetY:$r(M,r,"OffsetY",o,w),horizontalAlignment:Gi(f.horizontalAlignment),verticalAlignment:Ui(f.verticalAlignment),text:A,color:P,outlineColor:C,outlineSize:L,referenceSize:h,sizeRatio:1,markerPlacement:s})}function qr(t,e,s,i,r,n,o,a,l,c,u,f,m,_){const p=r.symbol,d=p.symbolLayers;if(!d)return;if(_)return void Zr(t,e,s,i,r,o,n,a,l,c,u,f,m);let g=d.length;if(nn(d))return void function(t,e,s,i,r,n,o,a,l,h,c,u,f){const m=r.geometry,_=n[0],p=n[1],d=Ir(m);if(!d)return;const g="Relative"!==t.anchorPointUnits,[y,x,M]=kr(d,t.frame,t.size,t.anchorPoint,g),b={type:"sdf",geom:m,asFill:!0},v=t.primitiveName,S=Ei(t.size),w=Ei(t.rotation),P=Ei(t.offsetX),C=Ei(t.offsetY),L=p.path,I=p.primitiveName,k=_.primitiveName,T=zi(Wi(p)),z=zi(Vi(_)),A=Di(_);let E=!1,F="";for(const t of o)t.primitiveName!==I&&t.primitiveName!==k&&t.primitiveName!==v||(void 0!==t.value?F+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`:t.valueExpressionInfo&&(E=!0));const R=JSON.stringify({...t,markerGraphics:null}),N=(0,xi.hP)(JSON.stringify(b)+L).toString(),O={type:"marker",templateHash:(0,xi.hP)(JSON.stringify(r)+JSON.stringify(p)+JSON.stringify(_)+R+F).toString(),materialHash:E?()=>N:N,cim:b,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:c,anchorPoint:{x,y:M},isAbsoluteAnchorPoint:g,size:$r(t.primitiveName,a,"Size",l,S),rotation:$r(t.primitiveName,a,"Rotation",l,w),offsetX:$r(t.primitiveName,a,"OffsetX",l,P),offsetY:$r(t.primitiveName,a,"OffsetY",l,C),scaleX:1,frameHeight:f,rotateClockwise:t.rotateClockwise,referenceSize:u,sizeRatio:y,color:$r(I,a,"Color",l,T,jr),outlineColor:$r(k,a,"Color",l,z,jr),outlineWidth:$r(k,a,"Width",l,A),markerPlacement:s,path:L,animatedSymbolProperties:i};h.push(O)}(t,e,s,i,r,d,n,o,a,l,u,f,m);const y=gs.applyEffects(p.effects,r.geometry,c.geometryEngine);if(y)for(;g--;){const _=d[g];if(_&&!1!==_.enable)switch(_.type){case"CIMSolidFill":case"CIMSolidStroke":{const p=gs.applyEffects(_.effects,y,c.geometryEngine),d=Ir(p);if(!d)continue;const g="Relative"!==t.anchorPointUnits,[x,M,b]=kr(d,t.frame,t.size,t.anchorPoint,g),v="CIMSolidFill"===_.type,S={type:"sdf",geom:p,asFill:v},w=t.primitiveName,P=Ei(t.size)??10,C=Ei(t.rotation),L=Ei(t.offsetX),I=Ei(t.offsetY),k=_.path,T=_.primitiveName,z=zi(v?Wi(_):Vi(_)),A=v?{r:0,g:0,b:0,a:0}:zi(Vi(_)),E=Di(_);if(!v&&!E)break;let F=!1,R="";for(const t of n)t.primitiveName!==T&&t.primitiveName!==w||(void 0!==t.value?R+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`:t.valueExpressionInfo&&(F=!0));(0,h.pC)(e)&&"function"==typeof e&&(F=!0);const N=JSON.stringify({...t,markerGraphics:null}),O=(0,xi.hP)(JSON.stringify(S)+k).toString(),W={type:"marker",templateHash:(0,xi.hP)(JSON.stringify(r)+JSON.stringify(_)+N+R).toString(),materialHash:F?()=>O:O,cim:S,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:M,y:b},isAbsoluteAnchorPoint:g,size:$r(t.primitiveName,o,"Size",a,P),rotation:$r(t.primitiveName,o,"Rotation",a,C),offsetX:$r(t.primitiveName,o,"OffsetX",a,L),offsetY:$r(t.primitiveName,o,"OffsetY",a,I),scaleX:1,frameHeight:m,rotateClockwise:t.rotateClockwise,referenceSize:f,sizeRatio:x,color:$r(T,o,"Color",a,z,jr),outlineColor:$r(T,o,"Color",a,A,jr),outlineWidth:$r(T,o,"Width",a,E),markerPlacement:s,animatedSymbolProperties:i,path:k};l.push(W);break}default:Zr(t,e,s,i,r,o,n,a,l,c,u,f,m)}}}function Zr(t,e,s,i,r,n,o,a,l,c,u,f,m){const _=function(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}(t,r),p=["Rotation","OffsetX","OffsetY"],d=o.filter((e=>e.primitiveName!==t.primitiveName||!p.includes(e.propertyName)));let g="";for(const t of o)void 0!==t.value&&(g+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`);const[y,x,M]=lr.getTextureAnchor(_,c),b=t.primitiveName,v=Ei(t.rotation),S=Ei(t.offsetX),w=Ei(t.offsetY),P=(0,xi.hP)(JSON.stringify(_)+g).toString(),C={type:"marker",templateHash:P,materialHash:d.length>0||(0,h.pC)(e)&&"function"==typeof e?sn(P,n,d,a):P,cim:_,materialOverrides:d,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:y,y:x},isAbsoluteAnchorPoint:!1,size:t.size,rotation:$r(b,n,"Rotation",a,v),offsetX:$r(b,n,"OffsetX",a,S),offsetY:$r(b,n,"OffsetY",a,w),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:m,rotateClockwise:t.rotateClockwise,referenceSize:f,sizeRatio:M/(0,B.F2)(t.size),markerPlacement:s,animatedSymbolProperties:i};l.push(C)}function Kr(t){if(t&&0===t.indexOf("Level_")){const e=parseInt(t.substr(6),10);if(!isNaN(e))return e}return 0}function jr(t){if(!t||0===t.length)return null;const e=new gi.Z(t).toRgba();return{r:e[0],g:e[1],b:e[2],a:e[3]}}function $r(t,e,s,i,r,n,o){const a=e[t];if(a){const t=a[s];if("string"==typeof t||"number"==typeof t||t instanceof Array)return n?n.call(null,t,o):t;if(null!=t&&t instanceof Mi.mz)return(e,s,a)=>{let l=er(t,e,{$view:a},i.geometryType,s);return null!==l&&n&&(l=n.call(null,l,o)),null!==l?l:r}}return r}function Qr(t){return t?t.charAt(0).toLowerCase()+t.substr(1):t}function tn(t,e,s,i){for(const t of e)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(s,i,r)=>{for(const t of e)t.fn&&(t.value=t.fn(s,i,r));const n=[];for(let s of t){const t=s?.primitiveName;if(t){let i=!1;for(const r of e)if(r.primitiveName===t){const t=Qr(r.propertyName);null!=r.value&&r.value!==s[t]&&(i||(s=(0,ht.d9)(s),i=!0),s[t]=r.value)}}n.push(s)}return n}}function en(t,e,s,i){const r=[];if(hr.findApplicableOverrides(t,e,r),0===r.length)return t;for(const t of r)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(e,s,i)=>{for(const t of r)t.fn&&(t.value=t.fn(e,s,i));const n=(0,ht.d9)(t),o=t.primitiveName;for(const t of r)if(t.primitiveName===o){const e=Qr(t.propertyName);null!=t.value&&t.value!==n[e]&&(n[e]=t.value)}return n}}function sn(t,e,s,i){for(const t of s)if(t.valueExpressionInfo){const s=e[t.primitiveName]&&e[t.primitiveName][t.propertyName];s instanceof Mi.mz&&(t.fn=(t,e,r)=>er(s,t,{$view:r},i.geometryType,e))}return(e,i,r)=>{for(const t of s)t.fn&&(t.value=t.fn(e,i,r));return(0,xi.hP)(t+hr.buildOverrideKey(s)).toString()}}function rn(t,e,s,i,r){let n=!1,o="";for(const s of t)s.primitiveName===e&&(void 0!==s.value?o+=`-${s.primitiveName}-${s.propertyName}-${JSON.stringify(s.value)}`:s.valueExpressionInfo&&(n=!0));return(0,h.pC)(s)&&"function"==typeof s&&(n=!0),(0,h.pC)(i)&&"function"==typeof i&&(n=!0),(0,h.pC)(r)&&"function"==typeof r&&(n=!0),[n,o]}const nn=t=>t&&2===t.length&&t[0].enable&&t[1].enable&&"CIMSolidStroke"===t[0].type&&"CIMSolidFill"===t[1].type&&!t[0].effects&&!t[1].effects,on=l.Z.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class an extends ys{constructor(t){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=t}analyze(t,e,s,i,r){if(r&&0===r.length)return null;const n=r&&r.length>0,o=e.readLegacyFeature(),a=e.getObjectId(),l=this._materialCache,h=this._cimLayer.materialHash;if(!h)return on.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c="function"==typeof h?h(o,s,i,a):h;if(l.has(c)){const t=l.get(c);return Promise.resolve(t)}const u=this._ongoingMaterialRequestMap.get(c);if(u)return u;const f=this._cimLayer,m=function(t,e){if(!e||0===e.length)return t;const s=(0,ht.d9)(t);return hr.applyOverrides(s,e),s}(f.cim,this._cimLayer.materialOverrides);m.mosaicHash=c;const{type:_,url:p}=f,d={cim:m,type:_,mosaicHash:c,url:p,size:null,dashTemplate:null,text:null,fontName:null,objectId:a,animatedSymbolProperties:null};switch(_){case"marker":d.size=Ci(f.size,o,s,i),d.animatedSymbolProperties=Ci(f.animatedSymbolProperties,o,s,i);break;case"line":d.dashTemplate=f.dashTemplate;break;case"text":d.text=Ci(f.text,o,s,i),d.fontName=Ci(f.fontName,o,s,i)}const g=t.getMosaicItem(d,r).then((t=>(n||(this._ongoingMaterialRequestMap.delete(c),l.set(c,t)),t))).catch((t=>(this._ongoingMaterialRequestMap.delete(c),on.error(".analyze()",t.message),null)));return n||this._ongoingMaterialRequestMap.set(c,g),g}}function ln(t,e){if(t&&"name"in t){const s=t;return e&&e.error(new o.Z(s.name,s.message,s.details)),!1}return!0}class hn extends(di(an)){constructor(t,e,s){if(super(t),this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI)),tt(t.color)){const e=(e,s,i)=>{const r=t.color(e,s,i);return r&&(0,Y.t2)(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&(0,Y.t2)(e)||0}const i="CIMMarkerPlacementInsidePolygon"===t.cim.placement?.type&&t.cim.placement.shiftOddRows?2:1,r=t.height;if(tt(r)){const t=(t,e,s)=>r(t,e,s)*i;this._dynamicPropertyMap.set("_height",t)}else this._height=(r||0)*i;const n=t.offsetX;if(tt(n)){const t=(t,e,s)=>(0,B.F2)(n(t,e,s));this._dynamicPropertyMap.set("_offsetX",t)}else this._offsetX=(0,B.F2)(n||0);const o=t.offsetY;if(tt(o)){const t=(t,e,s)=>(0,B.F2)(-o(t,e,s));this._dynamicPropertyMap.set("_offsetY",t)}else this._offsetY=(0,B.F2)(-o||0);const a=t.scaleX;tt(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a||1;const l=t.angle;if(tt(l)){const t=(t,e,s)=>(0,Ts.s5)(l(t,e,s));this._dynamicPropertyMap.set("_angle",t)}else this._angle=(0,Ts.s5)(l)||0;if((0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._cimFillLayer=t,this._bitset=(t.colorLocked?A.Uh:0)|(t.applyRandomOffset?A.jk:0)|(t.sampleAlphaOnly?A.Iv:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[s,i]=st(t.scaleInfo,e);return new hn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)}));const r=q.dk.load(this._fillMaterialKey),n=this._materialCache,o=(0,this._cimFillLayer.materialHash)(i,e,s),a=n.get(o);let l=null;if(a&&ln(a.spriteMosaicItem)&&(l=a.spriteMosaicItem),l){const{rect:t,width:e,height:s}=l,i=t.x+A.fL,n=t.y+A.fL,o=i+e,a=n+s;let h=Math.round((0,B.F2)(this._height));h<=0&&(h=a-n);let c=Math.round((0,B.F2)(this._height/s*e||0));c<=0&&(c=o-i);const u=this._scaleX,f=1;this.tl=(0,J.UJ)(i,n),this.br=(0,J.UJ)(o,a),this.aux21=(0,J.UJ)(c,h),this.aux22=(0,J.UJ)(this._offsetX,this._offsetY),this.aux3=(0,J.Jz)(128*u,128*f,this._angle,0),r.sdf=l.sdf,r.pattern=!0,r.textureBinding=l.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class cn extends(ui(an)){constructor(t,e,s){super(t),this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI)),this._cimLineLayer=t;let i=0;tt(t.width)||(i=.5*(0,B.F2)(t.width)),this._dynamicPropertyMap.set("_halfWidth",((e,s,r)=>tt(t.width)?.5*(0,B.F2)(t.width(e,s,r)):i)),tt(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,tt(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const r=t.color;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=r&&(0,Y.t2)(r)||0;const n=t.miterLimit;if(tt(n)){const t=(t,e,s)=>et(n(t,e,s));this._dynamicPropertyMap.set("_miterLimitCosine",t)}else this._miterLimitCosine=et(n);if((0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._scaleFactor=t.scaleFactor||1,this._isDashed=null!=t.dashTemplate;const o=t.colorLocked?A.Uh:0,a=t.scaleDash?A._6:0,l=t.sampleAlphaOnly?A.Iv:0;this.tessellationProperties._bitset=o|a|l,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[s,i]=st(t.scaleInfo,e);return new cn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)})),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(i,e,s),o=r.get(n);let a=null;if(o&&ln(o.spriteMosaicItem)&&(a=o.spriteMosaicItem),a){this._hasPattern=!0;const{rect:t,width:e,height:s}=a,i=t.x+A.fL,r=t.y+A.fL,n=i+e,o=r+s;this.tessellationProperties._tl=(0,J.UJ)(i,r),this.tessellationProperties._br=(0,J.UJ)(n,o)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const l=q.a.load(this._materialKey);a&&(l.sdf=a.sdf,l.pattern=!0,l.textureBinding=a.textureBinding),this._materialKey=l.data}}const un=(0,ns.c)(),fn=ss();class mn extends(Ls(an)){constructor(t,e,s){super(t),this._cimMarkerLayer=t,this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI));const i=t.color;if(tt(i)){const t=(t,e,s)=>(0,Y.t2)(i(t,e,s));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=(0,Y.t2)(i);const r=t.outlineColor;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_outlineColor",t)}else this._outlineColor=(0,Y.t2)(r);const n=t.size;if(tt(n)){const t=(t,e,s)=>(0,B.F2)(n(t,e,s));this._dynamicPropertyMap.set("_size",t)}else this._size=(0,B.F2)(n)||0;const o=t.scaleX;tt(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const a=t.offsetX;if(tt(a)){const t=(t,e,s)=>(0,B.F2)(a(t,e,s));this._dynamicPropertyMap.set("xOffset",t)}else this.xOffset=(0,B.F2)(a)||0;const l=t.offsetY;if(tt(l)){const t=(t,e,s)=>(0,B.F2)(l(t,e,s));this._dynamicPropertyMap.set("yOffset",t)}else this.yOffset=(0,B.F2)(l)||0;const c=t.outlineWidth;if(tt(c)){const t=(t,e,s)=>(0,B.F2)(c(t,e,s));this._dynamicPropertyMap.set("_outlineWidth",t)}else this._outlineWidth=(0,B.F2)(c)||0;const u=t.rotation;if(tt(u)?this._dynamicPropertyMap.set("_angle",u):this._angle=u||0,(0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if((0,h.pC)(t.markerPlacement)){const e=t.markerPlacement;tt(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._markerPlacement=e}this._scaleFactor=(0,h.Pt)(t.scaleFactor,1),this._bitSet=(t.alignment===X.v2.MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[s,i]=st(t.scaleInfo,e);return new mn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature(),r=t.getObjectId();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)}));const n=this._cimMarkerLayer.materialHash,a="function"==typeof n?n(i,e,s,r):n,h=this._materialCache.get(a);if(!h||!ln(h.spriteMosaicItem)||!h.spriteMosaicItem)return void l.Z.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new o.Z("mapview-cim","Encountered an error when binding feature"));const c=h.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,f=c.width/c.height*this._scaleX,m=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let _=this._size,p=_*f;const d=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const y=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/(0,B.F2)(this._cimMarkerLayer.frameHeight):1,x=this._outlineWidth*y,M=(0,B.F2)(this._cimMarkerLayer.referenceSize);let b=0,v=0;const S=this._cimMarkerLayer.anchorPoint;S&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(b=(0,B.F2)(S.x)/(this._size*f),v=(0,B.F2)(S.y)/this._size):(b=S.x,v=S.y)),this._anchorX=b,this._anchorY=v,this._sizeOutlineWidth=(0,J.Jz)(Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*M),255))),this.angle=m;const w=Math.round(64*u);this._bitestAndDistRatio=(0,J.UJ)(this._bitSet,w);const P=c.rect.x+A.fL,C=c.rect.y+A.fL,L=P+c.width,I=C+c.height;this._texUpperLeft=(0,J.UJ)(P,C),this._texUpperRight=(0,J.UJ)(L,C),this._texBottomLeft=(0,J.UJ)(P,I),this._texBottomRight=(0,J.UJ)(L,I);const k=q.mE.load(this._materialKey);k.sdf=c.sdf,k.pattern=!0,k.textureBinding=c.textureBinding,this._materialKey=k.data,p*=u,_*=u,p*=this._scaleFactor,_*=this._scaleFactor,p*=c.rect.width/c.width,_*=c.rect.height/c.height,this._computedWidth=p,this._computedHeight=_,this._applyTransformation(fn,un),this.xOffset=d,this.yOffset=g}}function _n(t){const e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=t.charCodeAt(s);return e}class pn extends(ps(an)){constructor(t,e,s){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI));const i=t.scaleFactor||1;this._cimTextLayer=t;const r=t.color;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_color",t)}else this._color=(0,Y.t2)(r);const n=t.outlineColor;if(tt(n)){const t=(t,e,s)=>(0,Y.t2)(n(t,e,s));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=(0,Y.t2)(n);let o,a,l;if(tt(t.size)||(o=Math.min(Math.round((0,B.F2)(t.size*t.sizeRatio)),127)),this._dynamicPropertyMap.set("_size",((e,s,i)=>tt(t.size)?Math.min(Math.round((0,B.F2)(t.size(e,s,i)*t.sizeRatio)),127):o)),tt(t.outlineSize)){const e=(e,s,i)=>Math.min(Math.floor(5*(0,B.F2)(t.outlineSize(e,s,i)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(5*(0,B.F2)(t.outlineSize*t.sizeRatio)),127);if(tt(t.offsetX)||(a=Math.round((0,B.F2)(t.offsetX*t.sizeRatio))),this._dynamicPropertyMap.set("_xOffset",((e,s,i)=>tt(t.offsetX)?Math.round((0,B.F2)(t.offsetX(e,s,i)*t.sizeRatio)):a)),tt(t.offsetY)||(l=Math.round((0,B.F2)(t.offsetY*t.sizeRatio))),this._dynamicPropertyMap.set("_yOffset",((e,s,i)=>tt(t.offsetY)?Math.round((0,B.F2)(t.offsetY(e,s,i)*t.sizeRatio)):l)),tt(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,tt(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,tt(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,(0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if((0,h.pC)(t.markerPlacement)){const e=t.markerPlacement;tt(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._textPlacement=e}tt(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=i;const c=Math.min(Math.round((0,B.F2)(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*c)),this._materialKey=t.materialKey;const u=q.qr.load(this._materialKey);u.sdf=!0,this._bitset=(t.alignment===X.v2.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=u.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[s,i]=st(t.scaleInfo,e);return new pn(t,s,i)}async analyze(t,e,s,i){const r=e.readLegacyFeature(),n=function(t,e,s,i){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,s,i):""}(this._cimTextLayer,r,s,i),o=await super.analyze(t,e,s,i,_n(n));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(n,o.glyphMosaicItems),o}bindFeature(t,e,s){const i=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)})),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/A.Ex,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=(0,H.kH)((0,h.Pt)(this._horizontalAlignment,"center")),this._yAlignD=(0,H.b7)((0,h.Pt)(this._verticalAlignment,"baseline"));const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const dn=128;class gn extends(di(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p){super(),this._effects=m;const d=q.dk.load(t);e&&(d.sdf=e.sdf,d.pattern=!0,d.textureBinding=e.textureBinding),this.fillColor=s,this.tl=i,this.br=r,this.aux21=(0,J.UJ)(n,o),this.aux22=(0,J.UJ)(a,l),this.aux3=(0,J.Jz)(h,c,u,0),this._bitset=f,this._minMaxZoom=(0,J.UJ)(Math.round(_*A.MI),Math.round(p*A.MI)),this._materialKey=d.data}static fromCIMFill(t,e,s){const i=t.color,r=i&&(0,Y.t2)(i)||0,n=t.materialKey,[o,a]=st(t.scaleInfo,s),l=(t.colorLocked?A.Uh:0)|(t.applyRandomOffset?A.jk:0)|(t.sampleAlphaOnly?A.Iv:0);if(!e)return new gn(n,null,r,0,0,0,0,0,0,0,0,0,l,t.effects,o,a);const{rect:h,width:c,height:u}=e,f=t.scaleX||1,m=h.x+A.fL,_=h.y+A.fL,p=m+c,d=_+u,g=(0,B.F2)(t.height),y=f*g;let x=Math.round(g);x<=0&&(x=d-_);let M=Math.round(y);M<=0&&(M=p-m);const b=(0,B.F2)(t.offsetX||0),v=(0,B.F2)(-t.offsetY||0),S=(0,J.UJ)(m,_),w=(0,J.UJ)(p,d);return new gn(n,e,r,S,w,M,x,b,v,dn,dn,(0,Ts.s5)(t.angle),l,t.effects,o,a)}static fromSimpleFill(t,e,s=!1){const{color:i}=t,r=i&&"esriSFSNull"!==t.style&&(0,Y.aH)(i)||0,n=s?A.Uh:0,o=t.materialKey;let a;if(e){const{rect:t,width:s,height:i,pixelRatio:l}=e,h=t.x+A.fL,c=t.y+A.fL,u=h+s,f=c+i,m=(0,J.UJ)(h,c),_=(0,J.UJ)(u,f);a=new gn(o,e,r,m,_,s/l,i/l,0,0,dn,dn,0,n,null,0,Z)}else a=new gn(o,null,r,0,0,0,0,0,0,0,0,0,n,null,0,Z);return a._maybeAddLineTemplate(t),a}static fromPictureFill(t,e,s=!1){const i=A.ru,{rect:r,width:n,height:o}=e,a=r.x+A.fL,l=r.y+A.fL,h=a+n,c=l+o,u=(0,J.UJ)(a,l),f=(0,J.UJ)(h,c),m=Math.round((0,B.F2)(t.width)),_=Math.round((0,B.F2)(t.height)),p=(0,B.F2)(t.xoffset),d=(0,B.F2)(-t.yoffset),g=t.materialKey,y=s?A.Uh:0,x=new gn(g,e,i,u,f,m,_,p,d,dn*t.xscale,dn*t.yscale,0,y,null,0,Z);return x._maybeAddLineTemplate(t),x}}class yn{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=(0,c.hh)()}release(){const t=this._resolver;this._resolver=null,t?.resolve()}}const xn={marker:p.LW.MARKER,fill:p.LW.FILL,line:p.LW.LINE,text:p.LW.TEXT};class Mn{constructor(t,e,s,i){const r={minScale:e?.minScale,maxScale:e?.maxScale},n=function(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}(r);this.layers=t,this.data=e,this.hash=this._createHash()+n,this.rendererKey=s;const o={isOutline:!1,placement:null,symbologyType:p.mD.DEFAULT,vvFlags:s};for(const e of t){const t=xn[e.type];o.isOutline="line"===e.type&&e.isOutline,e.materialKey=(0,q.jj)(t,o),e.maxVVSize=i,e.scaleInfo=r,e.templateHash+=n}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}var bn=s(32243),vn=s(17452),Sn=s(65587),wn=s(25929),Pn=s(27883);async function Cn(t,e,s){if(!t.name)throw new o.Z("style-symbol-reference-name-missing","Missing name in style symbol reference");if(t.styleName&&"Esri2DPointSymbolsStyle"===t.styleName)return async function(t,e){const s=Pn.wm.replace(/\{SymbolName\}/gi,t.name);try{const t=await(0,Pn.EJ)(s,e);return(0,Pn.KV)(t.data)}catch(t){return(0,c.k_)(t),null}}(t,s);try{return async function(t,e,s,i){const r=t.data,n={portal:s&&(0,h.pC)(s.portal)?s.portal:Sn.Z.getDefault(),url:(0,vn.mN)(t.baseUrl),origin:"portal-item"},a=r.items.find((t=>t.name===e));if(!a)throw new o.Z("symbolstyleutils:symbol-name-not-found",`The symbol name '${e}' could not be found`,{symbolName:e});let l=(0,wn.f)((0,Pn.v9)(a,"cimRef"),n);(0,bn.XO)()&&(l=(0,bn.pJ)(l));try{const t=await(0,Pn.EJ)(l,i);return(0,Pn.KV)(t.data)}catch(t){return(0,c.k_)(t),null}}(await(0,Pn.n2)(t,e,s),t.name,e,s)}catch(t){return(0,c.k_)(t),null}}const Ln=async(t,e,s)=>new Mn(await async function(t,e,s,i,r){const n=i??[];if(!t)return n;let o,a;const l={};if("CIMSymbolReference"!==t.type)return Ar.error("Expect cim type to be 'CIMSymbolReference'"),n;if(o=t.symbol,a=t.primitiveOverrides,a){const t=[];for(const s of a){const i=s.valueExpressionInfo;if(i&&e){const r=i.expression,n=(0,Mi.Yi)(r,e.spatialReference,e.fields).then((t=>{(0,h.Wi)(t)||Rr(l,s.primitiveName,s.propertyName,t)}));t.push(n)}else null!=s.value&&Rr(l,s.primitiveName,s.propertyName,s.value)}t.length>0&&await Promise.all(t)}const c=[];switch(lr.fetchResources(o,s,c),c.length>0&&await Promise.all(c),o.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":!function(t,e,s,i,r,n,o){if(!t)return;const a=t.symbolLayers;if(!a)return;const l=t.effects;let h;const c=lr.getSize(t);"CIMPointSymbol"===t.type&&"Map"===t.angleAlignment&&(h=X.v2.MAP);let u=a.length;for(;u--;){const f=a[u];if(!f||!1===f.enable)continue;let m;l&&l.length&&(m=[...l]);const _=f.effects;_&&_.length&&(l?m.push(..._):m=[..._]);const p=[];let d;hr.findEffectOverrides(m,e,p),d=p.length>0?tn(m,p,s,i):m;const g=[];switch(hr.findApplicableOverrides(f,e,g),f.type){case"CIMSolidFill":Or(f,d,s,g,i,r);break;case"CIMPictureFill":Wr(f,d,s,g,i,n,r);break;case"CIMHatchFill":Vr(f,d,s,g,i,r);break;case"CIMGradientFill":Dr(f,d,s,g,i,r);break;case"CIMSolidStroke":Gr(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMPictureStroke":Ur(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMGradientStroke":Br(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMCharacterMarker":if(Xr(f,d,s,g,i,r))break;break;case"CIMPictureMarker":if(Xr(f,d,s,g,i,r))break;"CIMLineSymbol"===t.type&&(h=Nr(f)),Hr(f,d,s,g,i,n,r,h,c);break;case"CIMVectorMarker":if(Xr(f,d,s,g,i,r))break;"CIMLineSymbol"===t.type&&(h=Nr(f)),Yr(f,d,s,g,i,r,n,h,c,o);break;default:Ar.error("Cannot analyze CIM layer",f.type)}}}(o,a,l,e,n,s,r)}return n}(t.data,e,s),t.data,t.rendererKey,t.maxVVSize),In=async(t,e,s,i)=>{if(!t)return null;if("cim"===t.type)return Ln(t,e,s);if("web-style"===t.type){const r={type:"cim",data:await Cn(t,null,i),rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return Ln(r,e,s)}return t};function kn(t){if(!t)return null;const{type:e,cim:s,url:i,materialHash:r}=t,n={cim:s,type:e,mosaicHash:r,url:i,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null};switch(e){case"marker":n.size=t.size,n.path=t.path,n.animatedSymbolProperties=t.animatedSymbolProperties;break;case"line":n.dashTemplate=t.dashTemplate;break;case"text":n.text=t.text,n.fontName=t.fontName}return n}const Tn=l.Z.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),zn=new Array,An={isOutline:!1,placement:null,symbologyType:p.mD.DEFAULT,vvFlags:0},En={...ks.eG,hash:JSON.stringify(ks.eG),materialKey:(0,q.jj)(p.LW.MARKER,An)},Fn={...ks.wW,hash:JSON.stringify(ks.wW),materialKey:(0,q.jj)(p.LW.LINE,An)},Rn={...ks.lj,hash:JSON.stringify(ks.lj),materialKey:(0,q.jj)(p.LW.FILL,An)};function Nn(t,e){const s=t.length;return t.push(null),e.then((e=>t[s]=e)),t}function On(t){return!!(1&t)}class Wn{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new yn,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const s=t.hash;if(this._symbolToTemplate.has(s))return this._symbolToTemplate.get(s);const i=new Array;e&&this._createMeshTemplates(i,e,!0),this._createMeshTemplates(i,t,!1);const r=this._createGroupId("expanded-cim"===t.type&&Vn(t));return this._idToTemplateGroup.set(r,i),this._symbolToTemplate.set(s,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):zn}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(On(t)||Tn.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):zn}getMosaicItem(t,e){const s=this._createTemplateId(),i=new Promise((t=>this._idToResolver.set(s,t)));return this._fetchQueue.push({symbol:t,id:s,glyphIds:e}),i}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?async function(t,e,s){try{await t.acquire(),await e(s),t.release()}catch(e){throw t.release(),e}}(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],Rn,!1),marker:this._createMeshTemplates([],En,!1),line:this._createMeshTemplates([],Fn,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,s=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(s).then((()=>this._fetchResource(e,t).then((t=>{for(const{id:e,mosaicItem:s}of t)this._idToResolver.get(e)(s),this._idToResolver.delete(e)})))).catch((t=>{(0,c.D_)(t)?this._fetchQueue=this._fetchQueue.concat(e):"worker:port-closed"===t.name||Tn.error(new o.Z("mapview-template-store","Unable to fetch requested texture resources",t))}))}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?gn.fromSimpleFill(t,s,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?gn.fromPictureFill(t,s,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?pi.fromSimpleLine(t,s):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return xs.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(kn(t),_n(t.text));return ln(e,Tn)?xs.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?gn.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?pi.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?Is.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let s;switch(t.type){case"marker":s=await this._createCIMMarker(t);break;case"line":s=await this._createCIMLine(t);break;case"fill":s=await this._createCIMFill(t);break;case"text":s=await this._createCIMText(t)}return this._cimTemplateCache.set(e,s),s}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let s;switch(t.type){case"marker":s=mn.fromCIMMarker(t,this._tileInfo);break;case"line":s=cn.fromCIMLine(t,this._tileInfo);break;case"fill":s=hn.fromCIMFill(t,this._tileInfo);break;case"text":s=pn.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,s),s}_createPrimitiveMeshTemplates(t,e,s){switch(e.type){case"esriSMS":return Nn(t,this._createSMS(e));case"esriPMS":return Nn(t,this._createPMS(e));case"esriSFS":return Nn(t,this._createSFS(e,s));case"line-marker":return Nn(t,this._createLMS(e));case"esriPFS":return Nn(t,this._createPFS(e,s));case"esriSLS":return Nn(t,this._createSLS(e,!1));case"esriTS":return Nn(t,this._createTS(e));default:return Tn.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,s){if(e.type.includes("3d"))return Tn.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const s of e.layers)"function"==typeof s.materialHash?Nn(t,this._createDynamicCIM(s)):Nn(t,this._createCIM(s));return t}if("composite-symbol"===e.type){for(const i of e.layers)this._createPrimitiveMeshTemplates(t,i,s);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,s)}}const Vn=t=>{if(!t.layers)return!1;for(const e of t.layers)if("function"==typeof e.materialHash)return!0;return!1};class Dn{constructor(t,e,s){this._loadPromise=(0,G.j)(),this._geometryType=t,this._idField=e,this._templateStore=s}update(t,e){(0,h.pC)(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const s=new Map;if("simple"===t.type){for(const i of t.classes){const t=Ps.fromLabelClass(i,e);s.set(i.index,t)}return s}for(const i in t.classes){const r=t.classes[i];for(const t of r){const i=Ps.fromLabelClass(t,e);s.set(t.index,i)}}return s}get templates(){return this._templateStore}async analyze(t,e,s,i,r,n,o){if((0,c.Hc)(o))return;let a;"dictionary"===s.type&&(a=await s.analyze(this._idField,t.copy(),e,r,n,o));let l=0;for(;t.next();){let e;if(e=a?a[l++]:(0,h.pC)(i)&&(0,_.nE)(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?i.match(this._idField,t,this._geometryType,r,n):s.match(this._idField,t,this._geometryType,r,n),t.setGroupId(e),On(e)){const s=this._templateStore.getDynamicTemplateGroup(e);for(const e of s)e&&e.analyze&&e.analyze(this._templateStore,t,r,n)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,s,i,r,n){if((0,c.Hc)(n))return;const o=t.getCursor();for(s&&await s.analyze(this._idField,o.copy(),e,i,r,n);o.next();){let t=o.getGroupId();if(null!=t&&-1!==t||(t=s.match(this._idField,o,o.geometryType,i,r),o.setGroupId(t)),On(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,o,i,r)}o.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(n)}writeGraphic(t,e,s,i){const r=e.getGroupId(),n=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),null!=n){if(On(r))for(const t of o)t&&t.bindFeature(e,null,null);if(o){for(const r of o)r&&r.write(t,e,s,i);t.featureEnd()}}}writeCursor(t,e,s,i,r,n,o){const a=e.getGroupId(),l=e.getDisplayId(),c=this._templateStore.getTemplateGroup(a),u=this._schema.mesh.sortKey;let f=0;if((0,h.pC)(u)&&(f=null!=u.fieldIndex?e.getComputedNumericAtIndex(u.fieldIndex):null!=u.field?e.readAttribute(u.field):e.readAttribute(this._idField),f*="asc"===u.order?1:-1),t.featureStart(0,null==f||isNaN(f)?0:f),null!=l&&c){if(On(a))for(const t of c)t.bindFeature(e,s,i);for(const s of c)s.write(t,e,r,o);if((0,h.pC)(n)&&t.hasRecords){const s=n&&this._findLabelRef(c);this._writeLabels(t,e,n,s,r,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof Is)return e;return null}_writeLabels(t,e,s,i,r,n){for(const o of s)if((0,h.pC)(o)&&o){const{glyphs:s,rtl:a,index:l}=o,h=this._labelTemplates.get(l);h.setZoomLevel(r),h.bindReferenceTemplate(i),h.bindTextInfo(s,a),h.write(t,e,null,n)}}}var Gn=s(13867);const Un=l.Z.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Bn(t,e,s,i){switch(t.type){case"simple":case"heatmap":return Xn.fromBasicRenderer(t,e,s,i);case"map":return Jn.fromUVRenderer(t,e,s,i);case"interval":return Yn.fromCBRenderer(t,e,s,i);case"dictionary":return Kn.fromDictionaryRenderer(t,e,s,i);case"pie-chart":return Hn.fromPieChartRenderer(t,e,s,i);case"subtype":return Hn.fromSubtypes(t,e,s,i)}}class Xn{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,s,i){const r=new Xn;if(t.symbol){const n=await In(t.symbol,s,i),o=e.createTemplateGroup(n,null);r.setDefault(o)}return r}static async fromPieChartRenderer(t,e,s,i){const r=new Xn;if(t.markerSymbol){const n=await In(t.markerSymbol,s,i);let o;t.fillSymbol&&(o=await In(t.fillSymbol,s,i));const a=e.createTemplateGroup(n,o);r.setDefault(a)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,s,i,r){return this.getDefault()}async analyze(t,e,s,i,r,n){return null}}class Hn extends Xn{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,s,i){const r=new Map,n=[];for(const o in t.renderers){const a=parseInt(o,10),l=Bn(t.renderers[o],e,s,i).then((t=>r.set(a,t)));n.push(l)}return await Promise.all(n),new Hn(r,t.subtypeField)}match(t,e,s,i,r){const n=e.readAttribute(this._subtypeField),o=this._subMatchers.get(n);return o?o.match(t,e,s,i,r):null}}class Yn extends Xn{constructor(t,e,s,i){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=i,this._field=t,this._normalizationInfo=s}static async fromCBRenderer(t,e,s,i){const{isMaxInclusive:r,normalizationField:n,normalizationTotal:o,normalizationType:a}=t,l=t.field,h=new Yn(l,r,{normalizationField:n,normalizationTotal:o,normalizationType:a},t.fieldIndex),c=await In(t.backgroundFillSymbol,s,i);await Promise.all(t.intervals.map((async t=>{const r=await In(t.symbol,s,i),n=await e.createTemplateGroup(r,c),o={min:t.min,max:t.max};h.add(o,n)})));const u=await In(t.defaultSymbol,s,i);if(u){const t=await e.createTemplateGroup(u,c);h.setDefault(t)}return h}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort(((t,e)=>t.interval.min-e.interval.min))}size(){return super.size()+this._intervals.length}match(t,e,s,i,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(null==n||isNaN(n)||n===1/0||n===-1/0)return this.getDefault();for(let t=0;t<this._intervals.length;t++){const{interval:e,result:s}=this._intervals[t],i=n>=e.min,r=this._isMaxInclusive?n<=e.max:n<e.max;if(i&&r)return s}return this.getDefault()}_needsNormalization(){const t=this._normalizationInfo;return t&&(t.normalizationField||t.normalizationTotal||t.normalizationType)}_getValueFromField(t){const e=t.readAttribute(this._field);if(!this._needsNormalization()||null==e)return e;const{normalizationField:s,normalizationTotal:i,normalizationType:r}=this._normalizationInfo,n=!!s&&t.readAttribute(s);if(r)switch(r){case"esriNormalizeByField":return n?e/n:void 0;case"esriNormalizeByLog":return Math.log(e)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return e/i*100;default:return void Un.error(`Found unknown normalization type: ${r}`)}else Un.error("Normalization is required, but no type was set!")}}class Jn extends Xn{constructor(t,e,s){super(),this.type="map",this._nullResult=null,this._resultsMap=new Map,this._fieldsIndex=s,this._fields=t,this._seperator=e||""}static async fromUVRenderer(t,e,s,i){const r=t.fieldDelimiter,n=[t.field];t.field2&&n.push(t.field2),t.field3&&n.push(t.field3);const o=await In(t.backgroundFillSymbol,s,i),a=new Jn(n,r,t.fieldIndex);await Promise.all(t.map.map((async t=>{const r=await In(t.symbol,s,i),n=await e.createTemplateGroup(r,o);"<Null>"===t.value?a.setNullResult(n):a.add(t.value,n)})));const l=await In(t.defaultSymbol,s,i);if(l){const t=await e.createTemplateGroup(l,o);a.setDefault(t)}return a}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,s,i,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||"<Null>"===n))return this._nullResult;if(null==n)return this.getDefault();const o=n.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const s of this._fields){const i=t.readAttribute(s);null==i||""===i?e.push("<Null>"):e.push(i)}return e.join(this._seperator)}}let qn;async function Zn(){return qn||(qn=s.e(5329).then(s.bind(s,25329))),qn}class Kn extends Xn{constructor(t,e,s,i,r,n){super(),this.type="dictionary",this._groupIdCache=new Gn.Z(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=s,this._scaleFn=i,this._schemaUtilsModule=r,this._symbolOptions=n}static async fromDictionaryRenderer(t,e,i,r){const[{DictionaryLoader:n},o]=await Promise.all([s.e(4475).then(s.bind(s,84475)),Zn()]),a=new n(t.url,t.config,t.fieldMap);await a.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const l=await async function(t,e){const s=t||1;if("number"==typeof s)return(t,e,i)=>s;const i=await(0,Mi.Yi)(s,e.spatialReference,e.fields);return(t,s,r)=>er(i,t,{$view:r},e.geometryType,s)||1}(t.scaleExpression,i);return new Kn(a,e,i,l,o,t.symbolOptions)}async _analyzeFeature(t,e,s,i,r){const n=t.readLegacyFeature(),a=this._scaleFn(n,s,i),l=this._attributeHash(n)+"-"+a,h=this._groupIdCache.get(l);if(h)return h;const c={...i,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},u=await this._loader.getSymbolAsync(n,c),f=this._schemaUtilsModule.createSymbolSchema(u,this._symbolOptions),m=In(f,this._info,e,r).then((t=>{if("expanded-cim"!==t.type)return Un.error(new o.Z("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+a;for(const e of t.layers)e.scaleFactor=a,e.templateHash+="-"+a;return this._templates.createTemplateGroup(t,null)}));return this._groupIdCache.put(l,m,1),m}async analyze(t,e,s,i,r,n){const o=e.getCursor(),a=[];for(;o.next();)a.push(this._analyzeFeature(o,s,i,r,n));return Promise.all(a)}match(t,e,s,i,r){return null}_attributeHash(t){let e="";for(const s of this._symbolFields){const i=this._fieldMap[s];i&&(e+=t.attributes[i]+"-")}return e}}var jn=s(47988);class $n{constructor(t){this._remoteClient=t,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){}async fetchResource(t,e){const s=this._resourceMap,i=s.get(t);if(i)return i;let r=this._inFlightResourceMap.get(t);if(r)return r;try{r=this._remoteClient.invoke("tileRenderer.fetchResource",{url:t},{...e}),this._inFlightResourceMap.set(t,r),r.then((e=>(this._inFlightResourceMap.delete(t),s.set(t,e),e)))}catch(t){return(0,c.D_)(t)?null:{width:0,height:0}}return r}getResource(t){return this._resourceMap.get(t)??null}}function Qn(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function to(t){const e=t.message,s={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin,version:e.version},transferList:new Array};for(const t in e.data){const i=e.data[t];if(s.message.data[t]=null,(0,h.pC)(i)){const e=i.stride,r=i.indices.slice(0),n=i.vertices.slice(0),o=i.records.slice(0),a={stride:e,indices:r,vertices:n,records:o,metrics:(0,h.yw)(i.metrics,(t=>t.slice(0)))};s.transferList.push(r,n,o),s.message.data[t]=a}}return s}let eo=class extends jn.Z{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new $n(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach((e=>{e.forEach(t)}))}async update(t,e){const s=e.schema.processors[0];if("symbol"!==s.type)return;const i=(0,f.Hg)(this._schema,s);((0,f.uD)(i,"mesh")||(0,f.uD)(i,"target"))&&(t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,s,i){return(0,c.k_)(i),this._onTileData(t,e,s,i)}onTileClear(t){return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:{clear:!0}})}onTileError(t,e,s){const i=s.signal,r={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:i})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach((t=>{for(const s of t)s.message.tileKey===e.id&&this._updateTileMesh("append",e,to(s),[],!1,!1,null)}))}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(to(e))}_createFactory(t){const{geometryType:e,objectIdField:s,fields:i}=this.service,r={geometryType:e,fields:i,spatialReference:m.Z.fromJSON(this.spatialReference)},n=new Wn(((t,e)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",t,e)),this.tileStore.tileScheme.tileInfo),{matcher:o,aggregateMatcher:a}=t.mesh;return this._store=n,this._matchers.feature=Bn(o,n,r,this._resourceManagerProxy),this._matchers.aggregate=(0,h.yw)(a,(t=>Bn(t,n,r,this._resourceManagerProxy))),new Dn(e,s,n)}async _onTileData(t,e,s,i){(0,c.k_)(i);const{type:r,addOrUpdate:n,remove:o,clear:a,end:l}=e,u=!!this._schema.mesh.sortKey;if(!n){const e={type:r,addOrUpdate:null,remove:o,clear:a,end:l,sort:u};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},i)}const f=this._processFeatures(t,n,s,i,e.status.version);try{const s=await f;if((0,h.Wi)(s)){const e={type:r,addOrUpdate:null,remove:o,clear:a,end:l,sort:u};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},i)}const n=[];for(const e of s){let s=!1;const i=e.message.bufferIds,r=t.key.id,o=e.message.tileKey;if(r!==o&&(0,h.pC)(i)){if(!this.tileStore.get(o)){this._addBufferData(r,e),n.push(e);continue}let t=this._bufferIds.get(o);t||(t=new Set,this._bufferIds.set(o,t));const a=Array.from(i);for(const e of a){if(t.has(e)){s=!0;break}t.add(e)}}s||(this._addBufferData(r,e),n.push(e))}await Promise.all(n.map((s=>{const n=t.key.id===s.message.tileKey,o=n?e.remove:[],a=n&&e.end;return this._updateTileMesh(r,t,s,o,a,e.clear,i.signal)})))}catch(e){this._handleError(t,e,i)}}async _updateTileMesh(t,e,s,i,r,n,o){const a=t,l=s.message.tileKey,u=!!this._schema.mesh.sortKey;l!==e.key.id&&(r=!1);const f=(0,h.yw)(s,(t=>t.message)),m=(0,h.yw)(s,(t=>t.transferList))||[],_={type:a,addOrUpdate:f,remove:i,clear:n,end:r,sort:u},p={transferList:(0,h.Wg)(m)||[],signal:o};return(0,c.k_)(p),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:l,data:_},p)}async _processFeatures(t,e,s,i,r){if((0,h.Wi)(e)||!e.hasFeatures)return null;const n={transform:t.transform,hasZ:!1,hasM:!1},o=this._factory,a={viewingMode:"",scale:t.scale},l=await this._matchers.feature,u=await this._matchers.aggregate;(0,c.k_)(i);const f=this._getLabelInfos(t,e);return await o.analyze(e.getCursor(),this._resourceManagerProxy,l,u,n,a),(0,c.k_)(i),this._writeFeatureSet(t,e,n,f,o,s,r)}_writeFeatureSet(t,e,s,i,r,n,o){const a=e.getSize(),l=this._schema.mesh.matcher.symbologyType,c=new D(t.key.id,{features:a,records:a,metrics:0},l,n,l!==p.mD.HEATMAP,o),u={viewingMode:"",scale:t.scale},f=e.getCursor();for(;f.next();)try{const e=f.getDisplayId(),n=(0,h.pC)(i)?i.get(e):null;r.writeCursor(c,f,s,u,t.level,n,this._resourceManagerProxy)}catch(t){}const m=t.tileInfoView.tileInfo.isWrappable;return c.serialize(m)}_handleError(t,e,s){if(!(0,c.D_)(e)){const i={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:s.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if((0,h.Wi)(e))return null;if("subtype"===e.type){const s={type:"subtype",classes:{}};let i=!1;for(const r in e.classes){const n=e.classes[r].filter((e=>Qn(e,t.scale)));i=i||!!n.length,s.classes[r]=n}return i?s:null}const s=e.classes.filter((e=>Qn(e,t.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(t,e){if("subtype"===e.type){const s=this.service.subtypeField,i=(0,h.s3)(s,"Expected to find subtype Field"),r=t.readAttribute(i);return null==r?[]:e.classes[r]??[]}return e.classes}_getLabelInfos(t,e){const s=this._getLabelingSchemaForScale(t);if((0,h.Wi)(s))return null;const i=new Map,r=e.getCursor();for(;r.next();){const t=r.getDisplayId(),e=[],o=(0,_.nE)(t),a=o&&1!==r.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(r,s);for(const s of l){if(s.target!==a)continue;const i=r.getStorage(),l=o&&"feature"===a?i.getComputedStringAtIndex(r.readAttribute("referenceId"),s.fieldIndex):i.getComputedStringAtIndex(t,s.fieldIndex);if(!l)continue;const h=n(l.toString()),c=h[0],u=h[1];this._store.getMosaicItem(s.symbol,_n(c)).then((t=>{e[s.index]={glyphs:t.glyphMosaicItems,rtl:u,index:s.index}}))}i.set(t,e)}return i}};eo=(0,i._)([(0,u.j)("esri.views.2d.layers.features.processors.SymbolProcessor")],eo);const so=eo},14867:(t,e,s)=>{function i(t,e,s,i){const r=t.clone(),n=1<<r.level,o=r.col+e,a=r.row+s;return i&&o<0?(r.col=o+n,r.world-=1):o>=n?(r.col=o-n,r.world+=1):r.col=o,r.row=a,r}s.d(e,{M:()=>i}),s(3651)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6785],{4307:(t,e,s)=>{s.d(e,{d:()=>l,s:()=>r,t:()=>f});var i=s(46851);function r(t,e,s){return t[0]=e,t[1]=s,t}function n(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function o(t,e,s){return t[0]=e[0]*s[0],t[1]=e[1]*s[1],t}function a(t,e,s){return t[0]=e[0]/s[0],t[1]=e[1]/s[1],t}function l(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}function h(t,e){const s=e[0]-t[0],i=e[1]-t[1];return s*s+i*i}function c(t){const e=t[0],s=t[1];return Math.sqrt(e*e+s*s)}function u(t){const e=t[0],s=t[1];return e*e+s*s}function f(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r+s[4],t[1]=s[1]*i+s[3]*r+s[5],t}const m=c,_=n,p=o,d=a,g=l,y=h,x=u;Object.freeze(Object.defineProperty({__proto__:null,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:r,add:function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t},subtract:n,multiply:o,divide:a,ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},min:function(t,e,s){return t[0]=Math.min(e[0],s[0]),t[1]=Math.min(e[1],s[1]),t},max:function(t,e,s){return t[0]=Math.max(e[0],s[0]),t[1]=Math.max(e[1],s[1]),t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t},scaleAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t},distance:l,squaredDistance:h,length:c,squaredLength:u,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},normalize:function(t,e){const s=e[0],i=e[1];let r=s*s+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},cross:function(t,e,s){const i=e[0]*s[1]-e[1]*s[0];return t[0]=t[1]=0,t[2]=i,t},lerp:function(t,e,s,i){const r=e[0],n=e[1];return t[0]=r+i*(s[0]-r),t[1]=n+i*(s[1]-n),t},random:function(t,e){e=e||1;const s=2*(0,i.R)()*Math.PI;return t[0]=Math.cos(s)*e,t[1]=Math.sin(s)*e,t},transformMat2:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[2]*r,t[1]=s[1]*i+s[3]*r,t},transformMat2d:f,transformMat3:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[3]*r+s[6],t[1]=s[1]*i+s[4]*r+s[7],t},transformMat4:function(t,e,s){const i=e[0],r=e[1];return t[0]=s[0]*i+s[4]*r+s[12],t[1]=s[1]*i+s[5]*r+s[13],t},rotate:function(t,e,s,i){const r=e[0]-s[0],n=e[1]-s[1],o=Math.sin(i),a=Math.cos(i);return t[0]=r*a-n*o+s[0],t[1]=r*o+n*a+s[1],t},angle:function(t,e){const s=t[0],i=t[1],r=e[0],n=e[1];let o=s*s+i*i;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const l=(s*r+i*n)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},str:function(t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},equals:function(t,e){const s=t[0],r=t[1],n=e[0],o=e[1],a=(0,i.g)();return Math.abs(s-n)<=a*Math.max(1,Math.abs(s),Math.abs(n))&&Math.abs(r-o)<=a*Math.max(1,Math.abs(r),Math.abs(o))},projectAndScale:function(t,e,s,i,r){let n=e[0]-s[0],o=e[1]-s[1];const a=(i[0]*n+i[1]*o)*(r-1);return n=i[0]*a,o=i[1]*a,t[0]=e[0]+n,t[1]=e[1]+o,t},len:m,sub:_,mul:p,div:d,dist:g,sqrDist:y,sqrLen:x},Symbol.toStringTag,{value:"Module"}))},1265:(t,e,s)=>{function i(){return new Float32Array(2)}function r(t,e){const s=new Float32Array(2);return s[0]=t,s[1]=e,s}function n(){return i()}function o(){return r(1,1)}function a(){return r(1,0)}function l(){return r(0,1)}s.d(e,{O:()=>c,Z:()=>h,c:()=>i,f:()=>r});const h=n(),c=o(),u=a(),f=l();Object.freeze(Object.defineProperty({__proto__:null,create:i,clone:function(t){const e=new Float32Array(2);return e[0]=t[0],e[1]=t[1],e},fromValues:r,createView:function(t,e){return new Float32Array(t,e,2)},zeros:n,ones:o,unitX:a,unitY:l,ZEROS:h,ONES:c,UNIT_X:u,UNIT_Y:f},Symbol.toStringTag,{value:"Module"}))},13867:(t,e,s)=>{s.d(e,{Z:()=>r});var i=s(69801);class r{constructor(t,e){this._storage=new i.WJ,this._storage.maxSize=t,e&&this._storage.registerRemoveFunc("",e)}put(t,e,s){this._storage.put(t,e,s,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}}},32243:(t,e,s)=>{function i(t){return t=t||globalThis.location.hostname,h.some((e=>null!=t?.match(e)))}function r(t,e){return t&&(e=e||globalThis.location.hostname)?null!=e.match(n)||null!=e.match(a)?t.replace("static.arcgis.com","staticdev.arcgis.com"):null!=e.match(o)||null!=e.match(l)?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}s.d(e,{XO:()=>i,pJ:()=>r});const n=/^devext.arcgis.com$/,o=/^qaext.arcgis.com$/,a=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,h=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,o,/^jsapps.esri.com$/,a,l]},62357:(t,e,s)=>{s.d(e,{F2:()=>r,Wz:()=>n,t_:()=>o});const i=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i;function r(t){return t?t/72*96:0}function n(t){return t?72*t/96:0}function o(t){if("string"==typeof t){const e=t.match(i);if(e){const s=Number(e[1]),i=e[3]&&e[3].toLowerCase(),r="-"===t.charAt(0),o="px"===i?n(s):s;return r?-o:o}return console.warn("screenUtils.toPt: input not recognized!"),null}return t}},72245:(t,e,s)=>{s.d(e,{K3:()=>r,Rx:()=>n});var i=s(80442);const r=()=>!!(0,i.Z)("enable-feature:force-wosr"),n=()=>!!(0,i.Z)("enable-feature:SceneLayer-editing")},27883:(t,e,s)=>{s.d(e,{EJ:()=>p,KV:()=>m,n2:()=>f,v9:()=>_,wm:()=>y});var i=s(3172),r=s(20102),n=s(70586),o=s(95330),a=s(17452),l=s(65587),h=s(41253),c=s(72245);const u={};function f(t,e,s){return t&&(0,n.pC)(t.styleUrl)?async function(t,e){try{return{data:(await p(t,e)).data,baseUrl:(0,a.Yd)(t),styleUrl:t}}catch(t){return(0,o.r9)(t),null}}(t.styleUrl,s):t&&(0,n.pC)(t.styleName)?function(t,e,s){const i=(0,n.pC)(e.portal)?e.portal:l.Z.getDefault();let o;const a=`${i.url} - ${i.user&&i.user.username} - ${t}`;return u[a]||(u[a]=function(t,e,s){return e.load(s).then((()=>{const i=new h.Z({disableExtraQuery:!0,query:`owner:${d} AND type:${g} AND typekeywords:"${t}"`});return e.queryItems(i,s)})).then((({results:e})=>{let i=null;const n=t.toLowerCase();if(e&&Array.isArray(e))for(const t of e){const e=t.typeKeywords?.some((t=>t.toLowerCase()===n));if(e&&t.type===g&&t.owner===d){i=t;break}}if(!i)throw new r.Z("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return i.load(s)}))}(t,i,s).then((t=>(o=t,t.fetchData()))).then((e=>({data:e,baseUrl:o.itemUrl??"",styleName:t})))),u[a]}(t.styleName,e,s):Promise.reject(new r.Z("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function m(t){return null===t||"CIMSymbolReference"===t.type?t:{type:"CIMSymbolReference",symbol:t}}function _(t,e){if("cimRef"===e)return t.cimRef;if(t.formatInfos&&!(0,c.K3)())for(const e of t.formatInfos)if("gltf"===e.type)return e.href;return t.webRef}function p(t,e){const s={responseType:"json",query:{f:"json"},...e};return(0,i.default)((0,a.Fv)(t),s)}const d="esri_en",g="Style",y="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"},31363:(t,e,s)=>{s.d(e,{B1:()=>i,DQ:()=>h,DT:()=>a,JJ:()=>r,Or:()=>c,_U:()=>n,k3:()=>u,sX:()=>f});const i=Number.POSITIVE_INFINITY,r=Math.PI,n=2*r,o=128/r,a=r/180,l=1/Math.LN2;function h(t,e){return(t%=e)>=0?t:t+e}function c(t){return h(t*o,256)}function u(t){return Math.log(t)*l}function f(t,e,s){return t*(1-s)+e*s}},35362:(t,e,s)=>{s.d(e,{E:()=>i,V:()=>r});class i{constructor(t,e){this.x=t,this.y=e}clone(){return new i(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,s=Math.sqrt(t*t+e*e);this.x/=s,this.y/=s}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const s=this.x,i=this.y;this.x=s*t-i*e,this.y=s*e+i*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const s=e.x-t.x,i=e.y-t.y;return Math.sqrt(s*s+i*i)}static add(t,e){return new i(t.x+e.x,t.y+e.y)}static sub(t,e){return new i(t.x-e.x,t.y-e.y)}}var r;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(r||(r={}))},30729:(t,e,s)=>{var i,r;function n(t){switch(t){case"left":return i.Left;case"right":return i.Right;case"center":return i.Center}}function o(t){switch(t){case"top":return r.Top;case"middle":return r.Center;case"baseline":return r.Baseline;case"bottom":return r.Bottom}}function a(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[i.Right,r.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[i.Center,r.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[i.Left,r.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[i.Right,r.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[i.Center,r.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[i.Left,r.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[i.Right,r.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[i.Center,r.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[i.Left,r.Top];default:return console.debug(`Found invalid placement type ${t}`),[i.Center,r.Center]}}function l(t){switch(t){case i.Right:return-1;case i.Center:return 0;case i.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function h(t){switch(t){case r.Top:return 1;case r.Center:return 0;case r.Bottom:case r.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function c(t){switch(t){case"left":return i.Left;case"right":return i.Right;case"center":return i.Center}}function u(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}s.d(e,{Hd:()=>c,NS:()=>u,TR:()=>r,b7:()=>o,g:()=>l,kH:()=>n,qv:()=>a,tf:()=>h}),function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"}(i||(i={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(r||(r={}))},63523:(t,e,s)=>{s.d(e,{CA:()=>h,Gq:()=>b,Xp:()=>l,a:()=>x,dk:()=>g,hF:()=>u,jj:()=>c,jy:()=>a,m2:()=>f,mE:()=>y,qr:()=>M});var i=s(20102),r=s(30729),n=s(66039);const o=Object.keys(n.mD).filter((t=>"number"==typeof n.mD[t])).reduce(((t,e)=>({...t,[e]:n.mD[e]})),{});function a(t){return t===n.mD.OUTLINE_FILL||t===n.mD.OUTLINE_FILL_SIMPLE}function l(t){return function(t){return t===n.mD.SIMPLE||t===n.mD.OUTLINE_FILL_SIMPLE}(t.symbologyType)}function h(t){return a(t.symbologyType)}function c(t,e){switch(t){case n.LW.FILL:return g.from(e);case n.LW.LINE:return x.from(e);case n.LW.MARKER:return y.from(e);case n.LW.TEXT:return M.from(e);case n.LW.LABEL:return b.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function u(t){switch(f.load(t).geometryType){case n.LW.MARKER:return new y(t);case n.LW.FILL:return new g(t);case n.LW.LINE:return new x(t);case n.LW.TEXT:return new M(t);case n.LW.LABEL:return new b(t)}}class f{constructor(t){this._data=0,this._data=t}static load(t){const e=this.shared;return e.data=t,e}set data(t){this._data=t}get data(){return this._data}get geometryType(){return this.bits(8,11)}set geometryType(t){this.setBits(t,8,11)}get mapAligned(){return!!this.bit(20)}set mapAligned(t){this.setBit(20,t)}get sdf(){return!!this.bit(11)}set sdf(t){this.setBit(11,t)}get pattern(){return!!this.bit(12)}set pattern(t){this.setBit(12,t)}get textureBinding(){return this.bits(0,8)}set textureBinding(t){this.setBits(t,0,8)}get symbologyType(){return this.bits(21,26)}set symbologyType(t){this.setBits(t,21,26)}get geometryTypeString(){switch(this.geometryType){case n.LW.FILL:return"fill";case n.LW.MARKER:return"marker";case n.LW.LINE:return"line";case n.LW.TEXT:return"text";case n.LW.LABEL:return"label";default:throw new i.Z(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const s=1<<t;e?this._data|=s:this._data&=~s}bit(t){return(this._data&1<<t)>>t}setBits(t,e,s){for(let i=e,r=0;i<s;i++,r++)this.setBit(i,0!=(t&1<<r))}bits(t,e){let s=0;for(let i=t,r=0;i<e;i++,r++)s|=this.bit(i)<<r;return s}hasVV(){return!1}setVV(t,e){}getVariation(){return{mapAligned:this.mapAligned,pattern:this.pattern,sdf:this.sdf,symbologyType:{value:n.mD[this.symbologyType],options:o,namespace:"SYMBOLOGY_TYPE"}}}getVariationHash(){return this._data&~(7&this.textureBinding)}}f.shared=new f(0);const m=t=>class extends t{get vvSizeMinMaxValue(){return 0!==this.bit(16)}set vvSizeMinMaxValue(t){this.setBit(16,t)}get vvSizeScaleStops(){return 0!==this.bit(17)}set vvSizeScaleStops(t){this.setBit(17,t)}get vvSizeFieldStops(){return 0!==this.bit(18)}set vvSizeFieldStops(t){this.setBit(18,t)}get vvSizeUnitValue(){return 0!==this.bit(19)}set vvSizeUnitValue(t){this.setBit(19,t)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(t,e){super.setVV(t,e);const s=function(t,e,s){const i=n.X.SIZE_FIELD_STOPS|n.X.SIZE_MINMAX_VALUE|n.X.SIZE_SCALE_STOPS|n.X.SIZE_UNIT_VALUE,r=(e&(n.mf.FIELD_TARGETS_OUTLINE|n.mf.MINMAX_TARGETS_OUTLINE|n.mf.SCALE_TARGETS_OUTLINE|n.mf.UNIT_TARGETS_OUTLINE))>>>4;return t===n.LW.LINE&&s.isOutline||t===n.LW.FILL&&a(s.symbologyType)?i&r:i&~r}(this.geometryType,t,e)&t;this.vvSizeMinMaxValue=!!(s&n.X.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(s&n.X.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(s&n.X.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(s&n.X.SIZE_SCALE_STOPS)}},_=t=>class extends t{get vvRotation(){return 0!==this.bit(15)}set vvRotation(t){this.setBit(15,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&n.X.ROTATION)}},p=t=>class extends t{get vvColor(){return 0!==this.bit(13)}set vvColor(t){this.setBit(13,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&n.X.COLOR)}},d=t=>class extends t{get vvOpacity(){return 0!==this.bit(14)}set vvOpacity(t){this.setBit(14,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&n.X.OPACITY)}};class g extends(p(d(m(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:s}=t,i=this.load(0);return i.geometryType=n.LW.FILL,i.symbologyType=e,e!==n.mD.DOT_DENSITY&&i.setVV(s,t),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}g.shared=new g(0);class y extends(p(d(_(m(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:s}=t,i=this.load(0);return i.geometryType=n.LW.MARKER,i.symbologyType=e,e!==n.mD.HEATMAP&&i.setVV(s,t),i.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class x extends(p(d(m(f)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LINE,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}x.shared=new x(0);class M extends(p(d(_(m(f))))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.TEXT,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}M.shared=new M(0);class b extends(m(f)){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=n.LW.LABEL,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.mapAligned=(0,r.NS)(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}b.shared=new b(0)},47988:(t,e,s)=>{s.d(e,{Z:()=>l});var i=s(43697),r=s(3920),n=s(5600),o=(s(67676),s(75215),s(52011));let a=class extends r.r{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const t=this.get("tileStore.tileScheme.spatialReference");return t&&t.toJSON()||null}};(0,i._)([(0,n.Cb)({readOnly:!0})],a.prototype,"supportsTileUpdates",null),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"remoteClient",void 0),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"service",void 0),(0,i._)([(0,n.Cb)()],a.prototype,"spatialReference",null),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileInfo",void 0),(0,i._)([(0,n.Cb)({constructOnly:!0})],a.prototype,"tileStore",void 0),a=(0,i._)([(0,o.j)("esri.views.2d.layers.features.processors.BaseProcessor")],a);const l=a},6785:(t,e,s)=>{s.r(e),s.d(e,{default:()=>so});var i=s(43697);const r=new(s(79087).Z);function n(t){if(!r.hasBidiChar(t))return[t,!1];let e;return e="rtl"===r.checkContextual(t)?"IDNNN":"ICNNN",[r.bidiTransform(t,e,"VLYSN"),!0]}var o=s(20102),a=s(80442),l=s(92604),h=s(70586),c=s(95330),u=(s(75215),s(67676),s(52011)),f=s(22862),m=s(82971),_=s(61027),p=s(66039),d=s(15923),g=s(5600),y=s(4307),x=s(49733);const M=new Set,b=[],v=new Map,S=[0,0];let w=class extends d.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e}=this;this._queue=new x.e({concurrency:t,process:(t,s)=>{const i=this._keyToItem.get(t);return e(i,{signal:s})},peeker:t=>t.values().next().value})}destroy(){this.clear(),this._queue=(0,h.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t,e){const s=t.key.id+"-"+e;if(this.has(s))return this.get(s);const i=this._queue.push(s),r=()=>{this._keyToItem.delete(s),this.notifyChange("updating")};return this._keyToItem.set(s,t),i.then(r,r),this.notifyChange("updating"),i}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);v.has(r)||(v.set(r,[]),s=Math.max(r,s),i=Math.min(r,i)),v.get(r).push(e.key),M.add(r)}));let r=this.state.scale;v.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(b,M),b.sort(((t,e)=>t-e)),r=b.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),b[0])),r=Math.min(r,s),r=Math.max(r,i);const n=v.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),l=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const s=o.denormalizeCol(t.col,t.world),i=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-s)*(a-s)+(l-t.row)*(l-t.row))-Math.sqrt((a-i)*(a-i)+(l-e.row)*(l-e.row))})),M.clear(),v.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,s=this.state.center;let i,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(S,n.key);const o=(0,y.d)(S,s);o<r&&(r=o,i=n.key)})),i.id}};(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"concurrency",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"process",void 0),(0,i._)([(0,g.Cb)()],w.prototype,"state",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"strategy",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],w.prototype,"tileInfoView",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],w.prototype,"updating",null),w=(0,i._)([(0,u.j)("esri.views.2d.tiling.PagedTileQueue")],w),s(83068);var P=s(55415);const C=new Set,L=[],I=new Map,k=[0,0];let T=class extends d.Z{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:e,strategy:s}=this;this._queue=new x.e({concurrency:t,process:(t,s)=>{const i=this._keyToItem.get(t);return e(i,{signal:s})},peeker:"scale-first"===s?t=>this._peekByScaleFirst(t):t=>this._peekByCenterFirst(t)})}destroy(){this.clear(),this._queue=(0,h.SC)(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(t){const e="string"==typeof t?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(t){return"string"==typeof t?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const e="string"==typeof t?t:t.id;return this.has(e)&&this._queue.isOngoing(e)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const s=this._queue.push(e),i=()=>{this._keyToItem.delete(e),this.notifyChange("updating")};return this._keyToItem.set(e,t),s.then(i,i),this.notifyChange("updating"),s}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView;let s=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;t.forEach((t=>{const e=this._keyToItem.get(t),r=this.tileInfoView.getTileScale(e.key);I.has(r)||(I.set(r,[]),s=Math.max(r,s),i=Math.min(r,i)),I.get(r).push(e.key),C.add(r)}));let r=this.state.scale;I.has(r)||(function(t,e){t.length=0,e.forEach((e=>t.push(e)))}(L,C),L.sort(((t,e)=>t-e)),r=L.reduce(((t,e)=>Math.abs(e-r)<Math.abs(t-r)?e:t),L[0])),r=Math.min(r,s),r=Math.max(r,i);const n=I.get(r),o=e.getClosestInfoForScale(r),a=o.getColumnForX(this.state.center[0]),l=o.getRowForY(this.state.center[1]);return n.sort(((t,e)=>{const s=o.denormalizeCol(t.col,t.world),i=o.denormalizeCol(e.col,e.world);return Math.sqrt((a-s)*(a-s)+(l-t.row)*(l-t.row))-Math.sqrt((a-i)*(a-i)+(l-e.row)*(l-e.row))})),C.clear(),I.clear(),n[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const e=this.tileInfoView,s=this.state.center;let i,r=Number.POSITIVE_INFINITY;return t.forEach((t=>{const n=this._keyToItem.get(t);e.getTileCoords(k,n.key);const o=(0,y.d)(k,s);o<r&&(r=o,i=n.key)})),i.id}};(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"concurrency",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"process",void 0),(0,i._)([(0,g.Cb)()],T.prototype,"state",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"strategy",void 0),(0,i._)([(0,g.Cb)({constructOnly:!0})],T.prototype,"tileInfoView",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],T.prototype,"updating",null),T=(0,i._)([(0,u.j)("esri.views.2d.tiling.TileQueue")],T);var z=s(24470);s(67524),new P.Z(0,0,0,0),new Map;var A=s(16534),E=s(29996);const F=new Map;F.set(p.LW.MARKER,{multiplier:1,indicesPerRecord:6,verticesPerRecord:4}),F.set(p.LW.LINE,{multiplier:1,indicesPerRecord:24,verticesPerRecord:8}),F.set(p.LW.FILL,{multiplier:1,indicesPerRecord:10,verticesPerRecord:10}),F.set(p.LW.TEXT,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4}),F.set(p.LW.LABEL,{multiplier:8,indicesPerRecord:6,verticesPerRecord:4});class R{constructor(t,e){this._pos=0;const s=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(s),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const s=Math.round(t);return s+(e-s%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest(1.25*(this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT),this._buffer.BYTES_PER_ELEMENT),s=new ArrayBuffer(e),i=new this._ctor(s);i.set(this._buffer,0),this._array=s,this._buffer=i,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,s){this._i16View[2*t]+=e,this._i16View[2*t+1]+=s}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length<t)throw new Error("Increment index overflows the target buffer");this._buffer[t]++}decr(t){this._buffer[t]--}writeRegion(t){this._ensureSize(t.length);const e=this._pos;return this._buffer.set(t,this._pos),this._pos+=t.length,e}writeManyFrom(t,e,s){this._ensureSize(s-e);for(let i=e;i!==s;i++)this.writeFixed(t._buffer[i])}buffer(){const t=this._array.slice(0,4*this._pos);return this.destroy(),t}toArray(){const t=this._array,e=[];for(let s=0;s<t.byteLength/4;s++)e.push(t[s]);return e}seek(t){this._pos=t}destroy(){this._array=null,this._buffer=null}}class N{constructor(t,e,s){this._start={index:0,vertex:0};const i=function(t,e,s){const{indicesPerRecord:i,multiplier:r,verticesPerRecord:n}=F.get(t);return{recordBytes:s*A.XJ*Uint32Array.BYTES_PER_ELEMENT,indexBytes:r*i*s*Uint32Array.BYTES_PER_ELEMENT,vertexBytes:r*n*s*e}}(t,e,s),r=e/4;this.geometryType=t,this._records=new R(Int32Array,i.recordBytes),this._indices=new R(Uint32Array,i.indexBytes),this._vertices=new R(Uint32Array,i.vertexBytes),this._metrics=new R(Float32Array,0),this._strideInt=r}serialize(t){const e=this._records.buffer(),s=this._indices.buffer(),i=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null,n=4*this._strideInt;return t.push(e,s,i),{stride:n,records:e,indices:s,vertices:i,metrics:r}}get strideInt(){return this._strideInt}get recordCount(){return this._records.length/A.XJ}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(t){this._vertices.ensureSize(t)}indexEnsureSize(t){this._indices.ensureSize(t)}recordStart(){this._start.index=this._indices.length,this._start.vertex=this._vertices.length}recordEnd(t,e,s,i,r,n,o,a){this._records.push(t),this._records.push(e),this._records.push(s),this._records.push(i),this._records.push(r),this._records.push(n),this._records.push(o),this._records.writeF32(a)}writeIndex(t){this._indices.push(t)}writeVertex(t){this._vertices.push(t)}writeVertexF32(t){this._vertices.writeF32(t)}copyLastFrom(t,e,s){const i=t._records.length-A.XJ,r=t._records.getValue(i),n=t._records.getValue(i+1),o=t._records.getValue(i+2),a=t._records.getValue(i+4),l=t._records.getValue(i+6),h=t._records.getValue(i+7),c=this._vertices.length,u=(t._start.vertex-this._vertices.length)/this._strideInt,f=this._indices.length,m=this.vertexCount;for(let e=t._start.index;e!==t._indices.length;e++){const s=t._indices.getValue(e);this._indices.push(s-u)}for(let e=t._start.vertex;e!==t._vertices.length;e++){const s=t._vertices.getValue(e);this._vertices.push(s)}for(let t=c;t<=this._vertices.length;t+=this._strideInt)this._vertices.i1616Add(t,e,s);this._records.push(r),this._records.push(n),this._records.push(o),this._records.push(f),this._records.push(a),this._records.push(m),this._records.push(l),this._records.push(h)}}var O=s(14867);function W(t){switch(t){case 1:case 8:case 32:return-1;case 2:case 64:return 0;case 4:case 16:case 128:return 1}}function V(t){switch(t){case 1:case 2:case 4:return-1;case 8:case 16:return 0;case 32:case 64:case 128:return 1}}class D{constructor(t,e,s,i,r,n=0){this._hasAggregate=!1,this.hasRecords=!1,this._data={self:new Map,neighbors:new Array},this._version=0,this._current={geometryType:0,writer:null,overlaps:0,start:0,insertAfter:0,sortKey:0,id:0,materialKey:0,indexStart:0,vertStart:0,isDotDensity:!1,bufferingEnabled:!1,metricBoxLenPointer:0},this.hint=e,this.tileKey=t,this._hasAggregate=i,this._pixelBufferEnabled=r,this._version=n,this._symbologyType=s}get hasAggregates(){return this._hasAggregate}get hasPixelBufferEnabled(){return this._pixelBufferEnabled}serialize(t){const e=[];return e.push(this._serializeTileVertexData(this.tileKey,this.tileKey,this._data.self)),this._data.neighbors.forEach(((s,i)=>{const r=1<<i,n=W(r),o=V(r),a=(0,O.M)(new P.Z(this.tileKey),n,o,t),l=this._serializeTileVertexData(this.tileKey,a.id,s.vertexData);l.message.bufferIds=s.displayIds,e.push(l)})),e}_serializeTileVertexData(t,e,s){const i=new Array;return{message:{tileKeyOrigin:t,tileKey:e,data:{[p.LW.MARKER]:s.get(p.LW.MARKER)?.serialize(i),[p.LW.FILL]:s.get(p.LW.FILL)?.serialize(i),[p.LW.LINE]:s.get(p.LW.LINE)?.serialize(i),[p.LW.TEXT]:s.get(p.LW.TEXT)?.serialize(i),[p.LW.LABEL]:s.get(p.LW.LABEL)?.serialize(i)},version:this._version},transferList:i}}featureStart(t,e){this._current.insertAfter=t,this._current.sortKey=e}featureEnd(){}recordStart(t,e,s,i){this._current.writer=this._getVertexWriter(s),this._current.overlaps=0,this._current.indexStart=this._current.writer.indexCount,this._current.vertStart=this._current.writer.vertexCount,this._current.bufferingEnabled=i,this._current.id=t,this._current.materialKey=e,this._current.geometryType=s,this._current.isDotDensity=!1,this._current.writer.recordStart()}recordCount(){return this._current.writer.recordCount}vertexCount(){return this._current.writer.vertexCount}indexCount(){return this._current.writer.indexCount}vertexEnsureSize(t){this._current.writer.vertexEnsureSize(t)}indexEnsureSize(t){this._current.writer.indexEnsureSize(t)}vertexBounds(t,e,s,i){this._current.bufferingEnabled&&this._addOverlap(t,e,s,i)}vertexWrite(t){this._current.writer.writeVertex(t)}vertexWriteF32(t){this._current.writer.writeVertexF32(t)}vertexEnd(){}vertexWriter(){return this._current.writer.vertexWriter}indexWrite(t){this._current.writer.writeIndex(t)}indexWriter(){return this._current.writer.indexWriter}metricWriter(){return this._current.writer.metricWriter}metricStart(t,e,s,i,r,n,o,a){this._current.writer=this._getVertexWriter(p.LW.LABEL);const l=this._current.writer.metricWriter;l.push((0,_.jL)(t)),l.push(e),l.push(s),l.push(i),l.push(r),l.push(n),l.push(o),l.push(a),l.push(255),this._current.metricBoxLenPointer=l.push(0)}metricEnd(){const t=this._current.writer.metricWriter;0===t.getValue(this._current.metricBoxLenPointer)&&t.seek(t.length-10)}metricBoxWrite(t,e,s,i){const r=this._current.writer.metricWriter;r.incr(this._current.metricBoxLenPointer),r.push(0),r.push(0),r.push(t),r.push(e),r.push(s),r.push(i)}recordEnd(){const t=this._current.vertStart,e=this._current.writer.vertexCount-t;if(!e)return!1;this.hasRecords=!0;const s=this._current.indexStart,i=this._current.writer.indexCount-s;if(this._current.writer.recordEnd(this._current.id,this._current.materialKey,this._current.insertAfter,s,i,t,e,this._current.sortKey),!this._pixelBufferEnabled||this._hasAggregate||0===this._current.overlaps||this._current.geometryType===p.LW.LABEL)return!0;const r=this._current.writer;for(let t=0;t<8;t++){const e=1<<t;if(this._current.overlaps&e){this._data.neighbors[t]||(this._data.neighbors[t]={vertexData:new Map,displayIds:new Set});const s=this._data.neighbors[t],i=this._current.geometryType;if(!s.vertexData.has(i)){const t=(0,E.$_)(i,this._symbologyType).geometry,e=new N(i,t,A.Ip);s.vertexData.set(i,e)}const n=s.vertexData.get(this._current.geometryType),o=8,a=512*-W(e)*o,l=512*-V(e)*o;n.copyLastFrom(r,a,l),s.displayIds.add(this._current.id)}}return!0}_addOverlap(t,e,s,i){const r=255^((t<0+s?148:t>=A.I_-s?41:189)|(e<0+i?224:e>=A.I_-i?7:231));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,s=(0,E.$_)(t,this._symbologyType).geometry;e.set(t,new N(t,s,this.hint.records))}return this._data.self.get(t)}}var G=s(65390),U=s(22021),B=s(62357),X=s(95648),H=s(30729),Y=s(37720),J=s(12142),q=s(63523);const Z=100;function K(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t}function j(t,e){return Math.sqrt(t*t+e*e)}function $(t){const e=j(t[0],t[1]);t[0]/=e,t[1]/=e}function Q(t,e){return j(t[0]-e[0],t[1]-e[1])}function tt(t){return"function"==typeof t}function et(t=2){return 1/Math.max(t,1)}function st(t,e){return[!!t.minScale&&e.scaleToZoom(t.minScale)||0,!!t.maxScale&&e.scaleToZoom(t.maxScale)||Z]}function it(t){return t.length-1}function rt(t,e,s=1){const[i,r]=function(t,e){return t[e+1]}(t,e);return Math.sqrt(i*i+r*r)*s}class nt{constructor(t,e,s,i,r){this._segments=t,this._index=e,this._distance=s,this._xStart=i,this._yStart=r,this._done=!1}static create(t){return new nt(t,0,0,t[0][0],t[0][1])}clone(){return new nt(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(t){return this._index===t._index||t._index===this._index-1&&(0===this._distance||1===t._distance)||t._index===this._index+1&&(1===this._distance||0===t._distance)}leq(t){return this._index<t._index||this._index===t._index&&this._distance<=t._distance}geq(t){return this._index>t._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let s=Math.acos(e);return t>0&&(s=2*Math.PI-s),s}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1<it(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(t,e){const s=this.backwardLength;if(t<=s)return this._distance=(s-t)/this.length,this;let i=this.backwardLength;for(;this.prev();){if(i+this.length>t)return this._seekBackwards(t-i);i+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let s=this.remainingLength;for(;this.next();){if(s+this.length>t)return this.seek(t-s,e);s+=this.length}return this._distance=1,e?this:null}}function ot(t,e,s,i=!0){const r=function(t){let e=0;for(let s=0;s<it(t);s++)e+=rt(t,s);return e}(t),n=nt.create(t),o=r/2;if(!i)return n.seek(o),void s(n.clone(),0,o+0*e,r);const a=Math.max((r-e)/2,0),l=Math.floor(a/e),h=o-l*e;n.seek(h);for(let t=-l;t<=l;t++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&s(n.clone(),t,o+t*e,r),n.seek(e)}function at(t,e){const s=1e-6;if(e<=0)return;const i=t.length;if(i<3)return;const r=[];let n=0;r.push(0);for(let e=1;e<i;e++)n+=Q(t[e],t[e-1]),r.push(n);e=Math.min(e,.2*n);const o=[];o.push(t[0][0]),o.push(t[0][1]);const a=t[i-1][0],l=t[i-1][1],h=K([0,0],t[0],t[1]);$(h),t[0][0]+=e*h[0],t[0][1]+=e*h[1],K(h,t[i-1],t[i-2]),$(h),t[i-1][0]+=e*h[0],t[i-1][1]+=e*h[1];for(let t=1;t<i;t++)r[t]+=e;r[i-1]+=e;const c=.5*e;for(let n=1;n<i-1;n++){let a=0,l=0,h=0;for(let i=n-1;i>=0&&!(r[i+1]<r[n]-c);i--){const o=c+r[i+1]-r[n],u=r[i+1]-r[i],f=r[n]-r[i]<c?1:o/u;if(Math.abs(f)<s)break;const m=f*f,_=f*o-.5*m*u,p=f*u/e,d=t[i+1],g=t[i][0]-d[0],y=t[i][1]-d[1];a+=p/_*(d[0]*f*o+.5*m*(o*g-u*d[0])-m*f*u*g/3),l+=p/_*(d[1]*f*o+.5*m*(o*y-u*d[1])-m*f*u*y/3),h+=p}for(let o=n+1;o<i&&!(r[o-1]>r[n]+c);o++){const i=c-r[o-1]+r[n],u=r[o]-r[o-1],f=r[o]-r[n]<c?1:i/u;if(Math.abs(f)<s)break;const m=f*f,_=f*i-.5*m*u,p=f*u/e,d=t[o-1],g=t[o][0]-d[0],y=t[o][1]-d[1];a+=p/_*(d[0]*f*i+.5*m*(i*g-u*d[0])-m*f*u*g/3),l+=p/_*(d[1]*f*i+.5*m*(i*y-u*d[1])-m*f*u*y/3),h+=p}o.push(a/h),o.push(l/h)}o.push(a),o.push(l);for(let e=0,s=0;e<i;e++)t[e][0]=o[s++],t[e][1]=o[s++]}var lt=s(98732),ht=s(22974),ct=s(33955);class ut{constructor(){this.setIdentity()}getAngle(){return(null==this.rz||0===this.rz&&1!==this.rzCos&&0!==this.rzSin)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}}function ft(t){const e=(0,ht.d9)(t);return(s=e)&&((0,ct.oU)(s)?xt(s.rings):(0,ct.l9)(s)?xt(s.paths):(0,ct.aW)(s)&&yt(s.points),mt(s)),e;var s}function mt(t){t&&((0,ct.wp)(t)?t.y=-t.y:(0,ct.oU)(t)?pt(t.rings):(0,ct.l9)(t)?pt(t.paths):(0,ct.aW)(t)&&_t(t.points))}function _t(t){if(t){const e=t.length;for(let s=0;s<e;s++)t[s][1]=-t[s][1]}}function pt(t){if(t)for(const e of t)_t(e)}function dt(t){if(t)for(let e=t.length-1;e>0;--e)t[e][0]-=t[e-1][0],t[e][1]-=t[e-1][1]}function gt(t){if(t)for(const e of t)dt(e)}function yt(t){if(t){const e=t.length;for(let s=1;s<e;++s)t[s][0]+=t[s-1][0],t[s][1]+=t[s-1][1]}}function xt(t){if(t)for(const e of t)yt(e)}function Mt(t){if(t)for(const e of t)bt(e)}function bt(t){t&&t.reverse()}function vt(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}function St(t){return t[4]}function wt(t,e){t[4]=e}class Pt{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1,t&&((0,ct.oU)(t)?e&&(this.multiPath=t.rings,this.isClosed=!0):(0,ct.l9)(t)?s&&(this.multiPath=t.paths,this.isClosed=!1):(0,ct.YX)(t)&&e&&(this.multiPath=Lt(t).rings,this.isClosed=!0),this.multiPath&&(this.pathCount=this.multiPath.length)),this.internalPlacement=new ut}next(){if(!this.multiPath)return null;for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}return this.pathCount=-1,this.pathIndex=-1,this.multiPath=null,null}}class Ct{constructor(t,e,s,i=0){this.isClosed=!1,this.multiPath=null,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=s,this.geomUnitsPerPoint=i,this.pathCount=-1,this.pathIndex=-1,this.iteratePath=!1}next(){for(;;){if(!this.multiPath){let t=this.inputGeometries.next();for(;t;){if((0,ct.oU)(t)?this.acceptPolygon&&(this.multiPath=t.rings,this.isClosed=!0):(0,ct.l9)(t)?this.acceptPolyline&&(this.multiPath=t.paths,this.isClosed=!1):(0,ct.YX)(t)&&this.acceptPolygon&&(this.multiPath=Lt(t).rings,this.isClosed=!0),this.multiPath){this.pathCount=this.multiPath.length,this.pathIndex=-1;break}t=this.inputGeometries.next()}if(!this.multiPath)return null}for(;this.iteratePath||this.pathIndex<this.pathCount-1;){this.iteratePath||this.pathIndex++;const t=this.processPath(this.multiPath[this.pathIndex]);if(t)return t}this.pathCount=-1,this.pathIndex=-1,this.multiPath=null}}}function Lt(t){return{rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}}class It{static local(){return null===It.instance&&(It.instance=new It),It.instance}execute(t,e,s,i){return new kt(t,e,s)}}It.instance=null;class kt{constructor(t,e,s){this._inputGeometries=t,this._angleTolerance=void 0!==e.angleTolerance?e.angleTolerance:120,this._maxCosAngle=Math.cos((1-Math.abs(this._angleTolerance)/180)*Math.PI)}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.oU)(t)){this._isClosed=!0;const e=(0,ht.d9)(t);return this._processMultipath(e.rings),e}if((0,ct.l9)(t)){this._isClosed=!1;const e=(0,ht.d9)(t);return this._processMultipath(e.paths),e}if((0,ct.YX)(t)){if(this._maxCosAngle)return t;this._isClosed=!0;const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];return this._processPath(e),{rings:[e]}}t=this._inputGeometries.next()}return null}_processMultipath(t){if(t)for(const e of t)this._processPath(e)}_processPath(t){if(t){let e,s,i,r,n,o,a=t.length,l=t[0];this._isClosed&&++a;for(let h=1;h<a;++h){let c;c=this._isClosed&&h===a-1?t[0]:t[h];const u=c[0]-l[0],f=c[1]-l[1],m=Math.sqrt(u*u+f*f);h>1&&m>0&&i>0&&(e*u+s*f)/m/i<=this._maxCosAngle&&wt(l,1),1===h&&(r=u,n=f,o=m),m>0&&(l=c,e=u,s=f,i=m)}this._isClosed&&i>0&&o>0&&(e*r+s*n)/o/i<=this._maxCosAngle&&wt(t[0],1)}}}const Tt=.03;class zt{constructor(){this._path=[]}path(){return this._path}addPath(t,e){e||t.reverse(),Array.prototype.push.apply(this._path,t),e||t.reverse()}static mergePath(t,e){e&&Array.prototype.push.apply(t,e)}startPath(t){this._path.push(t)}lineTo(t){this._path.push(t)}close(){const t=this._path;t.length>1&&(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]||t.push([t[0][0],t[0][1]]))}}class At{constructor(t=0,e=!1){}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);0!==e&&(t[0]/=e,t[1]/=e)}calculateLength(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}calculateSegLength(t,e){return this.calculateLength(t[e],t[e+1])}calculatePathLength(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=this.calculateSegLength(t,i);return e}calculatePathArea(t){let e=0;const s=t?t.length:0;for(let i=0;i<s-1;++i)e+=(t[i+1][0]-t[i][0])*(t[i+1][1]+t[i][1]);return e/2}getCoord2D(t,e,s){return[t[0]+(e[0]-t[0])*s,t[1]+(e[1]-t[1])*s]}getSegCoord2D(t,e,s){return this.getCoord2D(t[e],t[e+1],s)}getAngle(t,e,s){const i=e[0]-t[0],r=e[1]-t[1];return Math.atan2(r,i)}getSegAngle(t,e,s){return this.getAngle(t[e],t[e+1],s)}getAngleCS(t,e,s){const i=e[0]-t[0],r=e[1]-t[1],n=Math.sqrt(i*i+r*r);return n>0?[i/n,r/n]:[1,0]}getSegAngleCS(t,e,s){return this.getAngleCS(t[e],t[e+1],s)}cut(t,e,s,i){return[s<=0?t[e]:this.getSegCoord2D(t,e,s),i>=1?t[e+1]:this.getSegCoord2D(t,e,i)]}addSegment(t,e,s){s&&t.push(e[0]),t.push(e[1])}getSubCurve(t,e,s){const i=[];return this.appendSubCurve(i,t,e,s)?i:null}appendSubCurve(t,e,s,i){const r=e?e.length-1:0;let n=0,o=!0,a=0;for(;a<r;){const r=this.calculateSegLength(e,a);if(0!==r){if(o){if(n+r>s){const l=(s-n)/r;let h=1,c=!1;n+r>=i&&(h=(i-n)/r,c=!0);const u=this.cut(e,a,l,h);if(u&&this.addSegment(t,u,o),c)break;o=!1}}else{if(n+r>i){const s=this.cut(e,a,0,(i-n)/r);s&&this.addSegment(t,s,o);break}this.addSegment(t,[e[a],e[a+1]],o)}n+=r,++a}else++a}return!0}getCIMPointAlong(t,e){const s=t?t.length-1:0;let i=0,r=-1;for(;r<s;){++r;const s=this.calculateSegLength(t,r);if(0!==s){if(i+s>e){const n=(e-i)/s;return this.getCoord2D(t[r],t[r+1],n)}i+=s}}return null}isEmpty(t,e){if(!t||t.length<=1)return!0;const s=t?t.length-1:0;let i=-1;for(;i<s;){if(++i,t[i+1][0]!==t[i][0]||t[i+1][1]!==t[i][1])return!1;if(e&&t[i+1][2]!==t[i][2])return!1}return!0}offset(t,e,s,i,r){if(!t||t.length<2)return null;let n=0,o=t[n++],a=n;for(;n<t.length;){const e=t[n];e[0]===o[0]&&e[1]===o[1]||(n!==a&&(t[a]=t[n]),o=t[a++]),n++}const l=t[0][0]===t[a-1][0]&&t[0][1]===t[a-1][1];if(l&&--a,a<(l?3:2))return null;const h=[];o=l?t[a-1]:null;let c=t[0];for(let r=0;r<a;r++){const n=r===a-1?l?t[0]:null:t[r+1];if(o)if(n){const t=[n[0]-c[0],n[1]-c[1]];this.normalize(t);const r=[c[0]-o[0],c[1]-o[1]];this.normalize(r);const a=r[0]*t[1]-r[1]*t[0],l=r[0]*t[0]+r[1]*t[1];if(0===a&&1===l){c=n;continue}if(a>=0==e<=0){if(l<1){const s=[t[0]-r[0],t[1]-r[1]];this.normalize(s);const n=Math.sqrt((1+l)/2);if(n>1/i){const t=-Math.abs(e)/n;h.push([c[0]-s[0]*t,c[1]-s[1]*t])}}}else switch(s){case X.id.Mitered:{const s=Math.sqrt((1+l)/2);if(s>0&&1/s<i){const i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=Math.abs(e)/s;h.push([c[0]-i[0]*n,c[1]-i[1]*n]);break}}case X.id.Bevelled:h.push([c[0]+r[1]*e,c[1]-r[0]*e]),h.push([c[0]+t[1]*e,c[1]-t[0]*e]);break;case X.id.Rounded:if(l<1){h.push([c[0]+r[1]*e,c[1]-r[0]*e]);const s=Math.floor(2.5*(1-l));if(s>0){const i=1/s;let n=i;for(let o=1;o<s;o++,n+=i){const s=[r[1]*(1-n)+t[1]*n,-r[0]*(1-n)-t[0]*n];this.normalize(s),h.push([c[0]+s[0]*e,c[1]+s[1]*e])}}h.push([c[0]+t[1]*e,c[1]-t[0]*e])}break;case X.id.Square:default:if(a<0)h.push([c[0]+(r[1]+r[0])*e,c[1]+(r[1]-r[0])*e]),h.push([c[0]+(t[1]-t[0])*e,c[1]-(t[0]+t[1])*e]);else{const s=Math.sqrt((1+Math.abs(l))/2),i=[t[0]-r[0],t[1]-r[1]];this.normalize(i);const n=e/s;h.push([c[0]-i[0]*n,c[1]-i[1]*n])}}}else{const t=[c[0]-o[0],c[1]-o[1]];this.normalize(t),h.push([c[0]+t[1]*e,c[1]-t[0]*e])}else{const t=[n[0]-c[0],n[1]-c[1]];this.normalize(t),h.push([c[0]+t[1]*e,c[1]-t[0]*e])}o=c,c=n}return h.length<(l?3:2)?null:(l&&h.push([h[0][0],h[0][1]]),h)}}const Et=X.TF.OpenEnded;class Ft{static local(){return null===Ft.instance&&(Ft.instance=new Ft),Ft.instance}execute(t,e,s,i){return new Rt(t,e,s)}}Ft.instance=null;class Rt extends Ct{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._width=(void 0!==e.width?e.width:5)*s,this._arrowType=void 0!==e.geometricEffectArrowType?e.geometricEffectArrowType:void 0!==e.arrowType?e.arrowType:Et,this._offsetFlattenError=Tt*s}processPath(t){switch(this._arrowType){case X.TF.OpenEnded:default:return this._constructSimpleArrow(t,!0);case X.TF.Block:return this._constructSimpleArrow(t,!1);case X.TF.Crossed:return this._constructCrossedArrow(t)}}_constructSimpleArrow(t,e){const s=this._curveHelper.calculatePathLength(t);let i=this._width;s<2*i&&(i=s/2);const r=this._curveHelper.getSubCurve(t,0,s-i);if(!r)return null;const n=i/2;if(this._curveHelper.isEmpty(r,!1))return null;const o=this._constructOffset(r,-n);if(!o)return null;const a=this._constructOffset(r,n);if(!a)return null;const l=this._constructArrowBasePoint(o,-n/2);if(!l)return null;const h=this._constructArrowBasePoint(a,n/2);if(!h)return null;const c=t[t.length-1];e||(this._makeControlPoint(a,!0),this._makeControlPoint(o,!0));const u=new zt;return u.addPath(a,!0),u.lineTo(h),this._makeControlPoint(u.path()),u.lineTo(c),this._makeControlPoint(u.path()),u.lineTo(l),this._makeControlPoint(u.path()),u.addPath(o,!1),e?{paths:[u.path()]}:(u.close(),{rings:[u.path()]})}_constructCrossedArrow(t){const e=this._curveHelper.calculatePathLength(t);let s=this._width;e<3.732050807568877*s&&(s=e/3.732050807568877);const i=this._curveHelper.getSubCurve(t,0,e-2.732050807568877*s);if(!i)return null;const r=s/2;if(this._curveHelper.isEmpty(i,!1))return null;const n=this._constructOffset(i,r);if(!n)return null;const o=this._constructOffset(i,-r);if(!o)return null;const a=this._curveHelper.getSubCurve(t,0,e-s);if(!a)return null;if(this._curveHelper.isEmpty(a,!1))return null;const l=this._constructOffset(a,r);if(!l)return null;const h=this._constructOffset(a,-r);if(!h)return null;const c=l[l.length-1],u=this._constructArrowBasePoint(l,r/2);if(!u)return null;const f=h[h.length-1],m=this._constructArrowBasePoint(h,-r/2);if(!m)return null;const _=t[t.length-1];this._makeControlPoint(n,!1),this._makeControlPoint(o,!1);const p=new zt;return p.addPath(n,!0),this._makeControlPoint(p.path()),p.lineTo(f),p.lineTo(m),this._makeControlPoint(p.path()),p.lineTo(_),this._makeControlPoint(p.path()),p.lineTo(u),this._makeControlPoint(p.path()),p.lineTo(c),this._makeControlPoint(p.path()),p.addPath(o,!1),{paths:[p.path()]}}_constructOffset(t,e){return this._curveHelper.offset(t,e,X.id.Rounded,4,this._offsetFlattenError)}_constructArrowBasePoint(t,e){if(!t||t.length<2)return null;const s=t[t.length-2],i=t[t.length-1],r=[i[0]-s[0],i[1]-s[1]];return this._curveHelper.normalize(r),[i[0]+r[1]*e,i[1]-r[0]*e]}_makeControlPoint(t,e=!1){wt(e?t[0]:t[t.length-1],1)}}class Nt{static local(){return null===Nt.instance&&(Nt.instance=new Nt),Nt.instance}execute(t,e,s,i){return new Ot(t,e,s,i)}}Nt.instance=null;class Ot{constructor(t,e,s,i){this._inputGeometries=t,this._curveHelper=new At,this._size=(void 0!==e.size?e.size:1)*s,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t))if(this._size>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,this._size,X.id.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else{if(!(this._size<0))return t;if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return{xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size}}if((0,ct.oU)(t)){if(0===this._size)return t;const e=[];for(const s of t.rings){const t=this._curveHelper.offset(s,this._size,X.id.Rounded,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{rings:e}}if((0,ct.l9)(t)&&this._size>0){const e=[];for(const s of t.paths)if(s&&s.length>1){const t=this._curveHelper.offset(s,this._size,X.id.Rounded,4,this._offsetFlattenError),i=this._curveHelper.offset(s,-this._size,X.id.Rounded,4,this._offsetFlattenError);if(t&&i){for(let e=i.length-1;e>=0;e--)t.push(i[e]);t.push([t[0][0],t[0][1]]),e.push(t)}}if(e.length)return{rings:e}}(0,ct.wp)(t)&&this._size,t=this._inputGeometries.next()}return null}}class Wt{static local(){return null===Wt.instance&&(Wt.instance=new Wt),Wt.instance}execute(t,e,s,i){return new Vt(t,e,s)}}Wt.instance=null;class Vt{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??X.Em.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){let e;if((0,ct.wp)(t)?e=this._processGeom([[[t.x,t.y]]]):(0,ct.aW)(t)?e=this._processGeom([t.points]):(0,ct.l9)(t)?e=this._processGeom(t.paths):(0,ct.oU)(t)&&(e=this._processGeom(t.rings)),e&&e.length)return{paths:e}}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,i){return[t[0]*e+s[0]*i,t[1]*e+s[1]*i]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const i=t[0]*e-t[1]*s,r=t[0]*s+t[1]*e;t[0]=i,t[1]=r}_makeCtrlPt(t){const e=[t[0],t[1]];return wt(e,1),e}_addAngledTicks(t,e,s,i){const r=this._sub(s,e);this._normalize(r);const n=this._crossProduct(r,this._sub(i,e));let o;o=n>0?this._rightPerp(r):this._leftPerp(r);const a=Math.abs(n)/2,l=[];l.push([e[0]+(o[0]-r[0])*a,e[1]+(o[1]-r[1])*a]),l.push(e),l.push(s),l.push([s[0]+(o[0]+r[0])*a,s[1]+(o[1]+r[1])*a]),t.push(l)}_addBezier2(t,e,s,i,r){if(0==r--)return void t.push(i);const n=this._mid(e,s),o=this._mid(s,i),a=this._mid(n,o);this._addBezier2(t,e,n,a,r),this._addBezier2(t,a,o,i,r)}_addBezier3(t,e,s,i,r,n){if(0==n--)return void t.push(r);const o=this._mid(e,s),a=this._mid(s,i),l=this._mid(i,r),h=this._mid(o,a),c=this._mid(a,l),u=this._mid(h,c);this._addBezier3(t,e,o,h,u,n),this._addBezier3(t,u,c,l,r,n)}_add90DegArc(t,e,s,i,r){const n=r??this._crossProduct(this._sub(s,e),this._sub(i,e))>0,o=this._mid(e,s),a=this._sub(o,e);n?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const i=e[0],r=e[1],n=e[e.length-1],o=this._sub(i,r);this._normalize(o);const a=this._crossProduct(o,this._sub(n,r)),l=.5*a,h=this._leftPerp(o),c=[n[0]-h[0]*a,n[1]-h[1]*a],u=e.length-1,f=[];f.push(s?[-h[0],-h[1]]:h);let m=[-o[0],-o[1]];for(let t=1;t<u-1;t++){const s=this._sub(e[t+1],e[t]);this._normalize(s);const i=this._dotProduct(s,m),r=this._crossProduct(s,m),n=Math.sqrt((1+i)/2),o=this._sub(s,m);this._normalize(o),o[0]/=n,o[1]/=n,f.push(r<0?[-o[0],-o[1]]:o),m=s}f.push(this._rightPerp(m));for(let s=f.length-1;s>0;s--)t.push([e[s][0]+f[s][0]*l,e[s][1]+f[s][1]*l]);t.push([c[0]+f[0][0]*l,c[1]+f[0][1]*l]),t.push([c[0]+f[0][0]*a,c[1]+f[0][1]*a]),t.push(i),t.push([c[0]-f[0][0]*a,c[1]-f[0][1]*a]),t.push([c[0]-f[0][0]*l,c[1]-f[0][1]*l]);for(let s=1;s<f.length;s++)t.push([e[s][0]-f[s][0]*l,e[s][1]-f[s][1]*l])}_cp2(t,e,s){return t.length>=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,i){if(t.length>=3)return t[2];const r=this._mix(t[0],1-s,e,s),n=this._sub(e,t[0]);return this._normalize(n),this._rightPerpendicular(n),[r[0]+n[0]*i*this._defaultSize,r[1]+n[1]*i*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),i=this._sub(e,s);this._normalize(i);const r=this._rightPerp(i);return[e,s,[e[0]+(r[0]-i[0])*this._defaultSize,e[1]+(r[1]-i[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let i;if(t.length>=3)i=t[t.length-1];else{const t=this._sub(e,s);this._normalize(t);const r=this._rightPerp(t);i=[e[0]+(r[0]-t[0])*this._defaultSize,e[1]+(r[1]-t[1])*this._defaultSize]}return[s,i]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||0===s.length)continue;const t=s.length;let i=s[0];switch(this._rule){case X.Em.PerpendicularFromFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=[];n.push(r),n.push(this._mid(i,t)),e.push(n);break}case X.Em.ReversedFirstSegment:{const t=this._cp2(s,0,-1);e.push([t,i]);break}case X.Em.PerpendicularToSecondSegment:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=[];n.push(this._mid(t,r)),n.push(i),e.push(n);break}case X.Em.SecondSegmentWithTicks:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);let o;o=this._crossProduct(n,this._sub(i,t))>0?this._rightPerp(o):this._leftPerp(n);const a=[];a.push([t[0]+(o[0]-n[0])/3,t[1]+(o[1]-n[1])/3]),a.push(t),a.push(r),a.push([r[0]+(o[0]+n[0])/3,r[1]+(o[1]+n[1])/3]),e.push(a);break}case X.Em.DoublePerpendicular:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,3),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push(i),l.push([r[0]+o[0]*a,r[1]+o[1]*a]),e.push(l);const h=[];h.push([r[0]-o[0]*a,r[1]-o[1]*a]),h.push(t),e.push(h);break}case X.Em.OppositeToFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,3),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push([r[0]+o[0]*a,r[1]+o[1]*a]),l.push([r[0]-o[0]*a,r[1]-o[1]*a]),e.push(l);break}case X.Em.TriplePerpendicular:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=this._mid(i,t),o=this._sub(n,r);this._normalize(o);const a=this._crossProduct(o,this._sub(i,r));this._leftPerpendicular(o);const l=[];l.push([r[0]+o[0]*a*.8,r[1]+o[1]*a*.8]),l.push([n[0]+.8*(i[0]-n[0]),n[1]+.8*(i[1]-n[1])]),e.push(l),e.push([r,n]);const h=[];h.push([r[0]-o[0]*a*.8,r[1]-o[1]*a*.8]),h.push([n[0]+.8*(t[0]-n[0]),n[1]+.8*(t[1]-n[1])]),e.push(h);break}case X.Em.HalfCircleFirstSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,4),n=this._mid(i,t);let o=this._sub(t,i);const a=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18),h=Math.sqrt((1+a)/2),c=Math.sqrt((1-a)/2),u=[];let f;this._crossProduct(o,this._sub(r,i))>0?(u.push(i),o=this._sub(i,n),f=t):(u.push(t),o=this._sub(t,n),f=i),this._rotateDirect(o,h,c),o[0]/=h,o[1]/=h;for(let t=1;t<=18;t++)u.push(this._add(n,o)),this._rotateDirect(o,a,l);u.push(f),e.push(u);break}case X.Em.HalfCircleSecondSegment:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,1,-1);let n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t))/2;this._leftPerpendicular(n);const a=[t[0]+n[0]*o,t[1]+n[1]*o];n=this._sub(t,a);const l=Math.cos(Math.PI/18);let h=Math.sin(Math.PI/18);o>0&&(h=-h);const c=[t];for(let t=1;t<=18;t++)this._rotateDirect(n,l,h),c.push(this._add(a,n));e.push(c);break}case X.Em.HalfCircleExtended:{const r=this._cp2(s,0,-2),n=this._cp3(s,r,1,-1);let o;if(t>=4)o=s[3];else{const t=this._sub(i,r);o=this._add(n,t)}const a=this._dist(r,n)/2/.75,l=this._sub(r,i);this._normalize(l,a);const h=this._sub(n,o);this._normalize(h,a);const c=[o,n];e.push(c);const u=[this._clone(n)];this._addBezier3(u,n,this._add(n,h),this._add(r,l),r,4),u.push(i),e.push(u);break}case X.Em.OpenCircle:{const t=this._cp2(s,-2,0),r=this._sub(t,i),n=Math.cos(Math.PI/18),o=-Math.sin(Math.PI/18),a=[t];for(let t=1;t<=33;t++)this._rotateDirect(r,n,o),a.push(this._add(i,r));e.push(a);break}case X.Em.CoverageEdgesWithTicks:{const r=this._cp2(s,0,-1);let n,o;if(t>=3)n=s[2];else{const t=this._sub(r,i),e=this._leftPerp(t);n=[i[0]+e[0]-.25*t[0],i[1]+e[1]-.25*t[1]]}if(t>=4)o=s[3];else{const t=this._mid(i,r),e=this._sub(i,r);this._normalize(e),this._leftPerpendicular(e);const s=this._crossProduct(e,this._sub(n,t));this._rightPerpendicular(e),o=[n[0]+e[0]*s*2,n[1]+e[1]*s*2]}const a=this._sub(r,i);let l,h;l=this._crossProduct(a,this._sub(n,i))>0?this._rightPerp(a):this._leftPerp(a),h=[],h.push(n),h.push(i),h.push([i[0]+(l[0]-a[0])/3,i[1]+(l[1]-a[1])/3]),e.push(h),l=this._crossProduct(a,this._sub(o,r))>0?this._rightPerp(l):this._leftPerp(a),h=[],h.push([r[0]+(l[0]+a[0])/3,r[1]+(l[1]+a[1])/3]),h.push(r),h.push(o),e.push(h);break}case X.Em.GapExtentWithDoubleTicks:{const r=this._cp2(s,0,2),n=this._cp3(s,r,0,1);let o;if(t>=4)o=s[3];else{const t=this._sub(r,i);o=this._add(n,t)}this._addAngledTicks(e,i,r,this._mid(n,o)),this._addAngledTicks(e,n,o,this._mid(i,r));break}case X.Em.GapExtentMidline:{const r=this._cp2(s,2,0),n=this._cp3(s,r,0,1);let o;if(t>=4)o=s[3];else{const t=this._sub(r,i);o=this._add(n,t)}const a=[];a.push(this._mid(i,n)),a.push(this._mid(r,o)),e.push(a);break}case X.Em.Chevron:{const r=this._cp2(s,-1,-1);let n;if(t>=3)n=s[2];else{const t=this._sub(r,i);this._leftPerpendicular(t),n=this._add(i,t)}e.push([r,this._makeCtrlPt(i),n]);break}case X.Em.PerpendicularWithArc:{const t=this._cp2(s,0,-2),r=this._cp3(s,t,.5,-1);let n=this._sub(t,i);const o=this._norm(n);n[0]/=o,n[1]/=o;const a=this._crossProduct(n,this._sub(r,i));let l=this._dotProduct(n,this._sub(r,i));l<.05*o?l=.05*o:l>.95*o&&(l=.95*o);const h=[i[0]+n[0]*l,i[1]+n[1]*l];this._leftPerpendicular(n);let c=[];c.push([h[0]-n[0]*a,h[1]-n[1]*a]),c.push([h[0]+n[0]*a,h[1]+n[1]*a]),e.push(c);const u=[t[0]+n[0]*a,t[1]+n[1]*a];n=this._sub(t,u);const f=Math.cos(Math.PI/18);let m=Math.sin(Math.PI/18);a<0&&(m=-m),c=[i,t];for(let t=1;t<=9;t++)this._rotateDirect(n,f,m),c.push(this._add(u,n));e.push(c);break}case X.Em.ClosedHalfCircle:{const t=this._cp2(s,2,0),r=this._mid(i,t),n=this._sub(t,r),o=Math.cos(Math.PI/18),a=Math.sin(Math.PI/18),l=[i,t];for(let t=1;t<=18;t++)this._rotateDirect(n,o,a),l.push(this._add(r,n));e.push(l);break}case X.Em.TripleParallelExtended:{const t=this._cp2(s,0,-2),r=this._cp3(s,t,1,-2),n=this._mid(i,t),o=this._sub(r,t);this._normalize(o);const a=Math.abs(this._crossProduct(o,this._sub(n,t)))/2,l=this._dist(t,r),h=[t,i];h.push([i[0]+o[0]*l*.5,i[1]+o[1]*l*.5]),e.push(h);const c=[];c.push([n[0]-o[0]*a,n[1]-o[1]*a]),c.push([n[0]+o[0]*l*.375,n[1]+o[1]*l*.375]),wt(c[c.length-1],1),c.push([n[0]+o[0]*l*.75,n[1]+o[1]*l*.75]),e.push(c);const u=[t,r];e.push(u);break}case X.Em.ParallelWithTicks:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(r,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n),this._addAngledTicks(e,i,t,r),this._addAngledTicks(e,this._mix(i,1,n,o),this._mix(t,1,n,o),this._mid(i,t));break}case X.Em.Parallel:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._leftPerp(n),a=this._crossProduct(n,this._sub(r,i));let l=[i,t];e.push(l),l=[],l.push([i[0]+o[0]*a,i[1]+o[1]*a]),l.push([t[0]+o[0]*a,t[1]+o[1]*a]),e.push(l);break}case X.Em.PerpendicularToFirstSegment:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._mid(i,t),o=this._sub(t,i);this._normalize(o);const a=this._crossProduct(o,this._sub(r,i));this._leftPerpendicular(o);const l=[];l.push([n[0]-o[0]*a*.25,n[1]-o[1]*a*.25]),l.push([n[0]+o[0]*a*1.25,n[1]+o[1]*a*1.25]),e.push(l);break}case X.Em.ParallelOffset:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]-n[0]*o,i[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);const l=[];l.push([i[0]+n[0]*o,i[1]+n[1]*o]),l.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(l);break}case X.Em.OffsetOpposite:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]-n[0]*o,i[1]-n[1]*o]),a.push([t[0]-n[0]*o,t[1]-n[1]*o]),e.push(a);break}case X.Em.OffsetSame:{const t=this._cp2(s,3,0),r=this._cp3(s,t,.5,-1),n=this._sub(t,i);this._normalize(n);const o=this._crossProduct(n,this._sub(r,i));this._leftPerpendicular(n);const a=[];a.push([i[0]+n[0]*o,i[1]+n[1]*o]),a.push([t[0]+n[0]*o,t[1]+n[1]*o]),e.push(a);break}case X.Em.CircleWithArc:{let r=this._cp2(s,3,0);const n=this._cp3(s,r,.5,-1);let o,a;if(t>=4)o=s[3],a=this._crossProduct(this._sub(o,r),this._sub(n,r))>0;else{o=r,a=this._crossProduct(this._sub(o,i),this._sub(n,i))>0;const t=24*this._geomUnitsPerPoint,e=this._sub(o,i);this._normalize(e,t);const s=Math.sqrt(2)/2;this._rotateDirect(e,s,a?s:-s),r=this._add(i,e)}const l=this._sub(r,i),h=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r];for(let t=1;t<=36;t++)this._rotateDirect(l,h,c),u.push(this._add(i,l));this._add90DegArc(u,r,o,n,a),wt(u[u.length-8],1),e.push(u);break}case X.Em.DoubleJog:{let r,n,o=this._cp2(s,-3,1);if(r=t>=3?s[2]:this._add(i,this._sub(i,o)),t>=4)n=s[3];else{const t=i;i=o,n=r;const e=this._dist(i,t),s=this._dist(n,t);let a=30*this._geomUnitsPerPoint;.5*e<a&&(a=.5*e),.5*s<a&&(a=.5*s),o=this._mix(i,a/e,t,(e-a)/e),r=this._mix(n,a/s,t,(s-a)/s)}const a=this._mid(i,o),l=this._mid(n,r),h=this._dist(i,o),c=this._dist(r,n);let u=Math.min(h,c)/8;u=Math.min(u,24*this._geomUnitsPerPoint);const f=Math.cos(Math.PI/4);let m=this._sub(i,o);this._normalize(m,u),this._crossProduct(m,this._sub(n,o))>0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(o),_.push(this._add(a,m)),_.push(this._sub(a,m)),_.push(i),e.push(_),m=this._sub(n,r),this._normalize(m,u),this._crossProduct(m,this._sub(i,r))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(r),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(n),e.push(_);break}case X.Em.PerpendicularOffset:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);this._crossProduct(n,this._sub(i,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,r),o);e.push([a,i]);break}case X.Em.LineExcludingLastSegment:{const t=this._arrowPath(s),i=[];let r=t.length-2;for(;r--;)i.push(t[r]);e.push(i);break}case X.Em.MultivertexArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!1),e.push(i);break}case X.Em.CrossedArrow:{const t=this._arrowPath(s),i=[];this._addArrow(i,t,!0),e.push(i);break}case X.Em.ChevronArrow:{const[t,r]=this._arrowLastSeg(s),n=10*this._geomUnitsPerPoint,o=this._sub(i,t);this._normalize(o);const a=this._crossProduct(o,this._sub(r,t)),l=this._leftPerp(o),h=[r[0]-l[0]*a*2,r[1]-l[1]*a*2],c=[];c.push([r[0]+o[0]*n,r[1]+o[1]*n]),c.push(i),c.push([h[0]+o[0]*n,h[1]+o[1]*n]),e.push(c);break}case X.Em.ChevronArrowOffset:{const[t,r]=this._arrowLastSeg(s),n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t));this._leftPerpendicular(n);const a=[r[0]-n[0]*o,r[1]-n[1]*o],l=[];l.push([a[0]+n[0]*o*.5,a[1]+n[1]*o*.5]),l.push(this._mid(a,i)),l.push([a[0]-n[0]*o*.5,a[1]-n[1]*o*.5]),e.push(l);break}case X.Em.PartialFirstSegment:{const[t,r]=this._arrowLastSeg(s),n=this._sub(i,t);this._normalize(n);const o=this._crossProduct(n,this._sub(r,t));this._leftPerpendicular(n);const a=[r[0]-n[0]*o,r[1]-n[1]*o];e.push([t,a]);break}case X.Em.Arch:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,1),n=this._sub(i,t),o=this._mix(r,1,n,.55),a=this._mix(r,1,n,-.55),l=[i];this._addBezier2(l,i,o,r,4),this._addBezier2(l,r,a,t,4),e.push(l);break}case X.Em.CurvedParallelTicks:{const t=this._cp2(s,-4,1),r=this._cp3(s,t,.882353,-1.94),n=this._sub(r,t);this._crossProduct(n,this._sub(i,t))>0?this._rightPerpendicular(n):this._leftPerpendicular(n);const o=[n[0]/8,n[1]/8],a=this._sub(this._mid(t,r),o),l=this._sub(this._mix(t,.75,r,.25),o),h=this._sub(this._mix(t,.25,r,.75),o),c=[t];this._addBezier2(c,t,l,a,3),this._addBezier2(c,a,h,r,3),e.push(c);for(let t=0;t<8;t++){const s=c[2*t+1],i=[this._clone(s)];i.push(this._add(s,[n[0]/4,n[1]/4])),e.push(i)}break}case X.Em.Arc90Degrees:{const t=this._cp2(s,0,-1),r=this._cp3(s,t,.5,1),n=[t];this._add90DegArc(n,t,i,r),e.push(n);break}case X.Em.FullGeometry:default:e.push(s)}}return e}}class Dt{static local(){return null===Dt.instance&&(Dt.instance=new Dt),Dt.instance}execute(t,e,s,i){return new Gt(t,e,s)}}Dt.instance=null;class Gt extends Ct{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._beginCut=(void 0!==e.beginCut?e.beginCut:1)*s,this._endCut=(void 0!==e.endCut?e.endCut:1)*s,this._middleCut=(void 0!==e.middleCut?e.middleCut:0)*s,this._invert=void 0!==e.invert&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const e=this._beginCut,s=this._endCut,i=this._middleCut,r=this._curveHelper.calculatePathLength(t),n=[];if(this._invert)if(0===e&&0===s&&0===i);else if(e+s+i>=r)n.push(t);else{let o=this._curveHelper.getSubCurve(t,0,e);o&&n.push(o),o=this._curveHelper.getSubCurve(t,.5*(r-i),.5*(r+i)),o&&n.push(o),o=this._curveHelper.getSubCurve(t,r-s,s),o&&n.push(o)}else if(0===e&&0===s&&0===i)n.push(t);else if(e+s+i>=r);else if(0===i){const i=this._curveHelper.getSubCurve(t,e,r-s);i&&n.push(i)}else{let o=this._curveHelper.getSubCurve(t,e,.5*(r-i));o&&n.push(o),o=this._curveHelper.getSubCurve(t,.5*(r+i),r-s),o&&n.push(o)}return 0===n.length?null:{paths:n}}}class Ut{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return 0===this._values.length}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||0===t.length)return!1;for(let e=0;e<t.length;e++){let i=Math.abs(t[e]);s&&i<1e-7&&(i=1e-7),this._values.push(i),this._length+=i}return e&&1&t.length&&(this._length*=2),0!==this._length&&(this.ctrlPtGap=this.extPtGap=0,this._currentValue=-1,!0)}scale(t){const e=this._values?this._values.length:0;for(let s=0;s<e;++s)this._values[s]*=t;this._length*=t,this.extPtGap*=t,this.ctrlPtGap*=t}addValue(t){this._length+=t,this._values.push(t)}firstValue(){return this._values[0]}lastValue(){return this._values[this._values.length-1]}nextValue(){return this._currentValue++,this._currentValue===this._values.length&&(this._currentValue=0),this._values[this._currentValue]}reset(){this._currentValue=-1}length(){return this._length}_setEmpty(){this.extPtGap=this.ctrlPtGap=this._length=0,this._currentValue=-1,this._values.length=0}}class Bt{constructor(){this.pt=null,this.ca=0,this.sa=0}}var Xt,Ht;(Ht=Xt||(Xt={}))[Ht.FAIL=0]="FAIL",Ht[Ht.END=1]="END",Ht[Ht.CONTINUE=2]="CONTINUE";class Yt{constructor(){this.reset()}reset(){this.segment=-1,this.segmentLength=0,this.abscissa=0,this.isPathEnd=!1,this.isPartEnd=!1}isValid(){return-1!==this.segment}copyTo(t){t.segment=this.segment,t.segmentLength=this.segmentLength,t.abscissa=this.abscissa,t.isPathEnd=this.isPathEnd,t.isPartEnd=this.isPartEnd}}class Jt extends At{constructor(t=0,e=!1){super(t,e),this._tolerance=Tt,this._currentPosition=new Yt}updateTolerance(t){this._tolerance=Tt*t}init(t,e,s=!0){return s?(this._patternLength=e.length(),this._partExtPtGap=e.extPtGap,this._partCtrlPtGap=e.ctrlPtGap):(this._patternLength=0,this._partExtPtGap=0,this._partCtrlPtGap=0),this._currentPosition.reset(),this._partSegCount=0,this._path=t,this._seg=-1,this._setPosAtNextPart()}curPositionIsValid(){return this._currentPosition.isValid()}nextPosition(t,e=Xt.FAIL){const s=new Yt;return!!this._nextPosition(t,s,null,e)&&(s.copyTo(this._currentPosition),!0)}curPointAndAngle(t){t.pt=this._getPoint(this._currentPosition);const[e,s]=this._getAngle(this._currentPosition);t.ca=e,t.sa=s}nextPointAndAngle(t,e,s=Xt.FAIL){const i=new Yt;if(!this._nextPosition(t,i,null,s))return!1;i.copyTo(this._currentPosition),e.pt=this._getPoint(i);const[r,n]=this._getAngle(i);return e.ca=r,e.sa=n,!0}nextCurve(t){if(0===t)return null;const e=[],s=new Yt;return this._nextPosition(t,s,e,Xt.END)?(s.copyTo(this._currentPosition),e):null}isPathEnd(){return this._currentPosition.isPathEnd}getPathEnd(){if(-1===this._currentPosition.segment)throw new Error("missing segment");return this._path[this._currentPosition.segment+1]}_nextPosition(t,e,s,i){if(this._currentPosition.isPathEnd)return!1;let r=this._currentPosition.abscissa;for(this._currentPosition.segmentLength>0&&(r/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(0===s.length)if(0===r){const t=this._path[e.segment];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,r));const t=this._path[e.segment+1];s.push([t[0],t[1]])}if(r=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.calculateSegLength(this._path,e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==Xt.FAIL&&(e.segmentLength=this.calculateSegLength(this._path,e.segment),e.isPartEnd=!0,i===Xt.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){if(0===s.length)if(0===r){const t=this._path[e.segment];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,r));const t=e.abscissa/e.segmentLength;if(1===t){const t=this._path[e.segment+1];s.push([t[0],t[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,t))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)<this._tolerance&&(e.isPathEnd=this._partIsLast,e.isPartEnd=!0),!0}_getPoint(t){if(-1===t.segment)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegCoord2D(this._path,t.segment,e)}_getAngle(t){if(-1===t.segment)throw new Error("missing segment");const e=t.segmentLength<=0?0:t.abscissa/t.segmentLength;return this.getSegAngleCS(this._path,t.segment,e)}_setPosAtNextPart(){for(;this._partSegCount;)this._hasNextSegment()&&this._nextSegment(),this._partSegCount--;if(!this._hasNextSegment())return!1;for(this._partLength=0,this._partIsLast=!0,this._partSegCount=0;this._hasNextSegment();)if(this._partLength+=this.calculateSegLength(this._path,this._nextSegment()),this._partSegCount++,1===St(this._path[this._getEndPointIndex()])){this._partIsLast=!this._hasNextSegment();break}let t=this._partSegCount;for(;t;)this._previousSegment(),--t;this._currentPosition.segment=this._nextSegment(),this._currentPosition.segmentLength=this.calculateSegLength(this._path,this._currentPosition.segment),this._currentPosition.abscissa=0,this._currentPosition.isPathEnd=this._currentPosition.isPartEnd=!1,--this._partSegCount;const e=this._getStartPointIndex();this._ctrlPtBegin=1===St(this._path[e]);let s=e+this._partSegCount+1;if(s>=this._path.length&&(s=0),this._ctrlPtEnd=1===St(this._path[s]),this._patternLength>0){const t=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,e=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let s=Math.round((this._partLength-(t+e))/this._patternLength);s<=0&&(s=t+e>0?0:1),this._partLengthRatio=this._partLength/(t+e+s*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg<this._path.length-2}_previousSegment(){return--this._seg}_nextSegment(){return++this._seg}_getStartPointIndex(){return this._seg}_getEndPointIndex(){return this._seg+1}}class qt{static local(){return null===qt.instance&&(qt.instance=new qt),qt.instance}execute(t,e,s,i){return new Zt(t,e,s)}}qt.instance=null;class Zt extends Ct{constructor(t,e,s){super(t,!0,!0),this._firstCurve=null,this._walker=new Jt,this._walker.updateTolerance(s),this._endings=e.lineDashEnding,this._customDashPos=-(e.offsetAlongLine??0)*s,this._offsetAtEnd=(e.customEndingOffset??0)*s,this._pattern=new Ut,this._pattern.init(e.dashTemplate,!0),this._pattern.scale(s)}processPath(t){if(0===this._pattern.length())return this.iteratePath=!1,{paths:[t]};if(!this.iteratePath){let e=!0;switch(this._endings){case X.sj.HalfPattern:case X.sj.HalfGap:default:this._pattern.extPtGap=0;break;case X.sj.FullPattern:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.firstValue());break;case X.sj.FullGap:this.isClosed||(this._pattern.extPtGap=.5*this._pattern.lastValue());break;case X.sj.NoConstraint:this.isClosed||(e=!1);break;case X.sj.Custom:this.isClosed||(this._pattern.extPtGap=.5*this._offsetAtEnd)}const s=this._walker.calculatePathLength(t);if(this._pattern.isEmpty()||s<.1*this._pattern.length())return{paths:[t]};if(!this._walker.init(t,this._pattern,e))return{paths:[t]}}let e;if(this.iteratePath)e=this._pattern.nextValue();else{let t;switch(this._endings){case X.sj.HalfPattern:default:t=.5*this._pattern.firstValue();break;case X.sj.HalfGap:t=.5*-this._pattern.lastValue();break;case X.sj.FullGap:t=-this._pattern.lastValue();break;case X.sj.FullPattern:t=0;break;case X.sj.NoConstraint:case X.sj.Custom:t=-this._customDashPos}let s=t/this._pattern.length();s-=Math.floor(s),t=s*this._pattern.length(),this._pattern.reset(),e=this._pattern.nextValue();let i=!1;for(;t>=e;)t-=e,e=this._pattern.nextValue(),i=!i;e-=t,i?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);return s?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),zt.mergePath(s,this._firstCurve),this._firstCurve=null)):(e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null),{paths:[s]}}}class Kt{static local(){return null===Kt.instance&&(Kt.instance=new Kt),Kt.instance}execute(t,e,s,i){return new jt(t,e,s)}}Kt.instance=null;class jt{constructor(t,e,s){switch(this._inputGeometries=t,this._curveHelper=new At,this._width=(void 0!==e.width?e.width:2)*s,e.method){case X.$y.Mitered:default:this._method=X.id.Mitered;break;case X.$y.Bevelled:this._method=X.id.Bevelled;break;case X.$y.Rounded:case X.$y.TrueBuffer:this._method=X.id.Rounded;break;case X.$y.Square:this._method=X.id.Square}this._option=e.option,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t)&&this._width>0){if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0)return t;const e=[];return e.push([[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]),e.push([[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]]),{rings:e}}if((0,ct.oU)(t)&&this._width>0){const e=[];for(const s of t.rings){const t=this._curveHelper.calculatePathLength(s),i=this._curveHelper.offset(s,this._width,this._method,4,this._offsetFlattenError);i&&(t<0&&i.reverse(),e.push(i))}if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}}class $t{static local(){return null===$t.instance&&($t.instance=new $t),$t.instance}execute(t,e,s,i){return new Qt(t,e,s)}}$t.instance=null;class Qt extends Ct{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._length=(void 0!==e.length?e.length:20)*s,this._angle=void 0!==e.angle?e.angle:225,this._position=void 0!==e.position?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){if(this._curveHelper.isEmpty(t,!1))return null;const e=t[0],s=t[t.length-1],i=[s[0]-e[0],s[1]-e[1]];this._curveHelper.normalize(i);const r=[e[0]+(s[0]-e[0])*this._position/100,e[1]+(s[1]-e[1])*this._position/100],n=Math.cos((90-this._angle)/180*Math.PI);let o=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(o=-o),this._mirror=!this._mirror,{paths:[[e,[r[0]-this._length/2*n,r[1]-this._length/2*o],[r[0]+this._length/2*n,r[1]+this._length/2*o],s]]}}}class te{static local(){return null===te.instance&&(te.instance=new te),te.instance}execute(t,e,s,i){return new ee(t,e,s)}}te.instance=null;class ee{constructor(t,e,s){this._inputGeometries=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?-e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if((0,ct.YX)(t))return{xmin:t.xmin+this._offsetX,xmax:t.xmax+this._offsetX,ymin:t.ymin+this._offsetY,ymax:t.ymax+this._offsetY};if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._moveMultipath(e.rings,this._offsetX,this._offsetY),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._moveMultipath(e.paths,this._offsetX,this._offsetY),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._movePath(e.points,this._offsetX,this._offsetY),e}if((0,ct.wp)(t))return{x:t.x+this._offsetX,y:t.y+this._offsetY};t=this._inputGeometries.next()}return null}_moveMultipath(t,e,s){if(t)for(const i of t)this._movePath(i,e,s)}_movePath(t,e,s){if(t)for(const i of t)i[0]+=e,i[1]+=s}}class se{static local(){return null===se.instance&&(se.instance=new se),se.instance}execute(t,e,s,i){return new ie(t,e,s)}}se.instance=null;class ie{constructor(t,e,s){this._inputGeometries=t,this._curveHelper=new At,this._offset=(e.offset??1)*s,this._method=e.method,this._option=e.option,this._offsetFlattenError=Tt*s}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._offset)return t;if((0,ct.YX)(t)){if(this._method===X.id.Rounded&&this._offset>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset>0)return{xmin:t.xmin-this._offset,xmax:t.xmax+this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset}}if((0,ct.oU)(t)){const e=[];for(const s of t.rings){const t=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{rings:e}}if((0,ct.l9)(t)){const e=[];for(const s of t.paths){const t=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);t&&e.push(t)}if(e.length)return{paths:e}}t=this._inputGeometries.next()}return null}}class re{static local(){return null===re.instance&&(re.instance=new re),re.instance}execute(t,e,s,i){return new ne(t,e,s)}}re.instance=null;class ne{constructor(t,e,s){this._inputGeometries=t,this._reverse=void 0===e.reverse||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return Mt(e.paths),e}t=this._inputGeometries.next()}return null}}var oe=s(20322);class ae{static local(){return null===ae.instance&&(ae.instance=new ae),ae.instance}execute(t,e,s,i){return new le(t,e,s)}}ae.instance=null;class le{constructor(t,e,s){this._inputGeometries=t,this._rotateAngle=void 0!==e.angle?e.angle*Math.PI/180:0}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._rotateAngle)return t;const e=(0,z.Ue)();(0,oe.$P)(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if((0,ct.YX)(t)){const e={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._rotateMultipath(e.rings,s,i),e}if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._rotateMultipath(e.rings,s,i),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._rotateMultipath(e.paths,s,i),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._rotatePath(e.points,s,i),e}if((0,ct.wp)(t))return t;t=this._inputGeometries.next()}return null}_rotateMultipath(t,e,s){if(t)for(const i of t)this._rotatePath(i,e,s)}_rotatePath(t,e,s){if(t){const i=Math.cos(this._rotateAngle),r=Math.sin(this._rotateAngle);for(const n of t){const t=n[0]-e,o=n[1]-s;n[0]=e+t*i-o*r,n[1]=s+t*r+o*i}}}}class he{static local(){return null===he.instance&&(he.instance=new he),he.instance}execute(t,e,s,i){return new ce(t,e,s)}}he.instance=null;class ce{constructor(t,e,s){this._inputGeometries=t,this._xFactor=void 0!==e.xScaleFactor?e.xScaleFactor:1.15,this._yFactor=void 0!==e.yScaleFactor?e.yScaleFactor:1.15}next(){let t=this._inputGeometries.next();for(;t;){if(1===this._xFactor&&1===this._yFactor)return t;const e=(0,z.Ue)();(0,oe.$P)(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if((0,ct.YX)(t)){const e={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._scaleMultipath(e.rings,s,i),e}if((0,ct.oU)(t)){const e=(0,ht.d9)(t);return this._scaleMultipath(e.rings,s,i),e}if((0,ct.l9)(t)){const e=(0,ht.d9)(t);return this._scaleMultipath(e.paths,s,i),e}if((0,ct.aW)(t)){const e=(0,ht.d9)(t);return this._scalePath(e.points,s,i),e}if((0,ct.wp)(t))return t;t=this._inputGeometries.next()}return null}_scaleMultipath(t,e,s){if(t)for(const i of t)this._scalePath(i,e,s)}_scalePath(t,e,s){if(t)for(const i of t){const t=(i[0]-e)*this._xFactor,r=(i[1]-s)*this._yFactor;i[0]=e+t,i[1]=s+r}}}class ue{static local(){return null===ue.instance&&(ue.instance=new ue),ue.instance}execute(t,e,s,i){return new fe(t,e,s)}}ue.instance=null;class fe{constructor(t,e,s){this._inputGeometries=t,this._height=(void 0!==e.amplitude?e.amplitude:2)*s,this._period=(void 0!==e.period?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Ut,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Jt,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(0===this._height||0===this._period)return t;if((0,ct.l9)(t)){const e=this._processGeom(t.paths);if(e.length)return{paths:e}}if((0,ct.oU)(t)){const e=this._processGeom(t.rings);if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}_processGeom(t){const e=[];for(const s of t)if(this._walker.init(s,this._pattern))switch(this._style){case X.zQ.Sinus:default:e.push(this._constructCurve(s,!1));break;case X.zQ.Square:e.push(this._constructSquare(s));break;case X.zQ.Triangle:e.push(this._constructTriangle(s));break;case X.zQ.Random:e.push(this._constructCurve(s,!0))}else e.push(s);return e}_constructCurve(t,e){const s=new zt,i=this._walker.calculatePathLength(t);let r=Math.round(i/this._period);0===r&&(r=1);const n=16*r+1,o=i/r,a=this._period/16,l=1/n,h=2*Math.PI*i/o,c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),f=2*Math.PI*Math.random(),m=.75-Math.random()/2,_=.75-Math.random()/2,p=new Bt;this._walker.curPointAndAngle(p),s.startPath(p.pt);let d=0;for(;;){if(!this._walker.nextPointAndAngle(a,p)){s.lineTo(t[t.length-1]);break}{const t=d;let i;if(d+=l,e){const e=this._height/2*(1+.3*Math.sin(m*h*t+c));i=e*Math.sin(h*t+u),i+=e*Math.sin(_*h*t+f),i/=2}else i=.5*this._height*Math.sin(.5*h*t);s.lineTo([p.pt[0]-i*p.sa,p.pt[1]+i*p.ca])}}return s.path()}_constructSquare(t){const e=new zt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const s=new Bt;this._walker.curPointAndAngle(s);const r=new Bt;if(this._walker.nextPointAndAngle(this._period,r)){const n=new Bt;this._walker.nextPointAndAngle(this._period,n)&&(i?(e.startPath(s.pt),i=!1):e.lineTo(s.pt),e.lineTo([s.pt[0]-this._height/2*s.sa,s.pt[1]+this._height/2*s.ca]),e.lineTo([r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca]),e.lineTo([r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca]),e.lineTo([n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca]),t=!0)}}if(!t){e.lineTo(this._walker.getPathEnd());break}}return e.path()}_constructTriangle(t){const e=new zt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let t=!1;if(this._walker.curPositionIsValid()){const s=new Bt;this._walker.curPointAndAngle(s);const r=new Bt;if(this._walker.nextPointAndAngle(this._period/2,r)){const n=new Bt;this._walker.nextPointAndAngle(this._period,n)&&(this._walker.nextPosition(this._period/2)&&(i?(e.startPath(s.pt),i=!1):e.lineTo(s.pt),e.lineTo([r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca]),e.lineTo([n.pt[0]+this._height/2*n.sa,n.pt[1]-this._height/2*n.ca])),t=!0)}}if(!t){e.lineTo(this._walker.getPathEnd());break}}return e.path()}}class me{static local(){return null===me.instance&&(me.instance=new me),me.instance}execute(t,e,s,i){return new _e(t,e,s)}}me.instance=null;class _e extends Pt{constructor(t,e,s){super(t,!0,!0),this._geometryWalker=new Jt,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Ut,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===X.JS.WithFullGap&&this.isClosed?this._endings=X.JS.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let s,i=!0;switch(this._endings){case X.JS.NoConstraint:s=-this._position,s=this._adjustPosition(s),i=!1;break;case X.JS.WithHalfGap:default:s=-this._pattern.lastValue()/2;break;case X.JS.WithFullGap:s=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case X.JS.WithMarkers:s=0;break;case X.JS.Custom:s=-this._position,s=this._adjustPosition(s),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,i))return null;this._pattern.reset();let r=0;for(;s>r;)s-=r,r=this._pattern.nextValue();r-=s,e=r,this.iteratePath=!0}const s=new Bt;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===X.JS.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===X.JS.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}class pe{static local(){return null===pe.instance&&(pe.instance=new pe),pe.instance}execute(t,e,s,i){return new de(t,e,s)}}pe.instance=null;class de extends Pt{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._type=e.extremityPlacement,this._position=void 0!==e.offsetAlongLine?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case X.Tx.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case X.Tx.JustBegin:e=this._atExtremities(t,this._position,!0);break;case X.Tx.JustEnd:e=this._atExtremities(t,this._position,!1);case X.Tx.None:}return e}_atExtremities(t,e,s){const i=t.length;if(i<2)return null;const r=s?1:i-2,n=s?i:-1,o=s?1:-1;let a,l=0,h=s?t[0]:t[i-1];for(let s=r;s!==n;s+=o){a=h,h=t[s];const i=this._curveHelper.calculateLength(a,h);if(l+i>e){const t=(e-l)/i,[s,r]=this._curveHelper.getAngleCS(a,h,t),n=vt(a,h,t);return this.internalPlacement.setTranslate(n[0]-this._offset*r,n[1]+this._offset*s),this._angleToLine&&this.internalPlacement.setRotateCS(-s,-r),this.internalPlacement}l+=i}return null}}class ge{static local(){return null===ge.instance&&(ge.instance=new ge),ge.instance}execute(t,e,s,i){return new ye(t,e,s)}}ge.instance=null;class ye extends Pt{constructor(t,e,s){super(t,!0,!0),this._walker=new Jt,this._walker.updateTolerance(s),this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._beginGap=void 0!==e.beginPosition?e.beginPosition*s:0,this._endGap=void 0!==e.endPosition?e.endPosition*s:0,this._flipFirst=void 0===e.flipFirst||e.flipFirst,this._pattern=new Ut,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const t=this._pattern.nextValue()*this._subPathLen,s=this._beginGap+t;e=s-this._prevPos,this._prevPos=s}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(t)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const s=this._pattern.nextValue()*this._subPathLen,i=this._beginGap+s;e=i-this._prevPos,this._prevPos=i,this.iteratePath=!0}const s=new Bt;if(!this._walker.nextPointAndAngle(e,s,Xt.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let r,n;return this._angleToLine?(r=s.ca,n=s.sa):(r=1,n=0),i&&(r=-r,n=-n),this.internalPlacement.setRotateCS(r,n),this._isFirst=!1,this._posCount--,0===this._posCount&&(this.iteratePath=!1),this.internalPlacement}}var xe=s(77734);class Me{static local(){return null===Me.instance&&(Me.instance=new Me),Me.instance}execute(t,e,s,i){return new be(t,e,s,i)}}Me.instance=null;class be{constructor(t,e,s,i){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,0!==this._stepX&&0!==this._stepY&&t&&function(t){return void 0!==t.rings}(t)&&t.rings){if(this._gridType=e.gridType??X.bj.Fixed,this._gridType===X.bj.Random){const t=e.seed??13,s=1;this._randomLCG=new xe.Z(t*s),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginX=0,this._graphicOriginY=0,this._internalPlacement=new ut,this._calculateMinMax(t),this._geometry=t}}next(){return this._geometry?this._nextInside():null}_calculateMinMax(t){let e,s,i,r,n,o,a,l;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,n=o=Number.MAX_VALUE,a=l=-Number.MAX_VALUE;for(const h of t.rings){const t=h?h.length:0;for(let c=0;c<t;++c)e=h[c][0]-this._graphicOriginX-this._offsetX,s=h[c][1]-this._graphicOriginY-this._offsetY,i=this._cosAngle*e-this._sinAngle*s,r=this._sinAngle*e+this._cosAngle*s,n=Math.min(n,i),a=Math.max(a,i),o=Math.min(o,r),l=Math.max(l,r)}n+=this._graphicOriginX,a+=this._graphicOriginX,o+=this._graphicOriginY,l+=this._graphicOriginY,this._xMin=Math.round(n/this._stepX),this._xMax=Math.round(a/this._stepX),this._yMin=Math.round(o/this._stepY),this._yMax=Math.round(l/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,i;return this._currentX++,this._gridType===X.bj.Random?(s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-this._randomLCG.getFloat())*2/3,i=this._graphicOriginY+e+this._stepY*this._randomness*(.5-this._randomLCG.getFloat())*2/3):(s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,i=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e),this._internalPlacement.setTranslate(s,i),this._internalPlacement}}}class ve{static local(){return null===ve.instance&&(ve.instance=new ve),ve.instance}execute(t,e,s,i){return new Se(t,e,s)}}ve.instance=null;class Se extends Pt{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=void 0!==e.startPointOffset?e.startPointOffset*s:0,this._epsilon=.001*s}processPath(t){const e=this._position;if(this._relativeTo===X.CS.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=t.length,this._curSegment=1,this.iteratePath=!0);this._curSegment<this._segmentCount;){const e=this._curSegment;this._curSegment++;const s=t[e-1],i=t[e],r=this._curveHelper.calculateLength(s,i);if(r<this._epsilon)continue;const n=.5+this._position/r,[o,a]=this._curveHelper.getAngleCS(s,i,n),l=vt(s,i,n);return this.internalPlacement.setTranslate(l[0]-this._offset*a,l[1]+this._offset*o),this._angleToLine&&this.internalPlacement.setRotateCS(o,a),this.internalPlacement}return this.iteratePath=!1,null}this._relativeTo===X.CS.LineEnd&&bt(t);const s=this.onLine(t,e);return this._relativeTo===X.CS.LineEnd&&bt(t),s}onLine(t,e){let s,i=!1;switch(this._relativeTo){case X.CS.LineMiddle:default:s=this._curveHelper.calculatePathLength(t)/2+e;break;case X.CS.LineBeginning:s=e;break;case X.CS.LineEnd:s=e,i=!0}const r=t.length;let n,o=0,a=t[0];for(let e=1;e<r;++e){n=a,a=t[e];const r=this._curveHelper.calculateLength(n,a);if(o+r>s){const t=(s-o)/r,[e,l]=this._curveHelper.getAngleCS(n,a,t),h=vt(n,a,t),c=i?-this._offset:this._offset;return this.internalPlacement.setTranslate(h[0]-c*l,h[1]+c*e),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-e,-l):this.internalPlacement.setRotateCS(e,l)),this.internalPlacement}o+=r}return null}}class we{static local(){return null===we.instance&&(we.instance=new we),we.instance}execute(t,e,s,i){return new Pe(t,e,s)}}we.instance=null;class Pe extends Pt{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new At,this._angleToLine=void 0===e.angleToLine||e.angleToLine,this._offset=void 0!==e.offset?e.offset*s:0,this._endPoints=void 0===e.placeOnEndPoints||e.placeOnEndPoints,this._controlPoints=void 0===e.placeOnControlPoints||e.placeOnControlPoints,this._regularVertices=void 0===e.placeOnRegularVertices||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(0!==this._offset){const t=Math.cos(e[2]),r=Math.sin(e[2]);s-=this._offset*r,i+=this._offset*t}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0;const e=function(t){return!(!t||0===t.length)&&t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]}(t),s=t.length-1;let i,r,n=0,o=0,a=0,l=0,h=0;for(;n<s;){n++,i=t[n-1],r=t[n];const c=St(i),u=St(r);(this._angleToLine||0!==this._offset)&&(l=this._curveHelper.getAngle(i,r,0)),1===n?e?(o=l,a=c):(this._endPoints||this._controlPoints&&1===c)&&this._tags.push([i[0],i[1],l]):1===c?this._controlPoints&&this._tags.push([i[0],i[1],Ce(h,l)]):this._regularVertices&&this._tags.push([i[0],i[1],Ce(h,l)]),(this._angleToLine||0!==this._offset)&&(h=this._curveHelper.getAngle(i,r,1)),n===s&&(e?1===u||1===a?this._controlPoints&&this._tags.push([r[0],r[1],Ce(h,o)]):this._regularVertices&&this._tags.push([r[0],r[1],Ce(h,o)]):(this._endPoints||this._controlPoints&&1===u)&&this._tags.push([r[0],r[1],h]))}this._tagIterator=0}}function Ce(t,e){const s=Math.PI;for(;Math.abs(e-t)>s+2e-15;)e-t>s?e-=2*s:e+=2*s;return(t+e)/2}var Le=s(35308);class Ie{constructor(t=ke){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(null==t)return;const{_data:e,_compare:s}=this;e.push(t);let i=e.length-1>>>0;const r=e[i];for(;i>0;){const t=i-1>>1,n=e[t];if(!(s(n,r)<=0))break;e[t]=r,e[i]=n,i=t}}dequeue(){const{_data:t,_compare:e}=this,s=t[0],i=t.pop();if(0===t.length)return s;t[0]=i;let r=0;const n=t.length,o=t[0];let a,l,h=null;for(;;){const s=2*r+1,i=2*r+2;if(h=null,s<n&&(a=t[s],e(a,o)>0&&(h=s)),i<n&&(l=t[i],(null===h&&e(l,o)<=0||null!==h&&e(l,a)<=0)&&(h=i)),null===h)break;t[r]=t[h],t[h]=o,r=h}return s}}const ke=(t,e)=>t<e?-1:t>e?1:0;var Te=s(86662),ze=s(87416);function Ae(t,e){const{rings:s}=e;let i=0;for(const e of s){const s=e.length;for(let r=1;r<s;++r){const s=e[r-1],n=e[r];s[1]>t[1]!=n[1]>t[1]&&((n[0]-s[0])*(t[1]-s[1])-(n[1]-s[1])*(t[0]-s[0])>0?i++:i--)}}return 0!==i}function Ee(t,e,s){if(s&&Ae(t,e))return{coord:t,distance:0};let i=1/0,r=0,n=0;const o=[0,0],{rings:a}=e;for(const e of a)if(!(e.length<2))for(let s=0;s<e.length-1;s++){(0,Te.Tx)(o,t,e,s);const a=Ve(t,o);a<i&&(i=a,r=o[0],n=o[1])}return{coord:[r,n],distance:Math.sqrt(i)}}function Fe(t,e,s,i){const r=[e,0];let n=1/0,o=1/0,a=!1,l=!1;const h=[[e,i[1]-1],[e,i[3]+1]],c=[0,0],u=[0,0],f=[0,0],m=[[0,0],[0,0]],_=(0,z.Ue)(),{rings:p}=t;for(const t of p)if(!(t.length<2))for(let e=1;e<t.length;e++){if(m[0][0]=t[e-1][0],m[0][1]=t[e-1][1],m[1][0]=t[e][0],m[1][1]=t[e][1],null===Re(_,m))continue;if(u[0]=h[0][0],u[1]=h[0][1],f[0]=h[1][0],f[1]=h[1][1],0===Ne(_,u,f))continue;if(!(0,ze.UT)(h[0],h[1],m[0],m[1],c))continue;const s=c[1];n>o?s<n&&(n=s,a=!0):s<o&&(o=s,l=!0)}return a&&l?r[1]=(n+o)/2:r[0]=r[1]=NaN,r}function Re(t,e){if(e.length<2)return null;t||(t=(0,z.Ue)());const[s,i]=e[0],[r,n]=e[1];return t[0]=Math.min(s,r),t[1]=Math.min(i,n),t[2]=Math.max(s,r),t[3]=Math.max(i,n),t}function Ne(t,e,s){let i=Oe(e,t),r=Oe(s,t);const n=t[0],o=t[1],a=t[2],l=t[3];if(i&r)return 0;if(!(i|r))return 4;const h=(i?1:0)|(r?2:0);do{const h=s[0]-e[0],c=s[1]-e[1];if(h>c)3&i?(1&i?(e[1]+=c*(n-e[0])/h,e[0]=n):(e[1]+=c*(a-e[0])/h,e[0]=a),i=Oe(e,t)):3&r?(1&r?(s[1]+=c*(n-s[0])/h,s[0]=n):(s[1]+=c*(a-s[0])/h,s[0]=a),r=Oe(s,t)):i?(4&i?(e[0]+=h*(o-e[1])/c,e[1]=o):(e[0]+=h*(l-e[1])/c,e[1]=l),i=Oe(e,t)):(4&r?(s[0]+=h*(o-s[1])/c,s[1]=o):(s[0]+=h*(l-s[1])/c,s[1]=l),r=Oe(s,t));else if(12&i?(4&i?(e[0]+=h*(o-e[1])/c,e[1]=o):(e[0]+=h*(l-e[1])/c,e[1]=l),i=Oe(e,t)):12&r?(4&r?(s[0]+=h*(o-s[1])/c,s[1]=o):(s[0]+=h*(l-s[1])/c,s[1]=l),r=Oe(s,t)):i?(1&i?(e[1]+=c*(n-e[0])/h,e[0]=n):(e[1]+=c*(a-e[0])/h,e[0]=a),i=Oe(e,t)):(1&r?(s[1]+=c*(n-s[0])/h,s[0]=n):(s[1]+=c*(a-s[0])/h,s[0]=a),r=Oe(s,t)),i&r)return 0}while(i|r);return h}function Oe(t,e){return(t[0]<e[0]?1:0)|(t[0]>e[2]?1:0)<<1|(t[1]<e[1]?1:0)<<2|(t[1]>e[3]?1:0)<<3}function We(t,e,s){return t+(e-t)*s}function Ve(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function De(t,e){if(t<e)return-1;if(t>e)return 1;if(t===e)return 0;const s=isNaN(t),i=isNaN(e);return s<i?-1:s>i?1:0}class Ge{constructor(t,e,s,i){this.x=t,this.y=e,this.cellSize=s,this.distancefromCellCenter=(0,Te.ko)(t,e,i),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}class Ue{static local(){return null===Ue.instance&&(Ue.instance=new Ue),Ue.instance}execute(t,e,s,i){return new Be(t,e,s)}}Ue.instance=null;class Be{constructor(t,e,s){this._geometry=t,this._offsetX=void 0!==e.offsetX?e.offsetX*s:0,this._offsetY=void 0!==e.offsetY?e.offsetY*s:0,this._method=void 0!==e.method?e.method:X.Lh.OnPolygon,this._internalPlacement=new ut}next(){const t=this._geometry;return this._geometry=null,t&&function(t){return void 0!==t.rings}(t)?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case X.Lh.CenterOfMass:{const s=(0,Le.NA)(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case X.Lh.BoundingBoxCenter:{const s=(0,z.Ue)();(0,oe.$P)(s,t),s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case X.Lh.OnPolygon:default:{let s;s=(0,a.Z)("polylabel-placement-enabled")?function(t){if(!t||!t.rings||0===t.rings.length)return null;const e=(0,oe.lC)((0,z.Ue)(),t.rings[0]);if(!e)return null;const s=e[2]-e[0],i=e[3]-e[1];if(0===s||0===i)return[e[0]+s/2,e[1]+i/2];const r=Math.max(Math.min(s,i)/100,1),n=new Ie(((t,e)=>e.maxDistanceToPolygon-t.maxDistanceToPolygon)),o=Math.min(s,i);let a=o/2,l=0,c=0;for(l=e[0];l<e[2];l+=o)for(c=e[1];c<e[3];c+=o)n.enqueue(new Ge(l+a,c+a,a,t));const u=(0,Le.a)(t.rings,!1);if(null===u)return null;let f,m=new Ge(u[0],u[1],0,t);for(;n.size>0;)f=(0,h.Wg)(n.dequeue()),f.distancefromCellCenter>m.distancefromCellCenter&&(m=f),f.maxDistanceToPolygon-m.distancefromCellCenter<=r||(a=f.cellSize/2,n.enqueue(new Ge(f.x-a,f.y-a,a,t)),n.enqueue(new Ge(f.x+a,f.y-a,a,t)),n.enqueue(new Ge(f.x-a,f.y+a,a,t)),n.enqueue(new Ge(f.x+a,f.y+a,a,t)));return[m.x,m.y]}(t):function(t){const{rings:e}=t;if(!e||0===e.length)return null;const s=(0,oe.$P)((0,z.Ue)(),t);if(!s)return null;const i=4*(Math.abs(s[0])+Math.abs(s[2])+Math.abs(s[1])+Math.abs(s[3])+1)*222045e-19;let r=0,n=0;for(let t=0;t<e.length;t++){const s=(0,Te.Sm)(e[t]);s>n&&(n=s,r=t)}if(Math.abs(n)<=2*i*i){const t=(0,oe.lC)((0,z.Ue)(),e[r]);return[(t[0]+t[2])/2,(t[1]+t[3])/2]}const o=(0,Le.DS)(e[r],!1,(0,z.Ue)());if(null===o)return null;if(1===e.length&&e[0].length<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],l=[NaN,NaN,NaN,NaN],h=[NaN,NaN,NaN,NaN];let c=!1,u=Ee(o,t,!0);0===u.distance&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ee(o,t,!1)),l[0]=u.distance,h[0]=0;const f=[NaN,NaN];let m=!1,_=.25,p=-1;const d=(0,oe.lC)((0,z.Ue)(),e[r]);let g=NaN;do{if(g=NaN,a[1]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ee(a[1],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[1],t))m=!0,l[1]=g,h[1]=Ve(a[1],o);else if(!isNaN(g)&&g>p&&(p=g,f[0]=a[1][0],f[1]=a[1][1]),_-=.01,_<.1){if(!(p>=0))break;m=!0,l[1]=p,a[1][0]=f[0],a[1][1]=f[1],h[1]=Ve(a[1],o)}}while(!m);m=!1,_=.5,p=-1;let y=.01,x=1;do{if(g=NaN,a[2]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ee(a[2],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[2],t))m=!0,l[2]=g,h[2]=Ve(a[2],o);else if(!isNaN(g)&&g>p)p=g,f[0]=a[2][0],f[1]=a[2][1];else if(g>p&&(p=g,f[0]=a[2][0],f[1]=a[2][1]),_=.5+y*x,y+=.01,x*=-1,_<.3||_>.7){if(!(p>=0))break;m=!0,l[2]=p,a[2][0]=f[0],a[2][1]=f[1],h[2]=Ve(a[2],o)}}while(!m);m=!1,_=.75,p=-1;do{if(g=NaN,a[3]=Fe(t,We(d[0],d[2],_),0,s),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ee(a[3],t,!1),g=u.distance),!isNaN(g)&&g>i&&Ae(a[3],t))m=!0,l[3]=g,h[3]=Ve(a[3],o);else if(g>p&&(p=g,f[0]=a[3][0],f[1]=a[3][1]),_+=.01,_>.9){if(!(p>=0))break;m=!0,l[3]=p,a[3][0]=f[0],a[3][1]=f[1],h[3]=Ve(a[3],o)}}while(!m);const M=[0,1,2,3],b=c?0:1;let v;for(let t=b;t<4;t++)for(let t=b;t<3;t++){const e=h[t],s=h[t+1];De(e,s)>0&&(v=M[t],M[t]=M[t+1],M[t+1]=v,h[t]=s,h[t+1]=e)}let S=b,w=0,P=0;for(let t=b;t<4;t++){switch(t){case 0:P=2*l[M[t]];break;case 1:P=1.66666666*l[M[t]];break;case 2:P=1.33333333*l[M[t]];break;case 3:P=l[M[t]]}P>w&&(w=P,S=M[t])}return a[S]}(t),null!==s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}}function Xe(t){if(!t)return null;switch(t.type){case"CIMGeometricEffectAddControlPoints":return It.local();case"CIMGeometricEffectArrow":return Ft.local();case"CIMGeometricEffectBuffer":return Nt.local();case"CIMGeometricEffectControlMeasureLine":return Wt.local();case"CIMGeometricEffectCut":return Dt.local();case"CIMGeometricEffectDashes":return qt.local();case"CIMGeometricEffectDonut":return Kt.local();case"CIMGeometricEffectJog":return $t.local();case"CIMGeometricEffectMove":return te.local();case"CIMGeometricEffectOffset":return se.local();case"CIMGeometricEffectReverse":return re.local();case"CIMGeometricEffectRotate":return ae.local();case"CIMGeometricEffectScale":return he.local();case"CIMGeometricEffectWave":return ue.local()}return null}function He(t){if(!t)return null;switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":return me.local();case"CIMMarkerPlacementAtExtremities":return pe.local();case"CIMMarkerPlacementAtRatioPositions":return ge.local();case"CIMMarkerPlacementInsidePolygon":return Me.local();case"CIMMarkerPlacementOnLine":return ve.local();case"CIMMarkerPlacementOnVertices":return we.local();case"CIMMarkerPlacementPolygonCenter":return Ue.local()}return null}class Ye{static getPlacement(t,e,s,i){const r=He(e);if(!r)return null;const n=ft(t);return r.execute(n,e,s,i)}}var Je=s(46851);function qe(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1],u=s[2],f=s[3],m=s[4],_=s[5];return t[0]=i*h+n*c,t[1]=r*h+o*c,t[2]=i*u+n*f,t[3]=r*u+o*f,t[4]=i*m+n*_+a,t[5]=r*m+o*_+l,t}function Ze(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=Math.sin(s),c=Math.cos(s);return t[0]=i*c+n*h,t[1]=r*c+o*h,t[2]=i*-h+n*c,t[3]=r*-h+o*c,t[4]=a,t[5]=l,t}function Ke(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=i*h+n*c+a,t[5]=r*h+o*c+l,t}function je(t,e){const s=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=s,t[2]=-s,t[3]=i,t[4]=0,t[5]=0,t}function $e(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Qe(t,e,s){return t[0]=e[0]-s[0],t[1]=e[1]-s[1],t[2]=e[2]-s[2],t[3]=e[3]-s[3],t[4]=e[4]-s[4],t[5]=e[5]-s[5],t}const ts=qe,es=Qe;function ss(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function is(t,e,s,i){const r=e[i],n=e[i+1];t[i]=s[0]*r+s[2]*n+s[4],t[i+1]=s[1]*r+s[3]*n+s[5]}function rs(t,e,s,i=0,r=0,n=2){const o=r||e.length/n;for(let r=i;r<o;r++)is(t,e,s,r*n)}Object.freeze(Object.defineProperty({__proto__:null,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},set:function(t,e,s,i,r,n,o){return t[0]=e,t[1]=s,t[2]=i,t[3]=r,t[4]=n,t[5]=o,t},invert:function(t,e){const s=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5];let l=s*n-i*r;return l?(l=1/l,t[0]=n*l,t[1]=-i*l,t[2]=-r*l,t[3]=s*l,t[4]=(r*a-n*o)*l,t[5]=(i*o-s*a)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:qe,rotate:Ze,scale:function(t,e,s){const i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],l=e[5],h=s[0],c=s[1];return t[0]=i*h,t[1]=r*h,t[2]=n*c,t[3]=o*c,t[4]=a,t[5]=l,t},translate:Ke,fromRotation:je,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t},fromTranslation:$e,str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)},add:function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t[3]=e[3]+s[3],t[4]=e[4]+s[4],t[5]=e[5]+s[5],t},subtract:Qe,multiplyScalar:function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*s,t[5]=e[5]*s,t},multiplyScalarAndAdd:function(t,e,s,i){return t[0]=e[0]+s[0]*i,t[1]=e[1]+s[1]*i,t[2]=e[2]+s[2]*i,t[3]=e[3]+s[3]*i,t[4]=e[4]+s[4]*i,t[5]=e[5]+s[5]*i,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]},equals:function(t,e){const s=t[0],i=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],f=e[4],m=e[5],_=(0,Je.g)();return Math.abs(s-l)<=_*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(i-h)<=_*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(r-c)<=_*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-u)<=_*Math.max(1,Math.abs(n),Math.abs(u))&&Math.abs(o-f)<=_*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(a-m)<=_*Math.max(1,Math.abs(a),Math.abs(m))},mul:ts,sub:es},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,create:ss,clone:function(t){const e=new Float32Array(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},fromValues:function(t,e,s,i,r,n){const o=new Float32Array(6);return o[0]=t,o[1]=e,o[2]=s,o[3]=i,o[4]=r,o[5]=n,o},createView:function(t,e){return new Float32Array(t,e,6)},transform:is,transformMany:rs},Symbol.toStringTag,{value:"Module"}));var ns=s(1265),os=s(87893);class as{constructor(t,e,s,i){this.center=(0,ns.f)(t,e),this.centerT=(0,ns.c)(),this.halfWidth=s/2,this.halfHeight=i/2,this.width=s,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new as(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const s=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),r=(t.halfWidth+this.halfWidth+e)/s,n=(t.halfHeight+this.halfHeight+e)/i,o=Math.min(r,n);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),s=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-e,r=Math.max(this.ymax,t.ymax)-s,n=e+i/2,o=s+r/2;this.width=i,this.height=r,this.halfWidth=i/2,this.halfHeight=r/2,this.x=n,this.y=o}static deserialize(t){const e=t.readF32(),s=t.readF32(),i=t.readInt32(),r=t.readInt32();return new as(e,s,i,r)}}const ls=Math.PI/180;class hs{constructor(t,e,s,i){this._rotationT=ss(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const r=s.rect,n=new Float32Array(8);t*=i,e*=i;const o=s.code?r.width*i:s.metrics.width,a=s.code?r.height*i:s.metrics.height;n[0]=t,n[1]=e,n[2]=t+o,n[3]=e,n[4]=t,n[5]=e+a,n[6]=t+o,n[7]=e+a,this._data=n,this._setTextureCoords(r),this._scale=i,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+a)}get width(){return this._mosaic.metrics.width*this._scale}get mosaic(){return this._mosaic}set angle(t){this._angle=t,je(this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,i=Math.abs(t)*this._scale,r=new Float32Array(8);r[0]=this.x,r[1]=this.y,r[2]=this.x+s,r[3]=this.y,r[4]=this.x,r[5]=this.y+i,r[6]=this.x+s,r[7]=this.y+i,rs(r,r,qe(ss(),this._rotationT,this._transform));let n=1/0,o=1/0,a=0,l=0;for(let t=0;t<4;t++){const e=r[2*t],s=r[2*t+1];n=Math.min(n,e),o=Math.min(o,s),a=Math.max(a,e),l=Math.max(l,s)}const h=a-n,c=l-o,u=n+h/2,f=o+c/2;this._bounds=new as(u,f,h,c)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,s=new Float32Array(8);rs(s,t,qe(ss(),this._rotationT,this._transform)),e.upperLeft=(0,J.UJ)(8*s[0],8*s[1]),e.upperRight=(0,J.UJ)(8*s[2],8*s[3]),e.lowerLeft=(0,J.UJ)(8*s[4],8*s[5]),e.lowerRight=(0,J.UJ)(8*s[6],8*s[7])}_setTextureCoords({x:t,y:e,width:s,height:i}){this._texcoords={upperLeft:(0,J.UJ)(t,e),upperRight:(0,J.UJ)(t+s,e),lowerLeft:(0,J.UJ)(t,e+i),lowerRight:(0,J.UJ)(t+s,e+i)}}}const cs=(t,e)=>({code:0,page:0,sdf:!0,rect:new os.Z(0,0,11,8),textureBinding:e,metrics:{advance:0,height:4,width:t,left:0,top:0}});class us{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=0!==s.angle,this._transform=this._createGlyphTransform(this.bounds,s);for(const e of t)e.setTransform(this._transform)}setRotation(t){if(0===t&&0===this._rotation)return;this._rotation=t;const e=this._transform;qe(e,je(ss(),t),e);for(const t of this.glyphs)t.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||"none"===s.decoration||!t.length)return;const i=s.scale,r="underline"===s.decoration?30:20,n=t[0].textureBinding;for(const s of e){const e=s.startX*i,o=s.startY*i,a=(s.width+s.glyphWidthEnd)*i;t.push(new hs(e,o+r*i,cs(a,n),1))}}get boundsT(){const t=this.bounds,e=(0,y.s)((0,ns.c)(),t.x,t.y);if((0,y.t)(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new as(e[0],e[1],s,s)}return new as(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,r=0;for(const n of t)e=Math.min(e,n.xTopLeft),s=Math.min(s,n.yTopLeft),i=Math.max(i,n.xTopLeft+n.width),r=Math.max(r,n.yBottomRight);const n=i-e,o=r-s;return new as(e+n/2,s+o/2,n,o)}_createGlyphTransform(t,e){const s=ls*e.angle,i=ss(),r=(0,ns.c)();return Ke(i,i,(0,y.s)(r,e.xOffset,-e.yOffset)),e.isCIM?Ze(i,i,s):(Ke(i,i,(0,y.s)(r,t.x,t.y)),Ze(i,i,s),Ke(i,i,(0,y.s)(r,-t.x,-t.y))),i}}class fs{constructor(t,e,s,i,r,n){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.end<t.length&&(this.glyphWidthEnd=t[this.end].metrics.width),this.width=i,this.yMin=r,this.yMax=n}}const ms=t=>10===t,_s=t=>32===t;const ps=t=>class extends t{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=p.LW.TEXT,this._aux=(0,J.Jz)(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=(0,h.yw)(t,(t=>function(t,e,s){const i=s.scale,r=new Array,n=function(t,e,s){const i=new Array,r=1/s.scale,n=s.maxLineWidth*r,o=e?t.length-1:0,a=e?-1:t.length,l=e?-1:1;let h=o,c=0,u=0,f=h,m=f,_=0,p=1/0,d=0;for(;h!==a;){const{code:e,metrics:s}=t[h],r=Math.abs(s.top);if(ms(e)||_s(e)||(p=Math.min(p,r),d=Math.max(d,r+s.height)),ms(e))h!==o&&(i.push(new fs(t,f,h-l,c,p,d)),p=1/0,d=0),c=0,f=h+l,m=h+l,u=0;else if(_s(e))m=h+l,u=0,_=s.advance,c+=s.advance;else if(c>n){if(m!==f){const e=m-2*l;c-=_,i.push(new fs(t,f,e,c-u,p,d)),p=1/0,d=0,f=m,c=u}else i.push(new fs(t,f,h-l,c,p,d)),p=1/0,d=0,f=h,m=h,c=0;c+=s.advance,u+=s.advance}else c+=s.advance,u+=s.advance;h+=l}const g=new fs(t,f,h-l,c,p,d);return g.start>=0&&g.end<t.length&&i.push(g),i}(t,e,s),o=function(t,e){let s=0;for(let e=0;e<t.length;e++){const{width:i}=t[e];s=Math.max(i,s)}const i="underline"===e.decoration?4:0,r=t[0].yMin;return{x:0,y:r,height:t[t.length-1].yMax+e.lineHeight*(t.length-1)+i-r,width:s}}(n,s),{vAlign:a,hAlign:l}=s,h=a===H.TR.Baseline?1:0,c=h?0:a-1,u=(1-h)*-o.y+c*(o.height/2)+-26*(h?1:0);for(let e=0;e<n.length;e++){const{start:o,end:a,width:h}=n[e];let c=-1*(l+1)*(h/2)-3;const f=e*s.lineHeight+u-3;n[e].startX=c,n[e].startY=f;for(let e=o;e<=a;e++){const s=t[e];if(ms(s.code))continue;const n=new hs(c+s.metrics.left,f-s.metrics.top,s,i);c+=s.metrics.advance,r.push(n)}}return new us(r,n,s)}(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:A.xm*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM}))):this._shapingInfo=null}_write(t,e,s,i){const r=e.getDisplayId();this._writeGeometry(t,e,r,s,i)}_writeGeometry(t,e,s,i,r){const n=this._shapingInfo;if((0,h.Wi)(n))return;if((0,h.pC)(this._textPlacement)){const o=r??e.readLegacyGeometryForDisplay();return this._writePlacedText(t,s,o,n,i)}const o=r?(0,lt.oB)((0,lt.GH)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!(0,h.Wi)(o)){if(o.isPoint){const[e,i]=o.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||i<0||i>=512))return;return this._writeGlyphs(t,s,{x:e,y:i},n)}o.forEachVertex(((e,i)=>this._writeGlyphs(t,s,{x:e,y:i},n)))}}_writePlacedText(t,e,s,i,r){const n=(0,h.Wg)(this._textPlacement),o=Ye.getPlacement(s,n,(0,B.F2)(1),r.geometryEngine);if(!o)return;let a=o.next();for(;null!=a;){const s=-a.getAngle();i.setRotation(s);const r=a.tx,n=-a.ty;r<0||r>=512||n<0||n>=512||(this._writeGlyphs(t,e,{x:r,y:n},i),i.setRotation(-s)),a=o.next()}}_writeGlyphs(t,e,s,i){const r=q.m2.load(this._materialKey),n=(0,J.UJ)(Math.round(8*s.x),Math.round(8*s.y)),o=this._vertexBoundsScale,a=i.bounds,l=2*Math.max(a.width,a.height);for(const h of i.glyphs)r.textureBinding=h.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(s.x+a.x+this._xOffset,s.y+a.y-this._yOffset,l*o,l*o),this._writeVertices(t,e,n,h),t.recordEnd()}_writeGlyph(t,e,s,i,r){const n=q.m2.load(this._materialKey),o=(0,J.UJ)(Math.round(8*s),Math.round(8*i));n.textureBinding=r.textureBinding,t.recordStart(e,n.data,this.geometryType,!0);const a=r.bounds,l=this._vertexBoundsScale;t.vertexBounds(s+a.x*l,i+a.y*l,a.width*l,a.height*l),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,s,i){const r=t.vertexCount();this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.upperLeft),t.vertexWrite(i.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.upperRight),t.vertexWrite(i.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.lowerLeft),t.vertexWrite(i.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,s,i),t.vertexWrite(i.offsets.lowerRight),t.vertexWrite(i.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,s,i){const r=this._color,n=this._haloColor,o=(0,J.Jz)(0,0,this._referenceSize,this._bitset),a=(0,J.Jz)(0,0,this._size,this._haloSize);t.vertexWrite(s),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}};class ds{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}}class gs{static executeEffects(t,e,s){const i=ft(e);let r=new ds(i);for(const e of t){const t=Xe(e);t&&(r=t.execute(r,e,1.3333333333333333,s))}return r}static next(t){const e=t.next();return function(t){t&&(mt(t),(0,ct.oU)(t)?gt(t.rings):(0,ct.l9)(t)?gt(t.paths):(0,ct.aW)(t)&&dt(t.points))}(e),e}static applyEffects(t,e,s){if(!t)return e;let i=new ds(e);for(const e of t){const t=Xe(e);t&&(i=t.execute(i,e,1,s))}let r,n=null;for(;r=i.next();)n?(0,ct.l9)(n)?(0,ct.l9)(r)&&n.paths.push(...r.paths):(0,ct.oU)(n)&&(0,ct.oU)(r)&&n.rings.push(...r.rings):n=r;return n}}class ys{bindFeature(t,e,s){}write(t,e,s,i){if((0,h.Wi)(this._effects)||0===this._effects?.length)return this._write(t,e,i);const r=gs.executeEffects(this._effects,e.readLegacyGeometryForDisplay(),i.geometryEngine);let n=gs.next(r);for(;n;)this._write(t,e,i,n),n=gs.next(r)}_write(t,e,s,i){}}class xs extends(ps(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p,d,g,y=!1,x,M){super(),this._xOffset=(0,B.F2)(f),this._yOffset=(0,B.F2)(m),this._decoration=h||"none",this._color=r,this._haloColor=n,this._haloSize=Math.min(Math.floor(5*(0,B.F2)((0,B.t_)(s))),127),this._size=Math.min(Math.round((0,B.F2)(e)),127);const b=Math.min(Math.round((0,B.F2)(i||e)),127);this._referenceSize=Math.round(Math.sqrt(256*b)),this._scale=this._size/A.Ex,this._angle=u,this._justify=(0,H.Hd)(o||"center"),this._xAlignD=(0,H.kH)(o||"center"),this._yAlignD=(0,H.b7)(a||"baseline"),this._baseline="baseline"===(a||"baseline"),this._bitset=(l===X.v2.MAP?1:0)|(c?1:0)<<1;const v=q.m2.load(t);v.sdf=!0,this._materialKey=v.data,this._lineWidth=(0,B.F2)(_)||512,this._lineHeight=p||1,this._textPlacement=d,this._effects=g,this._isCIM=y,this._minMaxZoom=(0,J.UJ)(Math.round(x*A.MI),Math.round(M*A.MI))}static fromText(t,e){const s=new xs(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&(0,Y.aH)(t.color)||0,t.haloColor&&(0,Y.aH)(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,X.v2.SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,0,Z),[,i]=n(t.text);return s.bindTextInfo(e,i),s._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,s}static fromCIMText(t,e,s){const i=t.scaleFactor||1,r=t.size*t.sizeRatio*i,[o,a]=st(t.scaleInfo,s),l=new xs(t.materialKey,r,t.outlineSize*t.sizeRatio,t.referenceSize,(0,Y.t2)(t.color),(0,Y.t2)(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*i,t.offsetY*t.sizeRatio*i,512,1,t.markerPlacement,t.effects,!0,o,a),[,h]=n(t.text);return l.bindTextInfo(e,h),l._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,l}}const Ms=l.Z.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),bs=function(t){const e=new Map;return t=>(e.has(t)||e.set(t,(t=>{let e=0;if(0===t)return 1/0;for(;!(t%2);)e++,t/=2;return e})(t)),e.get(t))}(),vs=t=>Math.floor(127*t+127),Ss=t=>Math.floor(10*t),ws=t=>Math.round(t*(254/360));class Ps extends xs{constructor(t,e,s,i){super(t,s.font.size,s.haloSize||0,s.font.size,s.color&&(0,Y.aH)(s.color)||0,s.haloColor&&(0,Y.aH)(s.haloColor)||0,s.horizontalAlignment,s.verticalAlignment,(0,H.NS)(e.labelPlacement)?X.v2.MAP:X.v2.SCREEN,s.font.decoration,!1,s.angle||0,s.xoffset,s.yoffset,s.lineWidth,s.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=p.LW.LABEL,this._allowOverrun=e.allowOverrun??!1,this._repeatLabel=e.repeatLabel??!0,this._labelPosition=e.labelPosition??"curved";const r=function(t,e){const s=!!t.minScale&&e.scaleToZoom(t.minScale)||0;return(0,U.uZ)(s,0,25.5)}(e,i),n=function(t,e){const s=!!t.maxScale&&e.scaleToZoom(t.maxScale)||255;return(0,U.uZ)(s,0,25.5)}(e,i),o=e.labelPlacement,[a,l]=(0,H.qv)(o);this._xAlignD=a,this._yAlignD=l,this._minZoom=r,this._maxZoom=n,this._refPlacementPadding=(0,B.F2)(s.haloSize)+A.Iw,this._repeatLabelDistance=e.repeatLabelDistance?(0,B.F2)(e.repeatLabelDistance):128;const h=q.Gq.load(t);h.sdf=!0,this._materialKey=h.data}static fromLabelClass(t,e){if("esriServerLinePlacementCenterAlong"===t.labelPlacement){const e=t.symbol;e.xoffset=0,e.yoffset=0,e.angle=0,e.font.decoration="none"}return new Ps(t.materialKey,t,t.symbol,e)}get _shapedBox(){return(0,h.Wg)(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=(0,H.g)(this._xAlignD),s=(0,H.tf)(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,(0,h.Wi)(t))return void(this._refSymbolAndPlacementOffset=(0,J.Jz)(0,0,vs(e),vs(s)));if("circle"===t.boundsType&&(e||s)){const t=Math.sqrt(e*e+s*s);e/=t,s/=t}const i=Math.max(t.height,t.width),r=4*this._refPlacementPadding;this._refSymbolAndPlacementOffset=(0,J.Jz)(r,i,vs(e),vs(s)),this._referenceSize=i,this._refPlacementDirX=e,this._refPlacementDirY=s,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if((0,h.Wi)(this._shapingInfo))return;const s=this._shapingInfo,i=e.getDisplayId(),r="esriGeometryPolygon"===e.geometryType?e.readLegacyCentroid():e.readLegacyGeometry();if(r)switch(this._current={out:t,inId:i,inShaping:s,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(r);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(r);break;default:((t,e="mapview-labeling")=>{Ms.error(new o.Z(e,t))})("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const s=Ss(this._current.zoomLevel);return Ss(t)<=s&&s<=Ss(e)}_placePointLabels(t){const{out:e,inId:s,inShaping:i}=this._current;this._writeGlyphs(e,s,t,i)}_placeLineLabels(t){const e=function(t,e){const s=e;for(let e=0;e<t.length;e++){let i=t[e];const r=[];r.push(i[0]);for(let t=1;t<i.length;t++){let[e,s]=r[t-1];e+=i[t][0],s+=i[t][1],r.push([e,s])}at(r,s);const n=[];n.push(r[0]);for(let t=1;t<r.length;t++){const[e,s]=r[t-1],[i,o]=r[t],a=Math.round(i-e),l=Math.round(o-s);n.push([a,l])}t[e]=n,i=n}return t}(t.paths,this._current.inShaping.bounds.width),s=this._placeSubdivGlyphs.bind(this),i=(this._shapedBox.width+this._repeatLabelDistance)/2;for(const t of e)ot(t,i,s,this._repeatLabel)}_placeSubdivGlyphs(t,e,s,i){const r=bs(e),n=this._shapedBox.width/2,o=Math.sqrt(this._repeatLabelDistance)/2,a=Math.min(s,i-s),l=this._current.inShaping.isMultiline?25:Math.log2(a/(o+n/2)),h=0===e?l:Math.min(r,l),c=Math.max(this._minZoom,this._current.zoomLevel+1-h),u=this._current.zoomLevel-c,f=this._shapedBox.width/2*2**u;this._current.inShaping.isMultiline?0===e&&this._placeStraight(t,c):this._allowOverrun&&u<0?this._placeStraightAlong(t,this._minZoom):"parallel"===this._labelPosition?this._placeStraightAlong(t,c):"curved"===this._labelPosition&&this._placeCurved(t,c,f)}_placeStraight(t,e){const{out:s,inId:i,inShaping:r}=this._current,n=Math.ceil(t.angle*(180/Math.PI)%360),o=Math.ceil((t.angle*(180/Math.PI)+180)%360);this._outLineLabelAngle=ws(n),this._writeGlyphs(s,i,t,r,e),this._outLineLabelAngle=ws(o),this._writeGlyphs(s,i,t,r,e)}_placeCurved(t,e,s){const{out:i,inId:r}=this._current;i.metricStart(r,e,t.x,t.y,0,0,0,0);const n=t.clone(),o=t.angle*(180/Math.PI)%360,a=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=ws(o),this._placeFirst(n,e,1),this._placeBack(t,n,e,s,1),this._placeForward(t,n,e,s,1),this._outLineLabelAngle=ws(a),this._placeFirst(n,e,0),this._placeBack(t,n,e,s,0),this._placeForward(t,n,e,s,0),i.metricEnd()}_placeStraightAlong(t,e){const{out:s,inId:i}=this._current;s.metricStart(i,e,t.x,t.y,0,0,0,0);const r=t.clone(),n=t.angle*(180/Math.PI)%360,o=(t.angle*(180/Math.PI)+180)%360;this._outLineLabelAngle=ws(n),this._placeFirst(r,e,1,!0),this._outLineLabelAngle=ws(o),this._placeFirst(r,e,0,!0),s.metricEnd()}_placeBack(t,e,s,i,r){const n=t.clone();let o=t.backwardLength+0;for(;n.prev()&&!(o>=i);)this._placeOnSegment(n,e,o,s,-1,r),o+=n.length+0}_placeForward(t,e,s,i,r){const n=t.clone();let o=t.remainingLength+0;for(;n.next()&&!(o>=i);)this._placeOnSegment(n,e,o,s,1,r),o+=n.length+0}_placeFirst(t,e,s,i=!1){const r=t,n=this._current.inShaping,o=n.glyphs,a=this._current.zoomLevel,{out:l,inId:h}=this._current;for(const c of o){const o=c.x>n.bounds.x?s:1-s,u=o*t.remainingLength+(1-o)*t.backwardLength,f=Math.abs(c.x+c.width/2-n.bounds.x),m=Math.max(0,a+Math.log2(f/(u+0))),_=Math.max(e,i?0:m);if(c.maxZoom=25,c.angle=t.angle+(1-s)*Math.PI,c.minZoom=_,this._writeGlyph(l,h,r.x,r.y,c),s&&this._isVisible(c.minZoom,c.maxZoom)){const t=c.bounds;l.metricBoxWrite(t.center[0],t.center[1],t.width,t.height)}}}_placeOnSegment(t,e,s,i,r,n){const o=this._current.inShaping.glyphs,{out:a,inId:l}=this._current,h=this._current.inShaping,c=this._current.zoomLevel,u=t.dx/t.length,f=t.dy/t.length,m={x:t.x+s*-r*u,y:t.y+s*-r*f};for(const u of o){const o=u.x>h.bounds.x?n:1-n;if(!(o&&1===r||!o&&-1===r))continue;const f=Math.abs(u.x+u.width/2-h.bounds.x),_=Math.max(0,c+Math.log2(f/s)-.1),p=Math.max(i,c+Math.log2(f/(s+t.length+0)));if(0!==_&&(u.angle=t.angle+(1-n)*Math.PI,u.minZoom=p,u.maxZoom=_,this._writeGlyph(a,l,m.x,m.y,u),n&&this._isVisible(u.minZoom,u.maxZoom))){const s=u.bounds,i=t.x-e.x,r=t.y-e.y;a.metricBoxWrite(s.center[0]+i,s.center[1]+r,s.width,s.height)}}}_writeGlyphs(t,e,s,i,r=this._minZoom){if(s.x<0||s.x>=512||s.y<0||s.y>=512)return;const n=s.x+this._refOffsetX,o=s.y-this._refOffsetY;for(const s of i.glyphs)s.minZoom=r,s.maxZoom=this._maxZoom,this._writeGlyph(t,e,n,o,s);const a=this._refPlacementDirX,l=this._refPlacementDirY,h=i.boundsT;t.metricStart(e,r,n,o,a,l,this._referenceSize,this._materialKey),t.metricBoxWrite(h.center[0],h.center[1],h.width,h.height),t.metricEnd()}_writeVertexCommon(t,e,s,i){const r=this._color,n=this._haloColor,o=(0,J.Jz)(0,0,this._size,this._haloSize),a=Math.max(i.minZoom,this._minZoom),l=Math.min(i.maxZoom,this._maxZoom),h=(0,J.Jz)(Ss(a),Ss(l),this._outLineLabelAngle,0);t.vertexWrite(s),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(n),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(h)}}const Cs=3.14159265359/180,Ls=t=>class extends t{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=p.LW.MARKER}_write(t,e,s,i){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,s,i),t.recordEnd()}_writeGeometry(t,e,s,i,r){if((0,h.pC)(this._markerPlacement))return this._writePlacedMarkers(t,e,i,r);if(!r&&"esriGeometryPoint"===e.geometryType){const i=e.getX(),r=e.getY();if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(i<0||i>=513||r<0||r>=513))return;return this._writeVertices(t,s,this._getPos(i,r),i,r)}const n=r?(0,lt.oB)((0,lt.GH)(r),2):"esriGeometryPolygon"===e.geometryType?e.readCentroid():e.readGeometryForDisplay();if(!(0,h.Wi)(n)){if(n.isPoint){const[e,i]=n.coords;if(!t.hasAggregates&&t.hasPixelBufferEnabled&&(e<0||e>=512||i<0||i>=512))return;return this._writeVertices(t,s,this._getPos(e,i),e,i)}n.forEachVertex(((e,i)=>{const r=2*A.I_;e<-r||e>=r||i<-r||i>=r||this._writeVertices(t,s,this._getPos(e,i),e,i)}))}}_writePlacedMarkers(t,e,s,i){const r=i??e.readLegacyGeometryForDisplay(),n=Ye.getPlacement(r,(0,h.Wg)(this._markerPlacement),(0,B.F2)(1),s.geometryEngine);if(!n)return;const o=e.getDisplayId(),a=(0,ns.c)(),l=ss();let c=n.next();for(;null!=c;){const e=c.tx,s=-c.ty;e>=-128&&e<=640&&s>=-128&&s<=640&&(this._applyTransformation(l,a,-c.getAngle()/Cs),this._writeVertices(t,o,this._getPos(e,s),e,s)),c=n.next()}}_writeVertices(t,e,s,i,r){const n=q.mE.load(this._materialKey);return n.symbologyType===p.mD.HEATMAP?this._writeHeatmapVertices(t,e,s):this._writeMarkerVertices(t,e,n,s,i,r)}_writeMarkerVertices(t,e,s,i,r,n){const o=s.vvRotation,a=t.vertexCount();let l=this._computedWidth*this._vertexBoundsScaleX,h=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const t=Math.max(l,h);l=t,h=t}if(o){const t=Math.max(this.xOffset,this.yOffset);l+=t,h+=t}t.vertexBounds(r+this.xOffset,n-this.yOffset,l,h),t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,a)}_writeHeatmapVertices(t,e,s){const i=t.vertexCount();t.vertexWrite(s),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,i)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,s=0){$e(t,(0,ns.f)(this.xOffset,-this.yOffset)),this.angle+s!==0&&Ze(t,t,Cs*(this.angle+s));const i=this._computedWidth,r=this._computedHeight,n=-(.5+this._anchorX)*i,o=-(.5-this._anchorY)*r;(0,y.s)(e,n,o),(0,y.t)(e,e,t),this._offsetUpperLeft=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],(0,y.s)(e,n+i,o),(0,y.t)(e,e,t),this._offsetUpperRight=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],(0,y.s)(e,n,o+r),(0,y.t)(e,e,t),this._offsetBottomLeft=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],(0,y.s)(e,n+i,o+r),(0,y.t)(e,e,t),this._offsetBottomRight=(0,J.UJ)(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return(0,J.UJ)(Math.round(8*t),Math.round(8*e))}};class Is extends(Ls(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,d,g,y,x,M,b,v,S){super(),this.angle=i,this.height=o,this.width=n,this.xOffset=e*x,this.yOffset=s*x,this._markerPlacement=M,this._effects=b,this._anchorX=d,this._anchorY=g,this._minMaxZoom=(0,J.UJ)(Math.round(v*A.MI),Math.round(S*A.MI));const w=(m===X.v2.MAP?A.Tz:A.CQ)|(c?A.Uh:0)|(f?A.oK:0)|(u?A.e0:0),P=_&&_.sdf,C=q.mE.load(t);C.sdf=P,C.pattern=!0,C.textureBinding=_.textureBinding,this._materialKey=C.data,this._fillColor=r,this._outlineColor=l,this._sizeOutlineWidth=(0,J.Jz)(Math.round(Math.min(Math.sqrt(128*n),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*h),255)),Math.round(Math.min(Math.sqrt(128*a),255)));const L=_.rect.x+A.fL,I=_.rect.y+A.fL,k=L+_.width,T=I+_.height;this._offsets.xUpperLeft=L,this._offsets.yUpperLeft=I,this._offsets.xUpperRight=k,this._offsets.yUpperRight=I,this._offsets.xBottomLeft=L,this._offsets.yBottomLeft=T,this._offsets.xBottomRight=k,this._offsets.yBottomRight=T,C.symbologyType===p.mD.PIE_CHART?(this._texUpperLeft=(0,J.UJ)(0,1),this._texUpperRight=(0,J.UJ)(1,1),this._texBottomLeft=(0,J.UJ)(0,0),this._texBottomRight=(0,J.UJ)(1,0)):(this._texUpperLeft=(0,J.UJ)(L,I),this._texUpperRight=(0,J.UJ)(k,I),this._texBottomLeft=(0,J.UJ)(L,T),this._texBottomRight=(0,J.UJ)(k,T)),n*=y,o*=y,n*=x,o*=x;const z=Math.round(64*y);this._bitestAndDistRatio=(0,J.UJ)(w,z),this._computedWidth=n,this._computedHeight=o;const E=(0,ns.c)(),F=ss();this._applyTransformation(F,E)}static fromCIMMarker(t,e,s){const i=e&&e.width||1,r=e&&e.height||1,n=t.size,o=i/r*t.scaleX,a=t.scaleSymbolsProportionally&&t.frameHeight?n/t.frameHeight:1;let l=(0,Y.t2)(t.color);const c=(0,Y.t2)(t.outlineColor),u=(0,B.F2)(n),f=u*o,m=(0,B.F2)(t.offsetX||0),_=(0,B.F2)(t.offsetY||0),p=(0,B.F2)(t.outlineWidth||0)*a,d=t.alignment||X.v2.SCREEN,g=(0,B.F2)(t.referenceSize),[y,x]=st(t.scaleInfo,s);e.sdf||0!==l||(l=-1);let M=t.rotation||0;t.rotateClockwise||(M=-M);let b=0,v=0;const S=t.anchorPoint;S&&(t.isAbsoluteAnchorPoint?n&&(b=S.x/(n*o),v=S.y/n):(b=S.x,v=S.y));const w=new Is(t.materialKey,m,_,M,l,f,u,g,c,p,t.colorLocked,t.scaleSymbolsProportionally,!1,d,e,b,v,t.sizeRatio,(0,h.Pt)(t.scaleFactor,1),t.markerPlacement,t.effects,y,x);return w._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/f:1,w._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/u:1,w}static fromPictureMarker(t,e){const s=Math.round((0,B.F2)(t.width)),i=Math.round((0,B.F2)(t.height)),r=A.ru,n=Math.round((0,B.F2)(t.xoffset||0)),o=Math.round((0,B.F2)(t.yoffset||0)),a=new Is(t.materialKey,n,o,t.angle,r,s,i,i,0,0,!1,!1,!1,X.v2.SCREEN,e,0,0,1,1,null,null,0,Z);return a._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,a._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,a}static fromSimpleMarker(t,e){const s=(0,Y.aH)(t.color),i=Math.round((0,B.F2)(t.size)),r=i,n=Math.round((0,B.F2)(t.xoffset||0)),o=Math.round((0,B.F2)(t.yoffset||0)),a=t.style,l=t.outline,h=0|(l&&l.color&&(0,Y.aH)(l.color)),c=0|(l&&l.width&&Math.round((0,B.F2)(l.width))),u=new Is(t.materialKey,n,o,t.angle,s,i,r,r,h,c,!1,!1,"esriSMSCross"===a||"esriSMSX"===a,X.v2.SCREEN,e,0,0,126/64,1,null,null,0,Z);return u.boundsType="esriSMSCircle"===a?"circle":"square",u._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,u._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,u}static fromLineSymbolMarker(t,e){const s=(0,Y.aH)(t.color),i=Math.round((0,B.F2)(6*t.lineWidth)),r=i,n="cross"===t.style||"x"===t.style;let o;switch(t.placement){case"begin-end":o=X.Tx.Both;break;case"begin":o=X.Tx.JustBegin;break;case"end":o=X.Tx.JustEnd;break;default:o=X.Tx.None}const a={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:o,offsetAlongLine:0},l=new Is(t.materialKey,0,0,0,s,i,r,r/6,s,n?Math.round((0,B.F2)(t.lineWidth)):0,!1,!1,n,X.v2.MAP,e,0,0,126/64,1,a,null,0,Z);return l.boundsType="circle"===t.style?"circle":"square",l}}var ks=s(58333),Ts=s(55987),zs=(s(95401),s(5428)),As=s(35362),Es=s(31294);function Fs(t,e,s,i,r,n,o){ri=0;const a=(i-s)*n,l=r&&r.length,h=l?(r[0]-s)*n:a;let c,u,f,m,_,p=Rs(e,s,0,0,h,n,!0);if(p&&p.next!==p.prev){if(l&&(p=function(t,e,s,i,r,n){const o=new Array;for(let r=0,a=i.length;r<a;r++){const l=Rs(t,e,0,i[r]*n,r<a-1?i[r+1]*n:s*n,n,!1);l===l.next&&(l.steiner=!0),o.push(Us(l))}o.sort(js);for(const t of o)r=Bs(t,r);return r}(e,s,i,r,p,n)),a>80*n){c=f=e[0+s*n],u=m=e[1+s*n];for(let t=n;t<h;t+=n){const i=e[t+s*n],r=e[t+1+s*n];c=Math.min(c,i),u=Math.min(u,r),f=Math.max(f,i),m=Math.max(m,r)}_=Math.max(f-c,m-u),_=0!==_?1/_:0}Os(p,t,n,c,u,_,o,0)}}function Rs(t,e,s,i,r,n,o){let a;if(o===function(t,e,s,i,r,n){let o=0;for(let s=i,a=r-n;s<r;s+=n)o+=(t[a+e*n]-t[s+e*n])*(t[s+1+e*n]+t[a+1+e*n]),a=s;return o}(t,e,0,i,r,n)>0)for(let s=i;s<r;s+=n)a=Ds(s+e*n,t[s+e*n],t[s+1+e*n],a);else for(let s=r-n;s>=i;s-=n)a=Ds(s+e*n,t[s+e*n],t[s+1+e*n],a);return a&&Ks(a,a.next)&&(Gs(a),a=a.next),a}function Ns(t,e=t){if(!t)return t;let s,i=t;do{if(s=!1,i.steiner||!Ks(i,i.next)&&0!==Hs(i.prev,i,i.next))i=i.next;else{if(Gs(i),i=e=i.prev,i===i.next)break;s=!0}}while(s||i!==e);return e}function Os(t,e,s,i,r,n,o,a){if(!t)return;!a&&n&&(t=Xs(t,i,r,n));let l=t;for(;t.prev!==t.next;){const h=t.prev,c=t.next;if(n?Vs(t,i,r,n):Ws(t))e.push(h.index/s+o),e.push(t.index/s+o),e.push(c.index/s+o),Gs(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?Os(t=$s(t,e,s,o),e,s,i,r,n,o,2):2===a&&Qs(t,e,s,i,r,n,o):Os(Ns(t),e,s,i,r,n,o,1);break}}}function Ws(t){const e=t.prev,s=t,i=t.next;if(Hs(e,s,i)>=0)return!1;let r=t.next.next;const n=r;let o=0;for(;r!==t.prev&&(0===o||r!==n);){if(o++,Js(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&Hs(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Vs(t,e,s,i){const r=t.prev,n=t,o=t.next;if(Hs(r,n,o)>=0)return!1;const a=r.x<n.x?r.x<o.x?r.x:o.x:n.x<o.x?n.x:o.x,l=r.y<n.y?r.y<o.y?r.y:o.y:n.y<o.y?n.y:o.y,h=r.x>n.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,c=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=Zs(a,l,e,s,i),f=Zs(h,c,e,s,i);let m=t.prevZ,_=t.nextZ;for(;m&&m.z>=u&&_&&_.z<=f;){if(m!==t.prev&&m!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Hs(m.prev,m,m.next)>=0)return!1;if(m=m.prevZ,_!==t.prev&&_!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&Hs(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;m&&m.z>=u;){if(m!==t.prev&&m!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Hs(m.prev,m,m.next)>=0)return!1;m=m.prevZ}for(;_&&_.z<=f;){if(_!==t.prev&&_!==t.next&&Js(r.x,r.y,n.x,n.y,o.x,o.y,_.x,_.y)&&Hs(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Ds(t,e,s,i){const r=si.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Gs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Us(t){let e=t,s=t;do{(e.x<s.x||e.x===s.x&&e.y<s.y)&&(s=e),e=e.next}while(e!==t);return s}function Bs(t,e){const s=function(t,e){let s=e;const i=t.x,r=t.y;let n,o=-1/0;do{if(r<=s.y&&r>=s.next.y&&s.next.y!==s.y){const t=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(t<=i&&t>o){if(o=t,t===i){if(r===s.y)return s;if(r===s.next.y)return s.next}n=s.x<s.next.x?s:s.next}}s=s.next}while(s!==e);if(!n)return null;if(i===o)return n.prev;const a=n,l=n.x,h=n.y;let c,u=1/0;for(s=n.next;s!==a;)i>=s.x&&s.x>=l&&i!==s.x&&Js(r<h?i:o,r,l,h,r<h?o:i,r,s.x,s.y)&&(c=Math.abs(r-s.y)/(i-s.x),(c<u||c===u&&s.x>n.x)&&qs(s,t)&&(n=s,u=c)),s=s.next;return n}(t,e);if(!s)return e;const i=ei(s,t);return Ns(i,i.next),Ns(s,s.next)}function Xs(t,e,s,i){for(let r;r!==t;r=r.next){if(r=r||t,null===r.z&&(r.z=Zs(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Xs(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,function(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let n=0;for(;r;){n++,i=r;let o=0;for(;o<s&&i;o++)i=i.nextZ;let a=s;for(;o>0||a>0&&i;){let s;0===o?(s=i,i=i.nextZ,a--):0!==a&&i?r.z<=i.z?(s=r,r=r.nextZ,o--):(s=i,i=i.nextZ,a--):(s=r,r=r.nextZ,o--),e?e.nextZ=s:t=s,s.prevZ=e,e=s}r=i}if(e.nextZ=null,s*=2,n<2)return t}}(t)}function Hs(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ys(t,e,s,i){return!!(Ks(t,e)&&Ks(s,i)||Ks(t,i)&&Ks(s,e))||Hs(t,e,s)>0!=Hs(t,e,i)>0&&Hs(s,i,t)>0!=Hs(s,i,e)>0}function Js(t,e,s,i,r,n,o,a){return(r-o)*(e-a)-(t-o)*(n-a)>=0&&(t-o)*(i-a)-(s-o)*(e-a)>=0&&(s-o)*(n-a)-(r-o)*(i-a)>=0}function qs(t,e){return Hs(t.prev,t,t.next)<0?Hs(t,e,t.next)>=0&&Hs(t,t.prev,e)>=0:Hs(t,e,t.prev)<0||Hs(t,t.next,e)<0}function Zs(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ks(t,e){return t.x===e.x&&t.y===e.y}function js(t,e){return t.x-e.x}function $s(t,e,s,i){let r=t;do{const n=r.prev,o=r.next.next;!Ks(n,o)&&Ys(n,r,r.next,o)&&qs(n,o)&&qs(o,n)&&(e.push(n.index/s+i),e.push(r.index/s+i),e.push(o.index/s+i),Gs(r),Gs(r.next),r=t=o),r=r.next}while(r!==t);return r}function Qs(t,e,s,i,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.index!==t.index&&ti(a,t)){let l=ei(a,t);return a=Ns(a,a.next),l=Ns(l,l.next),Os(a,e,s,i,r,n,o,0),void Os(l,e,s,i,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function ti(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!function(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ys(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}(t,e)&&qs(t,e)&&qs(e,t)&&function(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{s.y>n!=s.next.y>n&&s.next.y!==s.y&&r<(s.next.x-s.x)*(n-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next}while(s!==t);return i}(t,e)}function ei(t,e){const s=si.create(t.index,t.x,t.y),i=si.create(e.index,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,n.next=i,i.prev=n,i}class si{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,s){const i=ri<ii.length?ii[ri++]:new si;return i.index=t,i.x=e,i.y=s,i.prev=null,i.next=null,i.z=null,i.prevZ=null,i.nextZ=null,i.steiner=!1,i}}const ii=new Array;let ri=0;for(let t=0;t<8096;t++)ii.push(new si);const ni=new Es.b(0,0,0,1,0),oi=new Es.b(0,0,0,1,0);function ai(t,e,s){let i=0;for(let r=1;r<s;r++){const s=t[2*(e+r-1)],n=t[2*(e+r-1)+1];i+=(t[2*(e+r)]-s)*(t[2*(e+r)+1]+n)}return i}function li(t,e,s,i,r){let n=0;for(let o=s;o<i;o+=3){const s=2*(t[o]-r),i=2*(t[o+1]-r),a=2*(t[o+2]-r);n+=Math.abs((e[s]-e[a])*(e[i+1]-e[s+1])-(e[s]-e[i])*(e[a+1]-e[s+1]))}return n}ni.setExtent(A.I_),oi.setExtent(A.I_);var hi=s(67327);const ci=16,ui=t=>class extends t{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=p.LW.LINE}writeGeometry(t,e,s,i){this._writeGeometry(t,e,s,i)}_initializeTessellator(t){const e=q.a.load(this._materialKey),s=q.dk.load(this._materialKey),i=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,n=this.tessellationProperties._halfWidth<A.tQ&&!t&&!r;this.tessellationProperties.minMaxZoom=this._minMaxZoom,i.wrapDistance=65535,i.textured=this._isDashed||this._hasPattern,i.offset=this.tessellationProperties.offset,i.halfWidth=this.tessellationProperties._halfWidth;const o=n?0:1,a=(0,q.CA)(s)?mi:fi;this._lineTessellator=new hi.z(a(this.tessellationProperties,o,o),_i(this.tessellationProperties),n)}_write(t,e,s,i){const r="esriGeometryPoint"===e.geometryType;t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,i,r),t.recordEnd()}_writeGeometry(t,e,s,i){const r=s??e.readLegacyGeometryForDisplay(),n=this._getLines(r,i);(0,h.Wi)(n)||this._writeVertices(t,e,n)}_getLines(t,e){if((0,h.Wi)(t))return null;const s=t.paths||t.rings;return(0,h.Wi)(s)?null:function(t,e){oi.setPixelMargin(e);const s=oi,i=-e,r=A.I_+e;let n=[],o=!1,a=0;for(;a<t.length;){const e=[],l=t[a];if(!l)return null;s.reset(As.V.LineString);let[h,c]=l[0];if(o)s.moveTo(h,c);else{if(h<i||h>r||c<i||c>r){o=!0;continue}e.push({x:h,y:c})}let u=!1;const f=l.length;for(let t=1;t<f;++t)if(h+=l[t][0],c+=l[t][1],o)s.lineTo(h,c);else{if(h<i||h>r||c<i||c>r){u=!0;break}e.push({x:h,y:c})}if(u)o=!0;else{if(o){const t=s.resultWithStarts();if(t)for(const e of t)n.push(e)}else n.push({line:e,start:0});a++,o=!1}}return n=n.filter((t=>t.line.length>1)),0===n.length?null:n}(s,e?256:16)}_writeVertices(t,e,s){const i=e.getDisplayId(),r=t.vertexCount(),n=this.tessellationProperties,o=this._tessellationOptions;n.out=t,n.id=i,n.indexCount=0,n.vertexCount=0,n.offset=r,o.capType=this._capType,o.joinType=this._joinType;const a=q.dk.load(this._materialKey);this.tessellationProperties.key=(0,q.CA)(a)?a:q.a.load(this._materialKey);for(const{line:t,start:e}of s)o.initialDistance=e%65535,this._lineTessellator.tessellate(t,o)}},fi=(t,e,s)=>(i,r,n,o,a,l,h,c,u,f,m)=>{const _=(0,J.UJ)(m,Math.ceil(ci*t._halfWidth)),p=(0,J.Jz)(Math.round(ci*h),Math.round(ci*c),Math.round(ci*u),Math.round(ci*f)),d=(0,J.Jz)(ci*a,ci*l,0,t._bitset),g=t.out;return g.vertexBounds(i,r,e,s),g.vertexWrite((0,J.UJ)(8*i,8*r)),g.vertexWrite(t.id),g.vertexWrite(t._fillColor),g.vertexWrite(p),g.vertexWrite(_),g.vertexWrite(t._tl),g.vertexWrite(t._br),g.vertexWrite(d),g.vertexWrite((0,J.UJ)(Math.ceil(ci*t._halfReferenceWidth),0)),g.vertexWrite(t.minMaxZoom),g.vertexEnd(),t.offset+t.vertexCount++},mi=(t,e,s)=>(i,r,n,o,a,l,h,c,u,f,m)=>{const _=(0,J.UJ)(ci*t._halfWidth,ci*t._halfReferenceWidth),p=(0,J.Jz)(ci*h+128,ci*c+128,ci*u+128,ci*f+128),d=t.out,g=t._bitset<<24|t.id;d.vertexBounds(i,r,e,s),d.vertexWrite((0,J.UJ)(8*i,8*r)),d.vertexWrite(g),d.vertexWrite(t._fillColor);const y=(0,q.Xp)(t.key);return y||(d.vertexWrite(0),d.vertexWrite(0)),d.vertexWrite(0),d.vertexWrite(_),d.vertexWrite(p),y||d.vertexWrite(t.minMaxZoom),d.vertexEnd(),t.offset+t.vertexCount++},_i=t=>(e,s,i)=>{const r=t.out;r.indexWrite(e),r.indexWrite(s),r.indexWrite(i),t.indexCount+=3};class pi extends(ui(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p,d,g,y,x){super();const M=q.a.load(t);e&&(M.sdf=e.sdf,M.pattern=!0,M.textureBinding=e.textureBinding),this._capType=i,this._joinType=r,this._miterLimitCosine=et(n),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=a,this.tessellationProperties._br=l,this._hasPattern=h,this._isDashed=c,this._zOrder=d,this._effects=g,this._minMaxZoom=(0,J.UJ)(Math.round(y*A.MI),Math.round(x*A.MI)),this._materialKey=M.data;const b=(f?A.Uh:0)|(m?A.SD:0)|(u?A._6:0)|(_?A.Iv:0);this.tessellationProperties._bitset=b,this.tessellationProperties._halfWidth=.5*s,this.tessellationProperties._halfReferenceWidth=.5*p,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,s){const i=t.color,r=t.scaleFactor||1,n=!!t.dashTemplate;let o=t.cap;n&&o===X.RL.ROUND&&(o=X.RL.SQUARE);const a=t.join,l=(0,B.F2)(t.width)*r,h=(0,B.F2)(t.referenceWidth),c=(0,B.F2)(t.miterLimit),u=i&&(0,Y.t2)(i)||0,[f,m]=st(t.scaleInfo,s);if(!e)return new pi(t.materialKey,e,l,o,a,c,u,0,0,!1,n,t.scaleDash,t.colorLocked,!1,t.sampleAlphaOnly,h,t.zOrder,t.effects,f,m);const{rect:_,width:p,height:d}=e,g=_.x+A.fL,y=_.y+A.fL,x=g+p,M=y+d,b=(0,J.UJ)(g,y),v=(0,J.UJ)(x,M);return new pi(t.materialKey,e,l,o,a,c,u,b,v,!0,n,t.scaleDash,t.colorLocked,!1,t.sampleAlphaOnly,h,t.zOrder,t.effects,f,m)}static fromFillOutline(t){const e=q.dk.load(t.materialKey);return(0,q.CA)(e)&&t.outline&&"esriSLSSolid"===t.outline?.style?pi.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,s=!1){const{color:i}=t,r="esriSLSSolid"!==t.style&&"esriSLSNull"!==t.style,n=(0,E.ws)(t.cap||"round"),o=(0,E.xV)(t.join||"round");let a=i&&"esriSLSNull"!==t.style&&(0,Y.aH)(i)||0;"esriSLSNull"===t.style&&(a=0);const l=(0,B.F2)(t.width),h=t.miterLimit;if(!e)return new pi(t.materialKey,e,l,n,o,h,a,0,0,!1,r,!0,!1,s,!1,l,0,null,0,Z);const{rect:c,width:u,height:f}=e,m=c.x+A.fL,_=c.y+A.fL,p=m+u,d=_+f,g=(0,J.UJ)(m,_),y=(0,J.UJ)(p,d);return new pi(t.materialKey,e,l,n,o,h,a,g,y,!0,r,!0,!1,s,!1,l,0,null,0,Z)}static fromPictureLineSymbol(t,e,s,i){return l.Z.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}}const di=t=>class extends t{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=p.LW.FILL}_maybeAddLineTemplate(t){this._lineTemplate=pi.fromFillOutline(t)}_write(t,e,s,i){const r="esriGeometryPoint"===e.geometryType,n=q.dk.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,n,i,r),(0,q.CA)(n)&&(0,h.pC)(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,i,r),t.recordEnd()}_writeGeometry(t,e,s,i,r){const n=this._getGeometry(e,i,r);if((0,h.Wi)(n))return;const o=[];if(!(n.maxLength>100)&&!this.forceLibtess&&function(t,e){const{coords:s,lengths:i,hasIndeterminateRingOrder:r}=e,n=t;if(r)return!1;let o=0;for(let t=0;t<i.length;){let e=t,r=i[t],a=ai(s,o,r);const l=[];for(;++e<i.length;){const t=i[e],n=ai(s,o+r,t);if(!(n>0))break;a+=n,l.push(o+r),r+=t}const h=n.length;Fs(n,s,o,o+r,l,2,0);const c=li(n,s,h,n.length,0),u=Math.abs(a);if(Math.abs((c-u)/Math.max(1e-7,u))>1e-5)return n.length=0,!1;t=e,o+=r}return!0}(o,n))return void(o.length&&this._writeVertices(t,e,n.coords,n.lengths,s,o));const a=function(t){const{coords:e,lengths:s}=t,{buffer:i}=(0,G.b)(e,s);return i}(n);this._writeVertices(t,e,a,[a.length/2],s)}_writeVertex(t,e,s,i,r,n){const o=(0,J.UJ)(1*i,1*r);if(t.vertexBounds(i,r,0,0),t.vertexWrite(o),t.vertexWrite(e),s.symbologyType===p.mD.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(n.readGeometryArea()));else{t.vertexWrite(this.fillColor);const e=(0,q.Xp)(s);e||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),e||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,s,i,r,n){const o=e.getDisplayId(),a=this._bitset<<24|o,l=i.reduce(((t,e)=>t+e)),h=(0,E.$_)(r.geometryType,r.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(h*l);let u=0;if(n)for(const i of n){const n=s[2*i],o=s[2*i+1];this._writeVertex(t,a,r,n,o,e),u++}else for(let i=0;i<s.length;i+=2){const n=Math.round(s[i]),o=Math.round(s[i+1]);this._writeVertex(t,a,r,n,o,e),u++}t.indexEnsureSize(u);for(let e=0;e<u;e++)t.indexWrite(e+c)}_getGeometry(t,e,s){const i=e?(0,lt.oB)((0,lt.GH)(e),2):t.readGeometryForDisplay();return i?function(t,e){if((0,h.Wi)(t))return null;if(!function(t,e,s){let i=0;for(let e=0;e<t.lengths.length;e++){const r=t.lengths[e];for(let e=0;e<r;e++){const r=t.coords[2*(e+i)],n=t.coords[2*(e+i)+1];if(r<-128||r>s||n<-128||n>s)return!0}i+=r}return!1}(t,0,A.I_+128))return t;ni.setPixelMargin(e),ni.reset(As.V.Polygon);let s=0;for(let e=0;e<t.lengths.length;e++){const i=t.lengths[e];let r=t.coords[2*(0+s)],n=t.coords[2*(0+s)+1];ni.moveTo(r,n);for(let e=1;e<i;e++)r=t.coords[2*(e+s)],n=t.coords[2*(e+s)+1],ni.lineTo(r,n);ni.close(),s+=i}const i=ni.result(!1);if(!i)return null;const r=[],n=[];for(const t of i){let e=0;for(const s of t)n.push(s.x),n.push(s.y),e++;r.push(e)}return new zs.Z(r,n)}(i,s?256:8):null}};var gi=s(22303);function yi(t){if(!t)return"arial-unicode-ms";const e=t.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}s(68773),new Map;var xi=s(19153),Mi=s(59266),bi=s(71143);class vi{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,r=this._rasterizationCanvas,n=r.getContext("2d");t!==r&&(r.width=s,r.height=i,n.drawImage(t,0,0,s,i));const o=n.getImageData(0,0,s,i).data;if(e)for(const t of e)if(t&&t.oldColor&&4===t.oldColor.length&&t.newColor&&4===t.newColor.length){const[e,s,i,r]=t.oldColor,[n,a,l,h]=t.newColor;if(e===n&&s===a&&i===l&&r===h)continue;for(let t=0;t<o.length;t+=4)e===o[t]&&s===o[t+1]&&i===o[t+2]&&r===o[t+3]&&(o[t]=n,o[t+1]=a,o[t+2]=l,o[t+3]=h)}const a=new ImageData(o,s,i);return n.putImageData(a,0,0),r}tintImageData(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,r=this._rasterizationCanvas,n=r.getContext("2d");t!==r&&(r.width=s,r.height=i,n.drawImage(t,0,0,s,i));const o=n.getImageData(0,0,s,i),a=new Uint8Array(o.data),l=new gi.Z(e),h=[l.r/255,l.g/255,l.b/255,l.a];for(let t=0;t<a.length;t+=4)a[t+0]*=h[0],a[t+1]*=h[1],a[t+2]*=h[2],a[t+3]*=h[3];const c=new ImageData(new Uint8ClampedArray(a.buffer),s,i);return n.putImageData(c,0,0),r}}function Si(t){const e=t.getFrame(0);if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)return e;const s=document.createElement("canvas");s.width=t.width,s.height=t.height;const i=s.getContext("2d");return e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0),s}class wi{constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}}class Pi{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(i,e),{decoration:n,weight:o}=e.font;this._lineThroughWidthOffset=n&&"line-through"===n?.1*this._lineHeight:0;const a=this._lineHeight*this._textLines.length;s.width=r+2*this._lineThroughWidthOffset,s.height=a,this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=e.halo.size*e.pixelRatio,this._renderedWidth=r*e.pixelRatio,this._renderedHeight=a*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const l=e.color??[0,0,0,0],h=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=function(t){return`rgba(${t.slice(0,3).toString()},${t[3]})`}(l),this._haloStyle=function(t){return`rgb(${t.slice(0,3).toString()})`}(h);const c=this._renderedLineHeight,u=this._renderedHaloSize;i.save(),i.clearRect(0,0,s.width,s.height),this._setFontProperties(i,e);const f=function(t,e){return"center"===t?.5*e:"right"===t?e:0}(i.textAlign,this._renderedWidth)+u,m=u,_=u>0;let p=this._lineThroughWidthOffset,d=0;_&&this._renderHalo(i,f,m,p,d,e),d+=m,p+=f;for(const t of this._textLines)_?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(t,p,d),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(t,p,d)):(i.fillStyle=this._fillStyle,i.fillText(t,p,d)),n&&"none"!==n&&this._renderDecoration(i,p,d,n,o),d+=c;i.restore();const g=this._renderedWidth+2*this._lineThroughWidthOffset,y=this._renderedHeight,x=i.getImageData(0,0,g,y),M=new Uint8Array(x.data);if(e.premultiplyColors){let t;for(let e=0;e<M.length;e+=4)t=M[e+3]/255,M[e]=M[e]*t,M[e+1]=M[e+1]*t,M[e+2]=M[e+2]*t}let b,v;switch(e.horizontalAlignment){case"left":b=-.5;break;case"right":b=.5;break;default:b=0}switch(e.verticalAlignment){case"bottom":v=-.5;break;case"top":v=.5;break;default:v=0}return{size:[g,y],image:new Uint32Array(M.buffer),sdf:!1,simplePattern:!1,anchorX:b,anchorY:v,canvas:s}}_renderHalo(t,e,s,i,r,n){const o=this._renderedWidth,a=this._renderedHeight;this._haloRasterizationCanvas||(this._haloRasterizationCanvas=document.createElement("canvas")),this._haloRasterizationCanvas.width=o,this._haloRasterizationCanvas.height=a;const l=this._haloRasterizationCanvas,h=l.getContext("2d");h.clearRect(0,0,o,a),this._setFontProperties(h,n);const{decoration:c,weight:u}=n.font;h.fillStyle=this._haloStyle,h.strokeStyle=this._haloStyle,h.lineJoin="round",this._renderHaloNative(h,e,s,c,u),t.globalAlpha=this._parameters.halo.color[3],t.drawImage(l,0,0,o,a,i,r,o,a),t.globalAlpha=1}_renderHaloNative(t,e,s,i,r){const n=this._renderedLineHeight,o=this._renderedHaloSize;for(const a of this._textLines){const l=2*o,h=5,c=.1;for(let n=0;n<h;n++){const o=(1-(h-1)*c+n*c)*l;t.lineWidth=o,t.strokeText(a,e,s),i&&"none"!==i&&this._renderDecoration(t,e,s,i,r,o)}s+=n}}_setFontProperties(t,e){const s=Math.max(e.size,.5),i=e.font,r=`${i.style} ${i.weight} ${(0,B.F2)(s*e.pixelRatio).toFixed(1)}px ${i.family}, sans-serif`;let n;switch(t.font=r,t.textBaseline="top",e.horizontalAlignment){case"left":default:n="left";break;case"right":n="right";break;case"center":n="center"}t.textAlign=n}computeTextSize(t,e){this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const r=this._computeTextWidth(i,e),n=this._lineHeight*this._textLines.length;return s.width=r,s.height=n,[r*e.pixelRatio,n*e.pixelRatio]}_computeTextWidth(t,e){let s=0;for(const e of this._textLines)s=Math.max(s,t.measureText(e).width);const i=e.font;return("italic"===i.style||"oblique"===i.style||"string"==typeof i.weight&&("bold"===i.weight||"bolder"===i.weight)||"number"==typeof i.weight&&i.weight>600)&&(s+=.3*t.measureText("w").width),s+=2*this._parameters.halo.size,Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&"underline"===e&&(t*=1.3),Math.round(t+2*this._parameters.halo.size)}_renderDecoration(t,e,s,i,r,n){const o=.9*this._lineHeight,a="bold"===r?.06:"bolder"===r?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if("underline"===i)switch(l){case"top":s+=o;break;case"middle":s+=o/2}else if("line-through"===i)switch(l){case"top":s+=o/1.5;break;case"middle":s+=o/3}const h=n?1.5*n:Math.ceil(o*a);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=h,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}}function Ci(t,e,s,i){return"function"==typeof t?t(e,s,i):t}function Li(t){let e=t.length;for(;e--;)if(!" /-,\n".includes(t.charAt(e)))return!1;return!0}function Ii(t,e){const s=[];let i=0,r=-1;do{if(r=t.indexOf("[",i),r>=i){if(r>i){const e=t.substr(i,r-i);s.push([e,null,Li(e)])}if(i=r+1,r=t.indexOf("]",i),r>=i){if(r>i){const n=e[t.substr(i,r-i)];n&&s.push([null,n,!1])}i=r+1}}}while(-1!==r);if(i<t.length-1){const e=t.substr(i);s.push([e,null,Li(e)])}return s}function ki(t,e,s){let i="",r=null;for(const s of e){const[e,n,o]=s;if(e)o?r=e:(r&&(i+=r,r=null),i+=e);else{const e=t.attributes[n];e&&(r&&(i+=r,r=null),i+=e)}}return Ti(i,s)}function Ti(t,e){switch("string"!=typeof t&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function zi(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function Ai(t){return"CIMMarkerPlacementAlongLineRandomSize"===t.type||"CIMMarkerPlacementAlongLineSameSize"===t.type||"CIMMarkerPlacementAlongLineVariableSize"===t.type||"CIMMarkerPlacementAtExtremities"===t.type||"CIMMarkerPlacementAtMeasuredUnits"===t.type||"CIMMarkerPlacementAtRatioPositions"===t.type||"CIMMarkerPlacementOnLine"===t.type||"CIMMarkerPlacementOnVertices"===t.type}const Ei=(t,e=0)=>isNaN(t)||null==t?e:t;function Fi(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function Ri(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function Ni(t){let e="",s="";if(t){const i=t.toLowerCase();i.includes("italic")?e="italic":i.includes("oblique")&&(e="oblique"),i.includes("bold")?s="bold":i.includes("light")&&(s="lighter")}return{style:e,weight:s}}function Oi(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function Wi(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Wi(e);if(null!=t)return t}break;case"CIMTextSymbol":return Wi(t.symbol);case"CIMSolidFill":return t.color}}function Vi(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Vi(e);if(void 0!==t)return t}break;case"CIMTextSymbol":return Vi(t.symbol);case"CIMSolidStroke":case"CIMSolidFill":return t.color}}function Di(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const t=Di(e);if(void 0!==t)return t}break;case"CIMTextSymbol":return Di(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function Gi(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function Ui(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}const Bi=t=>t.includes("data:image/svg+xml"),Xi=Math.PI/180,Hi=l.Z.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");class Yi{constructor(t){this._t=t}static createIdentity(){return new Yi([1,0,0,0,1,0])}clone(){const t=this._t;return new Yi(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 Yi([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[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 Yi([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new Yi([e,-s,0,s,e,0])}rotate(t){return Yi.multiply(this,Yi.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const i=t._t,r=e._t,n=i[0]*r[0]+i[3]*r[1],o=i[1]*r[0]+i[4]*r[1],a=i[2]*r[0]+i[5]*r[1]+r[2],l=i[0]*r[3]+i[3]*r[4],h=i[1]*r[3]+i[4]*r[4],c=i[2]*r[3]+i[5]*r[4]+r[5],u=s._t;return u[0]=n,u[1]=o,u[2]=a,u[3]=l,u[4]=h,u[5]=c,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(0===e)return new Yi([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,i=(t[2]*t[3]-t[0]*t[5])*e,r=t[4]*e,n=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new Yi([r,n,s,o,a,i])}}class Ji{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new bi.Z(ut,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||Yi.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||Yi.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]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;Yi.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t)return;const s=t.symbolLayers;if(!s)return;const i=t.effects;if(i&&i.length>0){const t=this.executeEffects(i,e);if(t){let e=t.next();for(;e;)this.drawSymbolLayers(s,e),e=t.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let i=new ds(e);for(const e of t){const t=Xe(e);t&&(i=t.execute(i,e,this.geomUnitsPerPoint(),s))}return i}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const i=t[s];if(!i||!1===i.enable)continue;const r=i.effects;if(r&&r.length>0){const t=this.executeEffects(r,e);if(t){let e=null;for(;(e=t.next())&&(this.drawSymbolLayer(i,e),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);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);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 s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const i=He(s);if(i){const r="CIMMarkerPlacementInsidePolygon"===s.type||"CIMMarkerPlacementPolygonCenter"===s.type&&s.clipAtBoundary;r&&this.pushClipPath(e);const n=i.execute(e,s,this.geomUnitsPerPoint(),this._resourceManager.geometryEngine);if(n){let e=null;for(;(e=n.next())&&(this.drawMarker(t,e),!this._earlyReturn););}r&&this.popClipPath()}}else{const s=this._placementPool.acquire();if((0,ct.wp)(e))s.tx=e.x,s.ty=e.y,this.drawMarker(t,s);else if((0,ct.oU)(e))[s.tx,s.ty]=(0,Le.tO)(e),this.drawMarker(t,s);else for(const i of e.points)if(s.tx=i[0],s.ty=i[1],this.drawMarker(t,s),this._earlyReturn)break;this._placementPool.release(s)}}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 s=this._resourceManager.getResource(t.url),i=t.size??10;if((0,h.Wi)(s)||i<=0)return;const r=s.width,n=s.height;if(!r||!n)return;const o=r/n,a=t.scaleX??1,l=Yi.createIdentity(),c=t.anchorPoint;if(c){let e=c.x,s=c.y;"Absolute"!==t.anchorPointUnits&&(e*=i*o*a,s*=i),l.translate(-e,-s)}let u=t.rotation??0;t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Xi);let f=t.offsetX??0,m=t.offsetY??0;if(f||m){if(this._mapRotation){const t=Xi*this._mapRotation,e=Math.cos(t),s=Math.sin(t),i=f*s+m*e;f=f*e-m*s,m=i}l.translate(f,m)}const _=this.geomUnitsPerPoint();1!==_&&l.scale(_,_);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){if(!t)return;const s=t.markerGraphics;if(!s)return;const i=t.size??10,r=t.frame,n=r?r.ymax-r.ymin:0,o=i&&n?i/n:1,a=Yi.createIdentity();r&&a.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let e=l.x,s=l.y;"Absolute"!==t.anchorPointUnits?r&&(e*=r.xmax-r.xmin,s*=r.ymax-r.ymin):(e/=o,s/=o),a.translate(-e,-s)}1!==o&&a.scale(o,o);let h=t.rotation??0;t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*Xi);let c=t.offsetX??0,u=t.offsetY??0;if(c||u){if(this._mapRotation){const t=Xi*this._mapRotation,e=Math.cos(t),s=Math.sin(t),i=c*s+u*e;c=c*e-u*s,u=i}a.translate(c,u)}const f=this.geomUnitsPerPoint();1!==f&&a.scale(f,f);const m=e.getAngle();m&&a.rotate(m),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const t of s)if(t&&t.symbol&&t.geometry||Hi.error("Invalid marker graphic",t),this.drawSymbol(t.symbol,t.geometry,t.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,s){if(!t)return;if(!(0,ct.wp)(e))return;if((t.height??10)<=0)return;const i=Yi.createIdentity();let r=t.angle??0;r=-r,r&&i.rotate(r*Xi);const n=t.offsetX??0,o=t.offsetY??0;(n||o)&&i.translate(n,o);const a=this.geomUnitsPerPoint();1!==a&&i.scale(a,a),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let i=(void 0!==t.separation?t.separation:4)*s,r=void 0!==t.rotation?t.rotation:0;if(0===i)return null;i<0&&(i=-i);let n=0;const o=.5*i;for(;n>o;)n-=i;for(;n<-o;)n+=i;const a=(0,z.Ue)();(0,oe.$P)(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;r>180;)r-=180;for(;r<0;)r+=180;const h=Math.cos(r*Xi),c=Math.sin(r*Xi),u=-i*c,f=i*h;let m,_,p,d;n=(void 0!==t.offsetX?t.offsetX*s:0)*c-(void 0!==t.offsetY?t.offsetY*s:0)*h,m=p=Number.MAX_VALUE,_=d=-Number.MAX_VALUE;for(const t of l){const e=t[0],s=t[1],i=h*e+c*s,r=-c*e+h*s;m=Math.min(m,i),p=Math.min(p,r),_=Math.max(_,i),d=Math.max(d,r)}p=Math.floor(p/i)*i;let g=h*m-c*p-u*n/i,y=c*m+h*p-f*n/i,x=h*_-c*p-u*n/i,M=c*_+h*p-f*n/i;const b=1+Math.round((d-p)/i),v=[];for(let t=0;t<b;t++)g+=u,y+=f,x+=u,M+=f,v.push([[g,y],[x,M]]);return{paths:v}}}class qi extends Ji{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 wi(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return(0,z.al)(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(t){if(t&&!(this._clipCount>0))if((0,ct.oU)(t))this._processPath(t.rings,0);else if((0,ct.l9)(t))this._processPath(t.paths,0);else if((0,ct.YX)(t)){const e=ji(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0)return;const i=.5*this.transformSize(s);if((0,ct.oU)(t))this._processPath(t.rings,i);else if((0,ct.l9)(t))this._processPath(t.paths,i);else if((0,ct.YX)(t)){const e=ji(t);e&&this._processPath(e.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){(0,ct.oU)(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:s}=t,i=t.scaleX??1;let r=i*e,n=e;const o=this._resourceManager.getResource(s);!e&&(0,h.pC)(o)&&(r=i*o.width,n=o.height),this._merge(this.transformPt([-r/2,-n/2]),0),this._merge(this.transformPt([-r/2,n/2]),0),this._merge(this.transformPt([r/2,-n/2]),0),this._merge(this.transformPt([r/2,n/2]),0)}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new Pi);const s=$i(t),[i,r]=this._textRasterizer.computeTextSize(e,s);let n=0;switch(t.horizontalAlignment){case"Left":n=i/2;break;case"Right":n=-i/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=r/2;break;case"Top":o=-r/2;break;case"Baseline":o=r/6}this._merge(this.transformPt([-i/2+n,-r/2+o]),0),this._merge(this.transformPt([-i/2+n,r/2+o]),0),this._merge(this.transformPt([i/2+n,-r/2+o]),0),this._merge(this.transformPt([i/2+n,r/2+o]),0)}_processPath(t,e){if(t)for(const s of t){const t=s?s.length:0;if(t>1){this._merge(this.transformPt(s[0]),e);for(let i=1;i<t;i++)this._merge(this.transformPt(s[i]),e)}}}_merge(t,e){t[0]-e<this._xmin&&(this._xmin=t[0]-e),t[0]+e>this._xmax&&(this._xmax=t[0]+e),t[1]-e<this._ymin&&(this._ymin=t[1]-e),t[1]+e>this._ymax&&(this._ymax=t[1]+e)}}class Zi extends Ji{constructor(t,e,s,i){super(e,s),this._applyAdditionalRenderProps=i,this._colorSubstitutionHelper=new vi,this._ctx=t}drawSolidFill(t,e){if(!t)return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else if((0,ct.YX)(t))this._buildPath(ji(t).rings,!0);else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const s=this._ctx;s.fillStyle="string"==typeof e?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+e[3]/255+")",s.fill("evenodd")}drawSolidStroke(t,e,s,i,r,n){if(!t||!e||0===s)return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!1);else{if(!(0,ct.YX)(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(ji(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+")",o.lineWidth=Math.max(this.transformSize(s),.5),this._setCapStyle(i),this._setJoinStyle(r),o.miterLimit=n,o.stroke()}pushClipPath(t){if(this._ctx.save(),(0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else{if(!(0,ct.YX)(t))return;this._buildPath(ji(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:s,url:i,tintColor:r}=t,n=t.scaleX??1,o=this._resourceManager.getResource(i);if((0,h.Wi)(o))return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const c=Bi(i)||"src"in o&&Bi(o.src);let u="getFrame"in o?Si(o):o;s&&(u=this._colorSubstitutionHelper.applyColorSubstituition(u,s)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const f=this.transformPt([0,0]),[m,_]=this.getTransformAngle(),p=this.transformSize(1),d=this._ctx;d.save(),d.setTransform({m11:n*p*m,m12:n*p*_,m21:-p*_,m22:p*m,m41:f[0],m42:f[1]}),d.drawImage(u,-a/2,-l/2,a,l),d.restore()}drawText(t,e){if(!e||0===e.length)return;this._textRasterizer||(this._textRasterizer=new Pi);const s=$i(t);s.size*=this.transformSize((0,B.Wz)(1));const i=this._textRasterizer.rasterizeText(e,s);if(!i)return;const{size:r,anchorX:n,anchorY:o,canvas:a}=i,l=r[0]*(n+.5),h=r[1]*(o-.5),c=this._ctx,u=this.transformPt([0,0]),[f,m]=this.getTransformAngle();c.save(),c.setTransform({m11:1*f,m12:1*m,m21:-1*m,m22:1*f,m41:u[0]-1*l,m42:u[1]+1*h}),c.drawImage(a,0,0),c.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:s,height:i,offsetX:r,offsetY:n,rotation:o,scaleX:a,tintColor:l,url:c}=e;const u=this._resourceManager.getResource(c);if((0,h.Wi)(u))return;if((0,ct.oU)(t))this._buildPath(t.rings,!0);else if((0,ct.l9)(t))this._buildPath(t.paths,!0);else if((0,ct.YX)(t))this._buildPath(ji(t).rings,!0);else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const f=this._ctx,m=Bi(c)||"src"in u&&Bi(u.src);let _,p="getFrame"in u?Si(u):u;if(s&&(p=this._colorSubstitutionHelper.applyColorSubstituition(p,s)),this._applyAdditionalRenderProps){m||l&&(p=this._colorSubstitutionHelper.tintImageData(p,l)),_=f.createPattern(p,"repeat");const t=this.transformSize(1);o||(o=0),r?r*=t:r=0,n?n*=t:n=0,i&&(i*=t);const e=i?i/u.height:1,s=a&&i?a*i/u.width:1;if(0!==o||1!==e||1!==s||0!==r||0!==n){const t=new DOMMatrix;t.rotateSelf(0,0,-o).translateSelf(r,n).scaleSelf(s,e,1),_.setTransform(t)}}else _=f.createPattern(p,"repeat");f.save(),f.fillStyle=_,f.fill("evenodd"),f.restore()}drawPictureStroke(t,e){if(!t)return;let{colorSubstitutions:s,capStyle:i,joinStyle:r,miterLimit:n,tintColor:o,url:a,width:l}=e;const c=this._resourceManager.getResource(a);if((0,h.Wi)(c))return;let u;if((0,ct.oU)(t))u=t.rings;else if((0,ct.l9)(t))u=t.paths;else if((0,ct.YX)(t))u=ji(t).rings;else{if(!(0,ct.aW)(t))return;console.log("CanvasDrawHelper.drawPictureStroke - No implementation!")}l||(l=c.width);const f=Bi(a)||"src"in c&&Bi(c.src);let m="getFrame"in c?Si(c):c;s&&(m=this._colorSubstitutionHelper.applyColorSubstituition(m,s)),this._applyAdditionalRenderProps&&(f||o&&(m=this._colorSubstitutionHelper.tintImageData(m,o)));const _=Math.max(this.transformSize((0,B.F2)(l)),.5),p=_/m.width,d=this._ctx,g=d.createPattern(m,"repeat-y");let y,x;d.save(),this._setCapStyle(i),this._setJoinStyle(r),d.miterLimit=n,d.lineWidth=_;for(let t of u)if(t=(0,ht.d9)(t),Qi(t),t&&!(t.length<=1)){y=this.transformPt(t[0]);for(let e=1;e<t.length;e++){x=this.transformPt(t[e]);const s=Ki(y,x),i=new DOMMatrix;i.translateSelf(0,y[1]-_/2).scaleSelf(p,p,1).rotateSelf(0,0,90-s),g.setTransform(i),d.strokeStyle=g,d.beginPath(),d.moveTo(y[0],y[1]),d.lineTo(x[0],x[1]),d.stroke(),y=x}}d.restore()}_buildPath(t,e){const s=this._ctx;if(s.beginPath(),t)for(const i of t){const t=i?i.length:0;if(t>1){let r=this.transformPt(i[0]);s.moveTo(r[0],r[1]);for(let e=1;e<t;e++)r=this.transformPt(i[e]),s.lineTo(r[0],r[1]);e&&s.closePath()}}}_setCapStyle(t){switch(t){case X.kP.Butt:this._ctx.lineCap="butt";break;case X.kP.Round:this._ctx.lineCap="round";break;case X.kP.Square:this._ctx.lineCap="square"}}_setJoinStyle(t){switch(t){case X.r4.Bevel:this._ctx.lineJoin="bevel";break;case X.r4.Round:this._ctx.lineJoin="round";break;case X.r4.Miter:this._ctx.lineJoin="miter"}}}function Ki(t,e){const s=e[0]-t[0],i=e[1]-t[1];return 180/Math.PI*Math.atan2(i,s)}const ji=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;function $i(t,e=1){const s=Oi(t),i=Ni(t.fontStyleName),r=yi(t.fontFamilyName),{weight:n,style:o}=i,a=e*(t.height||5),l=Gi(t.horizontalAlignment),h=Ui(t.verticalAlignment),c=Wi(t),u=Vi(t.haloSymbol),f=u?e*(0|t.haloSize):0;return{color:c,size:a,horizontalAlignment:l,verticalAlignment:h,font:{family:r,style:Fi(o),weight:Ri(n),decoration:s},halo:{size:f||0,color:u,style:o},pixelRatio:1,premultiplyColors:!0}}function Qi(t){let e,s,i,r,n,o=t[0],a=1;for(;a<t.length;)e=t[a][0]-o[0],s=t[a][1]-o[1],r=0!==e?s/e:Math.PI/2,void 0!==i&&r-i<=1e-4?(t.splice(a-1,1),o=n):(n=o,o=t[a],a++),i=r}var tr=s(82397);function er(t,e,s,i,r){if((0,h.Wi)(t))return null;const n=t.referencesGeometry()&&r?function(t,e,s){const{transform:i,hasZ:r,hasM:n}=s;sr.has(e)||sr.set(e,function(t){const e={};switch(t){case"esriGeometryPoint":return(t,s,i,r)=>(0,tr.U1)(s,e,t,i,r);case"esriGeometryPolygon":return(t,s,i,r)=>(0,tr.Ie)(s,e,t,i,r);case"esriGeometryPolyline":return(t,s,i,r)=>(0,tr.G6)(s,e,t,i,r);case"esriGeometryMultipoint":return(t,s,i,r)=>(0,tr.J9)(s,e,t,i,r);default:return l.Z.getLogger("esri.views.2d.support.arcadeOnDemand").error(new o.Z("mapview-arcade",`Unable to handle geometryType: ${t}`)),t=>t}}(e));const a=sr.get(e)(t.geometry,i,r,n);return{...t,geometry:a}}(e,i,r):e,a=t.repurposeFeature(n);try{return t.evaluate({...s,$feature:a})}catch(t){return l.Z.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",t),null}}const sr=new Map;s(31363);const ir=Math.PI,rr=ir/2,nr=96/72,or=(Math.PI,l.Z.getLogger("esri.symbols.cim.CIMSymbolHelper"));function ar(t,e,s){switch(e.type){case"CIMSymbolReference":return ar(t,e.symbol,s);case"CIMPointSymbol":null==s&&(s={x:0,y:0}),t.drawSymbol(e,s);break;case"CIMLineSymbol":null==s&&(s={paths:[[[0,0],[10,0]]]}),t.drawSymbol(e,s);break;case"CIMPolygonSymbol":null==s&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),t.drawSymbol(e,s);break;case"CIMTextSymbol":{const s={x:0,y:0};t.drawSymbol(e,s);break}case"CIMVectorMarker":{const s=new ut;t.drawMarker(e,s);break}}return t.envelope()}class lr{static getEnvelope(t,e,s){const i=new qi(s);if(Array.isArray(t)){let s;for(const r of t)s?s.union(ar(i,r,e)):s=ar(i,r,e);return s}return ar(i,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const i=(s.x+.5*s.width)*nr,r=(s.y+.5*s.height)*nr,n=s.width*nr+2,o=s.height*nr+2;return[-i/n,-r/o,o]}static rasterize(t,e,s,i,r=!0){const n=s||this.getEnvelope(e,null,i);if(!n)return[null,0,0,0,0];const o=(n.x+.5*n.width)*nr,a=(n.y+.5*n.height)*nr;t.width=n.width*nr,t.height=n.height*nr,s||(t.width+=2,t.height+=2);const l=t.getContext("2d"),h=Yi.createScale(nr,-nr);h.translate(.5*t.width-o,.5*t.height+a);const c=new Zi(l,i,h);switch(e.type){case"CIMPointSymbol":{const t={type:"point",x:0,y:0};c.drawSymbol(e,t);break}case"CIMVectorMarker":{const t=new ut;c.drawMarker(e,t);break}}const u=l.getImageData(0,0,t.width,t.height),f=new Uint8Array(u.data);if(r){let t;for(let e=0;e<f.length;e+=4)t=f[e+3]/255,f[e]=f[e]*t,f[e+1]=f[e+1]*t,f[e+2]=f[e+2]*t}return[f,t.width,t.height,-o/t.width,-a/t.height]}static fromTextSymbol(t){const{angle:e,color:s,font:i,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:l,text:h,verticalAlignment:c,xoffset:u,yoffset:f}=t;let m,_,p,d,g;i&&(m=i.family,_=i.style,p=i.weight,d=i.size,g=i.decoration);let y=!1;return h&&(y=n(h)[1]),{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:{type:"CIMTextSymbol",angle:e,blockProgression:X.zV.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:X.eZ.Normal,fontEncoding:X.DD.Unicode,fontFamilyName:m||"Arial",fontStyleName:pr(_,p),fontType:X.Ky.Unspecified,haloSize:o,height:d,hinting:X.Dd.Default,horizontalAlignment:fr(a??"center"),kerning:l,letterWidth:100,ligatures:!0,lineGapType:"Multiple",offsetX:Ei(u),offsetY:Ei(f),strikethrough:"line-through"===g,underline:"underline"===g,symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_r(s)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:_r(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:y?X.UX.RTL:X.UX.LTR,verticalAlignment:mr(c??"baseline"),verticalGlyphOrientation:X.RS.Right,wordSpacing:100,billboardMode3D:X.UR.FaceNearPlane},textString:h}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:e,outline:s,width:i,xoffset:r,xscale:n,yoffset:o,yscale:a}=t,l=[],h={type:"CIMPolygonSymbol",symbolLayers:l};if(s){const{cap:t,join:e,miterLimit:i,width:r}=s;l.push({type:"CIMSolidStroke",color:_r(s.color),capStyle:cr(t),joinStyle:ur(e),miterLimit:i,width:r})}let c=t.url;"esriPFS"===t.type&&t.imageData&&(c=t.imageData);const u="angle"in t?t.angle:0,f=i*(n||1),m=e*(a||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:X.Qb.Picture,tintColor:null,url:c,height:m,width:f,offsetX:Ei(r),offsetY:Ei(o),rotation:Ei(-u),colorSubstitutions:null}),h}static fromSimpleFillSymbol(t){const{color:e,style:s,outline:i}=t,r=[],n={type:"CIMPolygonSymbol",symbolLayers:r};let o=null;if(i){const{cap:t,join:e,style:s}=i;"solid"!==s&&"none"!==s&&"esriSLSSolid"!==s&&"esriSLSNull"!==s&&(o=[{type:"CIMGeometricEffectDashes",dashTemplate:yr(s,t),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),r.push({type:"CIMSolidStroke",color:_r(i.color),capStyle:cr(t),joinStyle:ur(e),miterLimit:i.miterLimit,width:i.width,effects:o})}if(s&&"solid"!==s&&"none"!==s&&"esriSFSSolid"!==s&&"esriSFSNull"!==s){const t={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:_r(e),capStyle:X.kP.Butt,joinStyle:X.r4.Miter,width:.75}]};let i=0;const n=(0,B.Wz)(Mr(s)?8:10);switch(s){case"vertical":case"esriSFSVertical":i=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":i=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":i=45;break;case"cross":case"esriSFSCross":i=0}r.push({type:"CIMHatchFill",lineSymbol:t,offsetX:0,offsetY:0,rotation:i,separation:n}),"cross"===s||"esriSFSCross"===s?r.push({type:"CIMHatchFill",lineSymbol:(0,ht.d9)(t),offsetX:0,offsetY:0,rotation:90,separation:n}):"diagonal-cross"!==s&&"esriSFSDiagonalCross"!==s||r.push({type:"CIMHatchFill",lineSymbol:(0,ht.d9)(t),offsetX:0,offsetY:0,rotation:45,separation:n})}else!s||"solid"!==s&&"esriSFSSolid"!==s||r.push({type:"CIMSolidFill",enable:!0,color:_r(e)});return n}static fromSimpleLineSymbol(t){const{cap:e,color:s,join:i,marker:r,miterLimit:n,style:o,width:a}=t;let l=null;"solid"!==o&&"none"!==o&&"esriSLSSolid"!==o&&"esriSLSNull"!==o&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:yr(o,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const h=[];if(r){let t;switch(r.placement){case"begin-end":t=X.Tx.Both;break;case"begin":t=X.Tx.JustBegin;break;case"end":t=X.Tx.JustEnd;break;default:t=X.Tx.None}const e=lr.fromSimpleMarker(r,a,s).symbolLayers[0];e.markerPlacement={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:t,offsetAlongLine:0},h.push(e)}return"none"!==o&&"esriSLSNull"!==o&&h.push({type:"CIMSolidStroke",color:_r(s),capStyle:cr(e),joinStyle:ur(i),miterLimit:n,width:a,effects:l}),{type:"CIMLineSymbol",symbolLayers:h}}static fromPictureMarker(t){const{angle:e,height:s,width:i,xoffset:r,yoffset:n}=t;let o=t.url;return"esriPMS"===t.type&&t.imageData&&(o=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:X.Qb.Picture,tintColor:null,url:o,size:s,width:i,offsetX:Ei(r),offsetY:Ei(n),rotation:Ei(-e)}]}}static fromSimpleMarker(t,e,s){const{style:i}=t,r=t.color??s;if("path"===i){const e=[];if("outline"in t&&t.outline){const s=t.outline;e.push({type:"CIMSolidStroke",enable:!0,width:(0,B.F2)(Math.round((0,B.Wz)(s.width))),color:_r(s.color)})}e.push({type:"CIMSolidFill",enable:!0,color:_r(r),path:t.path});const[s,i]=xr("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Ei(-t.angle),size:Ei(t.size||6),offsetX:Ei(t.xoffset),offsetY:Ei(t.yoffset),frame:s,markerGraphics:[{type:"CIMMarkerGraphic",geometry:i,symbol:{type:"CIMPolygonSymbol",symbolLayers:e}}]}]}}const[n,o]=xr(i);let a;if(o&&n){const s=[];if("outline"in t&&t.outline){const e=t.outline;s.push({type:"CIMSolidStroke",enable:!0,width:e.width>.667?(0,B.F2)(Math.round((0,B.Wz)(e.width))):e.width,color:_r(e.color)})}else!e||"line-marker"!==t.type||"cross"!==t.style&&"x"!==t.style||s.push({type:"CIMSolidStroke",enable:!0,width:e,color:_r(r)});s.push({type:"CIMSolidFill",enable:!0,color:_r(r)});const i={type:"CIMPolygonSymbol",symbolLayers:s};a={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:Ei(-t.angle),size:Ei(t.size||6*e),offsetX:Ei(t.xoffset),offsetY:Ei(t.yoffset),frame:n,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:i}]}]}}return a}static fromCIMHatchFill(t,e){const s=e*(t.separation??4),i=s/2,r=(0,ht.d9)(t.lineSymbol);let n=this._getLineSymbolPeriod(r)||4;for(;n<4;)n*=2;const o=n/2,a={xmin:-o,xmax:o,ymin:-i,ymax:i},l=r.symbolLayers.find((t=>"CIMSolidStroke"===t.type));return l&&(l.width*=e),{type:"CIMVectorMarker",frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-o,0],[o,0]]]},symbol:r}],size:s}}static fetchResources(t,e,s){if(t&&e)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const i=t.symbolLayers;if(!i)return;for(const t of i)switch(Sr(t,e,s),t.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in t&&t.url&&s.push(e.fetchResource(t.url,null));break;case"CIMVectorMarker":{const i=t.markerGraphics;if(!i)continue;for(const t of i)if(t){const i=t.symbol;i&&lr.fetchResources(i,e,s)}}}}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers)for(const e of t.symbolLayers)if(e){const t=this._getEffectsRepeat(e.effects);if(t)return t;switch(e.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=this._getPlacementRepeat(e.markerPlacement);if(t)return t}}}}return 0}static _getEffectsRepeat(t){if(t)for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const t=e.dashTemplate;if(t&&t.length){let e=0;for(const s of t)e+=s;return 1&t.length&&(e*=2),e}break}case"CIMGeometricEffectWave":return e.period;default:or.error(`unsupported geometric effect type ${e.type}`)}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let t=0;for(const s of e)t+=s;return 1&e.length&&(t*=2),t}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,s={type:t.type,...t};s.markerPlacement=null,s.anchorPoint=null;const i=Math.abs(e.stepX),r=Math.abs(e.stepY),n=(e.randomness??100)/100;let o,a,l,h;if("Random"===e.gridType){const t=(0,B.Wz)(A.C1),s=Math.max(Math.floor(t/i),1),c=Math.max(Math.floor(t/r),1);o=s*i/2,a=c*r/2,l=2*a;const u=new xe.Z(e.seed),f=n*i/1.5,m=n*r/1.5;h=[];for(let t=0;t<s;t++)for(let e=0;e<c;e++){const s=t*i-o+f*(.5-u.getFloat()),n=e*r-a+m*(.5-u.getFloat());h.push({x:s,y:n}),0===t&&h.push({x:s+2*o,y:n}),0===e&&h.push({x:s,y:n+2*a})}}else!0===e.shiftOddRows?(o=i/2,a=r,l=2*r,h=[{x:-o,y:0},{x:o,y:0},{x:0,y:a},{x:0,y:-a}]):(o=i/2,a=r/2,l=r,h=[{x:-i,y:0},{x:0,y:-r},{x:-i,y:-r},{x:0,y:0},{x:i,y:0},{x:0,y:r},{x:i,y:r},{x:-i,y:r},{x:i,y:-r}]);return{type:"CIMVectorMarker",frame:{xmin:-o,xmax:o,ymin:-a,ymax:a},markerGraphics:h.map((t=>({type:"CIMMarkerGraphic",geometry:t,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}}))),size:l}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers)for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const t=s.size;t>e&&(e=t);break}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers)for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const t=s.width;t>e&&(e=t);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(Ai(s.markerPlacement)){const t=s.size;t>e&&(e=t)}}return e}}}static getMarkerScaleRatio(t){if(t&&"CIMVectorMarker"===t.type&&!1!==t.scaleSymbolsProportionally&&t.frame){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class hr{static findApplicableOverrides(t,e,s){if(t&&e){if(t.primitiveName){let i=!1;for(const e of s)if(e.primitiveName===t.primitiveName){i=!0;break}if(!i)for(const i of e)i.primitiveName===t.primitiveName&&s.push(i)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const i of t.effects)hr.findApplicableOverrides(i,e,s);if(t.symbolLayers)for(const i of t.symbolLayers)hr.findApplicableOverrides(i,e,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects)for(const i of t.effects)hr.findApplicableOverrides(i,e,s);if(t.markerPlacement&&hr.findApplicableOverrides(t.markerPlacement,e,s),"CIMVectorMarker"===t.type){if(t.markerGraphics)for(const i of t.markerGraphics)hr.findApplicableOverrides(i,e,s),hr.findApplicableOverrides(i.symbol,e,s)}else"CIMCharacterMarker"===t.type?hr.findApplicableOverrides(t.symbol,e,s):"CIMHatchFill"===t.type?hr.findApplicableOverrides(t.lineSymbol,e,s):"CIMPictureMarker"===t.type&&hr.findApplicableOverrides(t.animatedSymbolProperties,e,s)}}}static findEffectOverrides(t,e,s){if(!e||!t)return;const i=t.length;for(let r=0;r<i;r++){const i=t[r]?.primitiveName;if(i){let t=!1;for(const e of s)if(e.primitiveName===i){t=!0;break}if(!t)for(const t of e)t.primitiveName===i&&s.push(t)}}}static async resolveSymbolOverrides(t,e,s,i,r,n,o){if(!t||!t.symbol)return null;let{symbol:a,primitiveOverrides:l}=t;const h=!!l;if(!h&&!i)return a;a=(0,ht.d9)(a);let c=!0;if(e||(e={attributes:{}},c=!1),h){if(c||(l=l.filter((t=>!t.valueExpressionInfo?.expression.includes("$feature")))),o||(l=l.filter((t=>!t.valueExpressionInfo?.expression.includes("$view")))),l.length>0){const t=function(t){return(t?Object.keys(t):[]).map((e=>({name:e,alias:e,type:"string"==typeof t[e]?"esriFieldTypeString":"esriFieldTypeDouble"})))}(e.attributes);await hr.evaluateOverrides(l,e,{spatialReference:s,fields:t,geometryType:r},n,o)}hr.applyOverrides(a,l)}return i&&hr.applyDictionaryTextOverrides(a,e,i),a}static async evaluateOverrides(t,e,s,i,r){if(!e)return;let n;for(const o of t){const t=o.valueExpressionInfo;if(t&&s){n||(n=[]),o.value=void 0;const a=(0,Mi.Yi)(t.expression,s.spatialReference,s.fields).then((t=>{o.value=er(t,e,{$view:r},s.geometryType,i)}));n.push(a)}}void 0!==n&&n.length>0&&await Promise.all(n)}static applyDictionaryTextOverrides(t,e,s,i="Normal"){if(t&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const r=t.symbolLayers;if(!r)return;for(const n of r)n&&"CIMVectorMarker"===n.type&&hr.applyDictionaryTextOverrides(n,e,s,"CIMTextSymbol"===t.type?t.textCase:i)}break;case"CIMVectorMarker":{const i=t.markerGraphics;if(!i)return;for(const t of i)t&&hr.applyDictionaryTextOverrides(t,e,s)}break;case"CIMMarkerGraphic":{const r=t.textString;if(r&&r.includes("[")){const n=Ii(r,s);t.textString=ki(e,n,i)}}}}static applyOverrides(t,e,s,i){if(t.primitiveName)for(const r of e)if(r.primitiveName===t.primitiveName){const e=br(r.propertyName);if(i&&i.push({cim:t,nocapPropertyName:e,value:t[e]}),r.expression&&(r.value=hr.toValue(r.propertyName,r.expression)),s){let e=!1;for(const i of s)i.primitiveName===t.primitiveName&&(e=!0);e||s.push(r)}(0,h.pC)(r.value)&&(t[e]=r.value)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const r of t.effects)hr.applyOverrides(r,e,s,i);if(t.symbolLayers)for(const r of t.symbolLayers)hr.applyOverrides(r,e,s,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const r of t.effects)hr.applyOverrides(r,e,s,i);if("CIMVectorMarker"===t.type&&t.markerGraphics)for(const r of t.markerGraphics)hr.applyOverrides(r,e,s,i),hr.applyOverrides(r.symbol,e,s,i)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const s of t)void 0!==s.value&&(e+=`${s.primitiveName}${s.propertyName}${JSON.stringify(s.value)}`);return e}static toValue(t,e){if("DashTemplate"===t)return e.split(" ").map((t=>Number(t)));if("Color"===t){const t=new gi.Z(e).toRgba();return t[3]*=255,t}return e}}const cr=t=>{if(!t)return X.kP.Butt;switch(t){case"butt":return X.kP.Butt;case"square":return X.kP.Square;case"round":return X.kP.Round}},ur=t=>{if(!t)return X.r4.Miter;switch(t){case"miter":return X.r4.Miter;case"round":return X.r4.Round;case"bevel":return X.r4.Bevel}},fr=t=>{if((0,h.Wi)(t))return"Center";switch(t){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},mr=t=>{if((0,h.Wi)(t))return"Center";switch(t){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},_r=t=>{if(!t)return[0,0,0,0];const{r:e,g:s,b:i,a:r}=t;return[e,s,i,255*r]},pr=(t,e)=>{const s=dr(e),i=gr(t);return s&&i?`${s}-${i}`:`${s}${i}`},dr=t=>{if(!t)return"";switch(t.toLowerCase()){case"bold":case"bolder":return"bold"}return""},gr=t=>{if(!t)return"";switch(t.toLowerCase()){case"italic":case"oblique":return"italic"}return""},yr=(t,e)=>{const s="butt"===e;switch(t){case"dash":case"esriSLSDash":return s?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return s?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return s?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return s?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return s?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return s?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return s?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return s?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return s?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return s?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return or.error("Unexpected: style does not require rasterization"),[0,0];default:return or.error(`Tried to rasterize SLS, but found an unexpected style: ${t}!`),[0,0]}},xr=t=>{const e=50;let s,i;const r=t;if("circle"===r||"esriSMSCircle"===r){const t=.25;let r=Math.acos(1-t/e),n=Math.ceil(ir/r/4);0===n&&(n=1),r=rr/n,n*=4;const o=[];o.push([e,0]);for(let t=1;t<n;t++)o.push([e*Math.cos(t*r),-e*Math.sin(t*r)]);o.push([e,0]),s={rings:[o]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("cross"===r||"esriSMSCross"===r){const t=0;s={rings:[[[t,e],[t,t],[e,t],[e,-t],[t,-t],[t,-e],[-t,-e],[-t,-t],[-e,-t],[-e,t],[-t,t],[-t,e],[t,e]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("diamond"===r||"esriSMSDiamond"===r)s={rings:[[[-e,0],[0,e],[e,0],[0,-e],[-e,0]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e};else if("square"===r||"esriSMSSquare"===r)s={rings:[[[-e,-e],[-e,e],[e,e],[e,-e],[-e,-e]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e};else if("x"===r||"esriSMSX"===r){const t=0;s={rings:[[[0,t],[e-t,e],[e,e-t],[t,0],[e,t-e],[e-t,-e],[0,-t],[t-e,-e],[-e,t-e],[-t,0],[-e,e-t],[t-e,e],[0,t]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e}}else if("triangle"===r||"esriSMSTriangle"===r){const t=57.735026918962575,e=-t,r=2/3*100,n=r-100;s={rings:[[[e,n],[0,r],[t,n],[e,n]]]},i={xmin:e,ymin:n,xmax:t,ymax:r}}else"arrow"===r&&(s={rings:[[[-50,50],[50,0],[-50,-50],[-33,-20],[-33,20],[-50,50]]]},i={xmin:-e,ymin:-e,xmax:e,ymax:e});return[i,s]},Mr=t=>"vertical"===t||"horizontal"===t||"cross"===t||"esriSFSCross"===t||"esriSFSVertical"===t||"esriSFSHorizontal"===t,br=t=>t?t.charAt(0).toLowerCase()+t.substr(1):t;let vr;function Sr(t,e,i){t.effects&&!(0,h.pC)(e.geometryEngine)&&(vr?i.push(vr):(t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":return!0}return!1})(t.effects)&&(vr=Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)),i.push(vr),vr.then((t=>e.geometryEngine=t))))}const wr=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function Pr(t,e){return wr.has(e)?(s=t,.05*Math.max(Math.round(s/.05),1)):t;var s}const Cr=[1/256,1/65536,1/16777216,1/4294967296];function Lr(t){let e=1/0,s=-1/0,i=1/0,r=-1/0;for(const n of t)for(const t of n)t[0]<e&&(e=t[0]),t[0]>s&&(s=t[0]),t[1]<i&&(i=t[1]),t[1]>r&&(r=t[1]);return[e,i,s,r]}function Ir(t){return t?t.rings?Lr(t.rings):t.paths?Lr(t.paths):(0,ct.YX)(t)?[t.xmin,t.ymin,t.xmax,t.ymax]:null:null}function kr(t,e,s,i,r){const[n,o,a,l]=t;if(a<n||l<o)return[0,0,0];const h=a-n,c=l-o,u=Math.floor(31.5),f=(128-2*(u+1))/Math.max(h,c),m=Math.round(h*f)+2*u,_=Math.round(c*f)+2*u;let p=1;e&&(p=_/f/(e.ymax-e.ymin));let d=0,g=0,y=1;i&&(r?e&&s&&e.ymax-e.ymin>0&&(y=(e.xmax-e.xmin)/(e.ymax-e.ymin),d=i.x/(s*y),g=i.y/s):(d=i.x,g=i.y)),d=.5*(e.xmax+e.xmin)+d*(e.xmax-e.xmin),g=.5*(e.ymax+e.ymin)+g*(e.ymax-e.ymin),d-=n,g-=o,d*=f,g*=f,d+=u,g+=u;let x=d/m-.5,M=g/_-.5;return r&&(x*=s*y,M*=s),[p,x,M]}!function(t,e=0){let s=0;for(let i=0;i<4;i++)s+=t[e+i]*Cr[i]}(new Uint8ClampedArray([255,255,255,255]));const Tr=53290320,zr=10,Ar=l.Z.getLogger("esri.symbols.cim.cimAnalyzer");function Er(t){switch(t){case"Butt":return X.RL.BUTT;case"Square":return X.RL.SQUARE;default:return X.RL.ROUND}}function Fr(t){switch(t){case"Bevel":return X.AH.BEVEL;case"Miter":return X.AH.MITER;default:return X.AH.ROUND}}function Rr(t,e,s,i){let r;t[e]?r=t[e]:(r={},t[e]=r),r[s]=i}function Nr(t){const e=t.markerPlacement;return e&&e.angleToLine?X.v2.MAP:X.v2.SCREEN}function Or(t,e,s,i,r,n){const o=t.primitiveName,a=zi(t.color),[l,h]=rn(i,o,e,null,null),c=(0,xi.hP)(JSON.stringify(t)+h).toString();n.push({type:"fill",templateHash:c,materialHash:l?()=>c:c,cim:t,materialOverrides:null,colorLocked:t.colorLocked,color:$r(o,s,"Color",r,a,jr),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}function Wr(t,e,s,i,r,n,o){const a=t.primitiveName,l=t.tintColor?zi(t.tintColor):{r:255,g:255,b:255,a:1},[c,u]=rn(i,a,e,null,null),f=(0,xi.hP)(JSON.stringify(t)+u).toString(),m=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString();let _=Ei(t.scaleX);if("width"in t){const e=t.width;let s=1;const i=n.getResource(t.url);(0,h.pC)(i)&&(s=i.width/i.height),_/=s*(t.height/e)}o.push({type:"fill",templateHash:f,materialHash:c?()=>m:m,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:$r(a,s,"TintColor",r,l,jr),height:$r(a,s,"Height",r,t.height),scaleX:$r(a,s,"ScaleX",r,_),angle:$r(a,s,"Rotation",r,Ei(t.rotation)),offsetX:$r(a,s,"OffsetX",r,Ei(t.offsetX)),offsetY:$r(a,s,"OffsetY",r,Ei(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Vr(t,e,s,i,r,n){const o=["Rotation","OffsetX","OffsetY"],a=i.filter((e=>e.primitiveName!==t.primitiveName||!o.includes(e.propertyName))),l=t.primitiveName,[h,c]=rn(i,l,e,null,null),u=(0,xi.hP)(JSON.stringify(t)+c).toString(),f=(0,xi.hP)(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let m={r:255,g:255,b:255,a:1};if(t.lineSymbol){const e=t.lineSymbol?.symbolLayers.find((t=>"CIMSolidStroke"===t.type));e&&(m=zi(e.color))}n.push({type:"fill",templateHash:u,materialHash:h?sn(f,s,a,r):f,cim:t,materialOverrides:a,colorLocked:t.colorLocked,effects:e,color:m,height:$r(l,s,"Separation",r,t.separation),scaleX:1,angle:$r(l,s,"Rotation",r,Ei(t.rotation)),offsetX:$r(l,s,"OffsetX",r,Ei(t.offsetX)),offsetY:$r(l,s,"OffsetY",r,Ei(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0})}function Dr(t,e,s,i,r,n){const o=t.primitiveName,[a,l]=rn(i,o,e,null,null),h=(0,xi.hP)(JSON.stringify(t)+l).toString();n.push({type:"fill",templateHash:h,materialHash:a?sn(h,s,i,r):h,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Gr(t,e,s,i,r,n,o,a){const l=t.primitiveName,h=zi(t.color),c=void 0!==t.width?t.width:4,u=Er(t.capStyle),f=Fr(t.joinStyle),m=t.miterLimit,[_,p]=rn(i,l,e,null,null),d=(0,xi.hP)(JSON.stringify(t)+p).toString();let g,y;if(e&&e instanceof Array&&e.length>0){const t=e[e.length-1];if("CIMGeometricEffectDashes"===t.type&&"NoConstraint"===t.lineDashEnding&&null===t.offsetAlongLine){const t=(e=[...e]).pop();g=t.dashTemplate,y=t.scaleDash}}n.push({type:"line",templateHash:d,materialHash:_?()=>d:d,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:$r(l,s,"Color",r,h,jr),width:$r(l,s,"Width",r,c),cap:$r(l,s,"CapStyle",r,u),join:$r(l,s,"JoinStyle",r,f),miterLimit:$r(l,s,"MiterLimit",r,m),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:g,scaleDash:y,sampleAlphaOnly:!0})}function Ur(t,e,s,i,r,n,o,a){const l=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),h=t.primitiveName,c=zi(t.tintColor),u=void 0!==t.width?t.width:4,f=Er(t.capStyle),m=Fr(t.joinStyle),_=t.miterLimit,[p,d]=rn(i,h,e,null,null),g=(0,xi.hP)(JSON.stringify(t)+d).toString();n.push({type:"line",templateHash:g,materialHash:p?()=>l:l,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:$r(h,s,"TintColor",r,c,jr),width:$r(h,s,"Width",r,u),cap:$r(h,s,"CapStyle",r,f),join:$r(h,s,"JoinStyle",r,m),miterLimit:$r(h,s,"MiterLimit",r,_),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}function Br(t,e,s,i,r,n,o,a){const l=t.primitiveName,h=void 0!==t.width?t.width:4,c=Er(t.capStyle),u=Fr(t.joinStyle),f=t.miterLimit,[m,_]=rn(i,l,e,null,null),p=(0,xi.hP)(JSON.stringify(t)+_).toString();n.push({type:"line",templateHash:p,materialHash:m?sn(p,s,i,r):p,cim:t,materialOverrides:null,isOutline:o,colorLocked:t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:$r(l,s,"Width",r,h),cap:$r(l,s,"CapStyle",r,c),join:$r(l,s,"JoinStyle",r,u),miterLimit:$r(l,s,"MiterLimit",r,f),referenceWidth:a,zOrder:Kr(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function Xr(t,e,s,i,r,n){const o=t.markerPlacement;if(!o||"CIMMarkerPlacementInsidePolygon"!==o.type)return!1;const a=o,l=Math.abs(a.stepX),h=Math.abs(a.stepY);if(0===l||0===h)return!0;const c=["Rotation","OffsetX","OffsetY"],u=i.filter((e=>e.primitiveName!==t.primitiveName||!c.includes(e.propertyName))),f="url"in t?t.url:null,[m,_]=rn(i,a.primitiveName,e,null,null),p=(0,xi.hP)(JSON.stringify(t)+_).toString();let d,g,y=null;if("Random"===o.gridType){const t=(0,B.Wz)(A.C1),e=Math.max(Math.floor(t/l),1),s=Math.max(Math.floor(t/h),1);d=h*s,y=t=>t?t*s:0,g=e*l/d}else o.shiftOddRows?(d=2*h,y=t=>t?2*t:0,g=l/h*.5):(d=h,y=null,g=l/h);let x={r:255,g:255,b:255,a:1};return"tintColor"in t&&(x=zi(t.tintColor)),n.push({type:"fill",templateHash:p,materialHash:m?sn(p,s,u,r):p,cim:t,materialOverrides:u,colorLocked:t.colorLocked,effects:e,color:$r(a.primitiveName,s,"TintColor",r,x,jr),height:$r(a.primitiveName,s,"StepY",r,d,y),scaleX:g,angle:$r(a.primitiveName,s,"GridAngle",r,a.gridAngle),offsetX:$r(a.primitiveName,s,"OffsetX",r,Ei(a.offsetX)),offsetY:$r(a.primitiveName,s,"OffsetY",r,Ei(a.offsetY)),url:f,applyRandomOffset:"Random"===o.gridType,sampleAlphaOnly:!f}),!0}function Hr(t,e,s,i,r,n,o,a,l){const c=t.primitiveName,u=Ei(t.size);let f=Ei(t.scaleX,1);const m=Ei(t.rotation),_=Ei(t.offsetX),p=Ei(t.offsetY),d=t.tintColor?zi(t.tintColor):{r:255,g:255,b:255,a:1},g=(0,xi.hP)(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString(),y=en(t.markerPlacement,i,s,r),x=function(t,e,s,i){const r=[];if(hr.findApplicableOverrides(t,e,r),0===r.length)return t;for(const t of r)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(e,s,i)=>{for(const t of r)t.fn&&(t.value=t.fn(e,s,i));const n=(0,ht.d9)(t),o=t.primitiveName;for(const t of r)if(t.primitiveName===o){const e=Qr(t.propertyName);if(null!=t.value){const s=Pr(t.value,t.propertyName);s!==n[e]&&(n[e]=s)}}return n}}(t.animatedSymbolProperties,i,s,r),[M,b]=rn(i,c,e,y,x),v=(0,xi.hP)(JSON.stringify(t)+b).toString(),S=t.anchorPoint??{x:0,y:0};if("width"in t){const e=t.width;let s=1;const i=n.getResource(t.url);(0,h.pC)(i)&&(s=i.width/i.height),f/=s*(u/e)}function w(t,e){return Ci(x,t,e)}const P=t.animatedSymbolProperties&&!0===t.animatedSymbolProperties.randomizeStartTime?(t,e,s,i)=>{const r=function(t){return Math.floor(function(t,e){let s;if("string"==typeof t)s=(0,xi.hP)(t+`-seed(${e})`);else{let i=12;s=t^e;do{s=107*(s>>8^s)+i|0}while(0!=--i)}return(1+s/(1<<31))/2}(t,Tr)*zr)}(i),n=w(t,e);return g+`-MATERIALGROUP(${r})`+`-ASP(${JSON.stringify(n)})`}:M?(t,e)=>{const s=w(t,e);return g+`-ASP(${JSON.stringify(s)})`}:g;o.push({type:"marker",templateHash:v,materialHash:P,cim:t,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:!1,alignment:a,size:$r(c,s,"Size",r,u),scaleX:$r(c,s,"ScaleX",r,f),rotation:$r(c,s,"Rotation",r,m),offsetX:$r(c,s,"OffsetX",r,_),offsetY:$r(c,s,"OffsetY",r,p),color:$r(c,s,"TintColor",r,d,jr),anchorPoint:{x:S.x,y:-S.y},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:t.rotateClockwise,referenceSize:l,sizeRatio:1,markerPlacement:y,url:t.url,animatedSymbolProperties:x})}function Yr(t,e,s,i,r,n,o,a,l,h){const c=t.markerGraphics;if(!c)return;let u=0;if(t.scaleSymbolsProportionally){const e=t.frame;e&&(u=e.ymax-e.ymin)}const f=en(t.markerPlacement,i,s,r);for(const m of c)if(m){const c=m.symbol;if(!c)continue;switch(c.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":qr(t,e,f,null,m,i,s,r,n,o,a,l,u,h);break;case"CIMTextSymbol":Jr(t,e,f,m,s,i,r,n,a,l,u)}}}function Jr(t,e,s,i,r,n,o,a,l,h,c){hr.findApplicableOverrides(i,n,[]);const u=i.geometry;if(!("x"in u)||!("y"in u))return;const f=i.symbol,m=Oi(f),_=Ni(f.fontStyleName),p=yi(f.fontFamilyName);f.font={family:p,decoration:m,..._};const d=t.frame,g=u.x-.5*(d.xmin+d.xmax),y=u.y-.5*(d.ymin+d.ymax),x=t.size/c,M=t.primitiveName,b=Ei(f.height)*x,v=Ei(f.angle),S=Ei(t.offsetX)+(Ei(f.offsetX)+g)*x,w=Ei(t.offsetY)+(Ei(f.offsetY)+y)*x,P=zi(Wi(f));let C=zi(Vi(f)),L=Di(f);L||(C=zi(Wi(f.haloSymbol)),L=f.haloSize*x);const[I,k]=rn(n,M,e,s,null),T=JSON.stringify(t.effects)+Number(t.colorLocked).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),z=(0,xi.hP)(JSON.stringify(i)+T+k).toString();let A=$r(i.primitiveName,r,"TextString",o,i.textString,Ti,f.textCase);if(null==A)return;const{fontStyleName:E}=f,F=p+(E?"-"+E.toLowerCase():"-regular"),R=F;"string"==typeof A&&A.includes("[")&&f.fieldMap&&(A=function(t,e,s){const i=Ii(e,t);return t=>ki(t,i,s)}(f.fieldMap,A,f.textCase)),a.push({type:"text",templateHash:z,materialHash:I||"function"==typeof A||A.match(/\[(.*?)\]/)?(t,e,s)=>R+"-"+Ci(A,t,e,s):R+"-"+(0,xi.hP)(A),cim:f,materialOverrides:null,colorLocked:t.colorLocked,effects:e,alignment:l,anchorPoint:{x:t.anchorPoint?t.anchorPoint.x:0,y:t.anchorPoint?t.anchorPoint.y:0},isAbsoluteAnchorPoint:"Relative"!==t.anchorPointUnits,fontName:F,decoration:m,weight:$r(M,r,"Weight",o,_.weight),style:$r(M,r,"Size",o,_.style),size:$r(M,r,"Size",o,b),angle:$r(M,r,"Rotation",o,v),offsetX:$r(M,r,"OffsetX",o,S),offsetY:$r(M,r,"OffsetY",o,w),horizontalAlignment:Gi(f.horizontalAlignment),verticalAlignment:Ui(f.verticalAlignment),text:A,color:P,outlineColor:C,outlineSize:L,referenceSize:h,sizeRatio:1,markerPlacement:s})}function qr(t,e,s,i,r,n,o,a,l,c,u,f,m,_){const p=r.symbol,d=p.symbolLayers;if(!d)return;if(_)return void Zr(t,e,s,i,r,o,n,a,l,c,u,f,m);let g=d.length;if(nn(d))return void function(t,e,s,i,r,n,o,a,l,h,c,u,f){const m=r.geometry,_=n[0],p=n[1],d=Ir(m);if(!d)return;const g="Relative"!==t.anchorPointUnits,[y,x,M]=kr(d,t.frame,t.size,t.anchorPoint,g),b={type:"sdf",geom:m,asFill:!0},v=t.primitiveName,S=Ei(t.size),w=Ei(t.rotation),P=Ei(t.offsetX),C=Ei(t.offsetY),L=p.path,I=p.primitiveName,k=_.primitiveName,T=zi(Wi(p)),z=zi(Vi(_)),A=Di(_);let E=!1,F="";for(const t of o)t.primitiveName!==I&&t.primitiveName!==k&&t.primitiveName!==v||(void 0!==t.value?F+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`:t.valueExpressionInfo&&(E=!0));const R=JSON.stringify({...t,markerGraphics:null}),N=(0,xi.hP)(JSON.stringify(b)+L).toString(),O={type:"marker",templateHash:(0,xi.hP)(JSON.stringify(r)+JSON.stringify(p)+JSON.stringify(_)+R+F).toString(),materialHash:E?()=>N:N,cim:b,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:c,anchorPoint:{x,y:M},isAbsoluteAnchorPoint:g,size:$r(t.primitiveName,a,"Size",l,S),rotation:$r(t.primitiveName,a,"Rotation",l,w),offsetX:$r(t.primitiveName,a,"OffsetX",l,P),offsetY:$r(t.primitiveName,a,"OffsetY",l,C),scaleX:1,frameHeight:f,rotateClockwise:t.rotateClockwise,referenceSize:u,sizeRatio:y,color:$r(I,a,"Color",l,T,jr),outlineColor:$r(k,a,"Color",l,z,jr),outlineWidth:$r(k,a,"Width",l,A),markerPlacement:s,path:L,animatedSymbolProperties:i};h.push(O)}(t,e,s,i,r,d,n,o,a,l,u,f,m);const y=gs.applyEffects(p.effects,r.geometry,c.geometryEngine);if(y)for(;g--;){const _=d[g];if(_&&!1!==_.enable)switch(_.type){case"CIMSolidFill":case"CIMSolidStroke":{const p=gs.applyEffects(_.effects,y,c.geometryEngine),d=Ir(p);if(!d)continue;const g="Relative"!==t.anchorPointUnits,[x,M,b]=kr(d,t.frame,t.size,t.anchorPoint,g),v="CIMSolidFill"===_.type,S={type:"sdf",geom:p,asFill:v},w=t.primitiveName,P=Ei(t.size)??10,C=Ei(t.rotation),L=Ei(t.offsetX),I=Ei(t.offsetY),k=_.path,T=_.primitiveName,z=zi(v?Wi(_):Vi(_)),A=v?{r:0,g:0,b:0,a:0}:zi(Vi(_)),E=Di(_);if(!v&&!E)break;let F=!1,R="";for(const t of n)t.primitiveName!==T&&t.primitiveName!==w||(void 0!==t.value?R+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`:t.valueExpressionInfo&&(F=!0));(0,h.pC)(e)&&"function"==typeof e&&(F=!0);const N=JSON.stringify({...t,markerGraphics:null}),O=(0,xi.hP)(JSON.stringify(S)+k).toString(),W={type:"marker",templateHash:(0,xi.hP)(JSON.stringify(r)+JSON.stringify(_)+N+R).toString(),materialHash:F?()=>O:O,cim:S,materialOverrides:null,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:M,y:b},isAbsoluteAnchorPoint:g,size:$r(t.primitiveName,o,"Size",a,P),rotation:$r(t.primitiveName,o,"Rotation",a,C),offsetX:$r(t.primitiveName,o,"OffsetX",a,L),offsetY:$r(t.primitiveName,o,"OffsetY",a,I),scaleX:1,frameHeight:m,rotateClockwise:t.rotateClockwise,referenceSize:f,sizeRatio:x,color:$r(T,o,"Color",a,z,jr),outlineColor:$r(T,o,"Color",a,A,jr),outlineWidth:$r(T,o,"Width",a,E),markerPlacement:s,animatedSymbolProperties:i,path:k};l.push(W);break}default:Zr(t,e,s,i,r,o,n,a,l,c,u,f,m)}}}function Zr(t,e,s,i,r,n,o,a,l,c,u,f,m){const _=function(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}(t,r),p=["Rotation","OffsetX","OffsetY"],d=o.filter((e=>e.primitiveName!==t.primitiveName||!p.includes(e.propertyName)));let g="";for(const t of o)void 0!==t.value&&(g+=`-${t.primitiveName}-${t.propertyName}-${JSON.stringify(t.value)}`);const[y,x,M]=lr.getTextureAnchor(_,c),b=t.primitiveName,v=Ei(t.rotation),S=Ei(t.offsetX),w=Ei(t.offsetY),P=(0,xi.hP)(JSON.stringify(_)+g).toString(),C={type:"marker",templateHash:P,materialHash:d.length>0||(0,h.pC)(e)&&"function"==typeof e?sn(P,n,d,a):P,cim:_,materialOverrides:d,colorLocked:t.colorLocked,effects:e,scaleSymbolsProportionally:t.scaleSymbolsProportionally,alignment:u,anchorPoint:{x:y,y:x},isAbsoluteAnchorPoint:!1,size:t.size,rotation:$r(b,n,"Rotation",a,v),offsetX:$r(b,n,"OffsetX",a,S),offsetY:$r(b,n,"OffsetY",a,w),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:m,rotateClockwise:t.rotateClockwise,referenceSize:f,sizeRatio:M/(0,B.F2)(t.size),markerPlacement:s,animatedSymbolProperties:i};l.push(C)}function Kr(t){if(t&&0===t.indexOf("Level_")){const e=parseInt(t.substr(6),10);if(!isNaN(e))return e}return 0}function jr(t){if(!t||0===t.length)return null;const e=new gi.Z(t).toRgba();return{r:e[0],g:e[1],b:e[2],a:e[3]}}function $r(t,e,s,i,r,n,o){const a=e[t];if(a){const t=a[s];if("string"==typeof t||"number"==typeof t||t instanceof Array)return n?n.call(null,t,o):t;if(null!=t&&t instanceof Mi.mz)return(e,s,a)=>{let l=er(t,e,{$view:a},i.geometryType,s);return null!==l&&n&&(l=n.call(null,l,o)),null!==l?l:r}}return r}function Qr(t){return t?t.charAt(0).toLowerCase()+t.substr(1):t}function tn(t,e,s,i){for(const t of e)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(s,i,r)=>{for(const t of e)t.fn&&(t.value=t.fn(s,i,r));const n=[];for(let s of t){const t=s?.primitiveName;if(t){let i=!1;for(const r of e)if(r.primitiveName===t){const t=Qr(r.propertyName);null!=r.value&&r.value!==s[t]&&(i||(s=(0,ht.d9)(s),i=!0),s[t]=r.value)}}n.push(s)}return n}}function en(t,e,s,i){const r=[];if(hr.findApplicableOverrides(t,e,r),0===r.length)return t;for(const t of r)if(t.valueExpressionInfo){const e=s[t.primitiveName]&&s[t.primitiveName][t.propertyName];e instanceof Mi.mz&&(t.fn=(t,s,r)=>er(e,t,{$view:r},i.geometryType,s))}return(e,s,i)=>{for(const t of r)t.fn&&(t.value=t.fn(e,s,i));const n=(0,ht.d9)(t),o=t.primitiveName;for(const t of r)if(t.primitiveName===o){const e=Qr(t.propertyName);null!=t.value&&t.value!==n[e]&&(n[e]=t.value)}return n}}function sn(t,e,s,i){for(const t of s)if(t.valueExpressionInfo){const s=e[t.primitiveName]&&e[t.primitiveName][t.propertyName];s instanceof Mi.mz&&(t.fn=(t,e,r)=>er(s,t,{$view:r},i.geometryType,e))}return(e,i,r)=>{for(const t of s)t.fn&&(t.value=t.fn(e,i,r));return(0,xi.hP)(t+hr.buildOverrideKey(s)).toString()}}function rn(t,e,s,i,r){let n=!1,o="";for(const s of t)s.primitiveName===e&&(void 0!==s.value?o+=`-${s.primitiveName}-${s.propertyName}-${JSON.stringify(s.value)}`:s.valueExpressionInfo&&(n=!0));return(0,h.pC)(s)&&"function"==typeof s&&(n=!0),(0,h.pC)(i)&&"function"==typeof i&&(n=!0),(0,h.pC)(r)&&"function"==typeof r&&(n=!0),[n,o]}const nn=t=>t&&2===t.length&&t[0].enable&&t[1].enable&&"CIMSolidStroke"===t[0].type&&"CIMSolidFill"===t[1].type&&!t[0].effects&&!t[1].effects,on=l.Z.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");class an extends ys{constructor(t){super(),this._ongoingMaterialRequestMap=new Map,this._materialCache=new Map,this._dynamicPropertyMap=new Map,this._cimLayer=t}analyze(t,e,s,i,r){if(r&&0===r.length)return null;const n=r&&r.length>0,o=e.readLegacyFeature(),a=e.getObjectId(),l=this._materialCache,h=this._cimLayer.materialHash;if(!h)return on.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c="function"==typeof h?h(o,s,i,a):h;if(l.has(c)){const t=l.get(c);return Promise.resolve(t)}const u=this._ongoingMaterialRequestMap.get(c);if(u)return u;const f=this._cimLayer,m=function(t,e){if(!e||0===e.length)return t;const s=(0,ht.d9)(t);return hr.applyOverrides(s,e),s}(f.cim,this._cimLayer.materialOverrides);m.mosaicHash=c;const{type:_,url:p}=f,d={cim:m,type:_,mosaicHash:c,url:p,size:null,dashTemplate:null,text:null,fontName:null,objectId:a,animatedSymbolProperties:null};switch(_){case"marker":d.size=Ci(f.size,o,s,i),d.animatedSymbolProperties=Ci(f.animatedSymbolProperties,o,s,i);break;case"line":d.dashTemplate=f.dashTemplate;break;case"text":d.text=Ci(f.text,o,s,i),d.fontName=Ci(f.fontName,o,s,i)}const g=t.getMosaicItem(d,r).then((t=>(n||(this._ongoingMaterialRequestMap.delete(c),l.set(c,t)),t))).catch((t=>(this._ongoingMaterialRequestMap.delete(c),on.error(".analyze()",t.message),null)));return n||this._ongoingMaterialRequestMap.set(c,g),g}}function ln(t,e){if(t&&"name"in t){const s=t;return e&&e.error(new o.Z(s.name,s.message,s.details)),!1}return!0}class hn extends(di(an)){constructor(t,e,s){if(super(t),this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI)),tt(t.color)){const e=(e,s,i)=>{const r=t.color(e,s,i);return r&&(0,Y.t2)(r)||0};this._dynamicPropertyMap.set("fillColor",e)}else{const e=t.color;this.fillColor=e&&(0,Y.t2)(e)||0}const i="CIMMarkerPlacementInsidePolygon"===t.cim.placement?.type&&t.cim.placement.shiftOddRows?2:1,r=t.height;if(tt(r)){const t=(t,e,s)=>r(t,e,s)*i;this._dynamicPropertyMap.set("_height",t)}else this._height=(r||0)*i;const n=t.offsetX;if(tt(n)){const t=(t,e,s)=>(0,B.F2)(n(t,e,s));this._dynamicPropertyMap.set("_offsetX",t)}else this._offsetX=(0,B.F2)(n||0);const o=t.offsetY;if(tt(o)){const t=(t,e,s)=>(0,B.F2)(-o(t,e,s));this._dynamicPropertyMap.set("_offsetY",t)}else this._offsetY=(0,B.F2)(-o||0);const a=t.scaleX;tt(a)?this._dynamicPropertyMap.set("_scaleX",a):this._scaleX=a||1;const l=t.angle;if(tt(l)){const t=(t,e,s)=>(0,Ts.s5)(l(t,e,s));this._dynamicPropertyMap.set("_angle",t)}else this._angle=(0,Ts.s5)(l)||0;if((0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._cimFillLayer=t,this._bitset=(t.colorLocked?A.Uh:0)|(t.applyRandomOffset?A.jk:0)|(t.sampleAlphaOnly?A.Iv:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[s,i]=st(t.scaleInfo,e);return new hn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)}));const r=q.dk.load(this._fillMaterialKey),n=this._materialCache,o=(0,this._cimFillLayer.materialHash)(i,e,s),a=n.get(o);let l=null;if(a&&ln(a.spriteMosaicItem)&&(l=a.spriteMosaicItem),l){const{rect:t,width:e,height:s}=l,i=t.x+A.fL,n=t.y+A.fL,o=i+e,a=n+s;let h=Math.round((0,B.F2)(this._height));h<=0&&(h=a-n);let c=Math.round((0,B.F2)(this._height/s*e||0));c<=0&&(c=o-i);const u=this._scaleX,f=1;this.tl=(0,J.UJ)(i,n),this.br=(0,J.UJ)(o,a),this.aux21=(0,J.UJ)(c,h),this.aux22=(0,J.UJ)(this._offsetX,this._offsetY),this.aux3=(0,J.Jz)(128*u,128*f,this._angle,0),r.sdf=l.sdf,r.pattern=!0,r.textureBinding=l.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class cn extends(ui(an)){constructor(t,e,s){super(t),this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI)),this._cimLineLayer=t;let i=0;tt(t.width)||(i=.5*(0,B.F2)(t.width)),this._dynamicPropertyMap.set("_halfWidth",((e,s,r)=>tt(t.width)?.5*(0,B.F2)(t.width(e,s,r)):i)),tt(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,tt(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const r=t.color;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=r&&(0,Y.t2)(r)||0;const n=t.miterLimit;if(tt(n)){const t=(t,e,s)=>et(n(t,e,s));this._dynamicPropertyMap.set("_miterLimitCosine",t)}else this._miterLimitCosine=et(n);if((0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}this._scaleFactor=t.scaleFactor||1,this._isDashed=null!=t.dashTemplate;const o=t.colorLocked?A.Uh:0,a=t.scaleDash?A._6:0,l=t.sampleAlphaOnly?A.Iv:0;this.tessellationProperties._bitset=o|a|l,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[s,i]=st(t.scaleInfo,e);return new cn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)})),this._halfWidth*=this._scaleFactor;const r=this._materialCache,n=(0,this._cimLineLayer.materialHash)(i,e,s),o=r.get(n);let a=null;if(o&&ln(o.spriteMosaicItem)&&(a=o.spriteMosaicItem),a){this._hasPattern=!0;const{rect:t,width:e,height:s}=a,i=t.x+A.fL,r=t.y+A.fL,n=i+e,o=r+s;this.tessellationProperties._tl=(0,J.UJ)(i,r),this.tessellationProperties._br=(0,J.UJ)(n,o)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const l=q.a.load(this._materialKey);a&&(l.sdf=a.sdf,l.pattern=!0,l.textureBinding=a.textureBinding),this._materialKey=l.data}}const un=(0,ns.c)(),fn=ss();class mn extends(Ls(an)){constructor(t,e,s){super(t),this._cimMarkerLayer=t,this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI));const i=t.color;if(tt(i)){const t=(t,e,s)=>(0,Y.t2)(i(t,e,s));this._dynamicPropertyMap.set("_fillColor",t)}else this._fillColor=(0,Y.t2)(i);const r=t.outlineColor;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_outlineColor",t)}else this._outlineColor=(0,Y.t2)(r);const n=t.size;if(tt(n)){const t=(t,e,s)=>(0,B.F2)(n(t,e,s));this._dynamicPropertyMap.set("_size",t)}else this._size=(0,B.F2)(n)||0;const o=t.scaleX;tt(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const a=t.offsetX;if(tt(a)){const t=(t,e,s)=>(0,B.F2)(a(t,e,s));this._dynamicPropertyMap.set("xOffset",t)}else this.xOffset=(0,B.F2)(a)||0;const l=t.offsetY;if(tt(l)){const t=(t,e,s)=>(0,B.F2)(l(t,e,s));this._dynamicPropertyMap.set("yOffset",t)}else this.yOffset=(0,B.F2)(l)||0;const c=t.outlineWidth;if(tt(c)){const t=(t,e,s)=>(0,B.F2)(c(t,e,s));this._dynamicPropertyMap.set("_outlineWidth",t)}else this._outlineWidth=(0,B.F2)(c)||0;const u=t.rotation;if(tt(u)?this._dynamicPropertyMap.set("_angle",u):this._angle=u||0,(0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if((0,h.pC)(t.markerPlacement)){const e=t.markerPlacement;tt(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._markerPlacement=e}this._scaleFactor=(0,h.Pt)(t.scaleFactor,1),this._bitSet=(t.alignment===X.v2.MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[s,i]=st(t.scaleInfo,e);return new mn(t,s,i)}bindFeature(t,e,s){const i=t.readLegacyFeature(),r=t.getObjectId();this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)}));const n=this._cimMarkerLayer.materialHash,a="function"==typeof n?n(i,e,s,r):n,h=this._materialCache.get(a);if(!h||!ln(h.spriteMosaicItem)||!h.spriteMosaicItem)return void l.Z.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new o.Z("mapview-cim","Encountered an error when binding feature"));const c=h.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,f=c.width/c.height*this._scaleX,m=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let _=this._size,p=_*f;const d=this.xOffset,g=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const y=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/(0,B.F2)(this._cimMarkerLayer.frameHeight):1,x=this._outlineWidth*y,M=(0,B.F2)(this._cimMarkerLayer.referenceSize);let b=0,v=0;const S=this._cimMarkerLayer.anchorPoint;S&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(b=(0,B.F2)(S.x)/(this._size*f),v=(0,B.F2)(S.y)/this._size):(b=S.x,v=S.y)),this._anchorX=b,this._anchorY=v,this._sizeOutlineWidth=(0,J.Jz)(Math.round(Math.min(Math.sqrt(128*p),255)),Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*x),255)),Math.round(Math.min(Math.sqrt(128*M),255))),this.angle=m;const w=Math.round(64*u);this._bitestAndDistRatio=(0,J.UJ)(this._bitSet,w);const P=c.rect.x+A.fL,C=c.rect.y+A.fL,L=P+c.width,I=C+c.height;this._texUpperLeft=(0,J.UJ)(P,C),this._texUpperRight=(0,J.UJ)(L,C),this._texBottomLeft=(0,J.UJ)(P,I),this._texBottomRight=(0,J.UJ)(L,I);const k=q.mE.load(this._materialKey);k.sdf=c.sdf,k.pattern=!0,k.textureBinding=c.textureBinding,this._materialKey=k.data,p*=u,_*=u,p*=this._scaleFactor,_*=this._scaleFactor,p*=c.rect.width/c.width,_*=c.rect.height/c.height,this._computedWidth=p,this._computedHeight=_,this._applyTransformation(fn,un),this.xOffset=d,this.yOffset=g}}function _n(t){const e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=t.charCodeAt(s);return e}class pn extends(ps(an)){constructor(t,e,s){super(t),this._horizontalAlignment="center",this._verticalAlignment="middle",this._textToGlyphs=new Map,this._minMaxZoom=(0,J.UJ)(Math.round(e*A.MI),Math.round(s*A.MI));const i=t.scaleFactor||1;this._cimTextLayer=t;const r=t.color;if(tt(r)){const t=(t,e,s)=>(0,Y.t2)(r(t,e,s));this._dynamicPropertyMap.set("_color",t)}else this._color=(0,Y.t2)(r);const n=t.outlineColor;if(tt(n)){const t=(t,e,s)=>(0,Y.t2)(n(t,e,s));this._dynamicPropertyMap.set("_haloColor",t)}else this._haloColor=(0,Y.t2)(n);let o,a,l;if(tt(t.size)||(o=Math.min(Math.round((0,B.F2)(t.size*t.sizeRatio)),127)),this._dynamicPropertyMap.set("_size",((e,s,i)=>tt(t.size)?Math.min(Math.round((0,B.F2)(t.size(e,s,i)*t.sizeRatio)),127):o)),tt(t.outlineSize)){const e=(e,s,i)=>Math.min(Math.floor(5*(0,B.F2)(t.outlineSize(e,s,i)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",e)}else this._haloSize=Math.min(Math.floor(5*(0,B.F2)(t.outlineSize*t.sizeRatio)),127);if(tt(t.offsetX)||(a=Math.round((0,B.F2)(t.offsetX*t.sizeRatio))),this._dynamicPropertyMap.set("_xOffset",((e,s,i)=>tt(t.offsetX)?Math.round((0,B.F2)(t.offsetX(e,s,i)*t.sizeRatio)):a)),tt(t.offsetY)||(l=Math.round((0,B.F2)(t.offsetY*t.sizeRatio))),this._dynamicPropertyMap.set("_yOffset",((e,s,i)=>tt(t.offsetY)?Math.round((0,B.F2)(t.offsetY(e,s,i)*t.sizeRatio)):l)),tt(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,tt(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,tt(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,(0,h.pC)(t.effects)){const e=t.effects;tt(e)?this._dynamicPropertyMap.set("_effects",e):this._effects=e}if((0,h.pC)(t.markerPlacement)){const e=t.markerPlacement;tt(e)?this._dynamicPropertyMap.set("_markerPlacement",e):this._textPlacement=e}tt(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=i;const c=Math.min(Math.round((0,B.F2)(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*c)),this._materialKey=t.materialKey;const u=q.qr.load(this._materialKey);u.sdf=!0,this._bitset=(t.alignment===X.v2.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=u.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[s,i]=st(t.scaleInfo,e);return new pn(t,s,i)}async analyze(t,e,s,i){const r=e.readLegacyFeature(),n=function(t,e,s,i){return"string"==typeof t.text?t.text:"function"==typeof t.text?t.text(e,s,i):""}(this._cimTextLayer,r,s,i),o=await super.analyze(t,e,s,i,_n(n));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(n,o.glyphMosaicItems),o}bindFeature(t,e,s){const i=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach(((t,r)=>{this[r]=t(i,e,s)})),!this._text||0===this._text.length)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/A.Ex,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=(0,H.kH)((0,h.Pt)(this._horizontalAlignment,"center")),this._yAlignD=(0,H.b7)((0,h.Pt)(this._verticalAlignment,"baseline"));const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const dn=128;class gn extends(di(ys)){constructor(t,e,s,i,r,n,o,a,l,h,c,u,f,m,_,p){super(),this._effects=m;const d=q.dk.load(t);e&&(d.sdf=e.sdf,d.pattern=!0,d.textureBinding=e.textureBinding),this.fillColor=s,this.tl=i,this.br=r,this.aux21=(0,J.UJ)(n,o),this.aux22=(0,J.UJ)(a,l),this.aux3=(0,J.Jz)(h,c,u,0),this._bitset=f,this._minMaxZoom=(0,J.UJ)(Math.round(_*A.MI),Math.round(p*A.MI)),this._materialKey=d.data}static fromCIMFill(t,e,s){const i=t.color,r=i&&(0,Y.t2)(i)||0,n=t.materialKey,[o,a]=st(t.scaleInfo,s),l=(t.colorLocked?A.Uh:0)|(t.applyRandomOffset?A.jk:0)|(t.sampleAlphaOnly?A.Iv:0);if(!e)return new gn(n,null,r,0,0,0,0,0,0,0,0,0,l,t.effects,o,a);const{rect:h,width:c,height:u}=e,f=t.scaleX||1,m=h.x+A.fL,_=h.y+A.fL,p=m+c,d=_+u,g=(0,B.F2)(t.height),y=f*g;let x=Math.round(g);x<=0&&(x=d-_);let M=Math.round(y);M<=0&&(M=p-m);const b=(0,B.F2)(t.offsetX||0),v=(0,B.F2)(-t.offsetY||0),S=(0,J.UJ)(m,_),w=(0,J.UJ)(p,d);return new gn(n,e,r,S,w,M,x,b,v,dn,dn,(0,Ts.s5)(t.angle),l,t.effects,o,a)}static fromSimpleFill(t,e,s=!1){const{color:i}=t,r=i&&"esriSFSNull"!==t.style&&(0,Y.aH)(i)||0,n=s?A.Uh:0,o=t.materialKey;let a;if(e){const{rect:t,width:s,height:i,pixelRatio:l}=e,h=t.x+A.fL,c=t.y+A.fL,u=h+s,f=c+i,m=(0,J.UJ)(h,c),_=(0,J.UJ)(u,f);a=new gn(o,e,r,m,_,s/l,i/l,0,0,dn,dn,0,n,null,0,Z)}else a=new gn(o,null,r,0,0,0,0,0,0,0,0,0,n,null,0,Z);return a._maybeAddLineTemplate(t),a}static fromPictureFill(t,e,s=!1){const i=A.ru,{rect:r,width:n,height:o}=e,a=r.x+A.fL,l=r.y+A.fL,h=a+n,c=l+o,u=(0,J.UJ)(a,l),f=(0,J.UJ)(h,c),m=Math.round((0,B.F2)(t.width)),_=Math.round((0,B.F2)(t.height)),p=(0,B.F2)(t.xoffset),d=(0,B.F2)(-t.yoffset),g=t.materialKey,y=s?A.Uh:0,x=new gn(g,e,i,u,f,m,_,p,d,dn*t.xscale,dn*t.yscale,0,y,null,0,Z);return x._maybeAddLineTemplate(t),x}}class yn{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=(0,c.hh)()}release(){const t=this._resolver;this._resolver=null,t?.resolve()}}const xn={marker:p.LW.MARKER,fill:p.LW.FILL,line:p.LW.LINE,text:p.LW.TEXT};class Mn{constructor(t,e,s,i){const r={minScale:e?.minScale,maxScale:e?.maxScale},n=function(t){return t.minScale||t.maxScale?t.minScale+"-"+t.maxScale:""}(r);this.layers=t,this.data=e,this.hash=this._createHash()+n,this.rendererKey=s;const o={isOutline:!1,placement:null,symbologyType:p.mD.DEFAULT,vvFlags:s};for(const e of t){const t=xn[e.type];o.isOutline="line"===e.type&&e.isOutline,e.materialKey=(0,q.jj)(t,o),e.maxVVSize=i,e.scaleInfo=r,e.templateHash+=n}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}var bn=s(32243),vn=s(17452),Sn=s(65587),wn=s(25929),Pn=s(27883);async function Cn(t,e,s){if(!t.name)throw new o.Z("style-symbol-reference-name-missing","Missing name in style symbol reference");if(t.styleName&&"Esri2DPointSymbolsStyle"===t.styleName)return async function(t,e){const s=Pn.wm.replace(/\{SymbolName\}/gi,t.name);try{const t=await(0,Pn.EJ)(s,e);return(0,Pn.KV)(t.data)}catch(t){return(0,c.k_)(t),null}}(t,s);try{return async function(t,e,s,i){const r=t.data,n={portal:s&&(0,h.pC)(s.portal)?s.portal:Sn.Z.getDefault(),url:(0,vn.mN)(t.baseUrl),origin:"portal-item"},a=r.items.find((t=>t.name===e));if(!a)throw new o.Z("symbolstyleutils:symbol-name-not-found",`The symbol name '${e}' could not be found`,{symbolName:e});let l=(0,wn.f)((0,Pn.v9)(a,"cimRef"),n);(0,bn.XO)()&&(l=(0,bn.pJ)(l));try{const t=await(0,Pn.EJ)(l,i);return(0,Pn.KV)(t.data)}catch(t){return(0,c.k_)(t),null}}(await(0,Pn.n2)(t,e,s),t.name,e,s)}catch(t){return(0,c.k_)(t),null}}const Ln=async(t,e,s)=>new Mn(await async function(t,e,s,i,r){const n=i??[];if(!t)return n;let o,a;const l={};if("CIMSymbolReference"!==t.type)return Ar.error("Expect cim type to be 'CIMSymbolReference'"),n;if(o=t.symbol,a=t.primitiveOverrides,a){const t=[];for(const s of a){const i=s.valueExpressionInfo;if(i&&e){const r=i.expression,n=(0,Mi.Yi)(r,e.spatialReference,e.fields).then((t=>{(0,h.Wi)(t)||Rr(l,s.primitiveName,s.propertyName,t)}));t.push(n)}else null!=s.value&&Rr(l,s.primitiveName,s.propertyName,s.value)}t.length>0&&await Promise.all(t)}const c=[];switch(lr.fetchResources(o,s,c),c.length>0&&await Promise.all(c),o.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":!function(t,e,s,i,r,n,o){if(!t)return;const a=t.symbolLayers;if(!a)return;const l=t.effects;let h;const c=lr.getSize(t);"CIMPointSymbol"===t.type&&"Map"===t.angleAlignment&&(h=X.v2.MAP);let u=a.length;for(;u--;){const f=a[u];if(!f||!1===f.enable)continue;let m;l&&l.length&&(m=[...l]);const _=f.effects;_&&_.length&&(l?m.push(..._):m=[..._]);const p=[];let d;hr.findEffectOverrides(m,e,p),d=p.length>0?tn(m,p,s,i):m;const g=[];switch(hr.findApplicableOverrides(f,e,g),f.type){case"CIMSolidFill":Or(f,d,s,g,i,r);break;case"CIMPictureFill":Wr(f,d,s,g,i,n,r);break;case"CIMHatchFill":Vr(f,d,s,g,i,r);break;case"CIMGradientFill":Dr(f,d,s,g,i,r);break;case"CIMSolidStroke":Gr(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMPictureStroke":Ur(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMGradientStroke":Br(f,d,s,g,i,r,"CIMPolygonSymbol"===t.type,c);break;case"CIMCharacterMarker":if(Xr(f,d,s,g,i,r))break;break;case"CIMPictureMarker":if(Xr(f,d,s,g,i,r))break;"CIMLineSymbol"===t.type&&(h=Nr(f)),Hr(f,d,s,g,i,n,r,h,c);break;case"CIMVectorMarker":if(Xr(f,d,s,g,i,r))break;"CIMLineSymbol"===t.type&&(h=Nr(f)),Yr(f,d,s,g,i,r,n,h,c,o);break;default:Ar.error("Cannot analyze CIM layer",f.type)}}}(o,a,l,e,n,s,r)}return n}(t.data,e,s),t.data,t.rendererKey,t.maxVVSize),In=async(t,e,s,i)=>{if(!t)return null;if("cim"===t.type)return Ln(t,e,s);if("web-style"===t.type){const r={type:"cim",data:await Cn(t,null,i),rendererKey:t.rendererKey,maxVVSize:t.maxVVSize};return Ln(r,e,s)}return t};function kn(t){if(!t)return null;const{type:e,cim:s,url:i,materialHash:r}=t,n={cim:s,type:e,mosaicHash:r,url:i,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null};switch(e){case"marker":n.size=t.size,n.path=t.path,n.animatedSymbolProperties=t.animatedSymbolProperties;break;case"line":n.dashTemplate=t.dashTemplate;break;case"text":n.text=t.text,n.fontName=t.fontName}return n}const Tn=l.Z.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),zn=new Array,An={isOutline:!1,placement:null,symbologyType:p.mD.DEFAULT,vvFlags:0},En={...ks.eG,hash:JSON.stringify(ks.eG),materialKey:(0,q.jj)(p.LW.MARKER,An)},Fn={...ks.wW,hash:JSON.stringify(ks.wW),materialKey:(0,q.jj)(p.LW.LINE,An)},Rn={...ks.lj,hash:JSON.stringify(ks.lj),materialKey:(0,q.jj)(p.LW.FILL,An)};function Nn(t,e){const s=t.length;return t.push(null),e.then((e=>t[s]=e)),t}function On(t){return!!(1&t)}class Wn{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new yn,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const s=t.hash;if(this._symbolToTemplate.has(s))return this._symbolToTemplate.get(s);const i=new Array;e&&this._createMeshTemplates(i,e,!0),this._createMeshTemplates(i,t,!1);const r=this._createGroupId("expanded-cim"===t.type&&Vn(t));return this._idToTemplateGroup.set(r,i),this._symbolToTemplate.set(s,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):zn}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(On(t)||Tn.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):zn}getMosaicItem(t,e){const s=this._createTemplateId(),i=new Promise((t=>this._idToResolver.set(s,t)));return this._fetchQueue.push({symbol:t,id:s,glyphIds:e}),i}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?async function(t,e,s){try{await t.acquire(),await e(s),t.release()}catch(e){throw t.release(),e}}(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],Rn,!1),marker:this._createMeshTemplates([],En,!1),line:this._createMeshTemplates([],Fn,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,s=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(s).then((()=>this._fetchResource(e,t).then((t=>{for(const{id:e,mosaicItem:s}of t)this._idToResolver.get(e)(s),this._idToResolver.delete(e)})))).catch((t=>{(0,c.D_)(t)?this._fetchQueue=this._fetchQueue.concat(e):"worker:port-closed"===t.name||Tn.error(new o.Z("mapview-template-store","Unable to fetch requested texture resources",t))}))}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?gn.fromSimpleFill(t,s,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?gn.fromPictureFill(t,s,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:s}=await this.getMosaicItem(t);return ln(s,Tn)?pi.fromSimpleLine(t,s):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return ln(e,Tn)?Is.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return xs.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(kn(t),_n(t.text));return ln(e,Tn)?xs.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?gn.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?pi.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(kn(t));return ln(e,Tn)?Is.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let s;switch(t.type){case"marker":s=await this._createCIMMarker(t);break;case"line":s=await this._createCIMLine(t);break;case"fill":s=await this._createCIMFill(t);break;case"text":s=await this._createCIMText(t)}return this._cimTemplateCache.set(e,s),s}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let s;switch(t.type){case"marker":s=mn.fromCIMMarker(t,this._tileInfo);break;case"line":s=cn.fromCIMLine(t,this._tileInfo);break;case"fill":s=hn.fromCIMFill(t,this._tileInfo);break;case"text":s=pn.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,s),s}_createPrimitiveMeshTemplates(t,e,s){switch(e.type){case"esriSMS":return Nn(t,this._createSMS(e));case"esriPMS":return Nn(t,this._createPMS(e));case"esriSFS":return Nn(t,this._createSFS(e,s));case"line-marker":return Nn(t,this._createLMS(e));case"esriPFS":return Nn(t,this._createPFS(e,s));case"esriSLS":return Nn(t,this._createSLS(e,!1));case"esriTS":return Nn(t,this._createTS(e));default:return Tn.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,s){if(e.type.includes("3d"))return Tn.error("3D symbols are not supported with MapView"),t;if("expanded-cim"===e.type){for(const s of e.layers)"function"==typeof s.materialHash?Nn(t,this._createDynamicCIM(s)):Nn(t,this._createCIM(s));return t}if("composite-symbol"===e.type){for(const i of e.layers)this._createPrimitiveMeshTemplates(t,i,s);return t}return"cim"===e.type||"label"===e.type||"web-style"===e.type?t:this._createPrimitiveMeshTemplates(t,e,s)}}const Vn=t=>{if(!t.layers)return!1;for(const e of t.layers)if("function"==typeof e.materialHash)return!0;return!1};class Dn{constructor(t,e,s){this._loadPromise=(0,G.j)(),this._geometryType=t,this._idField=e,this._templateStore=s}update(t,e){(0,h.pC)(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const s=new Map;if("simple"===t.type){for(const i of t.classes){const t=Ps.fromLabelClass(i,e);s.set(i.index,t)}return s}for(const i in t.classes){const r=t.classes[i];for(const t of r){const i=Ps.fromLabelClass(t,e);s.set(t.index,i)}}return s}get templates(){return this._templateStore}async analyze(t,e,s,i,r,n,o){if((0,c.Hc)(o))return;let a;"dictionary"===s.type&&(a=await s.analyze(this._idField,t.copy(),e,r,n,o));let l=0;for(;t.next();){let e;if(e=a?a[l++]:(0,h.pC)(i)&&(0,_.nE)(t.getDisplayId())&&1!==t.readAttribute("cluster_count")?i.match(this._idField,t,this._geometryType,r,n):s.match(this._idField,t,this._geometryType,r,n),t.setGroupId(e),On(e)){const s=this._templateStore.getDynamicTemplateGroup(e);for(const e of s)e&&e.analyze&&e.analyze(this._templateStore,t,r,n)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,s,i,r,n){if((0,c.Hc)(n))return;const o=t.getCursor();for(s&&await s.analyze(this._idField,o.copy(),e,i,r,n);o.next();){let t=o.getGroupId();if(null!=t&&-1!==t||(t=s.match(this._idField,o,o.geometryType,i,r),o.setGroupId(t)),On(t)){const e=this._templateStore.getDynamicTemplateGroup(t);for(const t of e)t&&t.analyze&&t.analyze(this._templateStore,o,i,r)}o.setGroupId(t)}return await this._loadPromise,this._templateStore.finalize(n)}writeGraphic(t,e,s,i){const r=e.getGroupId(),n=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),null!=n){if(On(r))for(const t of o)t&&t.bindFeature(e,null,null);if(o){for(const r of o)r&&r.write(t,e,s,i);t.featureEnd()}}}writeCursor(t,e,s,i,r,n,o){const a=e.getGroupId(),l=e.getDisplayId(),c=this._templateStore.getTemplateGroup(a),u=this._schema.mesh.sortKey;let f=0;if((0,h.pC)(u)&&(f=null!=u.fieldIndex?e.getComputedNumericAtIndex(u.fieldIndex):null!=u.field?e.readAttribute(u.field):e.readAttribute(this._idField),f*="asc"===u.order?1:-1),t.featureStart(0,null==f||isNaN(f)?0:f),null!=l&&c){if(On(a))for(const t of c)t.bindFeature(e,s,i);for(const s of c)s.write(t,e,r,o);if((0,h.pC)(n)&&t.hasRecords){const s=n&&this._findLabelRef(c);this._writeLabels(t,e,n,s,r,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof Is)return e;return null}_writeLabels(t,e,s,i,r,n){for(const o of s)if((0,h.pC)(o)&&o){const{glyphs:s,rtl:a,index:l}=o,h=this._labelTemplates.get(l);h.setZoomLevel(r),h.bindReferenceTemplate(i),h.bindTextInfo(s,a),h.write(t,e,null,n)}}}var Gn=s(13867);const Un=l.Z.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Bn(t,e,s,i){switch(t.type){case"simple":case"heatmap":return Xn.fromBasicRenderer(t,e,s,i);case"map":return Jn.fromUVRenderer(t,e,s,i);case"interval":return Yn.fromCBRenderer(t,e,s,i);case"dictionary":return Kn.fromDictionaryRenderer(t,e,s,i);case"pie-chart":return Hn.fromPieChartRenderer(t,e,s,i);case"subtype":return Hn.fromSubtypes(t,e,s,i)}}class Xn{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,s,i){const r=new Xn;if(t.symbol){const n=await In(t.symbol,s,i),o=e.createTemplateGroup(n,null);r.setDefault(o)}return r}static async fromPieChartRenderer(t,e,s,i){const r=new Xn;if(t.markerSymbol){const n=await In(t.markerSymbol,s,i);let o;t.fillSymbol&&(o=await In(t.fillSymbol,s,i));const a=e.createTemplateGroup(n,o);r.setDefault(a)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,s,i,r){return this.getDefault()}async analyze(t,e,s,i,r,n){return null}}class Hn extends Xn{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,s,i){const r=new Map,n=[];for(const o in t.renderers){const a=parseInt(o,10),l=Bn(t.renderers[o],e,s,i).then((t=>r.set(a,t)));n.push(l)}return await Promise.all(n),new Hn(r,t.subtypeField)}match(t,e,s,i,r){const n=e.readAttribute(this._subtypeField),o=this._subMatchers.get(n);return o?o.match(t,e,s,i,r):null}}class Yn extends Xn{constructor(t,e,s,i){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=i,this._field=t,this._normalizationInfo=s}static async fromCBRenderer(t,e,s,i){const{isMaxInclusive:r,normalizationField:n,normalizationTotal:o,normalizationType:a}=t,l=t.field,h=new Yn(l,r,{normalizationField:n,normalizationTotal:o,normalizationType:a},t.fieldIndex),c=await In(t.backgroundFillSymbol,s,i);await Promise.all(t.intervals.map((async t=>{const r=await In(t.symbol,s,i),n=await e.createTemplateGroup(r,c),o={min:t.min,max:t.max};h.add(o,n)})));const u=await In(t.defaultSymbol,s,i);if(u){const t=await e.createTemplateGroup(u,c);h.setDefault(t)}return h}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort(((t,e)=>t.interval.min-e.interval.min))}size(){return super.size()+this._intervals.length}match(t,e,s,i,r){if(null==this._fieldIndex&&!this._field)return this.getDefault();const n=null!=this._fieldIndex?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(null==n||isNaN(n)||n===1/0||n===-1/0)return this.getDefault();for(let t=0;t<this._intervals.length;t++){const{interval:e,result:s}=this._intervals[t],i=n>=e.min,r=this._isMaxInclusive?n<=e.max:n<e.max;if(i&&r)return s}return this.getDefault()}_needsNormalization(){const t=this._normalizationInfo;return t&&(t.normalizationField||t.normalizationTotal||t.normalizationType)}_getValueFromField(t){const e=t.readAttribute(this._field);if(!this._needsNormalization()||null==e)return e;const{normalizationField:s,normalizationTotal:i,normalizationType:r}=this._normalizationInfo,n=!!s&&t.readAttribute(s);if(r)switch(r){case"esriNormalizeByField":return n?e/n:void 0;case"esriNormalizeByLog":return Math.log(e)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return e/i*100;default:return void Un.error(`Found unknown normalization type: ${r}`)}else Un.error("Normalization is required, but no type was set!")}}class Jn extends Xn{constructor(t,e,s){super(),this.type="map",this._nullResult=null,this._resultsMap=new Map,this._fieldsIndex=s,this._fields=t,this._seperator=e||""}static async fromUVRenderer(t,e,s,i){const r=t.fieldDelimiter,n=[t.field];t.field2&&n.push(t.field2),t.field3&&n.push(t.field3);const o=await In(t.backgroundFillSymbol,s,i),a=new Jn(n,r,t.fieldIndex);await Promise.all(t.map.map((async t=>{const r=await In(t.symbol,s,i),n=await e.createTemplateGroup(r,o);"<Null>"===t.value?a.setNullResult(n):a.add(t.value,n)})));const l=await In(t.defaultSymbol,s,i);if(l){const t=await e.createTemplateGroup(l,o);a.setDefault(t)}return a}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,s,i,r){if(null==this._fieldsIndex&&!this._fields)return this.getDefault();const n=null!=this._fieldsIndex?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(null!==this._nullResult&&(null==n||""===n||"<Null>"===n))return this._nullResult;if(null==n)return this.getDefault();const o=n.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const s of this._fields){const i=t.readAttribute(s);null==i||""===i?e.push("<Null>"):e.push(i)}return e.join(this._seperator)}}let qn;async function Zn(){return qn||(qn=s.e(5329).then(s.bind(s,25329))),qn}class Kn extends Xn{constructor(t,e,s,i,r,n){super(),this.type="dictionary",this._groupIdCache=new Gn.Z(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=s,this._scaleFn=i,this._schemaUtilsModule=r,this._symbolOptions=n}static async fromDictionaryRenderer(t,e,i,r){const[{DictionaryLoader:n},o]=await Promise.all([s.e(4475).then(s.bind(s,84475)),Zn()]),a=new n(t.url,t.config,t.fieldMap);await a.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const l=await async function(t,e){const s=t||1;if("number"==typeof s)return(t,e,i)=>s;const i=await(0,Mi.Yi)(s,e.spatialReference,e.fields);return(t,s,r)=>er(i,t,{$view:r},e.geometryType,s)||1}(t.scaleExpression,i);return new Kn(a,e,i,l,o,t.symbolOptions)}async _analyzeFeature(t,e,s,i,r){const n=t.readLegacyFeature(),a=this._scaleFn(n,s,i),l=this._attributeHash(n)+"-"+a,h=this._groupIdCache.get(l);if(h)return h;const c={...i,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},u=await this._loader.getSymbolAsync(n,c),f=this._schemaUtilsModule.createSymbolSchema(u,this._symbolOptions),m=In(f,this._info,e,r).then((t=>{if("expanded-cim"!==t.type)return Un.error(new o.Z("mapview-bad-type",`Found unexpected type ${t.type} in dictionary response`)),null;t.hash+="-"+a;for(const e of t.layers)e.scaleFactor=a,e.templateHash+="-"+a;return this._templates.createTemplateGroup(t,null)}));return this._groupIdCache.put(l,m,1),m}async analyze(t,e,s,i,r,n){const o=e.getCursor(),a=[];for(;o.next();)a.push(this._analyzeFeature(o,s,i,r,n));return Promise.all(a)}match(t,e,s,i,r){return null}_attributeHash(t){let e="";for(const s of this._symbolFields){const i=this._fieldMap[s];i&&(e+=t.attributes[i]+"-")}return e}}var jn=s(47988);class $n{constructor(t){this._remoteClient=t,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){}async fetchResource(t,e){const s=this._resourceMap,i=s.get(t);if(i)return i;let r=this._inFlightResourceMap.get(t);if(r)return r;try{r=this._remoteClient.invoke("tileRenderer.fetchResource",{url:t},{...e}),this._inFlightResourceMap.set(t,r),r.then((e=>(this._inFlightResourceMap.delete(t),s.set(t,e),e)))}catch(t){return(0,c.D_)(t)?null:{width:0,height:0}}return r}getResource(t){return this._resourceMap.get(t)??null}}function Qn(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function to(t){const e=t.message,s={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin,version:e.version},transferList:new Array};for(const t in e.data){const i=e.data[t];if(s.message.data[t]=null,(0,h.pC)(i)){const e=i.stride,r=i.indices.slice(0),n=i.vertices.slice(0),o=i.records.slice(0),a={stride:e,indices:r,vertices:n,records:o,metrics:(0,h.yw)(i.metrics,(t=>t.slice(0)))};s.transferList.push(r,n,o),s.message.data[t]=a}}return s}let eo=class extends jn.Z{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new $n(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach((e=>{e.forEach(t)}))}async update(t,e){const s=e.schema.processors[0];if("symbol"!==s.type)return;const i=(0,f.Hg)(this._schema,s);((0,f.uD)(i,"mesh")||(0,f.uD)(i,"target"))&&(t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=s,this._factory=this._createFactory(s),this._factory.update(s,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,s,i){return(0,c.k_)(i),this._onTileData(t,e,s,i)}onTileClear(t){return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:{clear:!0}})}onTileError(t,e,s){const i=s.signal,r={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:i})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach((t=>{for(const s of t)s.message.tileKey===e.id&&this._updateTileMesh("append",e,to(s),[],!1,!1,null)}))}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(to(e))}_createFactory(t){const{geometryType:e,objectIdField:s,fields:i}=this.service,r={geometryType:e,fields:i,spatialReference:m.Z.fromJSON(this.spatialReference)},n=new Wn(((t,e)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",t,e)),this.tileStore.tileScheme.tileInfo),{matcher:o,aggregateMatcher:a}=t.mesh;return this._store=n,this._matchers.feature=Bn(o,n,r,this._resourceManagerProxy),this._matchers.aggregate=(0,h.yw)(a,(t=>Bn(t,n,r,this._resourceManagerProxy))),new Dn(e,s,n)}async _onTileData(t,e,s,i){(0,c.k_)(i);const{type:r,addOrUpdate:n,remove:o,clear:a,end:l}=e,u=!!this._schema.mesh.sortKey;if(!n){const e={type:r,addOrUpdate:null,remove:o,clear:a,end:l,sort:u};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},i)}const f=this._processFeatures(t,n,s,i,e.status.version);try{const s=await f;if((0,h.Wi)(s)){const e={type:r,addOrUpdate:null,remove:o,clear:a,end:l,sort:u};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e},i)}const n=[];for(const e of s){let s=!1;const i=e.message.bufferIds,r=t.key.id,o=e.message.tileKey;if(r!==o&&(0,h.pC)(i)){if(!this.tileStore.get(o)){this._addBufferData(r,e),n.push(e);continue}let t=this._bufferIds.get(o);t||(t=new Set,this._bufferIds.set(o,t));const a=Array.from(i);for(const e of a){if(t.has(e)){s=!0;break}t.add(e)}}s||(this._addBufferData(r,e),n.push(e))}await Promise.all(n.map((s=>{const n=t.key.id===s.message.tileKey,o=n?e.remove:[],a=n&&e.end;return this._updateTileMesh(r,t,s,o,a,e.clear,i.signal)})))}catch(e){this._handleError(t,e,i)}}async _updateTileMesh(t,e,s,i,r,n,o){const a=t,l=s.message.tileKey,u=!!this._schema.mesh.sortKey;l!==e.key.id&&(r=!1);const f=(0,h.yw)(s,(t=>t.message)),m=(0,h.yw)(s,(t=>t.transferList))||[],_={type:a,addOrUpdate:f,remove:i,clear:n,end:r,sort:u},p={transferList:(0,h.Wg)(m)||[],signal:o};return(0,c.k_)(p),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:l,data:_},p)}async _processFeatures(t,e,s,i,r){if((0,h.Wi)(e)||!e.hasFeatures)return null;const n={transform:t.transform,hasZ:!1,hasM:!1},o=this._factory,a={viewingMode:"",scale:t.scale},l=await this._matchers.feature,u=await this._matchers.aggregate;(0,c.k_)(i);const f=this._getLabelInfos(t,e);return await o.analyze(e.getCursor(),this._resourceManagerProxy,l,u,n,a),(0,c.k_)(i),this._writeFeatureSet(t,e,n,f,o,s,r)}_writeFeatureSet(t,e,s,i,r,n,o){const a=e.getSize(),l=this._schema.mesh.matcher.symbologyType,c=new D(t.key.id,{features:a,records:a,metrics:0},l,n,l!==p.mD.HEATMAP,o),u={viewingMode:"",scale:t.scale},f=e.getCursor();for(;f.next();)try{const e=f.getDisplayId(),n=(0,h.pC)(i)?i.get(e):null;r.writeCursor(c,f,s,u,t.level,n,this._resourceManagerProxy)}catch(t){}const m=t.tileInfoView.tileInfo.isWrappable;return c.serialize(m)}_handleError(t,e,s){if(!(0,c.D_)(e)){const i={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:s.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if((0,h.Wi)(e))return null;if("subtype"===e.type){const s={type:"subtype",classes:{}};let i=!1;for(const r in e.classes){const n=e.classes[r].filter((e=>Qn(e,t.scale)));i=i||!!n.length,s.classes[r]=n}return i?s:null}const s=e.classes.filter((e=>Qn(e,t.scale)));return s.length?{type:"simple",classes:s}:null}_getLabels(t,e){if("subtype"===e.type){const s=this.service.subtypeField,i=(0,h.s3)(s,"Expected to find subtype Field"),r=t.readAttribute(i);return null==r?[]:e.classes[r]??[]}return e.classes}_getLabelInfos(t,e){const s=this._getLabelingSchemaForScale(t);if((0,h.Wi)(s))return null;const i=new Map,r=e.getCursor();for(;r.next();){const t=r.getDisplayId(),e=[],o=(0,_.nE)(t),a=o&&1!==r.readAttribute("cluster_count")?"aggregate":"feature",l=this._getLabels(r,s);for(const s of l){if(s.target!==a)continue;const i=r.getStorage(),l=o&&"feature"===a?i.getComputedStringAtIndex(r.readAttribute("referenceId"),s.fieldIndex):i.getComputedStringAtIndex(t,s.fieldIndex);if(!l)continue;const h=n(l.toString()),c=h[0],u=h[1];this._store.getMosaicItem(s.symbol,_n(c)).then((t=>{e[s.index]={glyphs:t.glyphMosaicItems,rtl:u,index:s.index}}))}i.set(t,e)}return i}};eo=(0,i._)([(0,u.j)("esri.views.2d.layers.features.processors.SymbolProcessor")],eo);const so=eo},14867:(t,e,s)=>{function i(t,e,s,i){const r=t.clone(),n=1<<r.level,o=r.col+e,a=r.row+s;return i&&o<0?(r.col=o+n,r.world-=1):o>=n?(r.col=o-n,r.world+=1):r.col=o,r.row=a,r}s.d(e,{M:()=>i}),s(3651)}}]);