@arcgis/core 5.0.0-next.2 → 5.0.0-next.4

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 (84) hide show
  1. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  2. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +5 -0
  3. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/6fcacfcb3d83515c37c9.js +1 -0
  6. package/assets/esri/core/workers/chunks/7a05b1f6163112bc9db2.js +1 -0
  7. package/assets/esri/core/workers/chunks/8bfa19c24be0e3f3fd74.js +1 -0
  8. package/assets/esri/core/workers/chunks/{c73def15ccfb2a32afa8.js → b5863afafd3a7d2d5c05.js} +1 -1
  9. package/assets/esri/core/workers/chunks/e5bcc44f3dc6fc90835a.js +1 -0
  10. package/assets/esri/core/workers/chunks/{24c14e4a1d2a2267097e.js → fe3f95fda29e4844b153.js} +1 -1
  11. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  12. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  13. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  14. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  15. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  16. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  17. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  18. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  19. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  20. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  21. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  22. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  23. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  24. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  25. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  26. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  27. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  28. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  29. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  30. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  31. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  32. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  33. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  34. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  35. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  36. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  37. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  38. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  39. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  40. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  41. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  42. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  43. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  44. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  45. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  46. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  47. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  50. package/config.js +1 -1
  51. package/core/dedupeResult.js +5 -0
  52. package/interfaces.d.ts +75 -29
  53. package/kernel.js +1 -1
  54. package/layers/KnowledgeGraphLayer.js +1 -1
  55. package/layers/LinkChartLayer.js +1 -1
  56. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  57. package/layers/knowledgeGraph/layerUtils.js +1 -1
  58. package/layers/support/Sublayer.js +1 -1
  59. package/package.json +1 -1
  60. package/support/basemapDefinitions.js +1 -1
  61. package/support/revision.js +1 -1
  62. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  63. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  64. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  65. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  66. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +5 -0
  67. package/views/3d/layers/graphics/Labeler.js +1 -1
  68. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  69. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  70. package/views/DOMContainer.js +1 -1
  71. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  72. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  73. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  74. package/views/analysis/ElevationProfile/elevationProfileLayerUtils.js +5 -0
  75. package/widgets/Daylight/DaylightViewModel.js +1 -1
  76. package/widgets/Daylight.js +1 -1
  77. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  78. package/widgets/Legend/LegendViewModel.js +1 -1
  79. package/widgets/Legend.js +1 -1
  80. package/assets/esri/core/workers/chunks/1019fa4818624ba292ef.js +0 -1
  81. package/assets/esri/core/workers/chunks/10fb29ba6f3f81353fbc.js +0 -1
  82. package/assets/esri/core/workers/chunks/650c94c0e8ab9721015e.js +0 -1
  83. package/assets/esri/core/workers/chunks/6e5b3bbee054d072b594.js +0 -1
  84. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function s(e){if(!e)return;const s=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,a=await r("esri/t9n/basemaps");return a[e]||a[s]}const a={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]}};export{a as esriBasemapDefinitions,s as getBasemapTitle};
5
+ import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function s(e){if(!e)return;const s=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,a=await r("esri/t9n/basemaps");return a[e]||a[s]}const a={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/94329802cbfa44a18f423e6f1a0b875c/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",itemId:"9d3d89d42cfe4e2c9d108a2f0d518406",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Trees_v1/SceneServer",itemId:"9d3d89d42cfe4e2c9d108a2f0d518406",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Open3D_Buildings_v1/SceneServer",itemId:"cd33b09dde0a419c986ca1a78a5fc06d",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return e("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/Esri3D_Buildings_v1/SceneServer",itemId:"b8fec5af7dfe4866b1b8ac2d2800f282",layerType:"ArcGISSceneServiceLayer"}]}};export{a as esriBasemapDefinitions,s as getBasemapTitle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const n="20250926",o="unknown";export{n as buildDate,o as commitHash};
5
+ const n="20250928",o="unknown";export{n as buildDate,o 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isIterable as t}from"../../../../core/iteratorUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{watch as o}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../../core/unitUtils.js";import{property as s}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{j as l}from"../../../../chunks/vec32.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../../geometry/ellipsoidUtils.js";import{create as p,fromPoints as u}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as m}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as y}from"../../support/hitTest.js";import{Intersector as d}from"../../webgl-engine/lib/Intersector.js";import{ElevationProfileLineComputation as f}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const h=2e5;let v=class extends f{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependenciesMemoized=r((e,t,r,o,i,s,n)=>({geometry:e,visibleLayers:t,maxIntersectionDistance:r,intersectOptions:o,view:i,stationary:s,spatialReference:n})),this._vecA=a(),this._vecB=a(),this._ray=p()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*i(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([o(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const i=this._intersector;if(null==i)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:s,view:n,spatialReference:a}=o,c=n.renderCoordsHelper,p=n.sceneIntersectionHelper,y=this._vecA,d=this._vecA,f=this._vecB,v=this._ray;if(!a)return{geometry:e,noDataValue:t};const g=await m.fromGeometry(e).project(a,r);if(!g)return{geometry:e,noDataValue:t};const w=g.coordinates,j=w.length;for(let m=0;m<j;++m){const e=w[m];l(f,e.x,e.y,e.z??0),c.toRenderCoords(f,a,f),c.setAltitude(y,h,f);const r=u(y,f,v);p.computeIntersection(r,i,!0,s);const n=_(o,i.results.all);n?(n.getIntersectionPoint(d),c.fromRenderCoords(d,d,a),e.z=d[2]):e.z=t}return{geometry:g.export(),noDataValue:t}}get _queryElevationDependencies(){const e=this._view;return e?this._getQueryElevationDependenciesMemoized(this.controller?.analysis.geometry,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){return this._view?.map?.allLayers?.filter(e=>e.visible).toArray()??[]}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:r,exclude:o}=this.profile;return y(e,{include:r,exclude:[...this._pointCloudLayers,...t(o)?o:o?[o]:[]]})}get _pointCloudLayers(){const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?c(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new d(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function _({maxIntersectionDistance:e},t){for(const r of t)if(r.withinDistance(e))return r;return null}e([s({readOnly:!0})],v.prototype,"minDemResolution",null),e([s()],v.prototype,"_queryElevationDependencies",null),e([s()],v.prototype,"_visibleLayers",null),e([s()],v.prototype,"_intersectOptions",null),e([s()],v.prototype,"_pointCloudLayers",null),e([s()],v.prototype,"_view",null),e([s()],v.prototype,"_maxIntersectionDistance",null),e([s()],v.prototype,"_intersector",null),v=e([n("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],v);export{v as ElevationProfileLineSceneComputation};
5
+ import{__decorate as e}from"tslib";import{dedupeResult as t}from"../../../../core/dedupeResult.js";import{isIterable as r}from"../../../../core/iteratorUtils.js";import{equalsShallow as o}from"../../../../core/lang.js";import{equalsMaybe as i}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/unitUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as c}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../geometry/ellipsoidUtils.js";import{create as m,fromPoints as d}from"../../../../geometry/support/ray.js";import{GeometryDescriptor as y}from"../../../../layers/support/GeometryDescriptor.js";import{externalToInternalIntersectOptions as f}from"../../support/hitTest.js";import{Intersector as h}from"../../webgl-engine/lib/Intersector.js";import{getVisibleLayerIds as v}from"../../../analysis/ElevationProfile/elevationProfileLayerUtils.js";import{ElevationProfileLineComputation as _}from"../../../analysis/ElevationProfile/ElevationProfileLineComputation.js";const g=2e5;let w=class extends _{constructor(){super(...arguments),this.type="scene",this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getStableElevationDependencies=t(()=>{const e=this._view;return e?{view:e,stationary:e.stationary,geometry:this.controller?.analysis.geometry,visibleLayerIds:this._getStableLayerIds(),maxIntersectionDistance:this._maxIntersectionDistance,intersectOptions:this._intersectOptions,spatialReference:this._getStableSpatialReference()}:null},o),this._getStableSpatialReference=t(()=>this._view?.spatialReference,i),this._getStableLayerIds=t(()=>v(this._view),o),this._getStablePointCloudLayers=t(()=>{const e=this._view;return e?e.allLayerViews.toArray().filter(e=>"point-cloud"===e.layer?.type).map(e=>e.layer):[]},o),this._vecA=p(),this._vecB=p(),this._ray=m()}get minDemResolution(){const e=this._view;if(!e)return null;const t=e.pointsOfInterest?.focus?.worldUnitsPerContentPixel;return null==t?null:t*n(e.spatialReference)}initialize(){const e=()=>this.onInvalidate(this);return this.addHandles([s(()=>this._queryElevationDependencies,e),this.controller.onElevationChange(e)])}async queryElevation(e,{noDataValue:t,signal:r}){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const i=this._intersector;if(null==i)throw new Error(`${this.declaredClass}: no view`);const{intersectOptions:s,view:n,spatialReference:l}=o,a=n.renderCoordsHelper,p=n.sceneIntersectionHelper,u=this._vecA,m=this._vecA,f=this._vecB,h=this._ray;if(!l)return{geometry:e,noDataValue:t};const v=await y.fromGeometry(e).project(l,r);if(!v)return{geometry:e,noDataValue:t};const _=v.coordinates,w=_.length;for(let y=0;y<w;++y){const e=_[y];c(f,e.x,e.y,e.z??0),a.toRenderCoords(f,l,f),a.setAltitude(u,g,f);const r=d(u,f,h);p.computeIntersection(r,i,!0,s);const n=j(o,i.results.all);n?(n.getIntersectionPoint(m),a.fromRenderCoords(m,m,l),e.z=m[2]):e.z=t}return{geometry:v.export(),noDataValue:t}}get _queryElevationDependencies(){return this._getStableElevationDependencies()}get _intersectOptions(){const e=this._view;if(!e||e.destroyed)return{};const{include:t,exclude:o}=this.profile;return f(e,{include:t,exclude:[...this._pointCloudLayers,...r(o)?o:o?[o]:[]]})}get _pointCloudLayers(){return this._getStablePointCloudLayers()}get _view(){const e=this.controller.view;return"3d"===e.type?e:null}get _maxIntersectionDistance(){const e=this._view;return e?.renderCoordsHelper?u(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(!e)return null;const t=new h(e.state.viewingMode),r=t.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=2,t}};function j({maxIntersectionDistance:e},t){for(const r of t)if(r.withinDistance(e))return r;return null}e([l({readOnly:!0})],w.prototype,"minDemResolution",null),e([l()],w.prototype,"_queryElevationDependencies",null),e([l()],w.prototype,"_intersectOptions",null),e([l()],w.prototype,"_pointCloudLayers",null),e([l()],w.prototype,"_view",null),e([l()],w.prototype,"_maxIntersectionDistance",null),e([l()],w.prototype,"_intersector",null),w=e([a("esri.views.3d.analysis.ElevationProfile.ElevationProfileLineSceneComputation")],w);export{w as ElevationProfileLineSceneComputation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{j as n}from"../../../../chunks/vec32.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as i,fromExtent 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),this.rawResult=null}get localOriginRenderSpace(){const{extent:e,localOrigin:r,renderCoordsHelper:o}=this,t=s();return o.toRenderCoords(r,e.spatialReference,t),t}get cameraPositionRenderSpace(){const{localOriginRenderSpace:e,renderCoordsHelper:r}=this,o=s();return r.setAltitude(o,h,e),o}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,o=i();return 2===r.viewingMode?a(e,o):(this._expandBoundingRect(e.xmin,e.ymin,o),this._expandBoundingRect(e.xmax,e.ymin,o),this._expandBoundingRect(e.xmin,e.ymax,o),this._expandBoundingRect(e.xmax,e.ymax,o)),o}get cameraDimensions(){const{boundingRect:e}=this;return{width:c(e),height:p(e)}}get cameraNearFar(){return{near:R,far:x}}get upVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,2,s())}get northVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,1,s())}get eastVector(){return this.renderCoordsHelper.worldBasisAtPosition(this.cameraPositionRenderSpace,0,s())}_expandBoundingRect(e,r,o){const{extent:t,eastVector:s,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=t.center.z??0;n(u,e,r,p),c.toRenderCoords(u,t.spatialReference,u),l(u,s,i,a,g),d(o,g,o)}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"extent",void 0),e([o()],m.prototype,"localOrigin",void 0),e([o()],m.prototype,"localOriginRenderSpace",null),e([o()],m.prototype,"cameraPositionRenderSpace",null),e([o()],m.prototype,"boundingRect",null),e([o()],m.prototype,"cameraDimensions",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"eastVector",null),e([o()],m.prototype,"rawResult",void 0),m=e([t("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],m);const u=s(),g=s(),h=9e3,R=0,x=2e4;export{m as VolumeMeasurementCutFillComputation};
5
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as r}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import t from"../../../../core/Accessor.js";import{property as o}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{j as s}from"../../../../chunks/vec32.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a,fromExtent as c,width as p,height as d,expand as l}from"../../../../geometry/support/aaBoundingRect.js";import{vectorCoordinates as m}from"../../../../geometry/support/coordinateSystem.js";let u=class extends t{constructor(e){super(e),this.rawResult=null}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(),o=1/r.unitInMeters;return r.setAltitude(t,R*o,e),t}get boundingRect(){const{extent:e,renderCoordsHelper:r}=this,t=a();return 2===r.viewingMode?c(e,t):(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)),t}get cameraDimensions(){const{boundingRect:e}=this;return{width:p(e),height:d(e)}}get cameraNearFar(){const{renderCoordsHelper:{unitInMeters:e}}=this,r=1/e;return{near:x*r,far:y*r}}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:n,northVector:i,upVector:a,renderCoordsHelper:c}=this,p=o.center.z??0;s(g,e,r,p),c.toRenderCoords(g,o.spatialReference,g),m(g,n,i,a,h),l(t,h,t)}};e([o()],u.prototype,"renderCoordsHelper",void 0),e([o()],u.prototype,"extent",void 0),e([o()],u.prototype,"localOrigin",void 0),e([o()],u.prototype,"localOriginRenderSpace",null),e([o()],u.prototype,"cameraPositionRenderSpace",null),e([o()],u.prototype,"boundingRect",null),e([o()],u.prototype,"cameraDimensions",null),e([o()],u.prototype,"upVector",null),e([o()],u.prototype,"northVector",null),e([o()],u.prototype,"eastVector",null),e([o()],u.prototype,"rawResult",void 0),u=e([n("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillComputation")],u);const g=i(),h=i(),R=r.maxTargetElevation,x=0,y=r.maxTargetElevation-r.minTargetElevation;export{u 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/Logger.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{initial as i,watch as n,when as s,syncAndInitial as a,sync as l}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as m}from"../../../../core/screenUtils.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../../../chunks/earcut.js";import{create as d}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as h}from"../../../../chunks/vec32.js";import{fromValues as y,create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as f}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as _}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as v}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as j}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as w,create as x,expand as G,width as R,height as E,fromExtent as V,intersects as b}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as H}from"../../../../chunks/vec3.js";import T from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as M}from"../support/projectionUtils.js";import{cutFillConfiguration as O}from"./VolumeMeasurementConfiguration.js";import{VolumeMeasurementCutFillComputation as U}from"./VolumeMeasurementCutFillComputation.js";import A from"./VolumeMeasurementError.js";import D from"./VolumeMeasurementResult.js";import{getRawResult as F}from"./volumeMeasurementUtils.js";import{ElevationContext as P}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as z}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as N}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as S,TargetGeometry as k}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as I}from"../../../support/euclideanLengthMeasurementUtils.js";let L=class extends t{constructor(e){super(e),this._projectionError=null,this._updatingHandles=new f,this._computationValue=null}initialize(){const e=this.view;this._renderer=new S({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},i),this.addHandles([this._createElevationUpdateHandle(),n(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,a),n(()=>this.elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,a),n(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},l),s(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(this._projectionError=null,!this.analysis.valid)return null;const e=this.analysis.geometry,t=_(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&(this._projectionError=new A("invalid-geometry","The measurement geometry cannot be projected to the view spatial reference."),M(this.analysis,e.spatialReference,r.getLogger(this))),t.geometry)}get elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone(),{elevationProvider:r}=this.view;return B(r,t),t}get _targetGeometry(){const e=this.elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=N(e,r,o,P.fromElevationInfo(new T({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=c(s.position,s.holeIndices,3),l=C(3*s.count),m=d(),p=d(),u=y(t.center.x,t.center.y,0);return v(t.spatialReference,u,m,o.spatialReference),p[12]=-m[12],p[13]=-m[13],p[14]=-m[14],H(l,s.position,p),new k(u,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new D({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this.analysis.valid?this._projectionError?this._projectionError:this._tooNearFarError?this._tooNearFarError:null:new A("invalid-geometry","The measurement geometry is invalid.")}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:t}=this,{camera:r}=t.state,{positions:o,localOrigin:i}=e;t.renderCoordsHelper.toRenderCoords(i,t.spatialReference,Q),w(X);for(let m=0;m<o.length;m+=3)r.projectToScreen(h(K,o[m]+Q[0],o[m+1]+Q[1],o[m+2]+Q[2]),Y),G(X,Y,X);const n=R(X),s=E(X),{maxVolumeExtentSizeVw:a,minVolumeExtentSizePixels:l}=O;return n>r.width/r.pixelRatio*a||s>r.height/r.pixelRatio*a?new A("distance-too-close","The measurement geometry is too close to the camera. Try zooming out or moving the geometry further away."):Math.max(n,s)<l?new A("distance-too-far","The measurement geometry is too far from the camera. Try zooming in or moving the geometry closer."):null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=o(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new U({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&this._enabled&&t&&(j(e.extent,e.spatialReference,q,this.view.spatialReference),V(t,J),b(q,J)&&this.notifyChange("elevationAlignedGeometry"))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,m;"local"===t&&e.isWebMercator?({width:l,height:m}=W(r)):(l=R(o),m=E(o));const p=l/s*(m/a),u=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(u.cut)*p,h=c(u.fill)*p;this._computation.rawResult=F(Math.abs(d),h)}};function B(e,t){t.rings[0].forEach(t=>{t[2]=z(e,t,"ground")??0})}function W(e){const t=I([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=I([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}e([p()],L.prototype,"_projectionError",void 0),e([p()],L.prototype,"_projectedGeometry",null),e([p()],L.prototype,"elevationAlignedGeometry",null),e([p()],L.prototype,"_targetGeometry",null),e([p()],L.prototype,"_renderGeometry",null),e([p({constructOnly:!0})],L.prototype,"analysis",void 0),e([p({constructOnly:!0})],L.prototype,"analysisViewData",void 0),e([p({constructOnly:!0})],L.prototype,"view",void 0),e([p()],L.prototype,"updating",null),e([p()],L.prototype,"result",null),e([p()],L.prototype,"error",null),e([p()],L.prototype,"_tooNearFarError",null),e([p()],L.prototype,"_enabled",null),e([p()],L.prototype,"_renderer",void 0),e([p({readOnly:!0})],L.prototype,"_updatingHandles",void 0),e([p()],L.prototype,"_computation",null),L=e([u("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],L);const q=w(),J=w(),K=g(),Q=g(),X=x(),Y=m();export{L as VolumeMeasurementCutFillController};
5
+ import{__decorate as e}from"tslib";import{volumeMeasurementConfiguration as t}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import r from"../../../../core/Accessor.js";import o from"../../../../core/Logger.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{initial as n,watch as s,when as a,syncAndInitial as l,sync as p}from"../../../../core/reactiveUtils.js";import{createScreenPointArray as u}from"../../../../core/screenUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/RandomLCG.js";import{subclass as c}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as y,x as g}from"../../../../chunks/vec32.js";import{fromValues as _,create as f}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as v}from"../../../../core/support/UpdatingHandles.js";import{projectOrLoad as j}from"../../../../geometry/projectionUtils.js";import{computeTranslationToOriginAndRotation as w}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectBoundingRect as E}from"../../../../geometry/projection/projectBoundingRect.js";import{empty as G,create as x,expand as R,width as b,height as L,fromExtent as V,intersects as T}from"../../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{t as M}from"../../../../chunks/vec3.js";import H from"../../../../symbols/support/ElevationInfo.js";import{logFailedGeometryProjectionError as P}from"../support/projectionUtils.js";import{VolumeMeasurementCutFillComputation as O}from"./VolumeMeasurementCutFillComputation.js";import{VolumeMeasurementProjectionError as U,VolumeMeasurementInvalidGeometryError as D,VolumeMeasurementDistanceTooCloseError as A,VolumeMeasurementDistanceTooFarError as S,VolumeMeasurementPerimeterTooLargeError as F,VolumeMeasurementUnsupportedCoordinateSystemError as I,VolumeMeasurementUnsupportedLayerTransparencyError as k}from"./volumeMeasurementErrors.js";import N from"./VolumeMeasurementResult.js";import{getRawResult as z}from"./volumeMeasurementUtils.js";import{ElevationContext as W}from"../../layers/graphics/ElevationContext.js";import{getElevationAtPoint as B}from"../../support/ElevationProvider.js";import{geometryToRenderInfo as q}from"../../support/renderInfoUtils/polygon.js";import{CutFillDepth as J,TargetGeometry as K}from"../../webgl-engine/lib/CutFillDepth.js";import{euclideanDirectDistance as Q}from"../../../support/euclideanLengthMeasurementUtils.js";let X=class extends r{constructor(e){super(e),this._projectionError=null,this._getElevationProvider=()=>this.view.elevationProvider,this._updatingHandles=new v,this._computationValue=null}initialize(){const e=this.view;this._renderer=new J({view:e}),this._updatingHandles.add(()=>({computation:this._computation,renderGeometry:this._renderGeometry}),({computation:e,renderGeometry:t})=>{e&&t&&(this._renderer.setup(e,t),this._renderer.start())},n),this.addHandles([this._createElevationUpdateHandle(),s(()=>this._targetGeometry,e=>this.analysisViewData.targetGeometry=e,l),s(()=>this._elevationAlignedGeometry,e=>this.analysisViewData.elevationAlignedGeometry=e,l),s(()=>({computation:this._computation,extent:this._projectedGeometry?.extent,localOrigin:this._renderGeometry?.localOrigin}),({computation:e,extent:t,localOrigin:r})=>{e&&t&&r&&(e.extent=t,e.localOrigin=r)},p),a(()=>this._renderer.done,()=>this._updateResult())])}destroy(){this._updatingHandles.destroy(),this._renderer.destroy()}get _projectedGeometry(){if(this._projectionError=null,!this.analysis.valid)return null;const e=this.analysis.geometry,t=j(e,this.view.spatialReference);return t.pending?(this._updatingHandles.addPromise(t.pending),null):(e&&!t.geometry&&(this._projectionError=new U,P(this.analysis,e.spatialReference,o.getLogger(this))),t.geometry)}get _elevationAlignedGeometry(){const e=this._projectedGeometry;if(!e)return null;const t=e.clone();return Y(this._getElevationProvider(),t),t}get _targetGeometry(){const e=this._elevationAlignedGeometry;if(!e)return null;const t=this.analysis.measureType,{effectiveTargetElevation:r}=this.analysisViewData;if("stockpile"===t||null==r)return e;const o=e.clone();return o.rings[0].forEach(e=>e[2]=r),o}get _renderGeometry(){const e=this._targetGeometry;if(!e)return null;const t=this._projectedGeometry?.extent;if(!t)return null;const{elevationProvider:r,renderCoordsHelper:o}=this.view;if(!r||!o)return null;const i=q(e,r,o,W.fromElevationInfo(new H({mode:"absolute-height"}))),{polygons:n}=i,s=n[0],a=d(s.position,s.holeIndices,3),l=C(3*s.count),p=h(),u=h(),m=_(t.center.x,t.center.y,0);return w(t.spatialReference,m,p,o.spatialReference),u[12]=-p[12],u[13]=-p[13],u[14]=-p[14],M(l,s.position,u),new K(m,l,a)}get updating(){return this._renderer.updating||this._updatingHandles.updating}get result(){const e=this._computation?.rawResult;return e?new N({measureType:this.analysis.measureType,rawResult:e,unit:this.analysisViewData.effectiveDisplayUnits.volume}):null}get error(){return this._unsupportedCoordinateSystemError??this._unsupportedLayerTransparencyError??this._invalidGeometryError??this._projectionError??this._perimeterTooLargeError??this._tooNearFarError}get _invalidGeometryError(){return this.analysis.valid?null:new D}get _tooNearFarError(){const e=this._renderGeometry;if(!e)return null;const{view:r}=this,{camera:o}=r.state,{positions:i,localOrigin:n}=e;r.renderCoordsHelper.toRenderCoords(n,r.spatialReference,ie),G(ne);for(let t=0;t<i.length;t+=3)o.projectToScreen(y(oe,i[t]+ie[0],i[t+1]+ie[1],i[t+2]+ie[2]),se),R(ne,se,ne);const s=b(ne),a=L(ne),{maxVolumeExtentSizeVw:l,minVolumeExtentSizePixels:p}=t;return s>o.width/o.pixelRatio*l||a>o.height/o.pixelRatio*l?new A:Math.max(s,a)<p?new S:null}get _perimeterTooLargeError(){return this._perimeterTooLargeLocalError??this._perimeterTooLargeGlobalError}get _perimeterTooLargeLocalError(){const{spatialReference:e,state:{isLocal:r}}=this.view;if(!r||!e.isWebMercator)return null;const o=this._perimeter,{maxPerimeterLocalWebMercator:i}=t;return null!=o&&o>i?new F:null}get _perimeterTooLargeGlobalError(){if(!this.view.state.isGlobal)return null;const e=this._perimeter,{maxPerimeterGlobal:r}=t;return null!=e&&e>r?new F:null}get _unsupportedCoordinateSystemError(){return this.view.state.isLocal&&this.view.spatialReference.isGeographic?new I:null}get _unsupportedLayerTransparencyError(){return(this.view.map?.ground.opacity??1)<1?new k:null}get _perimeter(){const e=this._renderGeometry?.positions,t=e?$(ee(e)):null;return null!=t?t/this.view.renderCoordsHelper.unitInMeters:null}get _enabled(){return!this.error}get _computation(){const e=this._projectedGeometry?.extent;if(!e||!this._enabled)return this._computationValue=i(this._computationValue),null;if(this._computationValue)return this._computationValue;const t=this._renderGeometry?.localOrigin;if(!t)return null;const{renderCoordsHelper:r}=this.view;return this._computationValue=new O({extent:e,localOrigin:t,renderCoordsHelper:r}),this._computationValue}_createElevationUpdateHandle(){const e=e=>{const t=this._projectedGeometry?.extent;"ground"===e.context&&this._enabled&&t&&(E(e.extent,e.spatialReference,te,this.view.spatialReference),V(t,re),T(te,re)&&(this._getElevationProvider=()=>this.view.elevationProvider))};return this.view.elevationProvider.on("elevation-change",t=>e(t))}_updateResult(){if(!this._computation)return;const{spatialReference:e,viewingMode:t}=this.view,{extent:r,boundingRect:o,cameraNearFar:{near:i,far:n}}=this._computation,{width:s,height:a}=this._renderer;let l,p;"local"===t&&e.isWebMercator?({width:l,height:p}=Z(r)):(l=b(o),p=L(o));const u=l/s*(p/a),m=this._renderer.getDepth(),c=e=>e*(n-i)+i,d=c(m.cut)*u,h=c(m.fill)*u;this._computation.rawResult=z(Math.abs(d),h)}};function Y(e,t){t.rings[0].forEach(t=>{t[2]=B(e,t,"ground")??0})}function Z(e){const t=Q([e.xmin,e.ymin,0],[e.xmax,e.ymin,0],e.spatialReference),r=Q([e.xmin,e.ymin,0],[e.xmin,e.ymax,0],e.spatialReference);return{width:t?.value??0,height:r?.value??0}}function $(e){if(!e)return null;let t=null,r=null,o=0;for(const i of e)t||(t=[i[0],i[1],i[2]??0]),r?o+=g(r,i):r=[0,0,0],r[0]=i[0],r[1]=i[1],r[2]=i[2];return t&&r&&(o+=g(r,t)),Math.sqrt(o)}function*ee(e){const t=f();for(let r=0;r<e.length;r+=3)t[0]=e[r],t[1]=e[r+1],t[2]=e[r+2],yield t}e([m()],X.prototype,"_projectionError",void 0),e([m()],X.prototype,"_projectedGeometry",null),e([m()],X.prototype,"_getElevationProvider",void 0),e([m()],X.prototype,"_elevationAlignedGeometry",null),e([m()],X.prototype,"_targetGeometry",null),e([m()],X.prototype,"_renderGeometry",null),e([m({constructOnly:!0})],X.prototype,"analysis",void 0),e([m({constructOnly:!0})],X.prototype,"analysisViewData",void 0),e([m({constructOnly:!0})],X.prototype,"view",void 0),e([m()],X.prototype,"updating",null),e([m()],X.prototype,"result",null),e([m()],X.prototype,"error",null),e([m()],X.prototype,"_invalidGeometryError",null),e([m()],X.prototype,"_tooNearFarError",null),e([m()],X.prototype,"_perimeterTooLargeError",null),e([m()],X.prototype,"_perimeterTooLargeLocalError",null),e([m()],X.prototype,"_perimeterTooLargeGlobalError",null),e([m()],X.prototype,"_unsupportedCoordinateSystemError",null),e([m()],X.prototype,"_unsupportedLayerTransparencyError",null),e([m()],X.prototype,"_perimeter",null),e([m()],X.prototype,"_enabled",null),e([m()],X.prototype,"_renderer",void 0),e([m({readOnly:!0})],X.prototype,"_updatingHandles",void 0),e([m()],X.prototype,"_computation",null),X=e([c("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillController")],X);const te=G(),re=G(),oe=f(),ie=f(),ne=x(),se=u();export{X 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import i from"../../../../core/Accessor.js";import{equals as s}from"../../../../core/arrayUtils.js";import{cyclicalPI as o}from"../../../../core/Cyclical.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{formatDecimal as l}from"../../../../core/quantityFormatUtils.js";import{watch as n,initial as a}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as c}from"../../../../core/unitUtils.js";import{property as u}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as d}from"../../../../chunks/earcut.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as p,n as g,e as y,i as _,f}from"../../../../chunks/vec32.js";import{create as v,fromValues as j}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as b}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as L}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as C}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as w}from"../../../../geometry/support/vector.js";import{t as G}from"../../../../chunks/vec3.js";import P from"../../../../symbols/support/ElevationInfo.js";import{cutFillConfiguration as V}from"./VolumeMeasurementConfiguration.js";import{LabelVisualElement as F}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as D}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as M,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as H}from"../../../../intl/messages.js";import{substitute as N}from"../../../../intl/substitute.js";let T=class extends i{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new P({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,i={view:e,isDecoration:!0},s=V,o={...i,width:s.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...o,isDraped:!0,color:t.toUnitRGBA(s.geometryOutlineColor)}),this._targetGeometry=new A(o);const r={...i,attached:!0,width:s.projectionLineWidth,renderOccluded:4,polygonOffset:!0},l={...r,stipplePattern:E(s.projectionLineStippleSize)},c=t.toUnitRGBA(s.cutProjectionLineColor),u=t.toUnitRGBA(s.fillProjectionLineColor);this._cutProjectionLines=new R({...r,color:c}),this._occludedCutProjectionLines=new R({...l,color:c}),this._fillProjectionLines=new R({...r,color:u}),this._occludedFillProjectionLines=new R({...l,color:u});const m={...i,attached:!0};this._cutVolumeLabel=new F(m),this._fillVolumeLabel=new F(m),this._cutFillRenderNode=new M({view:e,cutColor:s.cutColor,fillColor:s.fillColor,borderColor:s.geometryOutlineColor}),this.addHandles([n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},a),n(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},a),n(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),n(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},a),n(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),a),n(()=>this.visible,()=>this._updateCutFillVisibility()),n(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),n(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=r(this._elevationAlignedGeometry),this._targetGeometry=r(this._targetGeometry),this._cutProjectionLines=r(this._cutProjectionLines),this._occludedCutProjectionLines=r(this._occludedCutProjectionLines),this._fillProjectionLines=r(this._fillProjectionLines),this._occludedFillProjectionLines=r(this._occludedFillProjectionLines),this._cutVolumeLabel=r(this._cutVolumeLabel),this._fillVolumeLabel=r(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}get _config(){return V}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:o}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&s(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let s=0;s<c;++s){const e=n[s],i=p(v(),e[0],e[1],e[2]);o.toRenderCoords(i,l,i);const a=t.rings[0][s],c=p(v(),a[0],a[1],a[2]);o.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],g=[],y=this.view.state.camera;for(let s=0;s<r.length;++s){const i=r[s],o=r[0===s?r.length-1:s-1],l=r[s===r.length-1?0:s+1],n=e.rings[0][s],a=t.rings[0][s],c=n[2]>a[2],p=new k(i,o,l,c);u.push(p),p.updateOccluded(y);const _=p.isOccluded;c?(_?d:m).push(i):(_?g:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(g)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,i){const{geometryOutlineColor:s,cutProjectionLineColor:o,fillProjectionLineColor:r}=this._config;if(e){const e=t.toUnitRGBA(i);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=i}else{this._targetGeometry.color=t.toUnitRGBA(s);const e=t.toUnitRGBA(o);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(r);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=s}}_updateLabels(e){const{labelDistance:t}=this._config,{effectiveDisplayUnits:i,labelAnchors:s,messages:o,unitsMessages:r,result:l,visible:n}=e;if(this._cutVolumeLabel.visible=n,this._fillVolumeLabel.visible=n,this._cutVolumeLabel.geometry=s.cut?{type:"point",point:s.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=s.fill?{type:"point",point:s.fill,callout:{distance:-t,offset:0}}:null,null==l||null==o||null==r)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const a=i.volume,c=N(o.labels.cut,{volume:I(r,l.cutVolume,a)}),u=N(o.labels.fill,{volume:I(r,l.fillVolume,a)});this._cutVolumeLabel.text=c,this._fillVolumeLabel.text=u}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=j(i.x,i.y,0),o=v();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=v(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=D(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,p=c[0],g=p.count,y=d(p.mapPositions,p.holeIndices,3),_=y.length,f=6*g,j=C(f+_),w=C(_),P=L(3*f),V=L(3*f);S(m,u,y,p,P,null,V,null,j,w,t,l,n);const F=h(),R=h();return b(o,i,F,s.spatialReference),R[12]=-F[12],R[13]=-F[13],R[14]=-F[14],G(P,P,R),new U(P,w,j,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await H("esri/core/t9n/Units"),this.messages=await H("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){return e&&t&&l(e,t,c(t.value,t.unit,i))}e([u({constructOnly:!0})],T.prototype,"view",void 0),e([u({constructOnly:!0})],T.prototype,"analysis",void 0),e([u({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([u()],T.prototype,"unitsMessages",void 0),e([u()],T.prototype,"messages",void 0),e([u()],T.prototype,"loadingMessages",void 0),e([u({readOnly:!0})],T.prototype,"visible",null),e([u()],T.prototype,"updating",null),T=e([m("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=v(),this._n2=v();const r=g(z,y(z,e.endRenderSpace,e.startRenderSpace));g(this._n1,_(this._n1,r,g(W,y(W,t.startRenderSpace,e.startRenderSpace)))),g(this._n2,_(this._n2,r,g(W,y(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=o.normalize(w(this._n1,this._n2,r))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){y(z,this.segment.startRenderSpace,e.eye);const t=f(this._n1,z)<0,i=f(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=v(),W=v();export{T as VolumeMeasurementCutFillVisualization};
5
+ import{__decorate as e}from"tslib";import t from"../../../../Color.js";import"../../../../intl.js";import{volumeMeasurementConfiguration as i}from"../../../../analysis/VolumeMeasurement/volumeMeasurementConfiguration.js";import s from"../../../../core/Accessor.js";import{equals as o}from"../../../../core/arrayUtils.js";import{cyclicalPI as r}from"../../../../core/Cyclical.js";import{destroyMaybe as l}from"../../../../core/maybe.js";import{formatDecimal as n}from"../../../../core/quantityFormatUtils.js";import{watch as a,initial as c}from"../../../../core/reactiveUtils.js";import{adaptiveVolumeUnit as u}from"../../../../core/unitUtils.js";import{property as m}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{e as h}from"../../../../chunks/earcut.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{j as g,n as y,e as _,i as f,f as v}from"../../../../chunks/vec32.js";import{create as j,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{computeTranslationToOriginAndRotation as L}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as C}from"../../../../geometry/support/DoubleArray.js";import{newIndexArray as w}from"../../../../geometry/support/Indices.js";import{angleAroundAxis as G}from"../../../../geometry/support/vector.js";import{t as P}from"../../../../chunks/vec3.js";import V from"../../../../symbols/support/ElevationInfo.js";import{LabelVisualElement as F}from"../../interactive/visualElements/LabelVisualElement.js";import{LineVisualElement as R}from"../../interactive/visualElements/LineVisualElement.js";import{OutlineVisualElement as A}from"../../interactive/visualElements/OutlineVisualElement.js";import{EuclideanSegment as O}from"../../interactive/visualElements/support/Segment.js";import{ElevationContext as x}from"../../layers/graphics/ElevationContext.js";import{extrudePolygon as S}from"../../layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{geometryToRenderInfo as D}from"../../support/renderInfoUtils/polygon.js";import{CutFillColor as M,VolumeGeometry as U}from"../../webgl-engine/lib/CutFillColor.js";import{createStipplePatternSimple as E}from"../../webgl-engine/materials/lineStippleUtils.js";import{onLocaleChange as B}from"../../../../intl/locale.js";import{fetchMessageBundle as H}from"../../../../intl/messages.js";import{substitute as N}from"../../../../intl/substitute.js";let T=class extends s{get visible(){return this.analysisViewData.visible&&null!=this.analysisViewData.elevationAlignedGeometry&&null!=this.analysisViewData.targetGeometry}get updating(){return this.loadingMessages}constructor(e){super(e),this.unitsMessages=null,this.messages=null,this.loadingMessages=!0,this._elevationContext=x.fromElevationInfo(new V({mode:"absolute-height"})),this._extrusionHeight=1e4,this._projectionLines=[]}initialize(){const{view:e}=this,s={view:e,isDecoration:!0},o=i,r={...s,width:o.geometryOutlineWidth};this._elevationAlignedGeometry=new A({...r,isDraped:!0,color:t.toUnitRGBA(o.geometryOutlineColor)}),this._targetGeometry=new A(r);const l={...s,attached:!0,width:o.projectionLineWidth,renderOccluded:4,polygonOffset:!0},n={...l,stipplePattern:E(o.projectionLineStippleSize)},u=t.toUnitRGBA(o.cutProjectionLineColor),m=t.toUnitRGBA(o.fillProjectionLineColor);this._cutProjectionLines=new R({...l,color:u}),this._occludedCutProjectionLines=new R({...n,color:u}),this._fillProjectionLines=new R({...l,color:m}),this._occludedFillProjectionLines=new R({...n,color:m});const d={...s,attached:!0};this._cutVolumeLabel=new F(d),this._fillVolumeLabel=new F(d),this._cutFillRenderNode=new M({view:e,cutColor:o.cutColor,fillColor:o.fillColor,borderColor:o.geometryOutlineColor}),this.addHandles([a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry}),({elevationAlignedGeometry:e,targetGeometry:t})=>{this._elevationAlignedGeometry.geometry=e,this._targetGeometry.geometry=t},c),a(()=>({interactive:this.analysisViewData.interactive,measureType:this.analysis.measureType,visible:this.visible}),({visible:e,interactive:t,measureType:i})=>{this._elevationAlignedGeometry.visible=e&&!t,this._targetGeometry.visible=e&&"cut-fill"===i},c),a(()=>({elevationAlignedGeometry:this.analysisViewData.elevationAlignedGeometry,targetGeometry:this.analysisViewData.targetGeometry,visible:this.visible}),({elevationAlignedGeometry:e,targetGeometry:t,visible:i})=>this._updateProjectionLines(e,t,i)),a(()=>({interactive:this.analysisViewData.interactive,accentColor:this.view.effectiveTheme.accentColor}),({interactive:e,accentColor:t})=>{this._updateColors(e,t)},c),a(()=>this.analysisViewData.targetGeometry,()=>this._updateCutFillGeometry(),c),a(()=>this.visible,()=>this._updateCutFillVisibility()),a(()=>{const{messages:e,unitsMessages:t,visible:i,analysisViewData:s}=this;return{labelAnchors:s.labelAnchors,effectiveDisplayUnits:s.effectiveDisplayUnits,messages:e,unitsMessages:t,result:s.result,visible:i}},e=>this._updateLabels(e)),a(()=>this.view.state.camera,e=>this._updateProjectionLineOcclusion(e)),B(()=>this._updateMessageBundle())]),this._updateMessageBundle()}destroy(){this._elevationAlignedGeometry=l(this._elevationAlignedGeometry),this._targetGeometry=l(this._targetGeometry),this._cutProjectionLines=l(this._cutProjectionLines),this._occludedCutProjectionLines=l(this._occludedCutProjectionLines),this._fillProjectionLines=l(this._fillProjectionLines),this._occludedFillProjectionLines=l(this._occludedFillProjectionLines),this._cutVolumeLabel=l(this._cutVolumeLabel),this._fillVolumeLabel=l(this._fillVolumeLabel),this._cutFillRenderNode.destroy()}_updateProjectionLines(e,t,i){if(this._cutProjectionLines.visible=i,this._occludedCutProjectionLines.visible=i,this._fillProjectionLines.visible=i,this._occludedFillProjectionLines.visible=i,!e||!t)return;const{renderCoordsHelper:s}=this.view,r=[],l=e.spatialReference,n=e.rings[0],a=n.length>1&&o(n[0],n[n.length-1]),c=n.length-(a?1:0);for(let o=0;o<c;++o){const e=n[o],i=g(j(),e[0],e[1],e[2]);s.toRenderCoords(i,l,i);const a=t.rings[0][o],c=g(j(),a[0],a[1],a[2]);s.toRenderCoords(c,l,c);const u=new O(i,c);r.push(u)}e.isClockwise(n)||r.reverse();const u=[],m=[],d=[],h=[],p=[],y=this.view.state.camera;for(let o=0;o<r.length;++o){const i=r[o],s=r[0===o?r.length-1:o-1],l=r[o===r.length-1?0:o+1],n=e.rings[0][o],a=t.rings[0][o],c=n[2]>a[2],g=new k(i,s,l,c);u.push(g),g.updateOccluded(y);const _=g.isOccluded;c?(_?d:m).push(i):(_?p:h).push(i)}this._projectionLines=u,this._cutProjectionLines.setGeometryFromSegments(m),this._occludedCutProjectionLines.setGeometryFromSegments(d),this._fillProjectionLines.setGeometryFromSegments(h),this._occludedFillProjectionLines.setGeometryFromSegments(p)}_updateProjectionLineOcclusion(e){const t=[],i=[],s=[],o=[];let r=!1,l=!1;for(const n of this._projectionLines){n.updateOccluded(e)&&(r||=n.isCut,l||=!n.isCut);const a=n.isOccluded;(n.isCut?a?i:t:a?o:s).push(n.segment)}l&&(this._fillProjectionLines.setGeometryFromSegments(s),this._occludedFillProjectionLines.setGeometryFromSegments(o)),r&&(this._cutProjectionLines.setGeometryFromSegments(t),this._occludedCutProjectionLines.setGeometryFromSegments(i))}_updateColors(e,s){const{geometryOutlineColor:o,cutProjectionLineColor:r,fillProjectionLineColor:l}=i;if(e){const e=t.toUnitRGBA(s);this._targetGeometry.color=e,this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e,this._fillProjectionLines.color=e,this._occludedFillProjectionLines.color=e,this._cutFillRenderNode.borderColor=s}else{this._targetGeometry.color=t.toUnitRGBA(o);const e=t.toUnitRGBA(r);this._cutProjectionLines.color=e,this._occludedCutProjectionLines.color=e;const i=t.toUnitRGBA(l);this._fillProjectionLines.color=i,this._occludedFillProjectionLines.color=i,this._cutFillRenderNode.borderColor=o}}_updateLabels(e){const{labelDistance:t}=i,{effectiveDisplayUnits:s,labelAnchors:o,messages:r,unitsMessages:l,result:n,visible:a}=e;if(this._cutVolumeLabel.visible=a,this._fillVolumeLabel.visible=a,this._cutVolumeLabel.geometry=o.cut?{type:"point",point:o.cut,callout:{distance:t,offset:0}}:null,this._fillVolumeLabel.geometry=o.fill?{type:"point",point:o.fill,callout:{distance:-t,offset:0}}:null,null==n||null==r||null==l)return this._cutVolumeLabel.text="-",void(this._fillVolumeLabel.text="-");const c=s.volume,u=N(r.labels.cut,{volume:I(l,n.cutVolume,c)}),m=N(r.labels.fill,{volume:I(l,n.fillVolume,c)});this._cutVolumeLabel.text=u,this._fillVolumeLabel.text=m}_updateCutFillVisibility(){this.visible?this._cutFillRenderNode.enable():this._cutFillRenderNode.disable()}_updateCutFillGeometry(){const{renderCoordsHelper:e}=this.view,{targetGeometry:t}=this.analysisViewData;if(!t?.extent)return;const{center:i}=t.extent,s=b(i.x,i.y,0),o=j();e.toRenderCoords(s,t.spatialReference,o);const r=this._getExtrudedVolumes(t,this._extrusionHeight,s),l=this._getExtrudedVolumes(t,-this._extrusionHeight,s);this._cutFillRenderNode.updateGeometries(r,l,o)}_getExtrudedVolumes(e,t,i){const{renderCoordsHelper:s,spatialReference:o,elevationProvider:r}=this.view,l=j(),n=1===s.viewingMode;n||s.worldUpAtPosition([0,0,0],l);const a=D(e,r,s,this._elevationContext),{polygons:c,mapPositions:u,position:m}=a,d=c[0],g=d.count,y=h(d.mapPositions,d.holeIndices,3),_=y.length,f=6*g,v=w(f+_),b=w(_),G=C(3*f),V=C(3*f);S(m,u,y,d,G,null,V,null,v,b,t,l,n);const F=p(),R=p();return L(o,i,F,s.spatialReference),R[12]=-F[12],R[13]=-F[13],R[14]=-F[14],P(G,G,R),new U(G,b,v,V)}async _updateMessageBundle(){this.loadingMessages=!0;try{this.unitsMessages=await H("esri/core/t9n/Units"),this.messages=await H("esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis")}finally{this.loadingMessages=!1}}};function I(e,t,i){return e&&t&&n(e,t,u(t.value,t.unit,i))}e([m({constructOnly:!0})],T.prototype,"view",void 0),e([m({constructOnly:!0})],T.prototype,"analysis",void 0),e([m({constructOnly:!0})],T.prototype,"analysisViewData",void 0),e([m()],T.prototype,"unitsMessages",void 0),e([m()],T.prototype,"messages",void 0),e([m()],T.prototype,"loadingMessages",void 0),e([m({readOnly:!0})],T.prototype,"visible",null),e([m()],T.prototype,"updating",null),T=e([d("esri.views.3d.analysis.VolumeMeasurement.VolumeMeasurementCutFillVisualization")],T);class k{constructor(e,t,i,s){this.segment=e,this.previous=t,this.next=i,this.isCut=s,this._isOccluded=!1,this._n1=j(),this._n2=j();const o=y(z,_(z,e.endRenderSpace,e.startRenderSpace));y(this._n1,f(this._n1,o,y(W,_(W,t.startRenderSpace,e.startRenderSpace)))),y(this._n2,f(this._n2,o,y(W,_(W,e.startRenderSpace,i.startRenderSpace)))),this._isConvex=r.normalize(G(this._n1,this._n2,o))<0}get isOccluded(){return this._isOccluded}updateOccluded(e){_(z,this.segment.startRenderSpace,e.eye);const t=v(this._n1,z)<0,i=v(this._n2,z)<0,s=this._isOccluded;return this._isOccluded=this._isConvex?t&&i:t||i,this._isOccluded!==s}}const z=j(),W=j();export{T as VolumeMeasurementCutFillVisualization};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"./VolumeMeasurementError.js";class r extends e{constructor(){super("perimeter-too-large","The input geometry's perimeter is too large for the current viewing mode and spatial reference.")}}class t extends e{constructor(){super("distance-too-far","The measurement geometry is too far from the camera.")}}class s extends e{constructor(){super("distance-too-close","The measurement geometry is too close to the camera.")}}class o extends e{constructor(){super("invalid-geometry","The measurement geometry is invalid.")}}class n extends e{constructor(){super("invalid-geometry","The measurement geometry cannot be projected to the view spatial reference.")}}class a extends e{constructor(){super("unsupported-coordinate-system","The coordinate system of the view (viewing mode and spatial reference) is not supported.")}}class c extends e{constructor(){super("unsupported-layer-transparency","The volume measurement analysis does not support transparent layers.")}}export{s as VolumeMeasurementDistanceTooCloseError,t as VolumeMeasurementDistanceTooFarError,o as VolumeMeasurementInvalidGeometryError,r as VolumeMeasurementPerimeterTooLargeError,n as VolumeMeasurementProjectionError,a as VolumeMeasurementUnsupportedCoordinateSystemError,c as VolumeMeasurementUnsupportedLayerTransparencyError};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as s,result as i}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{disposeMaybe as l,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../core/promiseUtils.js";import c from"../../../../core/Queue.js";import{watch as h}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as d}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as y}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as g}from"../../../../symbols/callouts/calloutUtils.js";import{make as f}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as m,LineCalloutSymbolLayerRenderingInfo as C}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as x}from"./graphicSymbolUtils.js";import{LabelInfo as _}from"./LabelInfo.js";import{LabelParameters as L}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as v,verticalPlacementFromAnchor as G,textRenderAlignmentFromHorizontalPlacement as w}from"./placementUtils.js";import{placePointOnGeometry as A}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as T}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as I}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as S}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as P,isInEffectiveScaleRange as R}from"../../../support/layerViewUtils.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{Yield as V}from"../../../support/Yield.js";class O{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}}class z{constructor(e,t,s,i,a){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=s,this.textRenderParameters=i,this.labelFunction=a,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class E{constructor(e,t,s,i,a,l,r,o){this.layer=t,this.graphics3DCore=s,this.scaleVisibility=i,this.emptySymbolLabelSupported=a,this.elevationInfoOverride=l,this.disablePlacement=r,this.active=o,this.labelClassAbortController=new AbortController,this._labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new S(e,{pickable:!0},s.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let F=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new c,this._labels=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this.addHandles([h(()=>this.view.state?.camera,()=>this.setDirty()),h(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),h(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(j.LABELER,this)]),P()&&this.addHandles(h(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new I({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=l(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),B.graphic=null,B.renderingInfo=null,B.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,s)=>{const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(const t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;const s=e.textRenderers[t.labelClassContextIndex];s&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(s,e=>U(t.stageObject,e))),M(t.stageObject,s))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),V}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(t.active)if(H(t))this._dirty=!0;else if(Q(t.labelClassContexts)){if(null===t.labelClassContexts){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(const[s,i]of t.labelsToInitialize)if(this._ensureGraphics3DResources(i)&&(this._labels.set(s,i),this.deconflictor.setDirty(),e.madeProgress()),(i.visible&&i.textInitialized||!i.visible&&i.hasGraphics3DResources)&&(t.labelsToInitialize.delete(s),e.madeProgress()),e.done){this._dirty=!0;break}this._dirty||this.notifyChange("updating")}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();const{graphic3DGraphic:t,labelingContext:s}=this._focusAreasLabelsQueue.pop();if(0===t.labelLayers.length||!s.active)continue;const i=A(t.graphic.geometry);if(null==i)continue;const a=this.view.focusAreasView?.containsGeometry(i)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.isFocused!==a)&&(this._removeGraphic(s,t),this._addGraphic(s,t),this.setDirty())})}0===this._focusAreasLabelsQueue.length&&(this.notifyChange("readyToRun"),this.notifyChange("updating"))}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),o(t),e.scaleVisibility?.updateScaleRangeActive();const l=e.graphics3DCore,r=l.layer,n=r.labelingInfo?.filter(e=>!!e.symbol);if(!n||0===n.length)return;let c=!1;await s(n,async(s,r)=>{const n=s.symbol,h=x(l.getOrCreateGraphics3DSymbol(n));if(null==h)return void a.getLogger(this).error("Failed to create Graphics3DSymbol for label");await h.load(),o(t);let b=null;g(n)&&n.hasVisibleCallout()&&(b=f(n,l.symbolCreationContext),await b.load(),o(t));const u=await i(y(s,e.layer.fieldsIndex,this.view.spatialReference));if(o(t),!0===u.ok){const i=await this._createTextRenderParameters(h.symbol);o(t);const a=new z(s,h,b,i,u.value);this._updateLabelClassContextVisibility(a),e.setLabelClassContext(r,a)}else a.getLogger(this).error(`Label expression failed to evaluate: ${u.error}`),c=!0}),o(t)}async _createLabelClassContext(e){return null==e.labelClassPromise&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(n(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const t=e.symbolLayers.at(0);return"text"!==t?.type?null:T.fromSymbol(t,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)--s.graphics3DSymbol.referenced;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,r(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,i,a,l){if(!this._textTextureAtlas)return null;const r=new L(s,v(s.anchor),G(s.anchor),e.text,p(e.displayWidth,e.displayHeight));return B.graphic=t,B.layer=i,B.renderingInfo=null,a.createLabel(B,r,this._hudMaterials,this._textTextureAtlas,()=>l.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,s,i,a){B.graphic=e,B.layer=a;const l=i.screenOffset[0];return B.renderingInfo=new C(null,t,i.translation,i.centerOffset,l,i.centerOffsetUnits,i.elevationOffset),s.createGraphics3DGraphic(B,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,i=s.labelClassContexts;if(Q(i)||!s.emptySymbolLabelSupported&&0===t.layers.length)return!1;let a=!1;const l=t.graphic,r=s.layer,o=W(s.layer);for(let n=0;n<i.length;n++){const c=e.textRenderers[n],h=e.textLabelPlacements[n];if(null==c||null==h)continue;const b=i[n],u=b.graphics3DSymbol,p=k(u),d=u.symbolLayers[0];if(!d)continue;d.setElevationInfoOverride(s.elevationInfoOverride);const y=new _(t,p,b.labelClass),g=this._createTextSymbolGraphic(c,l,h,r,d,y);if(null==g)return!1;g.labelClass=b.labelClass,g.labelClassContextIndex=n,t.addLabelGraphic(g,s.stageLayer),this.deconflictor.setPriority(t,b.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,o),t.setVisibilityFlag(16,2,b.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),P()&&b.graphics.set(l.uid,t),a=!0;const f=b.graphics3DCalloutSymbolLayer;if(f&&h.hasLabelVerticalOffset){f.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(l,p,f,h,r);null!=e&&(b.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,s.stageLayer))}break}return a&&s.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelLayers){if(null==s.labelClass)continue;const e=t[s.labelClassContextIndex].graphics3DSymbol.symbolLayers[0];e?.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;const t=e.labelingContext,s=t.labelClassContexts;if(Q(s))return;const i=e.graphics3DGraphic.graphic;for(let l=0;l<s.length;l++){const r=s[l];if(e.textRenderers[l]=null,e.textLabelPlacements[l]=null,null==r?.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?d(i,t.layer,null):i;n=o.evaluate(e)}catch(a){n=null}else n=o.evaluate(i);if(null==n||""===n||/^\s+$/.test(n))continue;const c=r.graphics3DSymbol;if(!c.symbolLayers[0])continue;const h=e.graphics3DGraphic,b="label-3d"===c.symbol?.type?c.symbol:null,u=r.labelClass,p=t.disablePlacement,y=new _(h,b,u,p).placement;if(null==y)continue;const g=v(y.anchor),f=w(g);e.textRenderers[l]=new D(n,f,r.textRenderParameters,I.maxSize),e.textLabelPlacements[l]=y}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){const s=t.graphic.uid;if(e.graphics.set(s,t),e.active){const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){const s=t.graphic.uid,i=this._labels.get(s);if(!i)return!0;for(const a of i.graphics3DGraphic.labelLayers){if(null==a.labelClass)continue;if(!e.labelClassContexts[a.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,a))return!1}return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){const s=t.graphic.uid,i=this._labels.get(s);e.graphics.delete(s),e.labelClassContexts.forEach(e=>e.graphics.delete(s)),i&&(this._destroyGraphic(i,s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.graphics.get(s);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){const i=new Map;t.graphics.forEach(e=>i.set(e.graphic.uid,e));const a=e=>e.labelLayers[0];if(s.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,i,a),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelLayers[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,i,t)}}}_visibilityInfoChange(e){const t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,s)=>{const i=this._labels.get(s);i&&(this._destroyGraphic(i,s),i.visible=!1,e.labelsToInitialize.set(s,i))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const i=s?.emptySymbolLabelSupported||!1,a=s?.elevationInfoOverride||null,l=s?.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o=new E(this.view.stage,r,e,t,i,a,l,W(r));return this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(o,e),layerLabelsEnabled:()=>W(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged("screenSizePerspectiveEnabled",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(const e of this._labelingContexts)if(e.active&&!H(e))for(const t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!P())return;const{labelClass:t,graphics:s}=e,i={minScale:t.minScale,maxScale:t.maxScale},a=R(i,this.view.scale),l=null==e.scaleVisibility||e.scaleVisibility!==a;e.scaleVisibility=a,l&&s.size&&(s.forEach(e=>e.setVisibilityFlag(16,2,a)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,i=this._labels.get(s);i&&i.visible!==t&&(t&&!i.textureAtlasHandles.length?(this._addLabelTextureToAtlas(i),i.textInitialized||i.labelingContext.labelsToInitialize.set(s,i)):!t&&i.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(i),i.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>H(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+(H(t)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};function M(e,t){e.geometries[0].setAttributeData("size",[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],"size")}function U(e,t){e.geometries[0].setAttributeData("uvi",t),e.geometryVertexAttributeUpdated(e.geometries[0],"uvi",!0)}function H(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function Q(e){return!e||0===e.length}function k(e){return"label-3d"===e.symbol?.type?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}e([b({constructOnly:!0})],F.prototype,"view",void 0),e([b({constructOnly:!0})],F.prototype,"deconflictor",void 0),e([b()],F.prototype,"_textTextureAtlas",void 0),e([b({type:Boolean,readOnly:!0})],F.prototype,"updating",null),F=e([u("esri.views.3d.layers.graphics.Labeler")],F);const B=new m(null,null,null);export{F as Labeler,W as areLabelsVisible};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{forEach as s,result as i}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import a from"../../../../core/Logger.js";import{disposeMaybe as l,abortMaybe as r}from"../../../../core/maybe.js";import{throwIfAborted as o,isAbortError as n}from"../../../../core/promiseUtils.js";import c from"../../../../core/Queue.js";import{watch as h}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{fromValues as p}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{hydrateGraphic as d}from"../../../../layers/graphics/hydratedFeatures.js";import{createLabelFunction as y}from"../../../../layers/support/labelFormatUtils.js";import{hasCalloutSupport as g}from"../../../../symbols/callouts/calloutUtils.js";import{make as f}from"./Graphics3DCalloutSymbolLayerFactory.js";import{LineCalloutCreationContext as m,LineCalloutSymbolLayerRenderingInfo as C}from"./Graphics3DLineCalloutSymbolLayer.js";import{getGraphics3DSymbol as x}from"./graphicSymbolUtils.js";import{LabelInfo as _}from"./LabelInfo.js";import{LabelParameters as L}from"./LabelParameters.js";import{horizontalPlacementFromAnchor as v,verticalPlacementFromAnchor as G,textRenderAlignmentFromHorizontalPlacement as w}from"./placementUtils.js";import{placePointOnGeometry as A}from"./pointUtils.js";import{TextRenderer as D}from"../../webgl-engine/lib/TextRenderer.js";import{TextRenderParameters as T}from"../../webgl-engine/lib/TextRenderParameters.js";import{TextTextureAtlas as I}from"../../webgl-engine/lib/TextTextureAtlas.js";import{WebGLLayer as S}from"../../webgl-engine/lib/WebGLLayer.js";import{hasLayerBasedScaleVisibility as P,isInEffectiveScaleRange as R}from"../../../support/layerViewUtils.js";import{TaskPriority as j}from"../../../support/Scheduler.js";import{Yield as V}from"../../../support/Yield.js";class O{constructor(e,t){this.labelingContext=e,this.graphics3DGraphic=t,this.hasGraphics3DResources=!1,this.visible=!1,this.textureAtlasHandles=[],this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}}class z{constructor(e,t,s,i,a){this.labelClass=e,this.graphics3DSymbol=t,this.graphics3DCalloutSymbolLayer=s,this.textRenderParameters=i,this.labelFunction=a,this.calloutSymbolLayerIndex=0,this.graphics=new Map,this.scaleVisibility=null}}class E{constructor(e,t,s,i,a,l,r,o){this.layer=t,this.graphics3DCore=s,this.scaleVisibility=i,this.emptySymbolLabelSupported=a,this.elevationInfoOverride=l,this.disablePlacement=r,this.active=o,this.labelClassAbortController=new AbortController,this._labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new S(e,{pickable:!0},s.owner.layerViewUid)}destroy(){this.stageLayer.destroy()}get labelClassContexts(){return this._labelClassContexts}setLabelClassContext(e,t){this._labelClassContexts[e]=t}resetLabelClassContext(){this._labelClassContexts.length=0}}let F=class extends t{constructor(e){super(e),this._hudMaterials=new Map,this._calloutMaterials=new Map,this._dirty=!1,this._focusAreasLabelsQueue=new c,this._labels=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this.addHandles([h(()=>this.view.state?.camera,()=>this.setDirty()),h(()=>this.view.state?.rasterPixelRatio,()=>this._resetAllLabels()),h(()=>this.view.focusAreasView?.polygons,()=>this._updateFocus()),this.view.resourceController.scheduler.registerTask(j.LABELER,this)]),P()&&this.addHandles(h(()=>this.view.scale,()=>this._updateScaleVisibility())),this._textTextureAtlas=new I({view:this.view})}dispose(){this.removeAllHandles(),this._textTextureAtlas=l(this._textTextureAtlas),this._hudMaterials.clear(),this._calloutMaterials.clear(),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),B.graphic=null,B.renderingInfo=null,B.layer=null}_updateFocus(){this._focusAreasLabelsQueue.clear(),this._labelingContexts.forEach(e=>{e.graphics.forEach(t=>{this._focusAreasLabelsQueue.push({graphic3DGraphic:t,labelingContext:e})})})}_activateLabelingContext(e){e.graphics.forEach((t,s)=>{const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i),t.setVisibilityFlag(16,1,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((e,t)=>{e.setVisibilityFlag(16,1,!1),this.setLabelGraphicVisibility(e,!1),e.clearLabelGraphics(),this._labels.delete(t)}),e.active=!1}_addLabelTextureToAtlas(e){if(this._textTextureAtlas)for(const t of e.graphics3DGraphic.labelLayers){if(!t.labelClass)continue;const s=e.textRenderers[t.labelClassContextIndex];s&&(e.textureAtlasHandles.push(this._textTextureAtlas.addText(s,e=>U(t.stageObject,e))),M(t.stageObject,s))}}_removeLabelTextureFromAtlas(e){e.textureAtlasHandles.forEach(e=>e.remove()),e.textureAtlasHandles.length=0}get readyToRun(){return this.view.ready&&(this._dirty||this.deconflictor.readyToRun||this._focusAreasLabelsQueue.length>0)}runTask(e){return this._updateLabels(e),this._applyFocusAreasUpdates(e),!this._dirty&&this.deconflictor.readyToRun&&this.deconflictor.runTask(e),V}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const t of this._labelingContexts)if(t.active)if(H(t))this._dirty=!0;else if(Q(t.labelClassContexts)){if(null===t.labelClassContexts){this._deactivateLabelingContext(t);continue}this._createLabelClassContext(t),this._dirty=!0}else for(const[s,i]of t.labelsToInitialize)if(this._ensureGraphics3DResources(i)&&(this._labels.set(s,i),this.deconflictor.setDirty(),e.madeProgress()),(i.visible&&i.textInitialized||!i.visible&&i.hasGraphics3DResources)&&(t.labelsToInitialize.delete(s),e.madeProgress()),e.done){this._dirty=!0;break}this._dirty||this.notifyChange("updating")}}_applyFocusAreasUpdates(e){for(;this._focusAreasLabelsQueue.length>0&&!e.done;){e.madeProgress();const{graphic3DGraphic:t,labelingContext:s}=this._focusAreasLabelsQueue.pop();if(0===t.labelLayers.length||!s.active)continue;const i=A(t.graphic.geometry);if(null==i)continue;const a=this.view.focusAreasView?.containsGeometry(i)??!0;t.labelLayers.forEach(e=>{e.stageObject.geometries.some(e=>e.material.parameters.isFocused!==a)&&(this._removeGraphic(s,t),this._addGraphic(s,t),this.setDirty())})}0===this._focusAreasLabelsQueue.length&&(this.notifyChange("readyToRun"),this.notifyChange("updating"))}async _createLabelClassContextAsync(e){const t=e.labelClassAbortController?.signal;e.layer.when&&await e.layer.when(),o(t),e.scaleVisibility?.updateScaleRangeActive();const l=e.graphics3DCore,r=l.layer,n=r.labelingInfo?.filter(e=>!!e.symbol);if(!n||0===n.length)return;let c=!1;await s(n,async(s,r)=>{const n=s.symbol,h=x(l.getOrCreateGraphics3DSymbol(n));if(null==h)return void a.getLogger(this).error("Failed to create Graphics3DSymbol for label");await h.load(),o(t);let b=null;g(n)&&n.hasVisibleCallout()&&(b=f(n,l.symbolCreationContext),await b.load(),o(t));const u=await i(y(s,e.layer.fieldsIndex,this.view.spatialReference));if(o(t),!0===u.ok){const i=await this._createTextRenderParameters(h.symbol);o(t);const a=new z(s,h,b,i,u.value);this._updateLabelClassContextVisibility(a),e.setLabelClassContext(r,a)}else a.getLogger(this).error(`Label expression failed to evaluate: ${u.error}`),c=!0}),o(t)}async _createLabelClassContext(e){return null==e.labelClassPromise&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(t=>{if(n(t))throw t;e.resetLabelClassContext()}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const t=e.symbolLayers.at(0);return"text"!==t?.type?null:T.fromSymbol(t,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const s of e.labelClassContexts)s&&--s.graphics3DSymbol.referenced;const t=e.labelClassAbortController;e.labelClassAbortController=new AbortController,r(t),e.resetLabelClassContext(),e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,t,s,i,a,l){if(!this._textTextureAtlas)return null;const r=new L(s,v(s.anchor),G(s.anchor),e.text,p(e.displayWidth,e.displayHeight));return B.graphic=t,B.layer=i,B.renderingInfo=null,a.createLabel(B,r,this._hudMaterials,this._textTextureAtlas,()=>l.placement?.elevationOffset??null)}_createLineCalloutGraphic(e,t,s,i,a){B.graphic=e,B.layer=a;const l=i.screenOffset[0];return B.renderingInfo=new C(null,t,i.translation,i.centerOffset,l,i.centerOffsetUnits,i.elevationOffset),s.createGraphics3DGraphic(B,this._calloutMaterials)}_ensureGraphics3DResources(e){if(e.hasGraphics3DResources)return!1;const t=e.graphics3DGraphic;if(t.destroyed)return!1;this._ensureTextTextureResources(e);const s=e.labelingContext,i=s.labelClassContexts;if(Q(i)||!s.emptySymbolLabelSupported&&0===t.layers.length)return!1;let a=!1;const l=t.graphic,r=s.layer,o=W(s.layer);for(let n=0;n<i.length;n++){const c=e.textRenderers[n],h=e.textLabelPlacements[n],b=i[n];if(null==c||null==h||null==b)continue;const u=b.graphics3DSymbol,p=k(u),d=u.symbolLayers[0];if(!d)continue;d.setElevationInfoOverride(s.elevationInfoOverride);const y=new _(t,p,b.labelClass),g=this._createTextSymbolGraphic(c,l,h,r,d,y);if(null==g)return!1;g.labelClass=b.labelClass,g.labelClassContextIndex=n,t.addLabelGraphic(g,s.stageLayer),this.deconflictor.setPriority(t,b.textRenderParameters?.definition.size??0),t.setVisibilityFlag(16,1,o),t.setVisibilityFlag(16,2,b.scaleVisibility??!0),t.setVisibilityFlag(16,8,!1),P()&&b.graphics.set(l.uid,t),a=!0;const f=b.graphics3DCalloutSymbolLayer;if(f&&h.hasLabelVerticalOffset){f.setElevationInfoOverride(s.elevationInfoOverride);const e=this._createLineCalloutGraphic(l,p,f,h,r);null!=e&&(b.calloutSymbolLayerIndex=t.labelLayers.length,t.addLabelGraphic(e,s.stageLayer))}break}return a&&s.scaleVisibility?.updateGraphicLabelScaleVisibility(t),e.hasGraphics3DResources=!0,!0}_destroyGraphics3DResources(e){const t=e.labelingContext.labelClassContexts;for(const s of e.graphics3DGraphic.labelLayers){if(null==s.labelClass)continue;const e=t[s.labelClassContextIndex].graphics3DSymbol.symbolLayers[0];e?.onRemoveGraphic(s)}e.graphics3DGraphic.clearLabelGraphics(),e.hasGraphics3DResources=!1}_ensureTextTextureResources(e){if(e.textInitialized)return;const t=e.labelingContext,s=t.labelClassContexts;if(Q(s))return;const i=e.graphics3DGraphic.graphic;for(let l=0;l<s.length;l++){const r=s[l];if(e.textRenderers[l]=null,e.textLabelPlacements[l]=null,null==r?.textRenderParameters)continue;const o=r.labelFunction;let n;if("arcade"===o.type)try{const e=o.needsHydrationToEvaluate()?d(i,t.layer,null):i;n=o.evaluate(e)}catch(a){n=null}else n=o.evaluate(i);if(null==n||""===n||/^\s+$/.test(n))continue;const c=r.graphics3DSymbol;if(!c.symbolLayers[0])continue;const h=e.graphics3DGraphic,b="label-3d"===c.symbol?.type?c.symbol:null,u=r.labelClass,p=t.disablePlacement,y=new _(h,b,u,p).placement;if(null==y)continue;const g=v(y.anchor),f=w(g);e.textRenderers[l]=new D(n,f,r.textRenderParameters,I.maxSize),e.textLabelPlacements[l]=y}e.textInitialized=!0}_destroyTextTextureResources(e){e.textInitialized=!1,e.textRenderers.length=0,e.textLabelPlacements.length=0}_addGraphic(e,t){const s=t.graphic.uid;if(e.graphics.set(s,t),e.active){const i=new O(e,t);this._labels.set(s,i),e.labelsToInitialize.set(s,i)}this.setDirty(),this.deconflictor.setDirty()}_updateGraphicGeometry(e,t){const s=t.graphic.uid,i=this._labels.get(s);if(!i)return!0;for(const a of i.graphics3DGraphic.labelLayers){if(null==a.labelClass)continue;if(!e.labelClassContexts[a.labelClassContextIndex].graphics3DSymbol.symbolLayers[0].updateGeometry(t.graphic,a))return!1}return this.setDirty(),this.deconflictor.setDirty(),!0}_removeGraphic(e,t){const s=t.graphic.uid,i=this._labels.get(s);e.graphics.delete(s),e.labelClassContexts.forEach(e=>e?.graphics.delete(s)),i&&(this._destroyGraphic(i,s),e.labelsToInitialize.delete(s),this.setDirty(),this.deconflictor.setDirty())}_destroyGraphic(e,t){this._labels.delete(t),e.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(e),this._destroyTextTextureResources(e),e.hasGraphics3DResources&&this._destroyGraphics3DResources(e)}async _labelingInfoChange(e,t){if(!t)return this._visibilityInfoChange(e),this._resetLabels(e),this._createLabelClassContext(e);for(const s of t){const t=e.graphics.get(s);t&&(this._removeGraphic(e,t),this._addGraphic(e,t))}}_globalPropertyChanged(e,t){for(const s of t.labelClassContexts){if(!s)continue;const i=new Map;t.graphics.forEach(e=>i.set(e.graphic.uid,e));const a=e=>e.labelLayers[0];if(s.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,i,a),s.graphics3DCalloutSymbolLayer){const t=e=>e.labelLayers[s.calloutSymbolLayerIndex];s.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,i,t)}}}_visibilityInfoChange(e){const t=W(e.layer);t&&!e.active&&this._activateLabelingContext(e),!t&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((t,s)=>{const i=this._labels.get(s);i&&(this._destroyGraphic(i,s),i.visible=!1,e.labelsToInitialize.set(s,i))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const t of this._labelingContexts)if(t.graphics3DCore===e)return t;return null}addGraphicsOwner(e,t,s){const i=s?.emptySymbolLabelSupported||!1,a=s?.elevationInfoOverride||null,l=s?.disablePlacement||null;if(this._findLabelingContext(e))return;const r=e.layer,o=new E(this.view.stage,r,e,t,i,a,l,W(r));return this._labelingContexts.push(o),this.setDirty(),{addGraphic:e=>this._addGraphic(o,e),removeGraphic:e=>this._removeGraphic(o,e),updateGraphicGeometry:e=>this._updateGraphicGeometry(o,e),layerLabelsEnabled:()=>W(o.layer),labelingInfoChange:e=>this._labelingInfoChange(o,e),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",o),screenSizePerspectiveEnabledChanged:()=>this._globalPropertyChanged("screenSizePerspectiveEnabled",o),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",o),visibilityInfoChange:()=>this._visibilityInfoChange(o),reset:()=>this._resetLabels(o),remove:()=>this._removeGraphicsOwner(e),setDirty:()=>this.setDirty()}}_removeGraphicsOwner(e){const t=this._findLabelingContext(e);if(!t)return;const s=this._labelingContexts.indexOf(t);this._labelingContexts.splice(s,1),t.graphics.forEach(e=>this._removeGraphic(t,e)),t.destroy(),this.setDirty()}_updateScaleVisibility(){for(const e of this._labelingContexts)if(e.active&&!H(e))for(const t of e.labelClassContexts)this._updateLabelClassContextVisibility(t)}_updateLabelClassContextVisibility(e){if(!e||!P())return;const{labelClass:t,graphics:s}=e,i={minScale:t.minScale,maxScale:t.maxScale},a=R(i,this.view.scale),l=null==e.scaleVisibility||e.scaleVisibility!==a;e.scaleVisibility=a,l&&s.size&&(s.forEach(e=>e.setVisibilityFlag(16,2,a)),this.deconflictor.setDirty(),this.setDirty())}setLabelGraphicVisibility(e,t){const s=e.graphic.uid,i=this._labels.get(s);i&&i.visible!==t&&(t&&!i.textureAtlasHandles.length?(this._addLabelTextureToAtlas(i),i.textInitialized||i.labelingContext.labelsToInitialize.set(s,i)):!t&&i.textureAtlasHandles.length&&this._removeLabelTextureFromAtlas(i),i.visible=t,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._dirty||this._textTextureAtlas?.updating||this.deconflictor.updating||this._labelingContexts.some(e=>H(e))||this._focusAreasLabelsQueue.length>0}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((e,t)=>e+(H(t)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get usedMemory(){return this._textTextureAtlas?.usedMemory??0}get test(){}};function M(e,t){e.geometries[0].setAttributeData("size",[t.displayWidth,t.displayHeight]),e.geometryVertexAttributeUpdated(e.geometries[0],"size")}function U(e,t){e.geometries[0].setAttributeData("uvi",t),e.geometryVertexAttributeUpdated(e.geometries[0],"uvi",!0)}function H(e){return!!e.labelClassPromise&&!!e.labelClassAbortController}function Q(e){return 0===(e?.length??0)}function k(e){return"label-3d"===e.symbol?.type?e.symbol:null}function W(e){return!!e.labelsVisible&&!!e.labelingInfo?.some(e=>!!e.symbol)}e([b({constructOnly:!0})],F.prototype,"view",void 0),e([b({constructOnly:!0})],F.prototype,"deconflictor",void 0),e([b()],F.prototype,"_textTextureAtlas",void 0),e([b({type:Boolean,readOnly:!0})],F.prototype,"updating",null),F=e([u("esri.views.3d.layers.graphics.Labeler")],F);const B=new m(null,null,null);export{F as Labeler,W as areLabelsVisible};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{a as n,j as t,d as i,i as o,n as e}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as s,create as f,setMax as r}from"../../../../geometry/support/aaBoundingBox.js";import{assert as a}from"./Util.js";class u{constructor(n=0,t=!1,i=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=i}}const l=f();function h(t,i,o,e,c,s){if(!t.visible)return;const f=n(D,e,o),r=(n,t,i)=>{s(n,i,t)},{tolerance:l}=i,h=new u(l,!1,i.options.normalRequired);if(t.boundingInfo)a(0===t.type),m(t.boundingInfo,o,f,l,c,h,r);else{const n=t.positionAttribute,i=n.indices;q(o,f,0,i.length/3,i,n.data,n.stride,c,h,r)}}const p=c();function m(n,t,i,o,e,c,f){if(null==n)return;const a=k(i,p);if(s(l,n.bbMin),r(l,n.bbMax),null!=e&&e.applyToAabb(l),w(l,t,a,o)){const{primitiveIndices:s,position:r}=n,a=s?s.length:r.indices.length/3;if(a>U){const s=n.getChildren();if(void 0!==s){for(const n of s)m(n,t,i,o,e,c,f);return}}y(t,i,0,a,r.indices,r.data,r.stride,s,e,c,f)}}const M=c();function d(t,i,o,e,c,s,f,r,a){const{data:u,stride:l}=s;q(t,n(D,i,t),o,e,c,u,l,f,r,a)}function b(n,t,i,o,e,c,s,f,r,a=null,u=0){const l=n[0],h=n[1],p=n[2],m=t[0],d=t[1],b=t[2];for(let x=i;x<o;++x){const n=u+(a?a[x]:x),t=3*n,i=s*e[t],o=c[i],g=c[i+1],y=c[i+2],q=s*e[t+1],T=c[q],V=c[q+1],j=c[q+2],R=s*e[t+2],I=T-o,A=V-g,B=j-y,k=c[R]-o,w=c[R+1]-g,C=c[R+2]-y,U=d*C-w*b,D=b*k-C*m,E=m*w-k*d,F=I*U+A*D+B*E;if(Math.abs(F)<=z)continue;const G=l-o,H=h-g,J=p-y,K=G*U+H*D+J*E;if(F>0){if(K<0||K>F)continue}else if(K>0||K<F)continue;const L=H*B-A*J,N=J*I-B*G,O=G*A-I*H,P=m*L+d*N+b*O;if(F>0){if(P<0||K+P>F)continue}else if(P>0||K+P<F)continue;const Q=(k*L+w*N+C*O)/F;if(Q>=0){r(Q,n,f?v(I,A,B,k,w,C,M):null)}}}function x(n,t,i,o,e,c,s,f){const r=n[0],a=n[1],u=n[2],l=t[0],h=t[1],p=t[2];for(let m=i;m<o;++m){const n=3*m,t=n+1,i=n+2,o=c*n,d=e[o],b=e[o+1],x=e[o+2],g=c*t,y=c*i,q=e[g]-d,T=e[g+1]-b,V=e[g+2]-x,j=e[y]-d,R=e[y+1]-b,I=e[y+2]-x,A=h*I-R*p,B=p*j-I*l,k=l*R-j*h,w=q*A+T*B+V*k;if(Math.abs(w)<=z)continue;const C=r-d,U=a-b,D=u-x,E=C*A+U*B+D*k;if(w>0){if(E<0||E>w)continue}else if(E>0||E<w)continue;const F=U*V-T*D,G=D*q-V*C,H=C*T-q*U,J=l*F+h*G+p*H;if(w>0){if(J<0||E+J>w)continue}else if(J>0||E+J<w)continue;const K=(j*F+R*G+I*H)/w;if(K>=0){f(K,m,s?v(q,T,V,j,R,I,M):null)}}}function g(n,t,i,o,e,c,s,f,r,a,u,l=null,h=0){const p=n[0],m=n[1],d=n[2],b=t[0],x=t[1],g=t[2];for(let y=i;y<o;++y){const n=h+(l?l[y]:y),t=3*n,i=s*e[t],o=c[i],q=c[i+1],T=c[i+2],V=s*e[t+1],j=c[V],R=c[V+1],I=c[V+2],A=s*e[t+2],B=c[A],k=c[A+1],w=c[A+2],C=T-r,U=f/Math.sqrt(o*o+q*q+C*C),D=o+o*U,E=q+q*U,F=T+C*U,G=I-r,H=f/Math.sqrt(j*j+R*R+G*G),J=j+j*H,K=R+R*H,L=I+G*H,N=w-r,O=f/Math.sqrt(B*B+k*k+N*N),P=J-D,Q=K-E,S=L-F,W=B+B*O-D,X=k+k*O-E,Y=w+N*O-F,Z=x*Y-X*g,$=g*W-Y*b,_=b*X-W*x,nn=P*Z+Q*$+S*_;if(Math.abs(nn)<=z)continue;const tn=p-D,on=m-E,en=d-F,cn=tn*Z+on*$+en*_;if(nn>0){if(cn<0||cn>nn)continue}else if(cn>0||cn<nn)continue;const sn=on*S-Q*en,fn=en*P-S*tn,rn=tn*Q-P*on,an=b*sn+x*fn+g*rn;if(nn>0){if(an<0||cn+an>nn)continue}else if(an>0||cn+an<nn)continue;const un=(W*sn+X*fn+Y*rn)/nn;if(un>=0){u(un,n,a?v(P,Q,S,W,X,Y,M):null)}}}function y(n,t,i,o,e,c,s,f,r,a,u){const l=n[0],h=n[1],p=n[2],m=t[0],d=t[1],b=t[2],{normalRequired:x}=a;for(let g=i;g<o;++g){const n=f[g],t=3*n,i=s*e[t];let o=c[i],a=c[i+1],y=c[i+2];const q=s*e[t+1];let T=c[q],V=c[q+1],j=c[q+2];const R=s*e[t+2];let I=c[R],A=c[R+1],B=c[R+2];null!=r&&([o,a,y]=r.applyToVertex(o,a,y,g),[T,V,j]=r.applyToVertex(T,V,j,g),[I,A,B]=r.applyToVertex(I,A,B,g));const k=T-o,w=V-a,C=j-y,U=I-o,D=A-a,E=B-y,F=d*E-D*b,G=b*U-E*m,H=m*D-U*d,J=k*F+w*G+C*H;if(Math.abs(J)<=z)continue;const K=l-o,L=h-a,N=p-y,O=K*F+L*G+N*H;if(J>0){if(O<0||O>J)continue}else if(O>0||O<J)continue;const P=L*C-w*N,Q=N*k-C*K,S=K*w-k*L,W=m*P+d*Q+b*S;if(J>0){if(W<0||O+W>J)continue}else if(W>0||O+W<J)continue;const X=(U*P+D*Q+E*S)/J;if(X>=0){u(X,n,x?v(k,w,C,U,D,E,M):null)}}}function q(o,e,c,s,f,r,a,u,l,h){const p=e,m=E,M=Math.abs(p[0]),d=Math.abs(p[1]),b=Math.abs(p[2]),x=M>=d?M>=b?0:2:d>=b?1:2,g=x,y=p[g]<0?2:1,q=(x+y)%3,v=(x+(3-y))%3,I=p[q]/p[g],A=p[v]/p[g],B=1/p[g],k=T,w=V,C=j,{normalRequired:U}=l;for(let T=c;T<s;++T){const e=3*T,c=a*f[e];t(m[0],r[c+0],r[c+1],r[c+2]);const s=a*f[e+1];t(m[1],r[s+0],r[s+1],r[s+2]);const l=a*f[e+2];t(m[2],r[l+0],r[l+1],r[l+2]),u&&(i(m[0],u.applyToVertex(m[0][0],m[0][1],m[0][2],T)),i(m[1],u.applyToVertex(m[1][0],m[1][1],m[1][2],T)),i(m[2],u.applyToVertex(m[2][0],m[2][1],m[2][2],T))),n(k,m[0],o),n(w,m[1],o),n(C,m[2],o);const p=k[q]-I*k[g],M=k[v]-A*k[g],d=w[q]-I*w[g],b=w[v]-A*w[g],x=C[q]-I*C[g],y=C[v]-A*C[g],V=x*b-y*d,j=p*y-M*x,z=d*M-b*p;if((V<0||j<0||z<0)&&(V>0||j>0||z>0))continue;const D=V+j+z;if(0===D)continue;const E=V*(B*k[g])+j*(B*w[g])+z*(B*C[g]);if(E*Math.sign(D)<0)continue;const F=E/D;if(F>=0){h(F,T,U?R(m):null)}}}const T=c(),V=c(),j=c();function v(n,i,c,s,f,r,a){return t(I,n,i,c),t(A,s,f,r),o(a,I,A),e(a,a),a}function R(t){return n(I,t[1],t[0]),n(A,t[2],t[0]),o(M,I,A),e(M,M),M}const I=c(),A=c();function B(n,i,o){return t(o,1/(i[0]-n[0]),1/(i[1]-n[1]),1/(i[2]-n[2]))}function k(n,i){return t(i,1/n[0],1/n[1],1/n[2])}function w(n,t,i,o){return C(n,t,i,o,1/0)}function C(n,t,i,o,e){const c=(n[0]-o-t[0])*i[0],s=(n[3]+o-t[0])*i[0];let f=Math.min(c,s),r=Math.max(c,s);const a=(n[1]-o-t[1])*i[1],u=(n[4]+o-t[1])*i[1];if(r=Math.min(r,Math.max(a,u)),r<0)return!1;if(f=Math.max(f,Math.min(a,u)),f>r)return!1;const l=(n[2]-o-t[2])*i[2],h=(n[5]+o-t[2])*i[2];return r=Math.min(r,Math.max(l,h)),!(r<0)&&(f=Math.max(f,Math.min(l,h)),!(f>r)&&f<e)}const U=1e3,z=1e-7,D=c(),E=[c(),c(),c()];export{u as MeshIntersectionOptions,B as computeInvDir,k as computeInvDirFromDirection,v as computeNormalFromBarycentric,w as intersectAabbInvDir,C as intersectAabbInvDirBefore,b as intersectRayTriangles,q as intersectRayTrianglesWithDisplacementWatertight,g as intersectRayTrianglesWithVerticalOffsetENUGlobal,x as intersectRenderGeometryTriangles,h as intersectTriangleGeometry,d as intersectTriangles,z as triangleRayParallelTolerance};
5
+ import{a as n,j as t,d as i,i as o,n as e}from"../../../../chunks/vec32.js";import{create as c}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setMin as s,create as f,setMax as r}from"../../../../geometry/support/aaBoundingBox.js";import{assert as u}from"./Util.js";class a{constructor(n=0,t=!1,i=!0){this.tolerance=n,this.isVerticalRay=t,this.normalRequired=i}}const l=f();function h(t,i,o,e,c,s){if(!t.visible)return;const f=n(F,e,o),r=(n,t,i)=>s(n,i,t),{tolerance:l}=i,h=new a(l,!1,i.options.normalRequired);if(t.boundingInfo)u(0===t.type),b(t.boundingInfo,o,f,l,c,h,r);else{const n=t.positionAttribute,i=n.indices;V(o,f,0,i.length/3,i,n.data,n.stride,c,h,r)}}const p=c();function b(n,t,i,o,e,c,f){if(null==n)return;const u=C(i,p);if(s(l,n.bbMin),r(l,n.bbMax),null!=e&&e.applyToAabb(l),U(l,t,u,o)){const{primitiveIndices:s,position:r}=n,u=s?s.length:r.indices.length/3;if(u>D){const s=n.getChildren();if(void 0!==s){for(const n of s)b(n,t,i,o,e,c,f);return}}T(t,i,0,u,r.indices,r.data,r.stride,s,e,c,f)}}const m=c();function M(t,i,o,e,c,s,f,r,u){const{data:a,stride:l}=s;V(t,n(F,i,t),o,e,c,a,l,f,r,u)}function d(n,t,i,o){if(!i.visible)return;const e=(n,t,i)=>o(n,i,t),{boundingInfo:c}=i;if(c){const{bbMin:i,bbMax:o}=c;if(n<i[0]||n>o[0]||t<i[1]||t>o[1])return}const s=i.positionAttribute,f=s.indices;x(n,t,0,f.length/3,f,s,e)}function x(n,t,i,o,e,c,s){const{data:f,stride:r}=c;for(let u=i;u<o;++u){const i=3*u,o=r*e[i],c=r*e[i+1],a=r*e[i+2],l=f[o+0]-n,h=f[o+1]-t,p=f[c+0]-n,b=f[c+1]-t,m=f[a+0]-n,M=f[a+1]-t,d=m*b-M*p,x=l*M-h*m,g=p*h-b*l;(d<0||x<0||g<0)&&(d>0||x>0||g>0)||s(0,u,null)}}function g(n,t,i,o,e,c,s,f,r,u=null,a=0){const l=n[0],h=n[1],p=n[2],b=t[0],M=t[1],d=t[2];for(let x=i;x<o;++x){const n=a+(u?u[x]:x),t=3*n,i=s*e[t],o=c[i],g=c[i+1],y=c[i+2],q=s*e[t+1],T=c[q],V=c[q+1],v=c[q+2],j=s*e[t+2],R=T-o,A=V-g,B=v-y,k=c[j]-o,w=c[j+1]-g,C=c[j+2]-y,U=M*C-w*d,z=d*k-C*b,D=b*w-k*M,F=R*U+A*z+B*D;if(Math.abs(F)<=E)continue;const G=l-o,H=h-g,J=p-y,K=G*U+H*z+J*D;if(F>0){if(K<0||K>F)continue}else if(K>0||K<F)continue;const L=H*B-A*J,N=J*R-B*G,O=G*A-R*H,P=b*L+M*N+d*O;if(F>0){if(P<0||K+P>F)continue}else if(P>0||K+P<F)continue;const Q=(k*L+w*N+C*O)/F;if(Q>=0){r(Q,n,f?I(R,A,B,k,w,C,m):null)}}}function y(n,t,i,o,e,c,s,f){const r=n[0],u=n[1],a=n[2],l=t[0],h=t[1],p=t[2];for(let b=i;b<o;++b){const n=3*b,t=n+1,i=n+2,o=c*n,M=e[o],d=e[o+1],x=e[o+2],g=c*t,y=c*i,q=e[g]-M,T=e[g+1]-d,V=e[g+2]-x,v=e[y]-M,j=e[y+1]-d,R=e[y+2]-x,A=h*R-j*p,B=p*v-R*l,k=l*j-v*h,w=q*A+T*B+V*k;if(Math.abs(w)<=E)continue;const C=r-M,U=u-d,z=a-x,D=C*A+U*B+z*k;if(w>0){if(D<0||D>w)continue}else if(D>0||D<w)continue;const F=U*V-T*z,G=z*q-V*C,H=C*T-q*U,J=l*F+h*G+p*H;if(w>0){if(J<0||D+J>w)continue}else if(J>0||D+J<w)continue;const K=(v*F+j*G+R*H)/w;if(K>=0){f(K,b,s?I(q,T,V,v,j,R,m):null)}}}function q(n,t,i,o,e,c,s,f,r,u,a,l=null,h=0){const p=n[0],b=n[1],M=n[2],d=t[0],x=t[1],g=t[2];for(let y=i;y<o;++y){const n=h+(l?l[y]:y),t=3*n,i=s*e[t],o=c[i],q=c[i+1],T=c[i+2],V=s*e[t+1],v=c[V],j=c[V+1],R=c[V+2],A=s*e[t+2],B=c[A],k=c[A+1],w=c[A+2],C=T-r,U=f/Math.sqrt(o*o+q*q+C*C),z=o+o*U,D=q+q*U,F=T+C*U,G=R-r,H=f/Math.sqrt(v*v+j*j+G*G),J=v+v*H,K=j+j*H,L=R+G*H,N=w-r,O=f/Math.sqrt(B*B+k*k+N*N),P=J-z,Q=K-D,S=L-F,W=B+B*O-z,X=k+k*O-D,Y=w+N*O-F,Z=x*Y-X*g,$=g*W-Y*d,_=d*X-W*x,nn=P*Z+Q*$+S*_;if(Math.abs(nn)<=E)continue;const tn=p-z,on=b-D,en=M-F,cn=tn*Z+on*$+en*_;if(nn>0){if(cn<0||cn>nn)continue}else if(cn>0||cn<nn)continue;const sn=on*S-Q*en,fn=en*P-S*tn,rn=tn*Q-P*on,un=d*sn+x*fn+g*rn;if(nn>0){if(un<0||cn+un>nn)continue}else if(un>0||cn+un<nn)continue;const an=(W*sn+X*fn+Y*rn)/nn;if(an>=0){a(an,n,u?I(P,Q,S,W,X,Y,m):null)}}}function T(n,t,i,o,e,c,s,f,r,u,a){const l=n[0],h=n[1],p=n[2],b=t[0],M=t[1],d=t[2],{normalRequired:x}=u;for(let g=i;g<o;++g){const n=f[g],t=3*n,i=s*e[t];let o=c[i],u=c[i+1],y=c[i+2];const q=s*e[t+1];let T=c[q],V=c[q+1],v=c[q+2];const j=s*e[t+2];let R=c[j],A=c[j+1],B=c[j+2];null!=r&&([o,u,y]=r.applyToVertex(o,u,y,g),[T,V,v]=r.applyToVertex(T,V,v,g),[R,A,B]=r.applyToVertex(R,A,B,g));const k=T-o,w=V-u,C=v-y,U=R-o,z=A-u,D=B-y,F=M*D-z*d,G=d*U-D*b,H=b*z-U*M,J=k*F+w*G+C*H;if(Math.abs(J)<=E)continue;const K=l-o,L=h-u,N=p-y,O=K*F+L*G+N*H;if(J>0){if(O<0||O>J)continue}else if(O>0||O<J)continue;const P=L*C-w*N,Q=N*k-C*K,S=K*w-k*L,W=b*P+M*Q+d*S;if(J>0){if(W<0||O+W>J)continue}else if(W>0||O+W<J)continue;const X=(U*P+z*Q+D*S)/J;if(X>=0){a(X,n,x?I(k,w,C,U,z,D,m):null)}}}function V(o,e,c,s,f,r,u,a,l,h){const p=e,b=G,m=Math.abs(p[0]),M=Math.abs(p[1]),d=Math.abs(p[2]),x=m>=M?m>=d?0:2:M>=d?1:2,g=x,y=p[g]<0?2:1,q=(x+y)%3,T=(x+(3-y))%3,V=p[q]/p[g],I=p[T]/p[g],B=1/p[g],k=v,w=j,C=R,{normalRequired:U}=l;for(let v=c;v<s;++v){const e=3*v,c=u*f[e];t(b[0],r[c+0],r[c+1],r[c+2]);const s=u*f[e+1];t(b[1],r[s+0],r[s+1],r[s+2]);const l=u*f[e+2];t(b[2],r[l+0],r[l+1],r[l+2]),a&&(i(b[0],a.applyToVertex(b[0][0],b[0][1],b[0][2],v)),i(b[1],a.applyToVertex(b[1][0],b[1][1],b[1][2],v)),i(b[2],a.applyToVertex(b[2][0],b[2][1],b[2][2],v))),n(k,b[0],o),n(w,b[1],o),n(C,b[2],o);const p=k[q]-V*k[g],m=k[T]-I*k[g],M=w[q]-V*w[g],d=w[T]-I*w[g],x=C[q]-V*C[g],y=C[T]-I*C[g],j=x*d-y*M,R=p*y-m*x,z=M*m-d*p;if((j<0||R<0||z<0)&&(j>0||R>0||z>0))continue;const D=j+R+z;if(0===D)continue;const E=j*(B*k[g])+R*(B*w[g])+z*(B*C[g]);if(E*Math.sign(D)<0)continue;const F=E/D;if(F>=0){h(F,v,U?A(b):null)}}}const v=c(),j=c(),R=c();function I(n,i,c,s,f,r,u){return t(B,n,i,c),t(k,s,f,r),o(u,B,k),e(u,u),u}function A(t){return n(B,t[1],t[0]),n(k,t[2],t[0]),o(m,B,k),e(m,m),m}const B=c(),k=c();function w(n,i,o){return t(o,1/(i[0]-n[0]),1/(i[1]-n[1]),1/(i[2]-n[2]))}function C(n,i){return t(i,1/n[0],1/n[1],1/n[2])}function U(n,t,i,o){return z(n,t,i,o,1/0)}function z(n,t,i,o,e){const c=(n[0]-o-t[0])*i[0],s=(n[3]+o-t[0])*i[0];let f=Math.min(c,s),r=Math.max(c,s);const u=(n[1]-o-t[1])*i[1],a=(n[4]+o-t[1])*i[1];if(r=Math.min(r,Math.max(u,a)),r<0)return!1;if(f=Math.max(f,Math.min(u,a)),f>r)return!1;const l=(n[2]-o-t[2])*i[2],h=(n[5]+o-t[2])*i[2];return r=Math.min(r,Math.max(l,h)),!(r<0)&&(f=Math.max(f,Math.min(l,h)),!(f>r)&&f<e)}const D=1e3,E=1e-7,F=c(),G=[c(),c(),c()];export{a as MeshIntersectionOptions,w as computeInvDir,C as computeInvDirFromDirection,I as computeNormalFromBarycentric,U as intersectAabbInvDir,z as intersectAabbInvDirBefore,g as intersectRayTriangles,V as intersectRayTrianglesWithDisplacementWatertight,q as intersectRayTrianglesWithVerticalOffsetENUGlobal,y as intersectRenderGeometryTriangles,h as intersectTriangleGeometry,d as intersectTriangleGeometry2d,M as intersectTriangles,x as intersectTriangles2d,E as triangleRayParallelTolerance};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Material as i}from"../lib/Material.js";import{intersectTriangleGeometry as p}from"../lib/RayIntersections.js";class r extends i{constructor(){super(...arguments),this._pp0=t(0,0,1),this._pp1=t(0,0,0)}intersect(t,i,r,s,e,o){return p(t,r,s,e,void 0,o)}intersectDraped(t,i,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],p(t,i,this._pp0,this._pp1,void 0,s)}}export{r as TriangleMaterial};
5
+ import{Material as r}from"../lib/Material.js";import{intersectTriangleGeometry as e,intersectTriangleGeometry2d as t}from"../lib/RayIntersections.js";class i extends r{intersect(r,t,i,s,n,o){return e(r,i,s,n,void 0,o)}intersectDraped(r,e,i,s){return t(i[0],i[1],r,s)}}export{i as TriangleMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{byId as t,reparent as s}from"../core/domUtils.js";import{on as i}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import o from"../core/Logger.js";import{removeMaybe as n}from"../core/maybe.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as d}from"../core/scheduling.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import c from"./overlay/ViewOverlay.js";const p=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return p[0]=s.left+(t?.pageXOffset??0),p[1]=s.top+(t?.pageYOffset??0),p}function f(e){e&&(e.textContent="",e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const g=16,_=750,v=512,w=2,C=p=>{const C=p;let b=class extends C{constructor(...e){super(...e),this._freqInfo={freq:g,time:_},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([a(()=>this.cursor,e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)}),a(()=>this.navigating,e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())}),a(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const e=this;this.addHandles([a(()=>this.ui,(e,t)=>this._handleUIChange(e,t),l),e.on("focus",()=>this.notifyChange("focused")),e.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||o.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),f(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",s(r,l),r.appendChild(l),this._set("userContent",l);const h=document.createElement("div");h.className="esri-view-root",r.insertBefore(h,r.firstChild),this._set("root",h);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,h.appendChild(u),this._set("surface",u);const p=new c;h.appendChild(p.surface),this._set("overlay",p),this.addHandles(a(()=>p.needsRender,e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=d({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=n(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}set ui(e){const t=this._get("ui");t!==e&&t?.destroy(),this._set("ui",e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_updateAria(){const{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(a(()=>this.root,t=>{e.container=t?y(t):null},l),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=g,e.time=_;const t=d({prepare:e=>{const s=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,s&&(i.freq=g,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const r=this._position();i.freq=r||s?g:Math.min(_,i.freq*w),!s&&i.freq>=v&&(t.pause(),this._get("resizing")&&this._set("resizing",!1))}}),s=new ResizeObserver(s=>{e.freq=g,e.time=_,t.resume()});null!=this.container&&s.observe(this.container);const o=r(()=>s.disconnect());this.addHandles([i(window,"resize",()=>{e.freq=g,e.time=_,t.resume()}),o,t],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;if(t===i&&s===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([h()],b.prototype,"aria",void 0),e([h()],b.prototype,"container",null),e([h({readOnly:!0})],b.prototype,"focused",null),e([h({readOnly:!0})],b.prototype,"height",void 0),e([h()],b.prototype,"messagesCommon",void 0),e([h({type:c})],b.prototype,"overlay",void 0),e([h({readOnly:!0})],b.prototype,"position",void 0),e([h({readOnly:!0})],b.prototype,"resizing",void 0),e([h({readOnly:!0})],b.prototype,"root",void 0),e([h({value:null,readOnly:!0})],b.prototype,"size",null),e([h({readOnly:!0})],b.prototype,"surface",void 0),e([h({readOnly:!0})],b.prototype,"suspended",void 0),e([h({nonNullable:!0})],b.prototype,"ui",null),e([h({readOnly:!0})],b.prototype,"userContent",void 0),e([h({readOnly:!0})],b.prototype,"width",void 0),e([h()],b.prototype,"widthBreakpoint",void 0),b=e([u("esri.views.DOMContainer")],b),b};export{C as DOMContainer};
5
+ import{__decorate as e}from"tslib";import{byId as t,reparent as s}from"../core/domUtils.js";import{on as i}from"../core/events.js";import{makeHandle as r}from"../core/handleUtils.js";import o from"../core/Logger.js";import{removeMaybe as n}from"../core/maybe.js";import{watch as a,initial as l}from"../core/reactiveUtils.js";import{addFrameTask as h}from"../core/scheduling.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import c from"./overlay/ViewOverlay.js";const p=[0,0];function m(e){const t=(e.ownerDocument||window.document).defaultView,s=e.getBoundingClientRect();return p[0]=s.left+(t?.pageXOffset??0),p[1]=s.top+(t?.pageYOffset??0),p}function f(e){e&&(e.textContent="",e.parentNode&&e.parentNode.removeChild(e))}function y(e){const t=document.createElement("div");return e.appendChild(t),t}const g=16,_=750,v=512,w=2,C=p=>{const C=p;let b=class extends C{constructor(...e){super(...e),this._freqInfo={freq:g,time:_},this._overlayRenderTaskHandle=null,this.aria={},this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([a(()=>this.cursor,e=>{const{surface:t}=this;t&&t.setAttribute("data-cursor",e)}),a(()=>this.navigating,e=>{const{surface:t}=this;t&&t.setAttribute("data-navigating",e.toString())}),a(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0})])}initialize(){const e=this;this.addHandles([a(()=>this.ui,(e,t)=>this._handleUIChange(e,t),l),e.on("focus",()=>this.notifyChange("focused")),e.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui?.destroy(),this.container=null)}get container(){return this._get("container")??null}set container(e){const i=this._get("container"),r=t(e);if(r||"string"!=typeof e||o.getLogger(this).error("#container",`element with id '${e}' not found`),i===r)return;if(this._stopMeasuring(),i&&(i.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(f(this.root),this._set("root",null)),this.userContent&&(s(this.userContent,i),f(this.userContent),this._set("userContent",null))),!r)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);r.classList.add("esri-view");const l=document.createElement("div");l.className="esri-view-user-storage",s(r,l),r.appendChild(l),this._set("userContent",l);const d=document.createElement("div");d.className="esri-view-root",r.insertBefore(d,r.firstChild),this._set("root",d);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,d.appendChild(u),this._set("surface",u);const p=new c;d.appendChild(p.surface),this._set("overlay",p),this.addHandles(a(()=>p.needsRender,e=>{e&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=h({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=n(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",r),this._startMeasuring()}get focused(){const e=document.activeElement===this.surface;return document.hasFocus()&&e}get size(){return[this.width,this.height]}set ui(e){const t=this._get("ui");t!==e&&t?.destroy(),this._set("ui",e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,s){const i=this.position;return e-=i?i[0]:0,t-=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}containerToPage(e,t,s){const i=this.position;return e+=i?i[0]:0,t+=i?i[1]:0,s?(s[0]=e,s[1]=t):s=[e,t],s}_updateAria(){const{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_handleUIChange(e,t){this.removeHandles("ui"),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(a(()=>this.root,t=>{e.container=t?y(t):null},l),"ui")),this._set("ui",e)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const e=this._freqInfo;e.freq=g,e.time=_;const t=h({prepare:e=>{const s=this._measure(),i=this._freqInfo;if(i.time+=e.deltaTime,s&&(i.freq=g,this._get("resizing")||this._set("resizing",!0)),i.time<i.freq)return;i.time=0;const r=this._position();i.freq=r||s?g:Math.min(_,i.freq*w),!s&&i.freq>=v&&(t.pause(),this._get("resizing")&&this._set("resizing",!1))}}),s=new ResizeObserver(s=>{e.freq=g,e.time=_,t.resume()});null!=this.container&&s.observe(this.container);const o=r(()=>s.disconnect());this.addHandles([i(window,"resize",()=>{e.freq=g,e.time=_,t.resume()}),o,t],"measuring"),this._measure(),this._position()}_measure(){const e=this.container,t=e?e.clientWidth:0,s=e?e.clientHeight:0;if(0===t||0===s)return this.suspended||this._set("suspended",!0),!1;const i=this.width,r=this.height;if(t===i&&s===r)return this.suspended&&this._set("suspended",!1),!1;this._set("width",t),this._set("height",s),this.suspended&&this._set("suspended",!1);return this.emit("resize",{oldWidth:i,oldHeight:r,width:t,height:s}),!0}_position(){const e=this.container,t=this.position,s=e&&m(e);return!!s&&((!t||s[0]!==t[0]||s[1]!==t[1])&&(this._set("position",[s[0],s[1]]),!0))}forceDOMReadyCycle(){}};return e([d()],b.prototype,"aria",void 0),e([d()],b.prototype,"container",null),e([d({readOnly:!0})],b.prototype,"focused",null),e([d({readOnly:!0})],b.prototype,"height",void 0),e([d()],b.prototype,"messagesCommon",void 0),e([d({type:c})],b.prototype,"overlay",void 0),e([d({readOnly:!0})],b.prototype,"position",void 0),e([d({readOnly:!0})],b.prototype,"resizing",void 0),e([d({readOnly:!0})],b.prototype,"root",void 0),e([d({value:null,readOnly:!0})],b.prototype,"size",null),e([d({readOnly:!0})],b.prototype,"surface",void 0),e([d({readOnly:!0})],b.prototype,"suspended",void 0),e([d({nonNullable:!0})],b.prototype,"ui",null),e([d({readOnly:!0})],b.prototype,"userContent",void 0),e([d({readOnly:!0})],b.prototype,"width",void 0),e([d()],b.prototype,"widthBreakpoint",void 0),b=e([u("esri.views.DOMContainer")],b),b};export{C as DOMContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{makeHandle as s}from"../../../core/handleUtils.js";import{LRUCache as r}from"../../../core/LRUCache.js";import{mapCollection as a}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as n,abortMaybe as l}from"../../../core/maybe.js";import{memoize as p}from"../../../core/memoize.js";import{throwIfAborted as u,throwIfAbortError as m}from"../../../core/promiseUtils.js";import{watch as c,syncAndInitial as h,on as d}from"../../../core/reactiveUtils.js";import{throttle as _}from"../../../core/throttle.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as v}from"../../../core/unitUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationQueryTileCache as C}from"../../../layers/support/ElevationQueryTileCache.js";import{absoluteHeightElevationInfo as P}from"../../../support/elevationInfoUtils.js";import{getDefaultUnitForView as j}from"../../../support/getDefaultUnitForView.js";import{getConfig as T}from"./constants.js";import U from"./ElevationProfileError.js";import{InvalidGeometryError as w,UnknownError as R}from"./elevationProfileErrors.js";import{createProfileQueue as D,generateProfiles as M}from"./elevationProfileGenerationUtils.js";import{getBoundsInMeters as I,mergeStatistics as b}from"./elevationProfileStatisticsUtils.js";let E=class extends e{constructor(t){super(t),this.error=null,this._getEffectiveUnitsMemoized=p((t,e)=>({distance:t,elevation:e})),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getUpdateParametersMemoized=p((t,e,o)=>({stationary:t,activeComputations:e,generationParameters:o})),this._getGenerationParametersMemoized=p((t,e,o,i,s,r,a,n)=>null==s?null:{view:t,geometry:e,geometryIsValid:o,elevationInfo:i,options:a,queue:s,cache:r,slicePlane:n}),this._getOptionsMemoized=p((t,e)=>{const{densificationMaxSamples:o,maxTotalSamples:i}=T();return{samplingDistance:t,densificationMaxSamples:Math.round(o/e),maxTotalSamples:i}}),this._updateThrottled=_(t=>this._update(t),T().updateThrottleMillis)}initialize(){this._computationsCollection=a(()=>this.analysis.profiles,t=>this.computationFactory.create({controller:this,profile:t,onInvalidate:t=>this._invalidateComputation(t)}),{recycleItems:!0}),this.addHandles([this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),c(()=>this._updateParameters,t=>this._updateThrottled(t),h),this._updateThrottled]);const t="3d"===this.view.type?this.view.resourceController:void 0;this._queue=D(t?.scheduler),t?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=n(this._queue),this._currentTileCache=n(this._currentTileCache)}get effectiveDisplayUnits(){const t=I(this._activeComputations.map(t=>t.result.rawResult)),e=this.analysis.displayUnits,o=j(this.view),i=f(t.maxDistance,"meters",e.distance??o),s=v(t.maxElevation,"meters",e.elevation??o);return this._getEffectiveUnitsMemoized(i,s)}get progress(){let t=0,e=0;for(const o of this._activeComputations)t++,e+=o.progress;return t>0?e/t:0}get updating(){const{progress:t}=this;return t>0&&t<1||!!this._queue?.updating||this._updateThrottled.hasPendingUpdates()||null!=this._updateTask&&!this._updateTask.finished}get results(){return this._computations.map(t=>t.result)}get statistics(){return b(this._activeComputations.map(t=>t.result.statistics))}get hoveredPoints(){return this._computations.map(t=>t.hoveredPoint)}onElevationChange(t){const{view:e}=this;return"3d"===e?.type?d(()=>e.elevationProvider,"elevation-change",t,{onListenerAdd:t,onListenerRemove:t}):s()}get _tileCache(){this._currentTileCache=n(this._currentTileCache);const t=this.view;if("3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new C(new r(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(t=>t.profile.enabled&&t.available)}get _minDemResolution(){const t=this._minDemResolutions;return t.length>0?o(t):null}get _minDemResolutions(){const t=[];for(const{minDemResolution:e}of this._activeComputations)null!=e&&t.push(e);return t}get _updateParameters(){const{view:t}=this;return this._getUpdateParametersMemoized(t?.stationary??!0,this._activeComputations,this._generationParameters)}get _generationParameters(){const{view:t,analysis:e}=this;return null!=t&&t.ready?this._getGenerationParametersMemoized(t,e.geometry,e.valid,this.elevationInfo,this._queue,this._tileCache,this._options,"3d"===t.type?t.slice.plane:null):null}get elevationInfo(){return this.analysis.elevationInfo??P}get _options(){const t=this._activeComputations.length;let e=this._minDemResolution??T().defaultDemResolution;return e=parseFloat(e.toFixed(2)),this._getOptionsMemoized(e,t)}_update({stationary:t,activeComputations:e,generationParameters:o}){this._abortUpdate(),t&&(null!=o?this._updateTask=i(async t=>{this.error=null;const i=e.filter(t=>!this._isComputationValid(t,o));try{if(!o.geometryIsValid)throw new w;const e=M({...o,providers:i},{signal:t});for await(const s of e){u(t),this._clearInvalidResults(o);for(let t=0;t<i.length;t++)i[t].setResult(s[t])}for(const t of i)this._parametersPerComputation.set(t,o)}catch(s){m(s),this._abortUpdate(),this.error=s instanceof U?s:new R,i.forEach(t=>{t.clearResult()})}}):this._clearResults())}_abortUpdate(){this._updateTask=l(this._updateTask)}_isComputationValid(t,e){return this._parametersPerComputation.has(t)&&this._parametersPerComputation.get(t)===e}_invalidateComputation(t){this._parametersPerComputation.delete(t),this._updateThrottled(this._updateParameters)}_clearInvalidResults(t){for(const e of this._computations)this._isComputationValid(e,t)||(e.clearResult(),this._parametersPerComputation.delete(e))}_clearResults(){for(const t of this._computations)t.clearResult(),this._parametersPerComputation.delete(t)}};t([y({constructOnly:!0})],E.prototype,"analysis",void 0),t([y({constructOnly:!0})],E.prototype,"analysisViewData",void 0),t([y({constructOnly:!0})],E.prototype,"computationFactory",void 0),t([y({constructOnly:!0})],E.prototype,"view",void 0),t([y()],E.prototype,"error",void 0),t([y({readOnly:!0})],E.prototype,"effectiveDisplayUnits",null),t([y()],E.prototype,"progress",null),t([y()],E.prototype,"updating",null),t([y()],E.prototype,"results",null),t([y()],E.prototype,"statistics",null),t([y()],E.prototype,"hoveredPoints",null),t([y()],E.prototype,"_queue",void 0),t([y()],E.prototype,"_tileCache",null),t([y()],E.prototype,"_computationsCollection",void 0),t([y()],E.prototype,"_computations",null),t([y()],E.prototype,"_activeComputations",null),t([y({readOnly:!0})],E.prototype,"_minDemResolution",null),t([y()],E.prototype,"_minDemResolutions",null),t([y()],E.prototype,"_updateParameters",null),t([y()],E.prototype,"_generationParameters",null),t([y()],E.prototype,"elevationInfo",null),t([y()],E.prototype,"_options",null),E=t([g("esri.views.analysis.ElevationProfile.ElevationProfileController")],E);export{E as ElevationProfileController};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{dedupeResult as s}from"../../../core/dedupeResult.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{equalsShallow as a}from"../../../core/lang.js";import{LRUCache as n}from"../../../core/LRUCache.js";import{mapCollection as l}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as p,abortMaybe as u,equalsMaybe as c}from"../../../core/maybe.js";import{throwIfAborted as m,throwIfAbortError as h}from"../../../core/promiseUtils.js";import{watch as _,syncAndInitial as d,on as f}from"../../../core/reactiveUtils.js";import{throttle as v}from"../../../core/throttle.js";import{adaptiveVerticalLengthUnit as y,adaptiveLengthUnit as g}from"../../../core/unitUtils.js";import{property as C}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as P}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationQueryTileCache as j}from"../../../layers/support/ElevationQueryTileCache.js";import{absoluteHeightElevationInfo as T}from"../../../support/elevationInfoUtils.js";import{getDefaultUnitForView as U}from"../../../support/getDefaultUnitForView.js";import b from"../../../symbols/support/ElevationInfo.js";import{getConfig as w}from"./constants.js";import R from"./ElevationProfileError.js";import{InvalidGeometryError as S,UnknownError as I}from"./elevationProfileErrors.js";import{createProfileQueue as E,generateProfiles as D}from"./elevationProfileGenerationUtils.js";import{mergeStatistics as q,getBoundsInMeters as x}from"./elevationProfileStatisticsUtils.js";let O=class extends e{constructor(t){super(t),this.error=null,this._getStableEffectiveUnits=s(()=>{const t=x(this._activeComputations.map(t=>t.result.rawResult)),e=this.analysis.displayUnits,o=U(this.view);return{distance:g(t.maxDistance,"meters",e.distance??o),elevation:y(t.maxElevation,"meters",e.elevation??o)}},a),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getStableUpdateParameters=s(()=>({stationary:this.view.stationary??!0,activeComputations:this._activeComputations,generationParameters:this._generationParameters}),a),this._getStableGenerationParameters=s(()=>{const{view:t,analysis:e}=this;return t?.ready&&this._queue?{view:t,geometry:e.geometry,geometryIsValid:e.valid,elevationInfo:this.elevationInfo,queue:this._queue,cache:this._tileCache,options:this._options,slicePlane:"3d"===t.type?t.slice.plane:null}:null},a),this._getStableElevationInfo=s(()=>this.analysis.elevationInfo??V,c),this._getStableOptions=s(()=>{const{densificationMaxSamples:t,defaultDemResolution:e,maxTotalSamples:o}=w();let i=this._minDemResolution??e;return i=parseFloat(i.toFixed(2)),{samplingDistance:i,densificationMaxSamples:Math.round(t/this._activeComputations.length),maxTotalSamples:o}},a),this._updateThrottled=v(t=>this._update(t),w().updateThrottleMillis)}initialize(){this._computationsCollection=l(()=>this.analysis.profiles,t=>this.computationFactory.create({controller:this,profile:t,onInvalidate:t=>this._invalidateComputation(t)}),{recycleItems:!0}),this.addHandles([this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),_(()=>this._updateParameters,t=>this._updateThrottled(t),d),this._updateThrottled]);const t="3d"===this.view.type?this.view.resourceController:void 0;this._queue=E(t?.scheduler),t?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=p(this._queue),this._currentTileCache=p(this._currentTileCache)}get effectiveDisplayUnits(){return this._getStableEffectiveUnits()}get progress(){let t=0,e=0;for(const i of this._activeComputations)t++,e+=i.progress;const o=t>0?e/t:0;return o>.999999?1:o}get updating(){const{progress:t}=this;return t>0&&t<1||!!this._queue?.updating||this._updateThrottled.hasPendingUpdates()||null!=this._updateTask&&!this._updateTask.finished}get results(){return this._computations.map(t=>t.result)}get statistics(){return q(this._activeComputations.map(t=>t.result.statistics))}get hoveredPoints(){return this._computations.map(t=>t.hoveredPoint)}onElevationChange(t){const{view:e}=this;return"3d"===e?.type?f(()=>e.elevationProvider,"elevation-change",t,{onListenerAdd:t,onListenerRemove:t}):r()}get _tileCache(){this._currentTileCache=p(this._currentTileCache);const t=this.view;if("3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new j(new n(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(t=>t.profile.enabled&&t.available)}get _minDemResolution(){const t=this._minDemResolutions;return t.length>0?o(t):null}get _minDemResolutions(){const t=[];for(const{minDemResolution:e}of this._activeComputations)null!=e&&t.push(e);return t}get _updateParameters(){return this._getStableUpdateParameters()}get _generationParameters(){return this._getStableGenerationParameters()}get elevationInfo(){return this._getStableElevationInfo()}get _options(){return this._getStableOptions()}_update({stationary:t,activeComputations:e,generationParameters:o}){this._abortUpdate(),t&&(null!=o?this._updateTask=i(async t=>{this.error=null;const i=e.filter(t=>!this._isComputationValid(t,o));try{if(!o.geometryIsValid)throw new S;const e=D({...o,providers:i},{signal:t});for await(const s of e){m(t),this._clearInvalidResults(o);for(let t=0;t<i.length;t++)i[t].setResult(s[t]);for(const t of i)this._parametersPerComputation.set(t,o)}}catch(s){h(s),this._abortUpdate(),this.error=s instanceof R?s:new I,i.forEach(t=>{t.clearResult()})}}):this._clearResults())}_abortUpdate(){this._updateTask=u(this._updateTask)}_isComputationValid(t,e){return this._parametersPerComputation.has(t)&&this._parametersPerComputation.get(t)===e}_invalidateComputation(t){this._parametersPerComputation.delete(t),this._updateThrottled(this._updateParameters)}_clearInvalidResults(t){for(const e of this._computations)this._isComputationValid(e,t)||(e.clearResult(),this._parametersPerComputation.delete(e))}_clearResults(){for(const t of this._computations)t.clearResult(),this._parametersPerComputation.delete(t)}};t([C({constructOnly:!0})],O.prototype,"analysis",void 0),t([C({constructOnly:!0})],O.prototype,"analysisViewData",void 0),t([C({constructOnly:!0})],O.prototype,"computationFactory",void 0),t([C({constructOnly:!0})],O.prototype,"view",void 0),t([C()],O.prototype,"error",void 0),t([C({readOnly:!0})],O.prototype,"effectiveDisplayUnits",null),t([C()],O.prototype,"progress",null),t([C()],O.prototype,"updating",null),t([C()],O.prototype,"results",null),t([C()],O.prototype,"statistics",null),t([C()],O.prototype,"hoveredPoints",null),t([C()],O.prototype,"_queue",void 0),t([C()],O.prototype,"_tileCache",null),t([C()],O.prototype,"_computationsCollection",void 0),t([C()],O.prototype,"_computations",null),t([C()],O.prototype,"_activeComputations",null),t([C({readOnly:!0})],O.prototype,"_minDemResolution",null),t([C()],O.prototype,"_minDemResolutions",null),t([C()],O.prototype,"_updateParameters",null),t([C()],O.prototype,"_generationParameters",null),t([C()],O.prototype,"elevationInfo",null),t([C()],O.prototype,"_options",null),O=t([P("esri.views.analysis.ElevationProfile.ElevationProfileController")],O);const V=new b({...T});export{O as ElevationProfileController};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{memoize as o}from"../../../core/memoize.js";import{watch as r}from"../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as t}from"../../../core/unitUtils.js";import{property as i}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{ElevationProfileLineComputation as s}from"./ElevationProfileLineComputation.js";import{getGroundMinDemResolution as a}from"./elevationProfileQuerySourceUtils.js";let l=class extends s{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getQueryElevationDependencies=o((e,o)=>({ground:e,groundLayers:o}))}get minDemResolution(){return a(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)}initialize(){this.addHandles([r(()=>this._queryElevationDependencies,()=>this.onInvalidate(this))])}async queryElevation(e,o){const r=this._queryElevationDependencies;if(null==r)throw new Error(`${this.declaredClass}: no dependencies`);const{ground:i}=r;if(null==i)throw new Error("No ground configured in the view");const n=await i.queryElevation(e,o),s=t(e.spatialReference),a=t(i.layers.at(0).spatialReference);if(s!==a){const e=n.geometry;e.points=e.points.map(([e,r,t])=>[e,r,t===o.noDataValue?t:t*a/s])}return n}get _queryElevationDependencies(){return this._getQueryElevationDependencies(this._ground,this._ground?.layers?.toArray())}get _ground(){return this.controller.view?.map?.ground}};e([i()],l.prototype,"minDemResolution",null),e([i()],l.prototype,"available",null),e([i()],l.prototype,"_queryElevationDependencies",null),e([i()],l.prototype,"_ground",null),l=e([n("esri.views.analysis.ElevationProfile.ElevationProfileLineGroundComputation")],l);export{l as ElevationProfileLineGroundComputation};
5
+ import{__decorate as e}from"tslib";import{dedupeResult as r}from"../../../core/dedupeResult.js";import{equalsShallow as o}from"../../../core/lang.js";import{watch as t}from"../../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as i}from"../../../core/unitUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationProfileLineComputation as a}from"./ElevationProfileLineComputation.js";import{getGroundMinDemResolution as l}from"./elevationProfileQuerySourceUtils.js";let u=class extends a{constructor(){super(...arguments),this.type="ground",this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getStableQueryElevationDependencies=r(()=>({ground:this._ground,groundLayers:this._getStableGroundLayers()}),o),this._getStableGroundLayers=r(()=>this._ground?.layers?.toArray(),o)}get minDemResolution(){return l(this._ground)}get available(){return!0===this._ground?.layers.some(e=>e.visible)}initialize(){this.addHandles([t(()=>this._queryElevationDependencies,()=>this.onInvalidate(this))])}async queryElevation(e,r){const o=this._queryElevationDependencies;if(null==o)throw new Error(`${this.declaredClass}: no dependencies`);const{ground:t}=o;if(null==t)throw new Error("No ground configured in the view");const n=await t.queryElevation(e,r),s=i(e.spatialReference),a=i(t.layers.at(0).spatialReference);if(s!==a){const e=n.geometry;e.points=e.points.map(([e,o,t])=>[e,o,t===r.noDataValue?t:t*a/s])}return n}get _queryElevationDependencies(){return this._getStableQueryElevationDependencies()}get _ground(){return this.controller.view?.map?.ground}};e([n()],u.prototype,"minDemResolution",null),e([n()],u.prototype,"available",null),e([n()],u.prototype,"_queryElevationDependencies",null),e([n()],u.prototype,"_ground",null),u=e([s("esri.views.analysis.ElevationProfile.ElevationProfileLineGroundComputation")],u);export{u as ElevationProfileLineGroundComputation};