@arcgis/core 5.2.0-next.95 → 5.2.0-next.97

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 (542) hide show
  1. package/WebScene.d.ts +6 -3
  2. package/WebScene.js +1 -1
  3. package/applications/WebEditor/geometryUtils.d.ts +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/containerUtils.js +1 -1
  8. package/arcade/functions/track.js +1 -1
  9. package/arcgisGlobal.d.ts +2 -0
  10. package/assets/components/assets/icon/aiAgent16.json +1 -0
  11. package/assets/components/assets/icon/aiAgent24.json +1 -0
  12. package/assets/components/assets/icon/aiAgent32.json +1 -0
  13. package/assets/components/assets/icon/aiAgents16.json +1 -0
  14. package/assets/components/assets/icon/aiAgents24.json +1 -0
  15. package/assets/components/assets/icon/aiAgents32.json +1 -0
  16. package/assets/components/assets/icon/explodeGeometry16.json +1 -0
  17. package/assets/components/assets/icon/explodeGeometry24.json +1 -0
  18. package/assets/components/assets/icon/explodeGeometry32.json +1 -0
  19. package/assets/components/assets/icon/integration16.json +1 -0
  20. package/assets/components/assets/icon/integration24.json +1 -0
  21. package/assets/components/assets/icon/integration32.json +1 -0
  22. package/assets/components/assets/icon/spatiotemporalCatalog16.json +1 -0
  23. package/assets/components/assets/icon/spatiotemporalCatalog24.json +1 -0
  24. package/assets/components/assets/icon/spatiotemporalCatalog32.json +1 -0
  25. package/assets/components/assets/input-time-zone/t9n/messages.de.json +1 -1
  26. package/assets/esri/core/workers/RemoteClient.js +1 -1
  27. package/assets/esri/core/workers/chunks/000f91a18c22377f8525.js +1 -0
  28. package/assets/esri/core/workers/chunks/{05662a663f761dd3dea5.js → 006146ad6d4a5cbf1a1f.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bd1a7e95a797e1ed4a7b.js → 013c17e07756fa465845.js} +1 -1
  30. package/assets/esri/core/workers/chunks/014eaccf2c2d357981f0.js +1 -0
  31. package/assets/esri/core/workers/chunks/{f253875feb11883deb84.js → 04d4cd66485b622403d0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/05eb064f9b543890ae24.js +1 -0
  33. package/assets/esri/core/workers/chunks/{26737d061c7cfbbab95c.js → 0809a55a2f9be07cc5a9.js} +1 -1
  34. package/assets/esri/core/workers/chunks/0930738f43ce09b2ed2d.js +1 -0
  35. package/assets/esri/core/workers/chunks/{691434d4c6a38e63d819.js → 0a242e76bc293b0ad04b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/0a4092578dc7578bcf76.js +1 -0
  37. package/assets/esri/core/workers/chunks/0e11bee9b56a7f51b012.js +1 -0
  38. package/assets/esri/core/workers/chunks/0e65869a5dd5a3917da7.js +1 -0
  39. package/assets/esri/core/workers/chunks/0ffb5a1275d07dcd9115.js +1 -0
  40. package/assets/esri/core/workers/chunks/{e370a3337b3c90240e73.js → 105da965fc90604eb6bf.js} +1 -1
  41. package/assets/esri/core/workers/chunks/1082bb0858585bd4fa21.js +2 -0
  42. package/assets/esri/core/workers/chunks/{5235b9c21ac4156c2375.js → 10f4c5533f50c3693318.js} +1 -1
  43. package/assets/esri/core/workers/chunks/1201bb22a2bfd7d7ecba.js +1 -0
  44. package/assets/esri/core/workers/chunks/16f55c5d642a23c2547e.js +1 -0
  45. package/assets/esri/core/workers/chunks/{09e01fd1c199be0c8e03.js → 16ffbe484f6cd4736f79.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{1bf967c68d0c795d3fb4.js → 19a4907fc93ae8b817e9.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{f74c7cbe4bd12f73ae90.js → 19d7339f20f3008c4893.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{a8aa8cb60b30f0983e7e.js → 1a9f17781e0a3bc5106f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{bf7875fda48b15271a10.js → 1bef7097fe5e402539ea.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{fa377112ef3b78f6ed18.js → 1de1cc0ed0f169a58aff.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{0549e2badf511e27aa54.js → 1e3b07cf0e608431a277.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2e51764c8aa31096cb2a.js → 20feca2fdd304b3e9664.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{4c73c2f4331351e2a50c.js → 22ff018342860249b3eb.js} +1 -1
  54. package/assets/esri/core/workers/chunks/248df6fda489a9de5852.js +1 -0
  55. package/assets/esri/core/workers/chunks/279b16727d4b515eca44.js +1 -0
  56. package/assets/esri/core/workers/chunks/2b10d6597af3eeec5396.js +1 -0
  57. package/assets/esri/core/workers/chunks/2bd4b536e329112591c4.js +1 -0
  58. package/assets/esri/core/workers/chunks/2c01477b69c38f691e19.js +1 -0
  59. package/assets/esri/core/workers/chunks/2e2349387a2b9903f13c.js +2 -0
  60. package/assets/esri/core/workers/chunks/{4d700cb028f6306b163e.js → 32aa1529e84b839d051d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/33041e50ea02d99480b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/{5d7a5aa608ed6192b016.js → 349982635e921e838030.js} +1 -1
  63. package/assets/esri/core/workers/chunks/35d0a7597473d46866de.js +1 -0
  64. package/assets/esri/core/workers/chunks/374d726fdd0a9848cea5.js +1 -0
  65. package/assets/esri/core/workers/chunks/379f5ca5372d834af497.js +1 -0
  66. package/assets/esri/core/workers/chunks/37ae52c71bf9c70fbb92.js +1 -0
  67. package/assets/esri/core/workers/chunks/{05393b23ab24126d4236.js → 38bc5d09ae07f486d457.js} +1 -1
  68. package/assets/esri/core/workers/chunks/3bafa01ca01a67d09432.js +1 -0
  69. package/assets/esri/core/workers/chunks/3c7901ea007c9615ba54.js +1 -0
  70. package/assets/esri/core/workers/chunks/4047208f9559e06d7102.js +1 -0
  71. package/assets/esri/core/workers/chunks/4049e9b86c8e27a7ff12.js +1 -0
  72. package/assets/esri/core/workers/chunks/411bbdecba340df11d95.js +2 -0
  73. package/assets/esri/core/workers/chunks/42b5533f94ebcdc4befe.js +1 -0
  74. package/assets/esri/core/workers/chunks/44ca13c874b5aa0ed5a0.js +1 -0
  75. package/assets/esri/core/workers/chunks/4717831effb1ac6d5f5d.js +1 -0
  76. package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js → 476535cfb06ced74d611.js} +2 -2
  77. package/assets/esri/core/workers/chunks/486f1277fe834c0fc4c1.js +1 -0
  78. package/assets/esri/core/workers/chunks/48ade66f1685a1aaffba.js +1 -0
  79. package/assets/esri/core/workers/chunks/4d13c1a04788e5222678.js +1 -0
  80. package/assets/esri/core/workers/chunks/{cc3186dcbbf5edff8b9e.js → 4d7f6c92041d52cc8732.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{595edbc1e9bba47d5676.js → 4f89da01b67b66a92c01.js} +1 -1
  82. package/assets/esri/core/workers/chunks/507bbcde2b39321b50a4.js +1 -0
  83. package/assets/esri/core/workers/chunks/{9b8e33985310f281f084.js → 56a5b65961e722f5cae9.js} +1 -1
  84. package/assets/esri/core/workers/chunks/5830deda121e4c95d199.js +1 -0
  85. package/assets/esri/core/workers/chunks/{b102ae764c14d8b32ace.js → 58a52adc42fbe5cd12c6.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{b0e25ccb5a1e57a82628.js → 58b93f13316196d2e97d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/58f98bd89b644cfdafae.js +1 -0
  88. package/assets/esri/core/workers/chunks/5a8658e4ef5163e8ab3b.js +1 -0
  89. package/assets/esri/core/workers/chunks/5bb8d9d887dd4211afd2.js +1 -0
  90. package/assets/esri/core/workers/chunks/5d7625eb9997cd0dff09.js +1 -0
  91. package/assets/esri/core/workers/chunks/5e56a004b4407b8066eb.js +1 -0
  92. package/assets/esri/core/workers/chunks/5efc66be4576c6f67064.js +1 -0
  93. package/assets/esri/core/workers/chunks/60b1af54e7fc20fd9588.js +1 -0
  94. package/assets/esri/core/workers/chunks/6134a2c6983792787184.js +1 -0
  95. package/assets/esri/core/workers/chunks/6319413b89e23f671487.js +1 -0
  96. package/assets/esri/core/workers/chunks/{1b311ff39dede07865df.js → 633454b27c34f9ec7940.js} +1 -1
  97. package/assets/esri/core/workers/chunks/63c43ebf46964c283b4d.js +1 -0
  98. package/assets/esri/core/workers/chunks/65d3638ded62c5606ae3.js +1 -0
  99. package/assets/esri/core/workers/chunks/{aa0ef4493a7e9bed159f.js → 662f4b39ec44c68e0733.js} +1 -1
  100. package/assets/esri/core/workers/chunks/680bef5e8237cc3bdd84.js +1 -0
  101. package/assets/esri/core/workers/chunks/6835f959952f70972fce.js +1 -0
  102. package/assets/esri/core/workers/chunks/{ddf284648a73b6993737.js → 68d823697c298122ee08.js} +1 -1
  103. package/assets/esri/core/workers/chunks/6aaefd61505027267c9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/6ceb17eada151230abf7.js +1 -0
  105. package/assets/esri/core/workers/chunks/6df29716f75696434807.js +1 -0
  106. package/assets/esri/core/workers/chunks/6e804bd6bb4b0ee44fa9.js +1 -0
  107. package/assets/esri/core/workers/chunks/{ee77999df3785468b2b6.js → 6f6e8b7e6e2c856e4ed1.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{8ea28a4b1afe8bb2d313.js → 7091bbdc36f1f03f14b3.js} +1 -1
  109. package/assets/esri/core/workers/chunks/7608de0d942b4c16b2f6.js +1 -0
  110. package/assets/esri/core/workers/chunks/{4b6f433022a6822706cb.js → 762817d30474c15142b4.js} +1 -1
  111. package/assets/esri/core/workers/chunks/762e9a15b2638475a2b4.js +1 -0
  112. package/assets/esri/core/workers/chunks/79088d5c9c2e6a780929.js +1 -0
  113. package/assets/esri/core/workers/chunks/{f3d57c5b9dffd12e45b4.js → 7c3a89c12ea32a071ad4.js} +1 -1
  114. package/assets/esri/core/workers/chunks/7c67596c0792282afdfc.js +1 -0
  115. package/assets/esri/core/workers/chunks/7cef6e5f39137e74bbc3.js +1 -0
  116. package/assets/esri/core/workers/chunks/{87e0ceb1a64ab08e679a.js → 7fd54fa2f91cdab44ab3.js} +1 -1
  117. package/assets/esri/core/workers/chunks/822a5020afbca21df7f7.js +1 -0
  118. package/assets/esri/core/workers/chunks/8599d2f2eb0fbb4a8bf5.js +1 -0
  119. package/assets/esri/core/workers/chunks/862f7090ba4a56c07093.js +1 -0
  120. package/assets/esri/core/workers/chunks/{97c7dfd29ad4c2966cb4.js → 88252899a5291ad29710.js} +1 -1
  121. package/assets/esri/core/workers/chunks/8837fbcc0d484659b79c.js +1 -0
  122. package/assets/esri/core/workers/chunks/8dcc7749de3391710864.js +1 -0
  123. package/assets/esri/core/workers/chunks/900dad076347443b3ad9.js +1 -0
  124. package/assets/esri/core/workers/chunks/{f8f7b86bbd62106bc3d4.js → 925f83be3c1eb4b5c6af.js} +1 -1
  125. package/assets/esri/core/workers/chunks/{a4a22149077c7780481c.js → 9378ce457b02717304e6.js} +1 -1
  126. package/assets/esri/core/workers/chunks/93a7cf23f73b23fc7802.js +1 -0
  127. package/assets/esri/core/workers/chunks/93c1d1e7c0935242071e.js +1 -0
  128. package/assets/esri/core/workers/chunks/{fddcb8be714ad18ad0c8.js → 970b33947bf61fccd461.js} +1 -1
  129. package/assets/esri/core/workers/chunks/97aaff86e06380a68df8.js +1 -0
  130. package/assets/esri/core/workers/chunks/9bc7df2b8ae0ed443d13.js +1 -0
  131. package/assets/esri/core/workers/chunks/9cc14a41d4a90f6d626e.js +1 -0
  132. package/assets/esri/core/workers/chunks/9e514a58b1165e273202.js +1 -0
  133. package/assets/esri/core/workers/chunks/9fe1db0762ab3326eab4.js +1 -0
  134. package/assets/esri/core/workers/chunks/{a5bb19d2b7d7db22222b.js → a10188c4d1904965898a.js} +1 -1
  135. package/assets/esri/core/workers/chunks/a2288d44cba34d947613.js +1 -0
  136. package/assets/esri/core/workers/chunks/a26916de4c105859621e.js +1 -0
  137. package/assets/esri/core/workers/chunks/a322afbb48898ce35851.js +1 -0
  138. package/assets/esri/core/workers/chunks/a34cadd486e7fcc79063.js +1 -0
  139. package/assets/esri/core/workers/chunks/{cefb70d633c220cbedf9.js → a4dc1a80ed6604d71722.js} +1 -1
  140. package/assets/esri/core/workers/chunks/{6baae3e856d904fef9b1.js → a8f70cece5ce2b095cdd.js} +1 -1
  141. package/assets/esri/core/workers/chunks/ab332bd411d6c7d4190c.js +1 -0
  142. package/assets/esri/core/workers/chunks/{777f2fdf1f4b9f243893.js → ab3a6ce7bc2a27b92469.js} +1 -1
  143. package/assets/esri/core/workers/chunks/abd2f8fae6b918fbdd6d.js +1 -0
  144. package/assets/esri/core/workers/chunks/ad695de9f73b268af139.js +1 -0
  145. package/assets/esri/core/workers/chunks/{b13d2da33ec07e9d41ff.js → b0da2b089a89d643df1e.js} +1 -1
  146. package/assets/esri/core/workers/chunks/{65f4ca7201e7267bfc81.js → b5fcf4165ac72654742d.js} +1 -1
  147. package/assets/esri/core/workers/chunks/b82b523b6837ed1f28d3.js +2 -0
  148. package/assets/esri/core/workers/chunks/{527b87fddf33bb5d519e.js → ba77a8892cb23c7a297d.js} +1 -1
  149. package/assets/esri/core/workers/chunks/bb8089929ded0613d8e7.js +1 -0
  150. package/assets/esri/core/workers/chunks/bc7ca87d3bfe8a4aec81.js +1 -0
  151. package/assets/esri/core/workers/chunks/bc9b96a539f28afcb8cb.js +1 -0
  152. package/assets/esri/core/workers/chunks/{2d07d5a9ec67c39ef10c.js → bd4f29d2681e5596591a.js} +1 -1
  153. package/assets/esri/core/workers/chunks/bf9eba555aebca2c132b.js +1 -0
  154. package/assets/esri/core/workers/chunks/{903c7bd079888f65fef1.js → c3fbd81bb5820e48038f.js} +1 -1
  155. package/assets/esri/core/workers/chunks/c9df18e9ff7367a004b6.js +1 -0
  156. package/assets/esri/core/workers/chunks/ca8061e0a6d78d646ebf.js +1 -0
  157. package/assets/esri/core/workers/chunks/cc73ac8404615dc392d2.js +1 -0
  158. package/assets/esri/core/workers/chunks/{e823c9ccb7bc348d8824.js → ccb26860518dce6d01c0.js} +1 -1
  159. package/assets/esri/core/workers/chunks/cded34b161fcc790e672.js +1 -0
  160. package/assets/esri/core/workers/chunks/{1bf5c0a4bc5a960a3fa2.js → d1d4979e9dcabe5e4619.js} +1 -1
  161. package/assets/esri/core/workers/chunks/d2865c604849ce79183f.js +1 -0
  162. package/assets/esri/core/workers/chunks/{9b81bd62a2c72f592db1.js → d826f6d32b4c5885276a.js} +1 -1
  163. package/assets/esri/core/workers/chunks/d92540d3ffc4af980dd8.js +1 -0
  164. package/assets/esri/core/workers/chunks/dc7853795439ae77ace9.js +1 -0
  165. package/assets/esri/core/workers/chunks/{1f047dd747e7c1916dc7.js → dd55737fba0a8fe68101.js} +3 -3
  166. package/assets/esri/core/workers/chunks/dd8d19eb6b8e955c8067.js +1 -0
  167. package/assets/esri/core/workers/chunks/dda269a088275c823b40.js +1 -0
  168. package/assets/esri/core/workers/chunks/{7b70d6fdfa7a19ffffb0.js → de95dee8db92cf8f796f.js} +1 -1
  169. package/assets/esri/core/workers/chunks/e1c8767143f9f9d1f049.js +1 -0
  170. package/assets/esri/core/workers/chunks/{2cf2f2842c19be84ab4d.js → e6cb31c727f799c1297c.js} +1 -1
  171. package/assets/esri/core/workers/chunks/e934ef66d130c212c05b.js +1 -0
  172. package/assets/esri/core/workers/chunks/{7c56446184abcd14678b.js → ea77654c8964cc39b9a6.js} +1 -1
  173. package/assets/esri/core/workers/chunks/eb167f9f6132a6348d2e.js +1 -0
  174. package/assets/esri/core/workers/chunks/ed5ac1efd3cba49be756.js +1 -0
  175. package/assets/esri/core/workers/chunks/ef24fd6c0322e5de9fdf.js +2 -0
  176. package/assets/esri/core/workers/chunks/f219ba010c480bb75684.js +1 -0
  177. package/assets/esri/core/workers/chunks/fbf2d90240d36f8b423f.js +1 -0
  178. package/assets/esri/core/workers/chunks/{4ee99e654dad6f09abee.js → fc042b9936686785c39e.js} +1 -1
  179. package/assets/esri/core/workers/chunks/fc1658eae7b312502fab.js +1 -0
  180. package/assets/esri/core/workers/chunks/{af6b9fd77b1792fbb66e.js → fd4d124c5bf810d9e352.js} +1 -1
  181. package/assets/esri/core/workers/chunks/ffa35ecc681ec1c4739a.js +1 -0
  182. package/assets/esri/core/workers/chunks/ffca0b2333e760b66d3a.js +1 -0
  183. package/config.js +1 -1
  184. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  185. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  186. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  187. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  189. package/editing/sharedTemplates/executor/support/createPresetServiceEdit.js +1 -1
  190. package/geometry/Polygon.js +1 -1
  191. package/geometry/geometryEngine.d.ts +36 -36
  192. package/geometry/operators/affineTransformOperator.d.ts +30 -1
  193. package/geometry/operators/affineTransformOperator.js +1 -1
  194. package/geometry/operators/alphaShapeOperator.d.ts +49 -5
  195. package/geometry/operators/alphaShapeOperator.js +1 -1
  196. package/geometry/operators/areaOperator.d.ts +28 -4
  197. package/geometry/operators/areaOperator.js +1 -1
  198. package/geometry/operators/autoCompleteOperator.d.ts +25 -2
  199. package/geometry/operators/autoCompleteOperator.js +1 -1
  200. package/geometry/operators/boundaryOperator.d.ts +40 -2
  201. package/geometry/operators/boundaryOperator.js +1 -1
  202. package/geometry/operators/bufferOperator.d.ts +51 -6
  203. package/geometry/operators/bufferOperator.js +1 -1
  204. package/geometry/operators/centroidOperator.d.ts +23 -2
  205. package/geometry/operators/centroidOperator.js +1 -1
  206. package/geometry/operators/clipOperator.d.ts +34 -2
  207. package/geometry/operators/clipOperator.js +1 -1
  208. package/geometry/operators/containsOperator.d.ts +32 -2
  209. package/geometry/operators/containsOperator.js +1 -1
  210. package/geometry/operators/convexHullOperator.d.ts +47 -4
  211. package/geometry/operators/convexHullOperator.js +1 -1
  212. package/geometry/operators/crossesOperator.d.ts +35 -2
  213. package/geometry/operators/crossesOperator.js +1 -1
  214. package/geometry/operators/cutOperator.d.ts +23 -2
  215. package/geometry/operators/cutOperator.js +1 -1
  216. package/geometry/operators/densifyOperator.d.ts +61 -6
  217. package/geometry/operators/densifyOperator.js +1 -1
  218. package/geometry/operators/differenceOperator.d.ts +34 -2
  219. package/geometry/operators/differenceOperator.js +1 -1
  220. package/geometry/operators/disjointOperator.d.ts +33 -2
  221. package/geometry/operators/disjointOperator.js +1 -1
  222. package/geometry/operators/distanceOperator.d.ts +29 -4
  223. package/geometry/operators/distanceOperator.js +1 -1
  224. package/geometry/operators/equalsOperator.d.ts +32 -2
  225. package/geometry/operators/equalsOperator.js +1 -1
  226. package/geometry/operators/extendOperator.d.ts +29 -3
  227. package/geometry/operators/extendOperator.js +1 -1
  228. package/geometry/operators/generalizeOperator.d.ts +46 -5
  229. package/geometry/operators/generalizeOperator.js +1 -1
  230. package/geometry/operators/geodesicBufferOperator.d.ts +71 -7
  231. package/geometry/operators/geodesicBufferOperator.js +1 -1
  232. package/geometry/operators/geodesicProximityOperator.d.ts +106 -14
  233. package/geometry/operators/geodesicProximityOperator.js +1 -1
  234. package/geometry/operators/geodeticAreaOperator.d.ts +51 -5
  235. package/geometry/operators/geodeticAreaOperator.js +1 -1
  236. package/geometry/operators/geodeticDensifyOperator.d.ts +65 -6
  237. package/geometry/operators/geodeticDensifyOperator.js +1 -1
  238. package/geometry/operators/geodeticDistanceOperator.d.ts +52 -5
  239. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  240. package/geometry/operators/geodeticLengthOperator.d.ts +51 -5
  241. package/geometry/operators/geodeticLengthOperator.js +1 -1
  242. package/geometry/operators/geodeticUtilsOperator.d.ts +79 -9
  243. package/geometry/operators/geodeticUtilsOperator.js +1 -1
  244. package/geometry/operators/graphicBufferOperator.d.ts +47 -4
  245. package/geometry/operators/graphicBufferOperator.js +1 -1
  246. package/geometry/operators/integrateOperator.d.ts +24 -2
  247. package/geometry/operators/integrateOperator.js +1 -1
  248. package/geometry/operators/intersectionOperator.d.ts +88 -3
  249. package/geometry/operators/intersectionOperator.js +1 -1
  250. package/geometry/operators/intersectsOperator.d.ts +32 -2
  251. package/geometry/operators/intersectsOperator.js +1 -1
  252. package/geometry/operators/isNearOperator.d.ts +31 -4
  253. package/geometry/operators/isNearOperator.js +1 -1
  254. package/geometry/operators/json/bufferOperator.js +1 -1
  255. package/geometry/operators/json/containsOperator.js +1 -1
  256. package/geometry/operators/json/convexHullOperator.js +1 -1
  257. package/geometry/operators/json/crossesOperator.js +1 -1
  258. package/geometry/operators/json/disjointOperator.js +1 -1
  259. package/geometry/operators/json/generalizeOperator.js +1 -1
  260. package/geometry/operators/json/geodesicBufferOperator.js +1 -1
  261. package/geometry/operators/json/graphicBufferOperator.js +1 -1
  262. package/geometry/operators/json/intersectionOperator.js +1 -1
  263. package/geometry/operators/json/intersectsOperator.js +1 -1
  264. package/geometry/operators/json/lengthOperator.js +1 -1
  265. package/geometry/operators/json/offsetOperator.js +1 -1
  266. package/geometry/operators/json/overlapsOperator.js +1 -1
  267. package/geometry/operators/json/projectOperator.js +1 -1
  268. package/geometry/operators/json/simplifyOperator.js +1 -1
  269. package/geometry/operators/json/simplifyOperatorOGC.js +1 -1
  270. package/geometry/operators/json/touchesOperator.js +1 -1
  271. package/geometry/operators/json/unionOperator.js +1 -1
  272. package/geometry/operators/json/withinOperator.js +1 -1
  273. package/geometry/operators/labelPointOperator.d.ts +32 -2
  274. package/geometry/operators/labelPointOperator.js +1 -1
  275. package/geometry/operators/lengthOperator.d.ts +28 -4
  276. package/geometry/operators/lengthOperator.js +1 -1
  277. package/geometry/operators/linesToPolygonsOperator.d.ts +23 -2
  278. package/geometry/operators/linesToPolygonsOperator.js +1 -1
  279. package/geometry/operators/locateBetweenOperator.d.ts +28 -2
  280. package/geometry/operators/locateBetweenOperator.js +1 -1
  281. package/geometry/operators/minimumBoundingCircleOperator.d.ts +38 -4
  282. package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
  283. package/geometry/operators/multiPartToSinglePartOperator.d.ts +33 -4
  284. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  285. package/geometry/operators/offsetOperator.d.ts +50 -5
  286. package/geometry/operators/offsetOperator.js +1 -1
  287. package/geometry/operators/overlapsOperator.d.ts +33 -2
  288. package/geometry/operators/overlapsOperator.js +1 -1
  289. package/geometry/operators/polygonOverlayOperator.d.ts +31 -5
  290. package/geometry/operators/polygonOverlayOperator.js +1 -1
  291. package/geometry/operators/polygonSlicerOperator.d.ts +72 -10
  292. package/geometry/operators/polygonSlicerOperator.js +1 -1
  293. package/geometry/operators/projectOperator.d.ts +63 -3
  294. package/geometry/operators/projectOperator.js +1 -1
  295. package/geometry/operators/proximityOperator.d.ts +71 -9
  296. package/geometry/operators/proximityOperator.js +1 -1
  297. package/geometry/operators/relateOperator.d.ts +41 -2
  298. package/geometry/operators/relateOperator.js +1 -1
  299. package/geometry/operators/reshapeOperator.d.ts +28 -2
  300. package/geometry/operators/reshapeOperator.js +1 -1
  301. package/geometry/operators/shapePreservingProjectOperator.d.ts +64 -6
  302. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  303. package/geometry/operators/simplifyOGCOperator.d.ts +72 -6
  304. package/geometry/operators/simplifyOGCOperator.js +1 -1
  305. package/geometry/operators/simplifyOperator.d.ts +72 -4
  306. package/geometry/operators/simplifyOperator.js +1 -1
  307. package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
  308. package/geometry/operators/support/Transformation.d.ts +17 -11
  309. package/geometry/operators/support/jsonConverter.js +1 -1
  310. package/geometry/operators/symmetricDifferenceOperator.d.ts +33 -2
  311. package/geometry/operators/symmetricDifferenceOperator.js +1 -1
  312. package/geometry/operators/touchesOperator.d.ts +32 -2
  313. package/geometry/operators/touchesOperator.js +1 -1
  314. package/geometry/operators/types.d.ts +4 -1
  315. package/geometry/operators/unionOperator.d.ts +33 -2
  316. package/geometry/operators/unionOperator.js +1 -1
  317. package/geometry/operators/withinOperator.d.ts +32 -2
  318. package/geometry/operators/withinOperator.js +1 -1
  319. package/geometry/projectionUtils.js +1 -1
  320. package/geometry/support/geometryUtils.js +1 -1
  321. package/geometry/support/normalizeUtils.d.ts +5 -3
  322. package/geometry/support/normalizeUtils.js +1 -1
  323. package/interfaces.d.ts +202 -202
  324. package/kernel.js +1 -1
  325. package/layers/graphics/data/QueryEngineResult.js +1 -1
  326. package/layers/graphics/data/queryUtils.js +1 -1
  327. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  328. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  329. package/layers/list/Item.d.ts +27 -3
  330. package/layers/list/Item.js +1 -1
  331. package/layers/list/ItemPanel.d.ts +1 -1
  332. package/layers/list/LayerItemCollection.js +1 -1
  333. package/layers/mixins/ArcGISImageService.js +1 -1
  334. package/layers/mixins/TiledImagery.js +1 -1
  335. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  336. package/layers/raster/datasets/FunctionRaster.js +1 -1
  337. package/layers/raster/datasets/pixelReader.js +1 -1
  338. package/layers/raster/functions/clipUtils.js +1 -1
  339. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  340. package/layers/support/Sublayer.js +1 -1
  341. package/layers/support/trackInfoUtils.js +2 -0
  342. package/layers/video/videoUtils.js +1 -1
  343. package/package.json +5 -5
  344. package/popup/FeatureContentCollection.d.ts +3 -3
  345. package/popup/FeatureContentCollection.js +1 -1
  346. package/portal/schemas/definitions.js +1 -1
  347. package/portal/schemas/webScene.js +1 -1
  348. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  349. package/support/revision.js +1 -1
  350. package/support/tests/serviceMockDependencies.js +1 -1
  351. package/support/tests/setupServiceMocksMesh.js +1 -1
  352. package/symbols/cim/CIMEffects.js +1 -1
  353. package/symbols/cim/effects/EffectBuffer.js +1 -1
  354. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  355. package/symbols/cim/effects/EffectDonut.js +1 -1
  356. package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
  357. package/symbols/cim/effects/EffectOffset.js +1 -1
  358. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  359. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  360. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  361. package/views/2d/engine/webgl/Overlay.js +1 -1
  362. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  363. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  364. package/views/2d/layers/TileLayerView2D.js +1 -1
  365. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  366. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  367. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
  368. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  369. package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
  370. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  371. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  372. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  373. package/views/MapView.d.ts +3 -3
  374. package/views/SceneView.js +1 -1
  375. package/views/VideoView.js +1 -1
  376. package/views/View2D.d.ts +22 -22
  377. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  378. package/views/draw/DrawTool.js +1 -1
  379. package/views/draw/support/createUtils.js +1 -1
  380. package/views/layers/SceneLayerView.js +1 -1
  381. package/views/support/GeometryWorker.js +1 -1
  382. package/views/support/imageReprojection.js +1 -1
  383. package/views/video/VideoOperationalDataView.js +1 -1
  384. package/webscene/InitialViewProperties.d.ts +9 -1
  385. package/webscene/InitialViewProperties.js +1 -1
  386. package/webscene/Slide.d.ts +10 -1
  387. package/webscene/Slide.js +1 -1
  388. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  389. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  390. package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
  391. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  392. package/widgets/BatchAttributeForm/templates/FieldElementTemplate.js +1 -1
  393. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  394. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  395. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  396. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  397. package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
  398. package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
  399. package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
  400. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  401. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  402. package/widgets/Features/FeaturesViewModel.js +1 -1
  403. package/widgets/Features.js +1 -1
  404. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  405. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  406. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  407. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  408. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  409. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  410. package/widgets/OrientedImageryViewer/support/panConstraint.js +1 -1
  411. package/widgets/OrientedImageryViewer/support/superimposeUtils.js +1 -1
  412. package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
  413. package/widgets/Print.js +1 -1
  414. package/widgets/Search/SearchViewModel.js +1 -1
  415. package/widgets/Search/support/layerSearchUtils.js +1 -1
  416. package/widgets/Search/support/locatorUtils.js +1 -1
  417. package/widgets/UtilityNetworkTrace/support/GeometryHandler.js +1 -1
  418. package/widgets/support/FilterBuilder/FilterBuilderViewModel.d.ts +104 -0
  419. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  420. package/widgets/support/FilterBuilder.js +1 -1
  421. package/widgets/support/FilterCondition/FilterConditionViewModel.d.ts +145 -0
  422. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  423. package/widgets/support/FilterCondition/types.d.ts +20 -0
  424. package/widgets/support/ItemList.js +1 -1
  425. package/widgets/support/SelectionList/FeatureItem.d.ts +17 -68
  426. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  427. package/widgets/support/SelectionList/GroupLayerItem.d.ts +12 -50
  428. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  429. package/widgets/support/SelectionList/ItemBase.d.ts +14 -44
  430. package/widgets/support/SelectionList/ItemBase.js +1 -1
  431. package/widgets/support/SelectionList/LayerItem.d.ts +10 -56
  432. package/widgets/support/SelectionList/LayerItem.js +1 -1
  433. package/widgets/support/SelectionList/types.d.ts +4 -4
  434. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  435. package/assets/esri/core/workers/chunks/090ea7a131f8f60203ed.js +0 -1
  436. package/assets/esri/core/workers/chunks/0b4a7209b99227a842ad.js +0 -1
  437. package/assets/esri/core/workers/chunks/0be98adfef79fc5036f0.js +0 -1
  438. package/assets/esri/core/workers/chunks/0d2e2d90a4e4a28e2c0c.js +0 -1
  439. package/assets/esri/core/workers/chunks/0d7763d39a5a8586a0ae.js +0 -1
  440. package/assets/esri/core/workers/chunks/0d95f72e1c07ab867d21.js +0 -1
  441. package/assets/esri/core/workers/chunks/0dbbac7a2378728571a7.js +0 -1
  442. package/assets/esri/core/workers/chunks/0df9864ecebe6a2b973f.js +0 -1
  443. package/assets/esri/core/workers/chunks/104d74bc36c28c519396.js +0 -1
  444. package/assets/esri/core/workers/chunks/1670e9867efde4d7a6d6.js +0 -1
  445. package/assets/esri/core/workers/chunks/1c803eef9a8fdabc61e3.js +0 -2
  446. package/assets/esri/core/workers/chunks/1e192ac0533a5c0b5a7a.js +0 -1
  447. package/assets/esri/core/workers/chunks/1fe077f57a087c0e9119.js +0 -1
  448. package/assets/esri/core/workers/chunks/20f7b5fe64a217cb3d3d.js +0 -1
  449. package/assets/esri/core/workers/chunks/212222b64039d436b9a6.js +0 -1
  450. package/assets/esri/core/workers/chunks/24944b625ed8dcd904f0.js +0 -1
  451. package/assets/esri/core/workers/chunks/2b6d261fe79fe186fb22.js +0 -1
  452. package/assets/esri/core/workers/chunks/2bc3e7f394386fa75447.js +0 -1
  453. package/assets/esri/core/workers/chunks/30af0f7c4cfa541c9efd.js +0 -1
  454. package/assets/esri/core/workers/chunks/30d816bdeea00f6fa1ca.js +0 -1
  455. package/assets/esri/core/workers/chunks/35d46c2f658a8e92d913.js +0 -1
  456. package/assets/esri/core/workers/chunks/36e35a8067b18f59cc05.js +0 -1
  457. package/assets/esri/core/workers/chunks/3869dca884d7ca6488f5.js +0 -1
  458. package/assets/esri/core/workers/chunks/3f5234120d3a14186c1c.js +0 -1
  459. package/assets/esri/core/workers/chunks/45c1c90ac6c14657f3ff.js +0 -1
  460. package/assets/esri/core/workers/chunks/4a40b894ec89b0a4f9bf.js +0 -1
  461. package/assets/esri/core/workers/chunks/5165d367328ac7badf47.js +0 -1
  462. package/assets/esri/core/workers/chunks/5168bd8ab6233dc9c32a.js +0 -1
  463. package/assets/esri/core/workers/chunks/545bec045167c433af8f.js +0 -1
  464. package/assets/esri/core/workers/chunks/5782c0362a1799ceef41.js +0 -1
  465. package/assets/esri/core/workers/chunks/59598023c0aea62a6297.js +0 -1
  466. package/assets/esri/core/workers/chunks/59f0a2bd40b033ce77e4.js +0 -1
  467. package/assets/esri/core/workers/chunks/5af16937904c06fb06f6.js +0 -1
  468. package/assets/esri/core/workers/chunks/5b8591486f33627f5389.js +0 -1
  469. package/assets/esri/core/workers/chunks/6057a79c68c33ee4a193.js +0 -1
  470. package/assets/esri/core/workers/chunks/607acd9f615f87e14075.js +0 -1
  471. package/assets/esri/core/workers/chunks/62ee6c247f783acabb74.js +0 -1
  472. package/assets/esri/core/workers/chunks/63127e3b22e7eac6003d.js +0 -2
  473. package/assets/esri/core/workers/chunks/6564f17c4700dc8d9c0e.js +0 -2
  474. package/assets/esri/core/workers/chunks/678585509706755c0434.js +0 -2
  475. package/assets/esri/core/workers/chunks/691e9cc541cfaebe1776.js +0 -1
  476. package/assets/esri/core/workers/chunks/6a2d890640b2cd6c5ccb.js +0 -1
  477. package/assets/esri/core/workers/chunks/6b84982dfaf084a61b93.js +0 -1
  478. package/assets/esri/core/workers/chunks/6cbc30b31f0bb39c73ca.js +0 -1
  479. package/assets/esri/core/workers/chunks/6f01bd01b13662eb3bd7.js +0 -1
  480. package/assets/esri/core/workers/chunks/74cd9df85c4560bb8e52.js +0 -1
  481. package/assets/esri/core/workers/chunks/75bddfe2be64379db8fd.js +0 -1
  482. package/assets/esri/core/workers/chunks/7cf903db44f3647c8fd4.js +0 -1
  483. package/assets/esri/core/workers/chunks/7ddb5800777fbecee3a8.js +0 -1
  484. package/assets/esri/core/workers/chunks/7eae9053065d3d38e54e.js +0 -1
  485. package/assets/esri/core/workers/chunks/80f38ab2b7ae61e6f301.js +0 -1
  486. package/assets/esri/core/workers/chunks/854f42f16fdb40000aae.js +0 -1
  487. package/assets/esri/core/workers/chunks/87094044458b0ea5cb0f.js +0 -2
  488. package/assets/esri/core/workers/chunks/88f03352a4dc6184ea1f.js +0 -1
  489. package/assets/esri/core/workers/chunks/909ee7d2a0eec773037a.js +0 -1
  490. package/assets/esri/core/workers/chunks/91ac9328afff8a51bd96.js +0 -1
  491. package/assets/esri/core/workers/chunks/92a6559a6999b26362d7.js +0 -1
  492. package/assets/esri/core/workers/chunks/94ddfe165ac25aef8229.js +0 -1
  493. package/assets/esri/core/workers/chunks/9509bef285929c52c244.js +0 -1
  494. package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +0 -1
  495. package/assets/esri/core/workers/chunks/99f627938dbf0152fc02.js +0 -1
  496. package/assets/esri/core/workers/chunks/9df38cadebf8e6fd746c.js +0 -1
  497. package/assets/esri/core/workers/chunks/9e2b3754a76e0dd4a94a.js +0 -1
  498. package/assets/esri/core/workers/chunks/a0565137027c83108953.js +0 -1
  499. package/assets/esri/core/workers/chunks/a0eb882a5a81d25b9153.js +0 -1
  500. package/assets/esri/core/workers/chunks/a785e827f0215a73103d.js +0 -1
  501. package/assets/esri/core/workers/chunks/abe7670db06b27c0c8c8.js +0 -1
  502. package/assets/esri/core/workers/chunks/b19cff0e43fab2632660.js +0 -1
  503. package/assets/esri/core/workers/chunks/b333de4dea14c5db0a4d.js +0 -1
  504. package/assets/esri/core/workers/chunks/b6af90be328ebda26b8d.js +0 -1
  505. package/assets/esri/core/workers/chunks/b7c0da9d255d5e48320d.js +0 -1
  506. package/assets/esri/core/workers/chunks/bd7d87d175ba933ab2ce.js +0 -1
  507. package/assets/esri/core/workers/chunks/be0417df35a7d99af675.js +0 -1
  508. package/assets/esri/core/workers/chunks/c30b6bbabd05e4976fba.js +0 -1
  509. package/assets/esri/core/workers/chunks/c35553d07ad169910742.js +0 -1
  510. package/assets/esri/core/workers/chunks/c5c2fed38e0ccf84f1fa.js +0 -1
  511. package/assets/esri/core/workers/chunks/c88bfa51d2a8a024fc24.js +0 -1
  512. package/assets/esri/core/workers/chunks/ca36d85a47179d95f2fc.js +0 -1
  513. package/assets/esri/core/workers/chunks/d0cf9ff48f051adbd455.js +0 -1
  514. package/assets/esri/core/workers/chunks/d1304d414b1fa725168a.js +0 -1
  515. package/assets/esri/core/workers/chunks/d24125a791247019e2ca.js +0 -1
  516. package/assets/esri/core/workers/chunks/d26be8313526ecea9c68.js +0 -1
  517. package/assets/esri/core/workers/chunks/d2cb3d5ef0a9285afb78.js +0 -1
  518. package/assets/esri/core/workers/chunks/d4b0012ae1d3b8a9ba01.js +0 -1
  519. package/assets/esri/core/workers/chunks/e018cbd97e6e0e4ca5c4.js +0 -1
  520. package/assets/esri/core/workers/chunks/e39bccc000c768120a32.js +0 -1
  521. package/assets/esri/core/workers/chunks/e4380706b629729f2212.js +0 -1
  522. package/assets/esri/core/workers/chunks/ea1877ce00da3b585a30.js +0 -1
  523. package/assets/esri/core/workers/chunks/ea5ee1b12b43594592a0.js +0 -1
  524. package/assets/esri/core/workers/chunks/ea91c57a0b31f3f65ee5.js +0 -1
  525. package/assets/esri/core/workers/chunks/eafc591e1a98000d54ef.js +0 -1
  526. package/assets/esri/core/workers/chunks/ef851a2cff76fd211c07.js +0 -1
  527. package/assets/esri/core/workers/chunks/f3e53be08ab9dbdf17ae.js +0 -1
  528. package/assets/esri/core/workers/chunks/f53010adb70463b75bb9.js +0 -1
  529. package/assets/esri/core/workers/chunks/f5a058a0ce006bce2a2a.js +0 -1
  530. package/assets/esri/core/workers/chunks/f5f5b54cab722abe88e0.js +0 -1
  531. package/assets/esri/core/workers/chunks/f60ed579981913d44675.js +0 -1
  532. package/assets/esri/core/workers/chunks/f6f56f3e011dcef90bbb.js +0 -1
  533. package/assets/esri/core/workers/chunks/f83c3597e9332bd991eb.js +0 -1
  534. package/assets/esri/core/workers/chunks/f9a4387f850d85c44ca5.js +0 -1
  535. package/assets/esri/core/workers/chunks/fdd0e6d9927d3c43b0d3.js +0 -1
  536. package/geometry/operators/importUtils.js +0 -2
  537. /package/assets/esri/core/workers/chunks/{1c803eef9a8fdabc61e3.js.LICENSE.txt → 1082bb0858585bd4fa21.js.LICENSE.txt} +0 -0
  538. /package/assets/esri/core/workers/chunks/{87094044458b0ea5cb0f.js.LICENSE.txt → 2e2349387a2b9903f13c.js.LICENSE.txt} +0 -0
  539. /package/assets/esri/core/workers/chunks/{678585509706755c0434.js.LICENSE.txt → 411bbdecba340df11d95.js.LICENSE.txt} +0 -0
  540. /package/assets/esri/core/workers/chunks/{5edf77618ca51819d7c4.js.LICENSE.txt → 476535cfb06ced74d611.js.LICENSE.txt} +0 -0
  541. /package/assets/esri/core/workers/chunks/{6564f17c4700dc8d9c0e.js.LICENSE.txt → b82b523b6837ed1f28d3.js.LICENSE.txt} +0 -0
  542. /package/assets/esri/core/workers/chunks/{63127e3b22e7eac6003d.js.LICENSE.txt → ef24fd6c0322e5de9fdf.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{schema_definitions as e}from"./definitions.js";const i={title:"Webscene",type:"object",description:"The web scene data lists the basemap, operational layers, and presentation slides to be used in the web scene. It also contains information about pop-up windows and layer styling overrides to be used in the web scene. A version property allows you to supply the version of the web scene JSON format being used.",properties:{applicationProperties:{$ref:"#/definitions/applicationProperties_schema.json"},authoringApp:{type:"string",description:"String value indicating the application which authored the webmap"},authoringAppVersion:{type:"string",description:"String value indicating the authoring App's version number."},baseMap:{description:"Basemaps give the web scene a geographic context.",$ref:"#/definitions/baseMap_schema.json"},clippingArea:{$ref:"#/definitions/clippingArea_schema.json"},focusAreas:{$ref:"#/definitions/focusAreas_schema.json"},ground:{$ref:"#/definitions/ground_schema.json"},heightModelInfo:{$ref:"#/definitions/heightModelInfo_schema.json"},initialState:{$ref:"#/definitions/initialState_schema.json"},mapFloorInfo:{$ref:"#/definitions/mapFloorInfo_schema.json"},mapRangeInfo:{description:"Map Range Information",$ref:"#/definitions/mapRangeInfo_schema.json"},operationalLayers:{type:"array",description:"Operational layers contain business data which are used to make thematic scenes.",items:{$ref:"#/definitions/operationalLayers_schema.json"},uniqueItems:!0},presentation:{$ref:"#/definitions/presentation_schema.json"},spatialReference:{description:"An object used to specify the spatial reference of the given geometry.",$ref:"#/definitions/spatialReference_schema.json"},tables:{type:"array",description:"An array of table objects.",items:{$ref:"#/definitions/table_schema.json"}},transportationNetworks:{type:"array",description:"Used to specify the transportation networks of the scene.",items:{$ref:"#/definitions/transportationNetwork_schema.json"}},version:{$ref:"#/definitions/version_schema.json"},viewingMode:{type:"string",enum:["global","local"]},widgets:{description:"the widgets object contains widgets that should be exposed to the user.",$ref:"#/definitions/widgets_schema.json"}},required:["ground","operationalLayers","spatialReference","version","viewingMode"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
2
+ import{schema_definitions as e}from"./definitions.js";const i={title:"Webscene",type:"object",description:"The web scene data lists the basemap, operational layers, and presentation slides to be used in the web scene. It also contains information about pop-up windows and layer styling overrides to be used in the web scene. A version property allows you to supply the version of the web scene JSON format being used.",properties:{applicationProperties:{$ref:"#/definitions/applicationProperties_schema.json"},authoringApp:{type:"string",description:"String value indicating the application which authored the webmap"},authoringAppVersion:{type:"string",description:"String value indicating the authoring App's version number."},baseMap:{description:"Basemaps give the web scene a geographic context.",$ref:"#/definitions/baseMap_schema.json"},clippingArea:{$ref:"#/definitions/clippingArea_schema.json"},focusAreas:{$ref:"#/definitions/focusAreas_schema.json"},ground:{$ref:"#/definitions/ground_schema.json"},heightModelInfo:{$ref:"#/definitions/heightModelInfo_schema.json"},initialState:{$ref:"#/definitions/initialState_schema.json"},mapFloorInfo:{$ref:"#/definitions/mapFloorInfo_schema.json"},mapRangeInfo:{description:"Map Range Information",$ref:"#/definitions/mapRangeInfo_schema.json"},operationalLayers:{type:"array",description:"Operational layers contain business data which are used to make thematic scenes.",items:{$ref:"#/definitions/operationalLayers_schema.json"},uniqueItems:!0},presentation:{$ref:"#/definitions/presentation_schema.json"},spatialReference:{description:"An object used to specify the spatial reference of the given geometry.",$ref:"#/definitions/spatialReference_schema.json"},tables:{type:"array",description:"An array of table objects.",items:{$ref:"#/definitions/table_schema.json"}},timeZone:{$ref:"#/definitions/timeZone_schema.json"},transportationNetworks:{type:"array",description:"Used to specify the transportation networks of the scene.",items:{$ref:"#/definitions/transportationNetwork_schema.json"}},version:{$ref:"#/definitions/version_schema.json"},viewingMode:{type:"string",enum:["global","local"]},widgets:{description:"the widgets object contains widgets that should be exposed to the user.",$ref:"#/definitions/widgets_schema.json"}},required:["ground","operationalLayers","spatialReference","version","viewingMode"],additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import f from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as c}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:f}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=f),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const t=await(import("../../../geometry/operators/intersectionOperator.js"));r=e.filter(({geometry:e})=>!(!e||!t.execute(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let f=e.returnGeometry;if(null==f&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),f=e}let c=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;c=await a.whenLayerView(e),d=null!=p&&null!=c&&p in c&&"function"==typeof c[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(c);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,c).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),c.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:f,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:c,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const f=await n.queryAttributeBins(m,{signal:a});return M(f,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new f({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=c(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const f=await i.whenLayerView(this.layer);if(b(this,o,f).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const c=await this._fetchFeaturesFromMemory(f,p,m,a),d=null!=s&&s>0&&s<=c.length?s:c.length;return t(c,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
2
+ import{__decorate as e}from"tslib";import{pickRandom as t}from"../../../core/arrayUtils.js";import r from"../../../core/Error.js";import a from"../../../core/Logger.js";import{assertIsSome as i}from"../../../core/maybe.js";import{timeout as s,throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as n}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{toQuantizationTransform as m}from"../../../geometry/support/quantizationUtils.js";import{kebabDict as p}from"../../../layers/support/fieldType.js";import{isTimeOnlyField as y}from"../../../layers/support/fieldUtils.js";import c from"../../../rest/support/QuantizationParameters.js";import{getArcadeForPredominantCategory as f}from"../../statistics/support/predominanceUtils.js";import{summaryStatistics as d,uniqueValues as h,histogram as w,classBreaks as g,heatmapStatistics as F}from"../../statistics/support/statsWorker.js";import{mergeWhereClauses as S}from"../../statistics/support/utils.js";import{WorkerClient as q}from"../../statistics/support/WorkerClient.js";import{getFieldsList as v,isAnyDateField as x,getFieldsFromWhereClauses as V,fieldDelimiter as _}from"../utils.js";import z from"./LayerAdapter.js";import{getHistogramAttributeDefinition as T,getAttributeBinsQuery as N,processQueryAttributeBinsResult as M}from"./support/histogramUtils.js";import{ensureFeaturesJSON as L,getSummaryStatsQuery as E,getSummaryStatisticsFromFeatureSet as C,getViewInfoParams as j,getMissingFields as b,updateQueryWithFeatureFilter as I,getUVQuery as k,getUniqueValuesFromFeatureSet as O,getBins as Q,getDomainsForFields as J,getPredominantCategoriesFromUVInfos as B}from"./support/utils.js";import{processSummaryStatisticsResult as P,createUVResult as U,resolveCBResult as A}from"../../../statistics/utils.js";import{loadArcade as $}from"../../../support/loadArcade.js";const G=5;let R,D=class extends z{constructor(){super(...arguments),this._hasLocalSource=!1,this.adapterName="in-memory-layer-adapter"}destroy(){this.workerClient?.destroy()}async _waitForLayerViewUpdate(e){if(!e)throw new r(`${this.adapterName}:insufficient-data`,"layerView is required to fetch the features");const t=new AbortController,i=n(()=>!e.updating,t.signal);await s(i,5e3,t).catch(e=>{throw a.getLogger(this).warn("LayerView is taking too long to update. Aborting fetch from layerView."),e})}async _fetchFeatureSetFromMemory(e,t,a){const i=this.layer;if(this._hasLocalSource&&"queryFeatures"in i)return i.queryFeatures(e);if(!t)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=await t.whenLayerView(this.layer);return await this._waitForLayerViewUpdate(s),s.queryFeatures(e,{signal:a})}async _fetchFeaturesFromMemory(e,t,a,i){const s=this.layer,o="json"===i;if(this._hasLocalSource&&"queryFeatures"in s){const e=await s.queryFeatures(t);return o?L(e.features):e.features}if(await this._waitForLayerViewUpdate(e),o&&"queryFeaturesJSON"in e&&e.queryFeaturesJSON){const{features:r}=await e.queryFeaturesJSON(t,{signal:a});return r}if(!("queryFeatures"in e))throw new r(`${this.adapterName}:not-supported`,"'queryFeatures' is not supported on the layerView");const n=await e.queryFeatures(t,{signal:a});return o?L(n.features):n.features}_fetchFeaturesForStats(e,t){return v({field:e.field,field2:e.field2,field3:e.field3,normalizationField:e.normalizationField,valueExpression:e.valueExpression,fields:e.fields}).then(r=>this.getSampleFeatures({sampleSize:-1,view:e.view,returnGeometry:e.returnGeometry,filter:e.filter,requiredFields:r,sqlWhere:e.sqlWhere,signal:e.signal},t))}async _summaryStatsFromClientQuery(e,t){const{view:r,signal:a}=e,i=E(this,e,t),s=await this._fetchFeatureSetFromMemory(i,r,a),o=C(s,x(t)||y(t));return P(o,e.outStatisticTypes)}async _getNormalizationTotalFromMemory(e,t,a){const{featuresJSON:i,graphics:s,layerView:o,query:n}=t,l={include:["sum"]},u=(!i&&!s&&o&&"querySummaryStatistics"in o?await o.querySummaryStatistics(n,{field:e},{signal:a}):i?await this.workerClient.summaryStatistics({field:e,outStatisticTypes:l},i):await d({attribute:{field:e,outStatisticTypes:l},features:s??[]})).sum;if(null==u)throw new r(`${this.adapterName}:invalid`,"invalid normalizationTotal");return u}async _summaryStatsFromMemory(e,t){const{view:r,field:a,valueExpression:i,normalizationType:s,signal:o}=e,n={field:a,valueExpression:i,normalizationType:s,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,outStatisticTypes:e.outStatisticTypes},{featuresJSON:l,graphics:u,layerView:m,query:y,fieldInfos:c}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"querySummaryStatistics"});return i&&r&&(l||u)&&(n.fieldType=t?.type?p.toJSON(t.type):null,n.viewInfoParams=j(r),n.timeZone=r.timeZone,n.fieldInfos=c),"percent-of-total"===s&&null==e.normalizationTotal&&(n.normalizationTotal=await this._getNormalizationTotalFromMemory(a,{featuresJSON:l,graphics:u,layerView:m,query:y},o)),!l&&!u&&m&&"querySummaryStatistics"in m?m.querySummaryStatistics(y,n,{signal:o}):l?this.workerClient.summaryStatistics(n,l):d({attribute:n,features:u})}async _getFilteredFeatures(e,t){let r=e;const a=t?.geometry;if("intersects"===t?.spatialRelationship&&a){const{intersectionExecute:t}=await(import("../../../geometry/operators/intersectionOperator.js"));r=e.filter(({geometry:e})=>!(!e||!t(e,a)))}return e.length&&"declaredClass"in e[0]&&"esri.Graphic"===e[0].declaredClass?{graphics:r}:{featuresJSON:r}}async _processStatsFromMemoryParams(e){const{features:t,filter:r}=e;if(t?.length)return this._getFilteredFeatures(t,r);const{view:a,field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,sqlExpression:u,sqlWhere:m,layerViewFunc:p,signal:y}=e;let c=e.returnGeometry;if(null==c&&l){if(!R){const{arcadeUtils:e}=await $();R=e}const e=R.hasGeometryOperations(l);e&&await R.enableGeometryOperations(),c=e}let f=null,d=null,h=null,w=null,g=null;if(a)try{const e="subtype-sublayer"===this.layer.type?this.layer.parent:this.layer;f=await a.whenLayerView(e),d=null!=p&&null!=f&&p in f&&"function"==typeof f[p]}catch{d=!1}if(d)try{await this._waitForLayerViewUpdate(f);const e=await v({field:i,field2:s,field3:o,normalizationField:n,valueExpression:l,fields:await V([u,m],this.layer.fieldsIndex)});b(this,e,f).length?d=!1:(h=this.layer.createQuery(),h.outFields=e,h.returnGeometry=!1,h.where=S(h.where,m),I(h,r)),f.suspended&&(d=!1)}catch{d=!1}return d||(w=await this._fetchFeaturesForStats({field:i,field2:s,field3:o,fields:await V([u,m],this.layer.fieldsIndex),valueExpression:l,normalizationField:n,returnGeometry:c,filter:r,sqlWhere:m,view:a,signal:y},"json"),g=(await v({valueExpression:l})).map(e=>this.getField(e)?.toJSON()).filter(Boolean)),{layerView:f,query:h,featuresJSON:w,fieldInfos:g}}async _uvFromClientQuery(e,t){const{view:r,signal:a}=e,i=k(this,e),s=await this._fetchFeatureSetFromMemory(i,r,a),o=await O(s,{layer:this,field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:_,view:e.view,signal:e.signal});return U(o,t,e.returnAllCodedValues,_)}async _uvFromMemory(e,t){const{view:r,field:a,valueExpression:i,returnAllCodedValues:s,signal:o}=e,{featuresJSON:n,graphics:l,layerView:u,query:m,fieldInfos:p}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryUniqueValues"}),y={field:a,field2:e.field2,field3:e.field3,fieldDelimiter:_,valueExpression:i,domains:t,returnAllCodedValues:s};return i&&r&&(n||l)&&(y.viewInfoParams=j(r),y.timeZone=r.timeZone,y.fieldInfos=p),!n&&!l&&u&&"queryUniqueValues"in u?u.queryUniqueValues(m,y,{signal:o}):n?this.workerClient.uniqueValues(y,n):h({attribute:y,features:l})}_histogramForField(e){let t=null;return t=null!=e.minValue&&null!=e.maxValue?Promise.resolve({min:e.minValue,max:e.maxValue}):this.summaryStatistics({...e,outStatisticTypes:{include:["min","max","count"]}}).then(e=>{if(!e.count)throw new r(`${this.adapterName}:insufficient-data`,"Either the layer has no features or none of the features have data for the field");return{min:e.min,max:e.max}}),t.then(t=>Q(this,{min:t.min,max:t.max},e.field,e.numBins??void 0,e.view,e.filter,e.signal))}async _histogramFromQueryAttributeBinsFromMemory(e){const{field:t,normalizationType:r,signal:a}=e,i=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryAttributeBins"}),{featuresJSON:s,graphics:o,layerView:n,query:l}=i,u="percent-of-total"===r?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,i,a):void 0;if(!n||!("queryAttributeBins"in n)||s||o){const t=T(e,i,u);return s?this.workerClient.histogram(t,s):w({attribute:t,features:o})}const{query:m,min:p,max:y}=await N(e,this,u,l);if(!m)return{bins:[],minValue:p,maxValue:y,normalizationTotal:u};const c=await n.queryAttributeBins(m,{signal:a});return M(c,t?this.getField(t):null,{minValue:p,maxValue:y,normalizationTotal:u})}async _histogramFromMemory(e){const{field:t,signal:r}=e,a=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryHistogram"}),{featuresJSON:i,graphics:s,layerView:o,query:n}=a,l="percent-of-total"===e.normalizationType?e.normalizationTotal??await this._getNormalizationTotalFromMemory(t,a,r):void 0,u=T(e,a,l);return!i&&!s&&o&&"queryHistogram"in o?o.queryHistogram(n,u,{signal:r}):i?this.workerClient.histogram(u,i):w({attribute:u,features:s})}_classBreaksFromInterpolation(e){const{minValue:t,maxValue:r}=e,a=e.numClasses||G,i=[],s=(r-t)/a;for(let l=0;l<a;l++){const e=t+l*s;i.push({minValue:e,maxValue:e+s})}i[a-1].maxValue=r;const o={classBreaks:i,normalizationTotal:e.normalizationTotal},n=A(o,e.classificationMethod);return Promise.resolve(n)}async _classBreaksFromMemory(e){const{view:t,field:r,valueExpression:a,signal:i}=e,{featuresJSON:s,graphics:o,layerView:n,query:l,fieldInfos:u}=await this._processStatsFromMemoryParams({...e,layerViewFunc:"queryClassBreaks"}),m={field:r,valueExpression:a,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numClasses:e.numClasses};return a&&t&&(s||o)&&(m.viewInfoParams=j(t),m.timeZone=t.timeZone,m.fieldInfos=u),"percent-of-total"===e.normalizationType&&null==e.normalizationTotal&&(m.normalizationTotal=await this._getNormalizationTotalFromMemory(r,{featuresJSON:s,graphics:o,layerView:n,query:l},i)),!s&&!o&&n&&"queryClassBreaks"in n?n.queryClassBreaks(l,m,{signal:i}):s?this.workerClient.classBreaks(m,s):g({attribute:m,features:o})}async _heatmapStatsFromMemory(e){const{view:t,field:r,radius:a,signal:s}=e;i(t,"InMemoryLayerAdapter: must have a view");try{const r=await t.whenLayerView(this.layer);if("queryHeatmapStatistics"in r&&!r.updating&&!e.filter)return await r.queryHeatmapStatistics({field:e.field,radius:e.radius})}catch{o(s)}const{featuresJSON:n,graphics:l}=await this._processStatsFromMemoryParams({...e,returnGeometry:!0}),u=new c({extent:t.extent,tolerance:"2d"===t.type?t.state.resolution:t.pixelSizeAt?.(t.center)}),p={field:r,radius:a,transform:m(u),spatialReference:t.spatialReference?.toJSON(),size:t.size};return n?.length||l?.length?n?this.workerClient.heatmapStatistics(p,n):F({attribute:p,features:l}):{min:null,max:null}}getField(e=""){return this.layer.getField(e)}getFieldUsageInfo(e){return this.getField(e)?{supportsLabelingInfo:!0,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:!0,supportsStatistics:!0}:null}getFieldDomain(e,t){return this.layer.getFieldDomain(e,t)}createQuery(){return this.layer.createQuery()}async summaryStatistics(e){const{field:t,valueExpression:a,sqlExpression:i,features:s,view:o}=e,n=t?this.getField(t):null,l=!!a,u="3d"===o?.type;if(!a&&i&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return l||s||u?this._summaryStatsFromMemory(e,n):this._summaryStatsFromClientQuery(e,n)}async uniqueValues(e){const{valueExpression:t,sqlExpression:a,features:i,view:s}=e,o=await J(e,this),n=!!t,l="3d"===s?.type;if(!t&&a&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return n||i||l?this._uvFromMemory(e,o):this._uvFromClientQuery(e,o)}async histogram(e){const{features:t,valueExpression:a,normalizationType:i,sqlExpression:s}=e,o=t||!!a;if(!a&&s&&!this.supportsSQLExpression)throw new r(`${this.adapterName}:not-supported`,"Layer does not support standardized SQL expression for queries");return o||i?this._histogramFromMemory(e):this._histogramForField(e)}async classBreaks(e){return!1!==e.analyzeData?this._classBreaksFromMemory(e):this._classBreaksFromInterpolation(e)}async queryFeatureCount(e){const{whereClause:t,view:a,signal:i}=e;if(!a)throw new r(`${this.adapterName}:insufficient-data`,"view is required to fetch the features from layerView");const s=this.layer.createQuery();s.where=S(s.where,t);const o=await a.whenLayerView(this.layer);return await n(()=>!o.updating,i),o.queryFeatureCount(s,{signal:i})}async generateRenderer(e,t){throw new r(`${this.adapterName}:not-supported`,"Layer does not support generateRenderer operation")}async predominantCategories(e){const{fields:t,view:r,signal:a,filter:i}=e,s=f(t),o=await this._uvFromMemory({valueExpression:s,view:r,signal:a,filter:i});return B(o.uniqueValueInfos,t)}async heatmapStatistics(e){return this._heatmapStatsFromMemory(e)}async getSampleFeatures(e,a){const{view:i,sampleSize:s,requiredFields:o,returnGeometry:n,sqlWhere:l,filter:u,signal:m}=e,p=this.layer.createQuery(),y=1;if(p.outSpatialReference=i?.spatialReference,p.returnGeometry=!!n,p.outFields=o,p.where=S(p.where,l),I(p,u),!i)throw new r(`${this.adapterName}:not-supported`,"view is required to get sample features for Layer");const c=await i.whenLayerView(this.layer);if(b(this,o,c).length)throw new r(`${this.adapterName}:not-supported`,"Required fields need to be passed in the outFields for Layer");const f=await this._fetchFeaturesFromMemory(c,p,m,a),d=null!=s&&s>0&&s<=f.length?s:f.length;return t(f,d,y)}load(e){const t=this.layer.load(e).then(async t=>{this.geometryType=t.geometryType,this.objectIdField=t.objectIdField,this.supportsSQLExpression="stream"===t.type||!!t.capabilities?.query?.supportsSqlExpression,this.minScale=t.minScale,this.maxScale=t.maxScale,this.fullExtent="fullExtent"in t?t.fullExtent:t.parent?.fullExtent,this._hasLocalSource=!1,this.hasQueryEngine=!0,this.workerClient=q.getInstance(),await this.workerClient.open(e.signal)});return this.addResolvingPromise(t),Promise.resolve(this)}};e([l({readOnly:!0})],D.prototype,"adapterName",void 0),e([l({constructOnly:!0})],D.prototype,"layer",void 0),D=e([u("esri.smartMapping.support.adapters.InMemoryLayerAdapter")],D);export{D as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e="20260902",c="c36997bd6a7ed9d9fc3e7108721d1b7c392e0e26";export{e as buildDate,c as revision};
2
+ const e="20260903",d="2f7fe4370d2629a3bfeb0567d89a796eede6e1d5";export{e as buildDate,d as revision};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{execute as s}from"../../geometry/operators/containsOperator.js";import{execute as n}from"../../geometry/operators/crossesOperator.js";import{execute as m}from"../../geometry/operators/generalizeOperator.js";import{execute as a,accelerateGeometry as i}from"../../geometry/operators/intersectsOperator.js";import{execute as p}from"../../geometry/operators/overlapsOperator.js";import{execute as c}from"../../geometry/operators/touchesOperator.js";import{execute as u}from"../../geometry/operators/withinOperator.js";import{getGeometryExtent as y}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as g}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import x from"../../layers/support/FieldsIndex.js";function O(){const O=new WeakMap,d=new WeakMap;function v(e,r){const t=O.get(e);if(t)return t;const s=f(e);return s.spatialReference=r instanceof o?r:o.fromJSON(r),O.set(e,s),i(s),s}function b(e,r,t){return!e||G(r,t)?e:w(e,r,t)?.toJSON()}function w(e,r,s){if(!e)return;const n=d.get(e);if(n&&G(n.spatialReference,s))return n.geometry;const m=!G(r,s),a=m?t(v(e,r),o.fromJSON(s),{zConversionDisabled:!0}):v(e,r);return m&&i(a),d.set(e,{spatialReference:s,geometry:a}),a}function F(e,r,t,o){return{aGeometry:v(e,r),bGeometry:w(t,o,r)}}return{sql:{async createTestFeature(r,t){const o=await e(r,new x(t));return e=>o.testFeature(e)}},projection:{load:r,project:b},geometry:{isGeographic:j,quantize:(e,r)=>g(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=F(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return p(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=F(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=F(e,r,t,o);return u(s,n)},generalize(e,r,t,o){const s=m(v(e,r),t,{removeDegenerateParts:o});return s?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>y(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)}}}}export{O as getServiceMockDependencies};
2
+ import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{containsExecute as s}from"../../geometry/operators/containsOperator.js";import{crossesExecute as n}from"../../geometry/operators/crossesOperator.js";import{generalizeExecute as m}from"../../geometry/operators/generalizeOperator.js";import{intersectsExecute as a,intersectsAccelerateGeometry as i}from"../../geometry/operators/intersectsOperator.js";import{overlapsExecute as p}from"../../geometry/operators/overlapsOperator.js";import{touchesExecute as c}from"../../geometry/operators/touchesOperator.js";import{withinExecute as u}from"../../geometry/operators/withinOperator.js";import{getGeometryExtent as y}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as g}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import O from"../../layers/support/FieldsIndex.js";function d(){const d=new WeakMap,v=new WeakMap;function b(e,r){const t=d.get(e);if(t)return t;const s=f(e);return s.spatialReference=r instanceof o?r:o.fromJSON(r),d.set(e,s),i(s),s}function w(e,r,t){return!e||G(r,t)?e:F(e,r,t)?.toJSON()}function F(e,r,s){if(!e)return;const n=v.get(e);if(n&&G(n.spatialReference,s))return n.geometry;const m=!G(r,s),a=m?t(b(e,r),o.fromJSON(s),{zConversionDisabled:!0}):b(e,r);return m&&i(a),v.set(e,{spatialReference:s,geometry:a}),a}function h(e,r,t,o){return{aGeometry:b(e,r),bGeometry:F(t,o,r)}}return{sql:{async createTestFeature(r,t){const o=await e(r,new O(t));return e=>o.testFeature(e)}},projection:{load:r,project:w},geometry:{isGeographic:j,quantize:(e,r)=>g(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:m}=h(e,r,t,o);return s(n,m)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return p(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:m}=h(e,r,t,o);return n(s,m)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=h(e,r,t,o);return u(s,n)},generalize(e,r,t,o){const s=m(b(e,r),t,{removeDegenerateParts:o});return s?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>y(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await(import("./setupServiceMocksMesh.js"));return s(e,r,t,o)}}}}export{d as getServiceMockDependencies};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../geometry/Point.js";import e from"../../geometry/support/MeshMaterialMetallicRoughness.js";import o from"../../geometry/support/MeshTransform.js";import{createFromGLTF as r}from"../../geometry/support/meshUtils.js";import{loadImage as a}from"../../request/loadImage.js";import{meshMakeAbsolute as n}from"./meshUtils.js";import{isEncodedMeshTexture as i}from"../../views/3d/glTF/internal/resourceUtils.js";async function s(e,a,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=t.fromJSON(a),n=await r(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new o({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function l(t,e,o,r){const a=await s(t,e,o,r),n=a.extent.toJSON();return a.destroy(),n}async function c(t,o,r,a){const i=await s(t,o,r,a),{components:l}=i;if(null==l)throw new Error("Mesh has no components");const{transform:c}=i;if(null==c)throw new Error("Mesh has no transform");const m=n(i);if(!m)throw new Error("failed to project");const d=l.map(async t=>{const{faces:o,material:r}=t,a=r instanceof e,n={pbrMetallicRoughness:{baseColorFactor:r?.color?.toUnitRGBA()??[1,1,1,1],baseColorTexture:await u(r?.colorTexture),metallicFactor:a?r.metallic:void 0,roughnessFactor:a?r.roughness:void 0,metallicRoughnessTexture:a&&null!=r.metallicRoughnessTexture?await u(r.metallicRoughnessTexture):void 0},normalTexture:null!=r?.normalTexture?await u(r.normalTexture):void 0,occlusionTexture:a&&null!=r.occlusionTexture?await u(r.occlusionTexture):void 0,emissiveTexture:a&&null!=r.emissiveTexture?await u(r.emissiveTexture):void 0,emissiveFactor:a&&r.emissiveColor?.toUnitRGB()||void 0,alphaMode:("auto"===r?.alphaMode?"blend":r?.alphaMode)??"opaque",alphaCutoff:r?.alphaCutoff??.1,doubleSided:r?.doubleSided??!0,cullFace:r?.doubleSided??1?"none":"back"};return{geometry:{position:m.vertexAttributes.position,faces:o,normal:"source"===t.shading?m.vertexAttributes.normal:void 0,uv:m.vertexAttributes.uv,color:m.vertexAttributes.color},material:n}});return Promise.all(d)}async function u(t){if(null==t)return;const{url:e,data:o}=t,r="image/png",a="string"==typeof t.wrap?"clamp"===t.wrap?"none":t.wrap:"repeat";if(null!=o){if(i(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const t=await m(await d(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(o instanceof HTMLCanvasElement){const t=await m(o,r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}const t=await m(w(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(null!=e){const t=await f(e),o=await m(await d(t),r),n=await o.arrayBuffer();return{type:r,width:t.width,wrap:a,data:n}}}async function m(t,e){return new Promise((o,r)=>t.toBlob(t=>null==t?r(new Error("Failed to load image content")):o(t),e))}async function d(t){await t.decode();const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(t,0,0),e}function w(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(t,0,0),e}function f(t){const e=new Image;return e.src=t,a(e,e.src,!1,void 0)}export{l as extentFromGLB,c as nodeDataFromGLB};
2
+ import t from"../../geometry/Point.js";import e from"../../geometry/support/MeshMaterialMetallicRoughness.js";import o from"../../geometry/support/MeshTransform.js";import{createFromGLTF as r}from"../../geometry/support/meshUtils.js";import{loadImage as a}from"../../request/loadImage.js";import{meshMakeAbsolute as n}from"./meshUtils.js";import{isEncodedMeshTexture as i}from"../../views/3d/glTF/internal/resourceUtils.js";async function s(e,a,n,i){const s=URL.createObjectURL(new Blob([e]));try{const e=t.fromJSON(a),n=await r(e,s,{vertexSpace:e.spatialReference.isGeographic?"local":"georeferenced"}),{rotationAxis:l,rotationAngle:c,translation:u,scale:m}=i;return n.transform=new o({rotationAngle:c??0,rotationAxis:null!=l?[l[0],l[1],l[2]]:[0,0,1],translation:null!=u?[u[0],u[1],u[2]]:[0,0,0],scale:null!=m?[m[0],m[1],m[2]]:[1,1,1]}),n}finally{URL.revokeObjectURL(s)}}async function l(t,e,o,r){const a=await s(t,e,o,r),n=a.extent.toJSON();return a.destroy(),n}async function c(t,o,r,a){const i=await s(t,o,r,a),{components:l}=i;if(null==l)throw new Error("Mesh has no components");const{transform:c}=i;if(null==c)throw new Error("Mesh has no transform");const m=n(i);if(!m)throw new Error("failed to project");const d=l.map(async t=>{const{faces:o,material:r}=t,a=r instanceof e,n={pbrMetallicRoughness:{baseColorFactor:r?.color?.toUnitRGBA()??[1,1,1,1],baseColorTexture:await u(r?.colorTexture),metallicFactor:a?r.metallic:void 0,roughnessFactor:a?r.roughness:void 0,metallicRoughnessTexture:a&&null!=r.metallicRoughnessTexture?await u(r.metallicRoughnessTexture):void 0},normalTexture:null!=r?.normalTexture?await u(r.normalTexture):void 0,occlusionTexture:a&&null!=r.occlusionTexture?await u(r.occlusionTexture):void 0,emissiveTexture:a&&null!=r.emissiveTexture?await u(r.emissiveTexture):void 0,emissiveFactor:a&&r.emissiveColor?.toUnitRGB()||void 0,alphaMode:("auto"===r?.alphaMode?"blend":r?.alphaMode)??"opaque",alphaCutoff:r?.alphaCutoff??.1,doubleSided:r?.doubleSided??!0,cullFace:r?.doubleSided??!0?"none":"back"};return{geometry:{position:m.vertexAttributes.position,faces:o,normal:"source"===t.shading?m.vertexAttributes.normal:void 0,uv:m.vertexAttributes.uv,color:m.vertexAttributes.color},material:n}});return Promise.all(d)}async function u(t){if(null==t)return;const{url:e,data:o}=t,r="image/png",a="string"==typeof t.wrap?"clamp"===t.wrap?"none":t.wrap:"repeat";if(null!=o){if(i(o))throw new Error("Cannot bake encoded textures");if(o instanceof HTMLVideoElement)throw new Error("Cannot bake video textures");if(o instanceof HTMLImageElement){const t=await m(await d(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(o instanceof HTMLCanvasElement){const t=await m(o,r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}const t=await m(w(o),r),e=await t.arrayBuffer();return{type:r,width:o.width,wrap:a,data:e}}if(null!=e){const t=await f(e),o=await m(await d(t),r),n=await o.arrayBuffer();return{type:r,width:t.width,wrap:a,data:n}}}async function m(t,e){return new Promise((o,r)=>t.toBlob(t=>null==t?r(new Error("Failed to load image content")):o(t),e))}async function d(t){await t.decode();const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.drawImage(t,0,0),e}function w(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const o=e.getContext("2d");if(null==o)throw new Error("Failed to create 2d context");return o.putImageData(t,0,0),e}function f(t){const e=new Image;return e.src=t,a(e,e.src,!1,void 0)}export{l as extentFromGLB,c as nodeDataFromGLB};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../geometry/GeometryCursor.js";import{importLazily as r}from"../../geometry/operators/importUtils.js";import{TileClipper as t}from"../../geometry/support/TileClipper.js";const o=r(()=>import("../../geometry/operators/json/bufferOperator.js")),s=r(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=r(()=>import("../../geometry/operators/json/lengthOperator.js")),i=r(()=>import("../../geometry/operators/json/generalizeOperator.js")),n=r(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=r(()=>import("../../geometry/operators/json/offsetOperator.js")),a=r(()=>import("../../geometry/operators/json/simplifyOperator.js")),f=r(()=>import("../../geometry/operators/json/simplifyOperatorOGC.js")),c=r(()=>import("../../geometry/operators/support/jsonConverter.js")),g=512;let l;function y(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([f.getImportPromise(),p.getImportPromise(),n.getImportPromise()]);case"CIMGeometricEffectControlMeasureLine":return p.getImportPromise();case"CIMGeometricEffectTaperedPolygon":return Promise.all([a.getImportPromise(),m.getImportPromise(),i.getImportPromise()]);default:return Promise.resolve()}}function u(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?c.getImportPromise():Promise.resolve()}class P{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function j(r,o,s){if(!r)return null;l||(l=new t(0,0,0,1));const m=s?-1:1,i="esriGeometryPolygon"===r.geometryType,n=i?3:2,p=i?3:2;let a,f;for(l.reset(n),l.setPixelMargin(o+1),l.setExtent(g);r.nextPath();)if(!(r.pathSize<p)){for(r.nextPoint(),a=r.x,f=m*r.y,l.moveTo(a,f);r.nextPoint();)a=r.x,f=m*r.y,l.lineTo(a,f);i&&l.close()}const c=l.result(!1);if(c){const t=e.createEmptyOptimizedCIM(r.geometryType);for(const e of c){t.startPath();for(const r of e)t.pushXY(r.x,m*r.y)}return t.reset(),t}return null}export{P as SimpleEffectCursor,j as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,i as lazyGeneralizeOperator,n as lazyGraphicBufferOperator,c as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOGCOperator,a as lazySimplifyOperator,y as loadGeometryOperatorsForEffect,u as loadGeometryOperatorsForPlacement};
2
+ import{importLazily as e}from"../../core/importUtils.js";import{GeometryCursor as r}from"../../geometry/GeometryCursor.js";import{TileClipper as t}from"../../geometry/support/TileClipper.js";const o=e(()=>import("../../geometry/operators/json/bufferOperator.js")),s=e(()=>import("../../geometry/operators/json/convexHullOperator.js")),m=e(()=>import("../../geometry/operators/json/lengthOperator.js")),i=e(()=>import("../../geometry/operators/json/generalizeOperator.js")),n=e(()=>import("../../geometry/operators/json/graphicBufferOperator.js")),p=e(()=>import("../../geometry/operators/json/offsetOperator.js")),a=e(()=>import("../../geometry/operators/json/simplifyOperator.js")),f=e(()=>import("../../geometry/operators/json/simplifyOperatorOGC.js")),c=e(()=>import("../../geometry/operators/support/jsonConverter.js")),l=512;let g;function u(e){switch(e.type){case"CIMGeometricEffectDonut":case"CIMGeometricEffectBuffer":return o.getImportPromise();case"CIMGeometricEffectEnclosingPolygon":return s.getImportPromise();case"CIMGeometricEffectOffset":return Promise.all([f.getImportPromise(),p.getImportPromise(),n.getImportPromise()]);case"CIMGeometricEffectControlMeasureLine":return p.getImportPromise();case"CIMGeometricEffectTaperedPolygon":return Promise.all([a.getImportPromise(),m.getImportPromise(),i.getImportPromise()]);default:return Promise.resolve()}}function y(e){return"CIMMarkerPlacementAtMeasuredUnits"===e.type?c.getImportPromise():Promise.resolve()}class P{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}}function j(e,o,s){if(!e)return null;g||(g=new t(0,0,0,1));const m=s?-1:1,i="esriGeometryPolygon"===e.geometryType,n=i?3:2,p=i?3:2;let a,f;for(g.reset(n),g.setPixelMargin(o+1),g.setExtent(l);e.nextPath();)if(!(e.pathSize<p)){for(e.nextPoint(),a=e.x,f=m*e.y,g.moveTo(a,f);e.nextPoint();)a=e.x,f=m*e.y,g.lineTo(a,f);i&&g.close()}const c=g.result(!1);if(c){const t=r.createEmptyOptimizedCIM(e.geometryType);for(const e of c){t.startPath();for(const r of e)t.pushXY(r.x,m*r.y)}return t.reset(),t}return null}export{P as SimpleEffectCursor,j as clipCursorToTileExtent,o as lazyBufferOperator,s as lazyConvexHullOperator,i as lazyGeneralizeOperator,n as lazyGraphicBufferOperator,c as lazyJsonConversion,m as lazyLengthOperator,p as lazyOffsetOperator,f as lazySimplifyOGCOperator,a as lazySimplifyOperator,u as loadGeometryOperatorsForEffect,y as loadGeometryOperatorsForPlacement};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s,lazyBufferOperator as r}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";class m{static{this.instance=null}static local(){return null===m.instance&&(m.instance=new m),m.instance}execute(e,t,i){return new l(e,t,i)}}class l{constructor(e,t,i){const s=i.geomUnitsPerPoint,r=i.tileKey,m=i.maxInflateSize;this._preventClipping=i.preventClipping,this._inputGeometries=e,this._tileKey=r,this._curveHelper=new n,this._size=(void 0!==t.size?t.size:1)*s,this._maxInflateSize=m*s,this._offsetFlattenError=o*s}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"===n.geometryType)if(this._size>0){const i=e.createEmptyOptimizedCIM(n.geometryType),s=t(n)[0],r=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(r)return i.pushPath(r),i}else if(this._size<0){const t=n.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return e.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const o=!this._preventClipping&&this._tileKey?s(n,this._maxInflateSize,!0):n;if(!o)continue;const m=r.module,l={...o.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},a=m.execute(l,this._size);return a?e.fromJSONCIM(a):null}return null}}export{m as EffectBuffer};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectMultipath as t}from"../../../geometry/geometryCursorCollectUtils.js";import i from"../../../geometry/SpatialReference.js";import{clipCursorToTileExtent as s,lazyBufferOperator as r}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as o}from"../CurveHelper.js";class m{static{this.instance=null}static local(){return null===m.instance&&(m.instance=new m),m.instance}execute(e,t,i){return new l(e,t,i)}}class l{constructor(e,t,i){const s=i.geomUnitsPerPoint,r=i.tileKey,m=i.maxInflateSize;this._preventClipping=i.preventClipping,this._inputGeometries=e,this._tileKey=r,this._curveHelper=new n,this._size=(void 0!==t.size?t.size:1)*s,this._maxInflateSize=m*s,this._offsetFlattenError=o*s}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._size)return n;if("esriGeometryEnvelope"===n.geometryType)if(this._size>0){const i=e.createEmptyOptimizedCIM(n.geometryType),s=t(n)[0],r=this._curveHelper.offset(s,this._size,"Rounded",4,this._offsetFlattenError);if(r)return i.pushPath(r),i}else if(this._size<0){const t=n.asJSON();if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return e.fromJSONCIM({xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size})}const o=!this._preventClipping&&this._tileKey?s(n,this._maxInflateSize,!0):n;if(!o)continue;const{bufferExecute:m}=r.module,l=m({...o.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},this._size);return l?e.fromJSONCIM(l):null}return null}}export{m as EffectBuffer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{inchesPerMeter as s}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as i}from"../../../geometry/geometryCursorCollectUtils.js";import h from"../../../geometry/SpatialReference.js";import{getPathLength as e}from"../../../geometry/support/coordsUtils.js";import{setId as r}from"../CIMCursor.js";import{lazyOffsetOperator as _}from"../CIMEffects.js";class c{static{this.instance=null}static local(){return null===c.instance&&(c.instance=new c),c.instance}execute(s,t,i){return new o(s,t,i)}}class o{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i.geomUnitsPerPoint??1,this._scale=i?.scale,this._rule=t.rule??"FullGeometry",this._spatialReference=i?.spatialReference??h.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let s;for(;s=this._inputGeometries.next();){const h=this._processGeom(i(s));if(h?.length)return t.fromJSONCIM({paths:h})}return null}_computeWidth(t){if(!u(this._rule)||null==this._scale||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;const i=this._scale/(96*s*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*i)}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return r(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,o=[];o.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),o.push(t),o.push(i),o.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(o)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),o=this._mid(h,e),u=this._mid(_,c),a=this._mid(c,o),n=this._mid(u,a);this._addBezier3(s,t,_,u,n,r),this._addBezier3(s,n,a,o,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const o=Math.abs(this._crossProduct(_,this._sub(r,e)));let u=this._dotProduct(_,this._sub(r,e));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=.5*o,n=this._leftPerp(_),p=[e[0]+_[0]*u,e[1]+_[1]*u],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*o,p[1]+l[0][1]*o]),s.push(h),s.push([p[0]-l[0][0]*o,p[1]-l[0][1]*o]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_offsetPath(s,h){const e=_.module.execute({paths:[s],spatialReference:this._spatialReference.toJSON()},h,{joins:"miter",miterLimit:4}),[r]=i(t.fromJSONCIM(e));return r?.length?r:null}_processGeom(s){if(!s)return null;const t=[];for(const i of s){const s=i.length>1&&e(i)<this._defaultSize;if(!i||0===i.length||s)continue;const h=i.length;let _=i[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=[];e.push(h),e.push(this._mid(_,s)),t.push(e);break}case"ReversedFirstSegment":{const s=this._cp2(i,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=[];e.push(this._mid(s,h)),e.push(_),t.push(e);break}case"SecondSegmentWithTicks":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);let r;r=this._crossProduct(e,this._sub(_,s))>0?this._rightPerp(e):this._leftPerp(e);const c=[];c.push([s[0]+(r[0]-e[0])/3,s[1]+(r[1]-e[1])/3]),c.push(s),c.push(h),c.push([h[0]+(r[0]+e[0])/3,h[1]+(r[1]+e[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push(_),o.push([h[0]+r[0]*c,h[1]+r[1]*c]),t.push(o);const u=[];u.push([h[0]-r[0]*c,h[1]-r[1]*c]),u.push(s),t.push(u);break}case"OppositeToFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c,h[1]+r[1]*c]),o.push([h[0]-r[0]*c,h[1]-r[1]*c]),t.push(o);break}case"TriplePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c*.8,h[1]+r[1]*c*.8]),o.push([e[0]+.8*(_[0]-e[0]),e[1]+.8*(_[1]-e[1])]),t.push(o),t.push([h,e]);const u=[];u.push([h[0]-r[0]*c*.8,h[1]-r[1]*c*.8]),u.push([e[0]+.8*(s[0]-e[0]),e[1]+.8*(s[1]-e[1])]),t.push(u);break}case"HalfCircleFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18),u=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(h,_))>0?(n.push(_),r=this._sub(_,e),p=s):(n.push(s),r=this._sub(s,e),p=_),this._rotateDirect(r,u,a),r[0]/=u,r[1]/=u;for(let t=1;t<=18;t++)n.push(this._add(e,r)),this._rotateDirect(r,c,o);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,1,-1);let e=this._sub(_,s);this._normalize(e);const r=this._crossProduct(e,this._sub(h,s))/2;this._leftPerpendicular(e);const c=[s[0]+e[0]*r,s[1]+e[1]*r];e=this._sub(s,c);const o=Math.cos(Math.PI/18);let u=Math.sin(Math.PI/18);r>0&&(u=-u);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(e,o,u),a.push(this._add(c,e));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,1,-1);let r;if(h>=4)r=i[3];else{const t=this._sub(_,s);r=this._add(e,t)}const c=this._dist(s,e)/2/.75,o=this._sub(s,_);this._normalize(o,c);const u=this._sub(e,r);this._normalize(u,c);const a=[r,e];t.push(a);const n=[this._clone(e)];this._addBezier3(n,e,this._add(e,u),this._add(s,o),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(i,-2,0),h=this._sub(s,_),e=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(h,e,r),c.push(this._add(_,h));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(i,0,-1);let e,r;if(h>=3)e=i[2];else{const t=this._sub(s,_),i=this._leftPerp(t);e=[_[0]+i[0]-.25*t[0],_[1]+i[1]-.25*t[1]]}if(h>=4)r=i[3];else{const t=this._mid(_,s),i=this._sub(_,s);this._normalize(i),this._leftPerpendicular(i);const h=this._crossProduct(i,this._sub(e,t));this._rightPerpendicular(i),r=[e[0]+i[0]*h*2,e[1]+i[1]*h*2]}const c=this._sub(s,_);let o,u;o=this._crossProduct(c,this._sub(e,_))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push(e),u.push(_),u.push([_[0]+(o[0]-c[0])/3,_[1]+(o[1]-c[1])/3]),t.push(u),o=this._crossProduct(c,this._sub(r,s))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push([s[0]+(o[0]+c[0])/3,s[1]+(o[1]+c[1])/3]),u.push(s),u.push(r),t.push(u);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(i,0,2),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}this._addAngledTicks(t,_,s,this._mid(e,r)),this._addAngledTicks(t,e,r,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(i,2,0),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}const c=[];c.push(this._mid(_,e)),c.push(this._mid(s,r)),t.push(c);break}case"Chevron":{const s=this._cp2(i,-1,-1);let e;if(h>=3)e=i[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),e=this._add(_,t)}t.push([s,this._makeCtrlPt(_),e]);break}case"PerpendicularWithArc":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,.5,-1),r=this._sub(s,_),c=this._norm(r);r[0]/=c,r[1]/=c;const o=this._crossProduct(r,this._sub(e,_));let u=this._dotProduct(r,this._sub(e,_));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=[_[0]+r[0]*u,_[1]+r[1]*u];let n=this._leftPerp(r),p=[];if(p.push([a[0]-n[0]*o,a[1]-n[1]*o]),p.push([a[0]+n[0]*o,a[1]+n[1]*o]),t.push(p),h>=4){const s=i[3];let h=this._dotProduct(r,this._sub(s,_));h<.1*c?h=.1*c:h>.9*c&&(h=.9*c);const e=[_[0]+r[0]*h,_[1]+r[1]*h],o=this._crossProduct(r,this._sub(s,_)),u=[];u.push([e[0]-n[0]*o,e[1]-n[1]*o]),u.push([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(u)}const d=[s[0]+n[0]*o,s[1]+n[1]*o];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);o<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(i,2,0),h=this._mid(_,s),e=this._sub(s,h),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),o=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(e,r,c),o.push(this._add(h,e));t.push(o);break}case"TripleParallelExtended":{const s=this._cp2(i,0,-2),h=this._cp3(i,s,1,-2),e=this._mid(_,s),c=this._sub(h,s);this._normalize(c);const o=Math.abs(this._crossProduct(c,this._sub(e,s)))/2,u=this._dist(s,h),a=[s,_];a.push([_[0]+c[0]*u*.5,_[1]+c[1]*u*.5]),t.push(a);const n=[];n.push([e[0]-c[0]*o,e[1]-c[1]*o]),n.push([e[0]+c[0]*u*.375,e[1]+c[1]*u*.375]),r(n[n.length-1],1),n.push([e[0]+c[0]*u*.75,e[1]+c[1]*u*.75]),t.push(n);const p=[s,h];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_)),c=this._leftPerp(e);this._addAngledTicks(t,_,s,h),this._addAngledTicks(t,this._add2(_,c[0]*r,c[1]*r),this._add2(s,c[0]*r,c[1]*r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._leftPerp(e),c=this._crossProduct(e,this._sub(h,_));let o=[_,s];t.push(o),o=[],o.push([_[0]+r[0]*c,_[1]+r[1]*c]),o.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(o);break}case"PerpendicularToFirstSegment":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(h,_));this._leftPerpendicular(r);const o=[];o.push([e[0]-r[0]*c*.25,e[1]-r[1]*c*.25]),o.push([e[0]+r[0]*c*1.25,e[1]+r[1]*c*1.25]),t.push(o);break}case"ParallelOffset":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);const o=[];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(o);break}case"OffsetOpposite":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]+e[0]*r,_[1]+e[1]*r]),c.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(i,3,0);const e=this._cp3(i,s,.5,-1);let c,o;if(h>=4)c=i[3],o=this._crossProduct(this._sub(c,s),this._sub(e,s))>0;else{c=s,o=this._crossProduct(this._sub(c,_),this._sub(e,_))>0;const t=24*this._geomUnitsPerPoint,i=this._sub(c,_);this._normalize(i,t);const h=Math.sqrt(2)/2;this._rotateDirect(i,h,o?h:-h),s=this._add(_,i)}const u=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(u,a,n),p.push(this._add(_,u));this._add90DegArc(p,s,c,e,o),r(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,e=this._cp2(i,-3,1),r=this._cp3(i,e,-1,-.5);if(h>=4)s=i[3];else{const t=_;_=e,s=r;const i=this._dist(_,t),h=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*i<c&&(c=.5*i),.5*h<c&&(c=.5*h),e=this._mix(_,c/i,t,(i-c)/i),r=this._mix(s,c/h,t,(h-c)/h)}const c=this._mid(_,e),o=this._mid(s,r),u=this._dist(_,e),a=this._dist(r,s);let n=Math.min(u,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,e);this._normalize(d,n),this._crossProduct(d,this._sub(s,e))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(e),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,r),this._normalize(d,n),this._crossProduct(d,this._sub(_,r))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(r),l.push(this._add(o,d)),l.push(this._sub(o,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(i),h=[];let e=s.length-2;for(;e--;)h.push(s[e]);t.push(h);break}case"MultivertexArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!1),t.push(h);break}case"CrossedArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!0),t.push(h);break}case"ChevronArrow":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const o=this._crossProduct(r,this._sub(h,s));let u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=[s[0]+r[0]*u,s[1]+r[1]*u],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*o+r[0]*e,a[1]+n[1]*o+r[1]*e]),p.push(_),p.push([a[0]-n[0]*o+r[0]*e,a[1]-n[1]*o+r[1]*e]),t.push(p);break}case"ChevronArrowOffset":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=this._crossProduct(e,this._sub(h,s));let o=this._dotProduct(e,this._sub(h,s));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=[s[0]+e[0]*o,s[1]+e[1]*o];this._leftPerpendicular(e);const a=[];a.push([u[0]+e[0]*c*.5,u[1]+e[1]*c*.5]),a.push(this._mid(u,_)),a.push([u[0]-e[0]*c*.5,u[1]-e[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);let c=this._dotProduct(e,this._sub(h,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const o=[s[0]+e[0]*c,s[1]+e[1]*c];t.push([s,o]);break}case"Arch":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=this._sub(_,s),r=this._mix(h,1,e,.55),c=this._mix(h,1,e,-.55),o=[_];this._addBezier2(o,_,r,h,4),this._addBezier2(o,h,c,s,4),t.push(o);break}case"CurvedParallelTicks":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r),o=this._sub(this._mix(s,.75,h,.25),r),u=this._sub(this._mix(s,.25,h,.75),r),a=[s];this._addBezier2(a,s,o,c,3),this._addBezier2(a,c,u,h,3),t.push(a);for(let i=0;i<8;i++){const s=a[2*i+1],h=[this._clone(s)];h.push(this._add(s,[e[0]/4,e[1]/4])),t.push(h)}break}case"Arc90Degrees":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=[s];this._add90DegArc(e,s,_,h),t.push(e);break}case"TipWithPerpendicularAndTicks":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let o=this._crossProduct(r,this._sub(h,s)),u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=this._leftPerp(r),n=[_[0]-r[0]*e,_[1]-r[1]*e],p=.5*Math.max(c-u-e,e);o=Math.abs(o);const d=[];d.push([n[0]+a[0]*(o+p)-r[0]*p,n[1]+a[1]*(o+p)-r[1]*p]),d.push([n[0]+a[0]*o,n[1]+a[1]*o]),d.push([n[0]-a[0]*o,n[1]-a[1]*o]),d.push([n[0]-a[0]*(o+p)-r[0]*p,n[1]-a[1]*(o+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(i,1,0),e=this._cp3(i,s,2,0),c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18);let u=this._dist(s,_),a=[u,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);if(t.push(n),h>=4){n=[];const s=i[3];u=this._dist(s,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),r(n[1],1)),this._rotateDirect(a,c,o);t.push(n)}n=[],u=this._dist(e,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(i)[0];const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=Math.abs(this._crossProduct(e,this._sub(h,_)));let o=Math.abs(this._dotProduct(e,this._sub(h,_)));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=Math.max(c,o),a=this._leftPerp(e);let n=[];const p=[_[0]-e[0]*o*.5+a[0]*c*.5,_[1]-e[1]*o*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),p[0]-=a[0]*u*.25,p[1]-=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-e[0]*o*.5-a[0]*c*.5,p[1]=_[1]-e[1]*o*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),p[0]+=a[0]*u*.25,p[1]+=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(i,-5,0),h=this._cp3(i,s,-.2,1),e=this._sub(_,s);this._normalize(e);const r=this._leftPerp(e),c=Math.abs(this._crossProduct(e,this._sub(h,s)));t.push([s,_]);const o=[];o.push([_[0]-e[0]*c+r[0]*c,_[1]-e[1]*c+r[1]*c]),o.push(_),o.push([_[0]-e[0]*c-r[0]*c,_[1]-e[1]*c-r[1]*c]),t.push(o),this._addDash(t,s,[-e[0]*c+r[0]*c,-e[1]*c+r[1]*c]),this._addDash(t,s,[-e[0]*c-r[0]*c,-e[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(i,2,0),e=this._cp3(i,s,1.5,0);let r;r=h>=4?i[3]:this._cp3(i,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const o=.5*this._dist(s,e),u=this._crossProduct(c,this._sub(r,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);u&&(n=-n);const p=[_,s];c[0]*=o,c[1]*=o;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(i,-2,1),h=this._cp3(i,s,-1,-.5),e=this._sub(h,s);this._normalize(e);const r=this._dotProduct(e,this._sub(s,_)),c=this._dotProduct(e,this._sub(h,_));let o=[_];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push(s),t.push(o),o=[_],o.push([_[0]+e[0]*c,_[1]+e[1]*c]),o.push(h),t.push(o);break}case"DoubleCurve":{const s=this._cp2(i,-5,-1),h=this._cp3(i,s,2,0),e=Math.atan2(1,5),c=Math.cos(e),o=Math.sin(e),u=this._sub(s,_),a=this._dist(_,s);this._normalize(u),this._rotateDirect(u,c,-o);const n=[_];n.push([_[0]+u[0]*a*.5,_[1]+u[1]*a*.5]),r(n[1],1),n.push([_[0]+u[0]*a*.8,_[1]+u[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+u[0]*a,_[1]+u[1]*a],s,3);const p=this._sub(h,s),d=this._dist(s,h);this._normalize(p),this._rotateDirect(p,c,-o),this._addBezier2(n,s,[h[0]-p[0]*d,h[1]-p[1]*d],[h[0]-p[0]*d*.8,h[1]-p[1]*d*.8],3),n.push(h),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e),r>0?(this._addAngledTicks(t,_,[_[0]+e[0]*r,_[1]+e[1]*r],s),this._addAngledTicks(t,s,[s[0]+e[0]*r,s[1]+e[1]*r],_)):(this._addAngledTicks(t,[_[0]+e[0]*r,_[1]+e[1]*r],_,s),this._addAngledTicks(t,[s[0]+e[0]*r,s[1]+e[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(i,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],h=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],e=h[0]-t[0],r=t[1]-h[1],c=Math.min(e,r)/10,o=[];o.push([t[0]+c+.75*(e-2*c),t[1]]),o.push([h[0]-c,t[1]]),this._add90DegArc(o,[h[0]-c,t[1]],[h[0],t[1]-c],[h[0],t[1]]),o.push([h[0],h[1]+c]),this._add90DegArc(o,[h[0],h[1]+c],[h[0]-c,h[1]],h),o.push([t[0]+c,h[1]]),this._add90DegArc(o,[t[0]+c,h[1]],[t[0],h[1]+c],[t[0],h[1]]),o.push([t[0],t[1]-c]),this._add90DegArc(o,[t[0],t[1]-c],[t[0]+c,t[1]],t),o.push([t[0]+c+.75*(e-2*c),t[1]]);break}case"ParallelOffsetByValue":{if(i.length<2||0===this._width)break;const s=this._offsetPath(i,.5*this._width);s&&t.push(s);const h=this._offsetPath(i,.5*-this._width);h&&t.push(h);break}default:t.push(i)}}return t}}function u(s){return"ParallelOffsetByValue"===s}export{c as EffectControlMeasureLine};
2
+ import{inchesPerMeter as s}from"../../../core/units.js";import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectMultipath as i}from"../../../geometry/geometryCursorCollectUtils.js";import h from"../../../geometry/SpatialReference.js";import{getPathLength as e}from"../../../geometry/support/coordsUtils.js";import{setId as r}from"../CIMCursor.js";import{lazyOffsetOperator as _}from"../CIMEffects.js";class c{static{this.instance=null}static local(){return null===c.instance&&(c.instance=new c),c.instance}execute(s,t,i){return new o(s,t,i)}}class o{constructor(s,t,i){this._defaultPointSize=20,this._inputGeometries=s,this._geomUnitsPerPoint=i.geomUnitsPerPoint??1,this._scale=i?.scale,this._rule=t.rule??"FullGeometry",this._spatialReference=i?.spatialReference??h.WebMercator,this._width=this._computeWidth(t.width??25),this._defaultSize=this._defaultPointSize*this._geomUnitsPerPoint}next(){let s;for(;s=this._inputGeometries.next();){const h=this._processGeom(i(s));if(h?.length)return t.fromJSONCIM({paths:h})}return null}_computeWidth(t){if(!u(this._rule)||null==this._scale||!this._spatialReference.metersPerUnit)return t*this._geomUnitsPerPoint;const i=this._scale/(96*s*this._spatialReference.metersPerUnit);return t/(this._spatialReference.metersPerUnit*i)}_clone(s){return[s[0],s[1]]}_mid(s,t){return[(s[0]+t[0])/2,(s[1]+t[1])/2]}_mix(s,t,i,h){return[s[0]*t+i[0]*h,s[1]*t+i[1]*h]}_add(s,t){return[s[0]+t[0],s[1]+t[1]]}_add2(s,t,i){return[s[0]+t,s[1]+i]}_sub(s,t){return[s[0]-t[0],s[1]-t[1]]}_dist(s,t){return Math.sqrt((s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1]))}_norm(s){return Math.sqrt(s[0]*s[0]+s[1]*s[1])}_normalize(s,t=1){const i=t/this._norm(s);s[0]*=i,s[1]*=i}_leftPerpendicular(s){const t=-s[1],i=s[0];s[0]=t,s[1]=i}_leftPerp(s){return[-s[1],s[0]]}_rightPerpendicular(s){const t=s[1],i=-s[0];s[0]=t,s[1]=i}_rightPerp(s){return[s[1],-s[0]]}_dotProduct(s,t){return s[0]*t[0]+s[1]*t[1]}_crossProduct(s,t){return s[0]*t[1]-s[1]*t[0]}_rotateDirect(s,t,i){const h=s[0]*t-s[1]*i,e=s[0]*i+s[1]*t;s[0]=h,s[1]=e}_makeCtrlPt(s){const t=[s[0],s[1]];return r(t,1),t}_addAngledTicks(s,t,i,h){const e=this._sub(i,t);this._normalize(e);const r=this._crossProduct(e,this._sub(h,t));let _;_=r>0?this._rightPerp(e):this._leftPerp(e);const c=Math.abs(r)/2,o=[];o.push([t[0]+(_[0]-e[0])*c,t[1]+(_[1]-e[1])*c]),o.push(t),o.push(i),o.push([i[0]+(_[0]+e[0])*c,i[1]+(_[1]+e[1])*c]),s.push(o)}_addBezier2(s,t,i,h,e){if(0===e--)return void s.push(h);const r=this._mid(t,i),_=this._mid(i,h),c=this._mid(r,_);this._addBezier2(s,t,r,c,e),this._addBezier2(s,c,_,h,e)}_addBezier3(s,t,i,h,e,r){if(0===r--)return void s.push(e);const _=this._mid(t,i),c=this._mid(i,h),o=this._mid(h,e),u=this._mid(_,c),a=this._mid(c,o),n=this._mid(u,a);this._addBezier3(s,t,_,u,n,r),this._addBezier3(s,n,a,o,e,r)}_add90DegArc(s,t,i,h,e){const r=e??this._crossProduct(this._sub(i,t),this._sub(h,t))>0,_=this._mid(t,i),c=this._sub(_,t);r?this._leftPerpendicular(c):this._rightPerpendicular(c),_[0]+=c[0],_[1]+=c[1],this._addBezier3(s,t,this._mix(t,.33333,_,.66667),this._mix(i,.33333,_,.66667),i,4)}_addArrow(s,t,i){const h=t[0],e=t[1],r=t[t.length-1],_=this._sub(h,e),c=this._norm(_);this._normalize(_);const o=Math.abs(this._crossProduct(_,this._sub(r,e)));let u=this._dotProduct(_,this._sub(r,e));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=.5*o,n=this._leftPerp(_),p=[e[0]+_[0]*u,e[1]+_[1]*u],d=t.length-1,l=[];l.push(i?[-n[0],-n[1]]:n);let b=[-_[0],-_[1]];for(let P=1;P<d-1;P++){const s=this._sub(t[P+1],t[P]);this._normalize(s);const i=this._dotProduct(s,b),h=this._crossProduct(s,b),e=Math.sqrt((1+i)/2),r=this._sub(s,b);this._normalize(r),r[0]/=e,r[1]/=e,l.push(h<0?[-r[0],-r[1]]:r),b=s}l.push(this._rightPerp(b));for(let P=l.length-1;P>0;P--)s.push([t[P][0]+l[P][0]*a,t[P][1]+l[P][1]*a]);s.push([p[0]+l[0][0]*a,p[1]+l[0][1]*a]),s.push([p[0]+l[0][0]*o,p[1]+l[0][1]*o]),s.push(h),s.push([p[0]-l[0][0]*o,p[1]-l[0][1]*o]),s.push([p[0]-l[0][0]*a,p[1]-l[0][1]*a]);for(let P=1;P<l.length;P++)s.push([t[P][0]-l[P][0]*a,t[P][1]-l[P][1]*a])}_addDash(s,t,i){const h=this._norm(i)/7;this._normalize(i);let e=[];for(let r=0;r<=7;r++)e.push([t[0]+i[0]*r*h,t[1]+i[1]*r*h]),1&r&&(s.push(e),e=[])}_cp2(s,t,i){return s.length>=2?s[1]:this._add2(s[0],t*this._defaultSize,i*this._defaultSize)}_cp3(s,t,i,h){if(s.length>=3)return s[2];const e=this._mix(s[0],1-i,t,i),r=this._sub(t,s[0]);return this._normalize(r),this._rightPerpendicular(r),[e[0]+r[0]*h*this._defaultSize,e[1]+r[1]*h*this._defaultSize]}_arrowPath(s){if(s.length>2)return s;const t=s[0],i=this._cp2(s,-4,0),h=this._sub(t,i);this._normalize(h);const e=this._rightPerp(h);return[t,i,[t[0]+(e[0]-h[0])*this._defaultSize,t[1]+(e[1]-h[1])*this._defaultSize]]}_arrowLastSeg(s){const t=s[0],i=this._cp2(s,-4,0);let h;if(s.length>=3)h=s[s.length-1];else{const s=this._sub(t,i);this._normalize(s);const e=this._rightPerp(s);h=[t[0]+(e[0]-s[0])*this._defaultSize,t[1]+(e[1]-s[1])*this._defaultSize]}return[i,h]}_offsetPath(s,h){const{offsetExecute:e}=_.module,r=e({paths:[s],spatialReference:this._spatialReference.toJSON()},h,{joins:"miter",miterLimit:4}),[c]=i(t.fromJSONCIM(r));return c?.length?c:null}_processGeom(s){if(!s)return null;const t=[];for(const i of s){const s=i.length>1&&e(i)<this._defaultSize;if(!i||0===i.length||s)continue;const h=i.length;let _=i[0];switch(this._rule){case"PerpendicularFromFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=[];e.push(h),e.push(this._mid(_,s)),t.push(e);break}case"ReversedFirstSegment":{const s=this._cp2(i,0,-1);t.push([s,_]);break}case"PerpendicularToSecondSegment":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=[];e.push(this._mid(s,h)),e.push(_),t.push(e);break}case"SecondSegmentWithTicks":{if(i.length<3)return[];const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);let r;r=this._crossProduct(e,this._sub(_,s))>0?this._rightPerp(e):this._leftPerp(e);const c=[];c.push([s[0]+(r[0]-e[0])/3,s[1]+(r[1]-e[1])/3]),c.push(s),c.push(h),c.push([h[0]+(r[0]+e[0])/3,h[1]+(r[1]+e[1])/3]),t.push(c);break}case"DoublePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push(_),o.push([h[0]+r[0]*c,h[1]+r[1]*c]),t.push(o);const u=[];u.push([h[0]-r[0]*c,h[1]-r[1]*c]),u.push(s),t.push(u);break}case"OppositeToFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c,h[1]+r[1]*c]),o.push([h[0]-r[0]*c,h[1]-r[1]*c]),t.push(o);break}case"TriplePerpendicular":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s),r=this._sub(e,h);this._normalize(r);const c=this._crossProduct(r,this._sub(_,h));this._leftPerpendicular(r);const o=[];o.push([h[0]+r[0]*c*.8,h[1]+r[1]*c*.8]),o.push([e[0]+.8*(_[0]-e[0]),e[1]+.8*(_[1]-e[1])]),t.push(o),t.push([h,e]);const u=[];u.push([h[0]-r[0]*c*.8,h[1]-r[1]*c*.8]),u.push([e[0]+.8*(s[0]-e[0]),e[1]+.8*(s[1]-e[1])]),t.push(u);break}case"HalfCircleFirstSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,4),e=this._mid(_,s);let r=this._sub(s,_);const c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18),u=Math.sqrt((1+c)/2),a=Math.sqrt((1-c)/2),n=[];let p;this._crossProduct(r,this._sub(h,_))>0?(n.push(_),r=this._sub(_,e),p=s):(n.push(s),r=this._sub(s,e),p=_),this._rotateDirect(r,u,a),r[0]/=u,r[1]/=u;for(let t=1;t<=18;t++)n.push(this._add(e,r)),this._rotateDirect(r,c,o);n.push(p),t.push(n);break}case"HalfCircleSecondSegment":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,1,-1);let e=this._sub(_,s);this._normalize(e);const r=this._crossProduct(e,this._sub(h,s))/2;this._leftPerpendicular(e);const c=[s[0]+e[0]*r,s[1]+e[1]*r];e=this._sub(s,c);const o=Math.cos(Math.PI/18);let u=Math.sin(Math.PI/18);r>0&&(u=-u);const a=[s];for(let t=1;t<=18;t++)this._rotateDirect(e,o,u),a.push(this._add(c,e));t.push(a);break}case"HalfCircleExtended":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,1,-1);let r;if(h>=4)r=i[3];else{const t=this._sub(_,s);r=this._add(e,t)}const c=this._dist(s,e)/2/.75,o=this._sub(s,_);this._normalize(o,c);const u=this._sub(e,r);this._normalize(u,c);const a=[r,e];t.push(a);const n=[this._clone(e)];this._addBezier3(n,e,this._add(e,u),this._add(s,o),s,4),n.push(_),t.push(n);break}case"OpenCircle":{const s=this._cp2(i,-2,0),h=this._sub(s,_),e=Math.cos(Math.PI/18),r=-Math.sin(Math.PI/18),c=[s];for(let t=1;t<=33;t++)this._rotateDirect(h,e,r),c.push(this._add(_,h));t.push(c);break}case"CoverageEdgesWithTicks":{const s=this._cp2(i,0,-1);let e,r;if(h>=3)e=i[2];else{const t=this._sub(s,_),i=this._leftPerp(t);e=[_[0]+i[0]-.25*t[0],_[1]+i[1]-.25*t[1]]}if(h>=4)r=i[3];else{const t=this._mid(_,s),i=this._sub(_,s);this._normalize(i),this._leftPerpendicular(i);const h=this._crossProduct(i,this._sub(e,t));this._rightPerpendicular(i),r=[e[0]+i[0]*h*2,e[1]+i[1]*h*2]}const c=this._sub(s,_);let o,u;o=this._crossProduct(c,this._sub(e,_))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push(e),u.push(_),u.push([_[0]+(o[0]-c[0])/3,_[1]+(o[1]-c[1])/3]),t.push(u),o=this._crossProduct(c,this._sub(r,s))>0?this._rightPerp(c):this._leftPerp(c),u=[],u.push([s[0]+(o[0]+c[0])/3,s[1]+(o[1]+c[1])/3]),u.push(s),u.push(r),t.push(u);break}case"GapExtentWithDoubleTicks":{const s=this._cp2(i,0,2),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}this._addAngledTicks(t,_,s,this._mid(e,r)),this._addAngledTicks(t,e,r,this._mid(_,s));break}case"GapExtentMidline":{const s=this._cp2(i,2,0),e=this._cp3(i,s,0,1);let r;if(h>=4)r=i[3];else{const t=this._sub(s,_);r=this._add(e,t)}const c=[];c.push(this._mid(_,e)),c.push(this._mid(s,r)),t.push(c);break}case"Chevron":{const s=this._cp2(i,-1,-1);let e;if(h>=3)e=i[2];else{const t=this._sub(s,_);this._leftPerpendicular(t),e=this._add(_,t)}t.push([s,this._makeCtrlPt(_),e]);break}case"PerpendicularWithArc":{const s=this._cp2(i,0,-2),e=this._cp3(i,s,.5,-1),r=this._sub(s,_),c=this._norm(r);r[0]/=c,r[1]/=c;const o=this._crossProduct(r,this._sub(e,_));let u=this._dotProduct(r,this._sub(e,_));u<.05*c?u=.05*c:u>.95*c&&(u=.95*c);const a=[_[0]+r[0]*u,_[1]+r[1]*u];let n=this._leftPerp(r),p=[];if(p.push([a[0]-n[0]*o,a[1]-n[1]*o]),p.push([a[0]+n[0]*o,a[1]+n[1]*o]),t.push(p),h>=4){const s=i[3];let h=this._dotProduct(r,this._sub(s,_));h<.1*c?h=.1*c:h>.9*c&&(h=.9*c);const e=[_[0]+r[0]*h,_[1]+r[1]*h],o=this._crossProduct(r,this._sub(s,_)),u=[];u.push([e[0]-n[0]*o,e[1]-n[1]*o]),u.push([e[0]+n[0]*o,e[1]+n[1]*o]),t.push(u)}const d=[s[0]+n[0]*o,s[1]+n[1]*o];n=this._sub(s,d);const l=Math.cos(Math.PI/18);let b=Math.sin(Math.PI/18);o<0&&(b=-b),p=[_,s];for(let t=1;t<=9;t++)this._rotateDirect(n,l,b),p.push(this._add(d,n));t.push(p);break}case"ClosedHalfCircle":{const s=this._cp2(i,2,0),h=this._mid(_,s),e=this._sub(s,h),r=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),o=[_,s];for(let t=1;t<=18;t++)this._rotateDirect(e,r,c),o.push(this._add(h,e));t.push(o);break}case"TripleParallelExtended":{const s=this._cp2(i,0,-2),h=this._cp3(i,s,1,-2),e=this._mid(_,s),c=this._sub(h,s);this._normalize(c);const o=Math.abs(this._crossProduct(c,this._sub(e,s)))/2,u=this._dist(s,h),a=[s,_];a.push([_[0]+c[0]*u*.5,_[1]+c[1]*u*.5]),t.push(a);const n=[];n.push([e[0]-c[0]*o,e[1]-c[1]*o]),n.push([e[0]+c[0]*u*.375,e[1]+c[1]*u*.375]),r(n[n.length-1],1),n.push([e[0]+c[0]*u*.75,e[1]+c[1]*u*.75]),t.push(n);const p=[s,h];t.push(p);break}case"ParallelWithTicks":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_)),c=this._leftPerp(e);this._addAngledTicks(t,_,s,h),this._addAngledTicks(t,this._add2(_,c[0]*r,c[1]*r),this._add2(s,c[0]*r,c[1]*r),this._mid(_,s));break}case"Parallel":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._leftPerp(e),c=this._crossProduct(e,this._sub(h,_));let o=[_,s];t.push(o),o=[],o.push([_[0]+r[0]*c,_[1]+r[1]*c]),o.push([s[0]+r[0]*c,s[1]+r[1]*c]),t.push(o);break}case"PerpendicularToFirstSegment":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._mid(_,s),r=this._sub(s,_);this._normalize(r);const c=this._crossProduct(r,this._sub(h,_));this._leftPerpendicular(r);const o=[];o.push([e[0]-r[0]*c*.25,e[1]-r[1]*c*.25]),o.push([e[0]+r[0]*c*1.25,e[1]+r[1]*c*1.25]),t.push(o);break}case"ParallelOffset":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);const o=[];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(o);break}case"OffsetOpposite":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]-e[0]*r,_[1]-e[1]*r]),c.push([s[0]-e[0]*r,s[1]-e[1]*r]),t.push(c);break}case"OffsetSame":{const s=this._cp2(i,3,0),h=this._cp3(i,s,.5,-1),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e);const c=[];c.push([_[0]+e[0]*r,_[1]+e[1]*r]),c.push([s[0]+e[0]*r,s[1]+e[1]*r]),t.push(c);break}case"CircleWithArc":{let s=this._cp2(i,3,0);const e=this._cp3(i,s,.5,-1);let c,o;if(h>=4)c=i[3],o=this._crossProduct(this._sub(c,s),this._sub(e,s))>0;else{c=s,o=this._crossProduct(this._sub(c,_),this._sub(e,_))>0;const t=24*this._geomUnitsPerPoint,i=this._sub(c,_);this._normalize(i,t);const h=Math.sqrt(2)/2;this._rotateDirect(i,h,o?h:-h),s=this._add(_,i)}const u=this._sub(s,_),a=Math.cos(Math.PI/18),n=Math.sin(Math.PI/18),p=[s];for(let t=1;t<=36;t++)this._rotateDirect(u,a,n),p.push(this._add(_,u));this._add90DegArc(p,s,c,e,o),r(p[p.length-8],1),t.push(p);break}case"DoubleJog":{let s,e=this._cp2(i,-3,1),r=this._cp3(i,e,-1,-.5);if(h>=4)s=i[3];else{const t=_;_=e,s=r;const i=this._dist(_,t),h=this._dist(s,t);let c=30*this._geomUnitsPerPoint;.5*i<c&&(c=.5*i),.5*h<c&&(c=.5*h),e=this._mix(_,c/i,t,(i-c)/i),r=this._mix(s,c/h,t,(h-c)/h)}const c=this._mid(_,e),o=this._mid(s,r),u=this._dist(_,e),a=this._dist(r,s);let n=Math.min(u,a)/8;n=Math.min(n,24*this._geomUnitsPerPoint);const p=Math.cos(Math.PI/4);let d=this._sub(_,e);this._normalize(d,n),this._crossProduct(d,this._sub(s,e))>0?this._rotateDirect(d,p,-p):this._rotateDirect(d,p,p);let l=[];l.push(e),l.push(this._add(c,d)),l.push(this._sub(c,d)),l.push(_),t.push(l),d=this._sub(s,r),this._normalize(d,n),this._crossProduct(d,this._sub(_,r))<0?this._rotateDirect(d,p,p):this._rotateDirect(d,p,-p),l=[],l.push(r),l.push(this._add(o,d)),l.push(this._sub(o,d)),l.push(s),t.push(l);break}case"PerpendicularOffset":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r);t.push([c,_]);break}case"LineExcludingLastSegment":{const s=this._arrowPath(i),h=[];let e=s.length-2;for(;e--;)h.push(s[e]);t.push(h);break}case"MultivertexArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!1),t.push(h);break}case"CrossedArrow":{const s=this._arrowPath(i),h=[];this._addArrow(h,s,!0),t.push(h);break}case"ChevronArrow":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);const o=this._crossProduct(r,this._sub(h,s));let u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=[s[0]+r[0]*u,s[1]+r[1]*u],n=this._leftPerp(r),p=[];p.push([a[0]+n[0]*o+r[0]*e,a[1]+n[1]*o+r[1]*e]),p.push(_),p.push([a[0]-n[0]*o+r[0]*e,a[1]-n[1]*o+r[1]*e]),t.push(p);break}case"ChevronArrowOffset":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=this._crossProduct(e,this._sub(h,s));let o=this._dotProduct(e,this._sub(h,s));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=[s[0]+e[0]*o,s[1]+e[1]*o];this._leftPerpendicular(e);const a=[];a.push([u[0]+e[0]*c*.5,u[1]+e[1]*c*.5]),a.push(this._mid(u,_)),a.push([u[0]-e[0]*c*.5,u[1]-e[1]*c*.5]),t.push(a);break}case"PartialFirstSegment":{const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);let c=this._dotProduct(e,this._sub(h,s));c<.05*r?c=.05*r:c>.95*r&&(c=.95*r);const o=[s[0]+e[0]*c,s[1]+e[1]*c];t.push([s,o]);break}case"Arch":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=this._sub(_,s),r=this._mix(h,1,e,.55),c=this._mix(h,1,e,-.55),o=[_];this._addBezier2(o,_,r,h,4),this._addBezier2(o,h,c,s,4),t.push(o);break}case"CurvedParallelTicks":{const s=this._cp2(i,-4,1),h=this._cp3(i,s,.882353,-1.94),e=this._sub(h,s);this._crossProduct(e,this._sub(_,s))>0?this._rightPerpendicular(e):this._leftPerpendicular(e);const r=[e[0]/8,e[1]/8],c=this._sub(this._mid(s,h),r),o=this._sub(this._mix(s,.75,h,.25),r),u=this._sub(this._mix(s,.25,h,.75),r),a=[s];this._addBezier2(a,s,o,c,3),this._addBezier2(a,c,u,h,3),t.push(a);for(let i=0;i<8;i++){const s=a[2*i+1],h=[this._clone(s)];h.push(this._add(s,[e[0]/4,e[1]/4])),t.push(h)}break}case"Arc90Degrees":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,1),e=[s];this._add90DegArc(e,s,_,h),t.push(e);break}case"TipWithPerpendicularAndTicks":{const[s,h]=this._arrowLastSeg(i),e=10*this._geomUnitsPerPoint,r=this._sub(_,s),c=this._norm(r);this._normalize(r);let o=this._crossProduct(r,this._sub(h,s)),u=this._dotProduct(r,this._sub(h,s));u<.05*c?u=.05*c:u>.95*c-e&&(u=.95*c-e);const a=this._leftPerp(r),n=[_[0]-r[0]*e,_[1]-r[1]*e],p=.5*Math.max(c-u-e,e);o=Math.abs(o);const d=[];d.push([n[0]+a[0]*(o+p)-r[0]*p,n[1]+a[1]*(o+p)-r[1]*p]),d.push([n[0]+a[0]*o,n[1]+a[1]*o]),d.push([n[0]-a[0]*o,n[1]-a[1]*o]),d.push([n[0]-a[0]*(o+p)-r[0]*p,n[1]-a[1]*(o+p)-r[1]*p]),t.push(d),t.push([n,_]);break}case"ConcentricCircles":{const s=this._cp2(i,1,0),e=this._cp3(i,s,2,0),c=Math.cos(Math.PI/18),o=Math.sin(Math.PI/18);let u=this._dist(s,_),a=[u,0],n=[];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);if(t.push(n),h>=4){n=[];const s=i[3];u=this._dist(s,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),0===t&&(n.push(this._add(_,a)),r(n[1],1)),this._rotateDirect(a,c,o);t.push(n)}n=[],u=this._dist(e,_),a=[u,0];for(let t=0;t<=36;t++)n.push(this._add(_,a)),this._rotateDirect(a,c,o);t.push(n);break}case"DoubleJogArrow":{_=this._arrowPath(i)[0];const[s,h]=this._arrowLastSeg(i),e=this._sub(_,s),r=this._norm(e);this._normalize(e);const c=Math.abs(this._crossProduct(e,this._sub(h,_)));let o=Math.abs(this._dotProduct(e,this._sub(h,_)));o<.05*r?o=.05*r:o>.95*r&&(o=.95*r);const u=Math.max(c,o),a=this._leftPerp(e);let n=[];const p=[_[0]-e[0]*o*.5+a[0]*c*.5,_[1]-e[1]*o*.5+a[1]*c*.5];n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),p[0]-=a[0]*u*.25,p[1]-=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5+a[0]*u*.4,p[1]+=e[1]*u*.5+a[1]*u*.4,n.push([p[0],p[1]]),t.push(n),n=[],p[0]=_[0]-e[0]*o*.5-a[0]*c*.5,p[1]=_[1]-e[1]*o*.5-a[1]*c*.5,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),p[0]+=a[0]*u*.25,p[1]+=a[1]*u*.25,n.push([p[0],p[1]]),p[0]+=e[0]*u*.5-a[0]*u*.4,p[1]+=e[1]*u*.5-a[1]*u*.4,n.push([p[0],p[1]]),t.push(n);break}case"LinkedChevrons":{const s=this._cp2(i,-5,0),h=this._cp3(i,s,-.2,1),e=this._sub(_,s);this._normalize(e);const r=this._leftPerp(e),c=Math.abs(this._crossProduct(e,this._sub(h,s)));t.push([s,_]);const o=[];o.push([_[0]-e[0]*c+r[0]*c,_[1]-e[1]*c+r[1]*c]),o.push(_),o.push([_[0]-e[0]*c-r[0]*c,_[1]-e[1]*c-r[1]*c]),t.push(o),this._addDash(t,s,[-e[0]*c+r[0]*c,-e[1]*c+r[1]*c]),this._addDash(t,s,[-e[0]*c-r[0]*c,-e[1]*c-r[1]*c]);break}case"SegmentThenHalfCircle":{const s=this._cp2(i,2,0),e=this._cp3(i,s,1.5,0);let r;r=h>=4?i[3]:this._cp3(i,s,1.25,-.5);const c=this._sub(s,_);this._normalize(c);const o=.5*this._dist(s,e),u=this._crossProduct(c,this._sub(r,_))>0,a=Math.cos(Math.PI/18);let n=Math.sin(Math.PI/18);u&&(n=-n);const p=[_,s];c[0]*=o,c[1]*=o;const d=this._add(s,c);c[0]=-c[0],c[1]=-c[1];for(let t=1;t<=18;t++)this._rotateDirect(c,a,n),p.push(this._add(d,c));t.push(p);break}case"LineWithStraightTicks":{const s=this._cp2(i,-2,1),h=this._cp3(i,s,-1,-.5),e=this._sub(h,s);this._normalize(e);const r=this._dotProduct(e,this._sub(s,_)),c=this._dotProduct(e,this._sub(h,_));let o=[_];o.push([_[0]+e[0]*r,_[1]+e[1]*r]),o.push(s),t.push(o),o=[_],o.push([_[0]+e[0]*c,_[1]+e[1]*c]),o.push(h),t.push(o);break}case"DoubleCurve":{const s=this._cp2(i,-5,-1),h=this._cp3(i,s,2,0),e=Math.atan2(1,5),c=Math.cos(e),o=Math.sin(e),u=this._sub(s,_),a=this._dist(_,s);this._normalize(u),this._rotateDirect(u,c,-o);const n=[_];n.push([_[0]+u[0]*a*.5,_[1]+u[1]*a*.5]),r(n[1],1),n.push([_[0]+u[0]*a*.8,_[1]+u[1]*a*.8]),this._addBezier2(n,n[2],[_[0]+u[0]*a,_[1]+u[1]*a],s,3);const p=this._sub(h,s),d=this._dist(s,h);this._normalize(p),this._rotateDirect(p,c,-o),this._addBezier2(n,s,[h[0]-p[0]*d,h[1]-p[1]*d],[h[0]-p[0]*d*.8,h[1]-p[1]*d*.8],3),n.push(h),t.push(n);break}case"ParallelWithTicksByWidth":{const s=this._cp2(i,0,-1),h=this._cp3(i,s,.5,3),e=this._sub(s,_);this._normalize(e);const r=this._crossProduct(e,this._sub(h,_));this._leftPerpendicular(e),r>0?(this._addAngledTicks(t,_,[_[0]+e[0]*r,_[1]+e[1]*r],s),this._addAngledTicks(t,s,[s[0]+e[0]*r,s[1]+e[1]*r],_)):(this._addAngledTicks(t,[_[0]+e[0]*r,_[1]+e[1]*r],_,s),this._addAngledTicks(t,[s[0]+e[0]*r,s[1]+e[1]*r],_,s));break}case"EnclosingRoundedRectangle":{const s=this._cp2(i,3,-2),t=[Math.min(_[0],s[0]),Math.max(_[1],s[1])],h=[Math.max(_[0],s[0]),Math.min(_[1],s[1])],e=h[0]-t[0],r=t[1]-h[1],c=Math.min(e,r)/10,o=[];o.push([t[0]+c+.75*(e-2*c),t[1]]),o.push([h[0]-c,t[1]]),this._add90DegArc(o,[h[0]-c,t[1]],[h[0],t[1]-c],[h[0],t[1]]),o.push([h[0],h[1]+c]),this._add90DegArc(o,[h[0],h[1]+c],[h[0]-c,h[1]],h),o.push([t[0]+c,h[1]]),this._add90DegArc(o,[t[0]+c,h[1]],[t[0],h[1]+c],[t[0],h[1]]),o.push([t[0],t[1]-c]),this._add90DegArc(o,[t[0],t[1]-c],[t[0]+c,t[1]],t),o.push([t[0]+c+.75*(e-2*c),t[1]]);break}case"ParallelOffsetByValue":{if(i.length<2||0===this._width)break;const s=this._offsetPath(i,.5*this._width);s&&t.push(s);const h=this._offsetPath(i,.5*-this._width);h&&t.push(h);break}default:t.push(i)}}return t}}function u(s){return"ParallelOffsetByValue"===s}export{c as EffectControlMeasureLine};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e){return new r(t,i,e)}}class r{constructor(t,i,e){this._inputGeometries=t,this._tileKey=e.tileKey,this._maxInflateSize=e.maxInflateSize*e.geomUnitsPerPoint,this._preventClipping=e.preventClipping,this._width=(void 0!==i.width?i.width:2)*e.geomUnitsPerPoint,i.method,this._option=i.option??"Accurate"}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const t=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const o={...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},m=t.execute(o,-this._width);if(m)for(const i of m.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
2
+ import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import i from"../../../geometry/SpatialReference.js";import{lazyBufferOperator as e,clipCursorToTileExtent as n}from"../CIMEffects.js";class s{static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,i,e){return new r(t,i,e)}}class r{constructor(t,i,e){this._inputGeometries=t,this._tileKey=e.tileKey,this._maxInflateSize=e.maxInflateSize*e.geomUnitsPerPoint,this._preventClipping=e.preventClipping,this._width=(void 0!==i.width?i.width:2)*e.geomUnitsPerPoint,i.method,this._option=i.option??"Accurate"}next(){let s;for(;s=this._inputGeometries.next();){if("esriGeometryEnvelope"===s.geometryType&&this._width>0){const i=s.asJSON();return Math.min(i.xmax-i.xmin,i.ymax-i.ymin)-2*this._width<0?s:t.fromJSONCIM({paths:[[[i.xmin+this._width,i.ymin+this._width],[i.xmax-this._width,i.ymin+this._width],[i.xmax-this._width,i.ymax-this._width],[i.xmin+this._width,i.ymax-this._width],[i.xmin+this._width,i.ymin+this._width]],[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]})}if("esriGeometryPolygon"===s.geometryType){if(0===this._width)return s.clone();const{bufferExecute:t}=e.module,r=!this._preventClipping&&this._tileKey?n(s,this._maxInflateSize,!0):s.clone();if(!r)continue;const o=t({...r.asJSON(),spatialReference:{wkid:i.WebMercator.wkid}},-this._width);if(o)for(const i of o.rings)if(i){r.startPath();for(const t of i.reverse())r.pushXY(t[0],r.yFactor*t[1])}return r}}return null}}export{s as EffectDonut};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t,r){return new s(e,t,r)}}class s{constructor(e,t,r){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const o=n.module,s={...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}},i=o.execute(s);return i?e.fromJSONCIM(i):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import t from"../../../geometry/SpatialReference.js";import{getCursorBoundsXY as r}from"../../../geometry/support/boundsUtils.js";import{lazyConvexHullOperator as n}from"../CIMEffects.js";class o{static{this.instance=null}static local(){return null===o.instance&&(o.instance=new o),o.instance}execute(e,t,r){return new s(e,t,r)}}class s{constructor(e,t,r){this._inputGeometries=e,this._medhod=t.method}next(){let e=this._inputGeometries.next();const t=this._medhod;for(;null!=e;){if(e.totalSize>0)switch(t){case"RectangularBox":return i(e);case"ConvexHull":return this._constructConvexHull(e);default:return u(e)}e=this._inputGeometries.next()}return null}_constructConvexHull(r){switch(r.geometryType){case"esriGeometryPolyline":case"esriGeometryPolygon":{const{convexHullExecute:o}=n.module,s=o({...r.asJSON(),spatialReference:{wkid:t.WebMercator.wkid}});return s?e.fromJSONCIM(s):null}case"esriGeometryEnvelope":return r;default:return null}}}function i(t){const n=r(t),o={xmin:n[0],ymin:n[1],xmax:n[2],ymax:n[3]};return e.fromJSONCIM(o)}function u(t){switch(t.geometryType){case"esriGeometryPolyline":{const r=[];for(;t.nextPath();)l(t,r);return e.fromJSONCIM({rings:r})}case"esriGeometryPolygon":case"esriGeometryEnvelope":return t;default:return null}}function l(e,t){if(e.seekPathStart(),!e.nextPoint())return;const r=e.x,n=e.y,o=[[r,n]];for(t.push(o);e.nextPoint();)o.push([e.x,e.y]);o.push([r,n])}export{o as EffectEnclosingPolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as i,lazySimplifyOGCOperator as o,lazyOffsetOperator as n,lazyGraphicBufferOperator as m}from"../CIMEffects.js";import{CurveHelper as f,pixelTolerance as l}from"../CurveHelper.js";const a=10;class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(e,t,r){return new c(e,t,r)}}class c{constructor(e,t,r){const s=r.geomUnitsPerPoint,i=r.maxInflateSize;this._preventClipping=r.preventClipping,this._inputGeometries=e,this._tileKey=r.tileKey,this._curveHelper=new f,this._offset=(t.offset??1)*s,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(i*s),a),this._offsetFlattenError=l*s}next(){let f;for(;f=this._inputGeometries.next();){if(0===this._offset)return f.clone();if("esriGeometryEnvelope"===f.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(f),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const t=e.createEmptyOptimizedCIM(f.geometryType);return t.pushPath(s),t}return null}const r=f.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const l=!this._preventClipping&&this._tileKey?i(f,this._maxInflateSize,!0):f.clone();if(!l)continue;const a=o.module,u=n.module,c=m.module,p=a.execute({...l.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}});if(!p)continue;let _,y=h(this._method);return"esriGeometryPolygon"===f.geometryType?("square"===y&&(y="bevel"),_=c.executeMany([p],[this._offset],y,"round")[0]):_=u.execute(p,-this._offset,{joins:y,flattenError:this._offsetFlattenError,miterLimit:4}),_?e.fromJSONCIM(_):null}return null}}function h(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{u as EffectOffset};
2
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as i}from"../../../geometry/support/jsonTypeUtils.js";import{clipCursorToTileExtent as s,lazySimplifyOGCOperator as o,lazyOffsetOperator as n,lazyGraphicBufferOperator as f}from"../CIMEffects.js";import{CurveHelper as m,pixelTolerance as l}from"../CurveHelper.js";const a=10;class u{static{this.instance=null}static local(){return null===u.instance&&(u.instance=new u),u.instance}execute(e,t,r){return new c(e,t,r)}}class c{constructor(e,t,r){const i=r.geomUnitsPerPoint,s=r.maxInflateSize;this._preventClipping=r.preventClipping,this._inputGeometries=e,this._tileKey=r.tileKey,this._curveHelper=new m,this._offset=(t.offset??1)*i,this._method=t.method??"Square",this._maxInflateSize=Math.max(Math.abs(s*i),a),this._offsetFlattenError=l*i}next(){let m;for(;m=this._inputGeometries.next();){if(0===this._offset)return m.clone();if("esriGeometryEnvelope"===m.geometryType){if("Rounded"===this._method&&this._offset>0){const r=t(m),i=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(i){const t=e.createEmptyOptimizedCIM(m.geometryType);return t.pushPath(i),t}return null}const r=m.asJSON();if(i(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const l=!this._preventClipping&&this._tileKey?s(m,this._maxInflateSize,!0):m.clone();if(!l)continue;const{simplifyOGCExecute:a}=o.module,{offsetExecute:u}=n.module,{graphicBufferExecuteMany:c}=f.module,p=a({...l.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}});if(!p)continue;let y,_=h(this._method);return"esriGeometryPolygon"===m.geometryType?("square"===_&&(_="bevel"),y=c([p],[this._offset],_,"round")[0]):y=u(p,-this._offset,{joins:_,flattenError:this._offsetFlattenError,miterLimit:4}),y?e.fromJSONCIM(y):null}return null}}function h(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{u as EffectOffset};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonTypeUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0;const o=s.geomUnitsPerPoint;this._geomUnitsPerPoint=o,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*o*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*o*.5,this._originalLength=(void 0!==t.length?t.length:0)*o,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.getCurrentPath().asJSON(),h=a.module.execute(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),y=null==h?null:i(h)?h.rings:l(h)?h.paths:null;if(!y)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const f=c.module.execute(h);if((0===this._originalLength||this._originalLength>f)&&f>0){this._length=f;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const m=[];for(const e of y){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();m.push([...i,...l.reverse()])}const x={rings:m,spatialReference:{wkid:o.WebMercator.wkid}},d=_.module.execute(x);return s.fromJSONCIM(d)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
2
+ import e from"../../../core/Error.js";import t from"../../../core/Logger.js";import{GeometryCursor as s}from"../../../geometry/GeometryCursor.js";import o from"../../../geometry/SpatialReference.js";import{isPolygon as i,isPolyline as l}from"../../../geometry/support/jsonTypeUtils.js";import r from"../../../geometry/support/PolylineBuilder.js";import{Point as n}from"../../../geometry/support/TileClipper.js";import{PathEffectCursor as h}from"../CIMCursor.js";import{lazyGeneralizeOperator as a,lazyLengthOperator as c,lazySimplifyOperator as _}from"../CIMEffects.js";const p=()=>t.getLogger("esri.symbols.cim.effects.EffectTaperedPolygon");class y{static{this.instance=null}static local(){return null===y.instance&&(y.instance=new y),y.instance}execute(e,t,s){return new f(e,t,s)}}class f extends h{constructor(e,t,s){super(e,!1,!0),this._slopeS=0,this._slopeC=1,this._lastTangent1=new n(NaN,NaN),this._lastWidth=0;const o=s.geomUnitsPerPoint;this._geomUnitsPerPoint=o,this._halfFromWidth=Math.abs(void 0!==t.fromWidth?t.fromWidth:0)*o*.5,this._halfToWidth=Math.abs(void 0!==t.toWidth?t.toWidth:1)*o*.5,this._originalLength=(void 0!==t.length?t.length:0)*o,this._length=0}processPath(t){if(t.totalSize<=0)return null;if(this._halfFromWidth<=0&&this._halfToWidth<=0){const e=s.createEmptyOptimizedCIM("esriGeometryPolygon",!1,!1,t.yFactor);for(t.seekPathEnd();t.prevPoint();)e.pushXY(t.x,t.y);for(t.seekPathStart();t.nextPoint();)e.pushXY(t.x,t.y);return e}const n=t.getCurrentPath().asJSON(),{generalizeExecute:h}=a.module,y=h(n,.25*this._geomUnitsPerPoint,{removeDegenerateParts:!0}),f=null==y?null:i(y)?y.rings:l(y)?y.paths:null;if(!f)return p().error(new e("mapview-bad-resource","Unable to process geometry")),null;const{lengthExecute:m}=c.module,x=m(y);if((0===this._originalLength||this._originalLength>x)&&x>0){this._length=x;const e=(this._halfToWidth-this._halfFromWidth)/this._length;if(Math.abs(e)<1){const t=e*e;this._slopeC=Math.sqrt(1/(1+t)),this._slopeS=Math.sqrt(t/(1+t)),e<0&&(this._slopeS=-this._slopeS)}else this._slopeC=this._slopeS=.7071}else this._length=this._originalLength,this._slopeC=1,this._slopeS=0;const d=[];for(const e of f){const t=new r,s=new r;let o=0;this._setFromOffset(e.slice(0,2),t,s);for(let r=0,n=3;n<=e.length;++r,++n)o=this._setOffset(e.slice(r,n),o,t,s);this._setToOffset(e.slice(-2),o,t,s);const[i]=t.getGeometry(),[l]=s.getGeometry();d.push([...i,...l.reverse()])}const g={rings:d,spatialReference:{wkid:o.WebMercator.wkid}},{simplifyExecute:u}=_.module,T=u(g);return s.fromJSONCIM(T)}_setFromOffset([[e,t],[s,o]],i,l){const r=this._halfFromWidth,h=new n(s-e,o-t).normalize().scale(r);i.beginPath([e-h.y,t+h.x]),l.beginPath([e+h.y,t-h.x])}_setToOffset([[e,t],[s,o]],i,l,r){let h;h=(i+=Math.sqrt((s-e)**2+(o-t)**2))>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*i/this._length;const a=new n(s-e,o-t).normalize().scale(h);l.lineTo([s-a.y,o+a.x]),r.lineTo([s+a.y,o-a.x])}_setOffset([[t,s],[o,i],[l,r]],h,a,c){const _=Math.sqrt((o-t)**2+(i-s)**2);let y;y=h+_>=this._length?this._halfToWidth:this._halfFromWidth+(this._halfToWidth-this._halfFromWidth)*(h+_)/this._length,h+=_;const f=new n(o,i),m=new n(o-t,i-s).normalize(),x=new n(l-o,r-i).normalize(),d=n.sub(x,m),g=a.getPointCount(),u=c.getPointCount();m.leftPerpendicular(),x.leftPerpendicular();const T=m.x*x.x+m.y*x.y;if(T>.99){const e=n.add(m,x).scale(y/2),t=e.clone().rotate(this._slopeC,this._slopeS);a.lineTo([f.x+t.x,f.y+t.y]);const s=e.rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x-s.x,f.y-s.y])}else{const o=m.x*x.y-m.y*x.x;if(d.scale(1/o),o<0){d.scale(-y).rotateReverse(this._slopeC,this._slopeS);const t=c.getXY(u-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS),t=x.clone().scale(-y).rotateReverse(this._slopeC,this._slopeS);c.lineTo([f.x+e.x,f.y+e.y]),c.lineTo([f.x,f.y]),c.lineTo([f.x+t.x,f.y+t.y])}else c.lineTo([f.x+d.x,f.y+d.y])}else{d.scale(y).rotate(this._slopeC,this._slopeS);const t=a.getXY(g-1);t||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const s=n.add(f,d).sub(n.fromArray(t));if(m.x*s.y-m.y*s.x>0){const e=m.clone().scale(y).rotate(this._slopeC,this._slopeS),t=x.clone().scale(y).rotate(this._slopeC,this._slopeS);a.lineTo([f.x+e.x,f.y+e.y]),a.lineTo([f.x,f.y]),a.lineTo([f.x+t.x,f.y+t.y])}else a.lineTo([f.x+d.x,f.y+d.y])}const i=Math.acos(T);let l=1;if(y>.25){const e=2*Math.acos(1-.25/y);e<i&&(l=Math.round(i/e))}const r=Math.cos(i/l),h=Math.sin(i/l),_=m.clone();if(o<0){_.rotate(this._slopeC,this._slopeS);const o=a.getXY(g-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(this._lastWidth);o.rotate(this._slopeC,this._slopeS);const i=m.clone().scale(this._lastWidth);i.rotate(this._slopeC,this._slopeS),a.lineTo([e.x+o.x,e.y+o.y]),a.lineTo([e.x,e.y]),a.lineTo([e.x+i.x,e.y+i.y])}}else{_.scale(-1).rotateReverse(this._slopeC,this._slopeS);const o=c.getXY(u-1);o||p().error(new e("mapview-bad-resource","Unable to process geometry, index out of scope"));const i=n.add(f,_.clone().scale(this._lastWidth)),l=n.sub(i,n.fromArray(o)),r=m.x*l.y-m.y*l.x;if(!isNaN(this._lastTangent1.x)&&!isNaN(this._lastTangent1.y)&&r>0){const e=new n(t,s),o=this._lastTangent1.clone().scale(-this._lastWidth);o.rotateReverse(this._slopeC,this._slopeS);const i=m.clone().scale(-this._lastWidth);i.rotateReverse(this._slopeC,this._slopeS),c.lineTo([e.x+o.x,e.y+o.y]),c.lineTo([e.x,e.y]),c.lineTo([e.x+i.x,e.y+i.y])}}_.scale(y);for(let e=0;e<=l;e++)o<0?(a.lineTo([f.x+_.x,f.y+_.y]),_.rotateReverse(r,h)):(c.lineTo([f.x+_.x,f.y+_.y]),_.rotate(r,h))}return this._lastTangent1.setCoords(m.x,m.y),this._lastWidth=y,h}}export{y as EffectTaperedPolygon};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../geometry/Polyline.js";import{load as p,execute as c}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{load as d,execute as f}from"../../../../geometry/operators/projectOperator.js";import{execute as g}from"../../../../geometry/operators/simplifyOperator.js";import{GeometryWorkerHandle as y}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as h}from"../../../support/measurementWorkerUtils.js";const j=o(1e5,"meters");async function w(e,t,r){if(!e?.rings.length||!e.rings[0].length)return null;await d();const s=f(e,t);return s?0===h(t)?_(s,r):v(s,r):null}async function _(e,t){await p();const r=g(e);if(!r)return null;const s=H(r),i=c(r,j.value,{unit:j.unit});if(!i)return null;const n=c(s,j.value,{unit:j.unit});if(!n)return null;const{area:a,length:u}=await t.geodeticArea(e,{unit:"square-meters",returnLength:!0});return{area:a,display:{fill:i,outline:n},mode:"geodesic",perimeter:u??o(0,"meters")}}async function v(e,t){const r=g(e);if(!r)return null;const s=H(r),{area:i,length:n}=await t.area2D(e,{unit:"square-meters",returnLength:!0});return{area:i,display:{fill:r,outline:s},mode:"euclidean",perimeter:n??o(0,"meters")}}function H(e){return new m({spatialReference:e.spatialReference,paths:e.rings})}let k=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new l,this._measurementWorker=new y({preloadGeodetic:!0}),this._debouncedGetResult=r(async e=>{this._result=await w(e,this.view.spatialReference,this._measurementWorker)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],k.prototype,"_result",void 0),e([a()],k.prototype,"measurementViewData",void 0),e([a()],k.prototype,"result",null),e([a()],k.prototype,"updating",null),e([a()],k.prototype,"view",void 0),k=e([u("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementController")],k);export{k as AreaMeasurementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import m from"../../../../geometry/Polyline.js";import{geodeticDensifyLoad as p,geodeticDensifyExecute as c}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{projectLoad as d,projectExecute as f}from"../../../../geometry/operators/projectOperator.js";import{simplifyExecute as g}from"../../../../geometry/operators/simplifyOperator.js";import{GeometryWorkerHandle as y}from"../../../support/GeometryWorkerHandle.js";import{autoMeasurementMode as h}from"../../../support/measurementWorkerUtils.js";const j=o(1e5,"meters");async function w(e,t,r){if(!e?.rings.length||!e.rings[0].length)return null;await d();const s=f(e,t);return s?0===h(t)?_(s,r):v(s,r):null}async function _(e,t){await p();const r=g(e);if(!r)return null;const s=H(r),i=c(r,j.value,{unit:j.unit});if(!i)return null;const n=c(s,j.value,{unit:j.unit});if(!n)return null;const{area:a,length:u}=await t.geodeticArea(e,{unit:"square-meters",returnLength:!0});return{area:a,display:{fill:i,outline:n},mode:"geodesic",perimeter:u??o(0,"meters")}}async function v(e,t){const r=g(e);if(!r)return null;const s=H(r),{area:i,length:n}=await t.area2D(e,{unit:"square-meters",returnLength:!0});return{area:i,display:{fill:r,outline:s},mode:"euclidean",perimeter:n??o(0,"meters")}}function H(e){return new m({spatialReference:e.spatialReference,paths:e.rings})}let k=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new l,this._measurementWorker=new y({preloadGeodetic:!0}),this._debouncedGetResult=r(async e=>{this._result=await w(e,this.view.spatialReference,this._measurementWorker)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy(),this._measurementWorker.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],k.prototype,"_result",void 0),e([a()],k.prototype,"measurementViewData",void 0),e([a()],k.prototype,"result",null),e([a()],k.prototype,"updating",null),e([a()],k.prototype,"view",void 0),k=e([u("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementController")],k);export{k as AreaMeasurementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{isSupported as p,geodesicDensify as m,geodesicLengths as c}from"../../../../geometry/geodesicUtils.js";import{load as d,execute as g}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{load as f,execute as y}from"../../../../geometry/operators/geodeticLengthOperator.js";import{execute as h}from"../../../../geometry/operators/lengthOperator.js";import{load as j,execute as _}from"../../../../geometry/operators/projectOperator.js";import{execute as v}from"../../../../geometry/operators/simplifyOperator.js";const w=o(1e5,"meters");async function x(e,t){if(!e?.paths.length||!e.paths[0].length)return null;await j();const r=_(e,t);return r?r.spatialReference.isGeographic?p(r.spatialReference)?R(r):H(r):r.spatialReference.isWebMercator?H(r):D(r):null}async function H(e){await Promise.all([d(),f()]);const t=v(e);if(!t)return null;const r=g(t,w.value,{unit:w.unit});if(!r)return null;const s=y(t,{unit:"meters"});return{display:{outline:r},mode:"geodesic",length:o(s,"meters")}}function R(e){const t=v(e);if(!t)return null;const r=m(t,w.value),s=c([t],"meters")[0];return{display:{outline:r},mode:"geodesic",length:o(s,"meters")}}function D(e){const t=v(e);if(!t)return null;const r=h(t,{unit:"meters"});return{display:{outline:t},mode:"euclidean",length:o(r,"meters")}}let O=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new u,this._debouncedGetResult=r(async e=>{this._result=await x(e,this.view.spatialReference)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(s(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],O.prototype,"_result",void 0),e([a()],O.prototype,"measurementViewData",void 0),e([a()],O.prototype,"result",null),e([a()],O.prototype,"updating",null),e([a()],O.prototype,"view",void 0),O=e([l("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementController")],O);export{O as DistanceMeasurementController};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{debounce as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{createLength as s}from"../../../../core/quantity.js";import{watch as i,syncAndInitial as n}from"../../../../core/reactiveUtils.js";import{property as a,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as u}from"../../../../core/support/UpdatingHandles.js";import{isSupported as p,geodesicDensify as m,geodesicLengths as c}from"../../../../geometry/geodesicUtils.js";import{geodeticDensifyLoad as d,geodeticDensifyExecute as g}from"../../../../geometry/operators/geodeticDensifyOperator.js";import{geodeticLengthLoad as f,geodeticLengthExecute as y}from"../../../../geometry/operators/geodeticLengthOperator.js";import{lengthExecute as h}from"../../../../geometry/operators/lengthOperator.js";import{projectLoad as j,projectExecute as _}from"../../../../geometry/operators/projectOperator.js";import{simplifyExecute as v}from"../../../../geometry/operators/simplifyOperator.js";const w=s(1e5,"meters");async function H(e,t){if(!e?.paths.length||!e.paths[0].length)return null;await j();const r=_(e,t);return r?r.spatialReference.isGeographic?p(r.spatialReference)?D(r):R(r):r.spatialReference.isWebMercator?R(r):O(r):null}async function R(e){await Promise.all([d(),f()]);const t=v(e);if(!t)return null;const r=g(t,w.value,{unit:w.unit});if(!r)return null;const o=y(t,{unit:"meters"});return{display:{outline:r},mode:"geodesic",length:s(o,"meters")}}function D(e){const t=v(e);if(!t)return null;const r=m(t,w.value),o=c([t],"meters")[0];return{display:{outline:r},mode:"geodesic",length:s(o,"meters")}}function O(e){const t=v(e);if(!t)return null;const r=h(t,{unit:"meters"});return{display:{outline:t},mode:"euclidean",length:s(r,"meters")}}let b=class extends t{constructor(e){super(e),this._result=null,this._updatingHandles=new u,this._debouncedGetResult=r(async e=>{this._result=await H(e,this.view.spatialReference)})}initialize(){this.addHandles(i(()=>this.measurementViewData.analysis.geometry,e=>{this._updatingHandles.consumePromise(o(this._debouncedGetResult(e)))},n))}destroy(){this._updatingHandles.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],b.prototype,"_result",void 0),e([a()],b.prototype,"measurementViewData",void 0),e([a()],b.prototype,"result",null),e([a()],b.prototype,"updating",null),e([a()],b.prototype,"view",void 0),b=e([l("esri.views.2d.analysis.DistanceMeasurement.DistanceMeasurementController")],b);export{b as DistanceMeasurementController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when as d}from"../../../../core/reactiveUtils.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isVideoElement as p}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import{createPlayer as c,updateIfNeeded as f}from"./animatedFormats/utils.js";import y from"../../../webgl/Texture.js";import{TextureDescriptor as w}from"../../../webgl/TextureDescriptor.js";const x=[1,1],_=l(),v={none:"None",loop:"Loop",oscillate:"Oscillate"};function A(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?v[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class g extends u{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=h(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),d(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),p(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},a)]),n.element.load().catch(t=>{i.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return x}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}else"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new w(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new y(t,e,r)};if("animationOptions"in this.elementView.element){const e=A(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=c(r,e,null,i)}}else this.texture=new y(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&f(e,this._player),t.render(e,{config:{perspective:this.perspectiveTransform,texSize:x,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity},texture:{texture:this.texture,unit:0},position:this._vertices,tex:this._indices})):this.requestRender()}updateDrawCoords(e,t,r,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,d,l]=s.rings[0],m=this._vertices,{x:h,y:p}=e;m.set([a[0]-h,a[1]-p,o[0]-h,o[1]-p,d[0]-h,d[1]-p,l[0]-h,l[1]-p]);let u=t;if(i){const[e,,t]=n,{worldWidth:r,xBounds:s}=i,[o,a]=s;e<o&&t>o?u=r:t>a&&e<a&&(u=-r)}this.wrapAroundShift=u,this.isWrapAround=0!==u}_updatePerspectiveTransform(e,t){const r=this._vertices;n(_,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,_[6]/_[8]*e,_[7]/_[8]*t)}}export{g as default};
2
+ import e from"../../../../core/Error.js";import{on as t}from"../../../../core/events.js";import r from"../../../../core/Handles.js";import i from"../../../../core/Logger.js";import{disposeMaybe as s}from"../../../../core/maybe.js";import{getProjectiveTransform as n}from"../../../../core/perspectiveUtils.js";import{watch as o,initial as a,when as l}from"../../../../core/reactiveUtils.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as m}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{getClosestDenormalizedXToReference as h}from"../../../../geometry/support/normalizeUtils.js";import{isVideoElement as u}from"../../../../support/mediaLayerUtils.js";import{DisplayObject as c}from"../DisplayObject.js";import{createPlayer as f,updateIfNeeded as y}from"./animatedFormats/utils.js";import w from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";const _=[1,1],v=d(),g={none:"None",loop:"Loop",oscillate:"Oscillate"};function A(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?g[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}class R extends c{constructor(n){super(),this.elementView=n,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=p(),this._handles=new r,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._playAnimation=!0,this._handles.add([o(()=>this.elementView.element.opacity,e=>this.opacity=e,a),o(()=>[this.elementView.coords],()=>{this.requestRender()},a),o(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this.texture=s(this.texture),this.requestRender()},a),l(()=>this.elementView.element.loaded,()=>{const e=this.elementView.element;this.ready(),u(e)&&null!=e.content&&(this._handles.add([t(e.content,"play",()=>this.requestRender()),t(e.content,"loadeddata",()=>this.requestRender()),t(e.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in e.content?e.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([t(e.content,"seeked",()=>this.requestRender())]),this.requestRender())},a)]),n.element.load().catch(t=>{i.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new e("element-load-error","Element cannot be displayed",{element:n,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this._handles.destroy(),this.texture=s(this.texture)}get textureSize(){return _}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(null!=r){const i=r instanceof HTMLImageElement,s=r instanceof HTMLVideoElement,n=i?r.naturalWidth:s?r.videoWidth:r.width,o=i?r.naturalHeight:s?r.videoHeight:r.height;if(this._updatePerspectiveTransform(n,o),this.texture)if(s)if(r.readyState>=r.HAVE_CURRENT_DATA)e.animationsEnabled&&this._updateTextureAndRequestRender(r);else{const e=()=>{this._updateTextureAndRequestRender(r),r.removeEventListener("canplay",e),r.removeEventListener("seeked",e)};r.addEventListener("canplay",e),r.addEventListener("seeked",e)}else"getFrame"in r&&e.animationsEnabled&&this.requestRender();else{const e=new x(n,o);if(e.wrapMode=33071,e.preMultiplyAlpha=!0,"getFrame"in r){const i=r=>{this.texture?this.texture.setData(r):this.texture=new w(t,e,r)};if("animationOptions"in this.elementView.element){const e=A(this.elementView.element.animationOptions);this._playAnimation=e.playAnimation??!1,this._player=f(r,e,null,i)}}else this.texture=new w(t,e,r);this.texture.generateMipmap(),s&&this._requestVideoFrame(r)}}super.beforeRender(e)}_updateTextureAndRequestRender(e){this.texture.setData(e),this.texture.generateMipmap(),this._requestVideoFrame(e)}_requestVideoFrame(e){"requestVideoFrameCallback"in e?e.requestVideoFrameCallback(()=>this.requestRender()):e.paused||this.requestRender()}_createTransforms(){return null}draw(e,t){this.isReady&&null!=this.texture?(this._playAnimation&&y(e,this._player),t.render(e,{config:{perspective:this.perspectiveTransform,texSize:_,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity},texture:{texture:this.texture,unit:0},position:this._vertices,tex:this._indices})):this.requestRender()}updateDrawCoords(e,t,r,i){const{coords:s,bounds:n}=this.elementView;if(null==s||null==n)return;const[o,a,l,d]=s.rings[0],m=this._vertices,p=(n[0]+n[2])/2,u=h(e.x,p,s.spatialReference),c=e.y,f=e.x-u;m.set([a[0]-u,a[1]-c,o[0]-u,o[1]-c,l[0]-u,l[1]-c,d[0]-u,d[1]-c]);let y=t;if(i){const e=n[0]+f,t=n[2]+f,{worldWidth:r,xBounds:s}=i,[o,a]=s;e<o?y=r:t>a&&(y=-r)}this.wrapAroundShift=y,this.isWrapAround=0!==y}_updatePerspectiveTransform(e,t){const r=this._vertices;n(v,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),m(this.perspectiveTransform,v[6]/v[8]*e,v[7]/v[8]*t)}}export{R as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as h}from"../../../webgl/FramebufferObject.js";import u from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO??=new h(t,n),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-_;b>0&&f>0&&i.copyToTexture(m,_,b,f,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],b=u/m;if(_>b){const e=b/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/b*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const f=new Array(h),x=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);f[t]=i(s,x)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of f){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],k=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(k[1]),0),this.readbackScreenCoords[2]=Math.ceil(k[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
2
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{projectLoad as s,projectExecute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{ColorAttachment0 as c,SizedPixelFormat as d}from"../../../webgl/enums.js";import{DisposableFramebufferObject as h}from"../../../webgl/FramebufferObject.js";import u from"../../../webgl/Texture.js";import{TextureDescriptor as l}from"../../../webgl/TextureDescriptor.js";class m extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._ndcRect=[0,0,2,2],this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){super.destroy(),e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(e),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new l(i,a);return n.samplingMode=9729,n.wrapMode=33071,this._acquiredFBO??=new h(t,n),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,d=Math.round(r*n[0]),h=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=d+a.descriptor.width,l=h+a.descriptor.height,m=Math.max(d,0),_=Math.max(h,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-_;b>0&&f>0&&i.copyToTexture(m,_,b,f,m-d,_-h,a),t.bindFramebuffer(this._prevFBO)}_update(e){const{state:r}=e,a=this._controlPointsOwner,n=a.groundControlPoints(),c=a.getSize(),d=r.size,h=n?.length;if(!h)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const u=c[0],l=c[1],m=d[0],_=l/d[1],b=u/m;if(_>b){const e=b/_*2,t=(2-e)/2;this._ndcRect[0]=-1+t,this._ndcRect[1]=1,this._ndcRect[2]=e,this._ndcRect[3]=2}else{const e=_/b*2,t=(2-e)/2;this._ndcRect[0]=-1,this._ndcRect[1]=1-t,this._ndcRect[2]=2,this._ndcRect[3]=e}const f=new Array(h),x=r.spatialReference;for(let t=0;t<h;t++){const{lat:e,lon:r}=n[t],s=new o(r,e);f[t]=i(s,x)}const p=[];let M=1/0,g=1/0,w=-1/0,C=-1/0;for(const o of f){const e=t();r.toScreen(e,o.x,o.y),p.push({x:e[0],y:e[1]}),M=Math.min(M,e[0]),g=Math.min(g,e[1]),w=Math.max(w,e[0]),C=Math.max(C,e[1])}const R=[M,C],k=[w,g];this.readbackScreenCoords[0]=Math.max(Math.floor(R[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(k[1]),0),this.readbackScreenCoords[2]=Math.ceil(k[0]),this.readbackScreenCoords[3]=Math.ceil(R[1]);for(let t=0;t<p.length;t++){const e=p[t],r=(e.x-M)/(w-M),o=(C-e.y)/(C-g);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){this._readbackTexture&&this._hasCoordinates?this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,ndcRect:this._ndcRect}):this.requestRender()}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new l(o,s);e.wrapMode=33071,e.internalFormat=d.RGBA8,this._readbackTexture=new u(t,e)}return this._readbackTexture}}export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as r}from"../../../../../../../core/string.js";import{fromRotation as i,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as f,convertOptimizedGeometryToFlat as g,convertFlatToOptimizedGeometry as p,FlatGeometry as _}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as y}from"../../../../../../../geometry/GeometryCursor.js";import{importLazily as x}from"../../../../../../../geometry/operators/importUtils.js";import{getLabelPoint as v}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as P,convertToGeometry as b}from"../../../../../../../layers/graphics/featureConversionUtils.js";import M from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as w}from"../../../definitions.js";import L from"../../../collisions/BoundingBox.js";import{LabelMetric as I}from"../../../collisions/LabelMetric.js";import{smoothPaths as B,pathDivide as z}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as G,processColorInput as S}from"../fill/meshWriterUtils.js";import{TextMeshWriter as j,maxLabelZoom as D}from"../text/TextMeshWriter.js";const F=1,A=0,R=128,$=w*w/16,k=x(()=>import("../../../../../../../geometry/operators/gx/operatorIntersection.js")),C=x(()=>import("../../../../../../../chunks/FlatGeometry.js"));function O(e,t,i){return r(`${e}${t}${i}`)}function E(e,t,i,s,o){return r(`${e}${t}${i}${s*2**(D-o)}`)}function T(e,t,i){return r(`${e}${t}${i}`)}function X(e,t,i,s,o){return r(`${e}${o}${t}${i*2**(D-s)}`)}const Y=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class U extends j{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),k.getImportPromise(),C.getImportPromise()])}_write(e,{target:t,effectGeometry:r,level:i,viewExtent:s}){if(this._zoomLevel=i,null!=r)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),i=t.readYForDisplay();this._writePoint(e,r,i,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,s);break;case"esriGeometryMultipoint":{let r=0;const i=y.fromFeatureSetReader(t);if(i?.nextPath())for(;i.nextPoint();)this._writePoint(e,i.x,i.y,r++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,r,i,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new I(e,h,t,r,i,s,n,a,l,c,o)}_writePolygon(e,t,r){const i=k.module,s=C.module.constructFromFlatGeometry,o=t.readGeometryForDisplay()?.justXY(),n=t.readCentroidForDisplay()?.coords,a=o?.area()||0;if(!n)return;const l=a>=$;e.requiresRefresh||=l;const c=s(f(r)),h=s(f({x:n[0],y:n[1]})),m=!!i.execute(h,c,null);if(!o||!l||!m)return void this._writePoint(e,n[0],n[1],0,t);const u=s(g("polygon",o,null)),d=i.execute(u,c,null);if(!d)return void this._writePoint(e,n[0],n[1],0,t);const x=p(new _(d.toFlatGeometry())),P=y.fromOptimized(x,"esriGeometryPolygon",1),b=v(P)??n;this._writePoint(e,b[0],b[1],0,t)}_writePoint(e,t,r,i,s){if(t<0||t>w||r<0||r>w)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=O(this.evaluatedMeshParams.layerId,s.getObjectId(),i),c=T(s.getObjectId(),a,i),[h,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new I(n,a,l,c,t,r,h,m,u,d,f)),this._writeGlyphs(e,n,t,r,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:r,verticalAlignment:i}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,r,i)=>this._placeSubdivGlyphs(e,t,r,i),a=(o.bounds.width+s)/(1<<F);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:G(r,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===i?"above":"top"===i?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,r){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay()?.justXY();if(!n)return;const a=P(n,"esriGeometryPolyline",1)??new M,l=W(a,o),c=W(a,-o),h=b(c,"esriGeometryPolyline",!1,!1),m=b(l,"esriGeometryPolyline",!1,!1),u=B(m.paths,s.bounds.width),d=B(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,z(u[f],r,t,!!i);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,z(d[f],r,t,!!i)}_writeCenterAlong(e,t,r){const{repeatLabel:i}=this.evaluatedMeshParams,{shaping:s}=this._current,o=B(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,z(o[n],r,t,!!i)}_placeSubdivGlyphs(e,t,r,i){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,u=this._current.zoomRange[0],d=Y(t),f=this._current.shaping.bounds.width/(1<<F),g=Math.sqrt(n||R)/(1<<F),p=Math.min(r,i-r),_=h.isMultiline?D:Math.log2(p/(g+f/2)),y=0===t?_:Math.min(d,_),x=Math.max(u,this._zoomLevel+F-y),v=this._zoomLevel-x,P=h.bounds.width/2*2**v,b=E(a,c,m,t,this._zoomLevel),M=X(c,m,t,this._zoomLevel,l);s&&v<0?this._placeStraightAlong(e,u,b,M):"parallel"===o||h.isMultiline?this._placeStraightAlong(e,x,b,M):"curved"===o&&this._placeCurved(e,x,P,b,M)}_placeCurved(e,t,r,i,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,i,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,r,1,l),this._placeForward(e,a,t,r,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,r,0,c),this._placeForward(e,a,t,r,0,c)),o.metricEnd()}_placeStraightAlong(e,r,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,p=e.clone(),_=e.angle*(180/Math.PI)%360,y=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(r,m[0],0),a=Math.min(D,m[1]),f=i(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:_,mapAligned:!0,isLineLabel:!0},p=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(p,-1*x),[r,i]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,i,d,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(p,x),[r,i]=h.shapeBackground(s(o(),f,t));g.clipAngle=y,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,i,d,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(p,r,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(p,r,0,y,!0),l.metricEnd()}_placeBack(e,t,r,i,s,o){const n=e.clone();let a=e.backwardLength+A;for(;n.prev()&&!(a>=i);)this._placeOnSegment(n,t,a,r,-1,s,o),a+=n.length+A}_placeForward(e,t,r,i,s,o){const n=e.clone();let a=e.remainingLength+A;for(;n.next()&&!(a>=i);)this._placeOnSegment(n,t,a,r,1,s,o),a+=n.length+A}_placeFirst(e,t,r,i,s=!1){const{out:o,id:n,shaping:a,zoomRange:l,referenceBounds:c}=this._current,h=a.glyphs,m=this._getBoundsOffset(e.angle);for(const u of h){const h=u.x>a.bounds.x?r:1-r,d=h*e.remainingLength+(1-h)*e.backwardLength,f=Math.abs(u.x+u.width/2-a.bounds.x),g=Math.max(0,this._zoomLevel+Math.log2(f/(d+A))),p=Math.max(t,s?0:g);u.angle=e.angle+(1-r)*Math.PI;const _=[Math.max(l[0],p),Math.min(l[1],D)];this._writeLineGlyph(o,n,e.x,e.y,u,_,i,c),this._writeLineGlyphBox(o,u,r,_,m)}}_placeOnSegment(e,t,r,i,s,o,n){const{out:a,id:l,shaping:c,referenceBounds:h}=this._current,m=c.glyphs,u=e.dx/e.length,d=e.dy/e.length,f={x:e.x+r*-s*u,y:e.y+r*-s*d},g=this._getBoundsOffset(e.angle);for(const p of m){const t=p.x>c.bounds.x?o:1-o;if(!(t&&1===s||!t&&-1===s))continue;const m=Math.abs(p.x+p.width/2-c.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(m/r)-.1),d=Math.max(i,this._zoomLevel+Math.log2(m/(r+e.length+A)));if(0===u)continue;p.angle=e.angle+(1-o)*Math.PI;const _=[d,u];this._writeLineGlyph(a,l,f.x,f.y,p,_,n,h),this._writeLineGlyphBox(a,p,o,_,g)}}_getBoundsOffset(e){const r=t(this.evaluatedMeshParams.offsetX),s=t(this.evaluatedMeshParams.offsetY),a=u(r,s),l=i(o(),-e);return n(a,a,l)}_writeLineGlyph(e,t,r,i,s,o,n,a){if(r<0||r>w||i<0||i>w)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:u}=this._textMeshTransformProps,d=this._getDefaultGlyphMetrics(this.evaluatedMeshParams.glyphs),f=s.fontSize??h;this._writeQuad(e,t,r,i,{sdfSize:d.sdfSize,sdfRadius:d.sdfRadius,texcoords:l,offsets:c,fontSize:f,haloSize:m,outlineSize:u,color:s.color?S(s.color):S(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],o[0]),maxZoom:Math.min(this._current.zoomRange[1],o[1]),clipAngle:n,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,r,i,s){if((r||this._current.offsetDirection)&&this._isVisible(i)&&t.bounds){const r=t.bounds,i=new L(r.x+s[0],r.y+s[1],r.width,r.height);e.metricBoxWrite(i)}}_isVisible(e){const t=Math.max(this._current.zoomRange[0],e[0]),r=Math.min(this._current.zoomRange[1],e[1]),i=this._zoomLevel;return t<=i&&i<=r}}function W(e,t){const r=new M,{coords:i,lengths:s}=e,o=d(),n=d(),u=d(),f=d(),g=d(),p=d(),_=2;let y=0;for(let d=0;d<s.length;d++){const e=s[d];for(let s=0;s<e;s++){const d=_*(s+y-1),x=_*(s+y),v=_*(s+y+1);s>0?a(o,i[d],i[d+1]):a(o,0,0),a(n,i[x],i[x+1]),s<e-1?a(u,i[v],i[v+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===e-1?a(g,0,0):(l(g,u,n),c(g,g),a(g,g[1],-g[0])),h(p,f,g),c(p,p);const P=p[0]*g[0]+p[1]*g[1];0!==P&&m(p,p,P),m(p,p,t),r.coords.push(n[0]+p[0],n[1]+p[1])}r.lengths.push(e),y+=e}return r}export{U as LabelMeshWriter,O as labelIdHash,T as labelMetricHash,E as lineLabelIdHash,X as lineLabelMetricHash};
2
+ import{importLazily as e}from"../../../../../../../core/importUtils.js";import{memoize as t}from"../../../../../../../core/MapUtils.js";import{pt2px as i}from"../../../../../../../core/screenUtils.js";import{numericHash as r}from"../../../../../../../core/string.js";import{fromRotation as s,translate as o}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as n}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as a,set as l,sub as c,normalize as h,add as m,scale as u}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as f}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as g,convertOptimizedGeometryToFlat as p,convertFlatToOptimizedGeometry as _,FlatGeometry as y}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as x}from"../../../../../../../geometry/GeometryCursor.js";import{getLabelPoint as v}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as P,convertToGeometry as b}from"../../../../../../../layers/graphics/featureConversionUtils.js";import M from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as w}from"../../../definitions.js";import L from"../../../collisions/BoundingBox.js";import{LabelMetric as I}from"../../../collisions/LabelMetric.js";import{smoothPaths as B,pathDivide as z}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as G,processColorInput as S}from"../fill/meshWriterUtils.js";import{TextMeshWriter as j,maxLabelZoom as D}from"../text/TextMeshWriter.js";const F=1,A=0,R=128,$=w*w/16,k=e(()=>import("../../../../../../../geometry/operators/gx/operatorIntersection.js")),C=e(()=>import("../../../../../../../chunks/FlatGeometry.js"));function O(e,t,i){return r(`${e}${t}${i}`)}function E(e,t,i,s,o){return r(`${e}${t}${i}${s*2**(D-o)}`)}function T(e,t,i){return r(`${e}${t}${i}`)}function X(e,t,i,s,o){return r(`${e}${o}${t}${i*2**(D-s)}`)}const Y=t(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class U extends j{constructor(){super(...arguments),this._zoomLevel=0}async loadDependencies(){await Promise.all([super.loadDependencies(),k.getImportPromise(),C.getImportPromise()])}_write(e,{target:t,effectGeometry:i,level:r,viewExtent:s}){if(this._zoomLevel=r,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":this._writePolygon(e,t,s);break;case"esriGeometryMultipoint":{let i=0;const r=x.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new I(e,h,t,i,r,s,n,a,l,c,o)}_writePolygon(e,t,i){const r=k.module,s=C.module.constructFromFlatGeometry,o=t.readGeometryForDisplay()?.justXY(),n=t.readCentroidForDisplay()?.coords,a=o?.area()||0;if(!n)return;const l=a>=$;e.requiresRefresh||=l;const c=s(g(i)),h=s(g({x:n[0],y:n[1]})),m=!!r.execute(h,c,null);if(!o||!l||!m)return void this._writePoint(e,n[0],n[1],0,t);const u=s(p("polygon",o,null)),d=r.execute(u,c,null);if(!d)return void this._writePoint(e,n[0],n[1],0,t);const f=_(new y(d.toFlatGeometry())),P=x.fromOptimized(f,"esriGeometryPolygon",1),b=v(P)??n;this._writePoint(e,b[0],b[1],0,t)}_writePoint(e,t,i,r,s){if(t<0||t>w||i<0||i>w)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=O(this.evaluatedMeshParams.layerId,s.getObjectId(),r),c=T(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new I(n,a,l,c,t,i,h,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<F);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:G(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay()?.justXY();if(!n)return;const a=P(n,"esriGeometryPolyline",1)??new M,l=W(a,o),c=W(a,-o),h=b(c,"esriGeometryPolyline",!1,!1),m=b(l,"esriGeometryPolyline",!1,!1),u=B(m.paths,s.bounds.width),d=B(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,z(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,z(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=B(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,z(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){if(e.x<0||e.x>w||e.y<0||e.y>w)return;const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n,layerId:a,labelClassId:l}=this.evaluatedMeshParams,{objId:c,shaping:h,pathIndex:m}=this._current,u=this._current.zoomRange[0],d=Y(t),f=this._current.shaping.bounds.width/(1<<F),g=Math.sqrt(n||R)/(1<<F),p=Math.min(i,r-i),_=h.isMultiline?D:Math.log2(p/(g+f/2)),y=0===t?_:Math.min(d,_),x=Math.max(u,this._zoomLevel+F-y),v=this._zoomLevel-x,P=h.bounds.width/2*2**v,b=E(a,c,m,t,this._zoomLevel),M=X(c,m,t,this._zoomLevel,l);s&&v<0?this._placeStraightAlong(e,u,b,M):"parallel"===o||h.isMultiline?this._placeStraightAlong(e,x,b,M):"curved"===o&&this._placeCurved(e,x,P,b,M)}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,t,r,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:u}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,p=e.clone(),_=e.angle*(180/Math.PI)%360,y=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(c,r,a,e.x,e.y)),x){const r=Math.max(t,m[0],0),a=Math.min(D,m[1]),f=s(n(),-e.angle),g={minZoom:r,maxZoom:a,clipAngle:_,mapAligned:!0,isLineLabel:!0},p=i(this.evaluatedMeshParams.offsetX),x=i(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=d(p,-1*x),[i,r]=h.shapeBackground(o(n(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=d(p,x),[i,r]=h.shapeBackground(o(n(),f,t));g.clipAngle=y,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,u,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(p,t,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(p,t,0,y,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+A;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+A}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+A;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+A}_placeFirst(e,t,i,r,s=!1){const{out:o,id:n,shaping:a,zoomRange:l,referenceBounds:c}=this._current,h=a.glyphs,m=this._getBoundsOffset(e.angle);for(const u of h){const h=u.x>a.bounds.x?i:1-i,d=h*e.remainingLength+(1-h)*e.backwardLength,f=Math.abs(u.x+u.width/2-a.bounds.x),g=Math.max(0,this._zoomLevel+Math.log2(f/(d+A))),p=Math.max(t,s?0:g);u.angle=e.angle+(1-i)*Math.PI;const _=[Math.max(l[0],p),Math.min(l[1],D)];this._writeLineGlyph(o,n,e.x,e.y,u,_,r,c),this._writeLineGlyphBox(o,u,i,_,m)}}_placeOnSegment(e,t,i,r,s,o,n){const{out:a,id:l,shaping:c,referenceBounds:h}=this._current,m=c.glyphs,u=e.dx/e.length,d=e.dy/e.length,f={x:e.x+i*-s*u,y:e.y+i*-s*d},g=this._getBoundsOffset(e.angle);for(const p of m){const t=p.x>c.bounds.x?o:1-o;if(!(t&&1===s||!t&&-1===s))continue;const m=Math.abs(p.x+p.width/2-c.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(m/i)-.1),d=Math.max(r,this._zoomLevel+Math.log2(m/(i+e.length+A)));if(0===u)continue;p.angle=e.angle+(1-o)*Math.PI;const _=[d,u];this._writeLineGlyph(a,l,f.x,f.y,p,_,n,h),this._writeLineGlyphBox(a,p,o,_,g)}}_getBoundsOffset(e){const t=i(this.evaluatedMeshParams.offsetX),r=i(this.evaluatedMeshParams.offsetY),o=d(t,r),l=s(n(),-e);return a(o,o,l)}_writeLineGlyph(e,t,i,r,s,o,n,a){e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:u}=this._textMeshTransformProps,d=this._getDefaultGlyphMetrics(this.evaluatedMeshParams.glyphs),f=s.fontSize??h;this._writeQuad(e,t,i,r,{sdfSize:d.sdfSize,sdfRadius:d.sdfRadius,texcoords:l,offsets:c,fontSize:f,haloSize:m,outlineSize:u,color:s.color?S(s.color):S(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:a,minZoom:Math.max(this._current.zoomRange[0],o[0]),maxZoom:Math.min(this._current.zoomRange[1],o[1]),clipAngle:n,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,i,r,s){if((i||this._current.offsetDirection)&&this._isVisible(r)&&t.bounds){const i=t.bounds,r=new L(i.x+s[0],i.y+s[1],i.width,i.height);e.metricBoxWrite(r)}}_isVisible(e){const t=Math.max(this._current.zoomRange[0],e[0]),i=Math.min(this._current.zoomRange[1],e[1]),r=this._zoomLevel;return t<=r&&r<=i}}function W(e,t){const i=new M,{coords:r,lengths:s}=e,o=f(),n=f(),a=f(),d=f(),g=f(),p=f(),_=2;let y=0;for(let f=0;f<s.length;f++){const e=s[f];for(let s=0;s<e;s++){const f=_*(s+y-1),x=_*(s+y),v=_*(s+y+1);s>0?l(o,r[f],r[f+1]):l(o,0,0),l(n,r[x],r[x+1]),s<e-1?l(a,r[v],r[v+1]):l(a,0,0),0===s?l(d,0,0):(c(d,n,o),h(d,d),l(d,d[1],-d[0])),s===e-1?l(g,0,0):(c(g,a,n),h(g,g),l(g,g[1],-g[0])),m(p,d,g),h(p,p);const P=p[0]*g[0]+p[1]*g[1];0!==P&&u(p,p,P),u(p,p,t),i.coords.push(n[0]+p[0],n[1]+p[1])}i.lengths.push(e),y+=e}return i}export{U as LabelMeshWriter,O as labelIdHash,T as labelMetricHash,E as lineLabelIdHash,X as lineLabelMetricHash};