@arcgis/core 4.34.0-next.42 → 4.34.0-next.44

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 (227) hide show
  1. package/Basemap.js +1 -1
  2. package/Ground.js +1 -1
  3. package/PopupTemplate.js +1 -1
  4. package/WebDocument2D.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/07eea90733834313e9fa.js +1 -0
  8. package/assets/esri/core/workers/chunks/08840c4d3df711065571.js +1 -0
  9. package/assets/esri/core/workers/chunks/0d73afce787ee1e76b21.js +1 -0
  10. package/assets/esri/core/workers/chunks/0ebf666564d323d82259.js +1 -0
  11. package/assets/esri/core/workers/chunks/1a3a4c2c642899be37a0.js +1 -0
  12. package/assets/esri/core/workers/chunks/20ffac42ff5095af00fe.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d465e1b3a8a53d9c0a12.js → 24e76fa530fc0c495fb5.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{9247d768c3eccc0828a9.js → 28d71e1b866113650c75.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{31e6eb2685872baf538a.js → 2aac5d560e4c5defe882.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{85bfd380d4f522ff8e83.js → 2ae50b02cdf126a8b562.js} +1 -1
  17. package/assets/esri/core/workers/chunks/349da65a8793f7873366.js +22 -0
  18. package/assets/esri/core/workers/chunks/4622a3e64d3c4aafa56b.js +1 -0
  19. package/assets/esri/core/workers/chunks/{eea3e0bd17479a767160.js → 48514235c32917e43a3f.js} +55 -54
  20. package/assets/esri/core/workers/chunks/5ae6e2b3557fe8730072.js +1 -0
  21. package/assets/esri/core/workers/chunks/5f28470304b57e24d94c.js +1 -0
  22. package/assets/esri/core/workers/chunks/655b8d24ffe5405f8ba1.js +1 -0
  23. package/assets/esri/core/workers/chunks/6cd828cfe41e0cab2068.js +1 -0
  24. package/assets/esri/core/workers/chunks/{ad106f5f6d6848f40de3.js → 71b222089f5e9dcee474.js} +1 -1
  25. package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +1 -0
  26. package/assets/esri/core/workers/chunks/{962c0ef63de1635fb4aa.js → 7e99fc78bd0f40a8ba81.js} +1 -1
  27. package/assets/esri/core/workers/chunks/863e87ac982d7727b435.js +1 -0
  28. package/assets/esri/core/workers/chunks/8867368ab9b005460f19.js +353 -0
  29. package/assets/esri/core/workers/chunks/892623d938583cd0f006.js +1 -0
  30. package/assets/esri/core/workers/chunks/{d5d2d4df407cf078bb81.js → 97fc21355efc7b289f3b.js} +1 -1
  31. package/assets/esri/core/workers/chunks/99daf4b144838fa9ca67.js +1 -0
  32. package/assets/esri/core/workers/chunks/9d9a7333a968065b53a1.js +1 -0
  33. package/assets/esri/core/workers/chunks/{cca36750c86352c6d1f9.js → a638f1688ac9525a52a7.js} +1 -1
  34. package/assets/esri/core/workers/chunks/ab3c018c406dcd81ef9e.js +1 -0
  35. package/assets/esri/core/workers/chunks/af98c7546be409303213.js +1 -0
  36. package/assets/esri/core/workers/chunks/b01a90ce699058307bc2.js +1 -0
  37. package/assets/esri/core/workers/chunks/{9e7af4c3c0f8cf0f5c5b.js → b4251e10621fb3ad03a3.js} +1 -1
  38. package/assets/esri/core/workers/chunks/b79aa5ba0424641f878b.js +1 -0
  39. package/assets/esri/core/workers/chunks/bb56defb6dfb9b2c1f27.js +1 -0
  40. package/assets/esri/core/workers/chunks/c6da9ba188b627ab3b79.js +1 -0
  41. package/assets/esri/core/workers/chunks/{9c60599131860f635483.js → cd6398a2951922e13b86.js} +1 -1
  42. package/assets/esri/core/workers/chunks/ceb63ca9ad473c3f1820.js +1 -0
  43. package/assets/esri/core/workers/chunks/d392fbbcfac2a1b54bd6.js +1 -0
  44. package/assets/esri/core/workers/chunks/d547b27ac750953a998f.js +1 -0
  45. package/assets/esri/core/workers/chunks/{7d082bfcd13ad6e8c89d.js → d552b22219ec795aff89.js} +1 -1
  46. package/assets/esri/core/workers/chunks/dbc9bb3011f16ce33f71.js +1 -0
  47. package/assets/esri/core/workers/chunks/{7f523fa4d4ade4316625.js → e19cd07df8ce87e18832.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{c8d57588267e2fc4406c.js → e3f5afdf133c58b3d161.js} +1 -1
  49. package/assets/esri/core/workers/chunks/e505a101621de39de280.js +1 -0
  50. package/assets/esri/core/workers/chunks/e5aeb34d918dee539694.js +1 -0
  51. package/assets/esri/core/workers/chunks/e7806a57d29bca385f1d.js +1 -0
  52. package/assets/esri/core/workers/chunks/{712c740cf58c2e282efc.js → e962e6b47cb7e5a71c24.js} +1 -1
  53. package/assets/esri/core/workers/chunks/eafc4da265469e9e5e0b.js +1 -0
  54. package/assets/esri/core/workers/chunks/{88308a0dcc479688e67c.js → f1adf8ebc2c1b93857bf.js} +1 -1
  55. package/assets/esri/core/workers/chunks/f1b02c4bd5fde235212b.js +1 -0
  56. package/assets/esri/core/workers/chunks/f65b2d3a91a0c726fee4.js +1 -0
  57. package/assets/esri/core/workers/chunks/f667096ea325f690c4a6.js +1 -0
  58. package/assets/esri/core/workers/chunks/fe55833c80cf59df9c2b.js +1 -0
  59. package/assets/esri/libs/i3s/i3s.wasm +0 -0
  60. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace.json +1 -1
  61. package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
  62. package/chunks/ComponentShader.glsl.js +6 -5
  63. package/chunks/i3s.js +1 -1
  64. package/config.js +1 -1
  65. package/core/floatRGBA.js +1 -1
  66. package/graphic/graphicOrigins.d.ts +2 -0
  67. package/interfaces.d.ts +281 -124
  68. package/kernel.js +1 -1
  69. package/layers/CSVLayer.js +1 -1
  70. package/layers/GeoJSONLayer.js +1 -1
  71. package/layers/GraphicsLayer.js +1 -1
  72. package/layers/ImageryTileLayer.js +1 -1
  73. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  74. package/layers/IntegratedMeshLayer.js +1 -1
  75. package/layers/Layer.js +1 -1
  76. package/layers/MapImageLayer.js +1 -1
  77. package/layers/MediaLayer.js +1 -1
  78. package/layers/OrientedImageryLayer.js +1 -1
  79. package/layers/SceneLayer.js +1 -1
  80. package/layers/TileLayer.js +1 -1
  81. package/layers/VectorTileLayer.js +1 -1
  82. package/layers/WCSLayer.js +1 -1
  83. package/layers/WMSLayer.js +1 -1
  84. package/layers/WebTileLayer.js +1 -1
  85. package/layers/mixins/ArcGISImageService.js +1 -1
  86. package/layers/mixins/TemporalSceneLayer.js +1 -1
  87. package/layers/support/BuildingFilter.js +1 -1
  88. package/layers/support/LayerContingentValuesCache.js +1 -1
  89. package/layers/support/MapImage.js +1 -1
  90. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  91. package/networks/Network.js +1 -1
  92. package/package.json +1 -1
  93. package/portal/Portal.js +1 -1
  94. package/portal/PortalItem.js +1 -1
  95. package/portal/schemas/definitions.js +1 -1
  96. package/renderers/DotDensityRenderer.js +1 -1
  97. package/renderers/FlowRenderer.js +1 -1
  98. package/renderers/VectorFieldRenderer.js +1 -1
  99. package/renderers/support/ColormapInfo.js +1 -1
  100. package/rest/featureService/FeatureService.js +1 -1
  101. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
  102. package/rest/support/AlgorithmicColorRamp.js +1 -1
  103. package/rest/support/AttributeBinsFeatureSet.js +1 -1
  104. package/rest/support/DirectionsFeature.js +1 -1
  105. package/rest/support/FindImagesParameters.js +1 -1
  106. package/rest/support/ImageAreaParameters.js +1 -1
  107. package/rest/support/ImageBoundaryParameters.js +1 -1
  108. package/rest/support/ImageDistanceParameters.js +1 -1
  109. package/rest/support/ImageGPSInfoParameters.js +1 -1
  110. package/rest/support/ImageHeightParameters.js +1 -1
  111. package/rest/support/ImageHistogramParameters.js +1 -1
  112. package/rest/support/ImageIdentifyParameters.js +1 -1
  113. package/rest/support/ImagePixelLocationParameters.js +1 -1
  114. package/rest/support/ImagePointParameters.js +1 -1
  115. package/rest/support/ImageToMapMultirayParameters.js +1 -1
  116. package/rest/support/ImageToMapParameters.js +1 -1
  117. package/rest/support/ImageUrlParameters.js +1 -1
  118. package/rest/support/MapToImageParameters.js +1 -1
  119. package/rest/support/MeasureFromImageParameters.js +1 -1
  120. package/rest/support/MultipartColorRamp.js +1 -1
  121. package/support/revision.js +1 -1
  122. package/support/zipUtils.js +1 -1
  123. package/symbols/cim/animationUtils.js +1 -1
  124. package/symbols/support/gfxUtils.js +1 -1
  125. package/symbols/support/symbolLayerUtils.js +1 -1
  126. package/versionManagement/VersionManagementService.js +1 -1
  127. package/versionManagement/VersioningState.js +1 -1
  128. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
  130. package/views/2d/input/handlers/MouseWheelZoom.js +1 -1
  131. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  132. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  133. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  134. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  135. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  136. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  137. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  138. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  139. package/views/3d/layers/FlowSubView3D.js +1 -1
  140. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  141. package/views/3d/layers/I3SMeshView3D.js +1 -1
  142. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  143. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  144. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  145. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  146. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  147. package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
  148. package/views/3d/support/flow/StreamlineResources3D.js +5 -0
  149. package/views/3d/support/flow/StreamlineResources3DOverlay.js +5 -0
  150. package/views/3d/support/flow/StreamlineResources3DShape.js +5 -0
  151. package/views/3d/support/flow/geometryUtils.js +1 -1
  152. package/views/3d/terrain/OverlayRenderer.js +1 -1
  153. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  154. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  155. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  156. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +21 -14
  157. package/views/3d/webgl-engine/collections/Component/UniformComponentParameters.js +1 -1
  158. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +5 -5
  159. package/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js +7 -0
  160. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  161. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  162. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  163. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  164. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  165. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +7 -6
  166. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  167. package/views/SelectionManager.js +1 -1
  168. package/views/View.js +1 -1
  169. package/views/View2D.js +1 -1
  170. package/views/draw/Draw.js +1 -1
  171. package/webscene/spec-certification/compare.js +1 -1
  172. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  173. package/widgets/Editor/workflowUtils.js +1 -1
  174. package/widgets/FeatureForm/GroupInput.js +1 -1
  175. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  176. package/widgets/FeatureTable.js +1 -1
  177. package/widgets/Features/FeaturesViewModel.js +1 -1
  178. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  179. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  180. package/widgets/Widget.js +1 -1
  181. package/widgets/smartMapping/ClassedColorSlider/ClassedColorSliderViewModel.js +1 -1
  182. package/widgets/smartMapping/ClassedSizeSlider/ClassedSizeSliderViewModel.js +1 -1
  183. package/widgets/smartMapping/ColorSizeSlider/ColorSizeSliderViewModel.js +1 -1
  184. package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
  185. package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
  186. package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
  187. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  188. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  189. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  190. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  191. package/assets/esri/core/workers/chunks/00ae094cc21bc42faa54.js +0 -1
  192. package/assets/esri/core/workers/chunks/016d421114118307d4dd.js +0 -1
  193. package/assets/esri/core/workers/chunks/1cd15aa69f85ecfa32b0.js +0 -1
  194. package/assets/esri/core/workers/chunks/21a9f9c0cc1cde2fee90.js +0 -1
  195. package/assets/esri/core/workers/chunks/2ae0bda04fd5386b462f.js +0 -1
  196. package/assets/esri/core/workers/chunks/3358c1b04490706681cc.js +0 -1
  197. package/assets/esri/core/workers/chunks/364fb103cb139f26b455.js +0 -1
  198. package/assets/esri/core/workers/chunks/4ae15645e68e7f6dd6b7.js +0 -1
  199. package/assets/esri/core/workers/chunks/5156410dd84ea1232a6c.js +0 -1
  200. package/assets/esri/core/workers/chunks/560bb06cf1bf30df4af3.js +0 -1
  201. package/assets/esri/core/workers/chunks/5f11fff5bc16fdec42db.js +0 -1
  202. package/assets/esri/core/workers/chunks/647cff1eaaf1b622f439.js +0 -1
  203. package/assets/esri/core/workers/chunks/6b5b609b357924fa35be.js +0 -1
  204. package/assets/esri/core/workers/chunks/6b73926feb5c5d957062.js +0 -1
  205. package/assets/esri/core/workers/chunks/6c167daf115cd6abb3e5.js +0 -1
  206. package/assets/esri/core/workers/chunks/719b89341b26c3568c2f.js +0 -1
  207. package/assets/esri/core/workers/chunks/791b3130b34b52160c1f.js +0 -1
  208. package/assets/esri/core/workers/chunks/79b389baf972d329c38d.js +0 -1
  209. package/assets/esri/core/workers/chunks/7a5808c6e67c43274d86.js +0 -1
  210. package/assets/esri/core/workers/chunks/7ef7f3925495b9ade88c.js +0 -1
  211. package/assets/esri/core/workers/chunks/82955562805ad5514ed8.js +0 -346
  212. package/assets/esri/core/workers/chunks/90a9b618058dc41294de.js +0 -1
  213. package/assets/esri/core/workers/chunks/95f0c15d83d1f38e01d0.js +0 -1
  214. package/assets/esri/core/workers/chunks/98ac849cccc4d5316021.js +0 -1
  215. package/assets/esri/core/workers/chunks/a13a36207f265f720255.js +0 -1
  216. package/assets/esri/core/workers/chunks/a36be186ad10200c420c.js +0 -1
  217. package/assets/esri/core/workers/chunks/ad1e5c24c1eae5ab8e45.js +0 -1
  218. package/assets/esri/core/workers/chunks/b481807b31e59cce9931.js +0 -1
  219. package/assets/esri/core/workers/chunks/bc27cdd7c415ab166536.js +0 -1
  220. package/assets/esri/core/workers/chunks/c474800508e3ad5ce9d7.js +0 -1
  221. package/assets/esri/core/workers/chunks/c52314b987c63cd630f7.js +0 -1
  222. package/assets/esri/core/workers/chunks/d1635a7ab0c204852237.js +0 -1
  223. package/assets/esri/core/workers/chunks/da228aed337f492456cc.js +0 -1
  224. package/assets/esri/core/workers/chunks/e08b2e9213d35f85916f.js +0 -1
  225. package/assets/esri/core/workers/chunks/ec9ed7c9d64f88fcb806.js +0 -1
  226. package/assets/esri/core/workers/chunks/fb84fa28978a1820a725.js +0 -1
  227. package/views/3d/support/flow/StreamlinesResources3D.js +0 -5
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.42",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.44",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../core/Error.js";import{throwIfAbortError as t}from"../core/promiseUtils.js";import{urlToObject as i}from"../core/urlUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as s}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/SpatialReference.js";import l from"../graphic/CSVGraphicOrigin.js";import d from"./FeatureLayer.js";import{CSVSource as u}from"./graphics/sources/CSVSource.js";import{createCapabilities as c}from"./graphics/sources/support/clientSideDefaults.js";import p from"../rest/support/Query.js";import{w as h,r as y}from"../chunks/persistableUrlUtils.js";function m(e,t){throw new r(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let g=class extends d{constructor(...e){super(...e),this.geometryType="point",this.capabilities=c(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.graphicOrigin=new l(this),this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=n.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(t).then(async()=>this.initLayerProperties(await this.createGraphicsSource(r)));return this.addResolvingPromise(i),Promise.resolve(this)}get isTable(){return this.loaded&&null==this.geometryType}readWebMapLabelsVisible(e,r){return null!=r.showLabels?r.showLabels:!!r.layerDefinition?.drawingInfo?.labelingInfo}set url(e){if(!e)return void this._set("url",e);const r=i(e);this._set("url",r.path),r.query&&(this.customParameters={...this.customParameters,...r.query})}async createGraphicsSource(e){const r=new u({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",r),await r.load({signal:e}),this.read({locationInfo:r.locationInfo,columnDelimiter:r.delimiter},{origin:"service",url:this.parsedUrl}),r}queryFeatures(e,r){return this.load().then(()=>this.source.queryFeatures(p.from(e)||this.createQuery())).then(e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this,r.origin=this.graphicOrigin;return e})}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(p.from(e)||this.createQuery())}queryFeatureCount(e,r){return this.load().then(()=>this.source.queryFeatureCount(p.from(e)||this.createQuery()))}queryExtent(e,r){return this.load().then(()=>this.source.queryExtent(p.from(e)||this.createQuery()))}read(e,r){super.read(e,r),r&&"service"===r.origin&&this.revert(["latitudeField","longitudeField"],"service")}write(e,r){return super.write(e,{...r,writeLayerSchema:!0})}clone(){throw new r("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return m(this,"csv-layer:save")}async saveAs(e,r){return m(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh(this.customParameters);return null!=r&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};e([o({readOnly:!0,json:{read:!1,write:!1}})],g.prototype,"capabilities",void 0),e([o({type:[","," ",";","|","\t"],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],g.prototype,"delimiter",void 0),e([o({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],g.prototype,"editingEnabled",void 0),e([o({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],g.prototype,"fields",void 0),e([o({readOnly:!0})],g.prototype,"graphicOrigin",void 0),e([o({type:Boolean,readOnly:!0})],g.prototype,"isTable",null),e([s("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],g.prototype,"readWebMapLabelsVisible",null),e([o({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],g.prototype,"latitudeField",void 0),e([o({type:["show","hide"]})],g.prototype,"listMode",void 0),e([o({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],g.prototype,"locationType",void 0),e([o({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],g.prototype,"longitudeField",void 0),e([o({type:["CSV"]})],g.prototype,"operationalLayerType",void 0),e([o()],g.prototype,"outFields",void 0),e([o({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],g.prototype,"path",void 0),e([o({json:{read:!1},cast:null,type:u,readOnly:!0})],g.prototype,"source",void 0),e([o({json:{read:!1},value:"csv",readOnly:!0})],g.prototype,"type",void 0),e([o({json:{read:y,write:{isRequired:!0,ignoreOrigin:!0,writer:h}}})],g.prototype,"url",null),g=e([a("esri.layers.CSVLayer")],g);const f=g;export{f as default};
5
+ import{__decorate as e}from"tslib";import r from"../core/Error.js";import{throwIfAbortError as t}from"../core/promiseUtils.js";import{urlToObject as i}from"../core/urlUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as s}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/SpatialReference.js";import l from"../graphic/CSVGraphicOrigin.js";import d from"./FeatureLayer.js";import{CSVSource as u}from"./graphics/sources/CSVSource.js";import{createCapabilities as p}from"./graphics/sources/support/clientSideDefaults.js";import c from"../rest/support/Query.js";import{w as h,r as y}from"../chunks/persistableUrlUtils.js";function m(e,t){throw new r(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let g=class extends d{constructor(...e){super(...e),this.geometryType="point",this.capabilities=p(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.graphicOrigin=new l(this),this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=n.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(t).then(async()=>this.initLayerProperties(await this.createGraphicsSource(r)));return this.addResolvingPromise(i),Promise.resolve(this)}set portalItem(e){super.portalItem=e}get isTable(){return this.loaded&&null==this.geometryType}readWebMapLabelsVisible(e,r){return null!=r.showLabels?r.showLabels:!!r.layerDefinition?.drawingInfo?.labelingInfo}set url(e){if(!e)return void this._set("url",e);const r=i(e);this._set("url",r.path),r.query&&(this.customParameters={...this.customParameters,...r.query})}async createGraphicsSource(e){const r=new u({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",r),await r.load({signal:e}),this.read({locationInfo:r.locationInfo,columnDelimiter:r.delimiter},{origin:"service",url:this.parsedUrl}),r}queryFeatures(e,r){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery())).then(e=>{if(e?.features)for(const r of e.features)r.layer=r.sourceLayer=this,r.origin=this.graphicOrigin;return e})}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(c.from(e)||this.createQuery())}queryFeatureCount(e,r){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery()))}queryExtent(e,r){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery()))}read(e,r){super.read(e,r),r&&"service"===r.origin&&this.revert(["latitudeField","longitudeField"],"service")}write(e,r){return super.write(e,{...r,writeLayerSchema:!0})}clone(){throw new r("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return m(this,"csv-layer:save")}async saveAs(e,r){return m(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh(this.customParameters);return null!=r&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};e([o({readOnly:!0,json:{read:!1,write:!1}})],g.prototype,"capabilities",void 0),e([o({type:[","," ",";","|","\t"],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],g.prototype,"delimiter",void 0),e([o({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],g.prototype,"editingEnabled",void 0),e([o({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],g.prototype,"fields",void 0),e([o({readOnly:!0})],g.prototype,"graphicOrigin",void 0),e([o({type:Boolean,readOnly:!0})],g.prototype,"isTable",null),e([s("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],g.prototype,"readWebMapLabelsVisible",null),e([o({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],g.prototype,"latitudeField",void 0),e([o({type:["show","hide"]})],g.prototype,"listMode",void 0),e([o({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],g.prototype,"locationType",void 0),e([o({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],g.prototype,"longitudeField",void 0),e([o({type:["CSV"]})],g.prototype,"operationalLayerType",void 0),e([o()],g.prototype,"outFields",void 0),e([o({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],g.prototype,"path",void 0),e([o({json:{read:!1},cast:null,type:u,readOnly:!0})],g.prototype,"source",void 0),e([o({json:{read:!1},value:"csv",readOnly:!0})],g.prototype,"type",void 0),e([o({json:{read:y,write:{isRequired:!0,ignoreOrigin:!0,writer:h}}})],g.prototype,"url",null),g=e([a("esri.layers.CSVLayer")],g);const f=g;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as i}from"../core/promiseUtils.js";import{urlToObject as o}from"../core/urlUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/Extent.js";import a from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as l}from"../geometry/support/typeUtils.js";import u from"../graphic/GeoJSONGraphicOrigin.js";import d from"./Layer.js";import{GeoJSONSource as m}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as c}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as f}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as g}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{TrackableLayer as F}from"./mixins/TrackableLayer.js";import{attributeTableTemplate as T,elevationInfo as S,id as w,labelsVisible as E,legendEnabled as L,opacity as P,popupEnabled as q,screenSizePerspectiveEnabled as G,url as J}from"./support/commonProperties.js";import{validateBinsQuery as N}from"./support/featureLayerUtils.js";import U from"./support/FeatureTemplate.js";import D from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as Q,fixTimeInfoFields as B}from"./support/fieldUtils.js";import C from"./support/LabelClass.js";import{reader as Z}from"./support/labelingInfo.js";import{webSceneRendererTypes as V,rendererTypes as _}from"../renderers/support/typeUtils.js";import A from"../rest/support/Query.js";import{createPopupTemplate as M}from"../support/popupUtils.js";import{timeZoneProperty as z}from"../time/timeZoneUtils.js";const k=R();let W=class extends(v(h(c(g(f(y(I(F(O(x(j(b(r(d)))))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new u(this),this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new m({layer:this}),this.spatialReference=a.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(i).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),Q(this.renderer,this.fieldsIndex),B(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return o(this.url)}set renderer(e){Q(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=o(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");await this.load();const i=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),i}createPopupTemplate(e){return M(this,e)}createQuery(){const e=new A,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(A.from(e)||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(A.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(A.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(A.from(e)||this.createQuery(),t))}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();N(e,i,"GeoJSONLayer");const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const p of s.features)p.layer=p.sourceLayer=this;return s}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([s(T)],W.prototype,"attributeTableTemplate",void 0),e([s({readOnly:!0,json:{read:!1,write:!1}})],W.prototype,"capabilities",null),e([s({type:String})],W.prototype,"copyright",void 0),e([s({readOnly:!0})],W.prototype,"createQueryVersion",null),e([s(z("dateFieldsTimeReference"))],W.prototype,"dateFieldsTimeZone",void 0),e([s({readOnly:!0})],W.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],W.prototype,"definitionExpression",void 0),e([s({type:String})],W.prototype,"displayField",void 0),e([s({type:Boolean})],W.prototype,"editingEnabled",void 0),e([s(S)],W.prototype,"elevationInfo",void 0),e([s({type:[D],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],W.prototype,"fields",void 0),e([s(k.fieldsIndex)],W.prototype,"fieldsIndex",void 0),e([s({type:n,json:{name:"extent"}})],W.prototype,"fullExtent",void 0),e([s({type:["point","polygon","polyline","multipoint"],json:{read:{reader:l.read}}})],W.prototype,"geometryType",void 0),e([s({readOnly:!0,clonable:!1})],W.prototype,"graphicOrigin",void 0),e([s({type:Boolean})],W.prototype,"hasZ",void 0),e([s(w)],W.prototype,"id",void 0),e([s({type:Boolean,readOnly:!0})],W.prototype,"isTable",null),e([s(E)],W.prototype,"labelsVisible",void 0),e([s({type:[C],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Z},write:!0}})],W.prototype,"labelingInfo",void 0),e([s(L)],W.prototype,"legendEnabled",void 0),e([s({type:["show","hide"]})],W.prototype,"listMode",void 0),e([s({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],W.prototype,"objectIdField",void 0),e([s(P)],W.prototype,"opacity",void 0),e([s({type:["GeoJSON"]})],W.prototype,"operationalLayerType",void 0),e([s(k.outFields)],W.prototype,"outFields",void 0),e([s({readOnly:!0})],W.prototype,"parsedUrl",null),e([s(q)],W.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],W.prototype,"popupTemplate",void 0),e([s({types:_,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:V}}}})],W.prototype,"renderer",null),e([s(G)],W.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],W.prototype,"source",void 0),e([s({type:a})],W.prototype,"spatialReference",void 0),e([s({type:[U]})],W.prototype,"templates",void 0),e([s()],W.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],W.prototype,"type",void 0),e([s(J)],W.prototype,"url",null),W=e([p("esri.layers.GeoJSONLayer")],W);const H=W;export{H as default};
5
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as i}from"../core/promiseUtils.js";import{urlToObject as o}from"../core/urlUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/Extent.js";import a from"../geometry/SpatialReference.js";import{featureGeometryTypeKebabDictionary as l}from"../geometry/support/typeUtils.js";import u from"../graphic/GeoJSONGraphicOrigin.js";import d from"./Layer.js";import{GeoJSONSource as m}from"./graphics/sources/GeoJSONSource.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as c}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as h}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as f}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as g}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as O}from"./mixins/TemporalLayer.js";import{TrackableLayer as F}from"./mixins/TrackableLayer.js";import{attributeTableTemplate as T,elevationInfo as S,id as w,labelsVisible as E,legendEnabled as L,opacity as P,popupEnabled as q,screenSizePerspectiveEnabled as G,url as J}from"./support/commonProperties.js";import{validateBinsQuery as N}from"./support/featureLayerUtils.js";import U from"./support/FeatureTemplate.js";import D from"./support/Field.js";import{defineFieldProperties as R}from"./support/fieldProperties.js";import{fixRendererFields as Q,fixTimeInfoFields as B}from"./support/fieldUtils.js";import C from"./support/LabelClass.js";import{reader as Z}from"./support/labelingInfo.js";import{webSceneRendererTypes as V,rendererTypes as _}from"../renderers/support/typeUtils.js";import A from"../rest/support/Query.js";import{createPopupTemplate as M}from"../support/popupUtils.js";import{timeZoneProperty as z}from"../time/timeZoneUtils.js";const k=R();let W=class extends(v(h(c(g(f(y(O(F(I(x(j(b(r(d)))))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new u(this),this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new m({layer:this}),this.spatialReference=a.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(i).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),Q(this.renderer,this.fieldsIndex),B(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}set portalItem(e){super.portalItem=e}set timeInfo(e){super.timeInfo=e}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&null==this.geometryType}get parsedUrl(){return o(this.url)}set renderer(e){Q(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=o(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");await this.load();const i=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),i}createPopupTemplate(e){return M(this,e)}createQuery(){const e=new A,t=this.capabilities?.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e}getFieldDomain(e,t){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(A.from(e)||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(A.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(A.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(A.from(e)||this.createQuery(),t))}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();N(e,i,"GeoJSONLayer");const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const p of s.features)p.layer=p.sourceLayer=this;return s}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return null!=t&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};e([s(T)],W.prototype,"attributeTableTemplate",void 0),e([s({readOnly:!0,json:{read:!1,write:!1}})],W.prototype,"capabilities",null),e([s({type:String})],W.prototype,"copyright",void 0),e([s({readOnly:!0})],W.prototype,"createQueryVersion",null),e([s(z("dateFieldsTimeReference"))],W.prototype,"dateFieldsTimeZone",void 0),e([s({readOnly:!0})],W.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],W.prototype,"definitionExpression",void 0),e([s({type:String})],W.prototype,"displayField",void 0),e([s({type:Boolean})],W.prototype,"editingEnabled",void 0),e([s(S)],W.prototype,"elevationInfo",void 0),e([s({type:[D],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],W.prototype,"fields",void 0),e([s(k.fieldsIndex)],W.prototype,"fieldsIndex",void 0),e([s({type:n,json:{name:"extent"}})],W.prototype,"fullExtent",void 0),e([s({type:["point","polygon","polyline","multipoint"],json:{read:{reader:l.read}}})],W.prototype,"geometryType",void 0),e([s({readOnly:!0,clonable:!1})],W.prototype,"graphicOrigin",void 0),e([s({type:Boolean})],W.prototype,"hasZ",void 0),e([s(w)],W.prototype,"id",void 0),e([s({type:Boolean,readOnly:!0})],W.prototype,"isTable",null),e([s(E)],W.prototype,"labelsVisible",void 0),e([s({type:[C],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Z},write:!0}})],W.prototype,"labelingInfo",void 0),e([s(L)],W.prototype,"legendEnabled",void 0),e([s({type:["show","hide"]})],W.prototype,"listMode",void 0),e([s({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],W.prototype,"objectIdField",void 0),e([s(P)],W.prototype,"opacity",void 0),e([s({type:["GeoJSON"]})],W.prototype,"operationalLayerType",void 0),e([s(k.outFields)],W.prototype,"outFields",void 0),e([s({readOnly:!0})],W.prototype,"parsedUrl",null),e([s(q)],W.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:!0}})],W.prototype,"popupTemplate",void 0),e([s({types:_,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:V}}}})],W.prototype,"renderer",null),e([s(G)],W.prototype,"screenSizePerspectiveEnabled",void 0),e([s({readOnly:!0})],W.prototype,"source",void 0),e([s({type:a})],W.prototype,"spatialReference",void 0),e([s({type:[U]})],W.prototype,"templates",void 0),e([s()],W.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],W.prototype,"type",void 0),e([s(J)],W.prototype,"url",null),W=e([p("esri.layers.GeoJSONLayer")],W);const H=W;export{H as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as t}from"../core/support/OwningCollection.js";import s from"./Layer.js";import{BlendLayer as i}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as p}from"./mixins/ScaleRangeLayer.js";import{GraphicsCollection as a}from"../support/GraphicsCollection.js";import c from"../symbols/support/ElevationInfo.js";let n=class extends(i(p(s))){constructor(r){super(r),this.elevationInfo=null,this.graphics=new a,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}graphicChanged(r){this.emit("graphic-update",r)}};r([e({type:c})],n.prototype,"elevationInfo",void 0),r([e(t(a,"graphics"))],n.prototype,"graphics",void 0),r([e({type:["show","hide"]})],n.prototype,"listMode",void 0),r([e()],n.prototype,"screenSizePerspectiveEnabled",void 0),r([e({readOnly:!0})],n.prototype,"type",void 0),r([e({constructOnly:!0})],n.prototype,"internal",void 0),n=r([o("esri.layers.GraphicsLayer")],n);export{n as default};
5
+ import{__decorate as r}from"tslib";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{owningCollectionProperty as t}from"../core/support/OwningCollection.js";import s from"./Layer.js";import{BlendLayer as i}from"./mixins/BlendLayer.js";import{ScaleRangeLayer as p}from"./mixins/ScaleRangeLayer.js";import{GraphicsCollection as a}from"../support/GraphicsCollection.js";import c from"../symbols/support/ElevationInfo.js";let n=class extends(i(p(s))){constructor(r){super(r),this.elevationInfo=null,this.graphics=new a,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}get loaded(){return super.loaded}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}graphicChanged(r){this.emit("graphic-update",r)}};r([e({type:c})],n.prototype,"elevationInfo",void 0),r([e(t(a,"graphics"))],n.prototype,"graphics",void 0),r([e({type:["show","hide"]})],n.prototype,"listMode",void 0),r([e()],n.prototype,"screenSizePerspectiveEnabled",void 0),r([e({readOnly:!0})],n.prototype,"type",void 0),r([e({constructOnly:!0})],n.prototype,"internal",void 0),n=r([o("esri.layers.GraphicsLayer")],n);export{n as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import u from"./Layer.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{CustomParametersMixin as d}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as f}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as w}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as _}from"./support/commonProperties.js";import I from"./support/Field.js";import{getServicePixelValueField as O,getRawServicePixelValueField as P,getRasterAttributeTableFields as b,getMagnitudeField as x,getDirectionField as T,getMultidimensionalFields as N,commonRasterFieldNames as L,setDefaultRasterFieldFormats as J}from"./support/rasterFieldUtils.js";import C from"./support/RasterFunction.js";import{isFunctionRaster as M,getPrimaryRasters as E}from"./support/rasterDatasets/datasetUtils.js";import U from"./support/rasterDatasets/FunctionRaster.js";import $ from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as B,create as D}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as A,elevationModeUnsupportedMessage as W,featureExpressionUnsupportedMessage as z}from"../support/elevationInfoUtils.js";import{createPopupTemplate as k}from"../support/popupUtils.js";import G from"../symbols/support/ElevationInfo.js";let V=class extends(y(F(g(v(w(d(f(R(S(h(j(o(r(u)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[O("Pixel Value"),P("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=b(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=x(t),s=T();e.push(r,s)}if(i){const t=N(i);e.push(...t)}return e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==L.rawServicePixelValue)),s=k({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&J(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=c(C,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=M(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=E(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&B(t.toJSON(),i);const o=await Promise.all(i.map(e=>$.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await $.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await $.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=D(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new U({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(){const e=this.elevationInfo;A(i.getLogger(this),W("ImageryTile layers","relative-to-scene",e)),A(i.getLogger(this),z("ImageryTile layers",e))}};e([l({clonable:!1})],V.prototype,"_primaryRasters",void 0),e([l({type:G,value:null,json:{read:!1}})],V.prototype,"elevationInfo",null),e([l(_)],V.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],V.prototype,"isReference",void 0),e([l({type:["show","hide"]})],V.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],V.prototype,"blendMode",void 0),e([l({type:C,json:{name:"renderingRule",write:!0}})],V.prototype,"rasterFunction",void 0),e([l()],V.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],V.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],V.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],V.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],V.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],V.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({readOnly:!0,type:[I]})],V.prototype,"fields",void 0),e([l({readOnly:!0,type:[I]})],V.prototype,"rasterFields",null),e([l({constructOnly:!0})],V.prototype,"source",void 0),V=e([m("esri.layers.ImageryTileLayer")],V);const H=V;export{H as default};
5
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as p}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import u from"./Layer.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{ImageryTileMixin as f}from"./mixins/ImageryTileMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as R}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as w}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{legendEnabled as _}from"./support/commonProperties.js";import I from"./support/Field.js";import{getServicePixelValueField as O,getRawServicePixelValueField as P,getRasterAttributeTableFields as b,getMagnitudeField as x,getDirectionField as T,getMultidimensionalFields as N,commonRasterFieldNames as L,setDefaultRasterFieldFormats as J}from"./support/rasterFieldUtils.js";import C from"./support/RasterFunction.js";import{isFunctionRaster as M,getPrimaryRasters as E}from"./support/rasterDatasets/datasetUtils.js";import U from"./support/rasterDatasets/FunctionRaster.js";import $ from"./support/rasterDatasets/RasterFactory.js";import{getPrimaryRasterUrls as B,create as D}from"./support/rasterFunctions/rasterFunctionHelper.js";import{logInvalidElevationInfoWarning as A,elevationModeUnsupportedMessage as W,featureExpressionUnsupportedMessage as z}from"../support/elevationInfoUtils.js";import{createPopupTemplate as k}from"../support/popupUtils.js";import G from"../symbols/support/ElevationInfo.js";let V=class extends(d(F(g(v(w(y(f(R(S(h(j(o(r(u)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=a(async(e,t,r)=>{const{save:s,saveAs:i}=await import("./save/imageryUtils.js");switch(e){case 0:return s(this,t);case 1:return i(this,r,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(n).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[O("Pixel Value"),P("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,r=t?.attributeTable;if(r){const t=b(r);e.push(...t)}const s=t?.dataType,i=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=i){const t=i.variables[0].unit?.trim(),r=x(t),s=T();e.push(r,s)}if(i){const t=N(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,r=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==L.rawServicePixelValue)),s=k({fields:t,title:this.title},{...e,visibleFieldNames:r}),{rasterInfo:i}=this.raster;return s?.fieldInfos&&i&&J(s.fieldInfos,i),s}async generateRasterInfo(e,t){if(e=c(C,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(e,t);return r}catch(r){if(r instanceof s)throw r;throw new s("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const r=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=M(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:r,source:i}=this;if(!t&&!i)throw new s("imagery-tile-layer:open","missing url or source parameter");i?await this._openFromSource(i,e):r?await this._openFromUrlWithRasterFunction(t,r,e):await this._openFromUrl(t,e)}const r=this.raster.rasterInfo;if(!r)throw new s("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(p(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=E(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,r){const i=[e];t&&B(t.toJSON(),i);const o=await Promise.all(i.map(e=>$.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=o.findIndex(e=>null==e);if(a>-1)throw new s("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const r=await $.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new s("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(e,t){const r="the tiled imagery data source is not supported",i="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!i)throw new s("imagery-tile-layer:open",r);"MEMORY"===i&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const o=await $.open({url:"",source:e,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==o)throw new s("imagery-tile-layer:open",r);this._primaryRasters=[o],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=o}async _openFunctionRaster(e,t){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>r[e.url]=e);const s=D(e.functionDefinition?.toJSON()??e.toJSON(),r),i=new U({rasterFunction:s});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(r){r instanceof s&&i.getLogger(this).error("imagery-tile-layer:open",r.message),i.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(){const e=this.elevationInfo;A(i.getLogger(this),W("ImageryTile layers","relative-to-scene",e)),A(i.getLogger(this),z("ImageryTile layers",e))}};e([l({clonable:!1})],V.prototype,"_primaryRasters",void 0),e([l({type:G,value:null,json:{read:!1}})],V.prototype,"elevationInfo",null),e([l(_)],V.prototype,"legendEnabled",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],V.prototype,"isReference",void 0),e([l({type:["show","hide"]})],V.prototype,"listMode",void 0),e([l({json:{read:!0,write:!0}})],V.prototype,"blendMode",void 0),e([l({type:C,json:{name:"renderingRule",write:!0}})],V.prototype,"rasterFunction",void 0),e([l()],V.prototype,"sourceJSON",void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],V.prototype,"version",void 0),e([l({readOnly:!0,json:{read:!1}})],V.prototype,"type",void 0),e([l({type:["ArcGISTiledImageServiceLayer"]})],V.prototype,"operationalLayerType",void 0),e([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],V.prototype,"popupEnabled",void 0),e([l({type:t,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],V.prototype,"popupTemplate",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({readOnly:!0,type:[I]})],V.prototype,"fields",void 0),e([l({readOnly:!0,type:[I]})],V.prototype,"rasterFields",null),e([l({constructOnly:!0})],V.prototype,"source",void 0),V=e([m("esri.layers.ImageryTileLayer")],V);const H=V;export{H as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import r from"../core/Logger.js";import{rad2deg as o}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as l}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,f as h,t as y,c as u,A as x,z as g,a as v}from"../chunks/vec32.js";import{fromValues as j,create as S}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as b}from"../geometry/ellipsoidUtils.js";import _ from"../geometry/Extent.js";import A from"../geometry/SpatialReference.js";import{projectBuffer as w}from"../geometry/projection/projectBuffer.js";import L from"./Layer.js";import{APIKeyMixin as M}from"./mixins/APIKeyMixin.js";import{ArcGISService as E}from"./mixins/ArcGISService.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as R}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as U}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as N,url as O}from"./support/commonProperties.js";import z from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as D,elevationModeRequiredMessage as P,featureExpressionUnsupportedMessage as V}from"../support/elevationInfoUtils.js";import{f as X}from"../chunks/persistableUrlUtils.js";let k=class extends(E(T(R(U(s(I(M(L)))))))){readModifications(e,t,i){this._modificationsSource={url:X(e,i),context:i}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,l))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new A({wkid:4326,vcsWkid:115700}),this.fullExtent=new _(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const i of e)if("number"!=typeof i)return!1;return!0}_initFullExtent(){const e=this.rootTilesetJSON?.root?.boundingVolume;if(!e)return;if(e.box){const t=e?.box;if(t[3]>7645211&&t[7]>7645211&&t[11]>7645211)return}const t=this.rootTilesetJSON?.root?.transform,i=S();if(e.region&&this._verifyArray(e.region,6)){const t=e.region,i=o(t[0]),r=o(t[1]),s=t[4],a=o(t[2]),n=o(t[3]),l=t[5];this.fullExtent=new _({xmin:i,ymin:r,zmin:s,xmax:a,ymax:n,zmax:l,spatialReference:this.spatialReference})}else if(e.sphere&&this._verifyArray(e.sphere,4)){const r=e.sphere,o=j(r[0],r[1],r[2]),s=r[3]/Math.sqrt(3),a=S();d(a,o,j(s,s,s));const n=S();if(h(n,o,j(s,s,s)),t&&this._verifyArray(t,16)){const e=t;y(i,a,e),u(a,i),y(i,n,e),u(n,i)}w(a,b,0,a,A.WGS84,0),w(n,b,0,n,A.WGS84,0);const l=S(),m=S();x(l,a,n),g(m,a,n),this.fullExtent=new _({xmin:l[0],ymin:l[1],zmin:l[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:this.spatialReference})}else if(e.box&&this._verifyArray(e.box,12)){const i=e.box,r=j(i[0],i[1],i[2]),o=j(i[3],i[4],i[5]),s=j(i[6],i[7],i[8]),a=j(i[9],i[10],i[11]),n=[];for(let e=0;e<8;++e)n.push(S());if(h(n[0],r,o),h(n[0],n[0],s),h(n[0],n[0],a),v(n[1],r,o),h(n[1],n[1],s),h(n[1],n[1],a),h(n[2],r,o),v(n[2],n[2],s),h(n[2],n[2],a),v(n[3],r,o),v(n[3],n[3],s),h(n[3],n[3],a),h(n[4],r,o),h(n[4],n[4],s),v(n[4],n[4],a),v(n[5],r,o),h(n[5],n[5],s),v(n[5],n[5],a),h(n[6],r,o),v(n[6],n[6],s),v(n[6],n[6],a),v(n[7],r,o),v(n[7],n[7],s),v(n[7],n[7],a),t&&this._verifyArray(t,16)){const e=t;for(let t=0;t<8;++t)y(n[t],n[t],e)}const l=j(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),m=j(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)w(n[e],b,0,n[e],A.WGS84,0),x(m,m,n[e]),g(l,l,n[e]);this.fullExtent=new _({xmin:m[0],ymin:m[1],zmin:m[2],xmax:l[0],ymax:l[1],zmax:l[2],spatialReference:this.spatialReference})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){a(o)}if(null!=this._modificationsSource){const t=await z.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data,this._initFullExtent()},e=>{a(e)});await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";D(r.getLogger(this),P(t,"absolute-height",e)),D(r.getLogger(this),V(t,e))}};e([m({type:["IntegratedMesh3DTilesLayer"]})],k.prototype,"operationalLayerType",void 0),e([m({type:z,clonable:e=>e.clone()}),f({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],k.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],k.prototype,"readModifications",null),e([m({type:A})],k.prototype,"spatialReference",void 0),e([m({type:_})],k.prototype,"fullExtent",void 0),e([m(N)],k.prototype,"elevationInfo",null),e([m({type:["show","hide"]})],k.prototype,"listMode",void 0),e([m(O)],k.prototype,"url",void 0),e([m({readOnly:!0})],k.prototype,"type",void 0),e([m({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],k.prototype,"path",void 0),e([m({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],k.prototype,"minScale",void 0),e([m({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],k.prototype,"maxScale",void 0),k=e([c("esri.layers.IntegratedMesh3DTilesLayer")],k);const G=k;export{G as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{rad2deg as r}from"../core/mathUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{on as n,sync as l}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{persistable as f}from"../core/accessorSupport/decorators/persistable.js";import{d,f as h,t as u,c as y,A as x,z as g,a as v}from"../chunks/vec32.js";import{fromValues as j,create as S}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{WGS84ECEFSpatialReferenceLike as b}from"../geometry/ellipsoidUtils.js";import _ from"../geometry/Extent.js";import A from"../geometry/SpatialReference.js";import{projectBuffer as w}from"../geometry/projection/projectBuffer.js";import L from"./Layer.js";import{APIKeyMixin as M}from"./mixins/APIKeyMixin.js";import{ArcGISService as E}from"./mixins/ArcGISService.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as U}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as N}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as R,url as z}from"./support/commonProperties.js";import O from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as D,elevationModeRequiredMessage as P,featureExpressionUnsupportedMessage as V}from"../support/elevationInfoUtils.js";import{f as X}from"../chunks/persistableUrlUtils.js";var k;let F=class extends(E(T(U(N(s(I(M(L)))))))){static{k=this}readModifications(e,t,i){this._modificationsSource={url:X(e,i),context:i}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,l))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new A({wkid:4326,vcsWkid:115700}),this.fullExtent=new _(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}_verifyArray(e,t){if(!Array.isArray(e)||e.length<t)return!1;for(const i of e)if("number"!=typeof i)return!1;return!0}static{this.googleIMFullExtent={xmin:-180,ymin:-90,zmin:-450,xmax:180,ymax:90,zmax:8850}}_initFullExtent(){const e=this.rootTilesetJSON?.root?.boundingVolume;if(!e)return;const{spatialReference:t}=this;if(e.box){const i=e?.box;if(i[3]>J&&i[7]>J&&i[11]>J)return void(this.fullExtent=new _({...k.googleIMFullExtent,spatialReference:t}))}const i=this.rootTilesetJSON?.root?.transform,o=S();if(e.region&&this._verifyArray(e.region,6)){const i=e.region,o=r(i[0]),s=r(i[1]),a=i[4],n=r(i[2]),l=r(i[3]),m=i[5];this.fullExtent=new _({xmin:o,ymin:s,zmin:a,xmax:n,ymax:l,zmax:m,spatialReference:t})}else if(e.sphere&&this._verifyArray(e.sphere,4)){const r=e.sphere,s=j(r[0],r[1],r[2]),a=r[3]/Math.sqrt(3),n=S();d(n,s,j(a,a,a));const l=S();if(h(l,s,j(a,a,a)),i&&this._verifyArray(i,16)){const e=i;u(o,n,e),y(n,o),u(o,l,e),y(l,o)}w(n,b,0,n,A.WGS84,0),w(l,b,0,l,A.WGS84,0);const m=S(),p=S();x(m,n,l),g(p,n,l),this.fullExtent=new _({xmin:m[0],ymin:m[1],zmin:m[2],xmax:p[0],ymax:p[1],zmax:p[2],spatialReference:t})}else if(e.box&&this._verifyArray(e.box,12)){const o=e.box,r=j(o[0],o[1],o[2]),s=j(o[3],o[4],o[5]),a=j(o[6],o[7],o[8]),n=j(o[9],o[10],o[11]),l=[];for(let e=0;e<8;++e)l.push(S());if(h(l[0],r,s),h(l[0],l[0],a),h(l[0],l[0],n),v(l[1],r,s),h(l[1],l[1],a),h(l[1],l[1],n),h(l[2],r,s),v(l[2],l[2],a),h(l[2],l[2],n),v(l[3],r,s),v(l[3],l[3],a),h(l[3],l[3],n),h(l[4],r,s),h(l[4],l[4],a),v(l[4],l[4],n),v(l[5],r,s),h(l[5],l[5],a),v(l[5],l[5],n),h(l[6],r,s),v(l[6],l[6],a),v(l[6],l[6],n),v(l[7],r,s),v(l[7],l[7],a),v(l[7],l[7],n),i&&this._verifyArray(i,16)){const e=i;for(let t=0;t<8;++t)u(l[t],l[t],e)}const m=j(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),p=j(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let e=0;e<8;++e)w(l[e],b,0,l[e],A.WGS84,0),x(p,p,l[e]),g(m,m,l[e]);this.fullExtent=new _({xmin:p[0],ymin:p[1],zmin:p[2],xmax:m[0],ymax:m[1],zmax:m[2],spatialReference:t})}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const o=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(r){a(r)}if(null!=this._modificationsSource){const t=await O.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:o}).then(e=>{this.rootTilesetJSON=e.data,this._initFullExtent()},e=>{a(e)});await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";D(o.getLogger(this),P(t,"absolute-height",e)),D(o.getLogger(this),V(t,e))}};e([m({type:["IntegratedMesh3DTilesLayer"]})],F.prototype,"operationalLayerType",void 0),e([m({type:O,clonable:e=>e.clone()}),f({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],F.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],F.prototype,"readModifications",null),e([m({type:A})],F.prototype,"spatialReference",void 0),e([m({type:_})],F.prototype,"fullExtent",void 0),e([m(R)],F.prototype,"elevationInfo",null),e([m({type:["show","hide"]})],F.prototype,"listMode",void 0),e([m(z)],F.prototype,"url",void 0),e([m({readOnly:!0})],F.prototype,"type",void 0),e([m({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],F.prototype,"path",void 0),e([m({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],F.prototype,"minScale",void 0),e([m({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],F.prototype,"maxScale",void 0),F=k=e([c("esri.layers.IntegratedMesh3DTilesLayer")],F);const G=F,J=7645211;export{G as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as r}from"../core/promiseUtils.js";import{on as s,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import l from"./Layer.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as h}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as u}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{SceneService as g}from"./mixins/SceneService.js";import{elevationInfo as S}from"./support/commonProperties.js";import{I3SNodePageDefinition as j,I3SMaterialDefinition as w,I3STextureSetDefinition as x,I3SGeometryDefinition as L}from"./support/I3SLayerDefinitions.js";import I from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as _,featureExpressionUnsupportedMessage as b}from"../support/elevationInfoUtils.js";import{f as M}from"../chunks/persistableUrlUtils.js";let O=class extends(g(y(f(u(v(i(h(c(l))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(s(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:M(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){r(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await I.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new t("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new t("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new t("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";T(o.getLogger(this),_(t,"absolute-height",e)),T(o.getLogger(this),b(t,e))}};e([a({type:String,readOnly:!0})],O.prototype,"geometryType",void 0),e([a({type:["show","hide"]})],O.prototype,"listMode",void 0),e([a({type:["IntegratedMeshLayer"]})],O.prototype,"operationalLayerType",void 0),e([a({json:{read:!1},readOnly:!0})],O.prototype,"type",void 0),e([a({type:j,readOnly:!0})],O.prototype,"nodePages",void 0),e([a({type:[w],readOnly:!0})],O.prototype,"materialDefinitions",void 0),e([a({type:[x],readOnly:!0})],O.prototype,"textureSetDefinitions",void 0),e([a({type:[L],readOnly:!0})],O.prototype,"geometryDefinitions",void 0),e([a({readOnly:!0})],O.prototype,"serviceUpdateTimeStamp",void 0),e([a({type:I,clonable:e=>e.clone()}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],O.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],O.prototype,"readModifications",null),e([a(S)],O.prototype,"elevationInfo",null),e([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],O.prototype,"path",void 0),O=e([m("esri.layers.IntegratedMeshLayer")],O);const P=O;export{P as default};
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import c from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as u}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as w,I3SMaterialDefinition as x,I3STextureSetDefinition as L,I3SGeometryDefinition as I}from"./support/I3SLayerDefinitions.js";import b from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as _,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";let P=class extends(S(h(u(v(g(r(f(y(t(c)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:O(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){s(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await b.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new o("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";T(i.getLogger(this),_(t,"absolute-height",e)),T(i.getLogger(this),M(t,e))}};e([p({type:String,readOnly:!0})],P.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],P.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],P.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],P.prototype,"type",void 0),e([p({type:w,readOnly:!0,clonable:!1})],P.prototype,"nodePages",void 0),e([p({type:[x],readOnly:!0,clonable:!1})],P.prototype,"materialDefinitions",void 0),e([p({type:[L],readOnly:!0,clonable:!1})],P.prototype,"textureSetDefinitions",void 0),e([p({type:[I],readOnly:!0,clonable:!1})],P.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],P.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:b,clonable:e=>e?.clone()??e}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],P.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],P.prototype,"readModifications",null),e([p(j)],P.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],P.prototype,"path",void 0),P=e([m("esri.layers.IntegratedMeshLayer")],P);const U=P;export{U as default};
package/layers/Layer.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import{EventedMixin as o}from"../core/Evented.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import{Loadable as s}from"../core/Loadable.js";import a from"../core/Logger.js";import{isAbortError as l}from"../core/promiseUtils.js";import{urlToObject as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import{fromPortalItem as u}from"./support/fromPortalItem.js";import{T as m}from"../chunks/TimeExtent.js";let b=0,h=class extends(o(i(s))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d(-180,-90,180,90,c.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=c.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await import("./support/arcgisLayers.js")).fromUrl(t)}static fromPortalItem(e){return u(e)}initialize(){this.when().catch(e=>{l(e)||a.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return n(this.url)}createLayerView(e,t){return Promise.reject(new r("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e){return(await t(e,{query:{f:"json"},responseType:"json"})).data}throw new r("layer:no-attribution-data","Layer does not have attribution data")}};e([p({type:String})],h.prototype,"attributionDataUrl",void 0),e([p({readOnly:!0})],h.prototype,"effectiveVisible",null),e([p({type:d})],h.prototype,"fullExtent",void 0),e([p({readOnly:!0})],h.prototype,"hasAttributionData",null),e([p({type:String,clonable:!1})],h.prototype,"id",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"legendEnabled",void 0),e([p({type:["show","hide","hide-children"]})],h.prototype,"listMode",void 0),e([p({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,"opacity",void 0),e([p({clonable:!1})],h.prototype,"parent",void 0),e([p({readOnly:!0})],h.prototype,"parsedUrl",null),e([p({type:Boolean,readOnly:!0})],h.prototype,"persistenceEnabled",void 0),e([p({type:Boolean})],h.prototype,"popupEnabled",void 0),e([p({type:Boolean})],h.prototype,"attributionVisible",void 0),e([p({type:c})],h.prototype,"spatialReference",void 0),e([p({type:String})],h.prototype,"title",void 0),e([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),e([p()],h.prototype,"url",void 0),e([p({type:m})],h.prototype,"visibilityTimeExtent",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"visible",void 0),h=e([y("esri.layers.Layer")],h);export{h as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import{EventedMixin as o}from"../core/Evented.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import{Loadable as s}from"../core/Loadable.js";import a from"../core/Logger.js";import{isAbortError as l}from"../core/promiseUtils.js";import{urlToObject as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import{fromPortalItem as u}from"./support/fromPortalItem.js";import{T as m}from"../chunks/TimeExtent.js";let b=0,h=class extends(o(i(s))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d(-180,-90,180,90,c.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=c.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await import("./support/arcgisLayers.js")).fromUrl(t)}static fromPortalItem(e){return u(e)}initialize(){this.when().catch(e=>{l(e)||a.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}get parsedUrl(){return n(this.url)}createLayerView(e,t){return Promise.reject(new r("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e){return(await t(e,{query:{f:"json"},responseType:"json"})).data}throw new r("layer:no-attribution-data","Layer does not have attribution data")}};e([p({type:String})],h.prototype,"attributionDataUrl",void 0),e([p({readOnly:!0})],h.prototype,"effectiveVisible",null),e([p({type:d})],h.prototype,"fullExtent",void 0),e([p({readOnly:!0})],h.prototype,"hasAttributionData",null),e([p({type:String,clonable:!1})],h.prototype,"id",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"legendEnabled",void 0),e([p({type:["show","hide","hide-children"]})],h.prototype,"listMode",void 0),e([p({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,"opacity",void 0),e([p({clonable:!1})],h.prototype,"parent",void 0),e([p({readOnly:!0})],h.prototype,"parsedUrl",null),e([p({type:Boolean,readOnly:!0})],h.prototype,"persistenceEnabled",void 0),e([p({type:Boolean})],h.prototype,"popupEnabled",void 0),e([p({type:Boolean})],h.prototype,"attributionVisible",void 0),e([p({type:c})],h.prototype,"spatialReference",void 0),e([p({type:String})],h.prototype,"title",void 0),e([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),e([p()],h.prototype,"url",void 0),e([p({type:m})],h.prototype,"visibilityTimeExtent",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"visible",void 0),h=e([y("esri.layers.Layer")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a,isAbortError as p}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as n,inchesPerMeter as m}from"../core/unitUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import{nameToId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import{getScale as g}from"../geometry/support/scaleUtils.js";import{srToRESTValue as v}from"../geometry/support/spatialReferenceUtils.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISMapService as j}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as I}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as U}from"./mixins/SublayersOwner.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{url as M}from"./support/commonProperties.js";import{ExportImageParameters as R}from"./support/ExportImageParameters.js";import{createBitmap as F}from"./support/imageBitmapUtils.js";import _ from"./support/Sublayer.js";import{shouldWriteSublayerStructure as A}from"./support/sublayerUtils.js";import{serviceSupportsSpatialReference as N}from"./support/versionUtils.js";import J from"../symbols/support/ElevationInfo.js";import{T as q}from"../chunks/TimeExtent.js";import{timeZoneProperty as k}from"../time/timeZoneUtils.js";let G=class extends(I(E(T(U(j(S(O(L(s(P(x(w(b))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new R({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new J({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=o(async(e,r,t)=>{const{save:i,saveAs:s}=await import("./save/mapImageLayerUtils.js");switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("PNG32")?"png32":"png24"}writeSublayers(e,r,t,i){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray();let o=!1;const a=h(i.origin);let p;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===a){const e=this.createSublayersForOrigin("service").sublayers;o=A(s,e,2)}else if(a>3){const e=this.createSublayersForOrigin("portal-item");o=A(s,e.sublayers,h(e.origin)),p=e.originWithPartialOverrides}const n=[],m={writeSublayerStructure:o,...i,minimumWritableOrigin:p};let l=o||this.hasVisibleLayersForOrigin(a);s.forEach(e=>{const r=e.write({},m);n.push(r),l=l||"user"===e.originOf("visible")});n.some(e=>Object.keys(e).length>1)&&(r.layers=n),l&&(r.visibleLayers=s.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,r,t,i){const s=i?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=i?.floors??null,this._exportImageParameters.scale=i?.scale||g({extent:e,width:r})*s;const o=this._exportImageParameters.toJSON(),a=!i?.rotation||this.version<10.3?{}:{rotation:-i.rotation},p=e?.spatialReference,l=v(p);if(i?.scale&&e){const t=e.width/r*(n(e?.spatialReference)*m);o.dpi=i.scale/t}o.dpi*=s;const c={};if(i?.timeExtent){const{start:e,end:r}=i.timeExtent.toJSON();c.time=e&&r&&e===r?""+e:`${e??"null"},${r??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(c.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:l,imageSR:l,size:r+","+t,...o,...a,...c}}async fetchImage(e,r,t,i){const{data:s}=await this._fetchImage("image",e,r,t,i);return s}async fetchImageBitmap(e,r,t,i){const{data:s,url:o}=await this._fetchImage("blob",e,r,t,i);return F(s,o,i?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:i}=await r(this.url,t),{extent:s,fullExtent:o,timeExtent:a}=i,p=s||o;return{fullExtent:p&&f.fromJSON(p),timeExtent:a&&q.fromJSON({start:a[0],end:a[1]})}}loadAll(){return i(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return N(this,e)}async _fetchImage(e,i,s,o,a){const n={responseType:e,signal:a?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,s,o,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(null!=n.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new t("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:e}=await r(m,n);return{data:e,url:m}}catch(l){if(p(l))throw l;throw new t("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:i}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});i&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};e([l(k("dateFieldsTimeReference"))],G.prototype,"dateFieldsTimeZone",void 0),e([l({type:Boolean})],G.prototype,"datesInUnknownTimezone",void 0),e([l()],G.prototype,"dpi",void 0),e([l()],G.prototype,"elevationInfo",void 0),e([l()],G.prototype,"gdbVersion",void 0),e([l()],G.prototype,"imageFormat",void 0),e([u("imageFormat",["supportedImageFormatTypes"])],G.prototype,"readImageFormat",null),e([l({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],G.prototype,"imageMaxHeight",void 0),e([l({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],G.prototype,"imageMaxWidth",void 0),e([l()],G.prototype,"imageTransparency",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],G.prototype,"isReference",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"labelsVisible",void 0),e([l({type:["ArcGISMapServiceLayer"]})],G.prototype,"operationalLayerType",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"popupEnabled",void 0),e([l(k("preferredTimeReference"))],G.prototype,"preferredTimeZone",void 0),e([l()],G.prototype,"sourceJSON",void 0),e([l({json:{write:{ignoreOrigin:!0}}})],G.prototype,"sublayers",void 0),e([d("sublayers",{layers:{type:[_]},visibleLayers:{type:[c]}})],G.prototype,"writeSublayers",null),e([l({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],G.prototype,"listMode",void 0),e([l({json:{read:!1},readOnly:!0,value:"map-image"})],G.prototype,"type",void 0),e([l(M)],G.prototype,"url",void 0),G=e([y("esri.layers.MapImageLayer")],G);const V=G;export{V as default};
5
+ import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a,isAbortError as p}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as n,inchesPerMeter as m}from"../core/unitUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import{nameToId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import{getScale as g}from"../geometry/support/scaleUtils.js";import{srToRESTValue as v}from"../geometry/support/spatialReferenceUtils.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISMapService as j}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as I}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as U}from"./mixins/SublayersOwner.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{url as M}from"./support/commonProperties.js";import{ExportImageParameters as R}from"./support/ExportImageParameters.js";import{createBitmap as F}from"./support/imageBitmapUtils.js";import _ from"./support/Sublayer.js";import{shouldWriteSublayerStructure as A}from"./support/sublayerUtils.js";import{serviceSupportsSpatialReference as N}from"./support/versionUtils.js";import J from"../symbols/support/ElevationInfo.js";import{T as q}from"../chunks/TimeExtent.js";import{timeZoneProperty as k}from"../time/timeZoneUtils.js";let G=class extends(I(E(T(U(j(S(O(L(i(P(x(w(b))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new R({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new J({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=o(async(e,r,t)=>{const{save:s,saveAs:i}=await import("./save/mapImageLayerUtils.js");switch(e){case 0:return s(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("PNG32")?"png32":"png24"}get loaded(){return super.loaded}set portalItem(e){super.portalItem=e}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray();let o=!1;const a=h(s.origin);let p;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===a){const e=this.createSublayersForOrigin("service").sublayers;o=A(i,e,2)}else if(a>3){const e=this.createSublayersForOrigin("portal-item");o=A(i,e.sublayers,h(e.origin)),p=e.originWithPartialOverrides}const n=[],m={writeSublayerStructure:o,...s,minimumWritableOrigin:p};let l=o||this.hasVisibleLayersForOrigin(a);i.forEach(e=>{const r=e.write({},m);n.push(r),l=l||"user"===e.originOf("visible")});n.some(e=>Object.keys(e).length>1)&&(r.layers=n),l&&(r.visibleLayers=i.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,r,t,s){const i=s?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=s?.scale||g({extent:e,width:r})*i;const o=this._exportImageParameters.toJSON(),a=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},p=e?.spatialReference,l=v(p);if(s?.scale&&e){const t=e.width/r*(n(e?.spatialReference)*m);o.dpi=s.scale/t}o.dpi*=i;const c={};if(s?.timeExtent){const{start:e,end:r}=s.timeExtent.toJSON();c.time=e&&r&&e===r?""+e:`${e??"null"},${r??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(c.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:l,imageSR:l,size:r+","+t,...o,...a,...c}}async fetchImage(e,r,t,s){const{data:i}=await this._fetchImage("image",e,r,t,s);return i}async fetchImageBitmap(e,r,t,s){const{data:i,url:o}=await this._fetchImage("blob",e,r,t,s);return F(i,o,s?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:s}=await r(this.url,t),{extent:i,fullExtent:o,timeExtent:a}=s,p=i||o;return{fullExtent:p&&f.fromJSON(p),timeExtent:a&&q.fromJSON({start:a[0],end:a[1]})}}loadAll(){return s(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return N(this,e)}async _fetchImage(e,s,i,o,a){const n={responseType:e,signal:a?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(s,i,o,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(null!=n.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new t("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:e}=await r(m,n);return{data:e,url:m}}catch(l){if(p(l))throw l;throw new t("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});s&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};e([l(k("dateFieldsTimeReference"))],G.prototype,"dateFieldsTimeZone",void 0),e([l({type:Boolean})],G.prototype,"datesInUnknownTimezone",void 0),e([l()],G.prototype,"dpi",void 0),e([l()],G.prototype,"elevationInfo",void 0),e([l()],G.prototype,"gdbVersion",void 0),e([l()],G.prototype,"imageFormat",void 0),e([u("imageFormat",["supportedImageFormatTypes"])],G.prototype,"readImageFormat",null),e([l({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],G.prototype,"imageMaxHeight",void 0),e([l({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],G.prototype,"imageMaxWidth",void 0),e([l()],G.prototype,"imageTransparency",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],G.prototype,"isReference",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"labelsVisible",void 0),e([l({type:["ArcGISMapServiceLayer"]})],G.prototype,"operationalLayerType",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"popupEnabled",void 0),e([l(k("preferredTimeReference"))],G.prototype,"preferredTimeZone",void 0),e([l()],G.prototype,"sourceJSON",void 0),e([l({json:{write:{ignoreOrigin:!0}}})],G.prototype,"sublayers",void 0),e([y("sublayers",{layers:{type:[_]},visibleLayers:{type:[c]}})],G.prototype,"writeSublayers",null),e([l({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],G.prototype,"listMode",void 0),e([l({json:{read:!1},readOnly:!0,value:"map-image"})],G.prototype,"type",void 0),e([l(M)],G.prototype,"url",void 0),G=e([d("esri.layers.MapImageLayer")],G);const V=G;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../core/Collection.js";import o from"../core/Error.js";import t from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as i}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../core/accessorSupport/decorators/writer.js";import u from"./Layer.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as f}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as y}from"./mixins/ScaleRangeLayer.js";import h from"./support/ControlPointsGeoreference.js";import g from"./support/ImageElement.js";import S from"./support/LocalMediaElementSource.js";import{isWritingLayerFromItemToWebDocument as w}from"./support/mediaUtils.js";import v from"./support/VideoElement.js";import{isMediaElement as j}from"../support/mediaLayerUtils.js";let L=class extends(d(y(m(f(s(u)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=i(async(e,r,o)=>{const{save:t,saveAs:s}=await import("./save/mediaLayerUtils.js");switch(e){case 0:return t(this,r);case 1:return s(this,o,r)}}),this.source=new S}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new o("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const s=this._getSourceOverride(t,this.georeference);s&&(this.setAtOrigin("source",s,"web-map"),this.setAtOrigin("source",s,"web-scene"),t=s);const i=j(t)?new S({elements:new r([t])}):t;this._set("effectiveSource",i),this.spatialReference&&(i.spatialReference=this.spatialReference),await i.load(e),this.spatialReference=i.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,r){return e&&"itemId"in r&&r.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}get source(){return this._get("source")}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):t.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new S({elements:new r(e)}):e instanceof r?new S({elements:e}):e:null}readSource(e,r,o){if("itemId"in r&&r.itemId)return;const t=this._createSource(r);return t?.read(r,o),t}writeSource(e,r,t,s){if(e&&e instanceof S){const r=e.elements.length;if(1!==r)return void(s?.messages&&s.messages.push(new o("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}j(e)?e.write(r,s):s?.messages&&(e?s.messages.push(new o("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):s.messages.push(new o("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new g;case"video":return new v}return null}_getSourceOverride(e,r){if(j(e)&&3===this.originIdOf("source")&&r&&(5===this.originIdOf("georeference")||4===this.originIdOf("georeference"))){const o=e.toJSON(),t=this._createSource(o);return t.read({...o},{origin:"portal-item"}),t.read({georeference:r},{origin:"web-map"}),t.read({georeference:r},{origin:"web-scene"}),t}return null}};e([a({readOnly:!0})],L.prototype,"effectiveSource",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],L.prototype,"georeference",void 0),e([c("web-document","georeference")],L.prototype,"readGeoreference",null),e([a({type:String})],L.prototype,"copyright",void 0),e([a({readOnly:!0})],L.prototype,"fullExtent",null),e([a({type:["MediaLayer"]})],L.prototype,"operationalLayerType",void 0),e([a({type:["show","hide"]})],L.prototype,"listMode",void 0),e([a({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:h}},overridePolicy(e,r,o){return{enabled:!0,allowNull:!1,ignoreOrigin:w(this,o?.origin)&&j(e)&&!!e.georeference&&e.originIdOf("georeference")>3}}}}})],L.prototype,"source",null),e([n("source")],L.prototype,"castSource",null),e([c("source",["url"])],L.prototype,"readSource",null),e([l("source")],L.prototype,"writeSource",null),e([a()],L.prototype,"spatialReference",void 0),e([a({readOnly:!0})],L.prototype,"type",void 0),L=e([p("esri.layers.MediaLayer")],L);const O=L;export{O as default};
5
+ import{__decorate as e}from"tslib";import r from"../core/Collection.js";import o from"../core/Error.js";import t from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as i}from"../core/promiseUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import{cast as n}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../core/accessorSupport/decorators/writer.js";import u from"./Layer.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as f}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as y}from"./mixins/ScaleRangeLayer.js";import h from"./support/ControlPointsGeoreference.js";import g from"./support/ImageElement.js";import S from"./support/LocalMediaElementSource.js";import{isWritingLayerFromItemToWebDocument as w}from"./support/mediaUtils.js";import v from"./support/VideoElement.js";import{isMediaElement as j}from"../support/mediaLayerUtils.js";let L=class extends(d(y(m(f(s(u)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=i(async(e,r,o)=>{const{save:t,saveAs:s}=await import("./save/mediaLayerUtils.js");switch(e){case 0:return t(this,r);case 1:return s(this,o,r)}}),this.source=new S}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new o("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const s=this._getSourceOverride(t,this.georeference);s&&(this.setAtOrigin("source",s,"web-map"),this.setAtOrigin("source",s,"web-scene"),t=s);const i=j(t)?new S({elements:new r([t])}):t;this._set("effectiveSource",i),this.spatialReference&&(i.spatialReference=this.spatialReference),await i.load(e),this.spatialReference=i.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,r){return e&&"itemId"in r&&r.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}get loaded(){return super.loaded}get source(){return this._get("source")}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):t.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new S({elements:new r(e)}):e instanceof r?new S({elements:e}):e:null}readSource(e,r,o){if("itemId"in r&&r.itemId)return;const t=this._createSource(r);return t?.read(r,o),t}writeSource(e,r,t,s){if(e&&e instanceof S){const r=e.elements.length;if(1!==r)return void(s?.messages&&s.messages.push(new o("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}j(e)?e.write(r,s):s?.messages&&(e?s.messages.push(new o("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):s.messages.push(new o("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new g;case"video":return new v}return null}_getSourceOverride(e,r){if(j(e)&&3===this.originIdOf("source")&&r&&(5===this.originIdOf("georeference")||4===this.originIdOf("georeference"))){const o=e.toJSON(),t=this._createSource(o);return t.read({...o},{origin:"portal-item"}),t.read({georeference:r},{origin:"web-map"}),t.read({georeference:r},{origin:"web-scene"}),t}return null}};e([a({readOnly:!0})],L.prototype,"effectiveSource",void 0),e([a({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],L.prototype,"georeference",void 0),e([c("web-document","georeference")],L.prototype,"readGeoreference",null),e([a({type:String})],L.prototype,"copyright",void 0),e([a({readOnly:!0})],L.prototype,"fullExtent",null),e([a({type:["MediaLayer"]})],L.prototype,"operationalLayerType",void 0),e([a({type:["show","hide"]})],L.prototype,"listMode",void 0),e([a({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:h}},overridePolicy(e,r,o){return{enabled:!0,allowNull:!1,ignoreOrigin:w(this,o?.origin)&&j(e)&&!!e.georeference&&e.originIdOf("georeference")>3}}}}})],L.prototype,"source",null),e([n("source")],L.prototype,"castSource",null),e([c("source",["url"])],L.prototype,"readSource",null),e([l("source")],L.prototype,"writeSource",null),e([a()],L.prototype,"spatialReference",void 0),e([a({readOnly:!0})],L.prototype,"type",void 0),L=e([p("esri.layers.MediaLayer")],L);const O=L;export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../graphic/OrientedImageryGraphicOrigin.js";import s from"./FeatureLayer.js";import{useViewTimeProperty as p}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as m,orientedImageryTypeMap as l,timeIntervalUnitTypeMap as d,verticalMeasurementTypeMap as y,padAccuracyArray as u,isOrientationAccuracy as c}from"./orientedImagery/core/utils.js";import h from"../tables/AttributeTableTemplate.js";import{T as g}from"../chunks/TimeExtent.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!f.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends s{constructor(){super(...arguments),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new n(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return m(e,t,i)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(e=>this.supportedSourceTypes.has(e.type))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:h,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],x.prototype,"graphicOrigin",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return c(t)?u(t):[0,0,0,0,0,0,0,0]},String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",l.write,l.read,l.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:d.apiValues,json:{...S("timeIntervalUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(p)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:y.apiValues,json:{...S("verticalMeasurementUnit",y.write,y.read,y.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:g,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const b=x;export{b as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../graphic/OrientedImageryGraphicOrigin.js";import s from"./FeatureLayer.js";import{useViewTimeProperty as p}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as m,orientedImageryTypeMap as l,timeIntervalUnitTypeMap as d,verticalMeasurementTypeMap as y,padAccuracyArray as u,isOrientationAccuracy as c}from"./orientedImagery/core/utils.js";import h from"../tables/AttributeTableTemplate.js";import{T as g}from"../chunks/TimeExtent.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!f.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends s{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new n(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return m(e,t,i)}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(e=>this.supportedSourceTypes.has(e.type))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:h,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],x.prototype,"graphicOrigin",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return c(t)?u(t):[0,0,0,0,0,0,0,0]},String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",l.write,l.read,l.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:d.apiValues,json:{...S("timeIntervalUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(p)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:y.apiValues,json:{...S("verticalMeasurementUnit",y.write,y.read,y.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:g,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const I=x;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as T}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as E}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as q,legendEnabled as C,popupEnabled as G,attributeTableTemplate as N,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{getFieldDomain as V,computeEffectiveEditingEnabled as M,getGlobalIdToObjectIdMap as k}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as Z}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ae}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ne}from"./support/RangeInfo.js";import le from"./support/SceneFilter.js";import{cacheIsOutOfSync as pe}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as de}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ye}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ue}from"../renderers/support/typeUtils.js";import ce from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as he,elevationModeUnsupportedMessage as fe,featureExpressionUnsupportedMessage as me}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ge}from"../support/popupUtils.js";import{extractZipFiles as ve}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as be}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as we,getFetchPopupTemplate as Ie}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Le}from"../webdoc/support/opacityUtils.js";const je=new Set(["3DObject","Point"]),Fe=H();let Se=class extends(x(S(A(j(_(O(P(p(F(L(i(b)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?V(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:B.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&M(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:U;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ye(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ce;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Z(this.fieldsIndex,await we(this,Ie(this)));return be(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ge(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return E(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>ee(this.infoFor3D,t)?e+1:e,0);0===s&&r(new w),s>1&&r(new I);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ae(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await ve(e)).filter(e=>te(t,e))}validateLayer(e){if(e.layerType&&!je.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!E(this.associatedLayer?.url)||!pe(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await D(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&he(n.getLogger(this),fe("Mesh scene layers","relative-to-scene",e)),he(n.getLogger(this),me("Scene layers",e))}async fetchStatistics(e,t){return await de({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Se.prototype,"featureReduction",void 0),e([h({type:[ne],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Se.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Se.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Se.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Se.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Se.prototype,"type",void 0),e([h({...Fe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"fields",void 0),e([h()],Se.prototype,"types",null),e([h()],Se.prototype,"typeIdField",null),e([h()],Se.prototype,"templates",null),e([h()],Se.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Se.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Se.prototype,"floorInfo",void 0),e([h(Fe.outFields)],Se.prototype,"outFields",void 0),e([h({type:B,readOnly:!0,json:{read:!1}})],Se.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Se.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0})],Se.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0})],Se.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0})],Se.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Se.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Se.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Se.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Se.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Se.prototype,"definitionExpression",void 0),e([h({type:le,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Se.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Se.prototype,"path",void 0),e([h(R)],Se.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Se.prototype,"geometryType",null),e([h(q)],Se.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Se.prototype,"labelingInfo",void 0),e([h(C)],Se.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Le(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Se.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"semantic",void 0),e([h({types:ue,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Se.prototype,"renderer",null),e([h({json:{read:!1}})],Se.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Se.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Se.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"relationships",null),e([h(G)],Se.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"defaultPopupTemplate",null),e([h(N)],Se.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Se.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Se.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Se.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Se.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Se.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Se.prototype,"normalReferenceFrame",void 0),e([h(Q)],Se.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"serviceItemId",void 0),e([h(T)],Se.prototype,"useViewTime",null),Se=e([g("esri.layers.SceneLayer")],Se);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Oe={"mesh-pyramids":"mesh",points:"point"},Pe=Se;export{Pe as default};
5
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{SceneService as A}from"./mixins/SceneService.js";import{useViewTimeProperty as T}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as E}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as D}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as R,labelsVisible as q,legendEnabled as C,popupEnabled as G,attributeTableTemplate as N,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{getFieldDomain as V,computeEffectiveEditingEnabled as M,getGlobalIdToObjectIdMap as k}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as Z}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ae}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ne}from"./support/RangeInfo.js";import le from"./support/SceneFilter.js";import{cacheIsOutOfSync as pe}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as de}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ye}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ue}from"../renderers/support/typeUtils.js";import ce from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as he,elevationModeUnsupportedMessage as fe,featureExpressionUnsupportedMessage as me}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ge}from"../support/popupUtils.js";import{extractZipFiles as ve}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as be}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as we,getFetchPopupTemplate as Ie}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Le}from"../webdoc/support/opacityUtils.js";const je=new Set(["3DObject","Point"]),Fe=H();let Se=class extends(x(S(A(j(_(O(P(p(F(L(i(b)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?V(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:B.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&M(this.associatedLayer)}get geometryType(){return Oe[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:U;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ye(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ce;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Z(this.fieldsIndex,await we(this,Ie(this)));return be(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ge(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return E(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>ee(this.infoFor3D,t)?e+1:e,0);0===s&&r(new w),s>1&&r(new I);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ae(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await ve(e)).filter(e=>te(t,e))}validateLayer(e){if(e.layerType&&!je.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!E(this.associatedLayer?.url)||!pe(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await D(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&he(n.getLogger(this),fe("Mesh scene layers","relative-to-scene",e)),he(n.getLogger(this),me("Scene layers",e))}async fetchStatistics(e,t){return await de({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Se.prototype,"featureReduction",void 0),e([h({type:[ne],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Se.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Se.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Se.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Se.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Se.prototype,"type",void 0),e([h({...Fe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"fields",void 0),e([h()],Se.prototype,"types",null),e([h()],Se.prototype,"typeIdField",null),e([h()],Se.prototype,"templates",null),e([h()],Se.prototype,"formTemplate",null),e([h({readOnly:!0,clonable:!1})],Se.prototype,"fieldsIndex",null),e([h({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Se.prototype,"floorInfo",void 0),e([h(Fe.outFields)],Se.prototype,"outFields",void 0),e([h({type:B,readOnly:!0,json:{read:!1},clonable:!1})],Se.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Se.prototype,"readNodePages",null),e([h({type:[J],readOnly:!0,clonable:!1})],Se.prototype,"materialDefinitions",void 0),e([h({type:[X],readOnly:!0,clonable:!1})],Se.prototype,"textureSetDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Se.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Se.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Se.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Se.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Se.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Se.prototype,"definitionExpression",void 0),e([h({type:le,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Se.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Se.prototype,"path",void 0),e([h(R)],Se.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Se.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Se.prototype,"geometryType",null),e([h(q)],Se.prototype,"labelsVisible",void 0),e([h({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],Se.prototype,"labelingInfo",void 0),e([h(C)],Se.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Le(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Se.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"semantic",void 0),e([h({types:ue,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Se.prototype,"renderer",null),e([h({json:{read:!1}})],Se.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Se.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Se.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Se.prototype,"relationships",null),e([h(G)],Se.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Se.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Se.prototype,"defaultPopupTemplate",null),e([h(N)],Se.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Se.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Se.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Se.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Se.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Se.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Se.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Se.prototype,"normalReferenceFrame",void 0),e([h(Q)],Se.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Se.prototype,"serviceItemId",void 0),e([h(T)],Se.prototype,"useViewTime",null),Se=e([g("esri.layers.SceneLayer")],Se);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Oe={"mesh-pyramids":"mesh",points:"point"},Pe=Se;export{Pe as default};