@arcgis/core 5.0.0-next.30 → 5.0.0-next.32

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 (182) hide show
  1. package/Basemap.js +1 -1
  2. package/applications/SceneViewer/sceneViewerUtils.d.ts +3 -0
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{406d270ae2b3cf9e1f1b.js → 05e55118dc0023d500fc.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{93fe46be3c7fe34b5361.js → 1432e789aa4cba627337.js} +1 -1
  7. package/assets/esri/core/workers/chunks/1dd867fa7c58c06b79ea.js +1 -0
  8. package/assets/esri/core/workers/chunks/{6e9d731cb20307b83ab0.js → 1e55f152b60145f33b61.js} +1 -1
  9. package/assets/esri/core/workers/chunks/22d66d1c8dfccdbbcf30.js +1 -0
  10. package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +1 -0
  11. package/assets/esri/core/workers/chunks/{5f2cf73fb2944f82661d.js → 433d249c35c56bf15806.js} +34 -34
  12. package/assets/esri/core/workers/chunks/444026d1938c1078ca97.js +1 -0
  13. package/assets/esri/core/workers/chunks/{a425ffec91d07bbfeb80.js → 565358ea8d1bdc4d1ebc.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{b2fbb44e219232e61cbd.js → 794960ec36e11f4416c2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{0bfb7db0a151a5e85dd1.js → 8ad6595ad44c2d60c1ce.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{11bb437437272d8f3e2c.js → 9252854b512237b6a0ef.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{e615983fab688d515205.js → 944dfa9309da8f49a616.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{f2f4e34247882eceb50d.js → a2cee5ac0d4df0108425.js} +3 -3
  19. package/assets/esri/core/workers/chunks/a4b7ba8aec109beb5b4d.js +1 -0
  20. package/assets/esri/core/workers/chunks/{d769c1b18e2710e0388b.js → a6324f5f560ffadc6e5d.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{a091623bbfb3d771c8d8.js → d8db2c51b2fb42f37b2a.js} +1 -1
  22. package/assets/esri/core/workers/chunks/da517b4b07d4d27ce94c.js +1 -0
  23. package/assets/esri/core/workers/chunks/{984bb0943d07c86b7e77.js → ded3ef385d5a3a2ec8ca.js} +1 -1
  24. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +1 -0
  25. package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +1 -0
  26. package/assets/esri/core/workers/chunks/{14dc21fe66c7b98fb456.js → f3127bdf28a1d9b8db27.js} +1 -1
  27. package/assets/esri/core/workers/chunks/fee942ef802a162e0248.js +1 -0
  28. package/assets/esri/themes/base/widgets/_Attribution.scss +8 -0
  29. package/assets/esri/themes/dark/main.css +1 -1
  30. package/assets/esri/themes/light/main.css +1 -1
  31. package/assets/esri/themes/light/view.css +1 -1
  32. package/chunks/BlendLayers.glsl.js +1 -1
  33. package/config.js +1 -1
  34. package/core/Message.js +1 -1
  35. package/core/deprecate.js +1 -1
  36. package/core/keyboard.js +5 -0
  37. package/geometry/Circle.js +1 -1
  38. package/geometry/Extent.js +1 -1
  39. package/geometry/geodesicUtils.js +5 -0
  40. package/geometry/support/geodesicUtils.js +1 -1
  41. package/interfaces.d.ts +482 -190
  42. package/kernel.js +1 -1
  43. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  44. package/layers/graphics/OptimizedGeometry.js +1 -1
  45. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  46. package/layers/knowledgeGraph/SessionMemoryStorage.js +1 -1
  47. package/layers/support/BuildingFilterBlock.js +1 -1
  48. package/package.json +2 -2
  49. package/rest/support/QueryMixin.js +1 -1
  50. package/support/revision.js +1 -1
  51. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +1 -1
  52. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementController.js +1 -1
  53. package/views/2d/engine/vectorTiles/decluttering/SymbolRepository.js +1 -1
  54. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  55. package/views/2d/grid/gridUtils.js +1 -1
  56. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  57. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  58. package/views/2d/layers/MediaLayerView2D.js +1 -1
  59. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  60. package/views/2d/layers/StreamLayerView2D.js +1 -1
  61. package/views/3d/GroundView3D.js +1 -1
  62. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  63. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  64. package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
  65. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  66. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  67. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  68. package/views/3d/layers/I3SMeshView3D.js +1 -1
  69. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  70. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  71. package/views/3d/layers/MediaLayerView3D.js +1 -1
  72. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  73. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  74. package/views/3d/layers/StreamLayerView3D.js +1 -1
  75. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  76. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  77. package/views/3d/layers/graphics/LabelDeconflictor.js +1 -1
  78. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  79. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  80. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  81. package/views/3d/support/Attribution3D.js +5 -0
  82. package/views/3d/terrain/TileBlendTechniqueConfiguration.js +1 -1
  83. package/views/3d/terrain/TileCompositor.js +1 -1
  84. package/views/3d/terrain/TileRenderer.js +1 -1
  85. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  86. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  87. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  88. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  89. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  90. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +6 -6
  91. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +4 -4
  92. package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
  93. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  94. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  95. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  96. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  97. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  98. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  99. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  100. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  101. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  103. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  104. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  105. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  106. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
  107. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +4 -4
  108. package/views/Attribution.js +5 -0
  109. package/views/DOMContainer.js +1 -1
  110. package/views/SceneView.js +1 -1
  111. package/views/View.js +1 -1
  112. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  113. package/views/draw/support/managers/DrawTooltipManager.js +5 -0
  114. package/views/interactive/sketch/constraintUtils.js +1 -1
  115. package/views/interactive/sketch/constraints.js +1 -1
  116. package/views/interactive/tooltip/content/TooltipContentDynamic.js +5 -0
  117. package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
  118. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  119. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +5 -0
  120. package/views/layers/DimensionLayerView.js +1 -1
  121. package/views/layers/DimensionLayerViewMixin.js +5 -0
  122. package/views/layers/FeatureLayerView.js +1 -1
  123. package/views/layers/FeatureLayerViewMixin.d.ts +2 -2
  124. package/views/layers/FeatureLayerViewMixin.js +5 -0
  125. package/views/layers/ImageryLayerView.js +1 -1
  126. package/views/layers/ImageryLayerViewMixin.js +5 -0
  127. package/views/layers/LayerView.js +1 -1
  128. package/views/layers/LineOfSightLayerView.js +1 -1
  129. package/views/layers/LineOfSightLayerViewMixin.js +5 -0
  130. package/views/layers/MediaLayerView.js +1 -1
  131. package/views/layers/MediaLayerViewMixin.js +5 -0
  132. package/views/layers/OGCFeatureLayerView.js +1 -1
  133. package/views/layers/PointCloudLayerView.js +1 -1
  134. package/views/layers/StreamLayerView.js +1 -1
  135. package/views/layers/ViewshedLayerView.js +1 -1
  136. package/views/layers/ViewshedLayerViewMixin.js +5 -0
  137. package/views/support/AttributionItem.d.ts +4 -0
  138. package/views/support/AttributionItem.js +5 -0
  139. package/views/support/LayerLayerViewInfo.js +1 -1
  140. package/views/support/LayerViewManager.js +1 -1
  141. package/views/support/PromiseQueue.js +1 -1
  142. package/views/support/angularMeasurementUtils.js +1 -1
  143. package/views/support/attributionUtils.js +5 -0
  144. package/views/support/drapedUtils.js +1 -1
  145. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  146. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  147. package/views/support/geodesicMeasurementUtils.js +1 -1
  148. package/views/ui/2d/DefaultUI2D.js +1 -1
  149. package/views/ui/3d/DefaultUI3D.js +1 -1
  150. package/webscene/Environment.js +1 -1
  151. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  152. package/widgets/Attribution/AttributionViewModel.js +1 -1
  153. package/widgets/Attribution.js +1 -1
  154. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  155. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  156. package/widgets/ElevationProfile/ElevationProfileLine.js +1 -1
  157. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  158. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  159. package/widgets/ElevationProfile.js +1 -1
  160. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  161. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  162. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  163. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  164. package/widgets/Popup.js +1 -1
  165. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  166. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  167. package/widgets/Widget.js +1 -1
  168. package/widgets/support/decorators/accessibleHandler.js +1 -1
  169. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  170. package/widgets/support/jsxWidgetSupport.js +1 -1
  171. package/widgets/support/widget.js +1 -1
  172. package/widgets/support/widgetUtils.js +1 -1
  173. package/assets/esri/core/workers/chunks/25143b919e75d5d2da05.js +0 -1
  174. package/assets/esri/core/workers/chunks/2d17ed5321ca05acb8e3.js +0 -1
  175. package/assets/esri/core/workers/chunks/447b53a9280b2b19b7a6.js +0 -1
  176. package/assets/esri/core/workers/chunks/6ce7ca6bebdc61d8eada.js +0 -1
  177. package/assets/esri/core/workers/chunks/8fbda0b85731ac77e1d8.js +0 -1
  178. package/assets/esri/core/workers/chunks/98c32d10a2344cd7a50b.js +0 -1
  179. package/assets/esri/core/workers/chunks/b66e41d626a7d1b81d48.js +0 -1
  180. package/assets/esri/core/workers/chunks/d5b464ff83ce29b51968.js +0 -1
  181. package/assets/esri/core/workers/chunks/d777d7cb8df3f21ac97e.js +0 -1
  182. package/layers/support/attributionUtils.js +0 -5
@@ -1,4 +1,4 @@
1
1
  import "../../interfaces";
2
2
 
3
- type FeatureLayerViewMixin = __esri.FeatureLayerViewMixin;
4
- export default FeatureLayerViewMixin;
3
+ import FeatureLayerViewMixin = __esri.FeatureLayerViewMixin;
4
+ export { FeatureLayerViewMixin };
@@ -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{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as n,sqlIn as o,sqlAnd as a}from"../../core/sql.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{getPopupProvider as p}from"../../graphic/getPopupProvider.js";import{getFeatureIdInfoFieldNames as f}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as y}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as h}from"../../layers/support/displayFilterUtils.js";import m from"../../layers/support/FeatureEffect.js";import c from"../../layers/support/FeatureFilter.js";import{getSignedInUser as F}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as g,loadFeaturePopupArcadeModules as I}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as w,unpackFieldNames as b,collectLabelingFields as v,collectElevationFields as E,collectFilterFields as x,collectFeatureReductionFields as q,collectOrderByInfos as R,collectFields as j,collectTrackInfoFields as _,collectDisplayFilterFields as C,collectField as O,featureHasFields as k}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as P}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as U}from"../../networks/support/networkFieldUtils.js";import L from"../../rest/support/Query.js";import{createFeatureIdInfo as S}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getFetchPopupTemplate as T,getRequiredFields as D}from"./support/popupUtils.js";import{WhereClauseVisitor as N}from"./support/WhereClauseVisitor.js";const Q=Q=>{const A=Q;let G=class extends A{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&U(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?w(t,[...b(t,e.outFields),...i]):w(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?h(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?n(e,o(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?F(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new L(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,P(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new L(e)}queryAggregates(e,t){throw new Error("missing implementation")}queryAttributeBins(e,t){throw new Error("missing implementation")}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=[],r=new Set;for(const s of e){const e=p(s.origin),l=T(e,{...t,checkPopupEnabled:!0});l&&(i.push(s),r.add(l))}if(0===i.length||0===r.size)return[];const l=await this._createPopupQuery(r,t);return await g(this.layer,i,l,{hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new N(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,n="featureReduction"in i?i.featureReduction:null,o=new Set,a=[l?l.collectRequiredFields(o,r):null,v(o,i),e&&"elevationInfo"in i?E(o,i):null,null!=this.filter?x(o,i,this.filter):null,e||null==this.featureEffect?null:x(o,i,this.featureEffect.filter),!e&&n?q(o,i,n):null,!e&&s?R(o,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&j(o,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;j(o,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||j(o,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&j(o,i.fieldsIndex,[i.timeInfo.endField]),await _(o,i)}if("floorInfo"in i&&i.floorInfo&&j(o,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&j(o,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&j(o,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(C(o,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),j(o,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){O(o,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(o,r),v(o,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;j(o,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&O(o,r,y);const u=await Promise.allSettled(a);if(e)O(o,r,i.objectIdField);else for(const t of f(S(i)))O(o,r,t);e&&"displayField"in i&&i.displayField&&O(o,r,i.displayField);for(const p of u)"rejected"===p.status&&t.getLogger(this).error(p.reason);const d=Array.from(o).sort();this._set("requiredFields",d)}_popupFeatureHasRequiredFields(e,t){return k(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s="point"===this.layer.geometryType;for(const n of e){if(!s){const e=await I(n);i(t),s=(e&&e.arcadeUtils.hasGeometryOperations(n))??!1}const e=await D(this.layer,n);i(t);for(const t of e)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,P(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],G.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],G.prototype,"availableFields",null),e([u({readOnly:!0})],G.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],G.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],G.prototype,"effectiveDisplayFilterClause",null),e([u({type:m})],G.prototype,"featureEffect",null),e([u({type:c})],G.prototype,"filter",void 0),e([u()],G.prototype,"layer",void 0),e([u({type:Number})],G.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],G.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],G.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],G.prototype,"requiredFields",void 0),e([u({readOnly:!0})],G.prototype,"signedInUser",null),e([u()],G.prototype,"suspended",void 0),e([u()],G.prototype,"view",void 0),G=e([d("esri.views.layers.FeatureLayerViewMixin")],G),G};export{Q as FeatureLayerViewMixin};
@@ -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/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import i from"../../geometry/Point.js";import a from"../../layers/support/FieldsIndex.js";import{rasterFieldPrefix as p}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as n}from"../../layers/support/timeSupport.js";import{load as l,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import u from"../../rest/support/Query.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const y=y=>{const d=y;let f=class extends d{constructor(...e){super(...e),this.view=null}get timeExtent(){return n(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,s){const{layer:o}=this;if(!e)throw new t("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:o});const{popupEnabled:n}=o,l=c(o,s);if(!n||null==l)return[];const m=await l.getRequiredFields(null,{index:new a(o.rasterFields),partitions:new Map([["$pixel",o.rasterFields.filter(e=>e.name.startsWith(p)).map(e=>e.name)],["$imageCollectionItem",o.fields.map(e=>e.name)]])});r(s);const y=new u;y.timeExtent=this.timeExtent,y.geometry=e,y.outFields=m,y.outSpatialReference=e.spatialReference;const{resolution:d,spatialReference:f}=this.view,w="2d"===this.view.type?new i(d,d,f):new i(.5*d,.5*d,f),{returnTopmostRaster:h,showNoDataRecords:R}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},x={returnDomainValues:!0,returnTopmostRaster:h,pixelSize:w,showNoDataRecords:R,signal:s?.signal};return o.queryVisibleRasters(y,x)}async getSourceScale(){return await l(),await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"suspended",void 0),e([s({readOnly:!0})],f.prototype,"timeExtent",null),e([s()],f.prototype,"view",void 0),f=e([o("esri.views.layers.ImageryLayerView")],f),f};export{y as default};
5
+ import{ImageryLayerViewMixin as e}from"./ImageryLayerViewMixin.js";import r from"./LayerView.js";class a extends(e(r)){}export{a as default};
@@ -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{__decorate as e}from"tslib";import t from"../../core/Error.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import i from"../../geometry/Point.js";import a from"../../layers/support/FieldsIndex.js";import{rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as p}from"../../layers/support/timeSupport.js";import{load as l,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import u from"../../rest/support/Query.js";import{getFetchPopupTemplate as c}from"./support/popupUtils.js";const y=y=>{const d=y;let f=class extends d{constructor(...e){super(...e),this.view=null}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(e,s){const{layer:o}=this;if(!e)throw new t("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:o});const{popupEnabled:p}=o,l=c(o,s);if(!p||null==l)return[];const m=await l.getRequiredFields(null,{index:new a(o.rasterFields),partitions:new Map([["$pixel",o.rasterFields.filter(e=>e.name.startsWith(n)).map(e=>e.name)],["$imageCollectionItem",o.fields.map(e=>e.name)]])});r(s);const y=new u;y.timeExtent=this.timeExtent,y.geometry=e,y.outFields=m,y.outSpatialReference=e.spatialReference;const{resolution:d,spatialReference:f}=this.view,w="2d"===this.view.type?new i(d,d,f):new i(.5*d,.5*d,f),{returnTopmostRaster:h,showNoDataRecords:R}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},x={returnDomainValues:!0,returnTopmostRaster:h,pixelSize:w,showNoDataRecords:R,signal:s?.signal};return o.queryVisibleRasters(y,x)}async getSourceScale(){return await l(),await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return e([s()],f.prototype,"layer",void 0),e([s()],f.prototype,"suspended",void 0),e([s({readOnly:!0})],f.prototype,"timeExtent",null),e([s()],f.prototype,"view",void 0),f=e([o("esri.views.layers.ImageryLayerViewMixin")],f),f};export{y as ImageryLayerViewMixin};
@@ -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{EventedAccessor as t}from"../../core/Evented.js";import{IdentifiableMixin as i}from"../../core/Identifiable.js";import r from"../../core/Logger.js";import{destroyMaybe as s}from"../../core/maybe.js";import{EsriPromiseMixin as n}from"../../core/Promise.js";import{property as l,subclass as a}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as o}from"../../core/support/UpdatingHandles.js";import{validateScaleRange as p}from"../support/layerViewUtils.js";let d=class extends(i(n(t))){get spatialReferenceSupported(){return!0}constructor(e){super(e),this._updatingHandles=new o,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if("layerview:create-error"!==e.name){const t=this.layer&&this.layer.id||"no id",i=this.layer?.title||"no title";r.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${t}')`,e)}})}destroy(){this._updatingHandles=s(this._updatingHandles),this._set("parent",null)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return!0===this.layer?.visible}set visible(e){this._overrideIfSome("visible",e)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const e=this.view.timeExtent,t=this.layer?.visibilityTimeExtent;return!e||!t||!e.intersection(t).isEmpty}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&p(e)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const e=this.parent?.suspended?this.parent.suspendInfo:{},t=this;t.view?.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0);const i=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return p(i)&&this.visibleAtCurrentScale||(e.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(e.outsideVisibilityTimeExtent=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};e([l({readOnly:!0})],d.prototype,"spatialReferenceSupported",null),e([l()],d.prototype,"view",void 0),e([l()],d.prototype,"fullOpacity",null),e([l()],d.prototype,"layer",void 0),e([l()],d.prototype,"parent",void 0),e([l({readOnly:!0})],d.prototype,"suspended",null),e([l({readOnly:!0})],d.prototype,"suspendInfo",null),e([l({readOnly:!0})],d.prototype,"legendEnabled",null),e([l({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([l({readOnly:!0})],d.prototype,"updatingProgress",null),e([l()],d.prototype,"updateSuspended",null),e([l()],d.prototype,"visible",null),e([l({readOnly:!0})],d.prototype,"visibleAtCurrentScale",null),e([l({readOnly:!0})],d.prototype,"visibleAtCurrentTimeExtent",null),d=e([a("esri.views.layers.LayerView")],d);export{d as default};
5
+ import{__decorate as t}from"tslib";import{createTask as e}from"../../core/asyncUtils.js";import{EventedAccessor as i}from"../../core/Evented.js";import{IdentifiableMixin as r}from"../../core/Identifiable.js";import s from"../../core/Logger.js";import{destroyMaybe as n,removeMaybe as a}from"../../core/maybe.js";import{EsriPromiseMixin as l}from"../../core/Promise.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{property as u,subclass as p}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as d}from"../../core/support/UpdatingHandles.js";import{getAttributionItemFromUserCopyright as h,isDynamicAttributionLayer as y,createAttributionIndex as c,getAttributionItemsFromIndex as g,getAttributionItemFromAccessInformation as m,getAttributionItemFromLayerCopyright as b}from"../support/attributionUtils.js";import{validateScaleRange as f}from"../support/layerViewUtils.js";let v=class extends(r(l(i))){get spatialReferenceSupported(){return!0}constructor(t){super(t),this._updatingHandles=new d,this._attributionIndexTask=null,this.layer=null,this.parent=null}initialize(){this.when().catch(t=>{if("layerview:create-error"!==t.name){const e=this.layer&&this.layer.id||"no id",i=this.layer?.title||"no title";s.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${e}')`,t)}})}destroy(){this._updatingHandles=n(this._updatingHandles),this._attributionIndexTask=a(this._attributionIndexTask),this._set("parent",null)}get attributionItems(){const t=this._get("attributionItems")??[];if(this.suspended||!this.layer?.attributionVisible)return 0===t.length?t:[];if(!this.view.stationary)return t;const e=this.getAttributionItems();return t?.length!==e.length||t?.some((t,i)=>t.text!==e[i].text)?e:t}get attributionUpdating(){return!!this._attributionIndexTask&&!this._attributionIndexTask.finished}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&!0===this.layer?.legendEnabled}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return!0===this.layer?.visible}set visible(t){this._overrideIfSome("visible",t)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const t=this.view.timeExtent,e=this.layer?.visibilityTimeExtent;return!t||!e||!t.intersection(e).isEmpty}canResume(){const t=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&f(t)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const t=this.parent?.suspended?this.parent.suspendInfo:{},e=this;e.view?.ready||(t.viewNotReady=!0),this.layer&&this.layer.loaded||(t.layerNotLoaded=!0);const i=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return f(i)&&this.visibleAtCurrentScale||(t.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(t.outsideVisibilityTimeExtent=!0),this.visible||(t.layerInvisible=!0),t}isUpdating(){return!1}getAttributionItems(){const t=h(this.layer);if(t)return[t];if(y(this.layer)&&(this._attributionIndexTask||(this._attributionIndexTask=e(async t=>{const e=await this.layer.fetchAttributionData();return o(t),c(e)}),this._updatingHandles.addPromise(this._attributionIndexTask.promise)),this._attributionIndexTask?.finished&&this._attributionIndexTask.value))return g(this._attributionIndexTask.value,this.layer.tileInfo,this.view.scale,this.view.extent);const i=m(this.layer);if(i)return[i];const r=b(this.layer);return r?[r]:[]}};t([u({readOnly:!0})],v.prototype,"spatialReferenceSupported",null),t([u()],v.prototype,"view",void 0),t([u({readOnly:!0})],v.prototype,"attributionItems",null),t([u({readOnly:!0})],v.prototype,"attributionUpdating",null),t([u()],v.prototype,"fullOpacity",null),t([u()],v.prototype,"layer",void 0),t([u()],v.prototype,"parent",void 0),t([u({readOnly:!0})],v.prototype,"suspended",null),t([u({readOnly:!0})],v.prototype,"suspendInfo",null),t([u({readOnly:!0})],v.prototype,"legendEnabled",null),t([u({type:Boolean,readOnly:!0})],v.prototype,"updating",null),t([u({readOnly:!0})],v.prototype,"updatingProgress",null),t([u()],v.prototype,"updateSuspended",null),t([u()],v.prototype,"visible",null),t([u({readOnly:!0})],v.prototype,"visibleAtCurrentScale",null),t([u({readOnly:!0})],v.prototype,"visibleAtCurrentTimeExtent",null),v=t([p("esri.views.layers.LayerView")],v);export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{createAbortError as r}from"../../core/promiseUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";const l=l=>{const o=l;let a=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new t}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw r()}};return e([s()],a.prototype,"layer",void 0),e([s()],a.prototype,"interactive",null),e([s({readOnly:!0})],a.prototype,"results",null),a=e([i("esri.views.layers.LineOfSightLayerView")],a),a};export{l as default};
5
+ import e from"./LayerView.js";import{LineOfSightLayerViewMixin as i}from"./LineOfSightLayerViewMixin.js";class r extends(i(e)){}export{r as default};
@@ -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{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{createAbortError as i}from"../../core/promiseUtils.js";import{property as r,subclass as s}from"../../core/accessorSupport/decorators.js";const l=l=>{const o=l;let n=class extends o{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView?.interactive??!1}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get results(){return this.analysisView?.results??new t}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw i()}};return e([r()],n.prototype,"layer",void 0),e([r()],n.prototype,"interactive",null),e([r({readOnly:!0})],n.prototype,"results",null),n=e([s("esri.views.layers.LineOfSightLayerViewMixin")],n),n};export{l as LineOfSightLayerViewMixin};
@@ -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{property as e,subclass as o}from"../../core/accessorSupport/decorators.js";import{MediaLayerInteractionOptions as r}from"../3d/layers/support/MediaLayerInteractionOptions.js";const i=i=>{const s=i;let n=class extends s{constructor(...t){super(...t),this.layer=null,this.interactive=!1,this.interactionOptions=new r,this.selectedElement=null}highlight(t,e){throw new Error("missing implementation")}};return t([e()],n.prototype,"layer",void 0),t([e()],n.prototype,"interactive",void 0),t([e({type:r})],n.prototype,"interactionOptions",void 0),t([e()],n.prototype,"selectedElement",void 0),n=t([o("esri.views.layers.MediaLayerView")],n),n};export{i as default};
5
+ import e from"./LayerView.js";import{MediaLayerViewMixin as i}from"./MediaLayerViewMixin.js";class r extends(i(e)){}export{r as default};
@@ -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{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../core/accessorSupport/decorators.js";import{MediaLayerInteractionOptions as r}from"../3d/layers/support/MediaLayerInteractionOptions.js";const i=i=>{const s=i;let n=class extends s{constructor(...t){super(...t),this.layer=null,this.interactive=!1,this.interactionOptions=new r,this.selectedElement=null}highlight(t,e){throw new Error("missing implementation")}};return t([e()],n.prototype,"layer",void 0),t([e()],n.prototype,"interactive",void 0),t([e({type:r})],n.prototype,"interactionOptions",void 0),t([e()],n.prototype,"selectedElement",void 0),n=t([o("esri.views.layers.MediaLayerViewMixin")],n),n};export{i as MediaLayerViewMixin};
@@ -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{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";const s=s=>{const a=s;let l=class extends a{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return e([r()],l.prototype,"layer",void 0),e([r({readOnly:!0})],l.prototype,"availableFields",null),l=e([t("esri.views.layers.OGCFeatureLayerView")],l),l};export{s as OGCFeatureLayerView};
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"./LayerView.js";const s=o=>{const s=o;let a=class extends s{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return e([r()],a.prototype,"layer",void 0),e([r({readOnly:!0})],a.prototype,"availableFields",null),a=e([t("esri.views.layers.OGCFeatureLayerView")],a),a},a=s(o);export{a as OGCFeatureLayerView,s as OGCFeatureLayerViewMixin};
@@ -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{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";const o=o=>{const l=o;let n=class extends l{constructor(...e){super(...e),this.layer=null}get availableFields(){return[]}highlight(e,r){throw new Error("Not implemented")}queryFeatures(){throw new Error("Not implemented")}queryFeatureCount(){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(){throw new Error("Not implemented")}};return e([r()],n.prototype,"layer",void 0),e([r()],n.prototype,"availableFields",null),n=e([t("esri.views.layers.PointCloudLayerView")],n),n};export{o as PointCloudLayerView};
5
+ import{__decorate as e}from"tslib";import{property as r,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"./LayerView.js";const l=o=>{const l=o;let i=class extends l{constructor(...e){super(...e),this.layer=null}get availableFields(){return[]}highlight(e,r){throw new Error("Not implemented")}queryFeatures(){throw new Error("Not implemented")}queryFeatureCount(){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(){throw new Error("Not implemented")}};return e([r()],i.prototype,"layer",void 0),e([r()],i.prototype,"availableFields",null),i=e([t("esri.views.layers.PointCloudLayerView")],i),i},i=l(o);export{i as PointCloudLayerView,l as PointCloudLayerViewMixin};
@@ -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 s}from"tslib";import{property as e,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"../../layers/support/FeatureFilter.js";const r=r=>{const i=r;let n=class extends i{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...s){super(...s),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&"connected"===this._streamConnectionStatus?"paused":this._streamConnectionStatus}_onSuspendedChange(s){s?this._doPause():this._isUserPaused||this._doResume()}};return s([e()],n.prototype,"_isUserPaused",void 0),s([e({readOnly:!0})],n.prototype,"connectionStatus",null),s([e({type:o})],n.prototype,"filter",void 0),n=s([t("esri.views.layers.StreamLayerView")],n),n};export{r as StreamLayerView};
5
+ import{__decorate as s}from"tslib";import{property as e,subclass as t}from"../../core/accessorSupport/decorators.js";import o from"../../layers/support/FeatureFilter.js";import r from"./LayerView.js";const i=r=>{const i=r;let n=class extends i{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...s){super(...s),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&"connected"===this._streamConnectionStatus?"paused":this._streamConnectionStatus}_onSuspendedChange(s){s?this._doPause():this._isUserPaused||this._doResume()}};return s([e()],n.prototype,"_isUserPaused",void 0),s([e({readOnly:!0})],n.prototype,"connectionStatus",null),s([e({type:o})],n.prototype,"filter",void 0),n=s([t("esri.views.layers.StreamLayerView")],n),n},n=i(r);export{n as StreamLayerView,i as StreamLayerViewMixin};
@@ -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{createAbortError as s}from"../../core/promiseUtils.js";import{property as i,subclass as t}from"../../core/accessorSupport/decorators.js";const l=l=>{const a=l;let r=class extends a{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([i()],r.prototype,"layer",void 0),e([i()],r.prototype,"interactive",null),e([i()],r.prototype,"selectedViewshed",null),r=e([t("esri.views.layers.ViewshedLayerView")],r),r};export{l as default};
5
+ import e from"./LayerView.js";import{ViewshedLayerViewMixin as i}from"./ViewshedLayerViewMixin.js";class r extends(i(e)){}export{r as default};
@@ -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{__decorate as e}from"tslib";import{createAbortError as s}from"../../core/promiseUtils.js";import{property as i,subclass as t}from"../../core/accessorSupport/decorators.js";const l=l=>{const a=l;let r=class extends a{constructor(...e){super(...e),this.layer=null}get interactive(){return null!=this.analysisView&&this.analysisView.interactive}set interactive(e){null!=this.analysisView&&(this.analysisView.interactive=e)}get selectedViewshed(){return null!=this.analysisView?this.analysisView.selectedViewshed:null}set selectedViewshed(e){null!=this.analysisView&&(this.analysisView.selectedViewshed=e)}async createViewsheds(e){await(this.analysisView?.createViewsheds(e))}place(e){if(null!=this.analysisView)return this.analysisView.place(e);throw s()}};return e([i()],r.prototype,"layer",void 0),e([i()],r.prototype,"interactive",null),e([i()],r.prototype,"selectedViewshed",null),r=e([t("esri.views.layers.ViewshedLayerViewMixin")],r),r};export{l as ViewshedLayerViewMixin};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import AttributionItem = __esri.AttributionItem;
4
+ export default AttributionItem;
@@ -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
+ class t{constructor(t,s){this.text=t,this.score=s}}export{t as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{createResolver as t,onAbort as i,throwIfAborted as l}from"../../core/promiseUtils.js";import a from"../../layers/Layer.js";function s(e){return"tryRecycleWith"in e}class o{constructor(r,l,a){this.layer=r,this.view=l,this.layerViewImporter=a,this._controller=new AbortController,this._started=!1,this.done=!1,this._deferred=t(),this.promise=this._deferred.promise,i(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred?.reject(t)})}tryRecycle(e){if(!this.done||!this.layerView||!s(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let i=0;i<e.length;i++){const a=e[i];if(a.type!==r)continue;const s=this.layerView.tryRecycleWith(a,{signal:t});if(s){e.splice(i,1),this.layer=a;const r=this.layerView,o=r.view;return this.promise=s.then(()=>(l(t),a.emit("layerview-destroy",{view:o,layerView:r}),o.emit("layerview-destroy",{view:o,layerView:r}),a.emit("layerview-create",{view:o,layerView:r}),o.emit("layerview-create",{view:o,layerView:r}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:t}=this;if(this._started||!t.map)return;this._started=!0;const{_controller:{signal:a},layer:s}=this;this._map=t.map;try{let n,w;if(await s.load({signal:a}),s.prefetchResources&&await s.prefetchResources({signal:a}),y(s))n=await s.createLayerView(t,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(s))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(s);l(a),n="default"in r?new r.default({layer:s,view:t}):new r({layer:s,view:t})}const c=()=>{w=r(w),n.destroyed||n.destroy(),this.done=!0};w=i(a,c),l(a);try{await n.when()}catch(o){throw c(),o}const h=this._map?.allLayers?.includes(s);if(!h)return c(),void this._deferred?.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:s}));this.layerView=n,s.emit("layerview-create",{view:t,layerView:n}),t.emit("layerview-create",{layer:s,layerView:n}),this.done=!0,this._deferred?.resolve(n)}catch(o){s.emit("layerview-create-error",{view:t,error:o}),t.emit("layerview-create-error",{layer:s,error:o}),this.done=!0,this._deferred?.reject(new e("layerview:create-error","layerview creation failed",{layer:s,error:o}))}}}function y(e){return e.createLayerView!==a.prototype.createLayerView}export{o as LayerLayerViewInfo};
5
+ import e from"../../core/Error.js";import{removeMaybe as r}from"../../core/maybe.js";import{createResolver as t,onAbort as i,throwIfAborted as l}from"../../core/promiseUtils.js";import a from"../../layers/Layer.js";function o(e){return"tryRecycleWith"in e}class s{constructor(r,l,a){this.layer=r,this.view=l,this.layerViewImporter=a,this._controller=new AbortController,this._started=!1,this.done=!1,this._deferred=t(),this.promise=this._deferred.promise,i(this._controller.signal,()=>{this._recycleController?.abort();const t=new e("cancelled:layerview-create","layerview creation cancelled",{layer:r});this._deferred?.reject(t)})}tryRecycle(e){if(!this.done||!this.layerView||!o(this.layerView))return null;this._recycleController?.abort(),this._recycleController=new AbortController;const r=this.layer.type,t=this._recycleController.signal;for(let i=0;i<e.length;i++){const a=e[i];if(a.type!==r)continue;const o=this.layerView.tryRecycleWith(a,{signal:t});if(o){e.splice(i,1),this.layer=a;const r=this.layerView,s=r.view;return this.promise=o.then(()=>(l(t),a.emit("layerview-destroy",{view:s,layerView:r}),s.emit("layerview-destroy",{view:s,layerView:r,layer:void 0}),a.emit("layerview-create",{view:s,layerView:r}),s.emit("layerview-create",{view:s,layerView:r,layer:void 0}),r)),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null,this.promise=null,this._deferred=null}async start(){const{view:t}=this;if(this._started||!t.map)return;this._started=!0;const{_controller:{signal:a},layer:o}=this;this._map=t.map;try{let n,w;if(await o.load({signal:a}),o.prefetchResources&&await o.prefetchResources({signal:a}),y(o))n=await o.createLayerView(t,{signal:a});else{if(!this.layerViewImporter.hasLayerViewModule(o))throw new e("layer:view-not-supported","No layerview implementation was found");const r=await this.layerViewImporter.importLayerView(o);l(a),n="default"in r?new r.default({layer:o,view:t}):new r({layer:o,view:t})}const c=()=>{w=r(w),n.destroyed||n.destroy(),this.done=!0};w=i(a,c),l(a);try{await n.when()}catch(s){throw c(),s}const h=this._map?.allLayers?.includes(o);if(!h)return c(),void this._deferred?.reject(new e("view:no-layerview-for-layer","The layer has been removed from the map",{layer:o}));this.layerView=n,o.emit("layerview-create",{view:t,layerView:n}),t.emit("layerview-create",{layer:o,layerView:n}),this.done=!0,this._deferred?.resolve(n)}catch(s){o.emit("layerview-create-error",{view:t,error:s}),t.emit("layerview-create-error",{layer:o,error:s}),this.done=!0,this._deferred?.reject(new e("layerview:create-error","layerview creation failed",{layer:o,error:s}))}}}function y(e){return e.createLayerView!==a.prototype.createLayerView}export{s as LayerLayerViewInfo};
@@ -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 t from"../../core/Error.js";import i from"../../core/Logger.js";import{someMap as o}from"../../core/MapUtils.js";import{createResolver as s,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as p}from"../../core/scheduling.js";import{property as c,subclass as d}from"../../core/accessorSupport/decorators.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as u}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as m}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new f,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=s(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(p(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,t=[],i=this.view.ready,o=e=>{if(null!=e)for(const s of e)if(s){if(!1===this.layerViewFilter?.(s))continue;r.add(s);const e=this._layerLayerViewInfoMap.get(s);e&&i?e.start():e||this._recyclingInfoMap.has(s)||t.push(s),"layers"in s&&s.layers&&o(s.layers)}};for(const n of this._rootCollectionNames)o(w(this,n));const s=new Array,a=e=>{const r=e.tryRecycle(t);r?(this._recyclingInfoMap.set(e.layer,e),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.delete(e.layer),this._layerLayerViewInfoMap.set(e.layer,e),this._reschedule(),this.notifyChange("updating")}).catch(r=>{n(r)||(this._recyclingInfoMap.delete(e.layer),e.destroy(),this._reschedule(),this.notifyChange("updating"))})):s.push(e)};for(const n of this._layerLayerViewInfoMap.values())r.has(n.layer)||(this._layerLayerViewInfoMap.delete(n.layer),a(n));for(const n of this._recyclingInfoMap.values())r.has(n.layer)||(this._recyclingInfoMap.delete(n.layer),a(n));for(const n of t)this._createLayerView(n);this._refreshCollections(),s.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null},this._layersToLayerViews=new Map(e.layerviewMapping)}initialize(){this.addHandles([l(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),y(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule(),h)]),this._preloadLayerViewModules(),this._reschedule()}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),u(this._recyclingInfoMap),u(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(a()),this._workPromise=null)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||o(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),u(this._layerLayerViewInfoMap))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new t("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const t=this._layerLayerViewInfoMap.get(e);if(!t?.done)return!0;const i=t.layerView;return!(!i||!r||i.parent===r)||!!(t.done&&i&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,i))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,t){if(!e||!r)return void r?.removeAll();let i=0;for(const o of e){const e=this._layerLayerViewInfoMap.get(o);if(!e?.layerView)continue;const{layerView:s}=e;s.layer=o,s.parent=t,r.at(i)!==s&&r.splice(i,0,s),"layers"in o&&g(s)&&this._populateLayerViewsOwners(o.layers,s.layerViews,s),++i}i<r.length&&r.splice(i)}_createLayerView(e){e.load().catch(()=>{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new m(e,this.view,this.layerViewImporter);r.promise?.then(()=>this._refreshCollections(),r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||i.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this.destroyed||this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([c()],_.prototype,"_workPromise",void 0),e([c({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([c({readOnly:!0})],_.prototype,"_layersToLayerViews",void 0),e([c({constructOnly:!0})],_.prototype,"layerviewMapping",void 0),e([c({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([c({constructOnly:!0})],_.prototype,"layerViewFilter",void 0),e([c()],_.prototype,"layerViewImporter",void 0),e([c()],_.prototype,"supportsGround",void 0),e([c({readOnly:!0})],_.prototype,"updating",null),e([c({readOnly:!0})],_.prototype,"updatingRemaining",null),e([c({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
5
+ import{__decorate as e}from"tslib";import r from"../../core/Accessor.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{someMap as o}from"../../core/MapUtils.js";import{createResolver as s,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as y,syncAndInitial as h}from"../../core/reactiveUtils.js";import{schedule as c}from"../../core/scheduling.js";import{property as p,subclass as d}from"../../core/accessorSupport/decorators.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as u}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as m}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new f,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)!1!==this.layerViewFilter?.(r)&&this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=s(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(c(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const{map:e}=this.view;if(!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,t=[],i=this.view.ready,o=e=>{if(null!=e)for(const s of e)if(s){if(!1===this.layerViewFilter?.(s))continue;r.add(s);const e=this._layerLayerViewInfoMap.get(s);e&&i?e.start():e||this._recyclingInfoMap.has(s)||t.push(s),"layers"in s&&s.layers&&o(s.layers)}};for(const n of this._rootCollectionNames)o(w(this,n));const s=new Array,a=e=>{const r=e.tryRecycle(t);r?(this._recyclingInfoMap.set(e.layer,e),this.notifyChange("updating"),r.then(()=>{this._recyclingInfoMap.delete(e.layer),this._layerLayerViewInfoMap.set(e.layer,e),this._reschedule(),this.notifyChange("updating")}).catch(r=>{n(r)||(this._recyclingInfoMap.delete(e.layer),e.destroy(),this._reschedule(),this.notifyChange("updating"))})):s.push(e)};for(const n of this._layerLayerViewInfoMap.values())r.has(n.layer)||(this._layerLayerViewInfoMap.delete(n.layer),a(n));for(const n of this._recyclingInfoMap.values())r.has(n.layer)||(this._recyclingInfoMap.delete(n.layer),a(n));for(const n of t)this._createLayerView(n);this._refreshCollections(),s.forEach(e=>e.destroy());const l=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.groundLayers,e?.basemap?.referenceLayers,e?.layers].filter(e=>!!e);r.forEach(e=>"layers"in e&&l.push(e.layers)),this.addHandles(l.map(e=>this._watchUpdatingTracking.addOnCollectionChange(()=>e,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null},this._layersToLayerViews=new Map(e.layerviewMapping)}initialize(){this.addHandles([l(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),y(()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]},()=>this._reschedule(),h)]),this._preloadLayerViewModules(),this._reschedule()}clearHandles(){this._watchUpdatingTracking.removeAll()}destroy(){this.clear(),u(this._recyclingInfoMap),u(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(a()),this._workPromise=null)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||o(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),u(this._layerLayerViewInfoMap),u(this._recyclingInfoMap))}async whenLayerView(e){await this._reschedule();const r=this._layerLayerViewInfoMap.get(e)?.promise;if(!r){const r=this._recyclingInfoMap.get(e)?.promise;if(!r)throw new t("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return r}return r}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const t=this._layerLayerViewInfoMap.get(e);if(!t?.done)return!0;const i=t.layerView;return!(!i||!r||i.parent===r)||!!(t.done&&i&&"layers"in e&&e.layers?.length)&&e.layers.some(e=>this.isCreatingLayerViewsForLayer(e,i))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,t){if(!e||!r)return void r?.removeAll();let i=0;for(const o of e){const e=this._layerLayerViewInfoMap.get(o);if(!e?.layerView)continue;const{layerView:s}=e;s.layer=o,s.parent=t,r.at(i)!==s&&r.splice(i,0,s),"layers"in o&&g(s)&&this._populateLayerViewsOwners(o.layers,s.layerViews,s),++i}i<r.length&&r.splice(i)}_createLayerView(e){e.load().catch(()=>{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new m(e,this.view,this.layerViewImporter);r.promise?.then(()=>this._refreshCollections(),r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||i.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this.destroyed||this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([p()],_.prototype,"_workPromise",void 0),e([p({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([p({readOnly:!0})],_.prototype,"_layersToLayerViews",void 0),e([p({constructOnly:!0})],_.prototype,"layerviewMapping",void 0),e([p({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([p({constructOnly:!0})],_.prototype,"layerViewFilter",void 0),e([p()],_.prototype,"layerViewImporter",void 0),e([p()],_.prototype,"supportsGround",void 0),e([p({readOnly:!0})],_.prototype,"updating",null),e([p({readOnly:!0})],_.prototype,"updatingRemaining",null),e([p({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as t}from"../../core/compilerUtils.js";import e from"../../core/Error.js";import s from"../../core/Logger.js";import{isAborted as r,createAbortError as o,isPromiseLike as a,isAbortError as n}from"../../core/promiseUtils.js";import{signal as i}from"../../core/signal.js";import{Yield as c}from"./Yield.js";class l{constructor(){this._tasks=new Array,this._numPendingTasks=i(0),this._readyToRun=i(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}runTask(t){if(0===this.length)return c;for(;!t.done&&this._process(t);)t.madeProgress()}push(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,o)=>new _(r,o,t,e,s),Array.prototype.push)}_process(e){if(0===this._tasks.length)return!1;const s=this._tasks.shift();this._updateReadyToRun();try{if(r(s.signal))this._cancelTask(s,o());else switch(s.type){case 0:this._processSimple(s,e);break;case 1:this._processGenerator(s,e);break;case 2:this._processIterator(s,e);break;default:t(s)}}catch(a){s.reject(a)}return!0}cancelAll(){const t=o();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&h(t.iterator.return()),a(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&h(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);a(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new k(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);a(s)?s.then(e=>this._onIteratorResult(t,e),t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const o=t(s,r);e.call(this._tasks,o),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>--this._numPendingTasks.value)}}function h(t){a(t)?t.then(u,u):u(t)}function u(t){n(t)||t instanceof Error||t instanceof e||null!=t&&"object"==typeof t&&"done"in t&&t.done||s.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class p{constructor(t,e,s=void 0,r=void 0){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class d extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.callback=s,this.type=0}}class _ extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.generatorFunction=s,this.type=1}}class k extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.iterator=s,this.type=2}}export{l as PromiseQueue};
5
+ import{neverReached as t}from"../../core/compilerUtils.js";import e from"../../core/Error.js";import s from"../../core/Logger.js";import{isAborted as r,createAbortError as o,isPromiseLike as a,isAbortError as n}from"../../core/promiseUtils.js";import{signal as i}from"../../core/signal.js";import{Yield as c}from"./Yield.js";class l{constructor(){this._tasks=new Array,this._numPendingTasks=i(0),this._readyToRun=i(!1)}get length(){return this._tasks.length}get updating(){return this._numPendingTasks.value>0}get readyToRun(){return this._readyToRun.value}_updateReadyToRun(){this._readyToRun.value=this._tasks.length>0}destroy(){this.cancelAll()}runTask(t){if(0===this.length)return c;for(;!t.done&&this._process(t);)t.madeProgress()}push(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.push)}unshift(t,e,s){return this._addTask((r,o)=>new d(r,o,t,e,s),Array.prototype.unshift)}pushGenerator(t,e,s){return this._addTask((r,o)=>new _(r,o,t,e,s),Array.prototype.push)}_process(e){if(0===this._tasks.length)return!1;const s=this._tasks.shift();this._updateReadyToRun();try{if(r(s.signal))this._cancelTask(s,o());else switch(s.type){case 0:this._processSimple(s,e);break;case 1:this._processGenerator(s,e);break;case 2:this._processIterator(s,e);break;default:t(s)}}catch(a){s.reject(a)}return!0}cancelAll(){const t=o();for(const e of this._tasks)this._cancelTask(e,t);this._tasks.length=0,this._updateReadyToRun()}_cancelTask(t,e){if(t.abortCallback){const s=t.abortCallback(e);2===t.type&&t.iterator.return&&h(t.iterator.return()),a(s)?s.then(t.resolve,t.reject):t.resolve(s)}else 2===t.type&&t.iterator.throw&&h(t.iterator.throw(e)),t.reject(e)}_onIteratorResult(t,e){e.done?t.resolve(e.value):(this._tasks.unshift(t),this._updateReadyToRun())}_processSimple(t,e){const s=t.callback(e);a(s)?s.then(t.resolve,t.reject):t.resolve(s)}_processGenerator(t,e){const s=t.generatorFunction(e),r=new k(t.resolve,t.reject,s,t.signal,t.abortCallback);this._processIterator(r,e)}_processIterator(t,e){const s=t.iterator.next(e);a(s)?s.then(e=>this._onIteratorResult(t,e),t.reject):this._onIteratorResult(t,s)}_addTask(t,e){return new Promise((s,r)=>{const o=t(s,r);e.call(this._tasks,o),++this._numPendingTasks.value,this._updateReadyToRun()}).finally(()=>--this._numPendingTasks.value)}}function h(t){a(t)?t.then(u,u):u(t)}function u(t){n(t)||t instanceof Error||t instanceof e||null!=t&&"object"==typeof t&&"done"in t&&t.done||s.getLogger("esri.layers.support.PromiseQueue").warn("Generator iterator was aborted, but it is not done.")}class p{constructor(t,e,s,r){this.resolve=t,this.reject=e,this.signal=s,this.abortCallback=r}}class d extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.callback=s,this.type=0}}class _ extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.generatorFunction=s,this.type=1}}class k extends p{constructor(t,e,s,r,o){super(t,e,r,o),this.iterator=s,this.type=2}}export{l as PromiseQueue};
@@ -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{cyclicalDegrees as e,Cyclical as r}from"../../core/Cyclical.js";import{createAngle as t,convertRotationType as o}from"../../core/quantity.js";import{convertUnit as i}from"../../core/units.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as s,UNIT_Y as a}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as c,d as l,h as u}from"../../chunks/vec32.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as m}from"../../geometry/projection/projectVectorToVector.js";import{geodesicCompatibleSpatialReference as g,inverseGeodeticSolver as p,InverseGeodeticSolverResult as d,directGeodeticSolver as h}from"../../geometry/support/geodesicUtils.js";import{equals as v}from"../../geometry/support/spatialReferenceUtils.js";function j(e,r){if(null==e||null==r)return;const o=b(e,r);return null!=o?t(o,"radians","geographic"):void 0}const b=(()=>{const e=f(),r=f();return(t,o)=>(u(e,t.x,t.y,t.z??0),u(r,o.x,o.y,o.z??0),y(e,r,t.spatialReference,o.spatialReference))})(),y=(()=>{const e=s(),r=f(),t=f();return(o,s,l,u)=>{if(c(o,s))return;const f=g(l),d=g(u);if(f&&d&&v(f,d)&&m(o,l,r,f)&&m(s,u,t,d)){const{azimuth:e}=p(q,r,t,f);return null!=e?i(e,"degrees","radians"):void 0}e[0]=s[0]-o[0],e[1]=s[1]-o[1];let h=n(a,e);return e[0]<0&&(h=C-h),h}})();function x(e,r,t,o="absolute"){if(r&&t)switch(o){case"absolute":return j(r,t);case"relative":return w(z(e,r,t),"relative");case"relative-bilateral":return w(z(e,r,t),"relative-bilateral")}}function z(e,r,o){if(!e||!r||!o)return;const i=b(e,r),n=b(r,o);return null!=i&&null!=n?t(n-i,"radians","geographic"):void 0}function w(e,r){if(null!=e)switch(r){case"absolute":return M(e);case"relative":{const r=U(e);let o=P.normalize(r,0,!0);return-180===o&&(o=180),t(o,"degrees","geographic")}case"relative-bilateral":{const r=U(e),o=Math.abs(P.normalize(r,0,!0));return t(o,"degrees","geographic")}}}function M(e){const r=U(e),o=I.normalize(r,0,!0);return t(o,"degrees","geographic")}function T(e,r,n){let s=i(e.value,e.unit,"degrees");return s=o(s,e.rotationType,n),s=i(s,"degrees",r),t(s,r,n)}const R=(()=>{const e=f();return(r,t,n,s,a,c="geodesic")=>{l(e,t);const f=U(a);if("geodesic"===c){const o=g(n);if(o&&m(e,n,e,o))return h(r,e,f,s,o),r[2]=t[2],!!m(r,o,r,n)}const p=o(f,"geographic","arithmetic"),d=i(p,"degrees","radians"),v=t[0]+s*Math.cos(d),j=t[1]+s*Math.sin(d),b=t[2];return u(r,v,j,b),!0}})();function U(e){if(null!=e)return o(k(e),e.rotationType,"geographic")}function V(e){if(null!=e)return o(k(e),e.rotationType,"arithmetic")}function k(e){return i(e.value,e.unit,"degrees")}const q=new d,C=2*Math.PI,I=e,P=new r(-180,180);export{T as convertAngle,j as directionBetweenPoints,x as directionForVertices,V as getDegreesArithmetic,U as getDegreesGeographic,w as getNormalizedDirection,M as getNormalizedGeographicOrientation,R as pointFromDistanceAlongAzimuth,y as radiansGeographicBetweenVec};
5
+ import{cyclicalDegrees as e,Cyclical as r}from"../../core/Cyclical.js";import{createAngle as t,convertRotationType as o}from"../../core/quantity.js";import{convertUnit as i}from"../../core/units.js";import{angle as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as s,UNIT_Y as a}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as c,d as l,h as u}from"../../chunks/vec32.js";import{create as f}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{geodesicCompatibleSpatialReference as m,inverseGeodeticSolver as g,InverseGeodeticSolverResult as p,directGeodeticSolver as d}from"../../geometry/geodesicUtils.js";import{projectVectorToVector as h}from"../../geometry/projection/projectVectorToVector.js";import{equals as v}from"../../geometry/support/spatialReferenceUtils.js";function j(e,r){if(null==e||null==r)return;const o=b(e,r);return null!=o?t(o,"radians","geographic"):void 0}const b=(()=>{const e=f(),r=f();return(t,o)=>(u(e,t.x,t.y,t.z??0),u(r,o.x,o.y,o.z??0),y(e,r,t.spatialReference,o.spatialReference))})(),y=(()=>{const e=s(),r=f(),t=f();return(o,s,l,u)=>{if(c(o,s))return;const f=m(l),p=m(u);if(f&&p&&v(f,p)&&h(o,l,r,f)&&h(s,u,t,p)){const{azimuth:e}=g(q,r,t,f);return null!=e?i(e,"degrees","radians"):void 0}e[0]=s[0]-o[0],e[1]=s[1]-o[1];let d=n(a,e);return e[0]<0&&(d=C-d),d}})();function x(e,r,t,o="absolute"){if(r&&t)switch(o){case"absolute":return j(r,t);case"relative":return w(z(e,r,t),"relative");case"relative-bilateral":return w(z(e,r,t),"relative-bilateral")}}function z(e,r,o){if(!e||!r||!o)return;const i=b(e,r),n=b(r,o);return null!=i&&null!=n?t(n-i,"radians","geographic"):void 0}function w(e,r){if(null!=e)switch(r){case"absolute":return M(e);case"relative":{const r=U(e);let o=P.normalize(r,0,!0);return-180===o&&(o=180),t(o,"degrees","geographic")}case"relative-bilateral":{const r=U(e),o=Math.abs(P.normalize(r,0,!0));return t(o,"degrees","geographic")}}}function M(e){const r=U(e),o=I.normalize(r,0,!0);return t(o,"degrees","geographic")}function T(e,r,n){let s=i(e.value,e.unit,"degrees");return s=o(s,e.rotationType,n),s=i(s,"degrees",r),t(s,r,n)}const R=(()=>{const e=f();return(r,t,n,s,a,c="geodesic")=>{l(e,t);const f=U(a);if("geodesic"===c){const o=m(n);if(o&&h(e,n,e,o))return d(r,e,f,s,o),r[2]=t[2],!!h(r,o,r,n)}const g=o(f,"geographic","arithmetic"),p=i(g,"degrees","radians"),v=t[0]+s*Math.cos(p),j=t[1]+s*Math.sin(p),b=t[2];return u(r,v,j,b),!0}})();function U(e){if(null!=e)return o(k(e),e.rotationType,"geographic")}function V(e){if(null!=e)return o(k(e),e.rotationType,"arithmetic")}function k(e){return i(e.value,e.unit,"degrees")}const q=new p,C=2*Math.PI,I=e,P=new r(-180,180);export{T as convertAngle,j as directionBetweenPoints,x as directionForVertices,V as getDegreesArithmetic,U as getDegreesGeographic,w as getNormalizedDirection,M as getNormalizedGeographicOrientation,R as pointFromDistanceAlongAzimuth,y as radiansGeographicBetweenVec};
@@ -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{equals as t}from"../../core/arrayUtils.js";import{isMultiOriginJSONMixin as o}from"../../core/multiOriginJSONSupportUtils.js";import{project as n}from"../../geometry/projectionUtils.js";import r from"../../geometry/SpatialReference.js";import{fromValues as e,containsXY as i}from"../../geometry/support/aaBoundingRect.js";import s from"./AttributionItem.js";const c=100;class a{constructor(t,o,n){this.index=t,this.bbox=o,this.score=n}}function u(t){const o=t.contributors,n={maxZoom:0,attributions:[]};if(!o)return n;for(const r of o){if(!r.coverageAreas?.length||!r.attribution)continue;const t=n.attributions.length;n.attributions.push(r.attribution);for(const o of r.coverageAreas){const r=o.bbox,i=new a(t,e(r[1],r[0],r[3],r[2]),o.score??100);for(let t=o.zoomMin;t<=o.zoomMax;t++)n[t]??=[],n[t].push(i)}}return n.maxZoom=Math.max.apply(null,Object.keys(n).map(t=>+t).filter(t=>Number.isFinite(t))),n}function l(t,o,e,c){let a=o?.scaleToZoom(e)??0;if(a=Math.min(t.maxZoom??0,Math.round(a)),!c||null==a||a<=-1)return[];const u=t[a],{x:l,y:f}=n(c.center.clone().normalize(),r.WGS84),m=new Set;return u?.filter(t=>{const o=!m.has(t.index)&&i(t.bbox,l,f);return o&&m.add(t.index),o}).map(o=>new s(t.attributions[o.index],o.score))??[]}function f(t){return p(t,"user")?new s(t.copyright,c):null}function m(t){return p(t)?new s(t.copyright,c):null}function p(t,n){return null!=t&&"object"==typeof t&&"copyright"in t&&"string"==typeof t.copyright&&t.copyright.length>0&&(!n||o(t)&&"user"===t.originOf("copyright"))}function b(t){return null!=t&&"object"==typeof t&&"hasAttributionData"in t&&!0===t.hasAttributionData&&"attributionDataUrl"in t&&"fetchAttributionData"in t&&"function"==typeof t.fetchAttributionData}function h(t){return null!=t&&"object"==typeof t&&"portalItem"in t&&null!=t.portalItem&&"object"==typeof t.portalItem&&"accessInformation"in t.portalItem&&"string"==typeof t.portalItem.accessInformation&&t.portalItem.accessInformation.length>0}function g(t){return h(t)?new s(t.portalItem.accessInformation,c):null}function y(o,n){const r=new globalThis.Map;for(const t of n){const o=r.get(t.text);o?t.score>o.score&&r.set(t.text,t):r.set(t.text,t)}const e=Array.from(r.values()).sort((t,o)=>o.score-t.score);return o&&t(o,e,(t,o)=>t.text===o.text)?o:e}export{u as createAttributionIndex,y as deduplicateAttributionItems,g as getAttributionItemFromAccessInformation,m as getAttributionItemFromLayerCopyright,f as getAttributionItemFromUserCopyright,l as getAttributionItemsFromIndex,b as isDynamicAttributionLayer};
@@ -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{getMetersPerUnitForSR as e}from"../../core/units.js";import t from"../../geometry/Extent.js";import{calculateTolerance as n}from"../../renderers/support/clickToleranceUtils.js";function r(n,r,i,a=new t){let o=0;if("2d"===i.type)o=r*(i.resolution??0);else if("3d"===i.type){const t=i.overlayPixelSizeInMapUnits(n),a=i.basemapSpatialReference;o=null==a||a.equals(i.spatialReference)?r*t:e(a)/e(i.spatialReference)}const s=n.x-o,l=n.y-o,c=n.x+o,m=n.y+o,{spatialReference:p}=i;return a.xmin=Math.min(s,c),a.ymin=Math.min(l,m),a.xmax=Math.max(s,c),a.ymax=Math.max(l,m),a.spatialReference=p,a}function i(e,t,i){const o=i.toMap(e);if(null==o)return!1;return r(o,n(),i,a).intersects(t)}let a=new t;function o(){a=new t}export{o as cleanupDrapedUtils,r as createQueryGeometry,i as intersectsDrapedGeometry};
5
+ import{getMetersPerUnitForSR as e}from"../../core/units.js";import t from"../../geometry/Extent.js";import{calculateTolerance as n}from"../../renderers/support/clickToleranceUtils.js";function r(n,r,i,a=new t){let o=0;if("2d"===i.type)o=r*(i.resolution??0);else if("3d"===i.type){const t=i.overlayPixelSizeInMapUnits(n),{groundSpatialReference:a}=i;o=null==a||a.equals(i.spatialReference)?r*t:e(a)/e(i.spatialReference)}const s=n.x-o,l=n.y-o,c=n.x+o,m=n.y+o,{spatialReference:p}=i;return a.xmin=Math.min(s,c),a.ymin=Math.min(l,m),a.xmax=Math.max(s,c),a.ymax=Math.max(l,m),a.spatialReference=p,a}function i(e,t,i){const o=i.toMap(e);if(null==o)return!1;return r(o,n(),i,a).intersects(t)}let a=new t;function o(){a=new t}export{o as cleanupDrapedUtils,r as createQueryGeometry,i as intersectsDrapedGeometry};
@@ -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{createArea as e}from"../../core/quantity.js";import{geodesicAreas as r}from"../../geometry/support/geodesicUtils.js";import{geodesicMeasure as t}from"./geodesicMeasurementUtils.js";const s=e=>({geodesicArea(r){const{spatialReference:s}=r;return t(s,n,r=>a(e,r),r)}});async function o(){const e=await import("../../geometry/geometryEngine.js");return s(e)}function n(t){return e(Math.abs(r([t],"square-meters")[0]),"square-meters")}function a(r,t){try{return e(Math.abs(r.geodesicArea(t,"square-meters")),"square-meters")}catch(s){return null}}export{o as loadGeodesicAreaMeasurementUtils};
5
+ import{createArea as e}from"../../core/quantity.js";import{geodesicAreas as r}from"../../geometry/geodesicUtils.js";import{l as t,e as s}from"../../chunks/geodeticAreaOperator.js";import{isCurvedGeometry as o}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as a}from"./geodesicMeasurementUtils.js";const n=e=>({geodesicArea(r){const{spatialReference:t}=r,s=o(r);return a(t,s?m:u,s?m:r=>c(e,r),r)}});async function i(){const e=await import("../../geometry/geometryEngine.js");return await t(),n(e)}function u(t){return e(Math.abs(r([t],"square-meters")[0]),"square-meters")}function c(r,t){try{return e(Math.abs(r.geodesicArea(t,"square-meters")),"square-meters")}catch(s){return null}}function m(r){return e(s(r,{unit:"square-meters",curveType:"geodesic"}),"square-meters")}export{i as loadGeodesicAreaMeasurementUtils};
@@ -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{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import r from"../../geometry/Polyline.js";import{l as n,e as s}from"../../chunks/geodeticLengthOperator.js";import{inverseGeodeticSolver as o,InverseGeodeticSolverResult as i,geodesicLengths as c}from"../../geometry/support/geodesicUtils.js";import{equals as a}from"../../geometry/support/spatialReferenceUtils.js";import{geodesicMeasure as u}from"./geodesicMeasurementUtils.js";function m(e){const{spatialReference:t}=e;return u(t,j,h,e)}function f(e,t){if(!a(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return x[0]=e.x,x[1]=e.y,x[2]=e.hasZ?e.z:0,U[0]=t.x,U[1]=t.y,U[2]=t.hasZ?t.z:0,p(x,U,r)}function p(e,t,r){return u(r,y,d,e,t,r)}const l={geodesicLength:m,geodesicDistanceBetweenPoints:f,geodesicDistance:p};async function g(){return await n(),l}function y(t,r,n){return e(o(w,t,r,n).distance,"meters")}function d(t,r,n){return e(s(R(t,r,n),{unit:"meters"}),"meters")}function j(t){return e(c([t],"meters")[0],"meters")}function h(t){return e(s(t,{unit:"meters"}),"meters")}function R(e,t,n){return new r({spatialReference:n,paths:[[[...e],[...t]]]})}const w=new i,x=t(),U=t();export{g as loadGeodesicLengthMeasurementUtils};
5
+ import{createLength as e}from"../../core/quantity.js";import{create as t}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{inverseGeodeticSolver as r,InverseGeodeticSolverResult as n,geodesicLengths as s}from"../../geometry/geodesicUtils.js";import o from"../../geometry/Polyline.js";import{l as i,e as c}from"../../chunks/geodeticLengthOperator.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isCurvedGeometry as u}from"../../geometry/support/curves/curveUtils.js";import{geodesicMeasure as a}from"./geodesicMeasurementUtils.js";function f(e){const{spatialReference:t}=e,r=u(e);return a(t,r?R:h,R,e)}function p(e,t){if(!m(e.spatialReference,t.spatialReference))return null;const{spatialReference:r}=e;return U[0]=e.x,U[1]=e.y,U[2]=e.hasZ?e.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,l(U,v,r)}function l(e,t,r){return a(r,j,d,e,t,r)}const g={geodesicLength:f,geodesicDistanceBetweenPoints:p,geodesicDistance:l};async function y(){return await i(),g}function j(t,n,s){return e(r(x,t,n,s).distance,"meters")}function d(t,r,n){return e(c(w(t,r,n),{unit:"meters"}),"meters")}function h(t){return e(s([t],"meters")[0],"meters")}function R(t){return e(c(t,{unit:"meters"}),"meters")}function w(e,t,r){return new o({spatialReference:r,paths:[[[...e],[...t]]]})}const x=new n,U=t(),v=t();export{y as loadGeodesicLengthMeasurementUtils};
@@ -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{isSupported as e}from"../../geometry/support/geodesicUtils.js";import{isWebMercator as o}from"../../geometry/support/spatialReferenceUtils.js";function r(r){return e(r)||o(r)}function t(o,r,t,...p){return e(o)?r.apply(void 0,p):o.isWebMercator?t.apply(void 0,p):null}const p=1e5;export{p as geodesicDistanceThreshold,t as geodesicMeasure,r as supportsGeodesicMeasurement};
5
+ import{isSupported as e}from"../../geometry/geodesicUtils.js";import{isWebMercator as o}from"../../geometry/support/spatialReferenceUtils.js";function r(r){return e(r)||o(r)}function t(o,r,t,...i){return e(o)?r.apply(void 0,i):o.isWebMercator?t.apply(void 0,i):null}const i=1e5;export{i as geodesicDistanceThreshold,t as geodesicMeasure,r as supportsGeodesicMeasurement};
@@ -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 o}from"tslib";import{property as t,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"../DefaultUI.js";let e=class extends s{constructor(o){super(o),this.components=["attribution","zoom"]}};o([t()],e.prototype,"components",void 0),e=o([r("esri.views.ui.2d.DefaultUI2D")],e);const i=e;export{i as default};
5
+ import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../DefaultUI.js";let e=class extends r{constructor(o){super(o),this.components=["zoom"]}};o([t()],e.prototype,"components",void 0),e=o([s("esri.views.ui.2d.DefaultUI2D")],e);const p=e;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"../DefaultUI.js";let e=class extends r{constructor(o){super(o),this.components=["attribution","zoom","navigation-toggle","compass"]}};o([t()],e.prototype,"components",void 0),e=o([s("esri.views.ui.3d.DefaultUI3D")],e);const i=e;export{i as default};
5
+ import{__decorate as o}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import e from"../DefaultUI.js";let r=class extends e{constructor(o){super(o),this.components=["zoom","navigation-toggle","compass"]}};o([t()],r.prototype,"components",void 0),r=o([s("esri.views.ui.3d.DefaultUI3D")],r);const p=r;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONSupport as e}from"../core/JSONSupport.js";import{clone as o}from"../core/lang.js";import r from"../core/Logger.js";import{property as i,subclass as n}from"../core/accessorSupport/decorators.js";import s from"../views/3d/environment/SunnyWeather.js";import{weatherTypes as l,validateWeatherType as a}from"../views/3d/environment/weather.js";import{lightingTypes as p}from"./lightingTypes.js";import h from"./SunLighting.js";import c from"./VirtualLighting.js";import{backgroundProperty as g}from"./background/utils.js";var m;const u=(t,e,o)=>({enabled:!o?.isPresentation});let d=class extends e{static{m=this}constructor(t){super(t),this.lighting=new h,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(t){a(t?.type,r.getLogger(this))&&this._set("weather",t)}clone(){return new m(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?c.prototype.clone.call(this.lighting):h.prototype.clone.call(this.lighting),background:o(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};t([i({types:p,nonNullable:!0,json:{write:!0}})],d.prototype,"lighting",void 0),t([i(g)],d.prototype,"background",void 0),t([i({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"atmosphereEnabled",void 0),t([i({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"starsEnabled",void 0),t([i({types:l,nonNullable:!0,json:{write:!0},value:new s})],d.prototype,"weather",null),d=m=t([n("esri.webscene.Environment")],d);const b=d;export{b as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as e}from"../core/JSONSupport.js";import{clone as o}from"../core/lang.js";import r from"../core/Logger.js";import{property as i,subclass as n}from"../core/accessorSupport/decorators.js";import s from"../views/3d/environment/SunnyWeather.js";import{weatherTypes as l,validateWeatherType as a}from"../views/3d/environment/weather.js";import{lightingTypes as p}from"./lightingTypes.js";import h from"./SunLighting.js";import c from"./VirtualLighting.js";import{backgroundProperty as g}from"./background/utils.js";var m;const u=(t,e,o)=>({enabled:!o?.isPresentation});let d=class extends e{static{m=this}constructor(t){super(t),this.lighting=new h,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(t){a(t?.type,r.getLogger(this))&&this._set("weather",t)}clone(){return new m(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?c.prototype.clone.call(this.lighting):h.prototype.clone.call(this.lighting),background:o(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};t([i({types:{defaultKeyValue:"sun",...p},nonNullable:!0,json:{write:!0}})],d.prototype,"lighting",void 0),t([i(g)],d.prototype,"background",void 0),t([i({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"atmosphereEnabled",void 0),t([i({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"starsEnabled",void 0),t([i({types:l,nonNullable:!0,json:{write:!0},value:new s})],d.prototype,"weather",null),d=m=t([n("esri.webscene.Environment")],d);const b=d;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as o,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as u,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as d}from"../../core/units.js";import{property as v,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import g from"../../geometry/Point.js";import _ from"../../geometry/Polygon.js";import w from"../../geometry/Polyline.js";import{e as b}from"../../chunks/areaOperator.js";import{e as L,l as j}from"../../chunks/geodeticAreaOperator.js";import{e as S,l as A}from"../../chunks/geodeticDensifyOperator.js";import{e as k,l as G}from"../../chunks/geodeticLengthOperator.js";import{e as x}from"../../chunks/lengthOperator.js";import{e as M}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as q}from"../../geometry/support/centroid.js";import{isSupported as O,geodesicDensify as C,geodesicLengths as H,geodesicAreas as R}from"../../geometry/support/geodesicUtils.js";import T from"../../layers/GraphicsLayer.js";import U from"../../symbols/Font.js";import z from"../../symbols/SimpleFillSymbol.js";import D from"../../symbols/SimpleLineSymbol.js";import P from"../../symbols/SimpleMarkerSymbol.js";import E from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as V}from"../../views/2d/interactive/SnappingVisualizer2D.js";import F from"../../views/draw/Draw.js";import{createCoordinateHelper as W}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as I,screenToMap as B,dragManipulatedObject as J}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as N}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as Q}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as X}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Y}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Z}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as $}from"../../views/interactive/snapping/snappingUtils.js";const ee=1e5;let te=class extends K{constructor(e){super(e),this._measurementLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new F({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),$(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=n(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=n(this._measurementLayer),this._manipulatorLayer=n(this._manipulatorLayer),this._snappingLayer=n(this._snappingLayer),this._updatingHandles=n(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Y({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new X(new Q("point",W(!1,!1,this.view.spatialReference)),2),visualizer:new V(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new g({x:i,y:s,spatialReference:t}),n=re(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=X.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=I(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=Z({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(B(this.view)).next(t=>{if("start"===t.action){const r=new g(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(J({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new g({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=ie(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:n}=e;this._set("measurement",r);const o=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!i&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new z({color:s(h.accentColor,.3),outline:null})}),l=new t({symbol:new D({color:h.accentColor,width:2})}),p=new t({symbol:new E({color:h.textColor,font:new U({size:14,family:"sans-serif"}),haloColor:s(a(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=n;const d=i?q(i):null,v=d?g.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function re(e,r,i){const a=8,n={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new P({...n,size:a}),m=new P({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new N({view:r,layer:i,graphic:l,focusedSymbol:m})}function ie(e,t){if(2===e.length){const r=new w({paths:[e],spatialReference:t});let i;return i=t.isGeographic?O(t)?C(r,ee):S(r,ee,{unit:"meters"}):t.isWebMercator?S(r,ee,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new w({paths:[e],spatialReference:t}),i=new _({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(O(t)){if(n=C(r,ee),o=C(i,ee),o=M(o),!o)return null;s=H([r],"meters")[0],a=R([o],"square-meters")[0]}else{if(n=S(r,ee,{unit:"meters"}),o=S(i,ee,{unit:"meters"}),o=M(o),!o)return null;s=k(r,{unit:"meters"}),a=L(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=S(r,ee,{unit:"meters"}),o=S(i,ee,{unit:"meters"}),o=M(o),!o)return null;s=k(r,{unit:"meters"}),a=L(o,{unit:"square-meters"})}else{if(n=r,o=M(i),!o)return null;s=x(r,{unit:"meters"}),a=b(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function se(e){return null!=e}async function ae(e){(e?.isGeographic&&!O(e)||e?.isWebMercator)&&await Promise.all([j(),A(),G()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const n=oe(r);if(n)switch(n){case"metric":i.perimeter=h(e,a,"meters");break;case"imperial":i.perimeter=u(e,a,"meters");break;default:{const t=d(a,"meters",n);i.perimeter=l(e,t,n);break}}else i.perimeter="";return i}function oe(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([v()],te.prototype,"_drawActive",void 0),e([v({readOnly:!0})],te.prototype,"cursor",null),e([v({value:!0})],te.prototype,"editable",null),e([v({readOnly:!0})],te.prototype,"measurement",void 0),e([v({readOnly:!0})],te.prototype,"measurementLabel",void 0),e([v()],te.prototype,"messages",void 0),e([v({constructOnly:!0})],te.prototype,"snappingManager",void 0),e([v()],te.prototype,"unit",void 0),e([v()],te.prototype,"updating",null),e([v({constructOnly:!0})],te.prototype,"view",void 0),te=e([y("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],te);export{te as AreaMeasurement2DTool,ie as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,se as isSupported,ae as loadGeometryOperators};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{fetchMessageBundle as r,onLocaleChange as i}from"../../intl.js";import{multiplyOpacity as s,getContrast as a}from"../../core/colorUtils.js";import{destroyMaybe as n}from"../../core/maybe.js";import{watch as o,initial as m}from"../../core/reactiveUtils.js";import{formatDecimal as l,formatImperialArea as p,formatMetricArea as c,formatImperialLength as u,formatMetricLength as h}from"../../core/unitFormatUtils.js";import{convertUnit as d}from"../../core/units.js";import{property as v,subclass as y}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{isSupported as g,geodesicDensify as _,geodesicLengths as w,geodesicAreas as b}from"../../geometry/geodesicUtils.js";import L from"../../geometry/Point.js";import j from"../../geometry/Polygon.js";import S from"../../geometry/Polyline.js";import{e as A}from"../../chunks/areaOperator.js";import{e as k,l as G}from"../../chunks/geodeticAreaOperator.js";import{e as x,l as M}from"../../chunks/geodeticDensifyOperator.js";import{e as q,l as O}from"../../chunks/geodeticLengthOperator.js";import{e as C}from"../../chunks/lengthOperator.js";import{e as H}from"../../chunks/simplifyOperator.js";import{polygonCentroidPoint as R}from"../../geometry/support/centroid.js";import T from"../../layers/GraphicsLayer.js";import U from"../../symbols/Font.js";import z from"../../symbols/SimpleFillSymbol.js";import D from"../../symbols/SimpleLineSymbol.js";import P from"../../symbols/SimpleMarkerSymbol.js";import E from"../../symbols/TextSymbol.js";import{SnappingVisualizer2D as V}from"../../views/2d/interactive/SnappingVisualizer2D.js";import F from"../../views/draw/Draw.js";import{createCoordinateHelper as W}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as I,screenToMap as B,dragManipulatedObject as J}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as N}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as Q}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as X}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as Y}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Z}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as $}from"../../views/interactive/snapping/snappingUtils.js";const ee=1e5;let te=class extends K{constructor(e){super(e),this._measurementLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement layer"}),this._manipulatorLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement manipulator layer"}),this._snappingLayer=new T({internal:!0,listMode:"hide",visible:!1,title:"Area measurement snapping layer"}),this._updatingHandles=new f,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){r("esri/core/t9n/Units").then(e=>{this.messages=e});const e=this.view;this._draw=new F({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([i(async()=>{this.messages=await r("esri/core/t9n/Units")}),o(()=>[this.unit,this.messages],()=>{this._updateGraphics()},m),o(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const e=this._vertices.map(({coord:e})=>e);for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})]),$(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=n(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=n(this._measurementLayer),this._manipulatorLayer=n(this._manipulatorLayer),this._snappingLayer=n(this._snappingLayer),this._updatingHandles=n(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new Y({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new X(new Q("point",W(!1,!1,this.view.spatialReference)),2),visualizer:new V(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this;this._draw.create("polyline",{mode:"click",snappingManager:e}).on(["draw-complete","vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],e=>{this._updateSketch(e.vertices),"draw-complete"===e.type&&this._stopSketch()})}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new L({x:i,y:s,spatialReference:t}),n=re(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=X.fromGeometry(a,2);o.on("vertex-update",e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())});const m=I(n,(e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=Z({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(B(this.view)).next(t=>{if("start"===t.action){const r=new L(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t}).next(...m).next(J({operations:o})).next(()=>{e.graphic.geometry=o.data.geometry})});this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new L({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:e})=>{e.interactive=null==n||e!==n})}this._updateGraphics()}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=ie(this._vertices.map(({coord:e})=>e),this.view.spatialReference);if(!e)return;const{measurement:r,fillGeometry:i,outlineGeometry:n}=e;this._set("measurement",r);const o=r?ne(this.messages,r,this.unit):null;if(this._set("measurementLabel",o),!i&&!n)return;let m,l,p;const{graphics:c}=this._measurementLayer,u=3===c.length,{effectiveTheme:h}=this.view;u?(m=c.at(0),l=c.at(1),p=c.at(2)):(m=new t({symbol:new z({color:s(h.accentColor,.3),outline:null})}),l=new t({symbol:new D({color:h.accentColor,width:2})}),p=new t({symbol:new E({color:h.textColor,font:new U({size:14,family:"sans-serif"}),haloColor:s(a(h.textColor,160),.5),haloSize:2})}),c.removeAll(),c.addMany([m,l,p])),m.geometry=i,l.geometry=n;const d=i?R(i):null,v=d?L.fromJSON(d):null;p.geometry=v,p.symbol.text=o?.area??""}};function re(e,r,i){const a=8,n={style:"circle",color:s(r.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new P({...n,size:a}),m=new P({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new N({view:r,layer:i,graphic:l,focusedSymbol:m})}function ie(e,t){if(2===e.length){const r=new S({paths:[e],spatialReference:t});let i;return i=t.isGeographic?g(t)?_(r,ee):x(r,ee,{unit:"meters"}):t.isWebMercator?x(r,ee,{unit:"meters"}):r,{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new S({paths:[e],spatialReference:t}),i=new j({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(g(t)){if(n=_(r,ee),o=_(i,ee),o=H(o),!o)return null;s=w([r],"meters")[0],a=b([o],"square-meters")[0]}else{if(n=x(r,ee,{unit:"meters"}),o=x(i,ee,{unit:"meters"}),o=H(o),!o)return null;s=q(r,{unit:"meters"}),a=k(o,{unit:"square-meters"})}else if(t.isWebMercator){if(n=x(r,ee,{unit:"meters"}),o=x(i,ee,{unit:"meters"}),o=H(o),!o)return null;s=q(r,{unit:"meters"}),a=k(o,{unit:"square-meters"})}else{if(n=r,o=H(i),!o)return null;s=C(r,{unit:"meters"}),a=A(o,{unit:"square-meters"})}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function se(e){return null!=e}async function ae(e){(e?.isGeographic&&!g(e)||e?.isWebMercator)&&await Promise.all([G(),M(),O()])}function ne(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=c(e,s,"square-meters");break;case"imperial":i.area=p(e,s,"square-meters");break;default:{const t=d(s,"square-meters",r);i.area=l(e,t,r);break}}const n=oe(r);if(n)switch(n){case"metric":i.perimeter=h(e,a,"meters");break;case"imperial":i.perimeter=u(e,a,"meters");break;default:{const t=d(a,"meters",n);i.perimeter=l(e,t,n);break}}else i.perimeter="";return i}function oe(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([v()],te.prototype,"_drawActive",void 0),e([v({readOnly:!0})],te.prototype,"cursor",null),e([v({value:!0})],te.prototype,"editable",null),e([v({readOnly:!0})],te.prototype,"measurement",void 0),e([v({readOnly:!0})],te.prototype,"measurementLabel",void 0),e([v()],te.prototype,"messages",void 0),e([v({constructOnly:!0})],te.prototype,"snappingManager",void 0),e([v()],te.prototype,"unit",void 0),e([v()],te.prototype,"updating",null),e([v({constructOnly:!0})],te.prototype,"view",void 0),te=e([y("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],te);export{te as AreaMeasurement2DTool,ie as createAreaMeasurementInfo2D,ne as createAreaMeasurementLabel,se as isSupported,ae as loadGeometryOperators};
@@ -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{result as i}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{watch as r,on as n,when as o}from"../../core/reactiveUtils.js";import{property as a,subclass as h}from"../../core/accessorSupport/decorators.js";import{getDynamicAttribution as l,createContributorIndex as d}from"../../layers/support/attributionUtils.js";import{getLyr3DWasm as u}from"../../views/3d/layers/Lyr3DWasm.js";function c(t,e){return t&&"copyright"in t&&(!e||"function"==typeof t.originOf&&"user"===t.originOf("copyright"))}function p(t,e){return t.length!==e.length||t.some((t,i)=>t.text!==e[i].text)}function f(t,e,i){if(!i||!e)return;t.find(t=>t.layerView===e&&t.text===i)||t.push({text:i,layerView:e})}const m=[];let y=class extends e{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new s,this.view=null,this._allLayerViewsChange=t=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const e=this.view?.allLayerViews;e&&(this.addHandles(e.map(t=>r(()=>[t.suspended,t.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),e.forEach(t=>{"esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D"===t.declaredClass&&this.addHandles(t.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),t?.removed&&t.removed.forEach(t=>{this._pendingAttributions.delete(t),this._fetchedAttributionData.delete(t)}),this._updateAttributionItems()},this.addHandles([n(()=>this.view?.allLayerViews,"change",t=>this._allLayerViewsChange(t),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),o(()=>!0===this.view?.stationary,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;m.length=0;let i=!1,s=null;if(!t||!e)return void this._clear();e.forEach(e=>{if(e.suspended||!e.layer?.attributionVisible)return;const r=e.layer;if(c(r,"user"))return void f(m,e,r.copyright);if("integrated-mesh-3dtiles"===r.type&&r.hasGoogleUrl&&(i=!0,s=e),r.hasAttributionData){if(this._fetchedAttributionData.has(e)){const i=this._fetchedAttributionData.get(e);return void(i?f(m,e,l(i,r.tileInfo,t.scale,t.extent)):c(r)&&f(m,e,r.copyright))}return void this._fetchAttributionData(e)}const n="portalItem"in r?r.portalItem?.accessInformation:void 0;f(m,e,n||r.copyright)});const r=e.find(t=>"integrated-mesh-3dtiles"===t.layer?.type);if(this.view&&r){const t=u(this.view);if(t){const e=t.getAttributionText();for(let t=e.length-1;t>-1;--t)m.unshift({text:e[t],layerView:r})}}i&&s&&m.unshift({text:"Google Maps",layerView:s}),p(this.items,m)&&(this.items.removeAll(),this.items.addMany(m)),m.length=0,this.notifyChange("state")}async _fetchAttributionData(t){if(this._pendingAttributions.has(t))return;this._pendingAttributions.add(t);const e=await i(t.layer.fetchAttributionData().then(t=>d(t)));this._pendingAttributions.has(t)&&(this._pendingAttributions.delete(t),this._fetchedAttributionData.set(t,e.ok?e.value:null)),this._updateAttributionItems()}};t([a({readOnly:!0,type:s})],y.prototype,"items",void 0),t([a({readOnly:!0})],y.prototype,"state",null),t([a()],y.prototype,"view",void 0),y=t([h("esri.widgets.Attribution.AttributionViewModel")],y);const g=y;export{g as default};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import i from"../../core/Collection.js";import{watch as s,when as o,on as r}from"../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../core/accessorSupport/decorators.js";import{getLyr3DWasm as l}from"../../views/3d/layers/Lyr3DWasm.js";function d(t,e){return t.length!==e.length||t.some((t,i)=>t.text!==e[i].text)}function h(t,e,i){if(!i||!e)return;t.find(t=>t.layerView===e&&t.text===i)||t.push({text:i,layerView:e})}const m=Symbol("attributions");let u=class extends e{constructor(t){super(t),this._clear=()=>{this.removeHandles(m)},this.items=new i,this.view=null,this._allLayerViewsChange=()=>{this.removeHandles(m);const t=this.view?.allLayerViews;let e=!1;if(t){for(const i of t)this.addHandles(s(()=>[i.attributionItems],()=>this._updateAttributionItems()),m),"type"in i&&"integrated-mesh-3dtiles"===i.type&&(e=!0,this.addHandles([s(()=>i.suspended,()=>this._updateAttributionItems()),i.on("visible-geometry-changed",()=>this._updateAttributionItems())],m));e&&this.addHandles(o(()=>!0===this.view?.stationary,()=>this._updateAttributionItems()),m)}this._updateAttributionItems()},this.addHandles([r(()=>this.view?.allLayerViews,"change",this._allLayerViewsChange,{onListenerAdd:this._allLayerViewsChange,onListenerRemove:this._clear})])}destroy(){this.view=null,this.items.removeAll()}get state(){return this.view?.ready?this.view.allLayerViews.some(t=>t.attributionUpdating)?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews,i=[];let s=!1,o=null,r=null;if(t&&e){for(const t of e){if(t.suspended)continue;"type"in t&&"integrated-mesh-3dtiles"===t.type&&(r||=t,t.layer.hasGoogleUrl&&(s=!0,o=t));const e=t.attributionItems.slice().sort((t,e)=>e.score-t.score).map(t=>t.text).join(", ");h(i,t,e)}if(r){const e=l(t);if(e){const t=e.getAttributionText();for(let e=t.length-1;e>-1;--e)i.unshift({text:t[e],layerView:r})}}s&&o&&i.unshift({text:"Google Maps",layerView:o}),d(this.items,i)&&(this.items.removeAll(),this.items.addMany(i))}else this._clear()}};t([n({readOnly:!0,type:i})],u.prototype,"items",void 0),t([n({readOnly:!0})],u.prototype,"state",null),t([n()],u.prototype,"view",void 0),u=t([a("esri.widgets.Attribution.AttributionViewModel")],u);const c=u;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{on as t}from"../core/reactiveUtils.js";import{property as i,subclass as r}from"../core/accessorSupport/decorators.js";import s from"./Widget.js";import o from"./Attribution/AttributionViewModel.js";import{globalCss as n}from"./support/globalCss.js";import{messageBundle as l,accessibleHandler as d,tsx as c}from"./support/widget.js";const p="esri-attribution",h={base:p,poweredBy:`${p}__powered-by`,sources:`${p}__sources`,open:`${p}--open`,sourcesOpen:`${p}__sources--open`,link:`${p}__link`};let a=class extends s{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(e=>e.forEach(({target:e})=>this._checkSourceTextOverflow(e))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new o}initialize(){this.addHandles(t(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[h.open]:this._isOpen};return c("div",{bind:this,class:this.classes(h.base,n.widget,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return c("div",{class:h.poweredBy},"Powered by"," ",c("a",{class:h.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?0:void 0,{attributionText:r}=this,s={[h.sourcesOpen]:e,[n.interactive]:t};return c("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(h.sources,s),innerHTML:r,tabIndex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:i,clientWidth:r,scrollWidth:s}=e,o=s>r,n=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,n&&(t=!0),this._isOpen){const e=i<this._prevSourceNodeHeight;this._prevSourceNodeHeight=i,e&&(this._isOpen=!1,t=!0)}t&&this.scheduleRender()}_toggleState(){this._isInteractive&&(this._isOpen=!this._isOpen)}};e([i()],a.prototype,"_isOpen",void 0),e([i()],a.prototype,"_isInteractive",null),e([i()],a.prototype,"_attributionTextOverflowed",void 0),e([i()],a.prototype,"_prevSourceNodeHeight",void 0),e([i({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],a.prototype,"attributionText",null),e([i()],a.prototype,"icon",null),e([i()],a.prototype,"itemDelimiter",void 0),e([i()],a.prototype,"label",null),e([i(),l("esri/widgets/Attribution/t9n/Attribution")],a.prototype,"messages",void 0),e([i()],a.prototype,"view",null),e([i({type:o})],a.prototype,"viewModel",void 0),e([d()],a.prototype,"_toggleState",null),a=e([r("esri.widgets.Attribution")],a);const u=a;export{u as default};
5
+ import{__decorate as e}from"tslib";import{deprecated as t}from"../core/deprecate.js";import has from"../core/has.js";import i from"../core/Logger.js";import{on as r}from"../core/reactiveUtils.js";import{property as s,subclass as o}from"../core/accessorSupport/decorators.js";import n from"./Widget.js";import l from"./Attribution/AttributionViewModel.js";import{globalCss as a}from"./support/globalCss.js";import{messageBundle as c,accessibleHandler as d,tsx as h}from"./support/widget.js";const u="esri-attribution",p={base:u,poweredBy:`${u}__powered-by`,sources:`${u}__sources`,open:`${u}--open`,sourcesOpen:`${u}__sources--open`,link:`${u}__link`};let _=class extends n{constructor(e,r){super(e,r),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._sourcesNode=null,this._overflowRequestAnimationFrame=null,this._resizeObserver=new ResizeObserver(e=>{e.forEach(({target:e})=>{this._scheduleOverflowCheck(e)})}),this._mutationObserver=new MutationObserver(e=>{let t=!1;for(const i of e)if("childList"===i.type||"characterData"===i.type||"attributes"===i.type){t=!0;break}t&&this._sourcesNode&&this._scheduleOverflowCheck(this._sourcesNode)}),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new l,has("esri-deprecation-warnings")&&t(i.getLogger("esri.widgets.Attribution"),"This widget is deprecated. Use View.attributionVisible and View.attributionItems instead.",{replacement:"view.attributionVisible and view.attributionItems",warnOnce:!0})}initialize(){this.addHandles(r(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),null!=this._overflowRequestAnimationFrame&&(cancelAnimationFrame(this._overflowRequestAnimationFrame),this._overflowRequestAnimationFrame=null)}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}_scheduleOverflowCheck(e){null==this._overflowRequestAnimationFrame&&(this._overflowRequestAnimationFrame=requestAnimationFrame(()=>{this._overflowRequestAnimationFrame=null,this._checkSourceTextOverflow(e)}))}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[p.open]:this._isOpen};return h("div",{bind:this,class:this.classes(p.base,a.widget,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return h("div",{class:p.poweredBy},"Powered by"," ",h("a",{class:p.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?0:void 0,{attributionText:r}=this,s={[p.sourcesOpen]:e,[a.interactive]:t};return h("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(p.sources,s),innerHTML:r,tabIndex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._sourcesNode=e,this._resizeObserver.observe(e),this._mutationObserver.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),this._scheduleOverflowCheck(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:i,clientWidth:r,scrollWidth:s}=e,o=s>r,n=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,n&&(t=!0),this._isOpen){const e=i<this._prevSourceNodeHeight;this._prevSourceNodeHeight=i,e&&(this._isOpen=!1,t=!0)}t&&this.scheduleRender()}_toggleState(){this._isInteractive&&(this._isOpen=!this._isOpen)}};e([s()],_.prototype,"_isOpen",void 0),e([s()],_.prototype,"_isInteractive",null),e([s()],_.prototype,"_attributionTextOverflowed",void 0),e([s()],_.prototype,"_prevSourceNodeHeight",void 0),e([s({readOnly:!0,dependsOn:["viewModel.items.length","itemDelimiter"]})],_.prototype,"attributionText",null),e([s()],_.prototype,"icon",null),e([s()],_.prototype,"itemDelimiter",void 0),e([s()],_.prototype,"label",null),e([s(),c("esri/widgets/Attribution/t9n/Attribution")],_.prototype,"messages",void 0),e([s()],_.prototype,"view",null),e([s({type:l})],_.prototype,"viewModel",void 0),e([d()],_.prototype,"_toggleState",null),_=e([o("esri.widgets.Attribution")],_);const v=_;export{v as default};