@arcgis/core 5.2.0-next.20 → 5.2.0-next.21

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 (149) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/057d288d795b853295f1.js +2 -0
  3. package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → 19493c9c7e1d2ac0f80f.js} +8 -8
  4. package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
  5. package/assets/esri/core/workers/chunks/{4fdd38d7362bf09a994b.js → 33866e6e6de1bab64599.js} +1 -1
  6. package/assets/esri/core/workers/chunks/360fd810d70d21c092d9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
  8. package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
  9. package/assets/esri/core/workers/chunks/{c9e5d3f496cefb8e3934.js → 5aa375b0c6a205134703.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 6649acaceab00ad30e7f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/7175f0c6a6e56b685d20.js +680 -0
  12. package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js → 754f7ed62afc4e0a1972.js} +2 -2
  13. package/assets/esri/core/workers/chunks/{6ac09f4e85c664a17365.js → 8331e04ebe0a54b04ab6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{5216dd0544e901039c84.js → 8c64c6b8d7376a9d1c91.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 909e67dee8c30e391d69.js} +1 -1
  17. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
  18. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
  19. package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
  20. package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
  21. package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
  22. package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
  23. package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{6e8b9c03240ec372b587.js → c30ca771dd3f7198142b.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
  26. package/assets/esri/core/workers/chunks/da47fdffb5969694a2ae.js +1 -0
  27. package/assets/esri/core/workers/chunks/{764c8ba14ab74b66b391.js → e5fcd8e7a4a660ef6ad6.js} +1 -1
  28. package/assets/esri/core/workers/chunks/f0519b06987471456b69.js +1 -0
  29. package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → f1ff33584680d8718400.js} +1 -1
  30. package/assets/esri/core/workers/chunks/f47319d36f1527277923.js +1 -0
  31. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  32. package/assets/esri/themes/dark/main.css +1 -1
  33. package/assets/esri/themes/light/main.css +1 -1
  34. package/assets/esri/themes/light/view.css +1 -1
  35. package/chunks/Pattern.glsl.js +17 -17
  36. package/chunks/RibbonLine.glsl.js +45 -43
  37. package/chunks/bundle2.js +1 -1
  38. package/config.js +1 -1
  39. package/geometry/support/geometryUtils.js +1 -1
  40. package/geometry/support/intersects.js +1 -1
  41. package/geometry/support/intersectsBase.js +1 -1
  42. package/kernel.js +1 -1
  43. package/layers/AnnotationFeatureLayer.d.ts +43 -0
  44. package/layers/AnnotationFeatureLayer.js +1 -1
  45. package/layers/DimensionFeatureLayer.d.ts +39 -0
  46. package/layers/DimensionFeatureLayer.js +1 -1
  47. package/layers/DimensionLayer.d.ts +1 -0
  48. package/layers/FeatureLayer.js +1 -1
  49. package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
  50. package/layers/ParquetLayer.d.ts +6 -10
  51. package/layers/graphics/data/attributeSupport.js +1 -1
  52. package/layers/graphics/data/queryValidationUtils.js +1 -1
  53. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  54. package/layers/mixins/ArcGISImageService.js +1 -1
  55. package/layers/raster/datasets/WCSRaster.js +1 -1
  56. package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
  57. package/layers/support/SymbolLayerDrawing.js +1 -1
  58. package/package.json +2 -2
  59. package/support/revision.js +1 -1
  60. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  61. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  62. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  63. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  64. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  66. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  68. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  69. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  70. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  71. package/views/2d/layers/LayerView2D.js +1 -1
  72. package/views/2d/layers/MediaLayerView2D.js +1 -1
  73. package/views/2d/layers/features/FeatureContainer.js +1 -1
  74. package/views/2d/layers/features/RenderState.js +1 -1
  75. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  76. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  77. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  78. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  79. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  80. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  81. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  82. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  83. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  84. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
  85. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  86. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  87. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  88. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  89. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  90. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  91. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  92. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  93. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  94. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  95. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
  96. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
  97. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
  98. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
  99. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
  100. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  101. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  102. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  103. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  104. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  105. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  106. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  107. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  108. package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
  109. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  110. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
  111. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  112. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  113. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  114. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  115. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  116. package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
  117. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  118. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  119. package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
  120. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
  121. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  122. package/views/webgl/ShaderBuilder.js +1 -1
  123. package/widgets/BatchAttributeForm.js +1 -1
  124. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  125. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  126. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  127. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  128. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  129. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  130. package/widgets/OrientedImageryViewer/constants.js +1 -1
  131. package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
  132. package/widgets/OrientedImageryViewer.js +1 -1
  133. package/widgets/Print/CustomTemplate.d.ts +7 -0
  134. package/widgets/Search/LayerSearchSource.d.ts +3 -0
  135. package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
  136. package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
  137. package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
  138. package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
  139. package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
  140. package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
  141. package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
  142. package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
  143. package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
  144. package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
  145. package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
  146. package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
  147. package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
  148. /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 057d288d795b853295f1.js.LICENSE.txt} +0 -0
  149. /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → 754f7ed62afc4e0a1972.js.LICENSE.txt} +0 -0
@@ -73,6 +73,49 @@ export interface AnnotationFeatureLayerProperties extends LayerProperties, APIKe
73
73
 
74
74
  export interface AnnotationFeatureLayerEvents extends EditBusLayerEvents, RefreshableLayerEvents, LayerEvents {}
75
75
 
76
+ /**
77
+ * An AnnotationFeatureLayer displays text as features in a 2D map. An annotation is a type of feature that consists of text with
78
+ * position, layout, and style attributes. Initially, the AnnotationFeatureLayer will display all sublayers from the service, but you can configure the
79
+ * visibility of each [AnnotationFeatureSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/) using the [visible](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/#visible) property
80
+ * on each sublayer. Annotation features are not supported by the Legend component and the printed legend (it does print, but will not display in the printed legend).
81
+ * Example of an annotation feature (see [Annotation in ArcGIS Pro](https://doc.esri.com/en/arcgis-pro/latest/help/data/annotation/annotation.html)
82
+ * for more information on creating and publishing annotation features):
83
+ *
84
+ * <figure>
85
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/layers/annotationfeaturelayer.avif" alt="annotation"/>
86
+ * <figcaption> This image shows an AnnotationFeatureLayer representing wildfire burns and water features.</figcaption>
87
+ * </figure>
88
+ *
89
+ * AnnotationFeatureLayers may be created from a [url](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/#url).
90
+ * AnnotationFeatureLayers are published with specific fonts and symbols to be used for display. Annotation features text use the same client-side rendering engine as labels.
91
+ * If the font specified by the service is not available, a default font will be used instead.
92
+ * See the [Labeling guide](/Labeling/) for more information on how to configure labeling and text symbols.
93
+ *
94
+ * ```js
95
+ * // get a reference to arcgis-map
96
+ * const viewElement = document.querySelector("arcgis-map");
97
+ * // Create an annotation feature layer from a feature service layer URL
98
+ * const layer = new AnnotationFeatureLayer({
99
+ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/RiversAnnotation/FeatureServer/0"
100
+ * });
101
+ * // add the layer to the map
102
+ * viewElement.map.add(layer);
103
+ * ```
104
+ *
105
+ * > [!WARNING]
106
+ * >
107
+ * > **Known Limitations**
108
+ * > The following features are not currently supported at this release. Future releases will see increased functionality and support for additional features.
109
+ * > * Editing
110
+ * > * The `refresh` method
111
+ *
112
+ * @beta
113
+ * @since 5.1
114
+ * @see [AnnotationFeatureSublayer (beta)](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationFeatureSublayer/)
115
+ * @see [Labeling guide](/labeling/)
116
+ * @see [Annotation in ArcGIS Pro](https://doc.esri.com/en/arcgis-pro/latest/help/data/annotation/annotation.html)
117
+ * @see [DimensionFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/)
118
+ */
76
119
  export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperclass {
77
120
  /**
78
121
  * @deprecated
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import s from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,whenOrAbort as y,onAbort as m}from"../core/promiseUtils.js";import{watch as h,sync as c}from"../core/reactiveUtils.js";import{join as f}from"../core/urlUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"./Layer.js";import{APIKeyMixin as j}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as E}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as w}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as F}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{RefreshableLayer as T}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as x}from"./mixins/TemporalLayer.js";import _ from"./support/AnnotationFeatureSublayer.js";import{parse as O,cleanTitle as C,titleFromUrlAndName as A}from"./support/arcgisLayerUrl.js";import{barrierWeight as q,id as U,popupEnabled as k}from"./support/commonProperties.js";import{ensureLayerCredential as M,createQuery as D,getFieldDomain as N,hasDataChanged as Q}from"./support/featureLayerUtils.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as J}from"./support/versionUtils.js";import R from"../rest/support/Query.js";import{createPopupTemplate as $}from"../support/popupUtils.js";import{reader as B}from"../core/accessorSupport/decorators/reader.js";const K="annotation-feature-layer",V=G(),W=a.ofType(_);let z=class extends(w(L(x(P(T(S(F(I(u(E(j(o(g))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.sublayers=new W,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Annotation Layer"]),this.type="annotation-feature",this._dataElementPromise=null,this.addHandles(h(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),c))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${K}:missing-url`,"AnnotationFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>M(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new W(t.subtypes.map(({code:e})=>new _({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,s=t.name||O(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return A(r,s);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==s)return e=C(e),s?`${e} - ${C(s)}`:e;break}}return s?C(s):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(this.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return $(this,e)}async createGraphicsSource(r){const s={stack:[],error:void 0,hasError:!1};try{const{default:t}=await y(import("./graphics/sources/FeatureLayerSource.js"),r),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(s,l(m(r,()=>i.cancelLoad())??p()),!1);return await i.load({signal:r}),i}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}createQuery(){const e=D(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const t=f(this.url,"queryDataElements"),r={f:"json",layers:this.layerId};return this._dataElementPromise=i(t,{...e,responseType:"json",query:r}).then(e=>{const t=e.data.layerDataElements,r=this.layerId,s=t.find(e=>e.layerId===r);if(!s)throw new n("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return s.dataElement}),this._dataElementPromise}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return N(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),s=await r.source.queryFeatures(R.from(e)??r.createQuery(),t);if(s?.features)for(const i of s.features){const e=this.findSublayerForFeature(i);i.origin=e?.graphicOrigin,i.layer=i.sourceLayer=this}return s}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(R.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(R.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(R.from(e)??r.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&J(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),H(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Q(this)}_fetchFirstValidLayerId(e){return i(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b(q)],z.prototype,"barrierWeight",void 0),r([b({json:{write:!0}})],z.prototype,"editingEnabled",null),r([b({readOnly:!0})],z.prototype,"effectiveEditingEnabled",null),r([b({...V.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],z.prototype,"fields",void 0),r([b(V.fieldsIndex)],z.prototype,"fieldsIndex",void 0),r([b(U)],z.prototype,"id",void 0),r([b({type:["ArcGISAnnotationLayer"]})],z.prototype,"operationalLayerType",void 0),r([b(V.outFields)],z.prototype,"outFields",void 0),r([b(k)],z.prototype,"popupEnabled",void 0),r([b({type:s,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),r([b({clonable:!1,readOnly:!0})],z.prototype,"source",void 0),r([b({type:W})],z.prototype,"sublayers",void 0),r([B("service","sublayers",["subtypes"])],z.prototype,"readSublayers",null),r([b({type:String})],z.prototype,"sublayerTitleMode",void 0),r([B("service","title",["name"])],z.prototype,"readTitleFromService",null),r([B("portal-item","title")],z.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],z.prototype,"type",void 0),r([b({type:[Number],json:{write:{ignoreOrigin:!0}}})],z.prototype,"visibleLayers",null),z=r([v("esri.layers.AnnotationFeatureLayer")],z);const X=z;export{X as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import s from"../PopupTemplate.js";import i from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,whenOrAbort as y,onAbort as m}from"../core/promiseUtils.js";import{watch as h,sync as c}from"../core/reactiveUtils.js";import{join as f}from"../core/urlUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"./Layer.js";import{APIKeyMixin as S}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as E}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as w}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as F}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{RefreshableLayer as T}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as P}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as _}from"./mixins/TemporalLayer.js";import x from"./support/AnnotationFeatureSublayer.js";import{parse as O,cleanTitle as C,titleFromUrlAndName as A}from"./support/arcgisLayerUrl.js";import{barrierWeight as q,id as U,popupEnabled as k}from"./support/commonProperties.js";import{ensureLayerCredential as M,createQuery as D,getFieldDomain as N,hasDataChanged as Q}from"./support/featureLayerUtils.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as J}from"./support/versionUtils.js";import R from"../rest/support/Query.js";import{createPopupTemplate as $}from"../support/popupUtils.js";import{reader as B}from"../core/accessorSupport/decorators/reader.js";const K="annotation-feature-layer",V=G(),W=a.ofType(x);let z=class extends(w(L(_(P(T(j(F(I(u(E(S(o(g))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.sublayers=new W,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Annotation Layer"]),this.type="annotation-feature",this._dataElementPromise=null,this.addHandles(h(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),c))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${K}:missing-url`,"AnnotationFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>M(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new W(t.subtypes.map(({code:e})=>new x({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,s=t.name||O(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return A(r,s);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==s)return e=C(e),s?`${e} - ${C(s)}`:e;break}}return s?C(s):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(this.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return $(this,e)}async createGraphicsSource(r){const s={stack:[],error:void 0,hasError:!1};try{const{default:t}=await y(import("./graphics/sources/FeatureLayerSource.js"),r),i=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(s,l(m(r,()=>i.cancelLoad())??p()),!1);return await i.load({signal:r}),i}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}createQuery(){const e=D(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const t=f(this.url,"queryDataElements"),r={f:"json",layers:this.layerId};return this._dataElementPromise=i(t,{...e,responseType:"json",query:r}).then(e=>{const t=e.data.layerDataElements,r=this.layerId,s=t.find(e=>e.layerId===r);if(!s)throw new n("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return s.dataElement}),this._dataElementPromise}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return N(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),s=await r.source.queryFeatures(R.from(e)??r.createQuery(),t);if(s?.features)for(const i of s.features){const e=this.findSublayerForFeature(i);i.origin=e?.graphicOrigin,i.layer=i.sourceLayer=this}return s}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(R.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(R.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(R.from(e)??r.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&J(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),H(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return Q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new n(K+":unsupported-version","The feature service must be version 10.8 or above.")}_fetchFirstValidLayerId(e){return i(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b(q)],z.prototype,"barrierWeight",void 0),r([b({json:{write:!0}})],z.prototype,"editingEnabled",null),r([b({readOnly:!0})],z.prototype,"effectiveEditingEnabled",null),r([b({...V.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],z.prototype,"fields",void 0),r([b(V.fieldsIndex)],z.prototype,"fieldsIndex",void 0),r([b(U)],z.prototype,"id",void 0),r([b({type:["ArcGISAnnotationLayer"]})],z.prototype,"operationalLayerType",void 0),r([b(V.outFields)],z.prototype,"outFields",void 0),r([b(k)],z.prototype,"popupEnabled",void 0),r([b({type:s,json:{name:"popupInfo",write:!0}})],z.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),r([b({clonable:!1,readOnly:!0})],z.prototype,"source",void 0),r([b({type:W})],z.prototype,"sublayers",void 0),r([B("service","sublayers",["subtypes"])],z.prototype,"readSublayers",null),r([b({type:String})],z.prototype,"sublayerTitleMode",void 0),r([B("service","title",["name"])],z.prototype,"readTitleFromService",null),r([B("portal-item","title")],z.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],z.prototype,"type",void 0),r([b({type:[Number],json:{write:{ignoreOrigin:!0}}})],z.prototype,"visibleLayers",null),z=r([v("esri.layers.AnnotationFeatureLayer")],z);const X=z;export{X as default};
@@ -45,6 +45,45 @@ export interface DimensionFeatureLayerProperties extends LayerProperties, APIKey
45
45
 
46
46
  export interface DimensionFeatureLayerEvents extends EditBusLayerEvents, RefreshableLayerEvents, LayerEvents {}
47
47
 
48
+ /**
49
+ * DimensionFeatureLayer is 2D-only, and is not supported in [3D SceneViews](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). This layer is used for showing specific lengths or distances on a map. A dimension may indicate the length of a side of a building or land parcel, or the distance between two features,
50
+ * such as a fire hydrant and the corner of a building. A dimension feature is composed of several parts that may or may not be displayed, depending on the application. These parts are each represented differently
51
+ * using different symbology and placement rules. Dimension features are not supported by the Legend component and the printed legend (it does print, but will not display in the printed legend).
52
+ * Example of a dimension feature:
53
+ *
54
+ * <figure>
55
+ * <img src="https://developers.arcgis.com/javascript/latest/assets/references/core/layers/dimensionfeaturelayer.avif" alt="dimension"/>
56
+ * <figcaption> This image shows a DimensionFeatureLayer visualizing distances.</figcaption>
57
+ * </figure>
58
+ *
59
+ * DimensionFeatureLayer may be created from a [url](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/#url).
60
+ * In the geodatabase, dimensions are stored in dimension feature classes. As with other feature classes in the geodatabase, all features in a dimension feature class have a geographic location and attributes and
61
+ * can either be inside or outside a feature dataset. Like annotation features, dimension features are graphic features, and their symbology is stored in the geodatabase.
62
+ *
63
+ * ```js
64
+ * // get a reference to arcgis-map
65
+ * const viewElement = document.querySelector("arcgis-map");
66
+ * // Create a dimension feature layer from a feature service layer URL
67
+ * const layer = new DimensionFeatureLayer({
68
+ * url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/LakeDimensions/FeatureServer/0"
69
+ * });
70
+ * // add the layer to the map
71
+ * viewElement.map.add(layer);
72
+ * ```
73
+ *
74
+ * > [!WARNING]
75
+ * >
76
+ * > **Known Limitations**
77
+ * > The following features are not currently supported at this release. Future releases will see increased functionality and support for additional features.
78
+ * > * Editing
79
+ * > * The `refresh` method
80
+ *
81
+ * @beta
82
+ * @since 5.1
83
+ * @see [Dimensions in ArcGIS Pro](https://doc.esri.com/en/arcgis-pro/latest/help/data/dimensions/dimensions-in-arcgis-pro.html)
84
+ * @see [3D DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/)
85
+ * @see [AnnotationFeatureLayer (beta)](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/)
86
+ */
48
87
  export default class DimensionFeatureLayer extends DimensionFeatureLayerSuperclass {
49
88
  /**
50
89
  * @deprecated
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,whenOrAbort as m,onAbort as d}from"../core/promiseUtils.js";import{join as c}from"../core/urlUtils.js";import{property as h,subclass as y}from"../core/accessorSupport/decorators.js";import f from"../graphic/DimensionFeatureGraphicOrigin.js";import g from"./Layer.js";import{APIKeyMixin as j}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{BlendLayer as E}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as S}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as I}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{TemporalLayer as w}from"./mixins/TemporalLayer.js";import{parse as F,cleanTitle as x,titleFromUrlAndName as O}from"./support/arcgisLayerUrl.js";import{barrierWeight as q,id as D,popupEnabled as _}from"./support/commonProperties.js";import{ensureLayerCredential as U,createQuery as M,getFieldDomain as A,hasDataChanged as G}from"./support/featureLayerUtils.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{fixTimeInfoFields as C}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as J}from"./support/versionUtils.js";import N from"../rest/support/Query.js";import{createPopupTemplate as R}from"../support/popupUtils.js";import{reader as k}from"../core/accessorSupport/decorators/reader.js";const $="dimension-feature-layer",B=Q();let H=class extends(S(E(w(T(P(v(I(L(p(b(j(s(g))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new f(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Dimension Layer"]),this.type="dimension-feature",this._dataElementPromise=null}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${$}:missing-url`,"DimensionFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(r))}).then(()=>U(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||F(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return O(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=x(e),i?`${e} - ${x(i)}`:e;break}}return i?x(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return R(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),o=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(d(t,()=>o.cancelLoad())??l()),!1);return await o.load({signal:t}),o}catch(o){i.error=o,i.hasError=!0}finally{r(i)}}createQuery(){const e=M(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const r=c(this.url,"queryDataElements"),t={f:"json",layers:this.layerId};return this._dataElementPromise=o(r,{...e,responseType:"json",query:t}).then(e=>{const r=e.data.layerDataElements,t=this.layerId,i=r.find(e=>e.layerId===t);if(!i)throw new a("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return i.dataElement}),this._dataElementPromise}getFieldDomain(e,r){return A(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(N.from(e)??t.createQuery(),r),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=t,s.origin=o;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(N.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(N.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(N.from(e)??t.createQuery(),r)}serviceSupportsSpatialReference(e){return this.loaded&&J(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),C(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return G(this)}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([h(q)],H.prototype,"barrierWeight",void 0),t([h({json:{write:!0}})],H.prototype,"editingEnabled",null),t([h({readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),t([h({...B.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],H.prototype,"fields",void 0),t([h(B.fieldsIndex)],H.prototype,"fieldsIndex",void 0),t([h({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),t([h(D)],H.prototype,"id",void 0),t([h({type:["ArcGISDimensionLayer"]})],H.prototype,"operationalLayerType",void 0),t([h(B.outFields)],H.prototype,"outFields",void 0),t([h(_)],H.prototype,"popupEnabled",void 0),t([h({type:i,json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),t([h({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),t([h({clonable:!1,readOnly:!0})],H.prototype,"source",void 0),t([h({type:String})],H.prototype,"sublayerTitleMode",void 0),t([k("service","title",["name"])],H.prototype,"readTitleFromService",null),t([k("portal-item","title")],H.prototype,"readTitleFromPortalItem",null),t([h({json:{read:!1},value:"dimension-feature",readOnly:!0})],H.prototype,"type",void 0),H=t([y("esri.layers.DimensionFeatureLayer")],H);const K=H;export{K as default};
2
+ import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,whenOrAbort as m,onAbort as d}from"../core/promiseUtils.js";import{join as c}from"../core/urlUtils.js";import{property as h,subclass as y}from"../core/accessorSupport/decorators.js";import f from"../graphic/DimensionFeatureGraphicOrigin.js";import v from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{BlendLayer as b}from"./mixins/BlendLayer.js";import{CustomParametersMixin as E}from"./mixins/CustomParametersMixin.js";import{FeatureLayerBase as S}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as P}from"./mixins/TemporalLayer.js";import{parse as F,cleanTitle as x,titleFromUrlAndName as O}from"./support/arcgisLayerUrl.js";import{barrierWeight as q,id as _,popupEnabled as D}from"./support/commonProperties.js";import{ensureLayerCredential as U,createQuery as M,getFieldDomain as A,hasDataChanged as G}from"./support/featureLayerUtils.js";import{defineFieldProperties as Q}from"./support/fieldProperties.js";import{fixTimeInfoFields as C}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as J}from"./support/versionUtils.js";import N from"../rest/support/Query.js";import{createPopupTemplate as R}from"../support/popupUtils.js";import{reader as k}from"../core/accessorSupport/decorators/reader.js";const $="dimension-feature-layer",B=Q();let H=class extends(S(b(P(L(w(j(I(T(p(E(g(s(v))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new f(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.source=null,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Dimension Layer"]),this.type="dimension-feature",this._dataElementPromise=null}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${$}:missing-url`,"DimensionFeatureLayer must be created with a url");return this.initLayerProperties(await this.createGraphicsSource(r))}).then(()=>U(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||F(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return O(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=x(e),i?`${e} - ${x(i)}`:e;break}}return i?x(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return R(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),o=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(d(t,()=>o.cancelLoad())??l()),!1);return await o.load({signal:t}),o}catch(o){i.error=o,i.hasError=!0}finally{r(i)}}createQuery(){const e=M(this);return e.where=this.definitionExpression||"1=1",e}async fetchDataElement(e){if(this._dataElementPromise)return this._dataElementPromise;if(!this.url)throw new Error("InternalError: A URL is required to retrieve the data element for this layer.");const r=c(this.url,"queryDataElements"),t={f:"json",layers:this.layerId};return this._dataElementPromise=o(r,{...e,responseType:"json",query:t}).then(e=>{const r=e.data.layerDataElements,t=this.layerId,i=r.find(e=>e.layerId===t);if(!i)throw new a("fetchDataElement:not-available","A data element for this layer could not be retrieved.");return i.dataElement}),this._dataElementPromise}getFieldDomain(e,r){return A(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(N.from(e)??t.createQuery(),r),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=t,s.origin=o;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(N.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(N.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(N.from(e)??t.createQuery(),r)}serviceSupportsSpatialReference(e){return this.loaded&&J(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),C(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return G(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a($+":unsupported-version","The feature service must be version 10.8 or above.")}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([h(q)],H.prototype,"barrierWeight",void 0),t([h({json:{write:!0}})],H.prototype,"editingEnabled",null),t([h({readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),t([h({...B.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],H.prototype,"fields",void 0),t([h(B.fieldsIndex)],H.prototype,"fieldsIndex",void 0),t([h({readOnly:!0,clonable:!1})],H.prototype,"graphicOrigin",void 0),t([h(_)],H.prototype,"id",void 0),t([h({type:["ArcGISDimensionLayer"]})],H.prototype,"operationalLayerType",void 0),t([h(B.outFields)],H.prototype,"outFields",void 0),t([h(D)],H.prototype,"popupEnabled",void 0),t([h({type:i,json:{name:"popupInfo",write:!0}})],H.prototype,"popupTemplate",void 0),t([h({readOnly:!0})],H.prototype,"defaultPopupTemplate",null),t([h({clonable:!1,readOnly:!0})],H.prototype,"source",void 0),t([h({type:String})],H.prototype,"sublayerTitleMode",void 0),t([k("service","title",["name"])],H.prototype,"readTitleFromService",null),t([k("portal-item","title")],H.prototype,"readTitleFromPortalItem",null),t([h({json:{read:!1},value:"dimension-feature",readOnly:!0})],H.prototype,"type",void 0),H=t([y("esri.layers.DimensionFeatureLayer")],H);const K=H;export{K as default};
@@ -103,6 +103,7 @@ export interface DimensionLayerProperties extends LayerProperties, OperationalLa
103
103
  * @see [DimensionSimpleStyle](https://developers.arcgis.com/javascript/latest/references/core/analysis/DimensionSimpleStyle/)
104
104
  * @see [DimensionAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/DimensionAnalysisView3D/)
105
105
  * @see [Sample - Length dimensioning](https://developers.arcgis.com/javascript/latest/sample-code/layers-dimension/)
106
+ * @see [2D DimensionFeatureLayer (beta)](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionFeatureLayer/)
106
107
  */
107
108
  export default class DimensionLayer extends DimensionLayerSuperclass {
108
109
  /** @example const dimensionLayer = new DimensionLayer(); */
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import L from"../graphic/FeatureGraphicOrigin.js";import E from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as q}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as M}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as A}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as G}from"./mixins/PublishableLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as H}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as Z,parse as $,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as he,getFeatureType as fe,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import De from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as Oe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as xe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Ae from"./support/LabelClass.js";import{reader as Re}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TimeInfo.js";import Ne from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ge}from"./support/versionUtils.js";import{read as Je}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Be}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as We,rendererTypes as He}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import ke from"../rest/support/Query.js";import{isNumber as ze}from"../support/guards.js";import{createPopupTemplate as Ke}from"../support/popupUtils.js";import{symbolTypes as Xe}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Ye}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as et}from"../webdoc/support/unsupportedErrors.js";import{reader as tt}from"../core/accessorSupport/decorators/reader.js";import{writer as rt}from"../core/accessorSupport/decorators/writer.js";const it="FeatureLayer";function ot(e){return e&&e instanceof a}const st=xe();function at(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let nt=class extends(R(Q(A(G(M(q(P(V(W(x(H(B(J(C(U(N(m(O(_(s(E))))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new L(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ne({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Je(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),ot(t)&&this._resetMemorySource(t),ot(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let e=r;if(!e&&this.url){const t=$(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=De.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,it,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return Oe(this)}createPopupTemplate(e){return Ke(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return he(this,e,it)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return fe(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,it)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(ke.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,it)}async queryFeatureCount(e,t){return ve(this,e,t,it)}async queryExtent(e,t){return Fe(this,e,t,it)}async queryRelatedFeatures(e,t){return Te(this,e,t,it)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,it)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(it,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(it,"Layer source does not support queryAttributeBins capability");Se(e,i,it);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ze)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return et(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return et(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return et(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return et(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(it,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ge(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Be(this,{origin:"service"})}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],nt.prototype,"_titleCreator",null),r([F(z)],nt.prototype,"attributeTableTemplate",void 0),r([tt("service","capabilities")],nt.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],nt.prototype,"charts",void 0),r([F({readOnly:!0})],nt.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],nt.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],nt.prototype,"displayField",void 0),r([F({types:Xe,readOnly:!0})],nt.prototype,"defaultSymbol",void 0),r([F({type:Ze})],nt.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],nt.prototype,"editingEnabled",null),r([tt(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],nt.prototype,"readEditingEnabled",null),r([tt("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],nt.prototype,"readEditingEnabledFromWebMap",null),r([rt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabled",null),r([rt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],nt.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],nt.prototype,"featureTitleFields",null),r([F({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],nt.prototype,"fieldConfigurations",null),r([F({...st.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:at}}}}})],nt.prototype,"fields",void 0),r([F(st.fieldsIndex)],nt.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],nt.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],nt.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:at,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],nt.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],nt.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],nt.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],nt.prototype,"hasZ",void 0),r([F(K)],nt.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],nt.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],nt.prototype,"isTable",void 0),r([tt("service","isTable",["type","geometryType"]),tt("isTable",["layerDefinition.type","layerDefinition.geometryType"])],nt.prototype,"readIsTable",null),r([rt("web-map","isTable")],nt.prototype,"writeIsTable",null),r([F(X)],nt.prototype,"labelsVisible",void 0),r([F({type:[Ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Re,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Re,write:{layerContainerTypes:j}}})],nt.prototype,"labelingInfo",void 0),r([F({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],nt.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ye(e),t)}}},e})())],nt.prototype,"opacity",void 0),r([F(ee)],nt.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],nt.prototype,"listMode",void 0),r([tt("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],nt.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:at}}}}})],nt.prototype,"objectIdField",void 0),r([tt("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],nt.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],nt.prototype,"operationalLayerType",void 0),r([F(st.outFields)],nt.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],nt.prototype,"path",void 0),r([F(re)],nt.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],nt.prototype,"popupTemplate",void 0),r([rt("popupTemplate")],nt.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"defaultPopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"reloading",void 0),r([F({types:He,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:We,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],nt.prototype,"renderer",null),r([tt("service","renderer",["drawingInfo.renderer","defaultSymbol"]),tt("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],nt.prototype,"readRenderer",null),r([F()],nt.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],nt.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],nt.prototype,"source",null),r([tt("portal-item","source",["featureSet"]),tt("web-map","source",["featureSet"])],nt.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],nt.prototype,"spatialReference",void 0),r([F({type:Number})],nt.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],nt.prototype,"subtypeField",void 0),r([F({readOnly:!1})],nt.prototype,"subtypes",void 0),r([F({type:[Ee]})],nt.prototype,"templates",void 0),r([tt("templates",["editFieldsInfo","creatorField","editorField","templates"])],nt.prototype,"readTemplates",null),r([F({type:Ve})],nt.prototype,"timeInfo",void 0),r([F()],nt.prototype,"title",void 0),r([tt("service","title",["name"]),tt("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],nt.prototype,"readTitle",null),r([tt("web-map","title",["layerDefinition.name","title"])],nt.prototype,"readTitleFromWebMap",null),r([F({type:String})],nt.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],nt.prototype,"type",void 0),r([F({type:String})],nt.prototype,"typeIdField",void 0),r([tt("service","typeIdField"),tt("typeIdField",["layerDefinition.typeIdField"])],nt.prototype,"readTypeIdField",null),r([F({type:[De]})],nt.prototype,"types",void 0),r([tt("service","types",["types"]),tt("types",["layerDefinition.types"])],nt.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],nt.prototype,"visible",void 0),r([tt("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],nt.prototype,"readVisible",null),nt=r([T("esri.layers.FeatureLayer")],nt);export{nt as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import L from"../graphic/FeatureGraphicOrigin.js";import D from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as q}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as M}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as A}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as G}from"./mixins/PublishableLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as H}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as Z,parse as $,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as he,getFeatureType as fe,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import De from"./support/FeatureTemplate.js";import Ee from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as Oe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as xe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Ae from"./support/LabelClass.js";import{reader as Re}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TimeInfo.js";import Ne from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ge}from"./support/versionUtils.js";import{read as Je}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Be}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as We,rendererTypes as He}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import ke from"../rest/support/Query.js";import{isNumber as ze}from"../support/guards.js";import{createPopupTemplate as Ke}from"../support/popupUtils.js";import{symbolTypes as Xe}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Ye}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as et}from"../webdoc/support/unsupportedErrors.js";import{reader as tt}from"../core/accessorSupport/decorators/reader.js";import{writer as rt}from"../core/accessorSupport/decorators/writer.js";const it="FeatureLayer";function ot(e){return e&&e instanceof a}const st=xe();function at(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let nt=class extends(R(Q(A(G(M(q(P(V(W(x(H(B(J(C(U(N(m(O(_(s(D))))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new L(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ne({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readSymbolLayerDrawing(e,t){const r=t.layerDefinition?.drawingInfo,i=r?.renderer,o=r?.symbolLayerDrawing;return i&&o?new Ue(o):null}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Je(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new E({layer:this,items:e})),ot(t)&&this._resetMemorySource(t),ot(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>De.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let e=r;if(!e&&this.url){const t=$(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Ee.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,it,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return Oe(this)}createPopupTemplate(e){return Ke(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return he(this,e,it)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return fe(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,it)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(ke.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,it)}async queryFeatureCount(e,t){return ve(this,e,t,it)}async queryExtent(e,t){return Fe(this,e,t,it)}async queryRelatedFeatures(e,t){return Te(this,e,t,it)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,it)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(it,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(it,"Layer source does not support queryAttributeBins capability");Se(e,i,it);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ze)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return et(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return et(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return et(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return et(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(it,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ge(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Be(this,{origin:"service"})}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],nt.prototype,"_titleCreator",null),r([F(z)],nt.prototype,"attributeTableTemplate",void 0),r([tt("service","capabilities")],nt.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],nt.prototype,"charts",void 0),r([F({readOnly:!0})],nt.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],nt.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],nt.prototype,"displayField",void 0),r([F({types:Xe,readOnly:!0})],nt.prototype,"defaultSymbol",void 0),r([F({type:Ze})],nt.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],nt.prototype,"editingEnabled",null),r([tt(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],nt.prototype,"readEditingEnabled",null),r([tt("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],nt.prototype,"readEditingEnabledFromWebMap",null),r([rt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabled",null),r([rt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],nt.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],nt.prototype,"featureTitleFields",null),r([F({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],nt.prototype,"fieldConfigurations",null),r([F({...st.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:at}}}}})],nt.prototype,"fields",void 0),r([F(st.fieldsIndex)],nt.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],nt.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],nt.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:at,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],nt.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],nt.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],nt.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],nt.prototype,"hasZ",void 0),r([F(K)],nt.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],nt.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],nt.prototype,"isTable",void 0),r([tt("service","isTable",["type","geometryType"]),tt("isTable",["layerDefinition.type","layerDefinition.geometryType"])],nt.prototype,"readIsTable",null),r([rt("web-map","isTable")],nt.prototype,"writeIsTable",null),r([F(X)],nt.prototype,"labelsVisible",void 0),r([F({type:[Ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Re,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Re,write:{layerContainerTypes:j}}})],nt.prototype,"labelingInfo",void 0),r([F({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],nt.prototype,"symbolLayerDrawing",void 0),r([tt(["portal-item","web-map"],"symbolLayerDrawing",["layerDefinition.drawingInfo.renderer","layerDefinition.drawingInfo.symbolLayerDrawing"])],nt.prototype,"readSymbolLayerDrawing",null),r([F((()=>{const e=d(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ye(e),t)}}},e})())],nt.prototype,"opacity",void 0),r([F(ee)],nt.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],nt.prototype,"listMode",void 0),r([tt("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],nt.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:at}}}}})],nt.prototype,"objectIdField",void 0),r([tt("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],nt.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],nt.prototype,"operationalLayerType",void 0),r([F(st.outFields)],nt.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],nt.prototype,"path",void 0),r([F(re)],nt.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],nt.prototype,"popupTemplate",void 0),r([rt("popupTemplate")],nt.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"defaultPopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"reloading",void 0),r([F({types:He,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:We,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],nt.prototype,"renderer",null),r([tt("service","renderer",["drawingInfo.renderer","defaultSymbol"]),tt("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],nt.prototype,"readRenderer",null),r([F()],nt.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],nt.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],nt.prototype,"source",null),r([tt("portal-item","source",["featureSet"]),tt("web-map","source",["featureSet"])],nt.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],nt.prototype,"spatialReference",void 0),r([F({type:Number})],nt.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],nt.prototype,"subtypeField",void 0),r([F({readOnly:!1})],nt.prototype,"subtypes",void 0),r([F({type:[De]})],nt.prototype,"templates",void 0),r([tt("templates",["editFieldsInfo","creatorField","editorField","templates"])],nt.prototype,"readTemplates",null),r([F({type:Ve})],nt.prototype,"timeInfo",void 0),r([F()],nt.prototype,"title",void 0),r([tt("service","title",["name"]),tt("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],nt.prototype,"readTitle",null),r([tt("web-map","title",["layerDefinition.name","title"])],nt.prototype,"readTitleFromWebMap",null),r([F({type:String})],nt.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],nt.prototype,"type",void 0),r([F({type:String})],nt.prototype,"typeIdField",void 0),r([tt("service","typeIdField"),tt("typeIdField",["layerDefinition.typeIdField"])],nt.prototype,"readTypeIdField",null),r([F({type:[Ee]})],nt.prototype,"types",void 0),r([tt("service","types",["types"]),tt("types",["layerDefinition.types"])],nt.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],nt.prototype,"visible",void 0),r([tt("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],nt.prototype,"readVisible",null),nt=r([T("esri.layers.FeatureLayer")],nt);export{nt as default};
@@ -84,7 +84,7 @@ export interface IntegratedMesh3DTilesLayerProperties extends LayerProperties, A
84
84
 
85
85
  /**
86
86
  * The IntegratedMesh3DTilesLayer is designed for visualizing accurate representations of built and natural
87
- * environments in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
87
+ * environments in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
88
88
  *
89
89
  * Integrated mesh data is typically captured by an automated process for constructing 3D features from large sets of
90
90
  * overlapping imagery. The result integrates the original input image information as a realistic textured mesh and can
@@ -105,6 +105,14 @@ export interface IntegratedMesh3DTilesLayerProperties extends LayerProperties, A
105
105
  * });
106
106
  * ```
107
107
  *
108
+ * 3D Tiles data can include the
109
+ * [ESRI_crs](https://github.com/Esri/3D-tiles-layer/blob/main/ESRI_CRS/Esri_crs_extension.md) extension, which allows
110
+ * the data to be authored for a specific projected coordinate system (PCS) while still remaining available in WGS84
111
+ * and Web Mercator scenes. In a global or local scene with a [SceneView.spatialReference](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#spatialReference) set to WGS84 or
112
+ * Web Mercator, the layer will load in WGS84. In a local scene with a spatial reference explicitly set to the Esri_crs
113
+ * PCS, the layer will load in that PCS. If a local scene's spatial reference is dynamically determined from the layers
114
+ * in the scene, the layer will load in WGS84 unless all other layers also use the same Esri_crs PCS.
115
+ *
108
116
  * @since 4.29
109
117
  * @see [Sample - IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-integratedmesh3dtileslayer/)
110
118
  * @see [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
@@ -294,12 +294,10 @@ export interface ParquetLayerProperties extends LayerProperties, CustomParameter
294
294
  * >
295
295
  * > **Known Limitations**
296
296
  * >
297
- * > The ParquetLayer is supported in a [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) or a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
298
- * > The ParquetLayer only supports geographic (WGS84) and Web Mercator spatial references.
299
- * > Time and date fields may be downgraded to numeric values.
300
- * > The [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/) does not support the [Query.outStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outStatistics),
301
- * > [Query.orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields), or [Query.returnDistinctValues](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnDistinctValues)
302
- * > query parameters when the layer has more than 20,000 features.
297
+ * > * The ParquetLayer is supported in a [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) or a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
298
+ * > * The ParquetLayer only supports geographic (WGS84) and Web Mercator spatial references.
299
+ * > * Time and date fields may be downgraded to numeric values.
300
+ * > * ParquetLayer supports the [orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields) query parameter for datasets containing up to 500,000 features.
303
301
  *
304
302
  * @beta
305
303
  * @since 4.33
@@ -784,10 +782,8 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
784
782
  * >
785
783
  * > **Known Limitations**
786
784
  * >
787
- * > The [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/) does not support the [Query.outStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outStatistics),
788
- * > [Query.orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields), or [Query.returnDistinctValues](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnDistinctValues)
789
- * > query parameters when the layer has more than 20,000 features.
790
- * > Attribute values used in attribute queries executed against ParquetLayer are case sensitive.
785
+ * > * ParquetLayer supports the [orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields) query parameter for datasets containing up to 500,000 features.
786
+ * > * Attribute values used in attribute queries executed against ParquetLayer are case sensitive.
791
787
  *
792
788
  * @param query - Specifies the attributes and spatial
793
789
  * filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";import{kebabDict as r}from"../../support/fieldType.js";const s=new i(50,500),t="unsupported-query",n=" as ",o=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),a=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),l=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...o,...a]);function d(i,r,n={}){const o=c(r,i);if(!o){const n=s.getError(r,i);throw new e(t,"invalid SQL expression",{expression:r,error:n})}const a=n.expressionName||"expression";if(n.validateStandardized&&!o.isStandardized)throw new e(t,`${a} is not standard`,{expression:r});if(n.validateAggregate&&!o.isAggregate)throw new e(t,`${a} does not contain a valid aggregate function`,{expression:r});return o.fieldNames}function p(e,i,r,s){if(!r)return!0;const t="where clause";return g(e,i,d(e,r,{validateStandardized:!0,expressionName:t}),{expressionName:t,query:s}),!0}function f(i,r,s,n,o){if(!s)return!0;const a="having clause",l=d(i,s,{validateAggregate:!0,expressionName:a});g(i,r,l,{expressionName:a,query:o});const p=c(s,i),f=p?.getExpressions().every(e=>{const{aggregateType:r,field:s}=e,t=i.get(s)?.name;return n.some(e=>{const{onStatisticField:s,statisticType:n}=e,o=i.get(s)?.name;return o===t&&n.toLowerCase().trim()===r})});if(!f)throw new e(t,"expressions in having clause should also exist in outStatistics",{having:s});return!0}function c(e,i){return e?s.get(e,i):null}function u(e){return/\((.*?)\)/.test(e)?e:e.split(n)[0]}function y(e){return e.split(n)[1]}function g(i,r,s,n={}){const o=new Map;if(m(o,i,r,n.allowedFieldTypes??l,s),o.size){const i=n.expressionName??"expression";throw new e(t,`${i} contains invalid or missing fields`,{errors:Array.from(o.values()),query:n.query})}}function m(e,i,r,s,t){const n=t.includes("*")?[...r,...t.filter(e=>"*"!==e)]:t;for(const a of n){if(i.get(a))T(e,i,r,s,a);else try{const t=d(i,u(a),{validateStandardized:!0});for(const n of t)T(e,i,r,s,n)}catch(o){e.set(a,{type:"expression-error",expression:a,error:o})}}}function T(e,i,s,t,n){const o=i.get(n);o?s.has(o.name)?"all"!==t&&!1===t?.has(o.type)&&e.set(n,{type:"invalid-type",fieldName:o.name,fieldType:r.fromJSON(o.type),allowedFieldTypes:Array.from(t,e=>r.fromJSON(e))}):e.set(n,{type:"missing-field",fieldName:o.name}):e.set(n,{type:"invalid-field",fieldName:n})}export{a as allDateAndTimeFieldTypes,y as getAliasFromFieldName,u as getExpressionFromFieldName,c as getWhereClause,o as numericFieldTypes,g as validateFields,f as validateHaving,p as validateWhere};
2
+ import e from"../../../core/Error.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";import{kebabDict as r}from"../../support/fieldType.js";const t=new i(50,500),n="unsupported-query",s=" as ",o=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),a=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),l=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...o,...a]);function d(i,r,s={}){const o=c(r,i);if(!o){const s=t.getError(r,i);throw new e(n,"invalid SQL expression",{expression:r,error:s})}const a=s.expressionName||"expression";if(s.validateStandardized&&!o.isStandardized)throw new e(n,`${a} is not standard`,{expression:r});if(s.validateAggregate&&!o.isAggregate)throw new e(n,`${a} does not contain a valid aggregate function`,{expression:r});return o.fieldNames}function p(e,i,r,t){if(!r)return!0;const n="where clause";return g(e,i,d(e,r,{validateStandardized:!0,expressionName:n}),{expressionName:n,query:t}),!0}function f(i,r,t,s,o){if(!t)return!0;const a="having clause",l=d(i,t,{validateAggregate:!0,expressionName:a});g(i,r,l,{expressionName:a,query:o});const p=c(t,i),f=p?.getExpressions().every(e=>{const{aggregateType:r,field:t}=e,n=i.get(t)?.name;return s.some(e=>{const{onStatisticField:t,statisticType:s}=e,o=i.get(t)?.name;return o===n&&s.toLowerCase().trim()===r})});if(!f)throw new e(n,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function c(e,i){return e?t.get(e,i):null}function u(e){return/\((.*?)\)/.test(e)?e:e.split(s)[0]}function y(e){return e.split(s)[1]}function m(e,i,r){if(!F(i))return[];const t=new Set,n=i=>{if(i&&"*"!==i)for(const r of w(e,i))t.add(r)};for(const s of i)n(s.onStatisticField);for(const s of r??[])n(s);return Array.from(t)}function g(i,r,t,s={}){const o=new Map;if(T(o,i,r,s.allowedFieldTypes??l,t),o.size){const i=s.expressionName??"expression";throw new e(n,`${i} contains invalid or missing fields`,{errors:Array.from(o.values()),query:s.query})}}function T(e,i,r,t,n){const s=n.includes("*")?[...r,...n.filter(e=>"*"!==e)]:n;for(const a of s){if(i.get(a))x(e,i,r,t,a);else try{for(const n of w(i,a))x(e,i,r,t,n)}catch(o){e.set(a,{type:"expression-error",expression:a,error:o})}}}function w(e,i){const r=e.get(i);if(r)return[r.name];return d(e,u(i),{validateStandardized:!0})}function x(e,i,t,n,s){const o=i.get(s);o?t.has(o.name)?"all"!==n&&!1===n?.has(o.type)&&e.set(s,{type:"invalid-type",fieldName:o.name,fieldType:r.fromJSON(o.type),allowedFieldTypes:Array.from(n,e=>r.fromJSON(e))}):e.set(s,{type:"missing-field",fieldName:o.name}):e.set(s,{type:"invalid-field",fieldName:s})}function F(e){return null!=e&&e.every(e=>"exceedslimit"!==e.statisticType)}export{a as allDateAndTimeFieldTypes,y as getAliasFromFieldName,u as getExpressionFromFieldName,m as getFieldNamesFromStatistics,c as getWhereClause,F as isFieldStatisticDefinition,o as numericFieldTypes,g as validateFields,f as validateHaving,p as validateWhere};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{validateFields as t,validateWhere as i,validateHaving as s,numericFieldTypes as r,allDateAndTimeFieldTypes as o}from"./attributeSupport.js";import{checkProjectionSupport as n}from"./projectionSupport.js";import{checkSpatialQuerySupport as a}from"./spatialQuerySupport.js";import{loadArcade as l}from"../../../support/loadArcade.js";const u="unsupported-query";async function p(t,i){const s=t.bin;if(!s.onField&&!s.onExpression?.value||"autoIntervalBin"===s.type&&null==s.parameters.numberOfBins||"dateBin"===s.type&&(null==s.parameters.number||null==s.parameters.unit)||"fixedBoundariesBin"===s.type&&null==s.parameters.boundaries||"fixedIntervalBin"===s.type&&null==s.parameters.interval)throw new e(u,"Unsupported query options",{query:t});return d(t,i)}async function d(t,{fieldsIndex:i,geometryType:s,spatialReference:r,availableFields:o}){if(null!=t.geometryPrecision||t.multipatchOption&&"xyFootprint"!==t.multipatchOption||t.pixelSize||t.relationParam||t.text)throw new e(u,"Unsupported query options",{query:t});return c(i,o,t),m(i,o,t),Promise.all([a(t,s,r),n(r,t.outSR)]).then(()=>t)}function c(s,r,o){const{returnDistinctValues:n,outStatistics:a}=o,l=a?a.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in o&&o.orderByFields&&o.orderByFields.length>0){const e=" asc",i=" desc",n=o.orderByFields.map(t=>{const s=t.toLowerCase();return s.includes(e)?s.split(e)[0]:s.includes(i)?s.split(i)[0]:t}).filter(e=>!l.includes(e));t(s,r,n,{expressionName:"orderByFields",query:o})}if("outFields"in o)if(o.outFields?.length)t(s,r,o.outFields,{expressionName:"outFields",query:o,allowedFieldTypes:"all"});else if(n)throw new e(u,"outFields should be specified for returnDistinctValues",{query:o});i(s,r,o.where,o)}const f=new Set([...r,...o]);function m(i,r,o){const{outStatistics:n,groupByFieldsForStatistics:a,having:l}=o,p=a?.length,d=n?.length;if(l){if(!p||!d)throw new e(u,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:o});s(i,r,l,n,o)}if(d){if(!h(n))return;const s=n.map(e=>e.onStatisticField).filter(Boolean);t(i,r,s,{expressionName:"onStatisticFields",query:o}),p&&t(i,r,a,{expressionName:"groupByFieldsForStatistics",query:o});for(const a of n){const{onStatisticField:s,statisticType:n}=a;if(("percentile_disc"===n||"percentile_cont"===n)&&"statisticParameters"in a){const{statisticParameters:t}=a;if(!t)throw new e(u,"statisticParameters should be set for percentile type",{definition:a,query:o})}else i.get(s)&&"count"!==n&&"min"!==n&&"max"!==n&&t(i,r,[s],{expressionName:`outStatistics with '${n}' statistic type`,allowedFieldTypes:f,query:o})}}}async function y(t,i,{fieldsIndex:s,geometryType:r,spatialReference:o,availableFields:l}){if(null!=t.geometryPrecision||t.multipatchOption||t.pixelSize||t.relationParam||t.text||t.outStatistics||t.groupByFieldsForStatistics||t.having||t.orderByFields)throw new e(u,"Unsupported query options",{query:t});return c(s,l,t),Promise.all([F(s,l,i,t),a(t,r,o),n(o,t.outSR)]).then(()=>t)}async function F(i,s,r,o){let n=[];if(r.valueExpression){const{arcadeUtils:e}=await l();n=e.extractFieldNames(r.valueExpression)}if(r.field&&n.push(r.field),r.field2&&n.push(r.field2),r.field3&&n.push(r.field3),r.normalizationField&&n.push(r.normalizationField),!n.length&&!r.valueExpression)throw new e(u,"field or valueExpression is required",{params:r});t(i,s,n,{expressionName:"statistics",query:o})}function h(e){return null!=e&&e.every(e=>"exceedslimit"!==e.statisticType)}export{p as validateAttributeBinsQuery,d as validateQuery,y as validateStatisticsQuery};
2
+ import e from"../../../core/Error.js";import{validateFields as t,validateWhere as i,validateHaving as s,isFieldStatisticDefinition as r,getFieldNamesFromStatistics as o,numericFieldTypes as n,allDateAndTimeFieldTypes as a}from"./attributeSupport.js";import{checkProjectionSupport as l}from"./projectionSupport.js";import{checkSpatialQuerySupport as u}from"./spatialQuerySupport.js";import{loadArcade as p}from"../../../support/loadArcade.js";const d="unsupported-query";async function c(t,i){const s=t.bin;if(!s.onField&&!s.onExpression?.value||"autoIntervalBin"===s.type&&null==s.parameters.numberOfBins||"dateBin"===s.type&&(null==s.parameters.number||null==s.parameters.unit)||"fixedBoundariesBin"===s.type&&null==s.parameters.boundaries||"fixedIntervalBin"===s.type&&null==s.parameters.interval)throw new e(d,"Unsupported query options",{query:t});return f(t,i)}async function f(t,{fieldsIndex:i,geometryType:s,spatialReference:r,availableFields:o}){if(null!=t.geometryPrecision||t.multipatchOption&&"xyFootprint"!==t.multipatchOption||t.pixelSize||t.relationParam||t.text)throw new e(d,"Unsupported query options",{query:t});return m(i,o,t),h(i,o,t),Promise.all([u(t,s,r),l(r,t.outSR)]).then(()=>t)}function m(s,r,o){const{returnDistinctValues:n,outStatistics:a}=o,l=a?a.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in o&&o.orderByFields&&o.orderByFields.length>0){const e=" asc",i=" desc",n=o.orderByFields.map(t=>{const s=t.toLowerCase();return s.includes(e)?s.split(e)[0]:s.includes(i)?s.split(i)[0]:t}).filter(e=>!l.includes(e));t(s,r,n,{expressionName:"orderByFields",query:o})}if("outFields"in o)if(o.outFields?.length)t(s,r,o.outFields,{expressionName:"outFields",query:o,allowedFieldTypes:"all"});else if(n)throw new e(d,"outFields should be specified for returnDistinctValues",{query:o});i(s,r,o.where,o)}const y=new Set([...n,...a]);function h(i,n,a){const{outStatistics:l,groupByFieldsForStatistics:u,having:p}=a,c=u?.length,f=l?.length;if(p){if(!c||!f)throw new e(d,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:a});s(i,n,p,l,a)}if(f){if(!r(l))return;const s=o(i,l,u);t(i,n,s,{expressionName:"statistics",query:a});for(const r of l){const{onStatisticField:s,statisticType:o}=r;if(("percentile_disc"===o||"percentile_cont"===o)&&"statisticParameters"in r){const{statisticParameters:t}=r;if(!t)throw new e(d,"statisticParameters should be set for percentile type",{definition:r,query:a})}else i.get(s)&&"count"!==o&&"min"!==o&&"max"!==o&&t(i,n,[s],{expressionName:`outStatistics with '${o}' statistic type`,allowedFieldTypes:y,query:a})}}}async function F(t,i,{fieldsIndex:s,geometryType:r,spatialReference:o,availableFields:n}){if(null!=t.geometryPrecision||t.multipatchOption||t.pixelSize||t.relationParam||t.text||t.outStatistics||t.groupByFieldsForStatistics||t.having||t.orderByFields)throw new e(d,"Unsupported query options",{query:t});return m(s,n,t),Promise.all([w(s,n,i,t),u(t,r,o),l(o,t.outSR)]).then(()=>t)}async function w(i,s,r,o){let n=[];if(r.valueExpression){const{arcadeUtils:e}=await p();n=e.extractFieldNames(r.valueExpression)}if(r.field&&n.push(r.field),r.field2&&n.push(r.field2),r.field3&&n.push(r.field3),r.normalizationField&&n.push(r.normalizationField),!n.length&&!r.valueExpression)throw new e(d,"field or valueExpression is required",{params:r});t(i,s,n,{expressionName:"statistics",query:o})}export{c as validateAttributeBinsQuery,f as validateQuery,F as validateStatisticsQuery};