@arcgis/core 5.0.0-next.18 → 5.0.0-next.19

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 (105) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/analysis/ElevationProfile/ElevationProfileLineGround.js +1 -1
  3. package/analysis/ElevationProfile/ElevationProfileLineInput.js +1 -1
  4. package/analysis/ElevationProfile/ElevationProfileLineQuery.js +1 -1
  5. package/analysis/ElevationProfile/ElevationProfileLineScene.js +1 -1
  6. package/arcade/featureSetUtils.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerOGC.js +5 -0
  10. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  11. package/arcade/featureset/support/FeatureSet.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/assets/esri/core/workers/RemoteClient.js +1 -1
  14. package/assets/esri/core/workers/chunks/057d59ee6144e5890780.js +1 -0
  15. package/assets/esri/core/workers/chunks/{31b5900119dd7cd9e7d3.js → 0a6ad58ca4ca0cba2fa0.js} +1 -1
  16. package/assets/esri/core/workers/chunks/0d8d3d0de49064971874.js +1 -0
  17. package/assets/esri/core/workers/chunks/{b87bc987983b31c13f64.js → 0f1b9d69961dad0b922f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/110cc01dd6af7ee125d4.js +1 -0
  19. package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +1 -0
  20. package/assets/esri/core/workers/chunks/{5f6df4a3376b52ead53f.js → 14f994b1dd682bf2d61a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/3538eb39ebb58acedd67.js +1 -0
  22. package/assets/esri/core/workers/chunks/{02a22dd6d208a925cc5a.js → 52cf643621662712dc85.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5755b11272b777507612.js +1 -0
  24. package/assets/esri/core/workers/chunks/{d69265ceabfa92b40bb7.js → 58969dde8c3d0b2a9829.js} +1 -1
  25. package/assets/esri/core/workers/chunks/6e4829b52ade3e41ccc4.js +1 -0
  26. package/assets/esri/core/workers/chunks/{4a89e120be142ab58a27.js → 7224b321606116fd691c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{257f17b3836a623a9dbe.js → 795b09ff7a8f4e91f4dc.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3ac7562ea90f91a9f30c.js → 82b2741e75c2e9b88252.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5d2e5774768d8f290343.js → b656e8fd374113523404.js} +1 -1
  30. package/assets/esri/core/workers/chunks/bccb9ac572bc093fb177.js +1 -0
  31. package/assets/esri/core/workers/chunks/{79dbfa2b9b332ca0002f.js → c52161b94c0fb071747e.js} +1 -1
  32. package/assets/esri/core/workers/chunks/db76958fd9f54b6bd324.js +1 -0
  33. package/assets/esri/core/workers/chunks/e61d7762b56e36dc7e8a.js +1 -0
  34. package/assets/esri/core/workers/chunks/{b30897952494a3e5b9fe.js → e69c2b613bd0210e25ba.js} +1 -1
  35. package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +1 -0
  36. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  37. package/chunks/GlowComposition.glsl.js +46 -46
  38. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  39. package/config.js +1 -1
  40. package/editing/templateUtils.js +1 -1
  41. package/interfaces.d.ts +120 -23
  42. package/kernel.js +1 -1
  43. package/layers/BingMapsLayer.js +1 -1
  44. package/layers/PointCloudLayer.js +1 -1
  45. package/layers/SceneLayer.js +1 -1
  46. package/layers/VideoLayer.js +1 -1
  47. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  48. package/layers/mixins/SceneService.js +1 -1
  49. package/layers/ogc/ogcFeatureUtils.js +1 -1
  50. package/libs/parquet/parquet.js +1 -1
  51. package/package.json +1 -1
  52. package/renderers/support/RasterSymbolizer.js +1 -1
  53. package/rest/support/QueryMixin.js +1 -1
  54. package/support/revision.js +1 -1
  55. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  56. package/symbols/cim/cimAnalyzer.js +1 -1
  57. package/undoredo/support/ServiceVersionInfo.js +1 -1
  58. package/undoredo/support/Services.js +1 -1
  59. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  60. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  61. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +5 -0
  62. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
  63. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +5 -0
  64. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  65. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  66. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  67. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  68. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  69. package/views/3d/environment/SunLighting.js +1 -1
  70. package/views/3d/environment/VirtualLighting.js +1 -1
  71. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  72. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  73. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  74. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  75. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  76. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  77. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  78. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  79. package/widgets/Editor/VisibleElements.js +1 -1
  80. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  81. package/widgets/Editor/workflowUtils.js +1 -1
  82. package/widgets/Editor.js +1 -1
  83. package/widgets/FeatureTable/FieldColumn.js +1 -1
  84. package/widgets/FeatureTable/Grid/Column.js +1 -1
  85. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  86. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  87. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  88. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  89. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  90. package/widgets/OrientedImageryViewer.js +1 -1
  91. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  92. package/widgets/smartMapping/SizeSlider.js +1 -1
  93. package/widgets/support/SelectionList/VisibleElements.js +1 -1
  94. package/widgets/support/SelectionList.js +1 -1
  95. package/assets/esri/core/workers/chunks/080268f78436a2f0d996.js +0 -1
  96. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +0 -1
  97. package/assets/esri/core/workers/chunks/27e6a6c5610007ac6a54.js +0 -1
  98. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +0 -1
  99. package/assets/esri/core/workers/chunks/631fb2e62e48f8be4051.js +0 -1
  100. package/assets/esri/core/workers/chunks/722da7a39a0ad9300752.js +0 -1
  101. package/assets/esri/core/workers/chunks/9595aabbaf411eceea1e.js +0 -1
  102. package/assets/esri/core/workers/chunks/a470f662d73aa8d5d90f.js +0 -1
  103. package/assets/esri/core/workers/chunks/a57751f3d78524c876cd.js +0 -1
  104. package/assets/esri/core/workers/chunks/ac366221e8636b60aee5.js +0 -1
  105. package/assets/esri/core/workers/chunks/dec336700cfb83abbbeb.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import t from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import i from"../core/Error.js";import{clone as s}from"../core/lang.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../core/object.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{join as d}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import f from"../graphic/PointCloudGraphicOrigin.js";import h from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{types as x}from"./pointCloudFilters/typeUtils.js";import{popupEnabled as T,elevationInfo as P,legendEnabled as F}from"./support/commonProperties.js";import L from"./support/Field.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import O from"../popup/ExpressionInfo.js";import{types as _}from"../renderers/support/pointCloud/typeUtils.js";import{logInvalidElevationInfoWarning as N,elevationModeRequiredMessage as E,featureExpressionUnsupportedMessage as R}from"../support/elevationInfoUtils.js";import{createPopupTemplate as A}from"../support/popupUtils.js";const U=C();let V=class extends(S(v(w(I(b(a(j(g(o(h)))))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud",this.graphicOrigin=new f(this)}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const r=this.fieldsIndex.get(e);return r?.domain?r.domain:null}readServiceFields(e,r,t){return Array.isArray(e)?e.map(e=>{const r=new L;return"FieldTypeInteger"===e.type&&((e=s(e)).type="esriFieldTypeInteger"),r.read(e,t),r}):Array.isArray(r.attributeStorageInfo)?r.attributeStorageInfo.map(e=>new L({name:e.name,type:"ELEVATION"===e.name?"double":"integer"})):null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}writeRenderer(e,r,t,o){p("layerDefinition.drawingInfo.renderer",e.write({},o),r)}load(e){const r=null!=e?e.signal:null,t=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(l).then(()=>this._fetchService(r));return this.addResolvingPromise(t),Promise.resolve(this)}createPopupTemplate(e){const r=A(this,e);return r&&(this._formatPopupTemplateReturnsField(r),this._formatPopupTemplateRGBField(r)),r}_formatPopupTemplateReturnsField(e){const r=this.fieldsIndex.get("RETURNS");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new O({name:"pcl-returns-decoded",title:r.alias||r.name,expression:`\n var returnValue = $feature.${r.name};\n return (returnValue % 16) + " / " + Floor(returnValue / 16);\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const r=this.fieldsIndex.get("RGB");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new O({name:"pcl-rgb-decoded",title:r.alias||r.name,expression:`\n var rgb = $feature.${r.name};\n var red = Floor(rgb / 65536, 0);\n var green = Floor((rgb - (red * 65536)) / 256,0);\n var blue = rgb - (red * 65536) - (green * 256);\n\n return "rgb(" + red + "," + green + "," + blue + ")";\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,r){if(await this.load(r),!this.attributeStorageInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const o=this.fieldsIndex.get(e);if(!o)throw new i("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.attributeStorageInfo)if(i.name===o.name){const e=d(this.parsedUrl?.path??"",`./statistics/${i.key}`);return t(e,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r?r.signal:null}).then(e=>e.data)}throw new i("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,r){return this._debouncedSaveOperations(1,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"PointCloud"!==e.layerType)throw new i("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some(r=>r.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(e){N(n.getLogger(this),E("Point cloud layers","absolute-height",e)),N(n.getLogger(this),R("Point cloud layers",e))}};e([u({type:["PointCloudLayer"]})],V.prototype,"operationalLayerType",void 0),e([u(T)],V.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],V.prototype,"defaultPopupTemplate",null),e([u({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],V.prototype,"opacity",void 0),e([u({type:["show","hide"]})],V.prototype,"listMode",void 0),e([u({types:[x],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],V.prototype,"filters",void 0),e([u({type:[L]})],V.prototype,"fields",void 0),e([u(U.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([m("service","fields",["fields","attributeStorageInfo"])],V.prototype,"readServiceFields",null),e([u(U.outFields)],V.prototype,"outFields",void 0),e([u({readOnly:!0})],V.prototype,"attributeStorageInfo",void 0),e([u(P)],V.prototype,"elevationInfo",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],V.prototype,"path",void 0),e([u(F)],V.prototype,"legendEnabled",void 0),e([u({types:_,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:_},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],V.prototype,"renderer",void 0),e([y("renderer")],V.prototype,"writeRenderer",null),e([u({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),e([u({readOnly:!0})],V.prototype,"graphicOrigin",void 0),V=e([c("esri.layers.PointCloudLayer")],V);const K=V;export{K as default};
5
+ import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import t from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import i from"../core/Error.js";import{clone as s}from"../core/lang.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as p}from"../core/object.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{join as d}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import f from"../graphic/PointCloudGraphicOrigin.js";import h from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{SceneService as P,updateExtentFromPageObb as x}from"./mixins/SceneService.js";import{types as S}from"./pointCloudFilters/typeUtils.js";import{popupEnabled as T,elevationInfo as F,legendEnabled as _}from"./support/commonProperties.js";import L from"./support/Field.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import R from"../popup/ExpressionInfo.js";import{types as E}from"../renderers/support/pointCloud/typeUtils.js";import{logInvalidElevationInfoWarning as O,elevationModeRequiredMessage as N,featureExpressionUnsupportedMessage as A}from"../support/elevationInfoUtils.js";import{createPopupTemplate as U}from"../support/popupUtils.js";const K=C();let V=class extends(P(v(j(I(b(a(w(g(o(h)))))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud",this.graphicOrigin=new f(this),this.rootPagePromise=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const r=this.fieldsIndex.get(e);return r?.domain?r.domain:null}readServiceFields(e,r,t){return Array.isArray(e)?e.map(e=>{const r=new L;return"FieldTypeInteger"===e.type&&((e=s(e)).type="esriFieldTypeInteger"),r.read(e,t),r}):Array.isArray(r.attributeStorageInfo)?r.attributeStorageInfo.map(e=>new L({name:e.name,type:"ELEVATION"===e.name?"double":"integer"})):null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}writeRenderer(e,r,t,o){p("layerDefinition.drawingInfo.renderer",e.write({},o),r)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(l),await this._fetchService(e?.signal),await this._fetchRootPageAndUpdateExtent(e?.signal)}async _fetchRootPageAndUpdateExtent(e){this.rootPagePromise=this._fetchRootPage(e);const{fullExtent:r}=this;if(null!=r&&!r.hasZ){const e=await this.rootPagePromise;x(r,e?.nodes?.[0]?.obb)}}async _fetchRootPage(e){const r=`${this.parsedUrl?.path??""}/nodepages/0`;try{return(await t(r,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data}catch(o){throw new i("pointcloudlayer:root-page-missing","Root page missing.",{error:o,url:r})}}createPopupTemplate(e){const r=U(this,e);return r&&(this._formatPopupTemplateReturnsField(r),this._formatPopupTemplateRGBField(r)),r}_formatPopupTemplateReturnsField(e){const r=this.fieldsIndex.get("RETURNS");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new R({name:"pcl-returns-decoded",title:r.alias||r.name,expression:`\n var returnValue = $feature.${r.name};\n return (returnValue % 16) + " / " + Floor(returnValue / 16);\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const r=this.fieldsIndex.get("RGB");if(!r)return;const t=e.fieldInfos?.find(e=>e.fieldName===r.name);if(!t)return;const o=new R({name:"pcl-rgb-decoded",title:r.alias||r.name,expression:`\n var rgb = $feature.${r.name};\n var red = Floor(rgb / 65536, 0);\n var green = Floor((rgb - (red * 65536)) / 256,0);\n var blue = rgb - (red * 65536) - (green * 256);\n\n return "rgb(" + red + "," + green + "," + blue + ")";\n `});e.expressionInfos=[...e.expressionInfos||[],o],t.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,r){if(await this.load(r),!this.attributeStorageInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const o=this.fieldsIndex.get(e);if(!o)throw new i("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.attributeStorageInfo)if(i.name===o.name){const e=d(this.parsedUrl?.path??"",`./statistics/${i.key}`);return t(e,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r?r.signal:null}).then(e=>e.data)}throw new i("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,r){return this._debouncedSaveOperations(1,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"PointCloud"!==e.layerType)throw new i("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some(r=>r.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(e){O(n.getLogger(this),N("Point cloud layers","absolute-height",e)),O(n.getLogger(this),A("Point cloud layers",e))}};e([u({type:["PointCloudLayer"]})],V.prototype,"operationalLayerType",void 0),e([u(T)],V.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([u({readOnly:!0,json:{read:!1}})],V.prototype,"defaultPopupTemplate",null),e([u({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],V.prototype,"opacity",void 0),e([u({type:["show","hide"]})],V.prototype,"listMode",void 0),e([u({types:[S],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],V.prototype,"filters",void 0),e([u({type:[L]})],V.prototype,"fields",void 0),e([u(K.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([m("service","fields",["fields","attributeStorageInfo"])],V.prototype,"readServiceFields",null),e([u(K.outFields)],V.prototype,"outFields",void 0),e([u({readOnly:!0})],V.prototype,"attributeStorageInfo",void 0),e([u(F)],V.prototype,"elevationInfo",null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],V.prototype,"path",void 0),e([u(_)],V.prototype,"legendEnabled",void 0),e([u({types:E,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:E},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],V.prototype,"renderer",void 0),e([y("renderer")],V.prototype,"writeRenderer",null),e([u({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),e([u({readOnly:!0})],V.prototype,"graphicOrigin",void 0),V=e([c("esri.layers.PointCloudLayer")],V);const $=V;export{$ as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import{deprecated as o}from"../core/deprecate.js";import a from"../core/Error.js";import{abortHandle as n}from"../core/handleUtils.js";import l from"../core/Logger.js";import{destroyMaybe as p}from"../core/maybe.js";import{MultiOriginJSONMixin as d}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y,throwIfAborted as u,isAbortError as c,throwIfNotAbortError as h}from"../core/promiseUtils.js";import{whenOnce as f}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import{reader as v}from"../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../core/accessorSupport/decorators/subclass.js";import w from"../geometry/Point.js";import{projectWithZConversion as L}from"../geometry/projectionUtils.js";import I from"../graphic/SceneGraphicOrigin.js";import j from"./Layer.js";import{NoModelError as F,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as O}from"./mixins/APIKeyMixin.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{CustomParametersMixin as P}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as T}from"./mixins/EditBusLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{SceneService as D}from"./mixins/SceneService.js";import{useViewTimeProperty as U}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as R}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as q}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as C}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as G}from"./support/capabilities.js";import{elevationInfo as N,labelsVisible as Q,legendEnabled as V,popupEnabled as M,attributeTableTemplate as k,screenSizePerspectiveEnabled as K}from"./support/commonProperties.js";import{getFieldDomain as $,computeEffectiveEditingEnabled as H,getGlobalIdToObjectIdMap as z}from"./support/featureLayerUtils.js";import{FeatureReduction as W}from"./support/FeatureReduction.js";import Z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import J from"./support/FieldsIndex.js";import{fixRendererFields as X,unpackFieldNames as Y}from"./support/fieldUtils.js";import{I3SNodePageDefinition as ee,I3SMaterialDefinition as te,I3STextureSetDefinition as re,I3SGeometryDefinition as ie}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as se,isFileSupported as oe}from"./support/infoFor3D.js";import ae from"./support/LabelClass.js";import{reader as ne}from"./support/labelingInfo.js";import le from"./support/LayerFloorInfo.js";import{layerLookupMap as pe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as de}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ye}from"./support/RangeInfo.js";import ue from"./support/SceneFilter.js";import{cacheIsOutOfSync as ce}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as he}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as fe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as me}from"../renderers/support/typeUtils.js";import ge from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ve,elevationModeUnsupportedMessage as be,featureExpressionUnsupportedMessage as we}from"../support/elevationInfoUtils.js";import{createPopupTemplate as Le}from"../support/popupUtils.js";import{extractZipFiles as Ie}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as je}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Fe,getFetchPopupTemplate as Se}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Oe}from"../webdoc/support/opacityUtils.js";const _e=new Set(["3DObject","Point"]),Pe=B();let Te=class extends(R(T(D(_(A(x(E(d(P(O(i(j)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new I(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=p(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?$(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new J(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:ee.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&H(this.associatedLayer)}get geometryType(){return xe[this.profile]||"mesh"}set renderer(e){X(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:G;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Ae[r]?Ae[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await fe(this,{origin:"service"},t),X(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ge;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Y(this.fieldsIndex,await Fe(this,Se(this)));return je(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return Le(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return q(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await z(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={},null!=t.location&&o(l.getLogger(this),"The 'location' option of convertMesh() has been deprecated in favour of 'origin'.",{version:"4.34",replacement:"origin",warnOnce:!0});const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(t),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);u(t);const s=i.reduce((e,t)=>se(this.infoFor3D,t)?e+1:e,0);0===s&&r(new F),s>1&&r(new S);const n=this.spatialReference,p=t.origin??t.location,d=await L(p??t.defaultOrigin??new w({x:0,y:0,z:0,spatialReference:n}),n,t),y=d.spatialReference.isGeographic?"local":"georeferenced",{default:c}=await import("../geometry/Mesh.js");u(t);const h=c.createWithExternalSource(d,{type:"client",files:i},{vertexSpace:y,transform:de(d.spatialReference),unitConversionDisabled:!0}),[f]=await this.uploadAssets([h],{...t,useAssetOrigin:!p});return f}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await Ie(e)).filter(e=>oe(t,e))}validateLayer(e){if(e.layerType&&!_e.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=g(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!q(this.associatedLayer?.url)||!ce(this))return;g(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await C(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await pe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){c(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(n(e));try{await f(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void h(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&ve(l.getLogger(this),be("Mesh scene layers","relative-to-scene",e)),ve(l.getLogger(this),we("Scene layers",e))}async fetchStatistics(e,t){return await he({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([m({types:{key:"type",base:W,typeMap:{selection:Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Te.prototype,"featureReduction",void 0),e([m({type:[ye],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Te.prototype,"rangeInfos",void 0),e([m({json:{read:!1}})],Te.prototype,"associatedLayer",void 0),e([m({type:["show","hide"]})],Te.prototype,"listMode",void 0),e([m({type:["ArcGISSceneServiceLayer"]})],Te.prototype,"operationalLayerType",void 0),e([m({json:{read:!1},readOnly:!0})],Te.prototype,"type",void 0),e([m({...Pe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"fields",void 0),e([m()],Te.prototype,"types",null),e([m()],Te.prototype,"typeIdField",null),e([m()],Te.prototype,"templates",null),e([m()],Te.prototype,"formTemplate",null),e([m({readOnly:!0})],Te.prototype,"graphicOrigin",void 0),e([m({readOnly:!0,clonable:!1})],Te.prototype,"fieldsIndex",null),e([m({type:le,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Te.prototype,"floorInfo",void 0),e([m(Pe.outFields)],Te.prototype,"outFields",void 0),e([m({type:ee,readOnly:!0,json:{read:!1},clonable:!1})],Te.prototype,"nodePages",void 0),e([v("service","nodePages",["nodePages","pointNodePages"])],Te.prototype,"readNodePages",null),e([m({type:[te],readOnly:!0,clonable:!1})],Te.prototype,"materialDefinitions",void 0),e([m({type:[re],readOnly:!0,clonable:!1})],Te.prototype,"textureSetDefinitions",void 0),e([m({type:[ie],readOnly:!0,clonable:!1})],Te.prototype,"geometryDefinitions",void 0),e([m({readOnly:!0})],Te.prototype,"serviceUpdateTimeStamp",void 0),e([m({readOnly:!0})],Te.prototype,"attributeStorageInfo",void 0),e([m({readOnly:!0})],Te.prototype,"statisticsInfo",void 0),e([m({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Te.prototype,"excludeObjectIds",void 0),e([m({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Te.prototype,"definitionExpression",void 0),e([m({type:ue,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Te.prototype,"filter",void 0),e([m({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Te.prototype,"path",void 0),e([m(N)],Te.prototype,"elevationInfo",null),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"effectiveCapabilities",null),e([m({readOnly:!0})],Te.prototype,"effectiveEditingEnabled",null),e([m({type:String})],Te.prototype,"geometryType",null),e([m(Q)],Te.prototype,"labelsVisible",void 0),e([m({type:[ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ne},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ne},write:!0}})],Te.prototype,"labelingInfo",void 0),e([m(V)],Te.prototype,"legendEnabled",void 0),e([m({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Oe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Te.prototype,"opacity",void 0),e([m({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"priority",void 0),e([m({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"semantic",void 0),e([m({types:me,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Te.prototype,"renderer",null),e([m({json:{read:!1}})],Te.prototype,"cachedDrawingInfo",void 0),e([v("service","cachedDrawingInfo")],Te.prototype,"readCachedDrawingInfo",null),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"capabilities",null),e([m({type:Boolean,json:{read:!1}})],Te.prototype,"editingEnabled",null),e([m({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"infoFor3D",null),e([m({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"relationships",null),e([m(M)],Te.prototype,"popupEnabled",void 0),e([m({type:r,json:{name:"popupInfo",write:!0}})],Te.prototype,"popupTemplate",void 0),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"defaultPopupTemplate",null),e([m(k)],Te.prototype,"attributeTableTemplate",void 0),e([m({type:String,json:{read:!1}})],Te.prototype,"objectIdField",void 0),e([v("service","objectIdField",["objectIdField","fields"])],Te.prototype,"readObjectIdField",null),e([m({type:String,json:{read:!1}})],Te.prototype,"globalIdField",void 0),e([v("service","globalIdField",["globalIdField","fields"])],Te.prototype,"readGlobalIdField",null),e([m({readOnly:!0,type:String,json:{read:!1}})],Te.prototype,"displayField",null),e([m({type:String,json:{read:!1}})],Te.prototype,"profile",void 0),e([v("service","profile",["store.profile"])],Te.prototype,"readProfile",null),e([m({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Te.prototype,"normalReferenceFrame",void 0),e([m(K)],Te.prototype,"screenSizePerspectiveEnabled",void 0),e([m({json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"serviceItemId",void 0),e([m(U)],Te.prototype,"useViewTime",null),Te=e([b("esri.layers.SceneLayer")],Te);const Ae={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},xe={"mesh-pyramids":"mesh",points:"point"},Ee=Te;export{Ee as default};
5
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import{deprecated as o}from"../core/deprecate.js";import a from"../core/Error.js";import{abortHandle as n}from"../core/handleUtils.js";import l from"../core/Logger.js";import{destroyMaybe as p}from"../core/maybe.js";import{MultiOriginJSONMixin as d}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y,throwIfAborted as c,isAbortError as u,throwIfNotAbortError as h}from"../core/promiseUtils.js";import{whenOnce as f}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as g}from"../core/accessorSupport/utils.js";import{reader as v}from"../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../core/accessorSupport/decorators/subclass.js";import w from"../geometry/Point.js";import{projectWithZConversion as L}from"../geometry/projectionUtils.js";import I from"../graphic/SceneGraphicOrigin.js";import j from"./Layer.js";import{NoModelError as F,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as O}from"./mixins/APIKeyMixin.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{CustomParametersMixin as P}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as T}from"./mixins/EditBusLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as E}from"./mixins/ScaleRangeLayer.js";import{SceneService as D}from"./mixins/SceneService.js";import{useViewTimeProperty as U}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as R}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as q}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as C}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as G}from"./support/capabilities.js";import{elevationInfo as N,labelsVisible as Q,legendEnabled as V,popupEnabled as M,attributeTableTemplate as k,screenSizePerspectiveEnabled as K}from"./support/commonProperties.js";import{getFieldDomain as $,computeEffectiveEditingEnabled as H,getGlobalIdToObjectIdMap as z}from"./support/featureLayerUtils.js";import{FeatureReduction as W}from"./support/FeatureReduction.js";import Z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import J from"./support/FieldsIndex.js";import{fixRendererFields as X,unpackFieldNames as Y}from"./support/fieldUtils.js";import{I3SNodePageDefinition as ee,I3SMaterialDefinition as te,I3STextureSetDefinition as re,I3SGeometryDefinition as ie}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as se,isFileSupported as oe}from"./support/infoFor3D.js";import ae from"./support/LabelClass.js";import{reader as ne}from"./support/labelingInfo.js";import le from"./support/LayerFloorInfo.js";import{layerLookupMap as pe}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as de}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as ye}from"./support/RangeInfo.js";import ce from"./support/SceneFilter.js";import{cacheIsOutOfSync as ue}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as he}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as fe}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as me}from"../renderers/support/typeUtils.js";import ge from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ve,elevationModeUnsupportedMessage as be,featureExpressionUnsupportedMessage as we}from"../support/elevationInfoUtils.js";import{createPopupTemplate as Le}from"../support/popupUtils.js";import{extractZipFiles as Ie}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as je}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Fe,getFetchPopupTemplate as Se}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Oe}from"../webdoc/support/opacityUtils.js";const _e=new Set(["3DObject","Point"]),Pe=B();let Te=class extends(R(T(D(_(A(x(E(d(P(O(i(j)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new I(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=p(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?$(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new J(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:ee.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&H(this.associatedLayer)}get geometryType(){return xe[this.profile]||"mesh"}set renderer(e){X(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:G;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:c,supportsAdd:u,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:c&&b,supportsAdd:w&&u&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Ae[r]?Ae[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e?.signal;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await fe(this,{origin:"service"},t),X(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ge;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=Y(this.fieldsIndex,await Fe(this,Se(this)));return je(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return Le(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return q(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await z(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={},null!=t.location&&o(l.getLogger(this),"The 'location' option of convertMesh() has been deprecated in favour of 'origin'.",{version:"4.34",replacement:"origin",warnOnce:!0});const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(t),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e);c(t);const s=i.reduce((e,t)=>se(this.infoFor3D,t)?e+1:e,0);0===s&&r(new F),s>1&&r(new S);const n=this.spatialReference,p=t.origin??t.location,d=await L(p??t.defaultOrigin??new w({x:0,y:0,z:0,spatialReference:n}),n,t),y=d.spatialReference.isGeographic?"local":"georeferenced",{default:u}=await import("../geometry/Mesh.js");c(t);const h=u.createWithExternalSource(d,{type:"client",files:i},{vertexSpace:y,transform:de(d.spatialReference),unitConversionDisabled:!0}),[f]=await this.uploadAssets([h],{...t,useAssetOrigin:!p});return f}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await Ie(e)).filter(e=>oe(t,e))}validateLayer(e){if(e.layerType&&!_e.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=g(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!q(this.associatedLayer?.url)||!ue(this))return;g(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await C(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await pe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(n(e));try{await f(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void h(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&ve(l.getLogger(this),be("Mesh scene layers","relative-to-scene",e)),ve(l.getLogger(this),we("Scene layers",e))}async fetchStatistics(e,t){return await he({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([m({types:{key:"type",base:W,typeMap:{selection:Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Te.prototype,"featureReduction",void 0),e([m({type:[ye],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Te.prototype,"rangeInfos",void 0),e([m({json:{read:!1}})],Te.prototype,"associatedLayer",void 0),e([m({type:["show","hide"]})],Te.prototype,"listMode",void 0),e([m({type:["ArcGISSceneServiceLayer"]})],Te.prototype,"operationalLayerType",void 0),e([m({json:{read:!1},readOnly:!0})],Te.prototype,"type",void 0),e([m({...Pe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"fields",void 0),e([m()],Te.prototype,"types",null),e([m()],Te.prototype,"typeIdField",null),e([m()],Te.prototype,"templates",null),e([m()],Te.prototype,"formTemplate",null),e([m({readOnly:!0})],Te.prototype,"graphicOrigin",void 0),e([m({readOnly:!0,clonable:!1})],Te.prototype,"fieldsIndex",null),e([m({type:le,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Te.prototype,"floorInfo",void 0),e([m(Pe.outFields)],Te.prototype,"outFields",void 0),e([m({type:ee,readOnly:!0,json:{read:!1},clonable:!1})],Te.prototype,"nodePages",void 0),e([v("service","nodePages",["nodePages","pointNodePages"])],Te.prototype,"readNodePages",null),e([m({type:[te],readOnly:!0,clonable:!1})],Te.prototype,"materialDefinitions",void 0),e([m({type:[re],readOnly:!0,clonable:!1})],Te.prototype,"textureSetDefinitions",void 0),e([m({type:[ie],readOnly:!0,clonable:!1})],Te.prototype,"geometryDefinitions",void 0),e([m({readOnly:!0})],Te.prototype,"serviceUpdateTimeStamp",void 0),e([m({readOnly:!0})],Te.prototype,"attributeStorageInfo",void 0),e([m({readOnly:!0})],Te.prototype,"statisticsInfo",void 0),e([m({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Te.prototype,"excludeObjectIds",void 0),e([m({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Te.prototype,"definitionExpression",void 0),e([m({type:ce,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Te.prototype,"filter",void 0),e([m({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Te.prototype,"path",void 0),e([m(N)],Te.prototype,"elevationInfo",null),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"effectiveCapabilities",null),e([m({readOnly:!0})],Te.prototype,"effectiveEditingEnabled",null),e([m({type:String})],Te.prototype,"geometryType",null),e([m(Q)],Te.prototype,"labelsVisible",void 0),e([m({type:[ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ne},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ne},write:!0}})],Te.prototype,"labelingInfo",void 0),e([m(V)],Te.prototype,"legendEnabled",void 0),e([m({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Oe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Te.prototype,"opacity",void 0),e([m({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"priority",void 0),e([m({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"semantic",void 0),e([m({types:me,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Te.prototype,"renderer",null),e([m({json:{read:!1}})],Te.prototype,"cachedDrawingInfo",void 0),e([v("service","cachedDrawingInfo")],Te.prototype,"readCachedDrawingInfo",null),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"capabilities",null),e([m({type:Boolean,json:{read:!1}})],Te.prototype,"editingEnabled",null),e([m({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"infoFor3D",null),e([m({readOnly:!0,json:{write:!1,read:!1}})],Te.prototype,"relationships",null),e([m(M)],Te.prototype,"popupEnabled",void 0),e([m({type:r,json:{name:"popupInfo",write:!0}})],Te.prototype,"popupTemplate",void 0),e([m({readOnly:!0,json:{read:!1}})],Te.prototype,"defaultPopupTemplate",null),e([m(k)],Te.prototype,"attributeTableTemplate",void 0),e([m({type:String,json:{read:!1}})],Te.prototype,"objectIdField",void 0),e([v("service","objectIdField",["objectIdField","fields"])],Te.prototype,"readObjectIdField",null),e([m({type:String,json:{read:!1}})],Te.prototype,"globalIdField",void 0),e([v("service","globalIdField",["globalIdField","fields"])],Te.prototype,"readGlobalIdField",null),e([m({readOnly:!0,type:String,json:{read:!1}})],Te.prototype,"displayField",null),e([m({type:String,json:{read:!1}})],Te.prototype,"profile",void 0),e([v("service","profile",["store.profile"])],Te.prototype,"readProfile",null),e([m({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Te.prototype,"normalReferenceFrame",void 0),e([m(K)],Te.prototype,"screenSizePerspectiveEnabled",void 0),e([m({json:{read:!1,origins:{service:{read:!0}}}})],Te.prototype,"serviceItemId",void 0),e([m(U)],Te.prototype,"useViewTime",null),Te=e([b("esri.layers.SceneLayer")],Te);const Ae={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},xe={"mesh-pyramids":"mesh",points:"point"},Ee=Te;export{Ee as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as p,initial as y,whenOnce as m}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{Integer as d}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import f from"../geometry/Extent.js";import v from"../geometry/Polyline.js";import g from"../geometry/SpatialReference.js";import S from"./Layer.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as O,effectProperty as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as T}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{opacity as x,id as U}from"./support/commonProperties.js";import{normalizeParsedUrlObject as P,urlProperty as E}from"./support/multiLayerServiceUtils.js";import N from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as M}from"./support/serviceCapabilitiesUtils.js";import k from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import F from"./support/VideoFrame.js";import G from"./support/VideoTimeExtent.js";import H from"./video/VideoController.js";import{getFrameHorizonPoints as J,getGroundControlPoints as R,getTelemetryData as z,getServiceLayersInfo as A,getStyledTelemetrySymbol as q,getSensorTrailPoints as D,readVideoTimeExtent as B}from"./video/videoUtils.js";import W from"../symbols/CIMSymbol.js";import _ from"../symbols/PictureMarkerSymbol.js";import Q from"../symbols/SimpleFillSymbol.js";import $ from"../symbols/SimpleLineSymbol.js";import Z from"../symbols/SimpleMarkerSymbol.js";import K from"../symbols/Symbol.js";import{write as X}from"../symbols/support/jsonUtils.js";function Y(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}let ee=[];const te=new t([255,127,0]),re=new t([0,0,0,.05]),oe=new Z({angle:0,color:te,size:10,style:"cross"}),ie=new Q({color:re,outline:new $({color:te,width:2})}),se=new $({color:te,width:1}),le=new Z({angle:0,color:te,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),ne=new $({color:te,width:1}),ae={types:{base:K,key:"type",typeMap:{"simple-marker":Z,"picture-marker":_,cim:W}},json:{name:"drawingInfo.sensorSymbol",write:{writer:X,overridePolicy:Y}}};function pe(e,t){return{type:t,json:{name:e,write:{overridePolicy:Y}}}}let ye=class extends(O(L(b(w(I(n(T(S)))))))){constructor(e){super(e),this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new H,this.copyright=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=oe.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=ie.clone(),this.fullExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:"platformHeading",symbolOffset:0},this.sensorSymbol=le.clone(),this.sensorSightLineSymbol=se.clone(),this.sensorTrailSymbol=ne.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=g.WGS84,this.start=0,this.telemetryDisplay=new V,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([p(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),p(()=>this.telemetry?.sensorLocation,e=>this._setSensorTrail(e),y)]),m(()=>this.loaded&&"can-play"===this.state&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!1},e).catch(a).then(()=>this._fetchService(t));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return M(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return J(this.metadata)}get groundControlPoints(){return R(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return P(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return A(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){ee=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e){this.frameCenterSymbol=q(this.frameCenterSymbol,e)??oe,this.frameOutlineSymbol=q(this.frameOutlineSymbol,e,re)??ie,this.sensorSightLineSymbol=q(this.sensorSightLineSymbol,e)??se,this.sensorTrailSymbol=q(this.sensorTrailSymbol,e)??ne,this.sensorSymbol=q(this.sensorSymbol,e)??le}write(e,t){return null==this.layerId?(t?.messages?.push(new i("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' cannot be saved to a web map, web scene, or portal item. The ArcGIS server version must be greater than 11.2.`)),null):super.write(e,t)}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=D(e,ee);ee=[...t];const r=ee.map(e=>e.toArray()),o=new v({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"autoplay",null),e([u({readOnly:!0})],ye.prototype,"buffered",null),e([u({readOnly:!0})],ye.prototype,"cameraInfo",void 0),e([u({readOnly:!0,json:{read:!1}})],ye.prototype,"capabilities",void 0),e([c("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ye.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],ye.prototype,"codecs",void 0),e([u({readOnly:!0})],ye.prototype,"connectionInfo",void 0),e([c("connectionInfo",["connectionUrl"])],ye.prototype,"readConnectionInfo",null),e([u()],ye.prototype,"controller",void 0),e([u({type:String})],ye.prototype,"copyright",void 0),e([u({readOnly:!0,type:Date})],ye.prototype,"created",void 0),e([u({type:Number})],ye.prototype,"currentTime",null),e([u({json:{write:!1}})],ye.prototype,"customParameters",void 0),e([u({type:String})],ye.prototype,"description",void 0),e([u({type:Number})],ye.prototype,"duration",null),e([u({readOnly:!0})],ye.prototype,"elevationSource",void 0),e([u({type:Boolean})],ye.prototype,"ended",null),e([u({type:F})],ye.prototype,"frame",void 0),e([u(pe("drawingInfo.frameCenterSymbol",Z))],ye.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:d})],ye.prototype,"frameCount",void 0),e([u(j)],ye.prototype,"frameEffect",void 0),e([u(x)],ye.prototype,"frameOpacity",void 0),e([u(pe("drawingInfo.frameOutlineSymbol",Q))],ye.prototype,"frameOutlineSymbol",void 0),e([u({type:f})],ye.prototype,"fullExtent",void 0),e([u({readOnly:!0})],ye.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:B,source:"time"}},type:G})],ye.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],ye.prototype,"groundControlPoints",null),e([u(U)],ye.prototype,"id",void 0),e([u({type:f})],ye.prototype,"initialExtent",void 0),e([u({readOnly:!0})],ye.prototype,"isLive",null),e([u({type:d,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ye.prototype,"layerId",void 0),e([u({readOnly:!0})],ye.prototype,"livestreamStatus",null),e([u({type:Boolean})],ye.prototype,"loop",null),e([u({readOnly:!0})],ye.prototype,"metadata",null),e([u({readOnly:!0})],ye.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],ye.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],ye.prototype,"parsedUrl",null),e([u({type:N})],ye.prototype,"playbackInfo",void 0),e([u({type:Number})],ye.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],ye.prototype,"playerUrl",null),e([u({readOnly:!0})],ye.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],ye.prototype,"posterUrl",void 0),e([u({readOnly:!0})],ye.prototype,"qualities",void 0),e([u()],ye.prototype,"sensorSymbolOrientation",void 0),e([u(ae)],ye.prototype,"sensorSymbol",void 0),e([u(pe("drawingInfo.sensorSightLineSymbol",$))],ye.prototype,"sensorSightLineSymbol",void 0),e([u(pe("drawingInfo.sensorTrailSymbol",$))],ye.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],ye.prototype,"serviceItemId",void 0),e([u()],ye.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],ye.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],ye.prototype,"sourceType",void 0),e([u()],ye.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],ye.prototype,"start",void 0),e([u({readOnly:!0})],ye.prototype,"started",null),e([u({readOnly:!0,type:String})],ye.prototype,"state",null),e([u({readOnly:!0,type:k})],ye.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"telemetryDisplay",void 0),e([c("service","title",["name"])],ye.prototype,"readTitleFromService",null),e([u({readOnly:!0})],ye.prototype,"type",void 0),e([u(E())],ye.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ye.prototype,"version",void 0),e([u({readOnly:!0})],ye.prototype,"videoElement",null),e([u({readOnly:!0})],ye.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],ye.prototype,"videoLayersInfo",void 0),e([c("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ye.prototype,"readLayerInfosFromService",null),e([u({type:G,readOnly:!0})],ye.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],ye.prototype,"videoWidth",null),e([u()],ye.prototype,"volume",null),e([u({readOnly:!0})],ye.prototype,"waiting",null),ye=e([h("esri.layers.VideoLayer")],ye);const me=ye;export{me as default};
5
+ import{__decorate as e}from"tslib";import t from"../Color.js";import r from"../request.js";import{deprecatedProperty as o}from"../core/deprecate.js";import i from"../core/Error.js";import s from"../core/Logger.js";import{clamp as l}from"../core/mathUtils.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{watch as p,initial as y,whenOnce as m}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{Integer as d}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import f from"../geometry/Extent.js";import v from"../geometry/Polyline.js";import g from"../geometry/SpatialReference.js";import S from"./Layer.js";import{ArcGISService as b}from"./mixins/ArcGISService.js";import{BlendLayer as O,effectProperty as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as T}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{opacity as x,id as U}from"./support/commonProperties.js";import{normalizeParsedUrlObject as P,urlProperty as E}from"./support/multiLayerServiceUtils.js";import N from"./support/PlaybackInfo.js";import{getVideoLayerCapabilities as M}from"./support/serviceCapabilitiesUtils.js";import k from"./support/TelemetryData.js";import V from"./support/TelemetryDisplay.js";import F from"./support/VideoFrame.js";import G from"./support/VideoTimeExtent.js";import H from"./video/VideoController.js";import{getFrameHorizonPoints as J,getGroundControlPoints as R,getTelemetryData as z,getServiceLayersInfo as A,getStyledTelemetrySymbol as q,getSensorTrailPoints as D,readVideoTimeExtent as B}from"./video/videoUtils.js";import W from"../symbols/CIMSymbol.js";import _ from"../symbols/PictureMarkerSymbol.js";import Q from"../symbols/SimpleFillSymbol.js";import $ from"../symbols/SimpleLineSymbol.js";import Z from"../symbols/SimpleMarkerSymbol.js";import K from"../symbols/Symbol.js";import{write as X}from"../symbols/support/jsonUtils.js";function Y(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}let ee=[];const te=new t([255,127,0]),re=new t([0,0,0,.05]),oe=new Z({angle:0,color:te,size:10,style:"cross"}),ie=new Q({color:re,outline:new $({color:te,width:2})}),se=new $({color:te,width:1}),le=new Z({angle:0,color:te,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),ne=new $({color:te,width:1}),ae={types:{base:K,key:"type",typeMap:{"simple-marker":Z,"picture-marker":_,cim:W}},json:{name:"drawingInfo.sensorSymbol",write:{writer:X,overridePolicy:Y}}};function pe(e,t){return{type:t,json:{name:e,write:{overridePolicy:Y}}}}let ye=class extends(O(L(b(w(I(n(T(S)))))))){constructor(e){super(e),this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new H,this.copyright=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=oe.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=ie.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:"platformHeading",symbolOffset:0},this.sensorSymbol=le.clone(),this.sensorSightLineSymbol=se.clone(),this.sensorTrailSymbol=ne.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=g.WGS84,this.start=0,this.telemetryDisplay=new V,this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([p(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),p(()=>this.telemetry?.sensorLocation,e=>this._setSensorTrail(e),y)]),m(()=>this.loaded&&"can-play"===this.state&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!1},e).catch(a).then(()=>this._fetchService(t));return this.addResolvingPromise(r),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return M(t)}readConnectionInfo(e,t){const r=Object.values(t.connectionUrl);return r?.length&&(this.controller.playerUrl=r[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return J(this.metadata)}get groundControlPoints(){return R(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return P(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return z(this.metadata)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return A(t)}get videoTimeExtent(){return o(s.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){ee=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;const t=l(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;const t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e){this.frameCenterSymbol=q(this.frameCenterSymbol,e)??oe,this.frameOutlineSymbol=q(this.frameOutlineSymbol,e,re)??ie,this.sensorSightLineSymbol=q(this.sensorSightLineSymbol,e)??se,this.sensorTrailSymbol=q(this.sensorTrailSymbol,e)??ne,this.sensorSymbol=q(this.sensorSymbol,e)??le}write(e,t){return null==this.layerId?(t?.messages?.push(new i("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' cannot be saved to a web map, web scene, or portal item. The ArcGIS server version must be greater than 11.2.`)),null):super.write(e,t)}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:o}=await r(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(o&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new i("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");const{data:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...s},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;const t=D(e,ee);ee=[...t];const r=ee.map(e=>e.toArray()),o=new v({hasZ:e.hasZ,paths:[r]});this.telemetry.sensorTrail=o.clone()}};e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"autoplay",null),e([u({readOnly:!0})],ye.prototype,"buffered",null),e([u({readOnly:!0})],ye.prototype,"cameraInfo",void 0),e([u({readOnly:!0,json:{read:!1}})],ye.prototype,"capabilities",void 0),e([c("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ye.prototype,"readCapabilitiesFromService",null),e([u({readOnly:!0})],ye.prototype,"codecs",void 0),e([u({readOnly:!0})],ye.prototype,"connectionInfo",void 0),e([c("connectionInfo",["connectionUrl"])],ye.prototype,"readConnectionInfo",null),e([u()],ye.prototype,"controller",void 0),e([u({type:String})],ye.prototype,"copyright",void 0),e([u({readOnly:!0,type:Date})],ye.prototype,"created",void 0),e([u({type:Number})],ye.prototype,"currentTime",null),e([u({json:{write:!1}})],ye.prototype,"customParameters",void 0),e([u({type:String})],ye.prototype,"description",void 0),e([u({type:Number})],ye.prototype,"duration",null),e([u({readOnly:!0})],ye.prototype,"elevationSource",void 0),e([u({type:Boolean})],ye.prototype,"ended",null),e([u({type:F})],ye.prototype,"frame",void 0),e([u(pe("drawingInfo.frameCenterSymbol",Z))],ye.prototype,"frameCenterSymbol",void 0),e([u({readOnly:!0,type:d})],ye.prototype,"frameCount",void 0),e([u(j)],ye.prototype,"frameEffect",void 0),e([u(x)],ye.prototype,"frameOpacity",void 0),e([u(pe("drawingInfo.frameOutlineSymbol",Q))],ye.prototype,"frameOutlineSymbol",void 0),e([u({type:f})],ye.prototype,"fullExtent",void 0),e([u({readOnly:!0})],ye.prototype,"frameHorizonPoints",null),e([u({readOnly:!0,json:{read:{reader:B,source:"time"}},type:G})],ye.prototype,"fullTimeExtent",void 0),e([u({readOnly:!0})],ye.prototype,"groundControlPoints",null),e([u(U)],ye.prototype,"id",void 0),e([u({type:f})],ye.prototype,"initialExtent",void 0),e([u({readOnly:!0})],ye.prototype,"isLive",null),e([u({type:d,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ye.prototype,"layerId",void 0),e([u({readOnly:!0})],ye.prototype,"livestreamStatus",null),e([u({type:Boolean})],ye.prototype,"loop",null),e([u({readOnly:!0})],ye.prototype,"metadata",null),e([u({readOnly:!0})],ye.prototype,"mimeType",null),e([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"muted",null),e([u({type:["ArcGISVideoLayer"]})],ye.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],ye.prototype,"parsedUrl",null),e([u({type:N})],ye.prototype,"playbackInfo",void 0),e([u({type:Number})],ye.prototype,"playbackRate",null),e([u({readOnly:!0,type:String})],ye.prototype,"playerUrl",null),e([u({readOnly:!0})],ye.prototype,"playing",null),e([u({readOnly:!0,json:{read:{source:"poster"}}})],ye.prototype,"posterUrl",void 0),e([u({readOnly:!0})],ye.prototype,"qualities",void 0),e([u()],ye.prototype,"sensorSymbolOrientation",void 0),e([u(ae)],ye.prototype,"sensorSymbol",void 0),e([u(pe("drawingInfo.sensorSightLineSymbol",$))],ye.prototype,"sensorSightLineSymbol",void 0),e([u(pe("drawingInfo.sensorTrailSymbol",$))],ye.prototype,"sensorTrailSymbol",void 0),e([u({readOnly:!0})],ye.prototype,"serviceItemId",void 0),e([u()],ye.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],ye.prototype,"sourceQuality",void 0),e([u({readOnly:!0,json:{name:"serviceType"}})],ye.prototype,"sourceType",void 0),e([u()],ye.prototype,"spatialReference",void 0),e([u({json:{write:!0}})],ye.prototype,"start",void 0),e([u({readOnly:!0})],ye.prototype,"started",null),e([u({readOnly:!0,type:String})],ye.prototype,"state",null),e([u({readOnly:!0,type:k})],ye.prototype,"telemetry",null),e([u({type:V,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ye.prototype,"telemetryDisplay",void 0),e([c("service","title",["name"])],ye.prototype,"readTitleFromService",null),e([u({readOnly:!0})],ye.prototype,"type",void 0),e([u(E())],ye.prototype,"url",void 0),e([u({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ye.prototype,"version",void 0),e([u({readOnly:!0})],ye.prototype,"videoElement",null),e([u({readOnly:!0})],ye.prototype,"videoHeight",null),e([u({readOnly:!0,json:{read:!1}})],ye.prototype,"videoLayersInfo",void 0),e([c("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ye.prototype,"readLayerInfosFromService",null),e([u({type:G,readOnly:!0})],ye.prototype,"videoTimeExtent",null),e([u({readOnly:!0})],ye.prototype,"videoWidth",null),e([u()],ye.prototype,"volume",null),e([u({readOnly:!0})],ye.prototype,"waiting",null),ye=e([h("esri.layers.VideoLayer")],ye);const me=ye;export{me as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as s}from"../../../core/Loadable.js";import{escapeRegExpString as r}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/SpatialReference.js";import{typeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{queryFeatureSetJSON as u,crsDefault as n,getSpatialReferenceWkid as c,getServerLandingPage as l,getServerConformance as d,getServerCollections as m,getServerOpenApi as y,getCollectionDefinition as f,crsPrefix as g}from"../../ogc/ogcFeatureUtils.js";import{zeroQueryBins as h}from"../../support/capabilities.js";import S from"../../../rest/support/FeatureSet.js";let C=class extends s{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:r},layer:{apiKey:o,customParameters:p,effectiveMaxRecordCount:i}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:i,queryParameters:{apiKey:o,customParameters:p},spatialReference:s,supportedCrs:r}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(e=>S.fromJSON(e))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>u(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){const{isWebMercator:t,isWGS84:s,latestWkid:r,wkid:o}=e,{supportedCrs:p}=this.featureDefinition;return s||t||!!o&&!!p[o]||!!r&&!!p[r]}_conformsToType(e,t){const s=new RegExp(`^${r(t)}$`,"i");return e.conformsTo.some(e=>s.test(e))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:h,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??n,s=c(t);return null==s?i.WGS84:new i({wkid:s})}_getSupportedSpatialReferences(e,t){const s="#/crs",r=e.crs??[n],o=r.includes(s)?r.filter(e=>e!==s).concat(t.crs??[]):r,p=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return o.filter(e=>!p.test(e))}async _loadOGCServices(e,s){const o=null!=s?s.signal:null,{apiKey:p,collectionId:i,customParameters:u,fields:n,geometryType:h,hasZ:S,objectIdField:C,timeInfo:R,url:v}=e,w={fields:n?.map(e=>e.toJSON()),geometryType:a.toJSON(h),hasZ:S??!1,objectIdField:C,timeInfo:R?.toJSON()},x={apiKey:p,customParameters:u,signal:o},O=await l(v,x),[j,D]=await Promise.all([d(O,x),m(O,x)]);if(!this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new t("ogc-feature-layer:no-geojson-support","Server does not support geojson");const F=D.collections.find(({id:e})=>e===i);if(!F)throw new t("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const T=this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await y(O,x):null,A=await f(F,w,x),Q=this._getMaxRecordCount(T),P=this._getCapabilities(A.hasZ,Q),b=this._getStorageSpatialReference(F).toJSON(),q=this._getSupportedSpatialReferences(F,D),G=new RegExp(`^${r(g)}`,"i"),_={};for(const t of q){const e=c(t);null!=e&&(_[e]||(_[e]=t.replace(G,"")))}this.featureDefinition={capabilities:P,collection:F,layerDefinition:A,spatialReference:b,supportedCrs:_}}};e([o()],C.prototype,"featureDefinition",void 0),e([o({constructOnly:!0})],C.prototype,"layer",void 0),e([o()],C.prototype,"type",void 0),C=e([p("esri.layers.graphics.sources.OGCFeatureSource")],C);export{C as OGCFeatureSource};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as s}from"../../../core/Loadable.js";import{escapeRegExpString as r}from"../../../core/string.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/SpatialReference.js";import{typeKebabDictionary as a}from"../../../geometry/support/typeUtils.js";import{queryFeatureSetJSON as u,crsDefault as n,getSpatialReferenceWkid as c,getServerLandingPage as l,getServerConformance as d,getServerCollections as m,getServerOpenApi as y,getCollectionDefinition as f,crsPrefix as g}from"../../ogc/ogcFeatureUtils.js";import{zeroQueryBins as h}from"../../support/capabilities.js";import S from"../../../rest/support/FeatureSet.js";let C=class extends s{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:r},layer:{apiKey:o,customParameters:p,effectiveMaxRecordCount:i}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:i,queryParameters:{apiKey:o,customParameters:p},spatialReference:s,supportedCrs:r}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(e=>S.fromJSON(e))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>u(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){const{isWebMercator:t,isWGS84:s,latestWkid:r,wkid:o}=e,{supportedCrs:p}=this.featureDefinition;return s||t||!!o&&!!p[o]||!!r&&!!p[r]}_conformsToType(e,t){const s=new RegExp(`^${r(t)}$`,"i");return e.conformsTo.some(e=>s.test(e))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,supportsTrueCurve:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:h,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const t=e?.components?.parameters;return t?.limit?.schema?.maximum??t?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const t=e.storageCrs??n,s=c(t);return null==s?i.WGS84:new i({wkid:s})}_getSupportedSpatialReferences(e,t){const s="#/crs",r=e.crs??[n],o=r.includes(s)?r.filter(e=>e!==s).concat(t.crs??[]):r,p=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return o.filter(e=>!p.test(e))}async _loadOGCServices(e,s){const o=null!=s?s.signal:null,{apiKey:p,collectionId:i,customParameters:u,fields:n,geometryType:h,hasZ:S,objectIdField:C,timeInfo:R,url:v}=e,w={fields:n?.map(e=>e.toJSON()),geometryType:a.toJSON(h),hasZ:S,objectIdField:C,timeInfo:R?.toJSON()},x={apiKey:p,customParameters:u,signal:o},O=await l(v,x),[j,D]=await Promise.all([d(O,x),m(O,x)]);if(!this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new t("ogc-feature-layer:no-geojson-support","Server does not support geojson");const F=D.collections.find(({id:e})=>e===i);if(!F)throw new t("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const T=this._conformsToType(j,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await y(O,x):null,A=await f(F,w,x),Q=this._getMaxRecordCount(T),P=this._getCapabilities(A.hasZ,Q),b=this._getStorageSpatialReference(F).toJSON(),q=this._getSupportedSpatialReferences(F,D),G=new RegExp(`^${r(g)}`,"i"),_={};for(const t of q){const e=c(t);null!=e&&(_[e]||(_[e]=t.replace(G,"")))}this.featureDefinition={capabilities:P,collection:F,layerDefinition:A,spatialReference:b,supportedCrs:_}}};e([o()],C.prototype,"featureDefinition",void 0),e([o({constructOnly:!0})],C.prototype,"layer",void 0),e([o()],C.prototype,"type",void 0),C=e([p("esri.layers.graphics.sources.OGCFeatureSource")],C);export{C as OGCFeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import o from"../../core/Logger.js";import{debounce as i}from"../../core/promiseUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{updateOrigins as l}from"../../core/accessorSupport/originUtils.js";import p from"../../geometry/Extent.js";import c from"../../geometry/HeightModelInfo.js";import d from"../../geometry/SpatialReference.js";import{titleFromUrlAndName as u,parse as m,cleanTitle as h}from"../support/arcgisLayerUrl.js";import{id as y}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";const _=_=>{const U=_;let P=class extends U{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=i(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return L(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:L(t)}:e;return p.fromJSON(o,r)}const o=t.store,i=L(t);return null==i||null==o?.extent||!Array.isArray(o.extent)||o.extent.some(e=>e<R)?null:new p({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:i})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?u(this.url,t.name):t.name;let o=t.name;if(!o&&this.url){const e=m(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),h(o)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,o.getLogger(this),t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,o=e.rootPage?.nodes?.[t];if(null==o?.obb?.center||null==o.obb.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(o.obb.center[0]<R||null==this.fullExtent||this.fullExtent.hasZ)return;const i=o.obb.halfSize,s=o.obb.center[2],a=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=s-a,this.fullExtent.zmax=s+a}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<R)return;const r=t[2],o=t[3],{fullExtent:i}=this;i&&(i.zmin=r-o,i.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let o=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(o=!0),o)return this._fetchVoxelServiceLayer();const i=r.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const o={...T,...t};let i=x.from(e);if(!i)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.getDefault();await this._ensureLoadBeforeSave(),i.type=O,i.portal=s;const a=I(i,"portal-item",!0),n={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,a,o),this.url&&(i.url=this.url),i.title||(i.title=this.title),E(i,o,1),await s.signIn(),await s.user.addItem({item:i,folder:o?.folder,data:n}),await j(this.resourceReferences,a),this.portalItem=i,l(a),a.portalItem=i,i}async _save(e){const t={...T,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==O)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${O}"`);await this._ensureLoadBeforeSave();const o=I(this.portalItem,"portal-item",!0),i={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,o,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),E(this.portalItem,t,0),await b(this.portalItem,i,this.resourceReferences,o),l(o),this.portalItem}async _validateAgainstJSONSchema(e,t,i){const s=i?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,i.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(o.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(y)],P.prototype,"id",void 0),e([s({type:d})],P.prototype,"spatialReference",void 0),e([a("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],P.prototype,"readSpatialReference",null),e([s({type:p})],P.prototype,"fullExtent",void 0),e([a("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],P.prototype,"readFullExtent",null),e([s({readOnly:!0,type:c})],P.prototype,"heightModelInfo",void 0),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],P.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],P.prototype,"maxScale",void 0),e([s({readOnly:!0})],P.prototype,"version",void 0),e([a("version",["store.version"])],P.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],P.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],P.prototype,"sublayerTitleMode",void 0),e([s({type:String})],P.prototype,"title",void 0),e([a("portal-item","title")],P.prototype,"readTitlePortalItem",null),e([a("service","title",["name"])],P.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],P.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],P.prototype,"url",void 0),e([s({readOnly:!0})],P.prototype,"parsedUrl",null),e([s({readOnly:!0})],P.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],P.prototype,"rootNode",void 0),P=e([n("esri.layers.mixins.SceneService")],P),P},R=-1e38;function L(e){if(null!=e.spatialReference)return d.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=o?new d(o):null}function E(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const i of o)e.typeKeywords.push(i);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const O="Scene Service",T={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};export{_ as SceneService,O as sceneServiceItemType};
5
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import o from"../../core/Logger.js";import{debounce as i}from"../../core/promiseUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{reader as a}from"../../core/accessorSupport/decorators/reader.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{updateOrigins as l}from"../../core/accessorSupport/originUtils.js";import p from"../../geometry/Extent.js";import c from"../../geometry/HeightModelInfo.js";import d from"../../geometry/SpatialReference.js";import{titleFromUrlAndName as m,parse as u,cleanTitle as h}from"../support/arcgisLayerUrl.js";import{id as y}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";const _=_=>{const A=_;let E=class extends A{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=i(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return L(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:L(t)}:e;return p.fromJSON(o,r)}const o=t.store,i=L(t);return null==i||null==o?.extent||!Array.isArray(o.extent)||o.extent.some(e=>e<R)?null:new p({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:i})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?m(this.url,t.name):t.name;let o=t.name;if(!o&&this.url){const e=u(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),h(o)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,o.getLogger(this),t);const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,o=t.rootPage?.nodes?.[r];O(e,o?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<R)return;const o=r[2],i=r[3];e.zmin=o-i,e.zmax=o+i}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let o=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(o=!0),o)return this._fetchVoxelServiceLayer();const i=r.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const o={...P,...t};let i=x.from(e);if(!i)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.getDefault();await this._ensureLoadBeforeSave(),i.type=U,i.portal=s;const a=I(i,"portal-item",!0),n={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,a,o),this.url&&(i.url=this.url),i.title||(i.title=this.title),T(i,o,1),await s.signIn(),await s.user.addItem({item:i,folder:o?.folder,data:n}),await j(this.resourceReferences,a),this.portalItem=i,l(a),a.portalItem=i,i}async _save(e){const t={...P,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const o=I(this.portalItem,"portal-item",!0),i={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,o,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),T(this.portalItem,t,0),await b(this.portalItem,i,this.resourceReferences,o),l(o),this.portalItem}async _validateAgainstJSONSchema(e,t,i){const s=i?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,i.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(o.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(y)],E.prototype,"id",void 0),e([s({type:d})],E.prototype,"spatialReference",void 0),e([a("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readSpatialReference",null),e([s({type:p})],E.prototype,"fullExtent",void 0),e([a("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readFullExtent",null),e([s({readOnly:!0,type:c})],E.prototype,"heightModelInfo",void 0),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],E.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],E.prototype,"maxScale",void 0),e([s({readOnly:!0})],E.prototype,"version",void 0),e([a("version",["store.version"])],E.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],E.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],E.prototype,"sublayerTitleMode",void 0),e([s({type:String})],E.prototype,"title",void 0),e([a("portal-item","title")],E.prototype,"readTitlePortalItem",null),e([a("service","title",["name"])],E.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],E.prototype,"url",void 0),e([s({readOnly:!0})],E.prototype,"parsedUrl",null),e([s({readOnly:!0})],E.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],E.prototype,"rootNode",void 0),E=e([n("esri.layers.mixins.SceneService")],E),E},R=-1e38;function L(e){if(null!=e.spatialReference)return d.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=o?new d(o):null}function O(e,t){if(null==t?.center||null==t.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<R)return;const o=t.halfSize,i=t.center[2],s=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);e.zmin=i-s,e.zmax=i+s}function T(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const i of o)e.typeKeywords.push(i);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};export{_ as SceneService,U as sceneServiceItemType,O as updateExtentFromPageObb};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import n from"../../core/Logger.js";import{makeAbsolute as i,addQueryParameters as r,urlToObject as o}from"../../core/urlUtils.js";import a from"../../geometry/SpatialReference.js";import{wgs84 as s}from"../../geometry/support/spatialReferenceUtils.js";import{project as l}from"../../geometry/support/webMercatorUtils.js";import{convertToFeatureSet as c,convertToGeometry as u,convertFromGeometry as d}from"../graphics/featureConversionUtils.js";import p from"../graphics/OptimizedFeatureSet.js";import{validateGeoJSON as f,inferLayerProperties as m,createOptimizedFeatures as g}from"../graphics/sources/geojson/geojson.js";import{createDrawingInfo as y}from"../graphics/sources/support/clientSideDefaults.js";import{mixAttributes as w}from"../graphics/sources/support/sourceUtils.js";import h from"../support/FieldsIndex.js";import{kebabDict as b}from"../support/fieldType.js";import{utc as j}from"../../time/constants.js";const F=()=>n.getLogger("esri.layers.ogc.ogcFeatureUtils"),I="startindex",T=new Set([I,"offset"]),k="http://www.opengis.net/def/crs/",x=`${k}OGC/1.3/CRS84`;async function S(n,o,a={},s=5){const{links:l}=n,c=L(l,"items","application/geo+json")||L(l,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==c)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:p}=a,g=i(c.href,n.landingPage.url),w={limit:s,...d,token:u},T=r(g,w),k={accept:"application/geo+json"},{data:x}=await e(T,{signal:p,headers:k}),S=U(T,s,x.links)??I;f(x);const v=m(x,{geometryType:o.geometryType}),O=o.fields||v.fields||[],P=null!=o.hasZ?o.hasZ:v.hasZ,q=v.geometryType,N=o.objectIdField||v.objectIdFieldName||"OBJECTID";let C=o.timeInfo;const R=O.find(({name:e})=>e===N);if(R)R.editable=!1,R.nullable=!1;else{if(!v.objectIdFieldType)throw new t("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");O.unshift({name:N,alias:N,type:"number"===v.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(N!==v.objectIdFieldName){const e=O.find(({name:e})=>e===v.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}O===v.fields&&v.unknownFields.length>0&&F().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:v.unknownFields}});for(const e of O){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new t("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!b.jsonValues.includes(e.type))throw new t("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(C){const e=new h(O);if(C.startTimeField){const t=e.get(C.startTimeField);t?(C.startTimeField=t.name,t.type="esriFieldTypeDate"):C.startTimeField=null}if(C.endTimeField){const t=e.get(C.endTimeField);t?(C.endTimeField=t.name,t.type="esriFieldTypeDate"):C.endTimeField=null}if(C.trackIdField){const t=e.get(C.trackIdField);t?C.trackIdField=t.name:(C.trackIdField=null,F().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:C}}))}C.timeReference||={timeZoneIANA:j},C.startTimeField||C.endTimeField||(F().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:C}}),C=void 0)}return{drawingInfo:q?y(q):null,extent:K(n),geometryType:q,fields:O,hasZ:!!P,objectIdField:N,paginationParameter:S,timeInfo:C}}async function v(n,r={}){const{links:o,url:a}=n,s=L(o,"data","application/json")||L(o,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(null==s)throw new t("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(s.href,a),{data:p}=await e(d,{signal:u,headers:{accept:"application/json"},query:{...c,token:l}});for(const e of p.collections)e.landingPage=n;return p}async function O(n,r={}){const{links:o,url:a}=n,s=L(o,"conformance","application/json")||L(o,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==s)throw new t("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(s.href,a),{data:p}=await e(d,{signal:u,headers:{accept:"application/json"},query:{...c,token:l}});return p}async function P(t,n={}){const{apiKey:i,customParameters:r,signal:o}=n,{data:a}=await e(t,{signal:o,headers:{accept:"application/json"},query:{...r,token:i}});return a.url=t,a}async function q(t,n={}){const{links:r,url:o}=t,a=L(r,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(null==a)return F().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:s,customParameters:l,signal:c}=n,u=i(a.href,o),{data:d}=await e(u,{signal:c,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...l,token:s}});return d}function N(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:r}=n;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return a.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(r,10);return Number.isNaN(e)?null:e}default:return null}}async function C(e,t,n){const i=await R(e,t,n);return c(i)}async function R(n,r,o){const{collection:{links:c,landingPage:{url:f}},layerDefinition:m,maxRecordCount:y,queryParameters:{apiKey:b,customParameters:j},spatialReference:F,supportedCrs:I}=n,T=L(c,"items","application/geo+json")||L(c,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(!T)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:k,num:x,start:S,timeExtent:v,where:O}=r;if(r.objectIds)throw new t("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const P=a.fromJSON(F),q=r.outSpatialReference??P,N=q.isWGS84?null:$(q,I),C=Z(k,I),R=D(v),W=M(O),G=x??(null==S?y:10),K=0===S?void 0:S,{fields:U,geometryType:A,hasZ:J,objectIdField:z,paginationParameter:E}=m,_=i(T.href,f),{data:B}=await e(_,{...o,query:{...j,...C,crs:N,datetime:R,query:W,limit:G,[E]:K,token:b},headers:{accept:"application/geo+json"}}),Q=g(B,{geometryType:A,hasZ:J,objectIdField:z}),V=Q.length===G&&!!L(B.links??[],"next","application/geo+json"),H=new h(U);for(const e of Q){const t={};w(H,t,e.attributes,!0);for(const e of H.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[z]=e.attributes[z],e.attributes=t}if(!N&&q.isWebMercator)for(const e of Q)if(null!=e.geometry&&null!=A){const t=u(e.geometry,A,J,!1);t.spatialReference=a.WGS84,e.geometry=d(l(t,q))}for(const e of Q)e.objectId=e.attributes[z];const X=N||!N&&q.isWebMercator?q.toJSON():s,Y=new p;return Y.exceededTransferLimit=V,Y.features=Q,Y.fields=U,Y.geometryType=A,Y.hasZ=J,Y.spatialReference=X,Y}function W(e){return null!=e&&"extent"===e.type}function $(e,t){const{isWebMercator:n,wkid:i,latestWkid:r}=e;if(!i&&!r)return null;const o=n?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||r&&t[r];return o?`${k}${o}`:null}function G(e){if(!e)return"";const{xmin:t,ymin:n,xmax:i,ymax:r}=e;return`${t},${n},${i},${r}`}function D(e){if(!e)return null;const{start:t,end:n}=e;return`${null!=t?t.toISOString():".."}/${null!=n?n.toISOString():".."}`}function M(e){return e&&"1=1"!==e?e:null}function Z(e,t){if(!W(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:G(e)};const i=$(n,t);return null!=i?{bbox:G(e),"bbox-crs":i}:n.isWebMercator?{bbox:G(l(e,a.WGS84))}:null}function K(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=4===n.length,[r,o]=n,s=i?void 0:n[2];return{xmin:r,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:s,zmax:i?void 0:n[5],spatialReference:a.WGS84.toJSON()}}function L(e,t,n){return e.find(({rel:e,type:i})=>e===t&&i===n)??e.find(({rel:e,type:n})=>e===t&&!n)}function U(e,t,n){if(!n)return;const i=L(n,"next","application/geo+json"),r=o(i?.href)?.query;if(!r)return;const a=o(e).query,s=Object.keys(a??{}),l=Object.entries(r).filter(([e])=>!s.includes(e)).find(([e,n])=>T.has(e.toLowerCase())&&Number.parseInt(n,10)===t),c=l?.[0];return c}export{x as crsDefault,k as crsPrefix,S as getCollectionDefinition,v as getServerCollections,O as getServerConformance,P as getServerLandingPage,q as getServerOpenApi,N as getSpatialReferenceWkid,C as queryFeatureSetJSON,R as queryOptimizedFeatureSet};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import n from"../../core/Logger.js";import{makeAbsolute as i,addQueryParameters as r,urlToObject as o}from"../../core/urlUtils.js";import a from"../../geometry/SpatialReference.js";import{wgs84 as s}from"../../geometry/support/spatialReferenceUtils.js";import{project as l}from"../../geometry/support/webMercatorUtils.js";import{convertToFeatureSet as c,convertToGeometry as u,convertFromGeometry as d}from"../graphics/featureConversionUtils.js";import p from"../graphics/OptimizedFeatureSet.js";import{validateGeoJSON as f,inferLayerProperties as m,createOptimizedFeatures as g}from"../graphics/sources/geojson/geojson.js";import{createDrawingInfo as y}from"../graphics/sources/support/clientSideDefaults.js";import{mixAttributes as w}from"../graphics/sources/support/sourceUtils.js";import h from"../support/FieldsIndex.js";import{kebabDict as b}from"../support/fieldType.js";import{utc as j}from"../../time/constants.js";const F=()=>n.getLogger("esri.layers.ogc.ogcFeatureUtils"),I="startindex",T=new Set([I,"offset"]),k="http://www.opengis.net/def/crs/",x=`${k}OGC/1.3/CRS84`;async function S(n,o,a={},s=5){const{links:l}=n,c=L(l,"items","application/geo+json")||L(l,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(null==c)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:p}=a,g=i(c.href,n.landingPage.url),w={limit:s,...d,token:u},T=r(g,w),k={accept:"application/geo+json"},{data:x}=await e(T,{signal:p,headers:k}),S=U(T,s,x.links)??I;f(x);const v=x.numberMatched,O=m(x,{geometryType:o.geometryType}),P=o.fields||O.fields||[],q=null!=o.hasZ?o.hasZ:O.hasZ,C=O.geometryType,N=o.objectIdField||O.objectIdFieldName||"OBJECTID";let R=o.timeInfo;const W=P.find(({name:e})=>e===N);if(W)W.editable=!1,W.nullable=!1;else{if(!O.objectIdFieldType)throw new t("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");P.unshift({name:N,alias:N,type:"number"===O.objectIdFieldType?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(N!==O.objectIdFieldName){const e=P.find(({name:e})=>e===O.objectIdFieldName);e&&(e.type="esriFieldTypeInteger")}P===O.fields&&O.unknownFields.length>0&&F().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:O.unknownFields}});for(const e of P){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),"esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable),!e.name)throw new t("ogc-feature-layer:invalid-field-name","field name is missing",{field:e});if(!b.jsonValues.includes(e.type))throw new t("ogc-feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e})}if(R){const e=new h(P);if(R.startTimeField){const t=e.get(R.startTimeField);t?(R.startTimeField=t.name,t.type="esriFieldTypeDate"):R.startTimeField=null}if(R.endTimeField){const t=e.get(R.endTimeField);t?(R.endTimeField=t.name,t.type="esriFieldTypeDate"):R.endTimeField=null}if(R.trackIdField){const t=e.get(R.trackIdField);t?R.trackIdField=t.name:(R.trackIdField=null,F().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:R}}))}R.timeReference||={timeZoneIANA:j},R.startTimeField||R.endTimeField||(F().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:R}}),R=void 0)}return{drawingInfo:C?y(C):null,extent:K(n),geometryType:C,fields:P,hasZ:!!q,objectIdField:N,paginationParameter:S,timeInfo:R,featureCount:v}}async function v(n,r={}){const{links:o,url:a}=n,s=L(o,"data","application/json")||L(o,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(null==s)throw new t("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(s.href,a),{data:p}=await e(d,{signal:u,headers:{accept:"application/json"},query:{...c,token:l}});for(const e of p.collections)e.landingPage=n;return p}async function O(n,r={}){const{links:o,url:a}=n,s=L(o,"conformance","application/json")||L(o,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(null==s)throw new t("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:l,customParameters:c,signal:u}=r,d=i(s.href,a),{data:p}=await e(d,{signal:u,headers:{accept:"application/json"},query:{...c,token:l}});return p}async function P(t,n={}){const{apiKey:i,customParameters:r,signal:o}=n,{data:a}=await e(t,{signal:o,headers:{accept:"application/json"},query:{...r,token:i}});return a.url=t,a}async function q(t,n={}){const{links:r,url:o}=t,a=L(r,"service-desc","application/vnd.oai.openapi+json;version=3.0");if(null==a)return F().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:s,customParameters:l,signal:c}=n,u=i(a.href,o),{data:d}=await e(u,{signal:c,headers:{accept:"application/vnd.oai.openapi+json;version=3.0"},query:{...l,token:s}});return d}function C(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?<authority>.*)\/(?<version>.*)\/(?<code>.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:r}=n;switch(i.toLowerCase()){case"ogc":switch(r.toLowerCase()){case"crs27":return a.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return a.WGS84.wkid;default:return null}case"esri":case"epsg":{const e=Number.parseInt(r,10);return Number.isNaN(e)?null:e}default:return null}}async function N(e,t,n){const i=await R(e,t,n);return c(i)}async function R(n,r,o){const{collection:{links:c,landingPage:{url:f}},layerDefinition:m,maxRecordCount:y,queryParameters:{apiKey:b,customParameters:j},spatialReference:F,supportedCrs:I}=n,T=L(c,"items","application/geo+json")||L(c,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(!T)throw new t("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:k,num:x,start:S,timeExtent:v,where:O}=r;if(r.objectIds)throw new t("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const P=a.fromJSON(F),q=r.outSpatialReference??P,C=q.isWGS84?null:$(q,I),N=Z(k,I),R=M(v),W=D(O),G=x??(null==S?y:10),K=0===S?void 0:S,{fields:U,geometryType:A,hasZ:J,objectIdField:z,paginationParameter:E}=m,_=i(T.href,f),{data:B}=await e(_,{...o,query:{...j,...N,crs:C,datetime:R,query:W,limit:G,[E]:K,token:b},headers:{accept:"application/geo+json"}}),Q=g(B,{geometryType:A,hasZ:J,objectIdField:z}),V=Q.length===G&&!!L(B.links??[],"next","application/geo+json"),H=new h(U);for(const e of Q){const t={};w(H,t,e.attributes,!0);for(const e of H.fields)e.nullable&&!(e.name in t)&&(t[e.name]=null);t[z]=e.attributes[z],e.attributes=t}if(!C&&q.isWebMercator)for(const e of Q)if(null!=e.geometry&&null!=A){const t=u(e.geometry,A,J,!1);t.spatialReference=a.WGS84,e.geometry=d(l(t,q))}for(const e of Q)e.objectId=e.attributes[z];const X=C||!C&&q.isWebMercator?q.toJSON():s,Y=new p;return Y.exceededTransferLimit=V,Y.features=Q,Y.fields=U,Y.geometryType=A,Y.hasZ=J,Y.spatialReference=X,Y}function W(e){return null!=e&&"extent"===e.type}function $(e,t){const{isWebMercator:n,wkid:i,latestWkid:r}=e;if(!i&&!r)return null;const o=n?t[3857]??t[102100]??t[102113]??t[900913]:i&&t[i]||r&&t[r];return o?`${k}${o}`:null}function G(e){if(!e)return"";const{xmin:t,ymin:n,xmax:i,ymax:r}=e;return`${t},${n},${i},${r}`}function M(e){if(!e)return null;const{start:t,end:n}=e;return`${null!=t?t.toISOString():".."}/${null!=n?n.toISOString():".."}`}function D(e){return e&&"1=1"!==e?e:null}function Z(e,t){if(!W(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:G(e)};const i=$(n,t);return null!=i?{bbox:G(e),"bbox-crs":i}:n.isWebMercator?{bbox:G(l(e,a.WGS84))}:null}function K(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=4===n.length,[r,o]=n,s=i?void 0:n[2];return{xmin:r,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:s,zmax:i?void 0:n[5],spatialReference:a.WGS84.toJSON()}}function L(e,t,n){return e.find(({rel:e,type:i})=>e===t&&i===n)??e.find(({rel:e,type:n})=>e===t&&!n)}function U(e,t,n){if(!n)return;const i=L(n,"next","application/geo+json"),r=o(i?.href)?.query;if(!r)return;const a=o(e).query,s=Object.keys(a??{}),l=Object.entries(r).filter(([e])=>!s.includes(e)).find(([e,n])=>T.has(e.toLowerCase())&&Number.parseInt(n,10)===t),c=l?.[0];return c}export{x as crsDefault,k as crsPrefix,S as getCollectionDefinition,v as getServerCollections,O as getServerConformance,P as getServerLandingPage,q as getServerOpenApi,C as getSpatialReferenceWkid,N as queryFeatureSetJSON,R as queryOptimizedFeatureSet};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import{isBlobProtocol as r}from"../../core/urlUtils.js";import{loadParquetModule as n}from"./loadParquetModule.js";import{MultiscaleGeometryField as o,GeometryInfo as a,GeometryType as i,PrimaryGeometryField as s}from"../../chunks/bundle.js";const u=t=>async function(r,n,o,a){const i=t?.(),s=i?{...i,debug:a}:{debug:a},{data:u}=await e(r,{responseType:"array-buffer",query:s,headers:{range:`bytes=${n}-${o}`}});return u},l=t=>async function(n){if(r(n)){const{data:t}=await e(n,{responseType:"blob"});return t.size}const{data:o}=await e(n,{responseType:"native",method:"head",query:t?.()}),a=o.headers.get("Content-Length");if(null==a)throw new Error("Unable to parse content length");return parseInt(a,10)};function c(e){switch(e){case"esriGeometryPoint":return i.Point;case"esriGeometryPolygon":return i.Polygon;case"esriGeometryPolyline":return i.Polyline;case"esriGeometryMultipoint":return i.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function m(e){switch(e.encoding.type){case"wkb":return s.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:r}=e.encoding;return s.fromLocation(t,r)}}}function f(e,r){const n=e.spatialReference.wkid,i=r.wkid;if(!n||!i)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const s=c(e.geometryType),u=m(e),l=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,r]=e.transform.translate,[n,a]=e.transform.scale,i=new Float64Array([t,r]),s=new Float64Array([n,a]);l.push(o.new(e.level,e.column,i,s))}}return a.new(s,n,i,u,l)}async function p(e,t={}){const{ParquetFile:r}=await n(),o=u(t.getCustomParameters),a=l(t.getCustomParameters),i=t.geometryInfo?f(t.geometryInfo,t.outSpatialReference??t.geometryInfo.spatialReference):null;return r.fromUrl(e,o,a,i)}function d(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function y(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{p as createParquetFile,y as readEsriMetadata,d as readGeoMetadata};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import"../../core/has.js";import{QueueProcessor as r}from"../../core/QueueProcessor.js";import{isBlobProtocol as n}from"../../core/urlUtils.js";import{loadParquetModule as o}from"./loadParquetModule.js";import{MultiscaleGeometryField as a,GeometryInfo as s,GeometryType as i,PrimaryGeometryField as u}from"../../chunks/bundle.js";const c=new r({concurrency:8,process:async t=>{const{data:r}=await e(t.url,t.options);return r}}),l=e=>async function(t,r,n,o){const a=e?.(),s=a??{};return await c.push({url:t,options:{responseType:"array-buffer",query:s,headers:{range:`bytes=${r}-${n}`}}})},m=t=>async function(r){if(n(r)){const{data:t}=await e(r,{responseType:"blob"});return t.size}const{data:o}=await e(r,{responseType:"native",method:"head",query:t?.()}),a=o.headers.get("Content-Length");if(null==a)throw new Error("Unable to parse content length");return parseInt(a,10)};function p(e){switch(e){case"esriGeometryPoint":return i.Point;case"esriGeometryPolygon":return i.Polygon;case"esriGeometryPolyline":return i.Polyline;case"esriGeometryMultipoint":return i.Multipoint;default:throw new t("parquet",`Found unexpected GeometryType: ${e}`)}}function f(e){switch(e.encoding.type){case"wkb":return u.fromWkb(e.encoding.primaryFieldName);case"location":{const{latitudeFieldName:t,longitudeFieldName:r}=e.encoding;return u.fromLocation(t,r)}}}function y(e,r){const n=e.spatialReference.wkid,o=r.wkid;if(!n||!o)throw new t("parquet","Unable to create ParquetFile, in and out wkid must be specified");const i=p(e.geometryType),u=f(e),c=[];if("xz"===e.displayOptimization?.mode){const t=e.displayOptimization.multiscale;for(const e of t.levels??[]){const[t,r]=e.transform.translate,[n,o]=e.transform.scale,s=new Float64Array([t,r]),i=new Float64Array([n,o]);c.push(a.new(e.level,e.column,s,i))}}return s.new(i,n,o,u,c)}async function d(e,t={}){const{ParquetFile:r}=await o(),n=l(t.getCustomParameters),a=m(t.getCustomParameters),s=t.geometryInfo?y(t.geometryInfo,t.outSpatialReference??t.geometryInfo.spatialReference):null;return r.fromUrl(e,n,a,s)}function w(e){const t=e.keyValueMetadata("geo");return null!=t?JSON.parse(t):null}function g(e){const t=e.keyValueMetadata("esri");return null!=t?JSON.parse(t):null}export{d as createParquetFile,g as readEsriMetadata,w as readGeoMetadata};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.0.0-next.18",
3
+ "version": "5.0.0-next.19",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../core/has.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../layers/support/RasterInfo.js";import{getPixelValueRange as n}from"../../layers/support/rasterFormats/pixelRangeUtils.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as m,isStandardU8Histogram as h,createStretchLUT as f,computeGammaValues as b,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as x,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as R,createHsvMap as I}from"./colorRampUtils.js";import{isUVRendererSupported as C,isColormapSupportedByWebGL as k,isColormapRendererSupported as L,isShadedReliefRendererSupported as _}from"./rasterRendererChecks.js";let O=class extends t{constructor(e){super(e),this.lookup={rendererJSON:{}},this.canRenderInWebGL=!1}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!T(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(s){return r.getLogger(this).error("symbolize",s.message),t}}simpleStretch(e,t){if(!T(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(s){return r.getLogger(this).error("symbolize",s.message),e}}generateWebGLParameters(e){const{rendererJSON:t}=this;switch(t.type){case"uniqueValue":case"rasterColormap":case"classBreaks":return this._generateColormapWebGLParams("classBreaks"===t.type);case"rasterStretch":return this._generateStretchWebGLParams(e.pixelBlock,t,e.bandIds);case"rasterShadedRelief":return this._generateShadedReliefWebGLParams(t,e.isGCS,e.resolution??void 0);case"vectorField":return this._generateVectorFieldWebGLParams(t);default:return null}}_isLUTChanged(e){const t=this.lookup.rendererJSON;if(!t)return!0;const{rendererJSON:r}=this;if("colorRamp"in r&&r.colorRamp){const s=r.colorRamp;if(e)return JSON.stringify(s)!==JSON.stringify(t.colorRamp)}return JSON.stringify(r)!==JSON.stringify(t)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){if(!e)return null;const{rasterInfo:r,lookup:s}=this,{pixelType:a,bandCount:o}=r,n=this.rendererJSON,l=["u8","u16","s8","s16"].includes(a);let c;const{dra:p}=n,{gamma:b}=s;if(p&&(t=null),"histogramEqualization"===n.stretchType){const a=p?null:s.histogramLut,o=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!a}),i="u8"===r.pixelType&&!p&&h(r.histograms?.[0])?e:d(e,{...o,gamma:b,isRenderer:!0});c=u(i,{lut:p?o.histogramLut:t?.length?t.map(e=>a[e]):a,offset:0})}else if(l){let i;if(p){const s=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t});i=f({pixelType:a,...s,gamma:b,rounding:"floor"})}else{if(this._isLUTChanged()){if(!this.bind().success)return e}i=s.stretchLut}if(!i)return e;o>1&&null!=t&&t.length===e?.pixels.length&&i.lut.length===o&&(i={lut:t.map(e=>i.lut[e]),offset:i.offset}),c=u(e,i)}else{const s=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:b,isRenderer:!0})}if(n.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,s.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},a=g(e,s);if(!r.colorRamp)return a;if(this._isLUTChanged(!0)){if(!this.bind().success)return a}const{hsvMap:o}=this.lookup;if(!o)return a;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return x(a,e,o,n),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!C(this.rasterInfo,a)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find(e=>"value"===e.name.toLowerCase());if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(r=>{const s=e.uniqueValueInfos?.find(e=>String(e.value)===String(r.attributes[a])),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):o&&i.push([r.attributes[t.name]].concat(o.color))})}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):o&&i.push([parseInt(""+e.value,10)].concat(o?.color))})}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=k(l?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!L(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(e=>[e.value].concat(e.color)).sort((e,t)=>e[0]-t[0]);if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=k(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!_(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=R(e.colorRamp,{interpolateAlpha:!0}),r=c({colormap:t}),s=I(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:s}}else this.lookup={rendererJSON:e};return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=t?.fields.find(e=>"value"===e.name.toLowerCase()),a=t?.fields.find(t=>t.name.toLowerCase()===e.field.toLowerCase()),o=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const i=o.sort((e,t)=>e.classMaxValue-t.classMaxValue),l=i[i.length-1];let u=e.minValue;if(!r){const t=[];for(let e=0;e<i.length;e++)t.push({value:i[e].classMinValue??u,mappedColor:i[e].symbol.color}),u=i[e].classMaxValue;return t.push({value:l.classMaxValue,mappedColor:l.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const p=[];if(null!=t&&null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,n=i[i.length-1],{classMaxValue:l}=n;u=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===l?n:s<u?null:i.find(({classMaxValue:e})=>e>s);a&&p.push([t].concat(a.symbol.color))}}else{const[t,r]=n(this.rasterInfo.pixelType);u=Math.max(t,Math.floor(e.minValue));for(let e=0;e<i.length;e++){const t=i[e],s=Math.min(r,Math.ceil(t.classMaxValue));for(let e=u;e<s;e++)p.push([e].concat(t.symbol.color));u=s}l.classMaxValue!==u&&u!==r||p.push([u].concat(l.symbol.color))}const d=c({colormap:p,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:d},this.canRenderInWebGL=k(d?.indexedColormap),{success:!0}}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||v(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.customStatistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!V(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:a,useGamma:o,colorRamp:n}=e;let{gamma:i}=e;if(o&&a&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=b(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map(e=>y(e));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=m(e,{rasterInfo:this.rasterInfo}),r=f({pixelType:l,...t,gamma:o?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}else this.lookup={rendererJSON:e};if(n&&!U(n)){const t=R(n,{interpolateAlpha:!0});this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&i?.length?i:null,this.canRenderInWebGL="histogramEqualization"!==t,{success:!0}}_generateColormapWebGLParams(e){const{indexedColormap:t,offset:r}=this.lookup.colormapLut||{};return{colormap:t,colormapOffset:r,isClassBreaks:e,type:"lut"}}_generateStretchWebGLParams(e,t,r){const{colormapLut:s}=this.lookup,a=t.colorRamp?s?.indexedColormap:null,o=t.colorRamp?s?.offset:null;"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!(!t.useGamma||!n?.some(e=>1!==e));let l=0;null!=e&&(l=e.getPlaneCount(),2===l&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:u}=this.rasterInfo,c=Math.min(3,r?.length||l||u,u),p=a||i?1:255,d=new Float32Array(c);if(i&&n)for(let m=0;m<c;m++)n[m]>1?n[m]>2?d[m]=6.5+(n[m]-2)**2.5:d[m]=6.5+100*(2-n[m])**4:d[m]=1;const h=i&&n?[n[0],n[1]??n[0],n[2]??n[0]]:[1,1,1],f=i?[d[0],d[1]??d[0],d[2]??d[0]]:[1,1,1];if(t.dra&&null==e&&("minMax"===t.stretchType||"standardDeviation"===t.stretchType))return{bandCount:c,minOutput:(t.min??0)/p,maxOutput:(t.max??255)/p,minCutOff:[0,0,0],maxCutOff:[1,1,1],factor:[1,1,1],useGamma:!1,gamma:h,gammaCorrection:f,colormap:a,colormapOffset:o,stretchType:t.stretchType,dynamicRangeAdjustment:t.dra,numberOfStandardDeviations:t.numberOfStandardDeviations??2,type:"stretch"};const{minCutOff:b,maxCutOff:y,minOutput:g,maxOutput:x}=m(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});1===b.length&&(b[2]=b[1]=b[0]),1===y.length&&(y[2]=y[1]=y[0]);const S=y.map((e,t)=>y[t]===b[t]?0:(x-g)/(y[t]-b[t])/p);return{bandCount:c,minOutput:g/p,maxOutput:x/p,minCutOff:b,maxCutOff:y,factor:S,useGamma:i,gamma:h,gammaCorrection:f,colormap:a,colormapOffset:o,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){const{colormapLut:s}=this.lookup,a=e.colorRamp?s?.indexedColormap:null,o=e.colorRamp?s?.offset:null,n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:a,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:o,flowRepresentation:n}=e,i=this.rasterInfo.statistics?.[0].min??0,l=this.rasterInfo.statistics?.[0].max??50,u=a?.find(e=>"sizeInfo"===e.type)??{maxDataValue:l,maxSize:.8*o,minDataValue:i,minSize:.2*o},c=u.minDataValue??i,p=u.maxDataValue??l,d=null!=u.maxSize&&null!=u.minSize?[u.minSize/o,u.maxSize/o]:[.2,.8];if("wind_speed"===t){const e=(d[0]+d[1])/2;d[0]=d[1]=e}const m=null!=c&&null!=p?[c,p]:null;let h=null;if("classified_arrow"===t)if(null!=c&&null!=p&&null!=u){h=[];const e=(u.maxDataValue-u.minDataValue)/5;for(let t=0;t<6;t++)h.push(u.minDataValue+e*t)}else h=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,b=a?.find(e=>"rotationInfo"===e.type);return{breakValues:h,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:o,symbolPercentRange:d,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":b?.rotationType||e.rotationType,type:"vectorField"}}};function V(e){return"percentClip"===e||"histogramEqualization"===e}function v(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}function T(e){return p(e)&&0!==e.validPixelCount}function U(e){return"algorithmic"===e.type&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}e([s({json:{write:!0}})],O.prototype,"rendererJSON",void 0),e([s({type:o,json:{write:!0}})],O.prototype,"rasterInfo",void 0),e([s({json:{write:!0}})],O.prototype,"lookup",void 0),e([s()],O.prototype,"canRenderInWebGL",void 0),O=e([a("esri.renderers.support.RasterSymbolizer")],O);export{O as default};
5
+ import{__decorate as e}from"tslib";import"../../core/has.js";import{JSONSupport as t}from"../../core/JSONSupport.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import o from"../../layers/support/RasterInfo.js";import{getPixelValueRange as n}from"../../layers/support/rasterFormats/pixelRangeUtils.js";import{colorize as i,remapColor as l,lookupPixels as u,createColormapLUT as c,isValidPixelBlock as p}from"../../layers/support/rasterFunctions/pixelUtils.js";import{stretch as d,getStretchCutoff as m,isStandardU8Histogram as h,createStretchLUT as f,computeGammaValues as b,createHistogramEqualizationLUT as y}from"../../layers/support/rasterFunctions/stretchUtils.js";import{hillshade as g,tintHillshade as x,calculateHillshadeParams as S}from"../../layers/support/rasterFunctions/surfaceUtils.js";import{convertColorRampToColormap as R,createHsvMap as I}from"./colorRampUtils.js";import{isUVRendererSupported as C,isColormapSupportedByWebGL as k,isColormapRendererSupported as L,isShadedReliefRendererSupported as _}from"./rasterRendererChecks.js";let O=class extends t{constructor(e){super(e),this.lookup={rendererJSON:{}},this.canRenderInWebGL=!1}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e?.pixelBlock;if(!T(t))return t;if(e.simpleStretchParams&&"rasterStretch"===this.rendererJSON.type)return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const s=e.extent,a=s.spatialReference.isGeographic,o={x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:o});break}}return r}catch(s){return r.getLogger(this).error("symbolize",s.message),t}}simpleStretch(e,t){if(!T(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),d(e,{...t,isRenderer:!0})}catch(s){return r.getLogger(this).error("symbolize",s.message),e}}generateWebGLParameters(e){const{rendererJSON:t}=this;switch(t.type){case"uniqueValue":case"rasterColormap":case"classBreaks":return this._generateColormapWebGLParams("classBreaks"===t.type);case"rasterStretch":return this._generateStretchWebGLParams(e.pixelBlock,t,e.bandIds);case"rasterShadedRelief":return this._generateShadedReliefWebGLParams(t,e.isGCS,e.resolution??void 0);case"vectorField":return this._generateVectorFieldWebGLParams(t);default:return null}}_isLUTChanged(e){const t=this.lookup.rendererJSON;if(!t)return!0;const{rendererJSON:r}=this;if("colorRamp"in r&&r.colorRamp){const s=r.colorRamp;if(e)return JSON.stringify(s)!==JSON.stringify(t.colorRamp)}return JSON.stringify(r)!==JSON.stringify(t)}_symbolizeColormap(e){if(this._isLUTChanged()){if(!this.bind().success)return e}return i(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);if(this._isLUTChanged()){if(!this.bind().success)return e}return t?i(e,this.lookup.colormapLut):l(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){if(!e)return null;const{rasterInfo:r,lookup:s}=this,{pixelType:a,bandCount:o}=r,n=this.rendererJSON,l=["u8","u16","s8","s16"].includes(a);let c;const{dra:p}=n,{gamma:b}=s;if(p&&(t=null),"histogramEqualization"===n.stretchType){const a=p?null:s.histogramLut,o=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!a}),i="u8"===r.pixelType&&!p&&h(r.histograms?.[0])?e:d(e,{...o,gamma:b,isRenderer:!0});c=u(i,{lut:p?o.histogramLut:t?.length?t.map(e=>a[e]):a,offset:0})}else if(l){let i;if(p){const s=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t});i=f({pixelType:a,...s,gamma:b,rounding:"floor"})}else{if(this._isLUTChanged()){if(!this.bind().success)return e}i=s.stretchLut}if(!i)return e;o>1&&null!=t&&t.length===e?.pixels.length&&i.lut.length===o&&(i={lut:t.map(e=>i.lut[e]),offset:i.offset}),c=u(e,i)}else{const s=m(n,{rasterInfo:r,pixelBlock:e,bandIds:t});c=d(e,{...s,gamma:b,isRenderer:!0})}if(n.colorRamp){if(this._isLUTChanged(!0)){if(!this.bind().success)return e}c=i(c,s.colormapLut)}return c}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,s={...r,...t},a=g(e,s);if(!r.colorRamp)return a;if(this._isLUTChanged(!0)){if(!this.bind().success)return a}const{hsvMap:o}=this.lookup;if(!o)return a;const n=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return x(a,e,o,n),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return 2===e&&("vector-magdir"===t||"vector-uv"===t)}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){const{bandCount:t,attributeTable:r,pixelType:s}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const o=e.defaultSymbol,n=1===t&&["u8","s8"].includes(s);if(!C(this.rasterInfo,a)&&!n)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const i=[];if(null!=r){const t=r.fields.find(e=>"value"===e.name.toLowerCase());if(!t)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(r=>{const s=e.uniqueValueInfos?.find(e=>String(e.value)===String(r.attributes[a])),n=s?.symbol?.color;n?i.push([r.attributes[t.name]].concat(n)):o&&i.push([r.attributes[t.name]].concat(o.color))})}else{if("value"!==a.toLowerCase())return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(e=>{const t=e?.symbol?.color;t?i.push([parseInt(""+e.value,10)].concat(t)):o&&i.push([parseInt(""+e.value,10)].concat(o?.color))})}if(0===i.length)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const l=c({colormap:i});return this.lookup={rendererJSON:e,colormapLut:l},this.canRenderInWebGL=k(l?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!L(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(e=>[e.value].concat(e.color)).sort((e,t)=>e[0]-t[0]);if(!t||0===t.length)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=c({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=k(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!_(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=R(e.colorRamp,{interpolateAlpha:!0}),r=c({colormap:t}),s=I(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:s}}else this.lookup={rendererJSON:e};return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,s=t?.fields.find(e=>"value"===e.name.toLowerCase()),a=t?.fields.find(t=>t.name.toLowerCase()===e.field.toLowerCase()),o=null!=s&&null!==a;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||o,tableValueField:s,tableBreakField:a}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:s,tableBreakField:a}=this._analyzeClassBreaks(e),o=e.classBreakInfos;if(!o?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const i=o.sort((e,t)=>e.classMaxValue-t.classMaxValue),l=i[i.length-1];let u=e.minValue;if(!r){const t=[];for(let e=0;e<i.length;e++)t.push({value:i[e].classMinValue??u,mappedColor:i[e].symbol.color}),u=i[e].classMaxValue;return t.push({value:l.classMaxValue,mappedColor:l.symbol.color}),this.lookup={rendererJSON:e,remapLut:t},this.canRenderInWebGL=!1,{success:!0}}const p=[];if(null!=t&&null!=s&&null!==a&&s!==a){const r=s.name,o=a.name,n=i[i.length-1],{classMaxValue:l}=n;u=e.minValue;for(const e of t.features){const t=e.attributes[r],s=e.attributes[o],a=s===l?n:s<u?null:i.find(({classMaxValue:e})=>e>s);a&&p.push([t].concat(a.symbol.color))}}else{const[t,r]=n(this.rasterInfo.pixelType);u=Math.max(t,Math.floor(e.minValue));for(let e=0;e<i.length;e++){const t=i[e],s=Math.min(r,Math.ceil(t.classMaxValue));for(let e=u;e<s;e++)p.push([e].concat(t.symbol.color));u=s}l.classMaxValue!==u&&u!==r||p.push([u].concat(l.symbol.color))}const d=c({colormap:p,fillUnspecified:!1});return this.lookup={rendererJSON:e,colormapLut:d},this.canRenderInWebGL=k(d?.indexedColormap),{success:!0}}_updateStretchRenderer(e){let{stretchType:t,dra:r}=e;if(!("none"===t||e.statistics?.length||v(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.customStatistics is required when dynamic range adjustment is not used."};const s=e.histograms||this.rasterInfo.histograms;!V(e.stretchType)||s?.length||r||(t="minMax");const{computeGamma:a,useGamma:o,colorRamp:n}=e;let{gamma:i}=e;if(o&&a&&!i?.length){const t=e.statistics?.length?e.statistics:this.rasterInfo.statistics;i=b(this.rasterInfo.pixelType,t)}const l=this.rasterInfo.pixelType,u=!r&&["u8","u16","s8","s16"].includes(l);if("histogramEqualization"===t){const t=s.map(e=>y(e));this.lookup={rendererJSON:e,histogramLut:t}}else if(u){const t=m(e,{rasterInfo:this.rasterInfo}),r=f({pixelType:l,...t,gamma:o?i:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:r}}else this.lookup={rendererJSON:e};if(n&&!U(n)){const t=R(n,{interpolateAlpha:!0});this.lookup.colormapLut=c({colormap:t}),this.lookup.rendererJSON=e}return this.lookup.gamma=o&&i?.length?i:null,this.canRenderInWebGL="histogramEqualization"!==t,{success:!0}}_generateColormapWebGLParams(e){const{indexedColormap:t,offset:r}=this.lookup.colormapLut||{};return{colormap:t,colormapOffset:r,isClassBreaks:e,type:"lut"}}_generateStretchWebGLParams(e,t,r){const{colormapLut:s}=this.lookup,a=t.colorRamp?s?.indexedColormap:null,o=t.colorRamp?s?.offset:null;"histogramEqualization"===t.stretchType&&(t={...t,stretchType:"minMax"});const{gamma:n}=this.lookup,i=!(!t.useGamma||!n?.some(e=>1!==e));let l=0;null!=e&&(l=e.getPlaneCount(),2===l&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:u}=this.rasterInfo,c=Math.min(3,r?.length||l||u,u),p=a||i?1:255,d=new Float32Array(c);if(i&&n)for(let m=0;m<c;m++)n[m]>1?n[m]>2?d[m]=6.5+(n[m]-2)**2.5:d[m]=6.5+100*(2-n[m])**4:d[m]=1;const h=i&&n?[n[0],n[1]??n[0],n[2]??n[0]]:[1,1,1],f=i?[d[0],d[1]??d[0],d[2]??d[0]]:[1,1,1];if(t.dra&&null==e&&("minMax"===t.stretchType||"standardDeviation"===t.stretchType))return{bandCount:c,minOutput:(t.min??0)/p,maxOutput:(t.max??255)/p,minCutOff:[0,0,0],maxCutOff:[1,1,1],factor:[1,1,1],useGamma:i,gamma:h,gammaCorrection:f,colormap:a,colormapOffset:o,stretchType:t.stretchType,dynamicRangeAdjustment:t.dra,numberOfStandardDeviations:t.numberOfStandardDeviations??2,type:"stretch"};const{minCutOff:b,maxCutOff:y,minOutput:g,maxOutput:x}=m(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});1===b.length&&(b[2]=b[1]=b[0]),1===y.length&&(y[2]=y[1]=y[0]);const S=y.map((e,t)=>y[t]===b[t]?0:(x-g)/(y[t]-b[t])/p);return{bandCount:c,minOutput:g/p,maxOutput:x/p,minCutOff:b,maxCutOff:y,factor:S,useGamma:i,gamma:h,gammaCorrection:f,colormap:a,colormapOffset:o,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){const{colormapLut:s}=this.lookup,a=e.colorRamp?s?.indexedColormap:null,o=e.colorRamp?s?.offset:null,n={...e,isGCS:t,resolution:r},i=S(n),l=this.rasterInfo.statistics?.[0];return{...i,minValue:l?.min??0,maxValue:l?.max??8e3,hillshadeType:"traditional"===e.hillshadeType?0:1,type:"hillshade",colormap:a,colormapOffset:o}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:s,visualVariables:a,symbolTileSize:o,flowRepresentation:n}=e,i=this.rasterInfo.statistics?.[0].min??0,l=this.rasterInfo.statistics?.[0].max??50,u=a?.find(e=>"sizeInfo"===e.type)??{maxDataValue:l,maxSize:.8*o,minDataValue:i,minSize:.2*o},c=u.minDataValue??i,p=u.maxDataValue??l,d=null!=u.maxSize&&null!=u.minSize?[u.minSize/o,u.maxSize/o]:[.2,.8];if("wind_speed"===t){const e=(d[0]+d[1])/2;d[0]=d[1]=e}const m=null!=c&&null!=p?[c,p]:null;let h=null;if("classified_arrow"===t)if(null!=c&&null!=p&&null!=u){h=[];const e=(u.maxDataValue-u.minDataValue)/5;for(let t=0;t<6;t++)h.push(u.minDataValue+e*t)}else h=[0,1e-6,3.5,7,10.5,14];const f="flow_to"===n===("ocean_current_kn"===t||"ocean_current_m"===t)?0:Math.PI,b=a?.find(e=>"rotationInfo"===e.type);return{breakValues:h,dataRange:m,inputUnit:r,outputUnit:s,symbolTileSize:o,symbolPercentRange:d,style:t||"single_arrow",rotation:f,rotationType:this.rasterInfo.storageInfo?.tileInfo&&"vector-uv"===this.rasterInfo.dataType?"geographic":b?.rotationType||e.rotationType,type:"vectorField"}}};function V(e){return"percentClip"===e||"histogramEqualization"===e}function v(e){return null!=e&&e.length>0&&null!=e[0].min&&null!=e[0].max}function T(e){return p(e)&&0!==e.validPixelCount}function U(e){return"algorithmic"===e.type&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}e([s({json:{write:!0}})],O.prototype,"rendererJSON",void 0),e([s({type:o,json:{write:!0}})],O.prototype,"rasterInfo",void 0),e([s({json:{write:!0}})],O.prototype,"lookup",void 0),e([s()],O.prototype,"canRenderInWebGL",void 0),O=e([a("esri.renderers.support.RasterSymbolizer")],O);export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as r}from"tslib";import"../../core/Logger.js";import"../../core/has.js";import"../../core/RandomLCG.js";import"../../core/Error.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";const s=s=>{const t=s;let e=class extends t{};return e=r([o("esri.rest.support.QueryMixin")],e),e};export{s as QueryMixin};
5
+ import{__decorate as r}from"tslib";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import e from"../../time/TimeExtent.js";const s=s=>{const p=s;let i=class extends p{};return r([o({type:e,json:{write:!0}})],i.prototype,"timeExtent",void 0),i=r([t("esri.rest.support.QueryMixin")],i),i};export{s as QueryMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- const e="20251017",f="31ffce02f738214e9cf444827db910a1aa5e4f3e";export{e as buildDate,f as commitHash};
5
+ const c="20251018",f="c29a17c1455bd526048f7d1061c83bf888f20f1e";export{c as buildDate,f as commitHash};