@arcgis/core 4.33.0-next.20250326 → 4.33.0-next.20250327

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 (146) hide show
  1. package/applications/Components/viewUtils.d.ts +3 -0
  2. package/applications/Components/viewUtils.js +5 -0
  3. package/arcade/arcadeAsyncRuntime.js +1 -1
  4. package/arcade/arcadeCompiler.js +1 -1
  5. package/arcade/arcadeRuntime.js +1 -1
  6. package/arcade/functions/date.js +1 -1
  7. package/arcade/functions/feature.js +1 -1
  8. package/arcade/functions/featuresetbase.js +1 -1
  9. package/arcade/functions/featuresetgeom.js +1 -1
  10. package/arcade/functions/featuresetstats.js +1 -1
  11. package/arcade/functions/featuresetstring.js +1 -1
  12. package/arcade/functions/geomasync.js +1 -1
  13. package/arcade/functions/geometry.js +1 -1
  14. package/arcade/functions/geomsync.js +1 -1
  15. package/arcade/functions/knowledgegraph.js +1 -1
  16. package/arcade/functions/maths.js +1 -1
  17. package/arcade/functions/stats.js +1 -1
  18. package/arcade/functions/string.js +1 -1
  19. package/arcade/geometry/functions.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/esri/core/workers/RemoteClient.js +1 -1
  22. package/assets/esri/core/workers/chunks/0f37b3a797d8a55439a4.js +1 -0
  23. package/assets/esri/core/workers/chunks/{6ff981ec0c725efe5525.js → 470cf066294b053c2732.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ba47e43ef039fe4b8c5c.js → 605eddec7aac891ed141.js} +1 -1
  25. package/assets/esri/core/workers/chunks/75a04b073231da70c18d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{fa3eeb40e2d732c184d8.js → 7f8c7e3e41e51ab4d612.js} +1 -1
  27. package/assets/esri/core/workers/chunks/80aaf31c8eec3cff2add.js +1 -0
  28. package/assets/esri/core/workers/chunks/82692bff98b4ec781544.js +319 -0
  29. package/assets/esri/core/workers/chunks/86ee278919038260696e.js +39 -0
  30. package/assets/esri/core/workers/chunks/{4496ef270c700078df0c.js → 8752f807c05d1ec215e8.js} +1 -1
  31. package/assets/esri/core/workers/chunks/9c59fc2df8081e65a128.js +1 -0
  32. package/assets/esri/core/workers/chunks/{d5d2a4e8e19898d86c6d.js → a2377969f76640f1d6fe.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{e0ac90b4ad8c36fb7d70.js → b2666b89755323a84fcb.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{726e3f413824f02fe689.js → bd2dcc55ac3418421ee5.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{b8a4352f83502449ff95.js → cbbbaccc0d3683e1c0fe.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{e4290719c8afc2a4ee8c.js → cc441051a52bfbda9caf.js} +1 -1
  37. package/assets/esri/core/workers/chunks/d3912886ac2910290f43.js +1 -0
  38. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +1 -0
  39. package/assets/esri/core/workers/chunks/{042771b4e56355924140.js → e9993d4f2bfdc434fbcc.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{4dc1e7d7ac2a4b0144c4.js → f128d3431da86e484117.js} +28 -29
  41. package/chunks/ComponentShader.glsl.js +25 -25
  42. package/chunks/HUDMaterial.glsl.js +2 -2
  43. package/chunks/LineMarker.glsl.js +26 -26
  44. package/chunks/Point2D.js +1 -1
  45. package/chunks/ProjectionTransformation.js +1 -1
  46. package/chunks/QuadraticBezier.js +1 -1
  47. package/chunks/RibbonLine.glsl.js +35 -33
  48. package/chunks/Terrain.glsl.js +33 -33
  49. package/chunks/aiServices.js +1 -1
  50. package/chunks/array.js +1 -1
  51. package/chunks/languageUtils.js +1 -1
  52. package/geometry/operators/projectOperator.js +1 -1
  53. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  54. package/interfaces.d.ts +246 -7
  55. package/layers/LinkChartLayer.js +1 -1
  56. package/layers/MapImageLayer.js +1 -1
  57. package/layers/TileLayer.js +1 -1
  58. package/package.json +1 -1
  59. package/support/revision.js +1 -1
  60. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  61. package/views/2d/layers/TileLayerView2D.js +1 -1
  62. package/views/2d/layers/support/util.js +1 -1
  63. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  64. package/views/3d/analysis/Slice/RotateManipulator.js +1 -1
  65. package/views/3d/layers/DrapedSubView3D.js +1 -1
  66. package/views/3d/layers/GraphicsView3D.js +1 -1
  67. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  68. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  69. package/views/3d/layers/MediaLayerView3D.js +1 -1
  70. package/views/3d/layers/TileLayerView3D.js +1 -1
  71. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  72. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  73. package/views/3d/layers/support/ImageHighlightHelper3D.js +5 -0
  74. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +5 -0
  75. package/views/3d/terrain/Overlay.js +1 -1
  76. package/views/3d/terrain/OverlayRenderer.js +1 -1
  77. package/views/3d/terrain/RasterTile.js +1 -1
  78. package/views/3d/terrain/TerrainRenderer.js +1 -1
  79. package/views/3d/terrain/TerrainSurface.js +1 -1
  80. package/views/3d/terrain/TileCompositor.js +1 -1
  81. package/views/3d/terrain/TileRenderer.js +1 -1
  82. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  83. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  84. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  85. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +9 -10
  86. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js +11 -0
  87. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +3 -3
  88. package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +3 -6
  89. package/views/3d/webgl-engine/core/shaderLibrary/terrain/BlendLayersOutput.js +1 -1
  90. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +1 -1
  91. package/views/3d/webgl-engine/lib/Material.js +1 -1
  92. package/views/3d/webgl-engine/lib/Program.js +1 -1
  93. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  94. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  95. package/views/3d/webgl-engine/lib/VertexAttribute.js +1 -1
  96. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  97. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  98. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  99. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  100. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  101. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  102. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  103. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  104. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  105. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  106. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  107. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  108. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  109. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  110. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  111. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  112. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  113. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  114. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  115. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  116. package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
  117. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  118. package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
  119. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  120. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  121. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  122. package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
  123. package/views/3d/webgl-engine/shaders/PointRendererTechniqueConfiguration.js +1 -1
  124. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  125. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  126. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
  127. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  128. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  129. package/views/SceneView.js +1 -1
  130. package/views/VideoView.d.ts +4 -0
  131. package/views/VideoView.js +1 -1
  132. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  133. package/views/layers/support/highlightUtils.js +5 -0
  134. package/views/support/TextureCompressionHandle.js +5 -0
  135. package/views/webgl/ShaderBuilder.js +1 -1
  136. package/views/webgl/Texture.js +1 -1
  137. package/views/webgl/TextureDescriptor.js +1 -1
  138. package/widgets/Features/FeaturesViewModel.js +1 -1
  139. package/assets/esri/core/workers/chunks/0059295780fa4a090f30.js +0 -319
  140. package/assets/esri/core/workers/chunks/3fc18638f8799b85001d.js +0 -1
  141. package/assets/esri/core/workers/chunks/81bf362ec0d23ffdc90c.js +0 -39
  142. package/assets/esri/core/workers/chunks/a59ad50d932da1e28c8f.js +0 -1
  143. package/assets/esri/core/workers/chunks/afe94e351b4a50d7bc53.js +0 -1
  144. package/assets/esri/core/workers/chunks/b8416f2560710258c239.js +0 -1
  145. package/assets/esri/core/workers/chunks/e088edb9ffbaa1ed12eb.js +0 -1
  146. package/assets/esri/core/workers/chunks/f454e773505c0eef2f9d.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as r}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{debounce as o,throwIfAborted as a}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{sqlAnd as l}from"../../../core/sql.js";import{getMetersPerUnitForSR as p}from"../../../core/unitUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{getResolutionForScale as h}from"../../../geometry/support/scaleUtils.js";import{collectFields as m}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as d}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as f}from"../../../renderers/support/clickToleranceUtils.js";import{identify as g}from"../../../rest/identify.js";import w from"../../../rest/support/IdentifyParameters.js";import{loadArcade as b}from"../../../support/loadArcade.js";import v from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as x,getFetchPopupTemplate as j}from"./popupUtils.js";let F=null;function P(e,t){return"tile"===t.type||"map-image"===t.type}let S=class extends t{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=o((async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch((()=>{})))}))}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&(t.visible=!1)}this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch((()=>{}))),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([n((()=>this.highlightGraphics),"change",(t=>e(t.added)),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:i}}}=this;if(!e)throw new s("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const o=U(r.sublayers,i,t);if(!o.length)return[];const a=await G(r,o);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!a)throw new s("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return a?this._fetchPopupFeaturesUsingQueries(e,o,t):this._fetchPopupFeaturesUsingIdentify(e,o,t)}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){const{layerView:{view:t},highlightGraphics:r,highlightGraphicUpdated:s}=this;if(r&&s)for(const i of e){const e=i.sourceLayer&&"renderer"in i.sourceLayer&&i.sourceLayer.renderer;i.sourceLayer&&"geometryType"in i.sourceLayer&&"point"===i.sourceLayer.geometryType&&e&&"getSymbolAsync"in e&&e.getSymbolAsync(i).then((async o=>{o||=new v;let a=null;const n="visualVariables"in e?e.visualVariables?.find((e=>"size"===e.type)):void 0;n&&(F||(F=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSize),a=F(n,i,{view:t.type,scale:t.scale,shape:"simple-marker"===o.type?o.style:null})),a||="width"in o&&"height"in o&&null!=o.width&&null!=o.height?Math.max(o.width,o.height):"size"in o?o.size:16,r.includes(i)&&(i.symbol=new v({style:"square",size:a,xoffset:"xoffset"in o?o.xoffset:0,yoffset:"yoffset"in o?o.yoffset:0}),s(i,"symbol"),i.visible=!0)}))}}async _updateHighlightedFeaturesGeometries(e){const{layerView:{layer:t,view:r},highlightGraphics:s,highlightGraphicUpdated:o}=this;if(this._highlightGeometriesResolution=e,!o||!s?.length||!t.capabilities.operations.supportsQuery)return;const a=this._getTargetResolution(e),n=new Map;for(const c of s)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>a){const e=c.sourceLayer;i(n,e,(()=>new Map)).set(c.getObjectId(),c)}const l=Array.from(n,(([e,t])=>{const s=e.createQuery();return s.objectIds=[...t.keys()],s.outFields=[e.objectIdField],s.returnGeometry=!0,s.maxAllowableOffset=a,s.outSpatialReference=r.spatialReference,e.queryFeatures(s)})),p=await Promise.all(l);if(!this.destroyed)for(const{features:i}of p)for(const e of i){const t=e.sourceLayer,r=n.get(t).get(e.getObjectId());r&&s.includes(r)&&(r.geometry=e.geometry,o(r,"geometry"),this._featuresResolutions.set(r,a))}}_getTargetResolution(e){const t=e*p(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const s=await this._createIdentifyParameters(e,t,r);if(null==s)return[];const{results:i}=await g(this.layerView.layer.parsedUrl,s,r);return i.map((e=>e.feature))}async _createIdentifyParameters(e,t,r){const{floors:s,layer:i,timeExtent:o,view:{spatialReference:a,scale:n}}=this.layerView;if(!t.length)return null;await Promise.all(t.map((({sublayer:e})=>e.load(r).catch((()=>{})))));const l=Math.min(has("mapservice-popup-identify-max-tolerance"),i.allSublayers.reduce(((e,t)=>t.renderer?f({renderer:t.renderer,pointerType:r?.pointerType}):e),2)),p=this.createFetchPopupFeaturesQueryGeometry(e,l),c=h(n,a),u=Math.round(p.width/c),m=new y({xmin:p.center.x-c*u,ymin:p.center.y-c*u,xmax:p.center.x+c*u,ymax:p.center.y+c*u,spatialReference:p.spatialReference});return new w({floors:s,gdbVersion:"gdbVersion"in i?i.gdbVersion:void 0,geometry:e,height:u,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:a,sublayers:i.sublayers,timeExtent:o,tolerance:l,width:u})}async _fetchPopupFeaturesUsingQueries(e,t,s){const{layerView:{floors:i,timeExtent:o}}=this,n=t.map((async({sublayer:t,popupTemplate:r})=>{if(await t.load(s).catch((()=>{})),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const n=t.createQuery(),p=f({renderer:t.renderer,pointerType:s?.pointerType}),c=this.createFetchPopupFeaturesQueryGeometry(e,p),u=new Set,[y]=await Promise.all([x(t,r),t.renderer?.collectRequiredFields(u,t.fieldsIndex)]);a(s),m(u,t.fieldsIndex,y);const h=Array.from(u).sort();n.geometry=c,n.outFields=h,n.timeExtent=o;const g=d(i,t);if(n.where=l(n.where,g),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,s="ascending"===e.order?"asc":"desc";r&&(n.orderByFields=[`${r} ${s}`])}const w=this._getTargetResolution(c.width/p),b=await _(r);a(s);const v="point"===t.geometryType||b&&b.arcadeUtils.hasGeometryOperations(r);v||(n.maxAllowableOffset=w);let{features:j}=await t.queryFeatures(n,s);const F=v?0:w;j=await R(t,j,s);for(const e of j)this._featuresResolutions.set(e,F);return j}));return(await Promise.allSettled(n)).reduce(((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e),[]).filter(r)}};function U(e,t,r){const s=[];if(!e)return s;const i=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(i);else if(e.popupEnabled){const t=j(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&s.unshift({sublayer:e,popupTemplate:t})}};return e.map(i),s}function _(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?b():Promise.resolve()}async function G(e,t){if(e.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(t.map((({sublayer:e})=>e.load().then((()=>e.capabilities.operations.supportsQuery)))))}catch{return!1}}async function R(e,t,r){const s=e.renderer;return s&&"defaultSymbol"in s&&!s.defaultSymbol&&(t=s.valueExpression?await Promise.all(t.map((e=>s.getSymbolAsync(e,r).then((t=>t?e:null))))).then((e=>e.filter((e=>null!=e)))):t.filter((e=>null!=s.getSymbol(e)))),t}e([c({constructOnly:!0})],S.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([c({constructOnly:!0})],S.prototype,"layerView",void 0),e([c({constructOnly:!0})],S.prototype,"highlightGraphics",void 0),e([c({constructOnly:!0})],S.prototype,"highlightGraphicUpdated",void 0),e([c({constructOnly:!0})],S.prototype,"updatingHandles",void 0),S=e([u("esri.views.layers.support.MapServiceLayerViewHelper")],S);export{S as MapServiceLayerViewHelper,U as collectPopupProviders,P as isMapServiceLayerView};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import r from"../../../core/Accessor.js";import{isSome as s}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{getOrCreateMapValue as o}from"../../../core/MapUtils.js";import{debounce as a,throwIfAborted as l}from"../../../core/promiseUtils.js";import{on as n}from"../../../core/reactiveUtils.js";import{sqlAnd as p}from"../../../core/sql.js";import{getMetersPerUnitForSR as c}from"../../../core/unitUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{getResolutionForScale as m}from"../../../geometry/support/scaleUtils.js";import{collectFields as d}from"../../../layers/support/fieldUtils.js";import{getLayerFloorFilterClause as f}from"../../../layers/support/floorFilterUtils.js";import{calculateTolerance as g}from"../../../renderers/support/clickToleranceUtils.js";import{identify as b}from"../../../rest/identify.js";import w from"../../../rest/support/IdentifyParameters.js";import{loadArcade as v}from"../../../support/loadArcade.js";import j from"../../../symbols/SimpleMarkerSymbol.js";import{getRequiredFields as x,getFetchPopupTemplate as S}from"./popupUtils.js";let F=null;function _(e,t){return"tile"===t.type||"map-image"===t.type}let P=class extends r{constructor(e){super(e),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=a((async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch((()=>{})))}))}initialize(){const e=e=>{for(const t of e){const{sourceLayer:e}=t;null!=e&&"geometryType"in e&&"point"===e.geometryType&&t.visible&&(t.visible=!1,this.highlightGraphicUpdated?.({graphic:t,property:"visible",oldValue:!0,newValue:!1}))}this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch((()=>{}))),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([n((()=>this.highlightGraphics),"change",(t=>e(t.added)),{onListenerAdd:t=>e(t)})])}async fetchPopupFeaturesAtLocation(e,t){const{layerView:{layer:r,view:{scale:s}}}=this;if(!e)throw new i("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:r});const o=G(r.sublayers,s,t);if(!o.length)return[];const a=await U(r,o);if(!((r.capabilities?.operations?.supportsIdentify??!0)&&r.version>=10.5)&&!a)throw new i("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:r});return a?this._fetchPopupFeaturesUsingQueries(e,o,t):this._fetchPopupFeaturesUsingIdentify(e,o,t)}clearHighlights(){this.highlightGraphics?.removeAll()}async _updateHighlightedFeaturesSymbols(e){for(const t of e)this._updateSymbology(t)}_updateSymbology(e){if("point"===e.geometry?.type)return this._updatePointSymbology(e)}_setGraphicSymbol(e,t){if(!t)return;const r=e.symbol;e.symbol=t,this.highlightGraphicUpdated?.({graphic:e,property:"symbol",oldValue:r,newValue:t})}_updatePointSymbology(e){const r=e.sourceLayer&&"renderer"in e.sourceLayer&&e.sourceLayer.renderer,{highlightGraphicUpdated:s,highlightGraphics:i,layerView:{view:o}}=this,a=e=>{e.visible||(e.visible=!0,s?.({graphic:e,property:"visible",oldValue:!1,newValue:!0}))};r&&"getSymbolAsync"in r?r.getSymbolAsync(e).then((async s=>{s||=new j;let l=null;const n="visualVariables"in r?r.visualVariables?.find((e=>"size"===e.type)):void 0;n&&(F||(F=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSize),l=F(n,e,{view:o.type,scale:o.scale,shape:"simple-marker"===s.type?s.style:null})),l||="width"in s&&"height"in s&&null!=s.width&&null!=s.height?Math.max(s.width,s.height):"size"in s?s.size:16,i?.includes(e)&&(this._setGraphicSymbol(e,new j({style:"square",size:l,color:new t([255,255,255,1/255]),xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0})),a(e))})):a(e)}async _updateHighlightedFeaturesGeometries(e){const{layerView:{layer:t,view:r},highlightGraphics:s,highlightGraphicUpdated:i}=this;if(this._highlightGeometriesResolution=e,!i||!s?.length||!t.capabilities.operations.supportsQuery)return;const a=this._getTargetResolution(e),l=new Map;for(const c of s)if(!this._featuresResolutions.has(c)||this._featuresResolutions.get(c)>a){const e=c.sourceLayer;o(l,e,(()=>new Map)).set(c.getObjectId(),c)}const n=Array.from(l,(([e,t])=>{const s=e.createQuery();return s.objectIds=[...t.keys()],s.outFields=[e.objectIdField],s.returnGeometry=!0,s.maxAllowableOffset=a,s.outSpatialReference=r.spatialReference,e.queryFeatures(s)})),p=await Promise.all(n);if(!this.destroyed)for(const{features:o}of p)for(const e of o){const t=e.sourceLayer,r=l.get(t).get(e.getObjectId());if(r&&s.includes(r)){const t=r.geometry;r.geometry=e.geometry,i({graphic:r,property:"geometry",oldValue:t,newValue:r.geometry}),this._featuresResolutions.set(r,a)}}}_getTargetResolution(e){const t=e*c(this.layerView.view.spatialReference),r=t/16;return r<=10?0:e/t*r}async _fetchPopupFeaturesUsingIdentify(e,t,r){const s=await this._createIdentifyParameters(e,t,r);if(null==s)return[];const{results:i}=await b(this.layerView.layer.parsedUrl,s,r);return i.map((e=>e.feature))}async _createIdentifyParameters(e,t,r){const{floors:s,layer:i,timeExtent:o,view:{spatialReference:a,scale:l}}=this.layerView;if(!t.length)return null;await Promise.all(t.map((({sublayer:e})=>e.load(r).catch((()=>{})))));const n=Math.min(has("mapservice-popup-identify-max-tolerance"),i.allSublayers.reduce(((e,t)=>t.renderer?g({renderer:t.renderer,pointerType:r?.pointerType}):e),2)),p=this.createFetchPopupFeaturesQueryGeometry(e,n),c=m(l,a),u=Math.round(p.width/c),h=new y({xmin:p.center.x-c*u,ymin:p.center.y-c*u,xmax:p.center.x+c*u,ymax:p.center.y+c*u,spatialReference:p.spatialReference});return new w({floors:s,gdbVersion:"gdbVersion"in i?i.gdbVersion:void 0,geometry:e,height:u,layerOption:"popup",mapExtent:h,returnGeometry:!0,spatialReference:a,sublayers:i.sublayers,timeExtent:o,tolerance:n,width:u})}async _fetchPopupFeaturesUsingQueries(e,t,r){const{layerView:{floors:i,timeExtent:o}}=this,a=t.map((async({sublayer:t,popupTemplate:s})=>{if(await t.load(r).catch((()=>{})),t.capabilities&&!t.capabilities.operations.supportsQuery)return[];const a=t.createQuery(),n=g({renderer:t.renderer,pointerType:r?.pointerType}),c=this.createFetchPopupFeaturesQueryGeometry(e,n),u=new Set,[h]=await Promise.all([x(t,s),t.renderer?.collectRequiredFields(u,t.fieldsIndex)]);l(r),d(u,t.fieldsIndex,h);const y=Array.from(u).sort();a.geometry=c,a.outFields=y,a.timeExtent=o;const m=f(i,t);if(a.where=p(a.where,m),t.capabilities?.query.supportsOrderBy&&t.orderBy?.[0]){const e=t.orderBy[0],r=!e.valueExpression&&e.field,s="ascending"===e.order?"asc":"desc";r&&(a.orderByFields=[`${r} ${s}`])}const b=this._getTargetResolution(c.width/n),w=await V(s);l(r);const v="point"===t.geometryType||w&&w.arcadeUtils.hasGeometryOperations(s);v||(a.maxAllowableOffset=b);let{features:j}=await t.queryFeatures(a,r);const S=v?0:b;j=await R(t,j,r);for(const e of j)this._featuresResolutions.set(e,S);return j}));return(await Promise.allSettled(a)).reduce(((e,t)=>"fulfilled"===t.status?[...e,...t.value]:e),[]).filter(s)}};function G(e,t,r){const s=[];if(!e)return s;const i=e=>{const o=0===e.minScale||t<=e.minScale,a=0===e.maxScale||t>=e.maxScale;if(e.visible&&o&&a)if(e.sublayers)e.sublayers.forEach(i);else if(e.popupEnabled){const t=S(e,{...r,defaultPopupTemplateEnabled:!1});null!=t&&s.unshift({sublayer:e,popupTemplate:t})}};return e.map(i),s}function V(e){return e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some((e=>"expression"===e.type))?v():Promise.resolve()}async function U(e,t){if(e.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(t.map((({sublayer:e})=>e.load().then((()=>e.capabilities.operations.supportsQuery)))))}catch{return!1}}async function R(e,t,r){const s=e.renderer;return s&&"defaultSymbol"in s&&!s.defaultSymbol&&(t=s.valueExpression?await Promise.all(t.map((e=>s.getSymbolAsync(e,r).then((t=>t?e:null))))).then((e=>e.filter((e=>null!=e)))):t.filter((e=>null!=s.getSymbol(e)))),t}e([u({constructOnly:!0})],P.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),e([u({constructOnly:!0})],P.prototype,"layerView",void 0),e([u({constructOnly:!0})],P.prototype,"highlightGraphics",void 0),e([u({constructOnly:!0})],P.prototype,"highlightGraphicUpdated",void 0),e([u({constructOnly:!0})],P.prototype,"updatingHandles",void 0),P=e([h("esri.views.layers.support.MapServiceLayerViewHelper")],P);export{P as MapServiceLayerViewHelper,G as collectPopupProviders,_ as isMapServiceLayerView};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{isSome as r}from"../../../core/arrayUtils.js";import o from"../../../core/Collection.js";import{isGraphic as t}from"../../../support/guards.js";function i(i){if(!i)return[];let e=t(i)?[i]:o.isCollection(i)?i.toArray():Array.isArray(i)?i:[];return e=e?.filter(r),0===(e?.length??0)?[]:e}export{i as getHighlightGraphics};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
+ */
5
+ import{signal as e}from"../../core/signal.js";class s{constructor(){this._texturesBeingCompressed=e(0)}get compressing(){return!!this._texturesBeingCompressed.value}increment(){this._texturesBeingCompressed.value++}decrement(){this._texturesBeingCompressed.value--}}export{s as TextureCompressionHandle};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import"../../core/has.js";import t from"../../core/Logger.js";import{BindType as r}from"./BindType.js";const n=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class i extends s{constructor(){super(...arguments),this.vertex=new c,this.fragment=new c,this.attributes=new h,this.varyings=new m,this.extensions=new _,this.outputs=new d}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),n=this.attributes.generateSource(e),s=this.varyings.generateSource(e),i="vertex"===e?this.vertex:this.fragment,o=i.uniforms.generateSource(),a=i.code.generateSource(),u=i.main.generateSource(t),c="vertex"===e?g:p,h=i.constants.generateSource(),m=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${h.join("\n")}\n${o.join("\n")}\n${n.join("\n")}\n${s.join("\n")}\n${m.join("\n")}\n${a.join("\n")}\n${u.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Bind];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Bind];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return t=>{for(let r=0;r<s;++r)n[r](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r)=>{for(let i=0;i<s;++i)n[i](e,t,r)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r,i)=>{for(let o=0;o<s;++o)n[o](e,i,t,r)}}}class o{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e(`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class a{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new e("Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class c extends s{constructor(){super(...arguments),this.uniforms=new o(this),this.main=new a(this),this.code=new u(this),this.constants=new l(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,n)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("vertex"===e?"out":"in")+` ${r.type} ${n};`))),t}}class _{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?_.ALLOWLIST_VERTEX:_.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class d{constructor(){this._entries=new Map}add(e,t,r=0){const s=this._entries.get(r);s?.name!==e||s?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:d.DEFAULT_NAME,type:d.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class l{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=l._numberToFloatStr(r);break;case"int":n=l._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])}, ${l._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"uvec2":n=`uvec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"uvec3":n=`uvec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"uvec4":n=`uvec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,(e=>l._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const p="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n#endif",g="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n\n invariant gl_Position;\n ";export{u as Code,s as Includes,a as Main,i as ShaderBuilder,c as Stage,o as Uniforms};
5
+ import e from"../../core/Error.js";import"../../core/has.js";import t from"../../core/Logger.js";import{BindType as r}from"./BindType.js";const n=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class i extends s{constructor(){super(...arguments),this.vertex=new c,this.fragment=new c,this.attributes=new h,this.varyings=new m,this.extensions=new _,this.outputs=new d}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!1){const r=this.extensions.generateSource(e),n=this.attributes.generateSource(e),s=this.varyings.generateSource(e),i="vertex"===e?this.vertex:this.fragment,o=i.uniforms.generateSource(),a=i.code.generateSource(),u=i.main.generateSource(t),c="vertex"===e?p:g,h=i.constants.generateSource(),m=this.outputs.generateSource(e);return`#version 300 es\n${r.join("\n")}\n${c}\n${h.join("\n")}\n${o.join("\n")}\n${n.join("\n")}\n${s.join("\n")}\n${m.join("\n")}\n${a.join("\n")}\n${u.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Bind];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Bind];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return t=>{for(let r=0;r<s;++r)n[r](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r)=>{for(let i=0;i<s;++i)n[i](e,t,r)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r,i)=>{for(let o=0;o<s;++o)n[o](e,i,t,r)}}}class o{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e(`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`))}get entries(){return Array.from(this._entries.values())}}class a{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new e("Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class c extends s{constructor(){super(...arguments),this.uniforms=new o(this),this.main=new a(this),this.code=new u(this),this.constants=new l(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach(((r,n)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("vertex"===e?"out":"in")+` ${r.type} ${n};`))),t}}class _{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?_.ALLOWLIST_VERTEX:_.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}static{this.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"]}static{this.ALLOWLIST_VERTEX=[]}}class d{constructor(){this._entries=new Map}add(e,t,r=0){const s=this._entries.get(r);s?.name!==e||s?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:d.DEFAULT_NAME,type:d.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}class l{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=l._numberToFloatStr(r);break;case"int":n=l._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])}, ${l._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"uvec2":n=`uvec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"uvec3":n=`uvec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"uvec4":n=`uvec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,(e=>l._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n#endif",p="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n\n invariant gl_Position;\n ";export{u as Code,s as Includes,a as Main,i as ShaderBuilder,c as Stage,o as Uniforms};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{signal as s}from"../../core/signal.js";import{checkWebGLError as o}from"./checkWebGLError.js";import{TextureType as a,ResourceType as n,CompressedTextureFormat as l,TextureSamplingMode as p,TextureConstants as m}from"./enums.js";import{GLObjectType as h}from"./GLObjectType.js";import{estimateMemory as _}from"./TextureDescriptor.js";import{isCompressedData as d,deriveInternalFormat as c,isTexImageSource as u,is3DTarget as g,validateTexture as T,isCompressedFormat as x,getDimensions as E,calcMipmapLevels as M,isSizedPixelFormat as A}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const f=null,w=()=>e.getLogger("esri/views/webgl/Texture");let b=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=h.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=s(null),"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return _(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===a.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.shouldCompress=t}setData(t){this.abortCompression(),!d(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in l&&(this._descriptor.internalFormat=void 0),this._setData(t),!d(t)&&this._descriptor.shouldCompress&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,l=0){n||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=c(p);const{context:m,pixelFormat:h,dataType:_,target:g,isImmutable:T}=p;if(T&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const x=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>p.width||s+a>p.height)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=m;l&&(o&&a||w().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,l)),u(n)?E.texSubImage2D(g,i,r,s,o,a,h,_,n):d(n)?E.compressedTexSubImage2D(g,i,r,s,o,a,p.internalFormat,n.levels[i]):E.texSubImage2D(g,i,r,s,o,a,h,_,n),l&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),m.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,l,p){p||w().error("An attempt to use uninitialized data!"),this._glName||w().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=c(m);const{context:h,pixelFormat:_,dataType:u,isImmutable:T,target:x}=m;if(T&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");g(x)||w().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+l>m.depth)&&w().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(d(p))p=p.levels[i],M.compressedTexSubImage3D(x,i,r,s,o,a,n,l,m.internalFormat,p);else{const t=p;M.texSubImage3D(x,i,r,s,o,a,n,l,_,u,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,T(i)}i.samplingMode===p.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=p.LINEAR_MIPMAP_NEAREST):i.samplingMode===p.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=p.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,T(e)}e.samplingMode===p.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=p.LINEAR):e.samplingMode===p.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=p.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,T(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=i(this._compressionAbortController.value))}_setData(i,r){const s=this._descriptor,a=s.context?.gl;if(!a)return;o(a),this._glName||(this._glName=a.createTexture(),s.context.instanceCounter.increment(n.Texture,this)),T(s);const l=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),o(a);const p=r??s.target,m=g(p);if(u(i))this._setDataFromTexImageSource(i,p);else{const{width:e,height:r,depth:n}=s;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==n)throw new t("Depth must be specified!");if(s.internalFormat=c(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,s.internalFormat,s.hasMipmap,e,r,n),d(i)){if(!x(s.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,p)}else this._texImage(p,0,s.internalFormat,e,r,n,i),o(a),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),o(a),s.context.bindTexture(l,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=a.TEXTURE_CUBE_MAP_POSITIVE_X;e<=a.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=c(r);const s=g(e),{width:a,height:n,depth:l}=E(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),s&&r.depth,s&&(r.depth=l),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,l),this._texImage(e,0,r.internalFormat,a,n,l,t),o(i),r.hasMipmap&&(this.generateMipmap(),o(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,l=M(i,s,o,a),p=Math.min(l,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,m.MAX_LEVEL,p),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),p)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!A(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?M(e,s,o,a):1;if(g(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,l,i,s,o,a)}else n.texStorage2D(e,l,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=g(e),{isImmutable:m,pixelFormat:h,dataType:_}=this._descriptor;if(m){if(null!=n){const r=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,i,0,0,0,s,o,a,h,_,r)}else l.texSubImage2D(e,i,0,0,s,o,h,_,r)}}else{const m=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texImage3D(e,i,r,s,o,a,0,h,_,m)}else l.texImage2D(e,i,r,s,o,0,h,_,m)}}_compressedTexImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=g(e);if(this._descriptor.isImmutable){if(null!=n)if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else l.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,i,r,s,o,a,0,n)}else l.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const i=!!this._descriptor.context.capabilities.compressedTextureETC,s=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(i||s){const o=new AbortController;this._compressionAbortController.value=o;const a={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!i,hasS3TC:!!s};e.compressionWorkerHandle.invoke(a,this._compressionAbortController.value.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((t=>{r(t)||o!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:n,target:l}=this._descriptor;const p=l===a.TEXTURE_3D;if(null==r||null==s||p&&null==o)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),n&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR?(i=p.LINEAR,t.hasMipmap||(r=p.LINEAR)):i!==p.NEAREST_MIPMAP_NEAREST&&i!==p.NEAREST_MIPMAP_LINEAR||(i=p.NEAREST,t.hasMipmap||(r=p.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{b as Texture,f as tracer};
5
+ import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{checkWebGLError as s}from"./checkWebGLError.js";import{TextureType as o,ResourceType as a,CompressedTextureFormat as n,TextureSamplingMode as p,TextureConstants as l}from"./enums.js";import{GLObjectType as m}from"./GLObjectType.js";import{estimateMemory as h}from"./TextureDescriptor.js";import{isCompressedData as d,deriveInternalFormat as _,isTexImageSource as c,is3DTarget as u,validateTexture as g,isCompressedFormat as T,getDimensions as x,calcMipmapLevels as E,isSizedPixelFormat as M}from"./textureUtils.js";import{ValidatedTextureDescriptor as A}from"./ValidatedTextureDescriptor.js";const I=null,f=()=>e.getLogger("esri/views/webgl/Texture");let w=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=m.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=A.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController}dispose(){this.abortCompression(),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.instanceCounter.decrement(a.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===o.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compressionHandle=t}disableCompression(){this._descriptor.compressionHandle=void 0}setData(t){this.abortCompression(),!d(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in n&&(this._descriptor.internalFormat=void 0),this._setData(t),!d(t)&&this._descriptor.compressionHandle&&this._compressOnWorker(t)}updateData(i,r,s,o,a,n,p=0){n||f().error("An attempt to use uninitialized data!"),this._glName||f().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=_(l);const{context:m,pixelFormat:h,dataType:u,target:g,isImmutable:T}=l;if(T&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const x=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>l.width||s+a>l.height)&&f().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:E}=m;p&&(o&&a||f().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),E.pixelStorei(E.UNPACK_SKIP_ROWS,p)),c(n)?E.texSubImage2D(g,i,r,s,o,a,h,u,n):d(n)?E.compressedTexSubImage2D(g,i,r,s,o,a,l.internalFormat,n.levels[i]):E.texSubImage2D(g,i,r,s,o,a,h,u,n),p&&E.pixelStorei(E.UNPACK_SKIP_ROWS,0),m.bindTexture(x,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,p,l){l||f().error("An attempt to use uninitialized data!"),this._glName||f().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=_(m);const{context:h,pixelFormat:c,dataType:g,isImmutable:T,target:x}=m;if(T&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");u(x)||f().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+p>m.depth)&&f().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(d(l))l=l.levels[i],M.compressedTexSubImage3D(x,i,r,s,o,a,n,p,m.internalFormat,l);else{const t=l;M.texSubImage3D(x,i,r,s,o,a,n,p,c,g,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(0===i.width||0===i.height)return;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,g(i)}i.samplingMode===p.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=p.LINEAR_MIPMAP_NEAREST):i.samplingMode===p.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=p.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,g(e)}e.samplingMode===p.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=p.LINEAR):e.samplingMode===p.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=p.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,g(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController=i(this._compressionAbortController))}_setData(i,r){const o=this._descriptor,n=o.context?.gl;if(!n)return;s(n),this._glName||(this._glName=n.createTexture(),o.context.instanceCounter.increment(a.Texture,this)),g(o);const p=o.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);o.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),s(n);const l=r??o.target,m=u(l);if(c(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=o;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==a)throw new t("Depth must be specified!");if(o.internalFormat=_(o),o.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,o.internalFormat,o.hasMipmap,e,r,a),d(i)){if(!T(o.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,o.internalFormat,l)}else this._texImage(l,0,o.internalFormat,e,r,a,i),s(n),o.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),s(n),o.context.bindTexture(p,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=o.TEXTURE_CUBE_MAP_POSITIVE_X;e<=o.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=_(r);const o=u(e),{width:a,height:n,depth:p}=x(t);r.width&&r.height,r.width||(r.width=a),r.height||(r.height=n),o&&r.depth,o&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,a,n,p),this._texImage(e,0,r.internalFormat,a,n,p,t),s(i),r.hasMipmap&&(this.generateMipmap(),s(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=E(i,s,o,a),m=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,l.MAX_LEVEL,m),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),m)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!M(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?E(e,s,o,a):1;if(u(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=u(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){if(!e.compressionWorkerHandle||!e.compressionWorkerHandle.isCompressible(t))return;const i=!!this._descriptor.context.capabilities.compressedTextureETC,s=!!this._descriptor.context.capabilities.compressedTextureS3TC;if(i||s){const o=new AbortController;this._compressionAbortController=o;const a=this._descriptor.compressionHandle;a.increment();const n={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!i,hasS3TC:!!s};e.compressionWorkerHandle.invoke(n,this._compressionAbortController.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController&&(this._compressionAbortController=null),a.decrement()})).catch((t=>{r(t)||o!==this._compressionAbortController||(this._compressionAbortController=null),a.decrement()}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:a,hasMipmap:n,target:p}=this._descriptor;const l=p===o.TEXTURE_3D;if(null==r||null==s||l&&null==a)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,a),n&&(1!==r||1!==s||l&&1!==a)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),l&&(a=Math.max(1,a>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR?(i=p.LINEAR,t.hasMipmap||(r=p.LINEAR)):i!==p.NEAREST_MIPMAP_NEAREST&&i!==p.NEAREST_MIPMAP_LINEAR||(i=p.NEAREST,t.hasMipmap||(r=p.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{w as Texture,I as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{TextureType as t,PixelFormat as i,PixelType as h,TextureSamplingMode as s,TextureWrapMode as e}from"./enums.js";import{getBytesPerElementFormat as p}from"./Util.js";class a{constructor(p=0,a=p){this.width=p,this.height=a,this.target=t.TEXTURE_2D,this.pixelFormat=i.RGBA,this.dataType=h.UNSIGNED_BYTE,this.samplingMode=s.LINEAR,this.wrapMode=e.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.shouldCompress=!1,this.depth=1,this.isImmutable=!1}}function r(i){return i.width<=0||i.height<=0||i.depth<=0?0:Math.round(i.width*i.height*i.depth*(i.hasMipmap?4/3:1)*(null==i.internalFormat?4:p(i.internalFormat))*(i.target===t.TEXTURE_CUBE_MAP?6:1))}export{a as TextureDescriptor,r as estimateMemory};
5
+ import{TextureType as t,PixelFormat as i,PixelType as h,TextureSamplingMode as s,TextureWrapMode as a}from"./enums.js";import{getBytesPerElementFormat as e}from"./Util.js";class p{constructor(e=0,p=e){this.width=e,this.height=p,this.target=t.TEXTURE_2D,this.pixelFormat=i.RGBA,this.dataType=h.UNSIGNED_BYTE,this.samplingMode=s.LINEAR,this.wrapMode=a.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function r(i){return i.width<=0||i.height<=0||i.depth<=0?0:Math.round(i.width*i.height*i.depth*(i.hasMipmap?4/3:1)*(null==i.internalFormat?4:e(i.internalFormat))*(i.target===t.TEXTURE_CUBE_MAP?6:1))}export{p as TextureDescriptor,r as estimateMemory};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{isSome as i}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import r from"../../core/Logger.js";import{debounce as o,isAbortError as a}from"../../core/promiseUtils.js";import n from"../../core/ReactiveSet.js";import{watch as l,when as u,sync as h}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../geometry/Point.js";import{initializeProjection as g,project as f}from"../../geometry/projection.js";import m from"../../geometry/SpatialReference.js";import{getPointFromGeometry as y}from"../../geometry/support/geometryUtils.js";import{geographicToWebMercator as w}from"../../geometry/support/webMercatorUtils.js";import{fallbackObjectIDAttribute as F}from"../../layers/LayerConstants.js";import v from"../../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as _}from"../../symbols/support/symbolUtils.js";import{system as b}from"../../time/constants.js";import{highlightsSupported as C}from"../../views/support/layerViewUtils.js";import P from"../Feature/FeatureViewModel.js";import{ActionsCollection as M,zoomToFeature as E,zoomToClusteredFeatures as V,browseClusteredFeatures as j}from"../Popup/actions.js";import{triggerAction as L,isClusterFeature as A,removeClusteredFeaturesForBrowsing as I,displayClusterExtent as R,browseAggregateFeatures as x,getSelectedTarget as T}from"../Popup/actionUtils.js";import O from"../support/AnchorElementViewModel.js";import S from"../support/GoTo.js";const B="location-scale-handle",H=()=>[E.clone()],G=()=>[V.clone(),j.clone()];let U=null;function Z(e,t){return"building-scene"===e||"2d"===t&&("map-image"===e||"tile"===e||"imagery"===e||"imagery-tile"===e)}let z=class extends(S(O)){constructor(e){super(e),this._pendingPromises=new n,this._fetchFeaturesController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this.actions=new M,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.initialDisplayMode="feature",this.selectedClusterBoundaryFeature=new t({symbol:new v({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=o((async e=>{const{spatialReference:t}=this,i=this.selectedFeature?.geometry?.type,s=this.location??e;if(i&&"mesh"!==i&&t&&s&&this.selectedFeature)if("point"!==i)try{const e=this.selectedFeature;let i=e.geometry;const r=this._getHighlightLayer(e),o=e.getObjectId();if(!r||!this.view)return;if(o){const e=this.view?.allLayerViews.find((e=>e.layer.uid===r.uid));if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:a}=await e.queryFeatures(s);i=a[0]?.geometry}if(!i||"mesh"===i.type)return;if(i=f(i,t),U||(U=await import("../../geometry/geometryEngineAsync.js")),!await U.intersects(i,s)){const t=(await U.nearestCoordinate(i,s)).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(o){a(o)||r.getLogger(this).error(o)}else this.location=y(this.selectedFeature.geometry)??s}))}initialize(){this.addHandles([this.on("view-change",(()=>this._autoClose())),l((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),l((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),l((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),l((()=>this.location),(e=>this._locationChange(e))),l((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),l((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),l((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),l((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>L({event:e,viewModel:this,view:this.view}))),u((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),h),l((()=>[this.features,this.map,this.spatialReference,this.timeZone]),(()=>this._updateFeatureVMs())),l((()=>this.view?.scale),(()=>this._viewScaleChange())),u((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),l((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new M;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:o}=this,a=r?i.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(a)??a;return u?.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new M;return e.removeAll(),e.addMany(A(this.selectedFeature)?G():H()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,o=s&&t.length;"list"!==this.initialDisplayMode?o&&i&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1):(!o||o&&i===s)&&(this.selectedFeatureIndex=-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=w(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach((e=>this._pendingPromises.add(e))),e.reduce(((e,t)=>e.finally((()=>t.then((e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)})).finally((()=>this._pendingPromises.delete(t))).catch((()=>{}))))),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some((e=>e.waitingForContent))}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=T(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){I(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?A(t)?(await R(this),await x(this)):r.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):r.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_getRoundRobinIndex(e,t){return(e+t)%t}_animationStateChange(e){this.zoomToLocation||(E.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(A(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor((this.selectedFeatureIndex+1)/this.featuresPerPage):null}_featureViewModelsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(null==i)return;const o=((i-1)*s+t)%t,a=o+s;r.slice(o,a).forEach(((t,i)=>{t&&(t.graphic??=e[o+i])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),A(e))return;return e.symbol=await _(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=e.sourceLayer?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await _(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}else this.location=y(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:s,spatialReference:r,map:o,timeZone:a,location:n}=this;if(A(t[0])||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach(((t,i)=>{if(!t)return;let h=null;if(l.some(((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h))),h)u[i]=h;else{const l=new P({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:o,view:s,timeZone:a});u[i]=l}})),l.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await(s?.when());const r=e?.spatialReference;return r&&i?(await g(r,i,null,t),s.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null})),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:s}=this;this.removeHandles(B),this.addHandles([l((()=>this.view?.scale),(()=>this._debouncedLocationUpdate(t).catch((e=>{a(e)||r.getLogger(this).error(e)})))),u((()=>!this.visible),(()=>{this.removeHandles(B)}),{once:!0})],B);const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});s?.popup&&"open"in s.popup&&s.popup.open({location:t??void 0,promises:o})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:s,view:r,visible:o}=this;if(!r||!s||!o)return;const a=this._getHighlightLayer(i);if(!a)return;const n=this._getHighlightLayerView(r,a);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&C(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,a,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter((e=>!t.includes(e)));i?.length&&(this.features=t.concat(i))}};e([c()],z.prototype,"_fetchFeaturesController",void 0),e([c({type:M})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c()],z.prototype,"activeFeature",void 0),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:M,readOnly:!0})],z.prototype,"defaultActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"featurePage",void 0),e([c({value:[]})],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureMenuOpen",void 0),e([c()],z.prototype,"featureMenuTitle",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c()],z.prototype,"initialDisplayMode",void 0),e([c({type:p})],z.prototype,"location",null),e([c()],z.prototype,"map",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c({type:m})],z.prototype,"spatialReference",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"timeZone",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c({readOnly:!0})],z.prototype,"waitingForContents",null),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([d("esri.widgets.Features.FeaturesViewModel")],z);const D=z;export{D as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import{isSome as i}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import r from"../../core/Logger.js";import{debounce as o,isAbortError as a}from"../../core/promiseUtils.js";import n from"../../core/ReactiveSet.js";import{watch as l,when as u,sync as h}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import p from"../../geometry/Point.js";import{initializeProjection as g,project as f}from"../../geometry/projection.js";import m from"../../geometry/SpatialReference.js";import{getPointFromGeometry as y}from"../../geometry/support/geometryUtils.js";import{geographicToWebMercator as w}from"../../geometry/support/webMercatorUtils.js";import{fallbackObjectIDAttribute as F}from"../../layers/LayerConstants.js";import v from"../../symbols/SimpleFillSymbol.js";import{getDisplayedSymbol as _}from"../../symbols/support/symbolUtils.js";import{system as b}from"../../time/constants.js";import{highlightsSupported as C}from"../../views/support/layerViewUtils.js";import P from"../Feature/FeatureViewModel.js";import{ActionsCollection as M,zoomToFeature as E,zoomToClusteredFeatures as V,browseClusteredFeatures as j}from"../Popup/actions.js";import{triggerAction as L,isClusterFeature as A,removeClusteredFeaturesForBrowsing as I,displayClusterExtent as R,browseAggregateFeatures as x,getSelectedTarget as T}from"../Popup/actionUtils.js";import O from"../support/AnchorElementViewModel.js";import S from"../support/GoTo.js";const B="location-scale-handle",H=()=>[E.clone()],G=()=>[V.clone(),j.clone()];let U=null;function Z(e,t){return"building-scene"===e||"map-image"===e||"tile"===e||"imagery"===e||"2d"===t&&"imagery-tile"===e}let z=class extends(S(O)){constructor(e){super(e),this._pendingPromises=new n,this._fetchFeaturesController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._selectedClusterFeature=null,this.actions=new M,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureMenuTitle=null,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.initialDisplayMode="feature",this.selectedClusterBoundaryFeature=new t({symbol:new v({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=o((async e=>{const{spatialReference:t}=this,i=this.selectedFeature?.geometry?.type,s=this.location??e;if(i&&"mesh"!==i&&t&&s&&this.selectedFeature)if("point"!==i)try{const e=this.selectedFeature;let i=e.geometry;const r=this._getHighlightLayer(e),o=e.getObjectId();if(!r||!this.view)return;if(o){const e=this.view?.allLayerViews.find((e=>e.layer.uid===r.uid));if(!e||!("queryFeatures"in e))return;const s=e.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:a}=await e.queryFeatures(s);i=a[0]?.geometry}if(!i||"mesh"===i.type)return;if(i=f(i,t),U||(U=await import("../../geometry/geometryEngineAsync.js")),!await U.intersects(i,s)){const t=(await U.nearestCoordinate(i,s)).coordinate??s;this.selectedFeature===e&&(this.location=t)}}catch(o){a(o)||r.getLogger(this).error(o)}else this.location=y(this.selectedFeature.geometry)??s}))}initialize(){this.addHandles([this.on("view-change",(()=>this._autoClose())),l((()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view]),(()=>this._highlightSelectedFeature())),l((()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view]),(()=>this._highlightActiveFeature())),l((()=>this.view?.animation?.state),(e=>this._animationStateChange(e))),l((()=>this.location),(e=>this._locationChange(e))),l((()=>this.selectedFeature),(e=>this._selectedFeatureChange(e))),l((()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage]),(()=>this._selectedFeatureIndexChange())),l((()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels]),(()=>this._setGraphicOnFeatureViewModels())),l((()=>this.featureViewModels),(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>L({event:e,viewModel:this,view:this.view}))),u((()=>!this.waitingForResult),(()=>this._waitingForResultChange()),h),l((()=>[this.features,this.map,this.spatialReference,this.timeZone]),(()=>this._updateFeatureVMs())),l((()=>this.view?.scale),(()=>this._viewScaleChange())),u((()=>!this.visible),(()=>this.browseClusterEnabled=!1)),l((()=>this.browseClusterEnabled),(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new M;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:o}=this,a=r?i.concat(t):t,n=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),l=n?.actions,u=n?.overwriteActions?l:l?.concat(a)??a;return u?.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){const e=this._get("defaultActions")||new M;return e.removeAll(),e.addMany(A(this.selectedFeature)?G():H()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,o=s&&t.length;"list"!==this.initialDisplayMode?o&&i&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=t.length?0:-1):(!o||o&&i===s)&&(this.selectedFeatureIndex=-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator,s=e?.spatialReference?.isWGS84;s&&i&&(t=w(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach((e=>this._pendingPromises.add(e))),e.reduce(((e,t)=>e.finally((()=>t.then((e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)})).finally((()=>this._pendingPromises.delete(t))).catch((()=>{}))))),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??b}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some((e=>e.waitingForContent))}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}centerAtLocation(){const{view:e}=this,t=T(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new s("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new s("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount),this}previous(){return this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount),this}disableClusterBrowsing(){I(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;"2d"===e?.type?A(t)?(await R(this),await x(this)):r.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):r.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_getRoundRobinIndex(e,t){return(e+t)%t}_animationStateChange(e){this.zoomToLocation||(E.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(i);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(A(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:s}=this;s&&i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>0?Math.floor((this.selectedFeatureIndex+1)/this.featuresPerPage):null}_featureViewModelsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(null==i)return;const o=((i-1)*s+t)%t,a=o+s;r.slice(o,a).forEach(((t,i)=>{t&&(t.graphic??=e[o+i])}))}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:s}=this;if(!e||!s)return;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),A(e))return;return e.symbol=await _(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature)}const r=e.sourceLayer?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await _(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const e=s.center?.clone();e&&(this.location=e)}}else this.location=y(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:s,spatialReference:r,map:o,timeZone:a,location:n}=this;if(A(t[0])||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const l=i.slice(),u=[];t.forEach(((t,i)=>{if(!t)return;let h=null;if(l.some(((e,i)=>(e&&e.graphic===t&&(h=e,l.splice(i,1)),!!h))),h)u[i]=h;else{const l=new P({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:o,view:s,timeZone:a});u[i]=l}})),l.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",u)}async _getScreenPoint(e,t){const{spatialReference:i,view:s}=this;if(!s)return null;await(s?.when());const r=e?.spatialReference;return r&&i?(await g(r,i,null,t),s.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:s}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:r}=s;this._fetchFeaturesController=s;const o=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:r,event:i});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null})),o}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:s}=this;this.removeHandles(B),this.addHandles([l((()=>this.view?.scale),(()=>this._debouncedLocationUpdate(t).catch((e=>{a(e)||r.getLogger(this).error(e)})))),u((()=>!this.visible),(()=>{this.removeHandles(B)}),{once:!0})],B);const{pendingFeatures:o}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});s?.popup&&"open"in s.popup&&s.popup.open({location:t??void 0,promises:o})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:"map-notes"===i?.type||"subtype-group"===i?.type?i:t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(Z(t.type,i))return e;const s=e.getObjectId();if(null!=s)return s;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,o=e.attributes;return o&&r&&o[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:s,view:r,visible:o}=this;if(!r||!s||!o)return;const a=this._getHighlightLayer(i);if(!a)return;const n=this._getHighlightLayerView(r,a);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&C(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,a,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}_updateFeatures(e){const{features:t}=this,i=e.filter((e=>!t.includes(e)));i?.length&&(this.features=t.concat(i))}};e([c()],z.prototype,"_fetchFeaturesController",void 0),e([c({type:M})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c()],z.prototype,"activeFeature",void 0),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:M,readOnly:!0})],z.prototype,"defaultActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"featurePage",void 0),e([c({value:[]})],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureMenuOpen",void 0),e([c()],z.prototype,"featureMenuTitle",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c()],z.prototype,"initialDisplayMode",void 0),e([c({type:p})],z.prototype,"location",null),e([c()],z.prototype,"map",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c({type:m})],z.prototype,"spatialReference",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"timeZone",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c({readOnly:!0})],z.prototype,"waitingForContents",null),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([d("esri.widgets.Features.FeaturesViewModel")],z);const D=z;export{D as default};