@arcgis/core 4.34.0-next.55 → 4.34.0-next.57

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 (211) hide show
  1. package/WebScene.js +1 -1
  2. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +4 -0
  3. package/analysis/VolumeMeasurement/{CutFillOptions.js → VolumeMeasurementCutFillOptions.js} +1 -1
  4. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/02a31483e09652a1a1a2.js +1 -0
  7. package/assets/esri/core/workers/chunks/0390f3aa624e3f380ce2.js +1 -0
  8. package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +1 -0
  9. package/assets/esri/core/workers/chunks/04e652df94790f5ca08a.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9f178cf73c63caaea190.js → 06d2251d6f6b3e44800a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/07d5e0633cc2f765037f.js +1 -0
  12. package/assets/esri/core/workers/chunks/{fe5c37c69da3ec1e56ac.js → 08393d9cc2ed846dd5b4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{18ceea59e469a0f2721b.js → 094c741fa8139c3f40cf.js} +1 -1
  14. package/assets/esri/core/workers/chunks/0d946a226b846b3c0849.js +1 -0
  15. package/assets/esri/core/workers/chunks/{6530449cd1975deb61f1.js → 184d3c88ac2fc1d7e2c3.js} +1 -1
  16. package/assets/esri/core/workers/chunks/2ded2446700f89155ccd.js +1 -0
  17. package/assets/esri/core/workers/chunks/{19391d60c76a1dc7c262.js → 2f7e192ee2066f863e1d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{6b11476b2004b4db576e.js → 3445ffd752262673fb13.js} +1 -1
  19. package/assets/esri/core/workers/chunks/38f09e36e174792646bd.js +1 -0
  20. package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +1 -0
  21. package/assets/esri/core/workers/chunks/{65e1f5b20a585e04655a.js → 44dc7ec52c4abb700783.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4558f2e3e77831758fdc.js +1 -0
  23. package/assets/esri/core/workers/chunks/4753793daf0b7ff8b5ff.js +1 -0
  24. package/assets/esri/core/workers/chunks/52917b753c5ceab0c1f7.js +353 -0
  25. package/assets/esri/core/workers/chunks/{6940bb6524938894a246.js → 53873f26a2c24cd75e4a.js} +1 -1
  26. package/assets/esri/core/workers/chunks/561a2078458bc0339f83.js +1 -0
  27. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +1 -0
  28. package/assets/esri/core/workers/chunks/{d0bf1fc6e3c198bc565d.js → 57486b18421a3c9690d0.js} +1 -1
  29. package/assets/esri/core/workers/chunks/5f079be7f322768aef21.js +1 -0
  30. package/assets/esri/core/workers/chunks/61a294f9411bf884f2ab.js +1 -0
  31. package/assets/esri/core/workers/chunks/{ad93a2621f75270f06cb.js → 69fbe363bb130fdd8146.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{722931d1a60be461e521.js → 70cf81ec5a901782d2db.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{24ac204d8a045aa821be.js → 7388e8c905d93dea1c05.js} +1 -1
  34. package/assets/esri/core/workers/chunks/749c7159e0902388e828.js +1 -0
  35. package/assets/esri/core/workers/chunks/76ff7ccfe583927918f3.js +969 -0
  36. package/assets/esri/core/workers/chunks/{ae73ac81bd10614c2b53.js → 7714228825fb44d506df.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{6130bc641aa7c1bcaaa8.js → 7c23be93d394f1bee941.js} +1 -1
  38. package/assets/esri/core/workers/chunks/7c86af4f60cea383ed96.js +1 -0
  39. package/assets/esri/core/workers/chunks/7eda1c400658b6a99be8.js +1 -0
  40. package/assets/esri/core/workers/chunks/{97ae2fdb6cb98249f5fa.js → 7f80bbbd0897082c1af3.js} +1 -1
  41. package/assets/esri/core/workers/chunks/80a69897fa3ce1eaa6e7.js +1 -0
  42. package/assets/esri/core/workers/chunks/80bd5988180f4618fd61.js +1 -0
  43. package/assets/esri/core/workers/chunks/{62ade6f18b375795ddfd.js → 8257352421f453a669e9.js} +1 -1
  44. package/assets/esri/core/workers/chunks/8762928d10c3821738ad.js +1 -0
  45. package/assets/esri/core/workers/chunks/88a5e7415f8858c454f7.js +1 -0
  46. package/assets/esri/core/workers/chunks/893e5eb5c028c4704317.js +1 -0
  47. package/assets/esri/core/workers/chunks/8ead467a5af0d9bba804.js +1 -0
  48. package/assets/esri/core/workers/chunks/91e04d03b0013bcaad82.js +1 -0
  49. package/assets/esri/core/workers/chunks/{c7d4c296011c5393bcaa.js → 9275313e0f1f521b2658.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{e666ca4d14b6490485d6.js → 92b60d4fb09711919601.js} +1 -1
  51. package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +1 -0
  52. package/assets/esri/core/workers/chunks/{5c556468e2a598ab793a.js → 9940e59033a8a1eff2a9.js} +1 -1
  53. package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +1 -0
  54. package/assets/esri/core/workers/chunks/{9928e432b884c75c3436.js → 9d920f3488d59e7f276c.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{a778a72456fefdf40115.js → a249e56a0be8cef33ba8.js} +1 -1
  56. package/assets/esri/core/workers/chunks/a3ee76b7e46d3fba7cf7.js +1 -0
  57. package/assets/esri/core/workers/chunks/{2cda605c302176905e84.js → a96ac5c68d84122e7751.js} +1 -1
  58. package/assets/esri/core/workers/chunks/acf13a64df2991a4cb6b.js +1 -0
  59. package/assets/esri/core/workers/chunks/{7a8d740d1226719a578a.js → b457b7dd907f06278bee.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b5640f9623a9c9ded92a.js +1 -0
  61. package/assets/esri/core/workers/chunks/bb67d491f62a5cce96cd.js +1 -0
  62. package/assets/esri/core/workers/chunks/{71acded1b3c0057917a1.js → bbdbb618a18542f7a4a2.js} +1 -1
  63. package/assets/esri/core/workers/chunks/bc9f54a6b577c43189fd.js +1 -0
  64. package/assets/esri/core/workers/chunks/{6fe738748ce837811ff4.js → bd4125d163f372a7e978.js} +1 -1
  65. package/assets/esri/core/workers/chunks/bead38898c3f4d4d3569.js +1 -0
  66. package/assets/esri/core/workers/chunks/{22334a464f798b5279b2.js → c80c032c5b7a11db177a.js} +1 -1
  67. package/assets/esri/core/workers/chunks/cc748d4f4adb9c584aa4.js +1 -0
  68. package/assets/esri/core/workers/chunks/cf699b9bb530b87be14c.js +1 -0
  69. package/assets/esri/core/workers/chunks/{5d331f7628514a572f82.js → d6ab4d55f1023ee6ec6a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4874aabdb5c60ca66216.js → db2b8d8cf7131554cf7e.js} +1 -1
  72. package/assets/esri/core/workers/chunks/de4da985c398c8bcf2e7.js +1 -0
  73. package/assets/esri/core/workers/chunks/ef85cd0e82d59db8a26f.js +33 -0
  74. package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +1 -0
  75. package/config.js +1 -1
  76. package/core/has.js +1 -1
  77. package/geometry/Multipoint.js +1 -1
  78. package/geometry/support/boundsUtils.js +1 -1
  79. package/geometry/support/contains.js +1 -1
  80. package/geometry/support/coordsUtils.js +1 -1
  81. package/geometry/support/curves/circleUtils.js +1 -1
  82. package/geometry/support/curves/circularArcUtils.js +1 -1
  83. package/geometry/support/curves/curveUtils.js +1 -1
  84. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  85. package/geometry/support/curves/rotate.js +5 -0
  86. package/geometry/support/extentUtils.js +1 -1
  87. package/geometry/support/rotate.js +1 -1
  88. package/graphic/ImageryGraphicOrigin.js +5 -0
  89. package/graphic/ImageryTileGraphicOrigin.js +5 -0
  90. package/graphic/KMLGraphicOrigin.js +5 -0
  91. package/graphic/WCSGraphicOrigin.js +5 -0
  92. package/graphic/isImageryGraphicOrigin.js +5 -0
  93. package/graphic/isImageryTileGraphicOrigin.js +5 -0
  94. package/graphic/isKMLGraphicOrigin.js +5 -0
  95. package/graphic/isWCSGraphicOrigin.js +5 -0
  96. package/interfaces.d.ts +10 -10
  97. package/kernel.js +1 -1
  98. package/layers/CatalogLayer.js +1 -1
  99. package/layers/FeatureLayer.js +1 -1
  100. package/layers/GroundLayer.js +5 -0
  101. package/layers/ImageryLayer.js +1 -1
  102. package/layers/ImageryTileLayer.js +1 -1
  103. package/layers/KMLLayer.js +1 -1
  104. package/layers/SceneLayer.js +1 -1
  105. package/layers/WCSLayer.js +1 -1
  106. package/layers/catalog/CatalogFootprintLayer.js +1 -1
  107. package/layers/mixins/ArcGISImageService.js +1 -1
  108. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  109. package/layers/support/ElevationQuery.js +1 -1
  110. package/layers/support/KMLSublayer.js +1 -1
  111. package/layers/support/featureReductionUtils.js +1 -1
  112. package/layers/support/kmlUtils.js +1 -1
  113. package/package.json +1 -1
  114. package/renderers/support/colorRampUtils.js +1 -1
  115. package/support/requestUtils.js +1 -1
  116. package/support/revision.js +1 -1
  117. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  118. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  119. package/views/2d/layers/KMLLayerView2D.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  121. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  122. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  123. package/views/3d/analysis/Viewshed/{ArrowManipulator.js → ViewshedArrowManipulator.js} +1 -1
  124. package/views/3d/analysis/Viewshed/{FieldOfViewManipulation.js → ViewshedFieldOfViewManipulation.js} +1 -1
  125. package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +5 -0
  126. package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +5 -0
  127. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  128. package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +5 -0
  129. package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
  130. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  131. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementComputation.js → VolumeMeasurementCutFillComputation.js} +1 -1
  132. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementController.js → VolumeMeasurementCutFillController.js} +1 -1
  133. package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementVisualization.js → VolumeMeasurementCutFillVisualization.js} +1 -1
  134. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  135. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  136. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  137. package/views/GroundView.js +1 -1
  138. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  139. package/views/draw/DrawOperation.js +1 -1
  140. package/views/draw/MultipointDrawAction.js +1 -1
  141. package/views/draw/PointDrawAction.js +1 -1
  142. package/views/draw/PolygonDrawAction.js +1 -1
  143. package/views/draw/PolylineDrawAction.js +1 -1
  144. package/views/draw/SegmentDrawAction.js +1 -1
  145. package/views/draw/support/Box.js +1 -1
  146. package/views/draw/support/GraphicMover.js +1 -1
  147. package/views/draw/support/Reshape.js +1 -1
  148. package/views/draw/support/drawUtils.js +1 -1
  149. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  150. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  151. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  152. package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
  153. package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
  154. package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
  155. package/views/interactive/tooltip/infos/SelectedVertexTooltipInfo.js +1 -1
  156. package/views/layers/ImageryLayerView.js +1 -1
  157. package/views/layers/ImageryTileLayerView.js +1 -1
  158. package/webscene/spec-certification/api.js +1 -1
  159. package/webscene/spec-certification/compare.js +1 -1
  160. package/webscene/spec-certification/spec.js +1 -1
  161. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  162. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  163. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  164. package/widgets/OrientedImageryViewer.js +1 -1
  165. package/widgets/Sketch/SketchViewModel.js +1 -1
  166. package/widgets/Sketch/support/sketchUtils.js +1 -1
  167. package/analysis/VolumeMeasurement/CutFillOptions.d.ts +0 -4
  168. package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +0 -1
  169. package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +0 -1
  170. package/assets/esri/core/workers/chunks/03ee4d63aa8de44958ab.js +0 -1
  171. package/assets/esri/core/workers/chunks/0445de3a8968c0734c91.js +0 -1
  172. package/assets/esri/core/workers/chunks/09268dc856c3d5ce178f.js +0 -1
  173. package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +0 -1
  174. package/assets/esri/core/workers/chunks/17776d9d3558d45ea7b5.js +0 -1
  175. package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +0 -1
  176. package/assets/esri/core/workers/chunks/1e01aaebdeffdfc0c6bd.js +0 -1
  177. package/assets/esri/core/workers/chunks/222f981e876f60ae282f.js +0 -1
  178. package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +0 -1
  179. package/assets/esri/core/workers/chunks/277941bec15525dbd3a0.js +0 -1
  180. package/assets/esri/core/workers/chunks/2cb14d040e67a261b31c.js +0 -1
  181. package/assets/esri/core/workers/chunks/31c088966ccfff2ea1db.js +0 -1
  182. package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +0 -1
  183. package/assets/esri/core/workers/chunks/3800764932a1c32cb29f.js +0 -1
  184. package/assets/esri/core/workers/chunks/46a470bea2a3601182dc.js +0 -1
  185. package/assets/esri/core/workers/chunks/4f8dab492331c9a2d67a.js +0 -1
  186. package/assets/esri/core/workers/chunks/5900dde7a201a7d47469.js +0 -1
  187. package/assets/esri/core/workers/chunks/5b2ff220aebe464dac23.js +0 -1
  188. package/assets/esri/core/workers/chunks/6801b92bce7a918fda6f.js +0 -1
  189. package/assets/esri/core/workers/chunks/772e81e9162e2240a7a6.js +0 -1
  190. package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +0 -1
  191. package/assets/esri/core/workers/chunks/7bdfc7c7ce1d94c00745.js +0 -353
  192. package/assets/esri/core/workers/chunks/83737d86584bf1b32368.js +0 -1
  193. package/assets/esri/core/workers/chunks/854bfda25bb406814929.js +0 -1
  194. package/assets/esri/core/workers/chunks/87f68c2b9361bd3f8cac.js +0 -1
  195. package/assets/esri/core/workers/chunks/8c81156b1605a16acc29.js +0 -1
  196. package/assets/esri/core/workers/chunks/8f6ff09e7d2f01b79faf.js +0 -1
  197. package/assets/esri/core/workers/chunks/97a38d700f2cb8807d51.js +0 -1
  198. package/assets/esri/core/workers/chunks/9e9be7f6ea32957f1088.js +0 -33
  199. package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +0 -1
  200. package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +0 -1
  201. package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +0 -1
  202. package/assets/esri/core/workers/chunks/de499e33035b56b6697d.js +0 -1
  203. package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +0 -1
  204. package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +0 -1
  205. package/assets/esri/core/workers/chunks/e10c5405f956b2cc59e4.js +0 -1
  206. package/assets/esri/core/workers/chunks/ead1acf95c3385630da8.js +0 -1001
  207. package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +0 -1
  208. package/assets/esri/core/workers/chunks/f4d7cbd33ef8710d7316.js +0 -1
  209. package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +0 -5
  210. package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +0 -5
  211. package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import r from"../config.js";import has from"../core/has.js";import{isAborted as e}from"../core/promiseUtils.js";import{getOrigin as o,hasSameOrigin as t,changeHost as n,getAppUrl as s,urlToObject as i}from"../core/urlUtils.js";import{parse as c}from"../layers/support/arcgisLayerUrl.js";import{isSecureProxyService as a}from"../portal/support/urlUtils.js";function u(r,o,t=!1,n){return new Promise((s,i)=>{if(e(n))return void i(l());let c=()=>{f(),i(new Error(`Unable to load ${o}`))},a=()=>{const e=r;f(),s(e)},u=()=>{if(!r)return;const e=r;f(),e.src="",i(l())};const f=()=>{has("esri-image-decode")||(r.removeEventListener("error",c),r.removeEventListener("load",a)),c=null,a=null,r=null,null!=n&&n.removeEventListener("abort",u),u=null,t&&URL.revokeObjectURL(o)};null!=n&&n.addEventListener("abort",u),has("esri-image-decode")?r.decode().then(a,c):(r.addEventListener("error",c),r.addEventListener("load",a))})}function l(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}const f="Timeout exceeded";function m(){return new Error(f)}function p(r){return"object"==typeof r&&!!r&&"message"in r&&r.message===f}function d(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const t=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?t[o(r)??""]=0:(t[o("http://"+r)??""]=0,t[o("https://"+r)??""]=0)}function w(e){const n=r.request.crossOriginNoCorsDomains;if(n){let r=o(e);if(r)return r=r.toLowerCase(),!t(r,s())&&n[r]<Date.now()-36e5}return!1}async function L(e){const t=i(e);e=t.path,"json"===t.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const n=r.request.crossOriginNoCorsDomains,s=o(e);n&&s&&(n[s.toLowerCase()]=Date.now())}const h=new Map;function v(r,e){const o=e?.preferredHost;if(!o||t(r,`https://${o}`,!0))return;const n=c(r);if(!n||"FeatureServer"!==n.serverType||a(r))return;const s=n.url.path.toLowerCase();h.has(s)||h.set(s,o)}function g(r){const e=c(r)?.url.path.toLowerCase();if(!e)return r;const o=h.get(e);return o?n(r,o):r}export{m as createTimeoutError,g as getPreferredUrl,w as isNoCorsRequestRequired,p as isTimeoutError,u as loadImageAsync,h as preferredHosts,d as registerNoCorsDomains,L as sendNoCorsRequest,v as setPreferredHost};
5
+ import r from"../config.js";import{isAborted as e}from"../core/promiseUtils.js";import{getOrigin as t,hasSameOrigin as o,changeHost as n,getAppUrl as s,urlToObject as i}from"../core/urlUtils.js";import{parse as c}from"../layers/support/arcgisLayerUrl.js";import{isSecureProxyService as a}from"../portal/support/urlUtils.js";function u(r,t,o=!1,n){return new Promise((s,i)=>{if(e(n))return void i(f());let c=()=>{l(),i(new Error(`Unable to load ${t}`))},a=async()=>{const e=r;try{await e.decode()}catch{}l(),s(e)},u=()=>{if(!r)return;const e=r;l(),e.src="",i(f())};const l=()=>{r&&(r.removeEventListener("error",c),r.removeEventListener("load",a),c=null,a=null,r=null,n?.removeEventListener("abort",u),u=null,o&&URL.revokeObjectURL(t))};n?.addEventListener("abort",u),r.addEventListener("error",c),r.addEventListener("load",a)})}function f(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}const l="Timeout exceeded";function m(){return new Error(l)}function p(r){return"object"==typeof r&&!!r&&"message"in r&&r.message===l}function d(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const o=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?o[t(r)??""]=0:(o[t("http://"+r)??""]=0,o[t("https://"+r)??""]=0)}function w(e){const n=r.request.crossOriginNoCorsDomains;if(n){let r=t(e);if(r)return r=r.toLowerCase(),!o(r,s())&&n[r]<Date.now()-36e5}return!1}async function L(e){const o=i(e);e=o.path,"json"===o.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const n=r.request.crossOriginNoCorsDomains,s=t(e);n&&s&&(n[s.toLowerCase()]=Date.now())}const v=new Map;function h(r,e){const t=e?.preferredHost;if(!t||o(r,`https://${t}`,!0))return;const n=c(r);if(!n||"FeatureServer"!==n.serverType||a(r))return;const s=n.url.path.toLowerCase();v.has(s)||v.set(s,t)}function E(r){const e=c(r)?.url.path.toLowerCase();if(!e)return r;const t=v.get(e);return t?n(r,t):r}export{m as createTimeoutError,E as getPreferredUrl,w as isNoCorsRequestRequired,p as isTimeoutError,u as loadImageAsync,v as preferredHosts,d as registerNoCorsDomains,L as sendNoCorsRequest,h as setPreferredHost};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const c="20250807",e="64cc533f44803135373e0050983e83a9fec0d226";export{c as buildDate,e as commitHash};
5
+ const c="20250809",e="c1714d8c08c66e85352c9a99864f65ccff60351e";export{c as buildDate,e as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import g from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import c from"./graphics/GraphicsView2D.js";import d from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import w from"./imagery/VectorFieldView2D.js";import m from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{defaultColor as f}from"../../support/HighlightDefaults.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";let _=class extends(m(y(p(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new c({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new d(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView()),h(()=>this.view.highlights.items.map(({name:i,color:t})=>({name:i,color:t})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(i&&"ranges"in i&&i.ranges.length)return this._highlightPixels(i,h);if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}_highlightPixels(i,t){const e={target:i,options:t};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const i=this._pixelHighlights.indexOf(e);i>-1&&(this._pixelHighlights.splice(i,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===t?new w({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new g({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){const t=this.view.highlights;this._pixelHighlights.sort((i,e)=>t.findIndex(({name:i})=>i===b(e.options))-t.findIndex(({name:t})=>t===b(i.options)));const e=this._pixelHighlights.map(({target:i,options:e})=>{const s=b(e),r=t.find(i=>i.name===s)?.color??f,{ranges:h,bandId:a}=i;return{ranges:h,bandId:a??0,color:r.toArray()}});"imagery"===i?.type&&(i.pixelHighlights=e,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],_.prototype,"pixelData",null),i([o()],_.prototype,"subview",void 0),_=i([l("esri.views.2d.layers.ImageryLayerView2D")],_);const x=_;export{x as default};
5
+ import{__decorate as i}from"tslib";import t from"../../../Graphic.js";import{isSome as e}from"../../../core/arrayUtils.js";import s from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{watch as h,sync as a}from"../../../core/reactiveUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{GraphicsCollection as n}from"../../../support/GraphicsCollection.js";import g from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import c from"./graphics/GraphicsView2D.js";import d from"./graphics/HighlightGraphicContainer.js";import u from"./imagery/ImageryView2D.js";import w from"./imagery/VectorFieldView2D.js";import m from"../../layers/ImageryLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as y}from"../../layers/RefreshableLayerView.js";import{defaultColor as f}from"../../support/HighlightDefaults.js";import{getHighlightName as b}from"../../support/highlightOptionsUtils.js";let _=class extends(m(y(p(v)))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new n,this._highlightView=void 0,this._pixelHighlights=[],this.layer=null,this.subview=null}get pixelData(){const{subview:i}=this;return this.updating||!i?null:"getPixelData"in i?i.getPixelData():null}update(i){this.subview?.update(i)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new c({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new d(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([h(()=>this.layer.exportImageServiceParameters.version,i=>{i&&this._exportImageVersion!==i&&(this._exportImageVersion=i,this.requestUpdate())},a),h(()=>this.timeExtent,i=>{const{subview:t}=this;t&&(t.timeExtent=i,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},a),this.layer.on("redraw",()=>{const{subview:i}=this;i&&("redraw"in i?i.redraw():i.redrawOrRefetch())}),h(()=>this.layer.renderer,()=>this._setSubView()),h(()=>this.view.highlights.items.map(({name:i,color:t})=>({name:i,color:t})),()=>this._updateHighlightOptions(this.subview))])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(i,h){if(i&&"pixelRanges"in i&&i.pixelRanges.length)return this._highlightPixels(i,h);if(!((Array.isArray(i)?i[0]:s.isCollection(i)?i.at(0):i)instanceof t))return r();let a=[];Array.isArray(i)||s.isCollection(i)?a=i.map(i=>i.clone()):i instanceof t&&(a=[i.clone()]);const o=a?.filter(e);if(!o?.length)return r();const l=b(h);return this._addHighlightGraphics(a,l),r(()=>!this.destroyed&&this._removeHighlightGraphics(a,l))}_highlightPixels(i,t){const e={target:i,options:t};return this._pixelHighlights.push(e),this._updateHighlightOptions(this.subview),r(()=>{const i=this._pixelHighlights.indexOf(e);i>-1&&(this._pixelHighlights.splice(i,1),this._updateHighlightOptions(this.subview))})}_addHighlightGraphics(i,t){this._highlightGraphics.addMany(i),this._addHighlights(i.map(i=>i.uid),t)}_removeHighlightGraphics(i,t){this._highlightGraphics.removeMany(i),this._removeHighlights(i.map(i=>i.uid),t)}async doRefresh(){this.requestUpdate()}isUpdating(){const i=!this.subview||this.subview.updating||!!this._highlightView?.updating;return has("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${i}\n-> subview ${!this.subview||this.subview.updating}\n-> higlightView ${this._highlightView?.updating}\n`),i}_processHighlight(){const i=this._getHighlights();this._highlightView?.setHighlight(i)}_setSubView(){if(!this.view)return;const i=this.layer.renderer?.type;let t="imagery";if("vector-field"===i?t="imageryVF":"flow"===i&&(t="flow"),this.subview){const{type:i}=this.subview;if(i===t)return this._attachSubview(this.subview),void("flow"===i?this.subview.redrawOrRefetch():"imagery"===i&&"lerc"===this.layer.format?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}"imagery"===t?(this.subview=new u({layer:this.layer,view:this.view,timeExtent:this.timeExtent}),this._updateHighlightOptions(this.subview)):this.subview="imageryVF"===t?new w({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new g({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(i){i&&!i.attached&&(i.attach(),i.attached=!0,this.container.addChildAt(i.container,0))}_detachSubview(i){i?.attached&&(this.container.removeChild(i.container),i.detach(),i.attached=!1)}_updateHighlightOptions(i){const t=this.view.highlights;this._pixelHighlights.sort((i,e)=>t.findIndex(({name:i})=>i===b(e.options))-t.findIndex(({name:t})=>t===b(i.options)));const e=this._pixelHighlights.map(({target:i,options:e})=>{const s=b(e),r=t.find(i=>i.name===s)?.color??f,{pixelRanges:h,bandId:a}=i;return{ranges:h,bandId:a??0,color:r.toArray()}});"imagery"===i?.type&&(i.pixelHighlights=e,i.attached&&("lerc"===this.layer.format?i.redraw():this.requestUpdate()))}};i([o()],_.prototype,"pixelData",null),i([o()],_.prototype,"subview",void 0),_=i([l("esri.views.2d.layers.ImageryLayerView2D")],_);const x=_;export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import c from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as g}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";let b=class extends(m(w(p(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&g(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,s){if(!e.ranges?.length)return i();const t={target:{...e},options:{...s}};return this._pixelHighlights.push(t),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(t);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:s}=this;let t;if(t="rasterVF"===i?new c({layer:s,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:s,layerView:this,scheduler:this.scheduler}):new d({layer:s,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in t&&(t.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in t&&(t.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in t){const{subview:e}=this;t.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(t),this._updateHighlightOptions(t),this.subview=t,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],b.prototype,"subview",void 0),e([n()],b.prototype,"useWebGLForProcessing",null),e([n()],b.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],b.prototype,"displayParameters",null),b=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import s from"../../../core/Logger.js";import{isAbortError as t}from"../../../core/promiseUtils.js";import{watch as r,sync as o,initial as a}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{hasExcludedVariableOrDimension as u}from"../../../layers/support/rasterDatasets/multidimensionalUtils.js";import l from"../engine/flow/FlowView2D.js";import{LayerView2DMixin as p}from"./LayerView2D.js";import d from"./imagery/ImageryTileView2D.js";import c from"./imagery/VectorFieldTileView2D.js";import{canUseMajorityInterpolationOnDataSource as g}from"./support/util.js";import m from"../../layers/ImageryTileLayerView.js";import v from"../../layers/LayerView.js";import{RefreshableLayerView as w}from"../../layers/RefreshableLayerView.js";let b=class extends(m(w(p(v)))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this._pixelHighlights=[],this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}get displayParameters(){const{layer:e}=this,i=this._get("displayParameters");return e.renderer&&e.visible?{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:"imagery-tile"===e.type?e.rasterFunction:null}:i}update(e){this.subview?.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([r(()=>this.displayParameters,(e,i)=>{const r=e.interpolation!==i?.interpolation&&("majority"===e.interpolation||"majority"===i?.interpolation)&&g(this.layer),o=!!this.layer.serviceRasterInfo?.storageInfo?.isBsqTile&&e.bandIds?.join()!==i?.bandIds?.join(),a=e.renderer!==i?.renderer&&this._getSubviewType(i?.renderer)!==this._getSubviewType(e.renderer);a&&this._updateSubview();const n=e.multidimensionalDefinition!==i?.multidimensionalDefinition,h=e.rasterFunction!==i?.rasterFunction,u=h&&!this._useWebGLForProcessing,l=n||r||a||u||o;this.subview.redrawOrRefetch({refetch:l,reprocess:h}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating")}),r(()=>this.layer.multidimensionalSubset??null,(e,i)=>{const{multidimensionalDefinition:r}=this.layer;null!=r&&u(r,e)!==u(r,i)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)}),this.notifyChange("updating"))},o),r(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(e=>{t(e)||s.getLogger(this).error(e)})},a),r(()=>this.view.highlights.items.map(({name:e,color:i})=>({name:e,color:i})),()=>this._updateHighlightOptions(this.subview),a)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}highlight(e,s){if(!e.pixelRanges?.length)return i();const t={target:{...e},options:{...s}};return this._pixelHighlights.push(t),this._updateHighlightOptions(this.subview),i(()=>{const e=this._pixelHighlights.indexOf(t);-1!==e&&(this._pixelHighlights.splice(e,1),this._updateHighlightOptions(this.subview))})}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:e}=this.layer;if(!e)return;const i=this._getSubviewType(e);if(this.subview){if(this.subview.type===i)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:s}=this;let t;if(t="rasterVF"===i?new c({layer:s,layerView:this,scheduler:this.scheduler}):"flow"===i?new l({layer:s,layerView:this,scheduler:this.scheduler}):new d({layer:s,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in t&&(t.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in t&&(t.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in t){const{subview:e}=this;t.previousLOD=e&&"previousLOD"in e?e.previousLOD:null}this._attachSubview(t),this._updateHighlightOptions(t),this.subview=t,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}_getSubviewType(e){const i=e?.type;return"vector-field"===i?"rasterVF":"flow"===i?"flow":"raster"}_updateHighlightOptions(e){"raster"===e?.type&&e.updateHighlightOptions(this._pixelHighlights)}};e([n()],b.prototype,"subview",void 0),e([n()],b.prototype,"useWebGLForProcessing",null),e([n()],b.prototype,"useProgressiveUpdate",null),e([n({readOnly:!0})],b.prototype,"displayParameters",null),b=e([h("esri.views.2d.layers.ImageryTileLayerView2D")],b);const y=b;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{version as i}from"../../../kernel.js";import t from"../../../core/Collection.js";import{abortMaybe as s,destroyMaybe as a}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{queryToObject as l,objectToQuery as r}from"../../../core/urlUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{load as m,project as c}from"../../../geometry/projectionUtils.js";import d from"../../../geometry/SpatialReference.js";import{KMLMapImage as y}from"../../../layers/support/KMLMapImage.js";import{getGraphics as g,fetchService as w,parseKML as u}from"../../../layers/support/kmlUtils.js";import{parseUrl as _}from"../../../rest/utils.js";import{GraphicsCollection as b}from"../../../support/GraphicsCollection.js";import{Bitmap as V}from"../engine/Bitmap.js";import{BitmapContainer as f}from"../engine/BitmapContainer.js";import{LayerView2DMixin as v}from"./LayerView2D.js";import S from"./graphics/GraphicContainer.js";import I from"./graphics/GraphicsView2D.js";import x from"../../layers/LayerView.js";import{ImageReprojector as C}from"../../support/imageReprojection.js";class j{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let k=class extends(v(x)){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new f,this._kmlVisualData=new j,this._fetchController=null,this.allVisiblePoints=new b,this.allVisiblePolylines=new b,this.allVisiblePolygons=new b,this.allVisibleMapImages=new t}async hitTest(e,i){const t=this.layer;return[this._pointsView?.hitTest(e),this._polylinesView?.hitTest(e),this._polygonsView?.hitTest(e)].flat().filter(Boolean).map(i=>(i.layer=t,i.sourceLayer=t,{type:"graphic",graphic:i,layer:t,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new I({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new I({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new I({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(e=>this._addMapImage(e)),e.removed.forEach(e=>this._removeMapImage(e))}),o(()=>this.layer.visibleSublayers,e=>{for(const i of this._kmlVisualData.allSublayers.values())i.visibility=0;for(const i of e){const e=this._kmlVisualData.allSublayers.get(i.id);e&&(e.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new C}detach(){this._fetchController=s(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=a(this._polygonsView),this._polylinesView=a(this._polylinesView),this._pointsView=a(this._pointsView),this._imageReprojector=a(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,e.extent,this.view.spatialReference).then(i=>{const t=new V(i.bitmapData);t.x=i.extent.xmin,t.y=i.extent.ymax,t.resolution=i.extent.width/i.bitmapData.width,t.rotation=e.rotation,this._mapImageContainer.addChild(t),this._bitmapIndex.set(e,t)})}async _getViewDependentUrl(e,t){const{viewFormat:s,viewBoundScale:a,httpQuery:o}=e;if(null!=s){if(null==t)throw new Error("Loading this network link requires a view state.");let n;if(await m(),null!=a&&1!==a){const e=new p(t.extent);e.expand(a),n=e}else n=t.extent;n=c(n,d.WGS84);const h=c(n,d.WebMercator),y=n.xmin,g=n.xmax,w=n.ymin,u=n.ymax,b=t.size[0]*t.pixelRatio,V=t.size[1]*t.pixelRatio,f=Math.max(h.width,h.height),v={"[bboxWest]":y.toString(),"[bboxEast]":g.toString(),"[bboxSouth]":w.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":n.center.x.toString(),"[lookatLat]":n.center.y.toString(),"[lookatRange]":f.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":n.center.x.toString(),"[lookatTerrainLat]":n.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":n.center.x.toString(),"[cameraLat]":n.center.y.toString(),"[cameraAlt]":f.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":b.toString(),"[vertPixels]":V.toString(),"[terrainEnabled]":"0","[clientVersion]":i,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},S=e=>{for(const i in e){let t;for(t in v)e[i]=e[i].replace(t,v[t])}},I=l(s);S(I);let x={};null!=o&&(x=l(o),S(x));const C=_(e.href);C.query={...C.query,...I,...x};return`${C.path}?${r(I)}`}return e.href}async _fetchService(e){const i=new j;await this._loadVisualData(this.layer.url,i,e),this._kmlVisualData=i,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const i=this._kmlVisualData.allSublayers.get(e);return!!i?.visibility&&(-1===i.parentFolderId||this._isSublayerVisible(i.parentFolderId))}_loadVisualData(e,i,t){return this._fetchParsedKML(e,t).then(async e=>{for(const s of e.sublayers){i.allSublayers.set(s.id,s);const e=s.points?await g(s.points):[],a=s.polylines?await g(s.polylines):[],o=s.polygons?await g(s.polygons):[],l=s.mapImages?.map(e=>y.fromJSON(e))??[];if(i.allPoints.push(...e.map(e=>({item:e,sublayerId:s.id}))),i.allPolylines.push(...a.map(e=>({item:e,sublayerId:s.id}))),i.allPolygons.push(...o.map(e=>({item:e,sublayerId:s.id}))),i.allMapImages.push(...l.map(e=>({item:e,sublayerId:s.id}))),s.networkLink){const e=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(e,i,t)}}})}_fetchParsedKML(e,i){return w(e,this.layer.spatialReference,this.layer.refreshInterval,i).then(e=>u(e.data))}_removeMapImage(e){const i=this._bitmapIndex.get(e);i&&(this._mapImageContainer.removeChild(i),this._bitmapIndex.delete(e))}};e([n()],k.prototype,"_pointsView",void 0),e([n()],k.prototype,"_polylinesView",void 0),e([n()],k.prototype,"_polygonsView",void 0),k=e([h("esri.views.2d.layers.KMLLayerView2D")],k);const P=k;export{P as default};
5
+ import{__decorate as e}from"tslib";import{version as i}from"../../../kernel.js";import t from"../../../core/Collection.js";import{abortMaybe as s,destroyMaybe as a}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{queryToObject as l,objectToQuery as r}from"../../../core/urlUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../geometry/Extent.js";import{load as m,project as c}from"../../../geometry/projectionUtils.js";import d from"../../../geometry/SpatialReference.js";import{KMLMapImage as y}from"../../../layers/support/KMLMapImage.js";import{getGraphics as g,fetchService as w,parseKML as u}from"../../../layers/support/kmlUtils.js";import{parseUrl as _}from"../../../rest/utils.js";import{GraphicsCollection as V}from"../../../support/GraphicsCollection.js";import{Bitmap as f}from"../engine/Bitmap.js";import{BitmapContainer as b}from"../engine/BitmapContainer.js";import{LayerView2DMixin as v}from"./LayerView2D.js";import S from"./graphics/GraphicContainer.js";import x from"./graphics/GraphicsView2D.js";import C from"../../layers/LayerView.js";import{ImageReprojector as I}from"../../support/imageReprojection.js";class j{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let k=class extends(v(C)){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new b,this._kmlVisualData=new j,this._fetchController=null,this.allVisiblePoints=new V,this.allVisiblePolylines=new V,this.allVisiblePolygons=new V,this.allVisibleMapImages=new t}async hitTest(e,i){const t=this.layer;return[this._pointsView?.hitTest(e),this._polylinesView?.hitTest(e),this._polygonsView?.hitTest(e)].flat().filter(Boolean).map(i=>(i.layer=t,i.sourceLayer=t,{type:"graphic",graphic:i,layer:t,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new x({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new x({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new x({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new S(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(e=>this._addMapImage(e)),e.removed.forEach(e=>this._removeMapImage(e))}),o(()=>this.layer.visibleSublayers,e=>{for(const i of this._kmlVisualData.allSublayers.values())i.visibility=0;for(const i of e){const e=this._kmlVisualData.allSublayers.get(i.id);e&&(e.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new I}detach(){this._fetchController=s(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=a(this._polygonsView),this._polylinesView=a(this._polylinesView),this._pointsView=a(this._pointsView),this._imageReprojector=a(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,e.extent,this.view.spatialReference).then(i=>{const t=new f(i.bitmapData);t.x=i.extent.xmin,t.y=i.extent.ymax,t.resolution=i.extent.width/i.bitmapData.width,t.rotation=e.rotation,this._mapImageContainer.addChild(t),this._bitmapIndex.set(e,t)})}async _getViewDependentUrl(e,t){const{viewFormat:s,viewBoundScale:a,httpQuery:o}=e;if(null!=s){if(null==t)throw new Error("Loading this network link requires a view state.");let n;if(await m(),null!=a&&1!==a){const e=new p(t.extent);e.expand(a),n=e}else n=t.extent;n=c(n,d.WGS84);const h=c(n,d.WebMercator),y=n.xmin,g=n.xmax,w=n.ymin,u=n.ymax,V=t.size[0]*t.pixelRatio,f=t.size[1]*t.pixelRatio,b=Math.max(h.width,h.height),v={"[bboxWest]":y.toString(),"[bboxEast]":g.toString(),"[bboxSouth]":w.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":n.center.x.toString(),"[lookatLat]":n.center.y.toString(),"[lookatRange]":b.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":n.center.x.toString(),"[lookatTerrainLat]":n.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":n.center.x.toString(),"[cameraLat]":n.center.y.toString(),"[cameraAlt]":b.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":V.toString(),"[vertPixels]":f.toString(),"[terrainEnabled]":"0","[clientVersion]":i,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},S=e=>{for(const i in e){let t;for(t in v)e[i]=e[i].replace(t,v[t])}},x=l(s);S(x);let C={};null!=o&&(C=l(o),S(C));const I=_(e.href);I.query={...I.query,...x,...C};return`${I.path}?${r(x)}`}return e.href}async _fetchService(e){const i=new j;await this._loadVisualData(this.layer.url,i,e),this._kmlVisualData=i,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll();const e=(e,i)=>{e.addMany(i.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))};e(this.allVisiblePoints,this._kmlVisualData.allPoints),e(this.allVisiblePolylines,this._kmlVisualData.allPolylines),e(this.allVisiblePolygons,this._kmlVisualData.allPolygons),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const i=this._kmlVisualData.allSublayers.get(e);return!!i?.visibility&&(-1===i.parentFolderId||this._isSublayerVisible(i.parentFolderId))}_loadVisualData(e,i,t){return this._fetchParsedKML(e,t).then(async e=>{for(const s of e.sublayers){i.allSublayers.set(s.id,s);const e=await g(s,"points",this.layer,s.id),a=await g(s,"polylines",this.layer,s.id),o=await g(s,"polygons",this.layer,s.id),l=s.mapImages?.map(e=>y.fromJSON(e))??[];if(i.allPoints.push(...e.map(e=>({item:e,sublayerId:s.id}))),i.allPolylines.push(...a.map(e=>({item:e,sublayerId:s.id}))),i.allPolygons.push(...o.map(e=>({item:e,sublayerId:s.id}))),i.allMapImages.push(...l.map(e=>({item:e,sublayerId:s.id}))),s.networkLink){const e=await this._getViewDependentUrl(s.networkLink,this.view.state);await this._loadVisualData(e,i,t)}}})}_fetchParsedKML(e,i){return w(e,this.layer.spatialReference,this.layer.refreshInterval,i).then(e=>u(e.data))}_removeMapImage(e){const i=this._bitmapIndex.get(e);i&&(this._mapImageContainer.removeChild(i),this._bitmapIndex.delete(e))}};e([n()],k.prototype,"_pointsView",void 0),e([n()],k.prototype,"_polylinesView",void 0),e([n()],k.prototype,"_polygonsView",void 0),k=e([h("esri.views.2d.layers.KMLLayerView2D")],k);const P=k;export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{clone as e}from"../../../../../core/lang.js";import t from"../../../../../graphic/CatalogGraphicOrigin.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as o}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as i,createLabelVVEvaluator as s}from"./labelingUtils.js";import{createFeatureSourceSchema as a}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as n}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as l}from"../support/rendererUtils.js";class p{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=i(t);return[{vvEvaluators:{0:s(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:s,editingInfo:a,objectIdField:n,globalIdField:l,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:u,parsedUrl:c}=i,m=i.fieldsIndex.toJSON(),y=o(i),f=i.timeInfo?.toJSON(),h=i.spatialReference.toJSON(),g=e(c);let b=n;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(b=e)}const I=r(g.path),S=t.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:I,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:d,globalIdField:l,fieldsIndex:m,geometryType:y,featureIdInfo:{type:"object-id",fieldName:n},timeInfo:f,spatialReference:h,outSpatialReference:S,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:s,apiKey:n}=this.layer;return a({definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:s},e,t,n)}createProcessorSchema(e,t,r){const{fields:o,geometryType:i,orderBy:s,objectIdField:a,renderer:l,labelingInfo:p,labelsVisible:d}=this.layer,u={featureReduction:null,labelingInfoSource:this.layer.id,fields:o.map(e=>e.toJSON()),geometryType:i,labelingInfo:p,labelsVisible:d,objectIdField:a,orderBy:s??"default",renderer:l?.clone()};return n(e,t,u,r)}get hasRequiredSupport(){return l(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=new t(this.layer)}}export{p as CatalogFootprintLayerAdapter};
5
+ import{clone as e}from"../../../../../core/lang.js";import{isHostedAgolService as t}from"../../../../../layers/support/arcgisLayerUrl.js";import{getServiceGeometryType as r}from"./geometryUtils.js";import{getLayerDeconflictionEnabled as o,createLabelVVEvaluator as i}from"./labelingUtils.js";import{createFeatureSourceSchema as s}from"../schema/SourceSchema.js";import{createSimpleProcessorSchema as a}from"../schema/processor/SimpleProcessorSchema.js";import{isRendererSupported as n}from"../support/rendererUtils.js";class l{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=o(t);return[{vvEvaluators:{0:i(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(o){const i=this.layer,{capabilities:s,editingInfo:a,objectIdField:n,globalIdField:l,datesInUnknownTimezone:p,dateFieldsTimeZone:d,orderBy:u,parsedUrl:c}=i,y=i.fieldsIndex.toJSON(),m=r(i),f=i.timeInfo?.toJSON(),h=i.spatialReference.toJSON(),g=e(c);let b=n;if(u?.length){const e=!u[0].valueExpression&&u[0].field;e&&(b=e)}const I=t(g.path),S=o.spatialReference.toJSON();return{type:"feature-service",source:g,isSourceHosted:I,orderByFields:b,outSpatialReference:S,metadata:{timeReferenceUnknownClient:p,dateFieldsTimeZone:d,globalIdField:l,fieldsIndex:y,geometryType:m,featureIdInfo:{type:"object-id",fieldName:n},timeInfo:f,spatialReference:h,outSpatialReference:S,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:s.query.maxRecordCount,supportsCompactGeometry:s.query.supportsCompactGeometry,supportsDefaultSpatialReference:s.query.supportsDefaultSpatialReference,supportsFormatPBF:s.query.supportsFormatPBF,supportsMaxRecordCountFactor:s.query.supportsMaxRecordCountFactor,supportsQuantization:s.query.supportsQuantization,supportsCentroidOnDegeneratedQuantizedGeometry:s.query.supportsCentroidOnDegeneratedQuantizedGeometry,supportsDegeneratedQuantizedGeometry:s.query.supportsDegeneratedQuantizedGeometry,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:a,apiKey:n}=this.layer;return s({definitionExpression:r,displayFilterInfo:o,customParameters:i,timeExtent:a},e,t,n)}createProcessorSchema(e,t,r){const{fields:o,geometryType:i,orderBy:s,objectIdField:n,renderer:l,labelingInfo:p,labelsVisible:d}=this.layer,u={featureReduction:null,labelingInfoSource:this.layer.id,fields:o.map(e=>e.toJSON()),geometryType:i,labelingInfo:p,labelsVisible:d,objectIdField:n,orderBy:s??"default",renderer:l?.clone()};return a(e,t,u,r)}get hasRequiredSupport(){return n(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){return[()=>this.layer.apiKey,()=>this.layer.customParameters,()=>this.layer.definitionExpression,()=>this.layer.outFields,()=>this.layer.renderer,()=>this.layer.labelsVisible?this.layer.labelingInfo:null,()=>this.layer.orderBy]}setGraphicOrigin(e){e.origin=this.layer.graphicOrigin}}export{l as CatalogFootprintLayerAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,n=s.supportsGPU&&(!o||o.rasters.length<=1),a=n?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",u=i===p||"na"===i&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:s}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,s)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=s?h:null,d.transformGrid=s?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=s?h:null,d.transformGrid=null}d.bandIds=s?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c;const{raster:m}=this.layer;if(o(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]})}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===i?.type?i:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?i:r:null,a.bandIds=n?s:null,a.interpolation=o,a.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const i=[],{highlights:s}=this.layerView.view;e.sort((e,t)=>s.findIndex(({name:e})=>e===d(t.options))-s.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{ranges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=s.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);i.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=i}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([i()],m.prototype,"canUseWebGLForProcessing",null),e([i()],m.prototype,"container",void 0),e([i()],m.prototype,"layer",void 0),e([i()],m.prototype,"type",void 0),m=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import has from"../../../../core/has.js";import{numberMaxFloat32 as r}from"../../../../core/mathUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{isFunctionRaster as o}from"../../../../layers/support/rasterDatasets/datasetUtils.js";import{getBytesPerPixel as n}from"../../../../layers/support/rasterFormats/pixelRangeUtils.js";import{convertGeometryToMask as a}from"../../../../layers/support/rasterFunctions/clipUtils.js";import{maxMapSizeGpu as l}from"../../../../layers/support/rasterFunctions/pixelUtils.js";import{RasterTileContainer as c}from"../../engine/imagery/RasterTileContainer.js";import{BaseImageryTileSubView2D as p}from"./BaseImageryTileSubView2D.js";import{canUseMajorityInterpolationOnDataSource as u}from"../support/util.js";import{defaultColor as h}from"../../../support/HighlightDefaults.js";import{getHighlightName as d}from"../../../support/highlightOptionsUtils.js";let m=class extends p{constructor(){super(...arguments),this.type="raster"}get canUseWebGLForProcessing(){const{loaded:e,symbolizer:t}=this.layer;if(!e||!t)return!1;const r=t.lookup.colormapLut?.indexedColormap,i=r&&r.length>this._maxIndexedColormapSize,s=n(this.layer.serviceRasterInfo);return!(has("ios")&&s>4)&&this.useWebGLForProcessing&&t.canRenderInWebGL&&!i&&!("majority"===this.layer.interpolation&&u(this.layer))}attach(){super.attach(),this.container=new c(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{raster:e,type:t}=this.layer,{container:r}=this;if("Function"!==e.datasetFormat||"wcs"===t)return r.rasterFunctionChain=null,r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!0,t.processed=!1,t.projected&&(t.invalidateTexture(),t.rasterTexture=null))}),void(this._rasterFunctionState="na");const i=this._rasterFunctionState,{rasterFunction:s,primaryRasters:o}=e,n=s.supportsGPU&&(!o||o.rasters.length<=1),a=n?s.flatWebGLFunctionChain:null,{renderer:l}=this.layer,c=!n||!a?.functions.length||"raster-stretch"===l?.type&&l.dynamicRangeAdjustment||!this.canUseWebGLForProcessing;r.rasterFunctionChain=c?null:this._addProjection(a);const p=null==s?"na":r.rasterFunctionChain?"gpu":"cpu",u=i===p||"na"===i&&"cpu"===p&&0===a?.functions?.length;r.children.forEach(e=>{const{bitmap:t}=e;t&&(t.suspended=!u,t.processed=!1,t.processedTexture=null)}),this._rasterFunctionState=p}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),{canUseWebGLForProcessing:s}=this,{source:n,globalSymbolizerParams:l,suspended:c,coords:p,resolution:u}=t,h=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:d}=e;if([d.x,d.y]=p,d.resolution=u,null!=n?.pixelBlock){const e={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(d.rawPixelData=e,s)d.source=n.pixelBlock,d.isRendereredSource=!1;else{const t=await this.layer.applyRenderer(e,"stretch"===l?.type?l:void 0);d.source=t,d.isRendereredSource=!0}d.symbolizerParameters=s?h:null,d.transformGrid=s?n.transformGrid:null}else{const e=this.createEmptyTilePixelBlock();d.source=e,d.symbolizerParameters=s?h:null,d.transformGrid=null}d.bandIds=s?r:null,d.width=this._tileInfoView.tileInfo.size[0],d.height=this._tileInfoView.tileInfo.size[1],d.interpolation=i,d.suspended=c;const{raster:m}=this.layer;if(o(m)){const t=m.getClippingGeometry(this.layerView.view.spatialReference);if(t){const r=m.getTileExtentFromTileInfo(e.key.level,e.key.row,e.key.col,this._tileInfoView.tileInfo);d.mask=a({srcExtent:r,geometry:t,size:[d.width,d.height]})}}d.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,s=this._getBandIds(),o=this._getLayerInterpolation(),{canUseWebGLForProcessing:n}=this,{bitmap:a}=e,{rawPixelData:l}=a;n||null==l?(a.isRendereredSource&&null!=l&&(a.source=l.pixelBlock),a.isRendereredSource=!1):(a.source=await this.layer.applyRenderer(l,"stretch"===i?.type?i:void 0),a.isRendereredSource=!0),a.symbolizerParameters=n?this.layerView.hasTilingEffects?i:r:null,a.bandIds=n?s:null,a.interpolation=o,a.suspended=!1}updateHighlightOptions(e){if(!e.length)return void(this.container.pixelHighlights=void 0);const i=[],{highlights:s}=this.layerView.view;e.sort((e,t)=>s.findIndex(({name:e})=>e===d(t.options))-s.findIndex(({name:t})=>t===d(e.options)));for(const{target:o,options:n}of e){const{pixelRanges:e}=o,a=Array.from({length:2*l},()=>0);for(let t=0;t<e.length;t++)a[2*t]=e[t][0],a[2*t+1]=e[t][1];for(let t=e.length;t<l;t++)a[2*t]=r,a[2*t+1]=-r;const c=o.bandId??0,p=d(n),u=s.find(e=>e.name===p)?.color??h,m=t.toUnitRGBA(u);i.push({ranges:a,bandId:c,color:m})}this.container.pixelHighlights=i}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return"raster-colormap"===r||"unique-value"===r?"nearest":"raster-stretch"===t.type&&null!=t.colorRamp?"bilinear"===e||"cubic"===e?"bilinear":"nearest":e}_addProjection(e){return e?.functions?.length&&!e.hasFocalFunction&&e.functions.unshift({name:"Reproject",parameters:{targetImageSize:this._tileInfoView.tileInfo.size,requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1}),e}};e([i()],m.prototype,"canUseWebGLForProcessing",null),e([i()],m.prototype,"container",void 0),e([i()],m.prototype,"layer",void 0),e([i()],m.prototype,"type",void 0),m=e([s("esri.views.2d.layers.imagery.ImageryTileView2D")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as c}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as m}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p,Part as d}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as y}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let g=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{c(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&m(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?y.fromGeometry(i,t.state.viewingMode):new y(new p("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,f),e(f,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;if(0===this._editGeometry.parts.length){const e=this.view;this._editGeometry.parts.push(new d(e.spatialReference,e.state.viewingMode))}const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],g.prototype,"areaMeasurement",null),e([s({value:null})],g.prototype,"view",null),e([s()],g.prototype,"isEmptyPolygon",null),e([s()],g.prototype,"isValidPolygon",null),e([s()],g.prototype,"extent",null),e([s()],g.prototype,"spatialReference",null),e([s()],g.prototype,"numVertices",null),e([s()],g.prototype,"polygonIsClosed",null),g=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],g);const f=new a;export{g as AreaMeasurement3DPathHelper};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import a from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as l}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as c}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as m}from"../../support/projectionUtils.js";import{createCoordinateHelper as u}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as p}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as d}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let y=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{c(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=l(i,t.spatialReference);null==o&&m(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?d.fromGeometry(i,t.state.viewingMode):new d(new p("polygon",u(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,g),e(g,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],y.prototype,"areaMeasurement",null),e([s({value:null})],y.prototype,"view",null),e([s()],y.prototype,"isEmptyPolygon",null),e([s()],y.prototype,"isValidPolygon",null),e([s()],y.prototype,"extent",null),e([s()],y.prototype,"spatialReference",null),e([s()],y.prototype,"numVertices",null),e([s()],y.prototype,"polygonIsClosed",null),y=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],y);const g=new a;export{y as AreaMeasurement3DPathHelper};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Color.js";import t from"../../../../core/Handles.js";import{watch as r,initial as o}from"../../../../core/reactiveUtils.js";import{fromTranslation as i,mul as s,fromXRotation as a,fromYRotation as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as c}from"../../../../chunks/vec32.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{displayFocusMultiplier as p}from"../Slice/sliceToolConfig.js";import{viewshedToolManipulatorConfiguration as f}from"./ViewshedConfiguration.js";import{Manipulator3D as h}from"../../interactive/Manipulator3D.js";import{RenderObject as d}from"../../interactive/RenderObject.js";import{createTubeGeometry as u,createExtrudedTriangle as j}from"../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as g}from"../../webgl-engine/materials/ColorMaterial.js";class w extends h{constructor(e,r){super({view:e,autoScaleRenderObjects:!1,worldSized:!1,radius:f.collisionRadius}),this._handles=new t,this._setupManipulatorVisual(r)}destroy(){this._handles.remove(),super.destroy()}_setupManipulatorVisual(e){const t=this._createMaterial(),r=1,o=[m(0,0,0),m(0,0,r)],h=u(t,o,e,16,!1),j=u(t,o,e*p,16,!1),g=b(!1,t,e),w=b(!0,t,e),M=l();i(M,o[o.length-1]),s(M,M,a(v,Math.PI/2)),s(M,M,n(v,Math.PI/2)),g.transformation=M,w.transformation=M,this.renderObjects=[new d(h,1),new d(j,2),new d(g,1),new d(w,2)];const _=m(0,f.getScaleOrientArrowTipLength(!0),0),O=c(_,_,M),x=[...o,O];this.collisionType={type:"line",paths:[x]}}_createMaterial(){const t=new g({cullFace:2,renderOccluded:4,isDecoration:!0});return this._handles.add(r(()=>e.toUnitRGBA(this.view.effectiveTheme.accentColor),e=>t.setParameters({color:e}),o)),t}}function b(e,t,r){const o=f.getScaleOrientArrowTipLength(e);let i=2*r;e&&(i*=p);const s=o/2;return j(t,o,s,s,i,0)}const v=l();export{w as ArrowManipulator};
5
+ import e from"../../../../Color.js";import t from"../../../../core/Handles.js";import{watch as r,initial as o}from"../../../../core/reactiveUtils.js";import{fromTranslation as i,mul as s,fromXRotation as a,fromYRotation as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as c}from"../../../../chunks/vec32.js";import{fromValues as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{displayFocusMultiplier as p}from"../Slice/sliceToolConfig.js";import{viewshedToolManipulatorConfiguration as f}from"./ViewshedConfiguration.js";import{Manipulator3D as h}from"../../interactive/Manipulator3D.js";import{RenderObject as d}from"../../interactive/RenderObject.js";import{createTubeGeometry as u,createExtrudedTriangle as j}from"../../webgl-engine/lib/GeometryUtil.js";import{ColorMaterial as g}from"../../webgl-engine/materials/ColorMaterial.js";class w extends h{constructor(e,r){super({view:e,autoScaleRenderObjects:!1,worldSized:!1,radius:f.collisionRadius}),this._handles=new t,this._setupManipulatorVisual(r)}destroy(){this._handles.remove(),super.destroy()}_setupManipulatorVisual(e){const t=this._createMaterial(),r=1,o=[m(0,0,0),m(0,0,r)],h=u(t,o,e,16,!1),j=u(t,o,e*p,16,!1),g=b(!1,t,e),w=b(!0,t,e),M=l();i(M,o[o.length-1]),s(M,M,a(v,Math.PI/2)),s(M,M,n(v,Math.PI/2)),g.transformation=M,w.transformation=M,this.renderObjects=[new d(h,1),new d(j,2),new d(g,1),new d(w,2)];const _=m(0,f.getScaleOrientArrowTipLength(!0),0),O=c(_,_,M),x=[...o,O];this.collisionType={type:"line",paths:[x]}}_createMaterial(){const t=new g({cullFace:2,renderOccluded:4,isDecoration:!0});return this._handles.add(r(()=>e.toUnitRGBA(this.view.effectiveTheme.accentColor),e=>t.setParameters({color:e}),o)),t}}function b(e,t,r){const o=f.getScaleOrientArrowTipLength(e);let i=2*r;e&&(i*=p);const s=o/2;return j(t,o,s,s,i,0)}const v=l();export{w as ViewshedArrowManipulator};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as g,g as _}from"../../../../chunks/vec32.js";import{create as M,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as j}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as w,screenToCircleAngle as A}from"./viewshedToolUtils.js";import{Manipulator3D as V}from"../../interactive/Manipulator3D.js";import{RenderObject as O}from"../../interactive/RenderObject.js";import{InteractiveManipulation as E}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as R}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as U}from"../../../interactive/dragEventPipeline.js";class x extends E{constructor(t){super(),this._handles=new r,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(t,r){const a=Object.values(this._manipulators);return e(a.map(({manipulator:e,side:a})=>U(e,(e,i,o,n,s)=>{const l=z(a,r),c=i.next(t=>({...t,manipulatorType:2,side:a})),u=A(c,this._view,l,r);t(e,u,o)})))}updateManipulatorsTransform(t){t.arcCentersPoints(H),this._forEachManipulatorInfo(r=>this._updateArcManipulatorTransform(r,t,H[r.side]))}updateManipulatorVisuals(t){this._forEachManipulatorInfo(r=>this._updateArcManipulatorVisuals(r,t))}_updateArcManipulatorVisuals({manipulator:t,side:r},e){const a=[];if(null!=e){const[i,o]=P(r,e,this._unfocusedArcMaterial);a.push(new O(i,1),new O(i.instantiate({material:this._focusedArcMaterial}),2)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=a,t.radius=j.collisionRadius}_updateArcManipulatorTransform({manipulator:t,side:r},e,i){const o=e.horizontalFieldOfView,n=a(e.verticalFieldOfView/2),s=a(o/2),g=I(r);t.renderLocation=i;const _=f(),M=t=>{h(_,t,_)};M(l(k,a(-90))),g||M(c(k,n));const b=e.farDistanceRenderSpace;let v,j;M(u(k,d(L,b,b,b))),M(p(k,F(r))),M(w(e,k)),g?(v=s,j=e.tiltedUpVector):(j=e.rightVector,v=n),v*="right"===r||"bottom"===r?-1:1;const A=m(k,v,j);null!=A&&M(A),t.modelTransform=_}_createManipulators(){const t=this._createArcManipulator("left"),r=this._createArcManipulator("right"),e=this._createArcManipulator("top"),a=this._createArcManipulator("bottom");this._manipulators={left:t,right:r,top:e,bottom:a};[[a.manipulator,e.manipulator],[t.manipulator,r.manipulator]].forEach(([t,r])=>{t.metadata={pairedManipulator:r},r.metadata={pairedManipulator:t}})}_createArcManipulator(t){const r=new V({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),e={manipulator:r,side:t};return this._updateArcManipulatorVisuals(e),this._handles.add(r.events.on(["focus-changed","grab-changed"],t=>{const e=r.metadata?.pairedManipulator;null!=e&&(e.hovering!==r.hovering&&(e.hovering=r.hovering),e.grabbing!==r.grabbing&&(e.grabbing=r.grabbing))})),e}_createArcMaterial(r){const e=j.getFovArcWidth(r),a=new T({renderOccluded:4,isDecoration:!0,width:e});return this._handles.add(n(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>a.setParameters({color:t}),s)),a}forEachManipulator(t){Object.values(this._manipulators).forEach(({manipulator:r})=>t(r,2))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach(r=>t(r))}get test(){return{manipulators:this._manipulators}}}function P(t,r,e){const{horizontalFieldOfView:o,verticalFieldOfView:n}=r,s=I(t),l=a(i((s?n:o)/2,0,15)),c=S(-l/2,l/2,s?1:Math.max(Math.sin(a(90-n/2)),.1));return[y(e,c),c]}function S(t,r,e,a=10){R(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const i=r-t;if(i<=0||e<=0){const t=.01;return[b(0,0,t),b(0,0,-t)]}const o=[],n=i/a;for(let s=0;s<a;s++){let i=t+s*n;s===a-1&&(i=r);const l=Math.cos(i)*e,c=Math.sin(i)*e,u=b(l-e,0,c);o.push(u)}return o}function D(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function F(t){return D(t)*G}function I(t){return"left"===t||"right"===t}function C(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"top"}function z(t,{observerRenderSpace:r,targetRenderSpace:e,tiltedUpVector:a,rightVector:i,farDistanceRenderSpace:o}){const n=g(L,e,r),s=I(t)?i:a,l=_(B,s,o);return v(r,n,l)}const G=Math.PI/2,k=f(),L=M(),B=M(),H={top:M(),bottom:M(),left:M(),right:M()};export{x as FieldOfViewManipulation,S as createArcPolylineVertices,C as flipSide,I as isSideHorizontal,F as sideToRad};
5
+ import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as g,g as _}from"../../../../chunks/vec32.js";import{create as M,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as j}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as w,screenToCircleAngle as A}from"./viewshedToolUtils.js";import{Manipulator3D as V}from"../../interactive/Manipulator3D.js";import{RenderObject as O}from"../../interactive/RenderObject.js";import{InteractiveManipulation as E}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as R}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as U}from"../../../interactive/dragEventPipeline.js";class x extends E{constructor(t){super(),this._handles=new r,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(t,r){const a=Object.values(this._manipulators);return e(a.map(({manipulator:e,side:a})=>U(e,(e,i,o,n,s)=>{const l=z(a,r),c=i.next(t=>({...t,manipulatorType:2,side:a})),u=A(c,this._view,l,r);t(e,u,o)})))}updateManipulatorsTransform(t){t.arcCentersPoints(H),this._forEachManipulatorInfo(r=>this._updateArcManipulatorTransform(r,t,H[r.side]))}updateManipulatorVisuals(t){this._forEachManipulatorInfo(r=>this._updateArcManipulatorVisuals(r,t))}_updateArcManipulatorVisuals({manipulator:t,side:r},e){const a=[];if(null!=e){const[i,o]=P(r,e,this._unfocusedArcMaterial);a.push(new O(i,1),new O(i.instantiate({material:this._focusedArcMaterial}),2)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=a,t.radius=j.collisionRadius}_updateArcManipulatorTransform({manipulator:t,side:r},e,i){const o=e.horizontalFieldOfView,n=a(e.verticalFieldOfView/2),s=a(o/2),g=I(r);t.renderLocation=i;const _=f(),M=t=>{h(_,t,_)};M(l(k,a(-90))),g||M(c(k,n));const b=e.farDistanceRenderSpace;let v,j;M(u(k,d(L,b,b,b))),M(p(k,F(r))),M(w(e,k)),g?(v=s,j=e.tiltedUpVector):(j=e.rightVector,v=n),v*="right"===r||"bottom"===r?-1:1;const A=m(k,v,j);null!=A&&M(A),t.modelTransform=_}_createManipulators(){const t=this._createArcManipulator("left"),r=this._createArcManipulator("right"),e=this._createArcManipulator("top"),a=this._createArcManipulator("bottom");this._manipulators={left:t,right:r,top:e,bottom:a};[[a.manipulator,e.manipulator],[t.manipulator,r.manipulator]].forEach(([t,r])=>{t.metadata={pairedManipulator:r},r.metadata={pairedManipulator:t}})}_createArcManipulator(t){const r=new V({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),e={manipulator:r,side:t};return this._updateArcManipulatorVisuals(e),this._handles.add(r.events.on(["focus-changed","grab-changed"],t=>{const e=r.metadata?.pairedManipulator;null!=e&&(e.hovering!==r.hovering&&(e.hovering=r.hovering),e.grabbing!==r.grabbing&&(e.grabbing=r.grabbing))})),e}_createArcMaterial(r){const e=j.getFovArcWidth(r),a=new T({renderOccluded:4,isDecoration:!0,width:e});return this._handles.add(n(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>a.setParameters({color:t}),s)),a}forEachManipulator(t){Object.values(this._manipulators).forEach(({manipulator:r})=>t(r,2))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach(r=>t(r))}get test(){return{manipulators:this._manipulators}}}function P(t,r,e){const{horizontalFieldOfView:o,verticalFieldOfView:n}=r,s=I(t),l=a(i((s?n:o)/2,0,15)),c=S(-l/2,l/2,s?1:Math.max(Math.sin(a(90-n/2)),.1));return[y(e,c),c]}function S(t,r,e,a=10){R(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const i=r-t;if(i<=0||e<=0){const t=.01;return[b(0,0,t),b(0,0,-t)]}const o=[],n=i/a;for(let s=0;s<a;s++){let i=t+s*n;s===a-1&&(i=r);const l=Math.cos(i)*e,c=Math.sin(i)*e,u=b(l-e,0,c);o.push(u)}return o}function D(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function F(t){return D(t)*G}function I(t){return"left"===t||"right"===t}function C(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"top"}function z(t,{observerRenderSpace:r,targetRenderSpace:e,tiltedUpVector:a,rightVector:i,farDistanceRenderSpace:o}){const n=g(L,e,r),s=I(t)?i:a,l=_(B,s,o);return v(r,n,l)}const G=Math.PI/2,k=f(),L=M(),B=M(),H={top:M(),bottom:M(),left:M(),right:M()};export{x as ViewshedFieldOfViewManipulation,S as createArcPolylineVertices,C as flipSide,I as isSideHorizontal,F as sideToRad};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import t from"../../../../core/Handles.js";import{deg2rad as i}from"../../../../core/mathUtils.js";import{fromScaling as e,fromTranslation as a,fromZRotation as r,mul as o,fromYRotation as n,multiply as s}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as m,g as c,f as p,a as u,H as h,e as d,b as f,n as _}from"../../../../chunks/vec32.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{fromValues as T}from"../../../../geometry/support/ray.js";import{displayFocusMultiplier as w}from"../Slice/sliceToolConfig.js";import{ViewshedArrowManipulator as j}from"./ViewshedArrowManipulator.js";import{viewshedToolManipulatorConfiguration as D}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as H,screenToCircleAngle as x}from"./viewshedToolUtils.js";import{screenToRenderRay as S}from"../../interactive/editingTools/dragEventPipeline3D.js";import{discRadiusSmall as M,discRadius as P}from"../../interactive/editingTools/manipulations/config.js";import{InteractiveManipulation as R}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createManipulatorDragEventPipeline as b,dragAtLocation as y}from"../../../interactive/dragEventPipeline.js";class V extends R{constructor(i){super(),this._handles=new t,this._tool=i.tool,this._view=i.view;const e=D.scaleOrientHandleRadius;this._manipulatorHeading=new j(this._view,e),this._manipulatorTilt=new j(this._view,e),this._manipulatorDistance=new j(this._view,e),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._manipulatorHeading=null,this._manipulatorTilt=null,this._manipulatorDistance=null,this._tool=null,this._view=null}createHeadingDragPipeline(t,e){return b(this._manipulatorHeading,(a,r,o,n,s)=>{const l=this._view,{tiltParallelToSurface:m,farDistanceRenderSpace:d,upVector:f,observerRenderSpace:_,targetRenderSpace:g,rightVector:T}=e,w=Math.sin(i(m))*d,j=p(L,_,c(O,f,w)),D=u(O,g,j),H=c(k,T,h(D)),S=v(j,D,H),M=x(r,l,S,e).next(t=>({...t,manipulatorType:3}));t(a,M,o)})}createTiltDragPipeline(t,i){return b(this._manipulatorTilt,(e,a,r,o,n)=>{const{observerRenderSpace:s,farDistanceRenderSpace:l,upVector:m,targetDirection:p}=i,u=d(p,m),h=f(L,p,m,-u);c(h,_(h,h),l);const g=c(O,m,l),T=v(s,h,g),w=x(a,this._view,T,i).next(t=>({...t,manipulatorType:3}));t(e,w,r)})}createDistanceDragPipeline(t,i){return b(this._manipulatorDistance,(e,a,r,o,n)=>{const s=T(i.observerRenderSpace,i.targetDirection),l=a.next(y(this._view,e.location)).next(S(this._view,s)).next(t=>({...t,manipulatorType:2}));t(e,l,r)})}updateManipulators(t){const{targetRenderSpace:i}=t;this._manipulatorHeading.renderLocation=i,this._manipulatorTilt.renderLocation=i,this._manipulatorDistance.renderLocation=i;const p=l(),u=t=>{s(p,t,p)},h=D.scaleOrientSize*(M/P);u(e(E,m(L,h,h,h))),u(H(t,E));const d=D.scaleOrientHandleRadius*w*h,f=c(L,t.targetDirection,d);u(a(E,f));const _=r(E,-C);o(_,_,n(I,-C)),this._manipulatorHeading.modelTransform=o(l(),p,_);const g=n(E,C);o(g,g,r(I,Math.PI)),this._manipulatorTilt.modelTransform=s(l(),p,g),this._manipulatorDistance.modelTransform=p}forEachManipulator(t){t(this._manipulatorHeading,3),t(this._manipulatorTilt,3),t(this._manipulatorDistance,2)}}const E=l(),I=l(),L=g(),O=g(),k=g(),C=Math.PI/2;export{V as ViewshedScaleOrientManipulation};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{deg2rad as t}from"../../../../core/mathUtils.js";import{fromScaling as e,mul as r,fromTranslation as s,fromRotation as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as a,c as n,t as l}from"../../../../chunks/vec32.js";import{fromValues as m,create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as f,arcAnglePerSegment as h}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as p,rotateBy as u}from"./viewshedToolUtils.js";import{Object3DVisualElement as d}from"../../interactive/visualElements/Object3DVisualElement.js";import{Attribute as w}from"../../webgl-engine/lib/Attribute.js";import{Geometry as v}from"../../webgl-engine/lib/Geometry.js";import{ColorMaterial as D}from"../../webgl-engine/materials/ColorMaterial.js";class b extends d{constructor(t){super(t),this._material=null,this._viewshedComputedData=null,this._material=new D({...f.shapeMaterialParameters,isDecoration:this.isDecoration,writeDepth:!1}),this.applyProperties(t)}get viewshedComputedData(){return this._viewshedComputedData}set viewshedComputedData(t){this._viewshedComputedData=t,this.updateTransform()}updateTransform(){const t=this._viewshedComputedData;if(null==t)return;const o=i(),a=t.farDistanceRenderSpace;e(o,m(a,a,a)),p(t,M),r(o,M,o),s(M,this._viewshedComputedData.observerRenderSpace),r(o,M,o),this.transform=o}createExternalResources(){}destroyExternalResources(){}forEachMaterial(t){t(this._material)}createGeometries(t){const{_material:e,viewshedComputedData:r}=this;if(null==r||null==e||!r.valid)return;j(e,r).forEach(e=>t.addGeometry(e))}}function j(e,r){const{horizontalFieldOfView:s,verticalFieldOfView:i}=r,m=a(C,0,0,1),c=a(_,0,1,0),f=a(x,1,0,0);u(m,m,t(i/2),c),u(m,m,t(s/2),f);const p=t=>Math.ceil(Math.abs(t)/h)+1,d=t(s),D=n(E,f),b=p(d),j=g(-d/(b-1)),R=o(M,j,D),V=t(-i),G=p(V),O=g(V/(G-1)),T=n(_,c),F=o(y,t(s)/2,f);l(T,T,F);const N=y,P=[],S=n(x,m);for(let t=0;t<b;t++){o(N,O,T);for(let e=0;e<G;e++){const r=3*(e*b+t);P[r]=S[0],P[r+1]=S[1],P[r+2]=S[2],l(S,S,N)}l(T,T,R),l(m,m,R),n(S,m)}const U=b*G;P[3*U]=0,P[3*U+1]=0,P[3*U+2]=0;const k=[];for(let t=0;t<b-1;t++)for(let e=0;e<G-1;e++){const r=6*(e*(b-1)+t);k[r]=e*b+t,k[r+1]=(e+1)*b+t,k[r+2]=e*b+t+1,k[r+3]=e*b+t+1,k[r+4]=(e+1)*b+t,k[r+5]=(e+1)*b+t+1}const z=[k];if(360!==s&&0!==i){const t=[],e=[];for(let r=0;r<G-1;r++){const s=3*r;t[s]=U,t[s+1]=(r+1)*b,t[s+2]=r*b,e[s]=U,e[s+1]=r*b+b-1,e[s+2]=(r+1)*b+b-1}z.push(t,e)}if(180!==i&&0!==s){const t=[],e=[];for(let r=0;r<b-1;r++){const s=3*r;t[s]=U,t[s+1]=r,t[s+2]=r+1,e[s]=U,e[s+1]=r+(G-1)*b+1,e[s+2]=r+(G-1)*b}z.push(t,e)}return z.map(t=>{const r=[["position",new w(P,t,3,!0)]];return new v(e,r)})}function g(t){return isNaN(t)?1:t}const C=c(),_=c(),x=c(),E=c(),M=i(),y=i();export{b as ViewshedShapeVisualElement};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as i}from"tslib";import e from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as c,syncAndInitial as d,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,e as b}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{FieldOfViewManipulation as V,isSideHorizontal as y,flipSide as D}from"./FieldOfViewManipulation.js";import{ScaleOrientManipulation as T}from"./ScaleOrientManipulation.js";import{viewshedToolManipulatorConfiguration as H}from"./ViewshedConfiguration.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends e{constructor(i){super(i),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new V({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new T({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([c(()=>this.viewshedComputedData?.observerRenderSpace,i=>{null!=i&&(this._moveManipulation.renderLocation=i,this._observerManipulator.renderLocation=i)},d),c(()=>this.viewshedComputedData?.heading,i=>{i&&(this._moveManipulation.angle=r(90-i))},v),c(()=>{const{viewshedComputedData:i}=this;return{viewshedComputedData:i,observer:i?.observer}},({viewshedComputedData:i,observer:e},a)=>{this._grabbing&&e!==a?.observer||(this.removeHandles(E),i?.valid&&this.addHandles([this._buildObserverDragPipeline(i),this._buildFOVDragPipeline(i),this._buildScaleOrientDragPipeline(i)].filter(t),E))},v),c(()=>{const i=this.viewshedComputedData;return i?.valid?{viewshedCompData:i,target:i.targetRenderSpace,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView}:null},i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorsTransform(i.viewshedCompData)},v),c(()=>{const i=this.viewshedComputedData;return i?.valid?{viewshedCompData:i,hFOV:i.horizontalFieldOfView,vFOV:i.verticalFieldOfView,tilt:i.tilt}:null},i=>{null!=i&&this._fieldOfViewManipulation.updateManipulatorVisuals(i.viewshedCompData)},v),c(()=>{const i=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),e=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:i&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:i&&(!this.parentTool.creating||e)}},({fovManipulationAvailable:i,nonFOVManipulationAvailable:e})=>{this._moveManipulation.available=e,this._scaleOrientManipulation.available=e,this._observerManipulator.available=e,this._fieldOfViewManipulation.available=i},v),c(()=>{const i=this.viewshedComputedData;if(!i?.valid)return null;const{observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=i;return{viewshedCompData:i,observer:e,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}},i=>{null!=i&&this._scaleOrientManipulation.updateManipulators(i.viewshedCompData)},v)]);const i=i=>{const e=this.analysisViewData;this.addHandles([i.events.on("focus-changed",()=>{const i=this._someManipulatorHovering();i&&this.parentTool.subToolHandles.forEach(({subTool:i})=>{i._resetHoveringTask()}),this._someManipulatorSelected()||i||(this._forceHoveringTask=a(async i=>{await(this._forceHoveringTestPromise??h(H.hoverTimeoutMilliseconds,i)),u(i),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),i.events.on("grab-changed",t=>{this._grabbing="start"===t.action,"end"===t.action&&e.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:i})=>{i!==this&&i._setInteractive(!this._grabbing)}),this._setInteractive(e=>e.hasManipulator(i)||!this._grabbing)}),i.events.on("drag",i=>{"start"===i.action&&e.tool?.updateInteractionVisualsVisibility()})])};this._forEachManipulator(i)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(i){const e=this.viewshed;null!=e&&(e.observer=i)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:i,grabbing:e}=this._moveManipulation;return{dragging:i,grabbing:e}}get scaleOrientInteractionState(){const{dragging:i,grabbing:e}=this._scaleOrientManipulation;return{dragging:i,grabbing:e}}_setInteractive(i){const e="boolean"==typeof i;this._forEachManipulation(t=>t.interactive=e?i:i(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(i){let e=!1;return this._forEachManipulator(t=>{e=e||t===i}),e}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(i){const e={mode:"absolute-height",offset:0},t=i.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((i,e,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next(i=>(this.observer=l.data.geometry,i)),cancel:n}},e,a,void 0)}_buildFOVDragPipeline(i){let e=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,n,s)=>{if(null==i)return{steps:n,cancel:s};const r=i.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next(a=>{"start"===a.action&&(l=null,e=i.horizontalFieldOfView,t=i.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const i="bottom"===a.side||"left"===a.side?n>0:n<0;l=y(a.side)?0===e&&i||360===e&&!i:0===t&&i}const s=l?D(a.side):a.side;let p=0;switch(s){case"left":p=e/2-n;break;case"right":p=e/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return y(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a}),cancel:s}},i)}_buildScaleOrientDragPipeline(i){let e=0,t=0;const a=(e,t)=>(a,o,n)=>{if(null==i)return{steps:o,cancel:n};const s=i.viewshed;return n=n.next(S(s,[e])),{steps:o=o.next(t(s,i)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(e,a)=>a=>("start"===a.action&&(t=i.heading),e.heading=o.normalize(t+a.deltaAngle),a)),i),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(e=i.tilt);let o=e+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a}),i),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(i,e)=>t=>{const a=g(I,t.renderEnd,e.observerRenderSpace),o=M(a)*e.metersPerUnit,n=b(a,e.targetDirection)<0?H.scaleOrientMinDistance:o;return i.farDistance=n,t}),i)])}_updateManipulatorVisibility(){const i=this._someManipulatorSelected(),e=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=i=>{o.push(i.disableDisplay())};i||!a&&e?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),i||!a&&e||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),i||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(i){this._forEachManipulation(e=>{e.forEachManipulator(i)}),i(this._observerManipulator)}_forEachManipulation(i){i(this._moveManipulation),i(this._fieldOfViewManipulation),i(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:i=>{this._forceHoveringTestPromise=i}}}};i([m({constructOnly:!0})],U.prototype,"analysis",void 0),i([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),i([m({constructOnly:!0})],U.prototype,"parentTool",void 0),i([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),i([m()],U.prototype,"viewshed",null),i([m()],U.prototype,"_grabbing",void 0),i([m()],U.prototype,"grabbing",null),i([m()],U.prototype,"viewshedComputedData",void 0),i([m()],U.prototype,"observer",null),U=i([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=_(),R=new n(0,180);export{U as ViewshedSubTool};
5
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{createTask as a}from"../../../../core/asyncUtils.js";import{cyclicalDegrees as o,Cyclical as n}from"../../../../core/Cyclical.js";import{handlesGroup as s}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{deg2rad as r}from"../../../../core/mathUtils.js";import{abortMaybe as l,destroyMaybe as p}from"../../../../core/maybe.js";import{after as h,throwIfAborted as u}from"../../../../core/promiseUtils.js";import{watch as d,syncAndInitial as c,initial as v}from"../../../../core/reactiveUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as f}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as g,H as M,e as b}from"../../../../chunks/vec32.js";import{create as _}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{tryProjectWithZConversion as w}from"../../../../geometry/projectionUtils.js";import{viewingModeFromString as O}from"../../../ViewingMode.js";import{viewshedToolManipulatorConfiguration as V}from"./ViewshedConfiguration.js";import{ViewshedFieldOfViewManipulation as y,isSideHorizontal as D,flipSide as T}from"./ViewshedFieldOfViewManipulation.js";import{ViewshedScaleOrientManipulation as H}from"./ViewshedScaleOrientManipulation.js";import{ViewshedObserverManipulator as j}from"./viewshedToolManipulatorUtils.js";import{discRadiusSmall as C}from"../../interactive/editingTools/manipulations/config.js";import{MoveManipulation as F}from"../../interactive/editingTools/manipulations/MoveManipulation.js";import{resetProperties as S,dragManipulatedObject as P}from"../../../interactive/dragEventPipeline.js";import{EditGeometryOperations as k}from"../../../interactive/editGeometry/EditGeometryOperations.js";const E=Symbol("dragHandles"),x=Symbol("hideManipulators"),A=Symbol("hideFoVManipulators"),z=Symbol("hideObserverManipulator");let U=class extends i{constructor(e){super(e),this._moveManipulation=null,this._observerManipulator=null,this._fieldOfViewManipulation=null,this._scaleOrientManipulation=null,this._forceHoveringTask=null,this._forceHoveringTestPromise=null,this._grabbing=!1,this.viewshedComputedData=null}initialize(){this._moveManipulation=this._createMoveManipulation(),this._fieldOfViewManipulation=new y({view:this.view,tool:this.parentTool}),this._scaleOrientManipulation=new H({view:this.view,tool:this.parentTool}),this._observerManipulator=new j(this.view,this.parentTool),this.addHandles([d(()=>this.viewshedComputedData?.observerRenderSpace,e=>{null!=e&&(this._moveManipulation.renderLocation=e,this._observerManipulator.renderLocation=e)},c),d(()=>this.viewshedComputedData?.heading,e=>{e&&(this._moveManipulation.angle=r(90-e))},v),d(()=>{const{viewshedComputedData:e}=this;return{viewshedComputedData:e,observer:e?.observer}},({viewshedComputedData:e,observer:i},a)=>{this._grabbing&&i!==a?.observer||(this.removeHandles(E),e?.valid&&this.addHandles([this._buildObserverDragPipeline(e),this._buildFOVDragPipeline(e),this._buildScaleOrientDragPipeline(e)].filter(t),E))},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,target:e.targetRenderSpace,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorsTransform(e.viewshedCompData)},v),d(()=>{const e=this.viewshedComputedData;return e?.valid?{viewshedCompData:e,hFOV:e.horizontalFieldOfView,vFOV:e.verticalFieldOfView,tilt:e.tilt}:null},e=>{null!=e&&this._fieldOfViewManipulation.updateManipulatorVisuals(e.viewshedCompData)},v),d(()=>{const e=this.analysisViewData.visible&&(this.viewshedComputedData?.valid??!1),i=this.parentTool.selectedViewshedComputedData===this.viewshedComputedData;return{fovManipulationAvailable:e&&!this.parentTool.isPlacingTarget,nonFOVManipulationAvailable:e&&(!this.parentTool.creating||i)}},({fovManipulationAvailable:e,nonFOVManipulationAvailable:i})=>{this._moveManipulation.available=i,this._scaleOrientManipulation.available=i,this._observerManipulator.available=i,this._fieldOfViewManipulation.available=e},v),d(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const{observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}=e;return{viewshedCompData:e,observer:i,target:t,verticalFieldOfView:a,horizontalFieldOfView:o}},e=>{null!=e&&this._scaleOrientManipulation.updateManipulators(e.viewshedCompData)},v)]);const e=e=>{const i=this.analysisViewData;this.addHandles([e.events.on("focus-changed",()=>{const e=this._someManipulatorHovering();e&&this.parentTool.subToolHandles.forEach(({subTool:e})=>{e._resetHoveringTask()}),this._someManipulatorSelected()||e||(this._forceHoveringTask=a(async e=>{await(this._forceHoveringTestPromise??h(V.hoverTimeoutMilliseconds,e)),u(e),this._forceHoveringTask=null,this._updateManipulatorVisibility()}))}),e.events.on("grab-changed",t=>{this._grabbing="start"===t.action,"end"===t.action&&i.tool?.updateInteractionVisualsVisibility(),this.parentTool.subToolHandles.forEach(({subTool:e})=>{e!==this&&e._setInteractive(!this._grabbing)}),this._setInteractive(i=>i.hasManipulator(e)||!this._grabbing)}),e.events.on("drag",e=>{"start"===e.action&&i.tool?.updateInteractionVisualsVisibility()})])};this._forEachManipulator(e)}destroy(){this._forceHoveringTask=l(this._forceHoveringTask),this._moveManipulation=p(this._moveManipulation),this._fieldOfViewManipulation=p(this._fieldOfViewManipulation),this._scaleOrientManipulation=p(this._scaleOrientManipulation),this.parentTool.manipulators.remove(this._observerManipulator),this._observerManipulator=p(this._observerManipulator)}get viewshed(){return this.viewshedComputedData?.viewshed}get grabbing(){return this._grabbing}get observer(){return this.viewshed?.observer}set observer(e){const i=this.viewshed;null!=i&&(i.observer=e)}get discManipulator(){return this._moveManipulation.xyManipulation.discManipulator}get moveInteractionState(){const{dragging:e,grabbing:i}=this._moveManipulation;return{dragging:e,grabbing:i}}get scaleOrientInteractionState(){const{dragging:e,grabbing:i}=this._scaleOrientManipulation;return{dragging:e,grabbing:i}}_setInteractive(e){const i="boolean"==typeof e;this._forEachManipulation(t=>t.interactive=i?e:e(t))}onManipulatorSelectionChanged(){if(this._updateManipulatorVisibility(),!this._someManipulatorSelected()){this.analysisViewData.selectedViewshed===this.viewshed&&(this.analysisViewData.selectedViewshed=null),this._resetHoveringTask()}}hasManipulator(e){let i=!1;return this._forEachManipulator(t=>{i=i||t===e}),i}_someManipulatorSelected(){return this._moveManipulation.selected||this._fieldOfViewManipulation.selected||this._scaleOrientManipulation.selected}_someManipulatorHovering(){return this._moveManipulation.hovering||this._fieldOfViewManipulation.hovering||this._scaleOrientManipulation.hovering}_createMoveManipulation(){return new F({view:this.view,tool:this.parentTool,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:C})}_buildObserverDragPipeline(e){const i={mode:"absolute-height",offset:0},t=e.observer;if(null==t)return null;const a=this.view.spatialReference;return this._moveManipulation.createDragPipeline((e,i,o,n,s)=>{n=n.next(S(this,["observer"]));const r=w(t,a);if(null==r)return{steps:o,cancel:n};const l=k.fromGeometry(r,O(this.view.viewingMode));return{steps:o.next(P({operations:l})).next(e=>(this.observer=l.data.geometry,e)),cancel:n}},i,a,void 0)}_buildFOVDragPipeline(e){let i=0,t=0;return this._fieldOfViewManipulation.createDragPipeline((a,n,s)=>{if(null==e)return{steps:n,cancel:s};const r=e.viewshed;let l=null;s=s.next(S(r,["horizontalFieldOfView","verticalFieldOfView"]));return{steps:n.next(a=>{"start"===a.action&&(l=null,i=e.horizontalFieldOfView,t=e.verticalFieldOfView);const n=a.deltaAngle;if(null==l&&0!==n){const e="bottom"===a.side||"left"===a.side?n>0:n<0;l=D(a.side)?0===i&&e||360===i&&!e:0===t&&e}const s=l?T(a.side):a.side;let p=0;switch(s){case"left":p=i/2-n;break;case"right":p=i/2+n;break;case"top":p=t+2*n;break;case"bottom":p=t-2*n}return D(s)?(p=o.normalize(p),p=p>270?0:p>180?180:p,r.horizontalFieldOfView=2*p):r.verticalFieldOfView=p,a}),cancel:s}},e)}_buildScaleOrientDragPipeline(e){let i=0,t=0;const a=(i,t)=>(a,o,n)=>{if(null==e)return{steps:o,cancel:n};const s=e.viewshed;return n=n.next(S(s,[i])),{steps:o=o.next(t(s,e)),cancel:n}};return s([this._scaleOrientManipulation.createHeadingDragPipeline(a("heading",(i,a)=>a=>("start"===a.action&&(t=e.heading),i.heading=o.normalize(t+a.deltaAngle),a)),e),this._scaleOrientManipulation.createTiltDragPipeline(a("tilt",(t,a)=>a=>{"start"===a.action&&(i=e.tilt);let o=i+a.deltaAngle;return o<-90?o=180:o>270&&(o=0),t.tilt=R.clamp(o),a}),e),this._scaleOrientManipulation.createDistanceDragPipeline(a("farDistance",(e,i)=>t=>{const a=g(I,t.renderEnd,i.observerRenderSpace),o=M(a)*i.metersPerUnit,n=b(a,i.targetDirection)<0?V.scaleOrientMinDistance:o;return e.farDistance=n,t}),e)])}_updateManipulatorVisibility(){const e=this._someManipulatorSelected(),i=null!=this._forceHoveringTask||this._someManipulatorHovering(),t=this._fieldOfViewManipulation.hovering,a=this.parentTool.creating;let o=[];const n=e=>{o.push(e.disableDisplay())};e||!a&&i?this.removeHandles(x):(this._scaleOrientManipulation.forEachManipulator(n),this._moveManipulation.forEachManipulator(n),this.addHandles(o,x),o=[]),e||!a&&i||a&&t?this.removeHandles(A):(this._fieldOfViewManipulation.forEachManipulator(n),this.addHandles(o,A)),e||!a?this.removeHandles(z):this.addHandles(this._observerManipulator.disableDisplay(),z)}_resetHoveringTask(){this._forceHoveringTask=l(this._forceHoveringTask),this._updateManipulatorVisibility()}_forEachManipulator(e){this._forEachManipulation(i=>{i.forEachManipulator(e)}),e(this._observerManipulator)}_forEachManipulation(e){e(this._moveManipulation),e(this._fieldOfViewManipulation),e(this._scaleOrientManipulation)}get test(){return{moveManipulation:this._moveManipulation,fieldOfViewManipulation:this._fieldOfViewManipulation,scaleOrientManipulation:this._scaleOrientManipulation,viewshedComputedData:this.viewshedComputedData,setHoveringTimeoutPromise:e=>{this._forceHoveringTestPromise=e}}}};e([m({constructOnly:!0})],U.prototype,"analysis",void 0),e([m({constructOnly:!0})],U.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],U.prototype,"parentTool",void 0),e([m({constructOnly:!0,nonNullable:!0})],U.prototype,"view",void 0),e([m()],U.prototype,"viewshed",null),e([m()],U.prototype,"_grabbing",void 0),e([m()],U.prototype,"grabbing",null),e([m()],U.prototype,"viewshedComputedData",void 0),e([m()],U.prototype,"observer",null),U=e([f("esri.views.3d.analysis.Viewshed.ViewshedSubTool")],U);const I=_(),R=new n(0,180);export{U as ViewshedSubTool};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as f,g as V,p as v,u as w,c as E,f as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import{ViewshedShapeVisualElement as D}from"./ViewshedShapeVisualElement.js";import y from"./ViewshedTool.js";import{LineVisualElement as j}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as F}from"../../interactive/visualElements/PointVisualElement.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},i={...t,stipplePattern:R(2)};this._observerVisualElement=new F({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new D({...e,isDecoration:this.isDecoration}),this._frameLinesVisualElement=new j(t),this._leftArcVisualElement=new j(t),this._rightArcVisualElement=new j(t),this._topArcVisualElement=new j(t),this._bottomArcVisualElement=new j(t),this._centralLongitude=new j(i),this._centralLatitude=new j(i),this.addHandles([a(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}},e=>{const t=null!=e;this._forEachVisualElement(e=>e.attached=t),t&&this._updateVisualElements(e)},{initial:!0,equals:s}),a(()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}},({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()},l),a(()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}},({visible:e,selected:t,staged:i,horFovNot360:s})=>{const o=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const r=e&&(t||s);this._leftArcVisualElement.visible=r,this._rightArcVisualElement.visible=r,this._forEachLineVisualElement(e=>{e.width=o?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(o?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t})},l),a(()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,o=this.view.activeTool,r=!t?.active&&o instanceof y&&o.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||r),color:this._color}},({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement(e=>e.color=t)},l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const o=s.tool?.active||s.interactive,r=e.viewshed===s.tool?.stagedViewshed,a=o&&(i||r)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:o}=e,r=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(r,i),this._updateFrameArcs(t,i,o),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:r,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=o(a),c=g(),p=m();h(p,n/2,l),d(c,r,p),O(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,r,p),O(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";O(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),O(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";O(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),O(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function O(e,t,i,s,o,r,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),f(c,c),V(c,c,n);let u=v(l,c);const L=C(r);"backward"===o&&(w(L,L),u=-(2*Math.PI-u));const D=[],y=Math.ceil(Math.abs(u)/a),j=m();h(j,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,j),b(R,t,F);const i=g();E(i,R),D.push([e,i])}e.geometry=D}e([n()],S.prototype,"view",void 0),e([n({constructOnly:!0})],S.prototype,"isDecoration",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedSubVisualization")],S);export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import"../../../../core/has.js";import{equals as s}from"../../../../core/lang.js";import{deg2rad as o}from"../../../../core/mathUtils.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{watch as a,initial as l}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{t as d,i as u,a as p,H as _,n as f,g as V,p as v,u as E,c as w,f as b}from"../../../../chunks/vec32.js";import{create as g,clone as C}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{viewshedVisualizationConfiguration as L,arcAnglePerSegment as A}from"./ViewshedConfiguration.js";import D from"./ViewshedTool.js";import{LineVisualElement as y}from"../../interactive/visualElements/LineVisualElement.js";import{PointVisualElement as j}from"../../interactive/visualElements/PointVisualElement.js";import{ViewshedShapeVisualElement as F}from"../../interactive/visualElements/ViewshedShapeVisualElement.js";import{createStipplePatternSimple as R}from"../../webgl-engine/materials/lineStippleUtils.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},i={...t,stipplePattern:R(2)};this._observerVisualElement=new j({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new F({...e,isDecoration:this.isDecoration}),this._frameLinesVisualElement=new y(t),this._leftArcVisualElement=new y(t),this._rightArcVisualElement=new y(t),this._topArcVisualElement=new y(t),this._bottomArcVisualElement=new y(t),this._centralLongitude=new y(i),this._centralLatitude=new y(i),this.addHandles([a(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}},e=>{const t=null!=e;this._forEachVisualElement(e=>e.attached=t),t&&this._updateVisualElements(e)},{initial:!0,equals:s}),a(()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}},({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()},l),a(()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}},({visible:e,selected:t,staged:i,horFovNot360:s})=>{const o=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const r=e&&(t||s);this._leftArcVisualElement.visible=r,this._rightArcVisualElement.visible=r,this._forEachLineVisualElement(e=>{e.width=o?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(o?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t})},l),a(()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,o=this.view.activeTool,r=!t?.active&&o instanceof D&&o.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||r),color:this._color}},({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement(e=>e.color=t)},l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const o=s.tool?.active||s.interactive,r=e.viewshed===s.tool?.stagedViewshed,a=o&&(i||r)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(this._centralLatitude)}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:o}=e,r=C(t.observerRenderSpace);this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(r,i),this._updateFrameArcs(t,i,o),this._updateCentralHelperArcs(t,s)}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:r,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=o(a),c=g(),p=m();h(p,n/2,l),d(c,r,p),O(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,r,p),O(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";O(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),O(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";O(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),O(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function O(e,t,i,s,o,r,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),f(c,c),V(c,c,n);let u=v(l,c);const L=C(r);"backward"===o&&(E(L,L),u=-(2*Math.PI-u));const D=[],y=Math.ceil(Math.abs(u)/a),j=m();h(j,u/y,L);const F=g();w(F,l);const R=g();w(R,i);for(let h=0;h<y;h++){const e=g();w(e,R),d(F,F,j),b(R,t,F);const i=g();w(i,R),D.push([e,i])}e.geometry=D}e([n()],S.prototype,"view",void 0),e([n({constructOnly:!0})],S.prototype,"isDecoration",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],S);export{S as default};
5
+ import{__decorate as i}from"tslib";import s from"../../../../core/Accessor.js";import{destroyHandle as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{mapCollection as t}from"../../../../core/mapCollectionUtils.js";import{watch as e,initial as r}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import n from"./ViewshedSubVisualization.js";let c=class extends s{get visible(){return this.analysisViewData.visible}constructor(i){super(i)}initialize(){const i=this.analysisViewData,s=t(()=>this.analysisViewData.viewshedComputedDataHandles,({viewshedComputedData:s})=>{const o=new n({view:this.view,viewshedComputedData:s,analysisViewData:i,isDecoration:this.isDecoration});return{visualization:o,remove:()=>o.destroy()}});this._subVisualizations=s,this.addHandles([o(s),e(()=>this.visible,i=>this._subVisualizations.forEach(({visualization:s})=>s.visible=i),r)])}get test(){}};i([a({constructOnly:!0})],c.prototype,"analysisViewData",void 0),i([a({constructOnly:!0,nonNullable:!0})],c.prototype,"view",void 0),i([a({constructOnly:!0})],c.prototype,"isDecoration",void 0),i([a()],c.prototype,"visible",null),c=i([l("esri.views.3d.analysis.Viewshed.ViewshedVisualization")],c);export{c as ViewshedVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,initial as l,when as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{c as m,q as v}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as f,isLoaded as V,projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as g,containsPoint as j}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedAnalysisVisualization as D}from"./Viewshed/ViewshedAnalysisVisualization.js";import{ViewshedComputedData as C}from"./Viewshed/ViewshedComputedData.js";import F from"./Viewshed/ViewshedTool.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as U,removeAnalysisViewTool as A,startPlaceOperation as S}from"../../analysis/analysisViewUtils.js";let N=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderNode=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=o(()=>this.analysis.viewsheds,t=>{const s=new C({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([n(()=>({valid:s.valid,canProject:f(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))},l),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._analysisVisualization=new D({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([n(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),n(()=>e.renderCoordsHelper,e=>{this.viewshedComputedDataHandles?.forEach(({viewshedComputedData:t})=>t.renderCoordsHelper=e)}),U(this,F),h(()=>this.interactive,()=>{this._unselectOtherViewsheds(this.selectedViewshed)},c)])}destroy(){this.userOperation=a(this.userOperation),A(this),this._analysisVisualization=d(this._analysisVisualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[n(()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature],()=>{this._updateObserverFromFeature(t,e)},l),this._createElevationUpdateHandle(e),h(()=>e.needUpdateByFeature,()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1})]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=y(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally(()=>t(s,i));const d=a.geometry;null!=d&&(_(s,i,T,r.spatialReference),j(T,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:s})=>t(e,s))}async createViewsheds(e){await S(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return S(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=m(w(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:m(w(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=v(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof F&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],N.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],N.prototype,"analysis",void 0),e([p()],N.prototype,"tool",void 0),e([p()],N.prototype,"_selectedViewshed",void 0),e([p()],N.prototype,"selectedViewshed",null),e([p()],N.prototype,"selectedViewshedComputedData",null),e([p()],N.prototype,"viewshedComputedDataHandles",void 0),e([p()],N.prototype,"userOperation",void 0),e([p()],N.prototype,"_analysisVisualization",void 0),e([p()],N.prototype,"_viewshedRenderNode",void 0),N=e([u("esri.views.3d.analysis.ViewshedAnalysisView3D")],N);const z=N,T=g();export{z as default};
5
+ import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../../analysis/featureReferenceUtils.js";import i from"../../../core/Accessor.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{mapCollection as o}from"../../../core/mapCollectionUtils.js";import{abortMaybe as a,destroyMaybe as d}from"../../../core/maybe.js";import{watch as n,initial as l,when as h,syncAndInitial as c}from"../../../core/reactiveUtils.js";import{property as p}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{c as m,q as v}from"../../../chunks/vec32.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as f,isLoaded as V,projectOrLoad as y}from"../../../geometry/projectionUtils.js";import{projectBoundingRect as _}from"../../../geometry/projection/projectBoundingRect.js";import{empty as g,containsPoint as j}from"../../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as R}from"./AnalysisView3D.js";import{logFailedGeometryProjectionError as b}from"./support/projectionUtils.js";import{ViewshedComputedData as D}from"./Viewshed/ViewshedComputedData.js";import C from"./Viewshed/ViewshedTool.js";import{ViewshedVisualization as F}from"./Viewshed/ViewshedVisualization.js";import{Intersector as H}from"../webgl-engine/lib/Intersector.js";import{Viewshed as O}from"../webgl-engine/lib/Viewshed.js";import{connectAnalysisViewToTool as U,removeAnalysisViewTool as S,startPlaceOperation as A}from"../../analysis/analysisViewUtils.js";let N=class extends(R(i)){constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderNode=new O({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new H(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=o(()=>this.analysis.viewsheds,t=>{const s=new D({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),i=Symbol();return this.addHandles([n(()=>({valid:s.valid,canProject:f(s.observer?.spatialReference,this.view.spatialReference)||V()}),({valid:e,canProject:t},i)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):i?.valid&&i?.canProject&&this._removeViewshedsFromRenderer(s),t||b(this.analysis,s.observer.spatialReference,r.getLogger(this)))},l),...this._createFeatureReferenceHandles(s)],i),{viewshedComputedData:s,remove:()=>{this.removeHandles(i),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new F({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([n(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),n(()=>e.renderCoordsHelper,e=>{this.viewshedComputedDataHandles?.forEach(({viewshedComputedData:t})=>t.renderCoordsHelper=e)}),U(this,C),h(()=>this.interactive,()=>{this._unselectOtherViewsheds(this.selectedViewshed)},c)])}destroy(){this.userOperation=a(this.userOperation),S(this),this._visualization=d(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[n(()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature],()=>{this._updateObserverFromFeature(t,e)},l),this._createElevationUpdateHandle(e),h(()=>e.needUpdateByFeature,()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1})]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=y(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally(()=>t(s,i));const d=a.geometry;null!=d&&(_(s,i,T,r.spatialReference),j(T,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:s})=>t(e,s))}async createViewsheds(e){await A(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return A(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=m(w(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:m(w(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=v(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof C&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],N.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],N.prototype,"analysis",void 0),e([p()],N.prototype,"tool",void 0),e([p()],N.prototype,"_selectedViewshed",void 0),e([p()],N.prototype,"selectedViewshed",null),e([p()],N.prototype,"selectedViewshedComputedData",null),e([p()],N.prototype,"viewshedComputedDataHandles",void 0),e([p()],N.prototype,"userOperation",void 0),e([p()],N.prototype,"_visualization",void 0),e([p()],N.prototype,"_viewshedRenderNode",void 0),N=e([u("esri.views.3d.analysis.ViewshedAnalysisView3D")],N);const z=N,T=g();export{z as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as n}from"../../../../chunks/vec32.js";import{fromValues as s,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,width as c,height as p,expand as d}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as l}from"../../../../geometry/support/coordinateSystem.js";let m=class extends r{constructor(e){super(e)}get localOrigin(){const{extent:e}=this;return s(e.center.x,e.center.y,0)}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i();return r.setAltitude(t,h,e),t}get cameraDimensions(){const{extent:e,renderCoordsHelper:r}=this;if(2===r.viewingMode)return{width:e.width,height:e.height};const t=a();this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t);return{width:c(t),height:p(t)}}get cameraNearFar(){return{near:x,far:y}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:s,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;n(u,e,r,p),c.toRenderCoords(u,o.spatialReference,u),l(u,s,i,a,g),d(t,g,t)}};e([t()],m.prototype,"renderCoordsHelper",void 0),e([t()],m.prototype,"extent",void 0),e([t()],m.prototype,"localOrigin",null),e([t()],m.prototype,"localOriginRenderSpace",null),e([t()],m.prototype,"cameraPositionRenderSpace",null),e([t()],m.prototype,"cameraDimensions",null),e([t()],m.prototype,"upVector",null),e([t()],m.prototype,"northVector",null),e([t()],m.prototype,"eastVector",null),m=e([o("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementComputation")],m);const u=i(),g=i(),h=9e3,x=0,y=2e4;export{m as CutFillVolumeMeasurementComputation};
5
+ import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as n}from"../../../../chunks/vec32.js";import{fromValues as s,create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,width as c,height as p,expand as d}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as l}from"../../../../geometry/support/coordinateSystem.js";let m=class extends r{constructor(e){super(e)}get localOrigin(){const{extent:e}=this;return s(e.center.x,e.center.y,0)}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:t}=this,o=i();return t.toRenderCoords(r,e.spatialReference,o),o}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,t=i();return r.setAltitude(t,h,e),t}get cameraDimensions(){const{extent:e,renderCoordsHelper:r}=this;if(2===r.viewingMode)return{width:e.width,height:e.height};const t=a();this._expandBoundingRect(e.xmin,e.ymin,t),this._expandBoundingRect(e.xmax,e.ymin,t),this._expandBoundingRect(e.xmin,e.ymax,t),this._expandBoundingRect(e.xmax,e.ymax,t);return{width:c(t),height:p(t)}}get cameraNearFar(){return{near:x,far:y}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,i())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,i())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,i())}_expandBoundingRect(e,r,t){const{extent:o,eastVector:s,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;n(u,e,r,p),c.toRenderCoords(u,o.spatialReference,u),l(u,s,i,a,g),d(t,g,t)}};e([t()],m.prototype,"renderCoordsHelper",void 0),e([t()],m.prototype,"extent",void 0),e([t()],m.prototype,"localOrigin",null),e([t()],m.prototype,"localOriginRenderSpace",null),e([t()],m.prototype,"cameraPositionRenderSpace",null),e([t()],m.prototype,"cameraDimensions",null),e([t()],m.prototype,"upVector",null),e([t()],m.prototype,"northVector",null),e([t()],m.prototype,"eastVector",null),m=e([o("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],m);const u=i(),g=i(),h=9e3,x=0,y=2e4;export{m as VolumeMeasurementCutFillComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{syncAndInitial as i,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{CutFillVolumeMeasurementComputation as g}from"./CutFillVolumeMeasurementComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},i),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const o=this.analysis.geometry;if(null==o||"ground"!==t.context)return;const i=p(o,this.view.spatialReference);if(null!=i.pending)return this._updatingHandles.addPromise(i.pending),void i.pending.finally(()=>e(t));const n=i.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(o,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:i}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,o.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(i,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:o}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||null==o)return void(this.analysisViewData.targetGeometry=t);const i=t.clone();i.rings[0].forEach(e=>{e[2]=o}),this.analysisViewData.targetGeometry=i}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementController")],v);const _=d(),w=d();export{v as CutFillVolumeMeasurementController};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{syncAndInitial as i,watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as p}from"../../../../geometry/projectionUtils.js";import{projectBoundingRect as m}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as d,fromExtent as u,intersects as c}from"../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as y}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as g}from"./VolumeMeasurementCutFillComputation.js";import{getElevationAtPoint as h}from"../../support/ElevationProvider.js";let v=class extends t{constructor(e){super(e),this._updatingHandles=new l,this._computation=null}initialize(){this._updatingHandles.add(()=>({geometry:this.analysis.geometry,projectedGeometry:p(this.analysis.geometry,this.view.spatialReference)}),({geometry:e,projectedGeometry:t})=>{null==t.pending?this._onGeometryChange(e,t.geometry):this._updatingHandles.addPromise(t.pending)},i),this.addHandles([this._createElevationUpdateHandle(),n(()=>[this.analysis.measureType,this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.effectiveTargetElevation],()=>this._updateTargetGeometry()),n(()=>this.analysisViewData.elevationAlignedGeometry?.extent,e=>{e?this._updateComputation(e):this._removeComputation()},a)])}destroy(){this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}_createComputation(e){const{renderCoordsHelper:t}=this.view;this._computation=new g({extent:e,renderCoordsHelper:t})}_updateComputation(e){this._computation?this._computation.extent=e:this._createComputation(e)}_removeComputation(){this._computation=null}_createElevationUpdateHandle(){const e=t=>{const o=this.analysis.geometry;if(null==o||"ground"!==t.context)return;const i=p(o,this.view.spatialReference);if(null!=i.pending)return this._updatingHandles.addPromise(i.pending),void i.pending.finally(()=>e(t));const n=i.geometry;null!=n&&null!=n.extent&&(m(t.extent,t.spatialReference,_,this.view.spatialReference),u(n.extent,w),c(_,w)&&this._onGeometryChange(o,n))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_onGeometryChange(e,t){const{elevationProvider:i}=this.view,{valid:n}=this.analysis;if(null==e||!n)return void(this.analysisViewData.elevationAlignedGeometry=null);if(null==t)return y(this.analysis,e.spatialReference,o.getLogger(this)),void(this.analysisViewData.elevationAlignedGeometry=null);const a=t.clone();f(i,a),this.analysisViewData.elevationAlignedGeometry=a}_updateTargetGeometry(){const{measureType:e}=this.analysis,{elevationAlignedGeometry:t,effectiveTargetElevation:o}=this.analysisViewData;if(!t)return void(this.analysisViewData.targetGeometry=null);if("stockpile"===e||null==o)return void(this.analysisViewData.targetGeometry=t);const i=t.clone();i.rings[0].forEach(e=>{e[2]=o}),this.analysisViewData.targetGeometry=i}};function f(e,t){t.rings[0].forEach(t=>{t[2]=h(e,t,"ground")??0})}e([r({constructOnly:!0})],v.prototype,"analysis",void 0),e([r({constructOnly:!0})],v.prototype,"analysisViewData",void 0),e([r({constructOnly:!0})],v.prototype,"view",void 0),e([r()],v.prototype,"updating",null),e([r({readOnly:!0})],v.prototype,"_updatingHandles",void 0),e([r()],v.prototype,"_computation",void 0),v=e([s("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],v);const _=d(),w=d();export{v as VolumeMeasurementCutFillController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{cutFillConfiguration as m}from"./VolumeMeasurementConfiguration.js";import{LineVisualElement as c}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as p}from"../../interactive/visualElements/OutlineVisualElement.js";import{GeodesicSegment as h}from"../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as u}from"../../webgl-engine/materials/lineStippleUtils.js";let d=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}constructor(e){super(e)}initialize(){const{accentColor:e}=this.view.effectiveTheme,i={view:this.view,isDecoration:!0},o=m,r={...i,width:o.geometryOutlineWidth},n=t.toUnitRGBA(e),l=t.toUnitRGBA(o.targetGeometryOutlineColor);this._elevationAlignedGeometry=new p({...r,isDraped:!0,color:n}),this._targetGeometry=new p({...r,color:l});const a={...i,attached:!0,width:o.projectionLineWidth,stipplePattern:u(o.projectionLineStippleSize),renderOccluded:4},h=t.toUnitRGBA(o.cutProjectionLineColor),d=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new c({...a,color:h}),this._fillProjectionLines=new c({...a,color:d}),this.addHandles([s(()=>[this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.targetGeometry,this.visible],()=>this._updateVisualElements()),s(()=>this.view.effectiveTheme.accentColor,e=>{this._elevationAlignedGeometry.color=t.toUnitRGBA(e)})])}destroy(){this._elevationAlignedGeometry=o(this._elevationAlignedGeometry),this._targetGeometry=o(this._targetGeometry),this._cutProjectionLines=o(this._cutProjectionLines),this._fillProjectionLines=o(this._fillProjectionLines)}_updateVisualElements(){this._updateGeometries(),this._updateProjectionLines()}_updateGeometries(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;this._elevationAlignedGeometry.geometry=t,this._elevationAlignedGeometry.visible=e,this._targetGeometry.geometry=i,this._targetGeometry.visible=e}_updateProjectionLines(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;if(this._cutProjectionLines.visible=e,this._fillProjectionLines.visible=e,!t||!i)return;const{renderCoordsHelper:o}=this.view,s=o.spatialReference,r=[],n=[],a=t.spatialReference;for(let m=0;m<t.rings[0].length;++m){const e=t.rings[0][m],c=l(y,e[0],e[1],e[2]);o.toRenderCoords(c,a,c);const p=i.rings[0][m],u=l(v,p[0],p[1],p[2]);o.toRenderCoords(u,a,u);const d=new h(c,u,s);c[2]>u[2]?r.push(d):n.push(d)}this._cutProjectionLines.setGeometryFromSegments(r),this._fillProjectionLines.setGeometryFromSegments(n)}};e([r({constructOnly:!0})],d.prototype,"view",void 0),e([r({constructOnly:!0})],d.prototype,"analysisViewData",void 0),e([r({readOnly:!0})],d.prototype,"visible",null),d=e([n("esri.views.3d.analysis.VolumeMeasurement.CutFillVolumeMeasurementVisualization")],d);const y=a(),v=a();export{d as CutFillVolumeMeasurementVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import i from"../../../../core/Accessor.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{i as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{cutFillConfiguration as m}from"./VolumeMeasurementConfiguration.js";import{LineVisualElement as c}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as p}from"../../interactive/visualElements/OutlineVisualElement.js";import{GeodesicSegment as h}from"../../interactive/visualElements/support/Segment.js";import{createStipplePatternSimple as u}from"../../webgl-engine/materials/lineStippleUtils.js";let d=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}constructor(e){super(e)}initialize(){const{accentColor:e}=this.view.effectiveTheme,i={view:this.view,isDecoration:!0},o=m,r={...i,width:o.geometryOutlineWidth},n=t.toUnitRGBA(e),l=t.toUnitRGBA(o.targetGeometryOutlineColor);this._elevationAlignedGeometry=new p({...r,isDraped:!0,color:n}),this._targetGeometry=new p({...r,color:l});const a={...i,attached:!0,width:o.projectionLineWidth,stipplePattern:u(o.projectionLineStippleSize),renderOccluded:4},h=t.toUnitRGBA(o.cutProjectionLineColor),d=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new c({...a,color:h}),this._fillProjectionLines=new c({...a,color:d}),this.addHandles([s(()=>[this.analysisViewData.elevationAlignedGeometry,this.analysisViewData.targetGeometry,this.visible],()=>this._updateVisualElements()),s(()=>this.view.effectiveTheme.accentColor,e=>{this._elevationAlignedGeometry.color=t.toUnitRGBA(e)})])}destroy(){this._elevationAlignedGeometry=o(this._elevationAlignedGeometry),this._targetGeometry=o(this._targetGeometry),this._cutProjectionLines=o(this._cutProjectionLines),this._fillProjectionLines=o(this._fillProjectionLines)}_updateVisualElements(){this._updateGeometries(),this._updateProjectionLines()}_updateGeometries(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;this._elevationAlignedGeometry.geometry=t,this._elevationAlignedGeometry.visible=e,this._targetGeometry.geometry=i,this._targetGeometry.visible=e}_updateProjectionLines(){const e=this.visible,{elevationAlignedGeometry:t,targetGeometry:i}=this.analysisViewData;if(this._cutProjectionLines.visible=e,this._fillProjectionLines.visible=e,!t||!i)return;const{renderCoordsHelper:o}=this.view,s=o.spatialReference,r=[],n=[],a=t.spatialReference;for(let m=0;m<t.rings[0].length;++m){const e=t.rings[0][m],c=l(y,e[0],e[1],e[2]);o.toRenderCoords(c,a,c);const p=i.rings[0][m],u=l(v,p[0],p[1],p[2]);o.toRenderCoords(u,a,u);const d=new h(c,u,s);c[2]>u[2]?r.push(d):n.push(d)}this._cutProjectionLines.setGeometryFromSegments(r),this._fillProjectionLines.setGeometryFromSegments(n)}};e([r({constructOnly:!0})],d.prototype,"view",void 0),e([r({constructOnly:!0})],d.prototype,"analysisViewData",void 0),e([r({readOnly:!0})],d.prototype,"visible",null),d=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],d);const y=a(),v=a();export{d as VolumeMeasurementCutFillVisualization};