@arcgis/core 5.0.0-next.8 → 5.0.0-next.9
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.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
- package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
- package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b708792c84620b73c847.js → 21293b0c6405a10ec7b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{a876d6159ca120c1567e.js → 28d1f2cf6aae547615c3.js} +1 -1
- package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
- package/assets/esri/core/workers/chunks/31b6406960261da21dd4.js +1 -0
- package/assets/esri/core/workers/chunks/31dbe07047dc61303d7d.js +1 -0
- package/assets/esri/core/workers/chunks/{59d3cac32ad6dad941dc.js → 35c9b24e4430bd6c2b6b.js} +1 -1
- package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/4fb5f1c671892001a4fd.js +1 -0
- package/assets/esri/core/workers/chunks/{d88f2fe680b8d5603ef8.js → 5350d50b47b6a4e0e169.js} +1 -1
- package/assets/esri/core/workers/chunks/58e59ead33368ce38c8f.js +1 -0
- package/assets/esri/core/workers/chunks/{aff8e40a641c6822af1d.js → 5db37547963857295273.js} +1 -1
- package/assets/esri/core/workers/chunks/{3afb83f5de033dda89ec.js → 604777417722d4effe06.js} +1 -1
- package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
- package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
- package/assets/esri/core/workers/chunks/{b96eb0ea506379182d62.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/7d641f2f5edd95b9bc18.js +1 -0
- package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
- package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
- package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
- package/assets/esri/core/workers/chunks/{2a8dff8521e1e6a10cf6.js → 89b748e064ca90b4f76a.js} +1 -1
- package/assets/esri/core/workers/chunks/{fef45bc59c71f88c60b5.js → 8d9d3797c6d62fdfff9d.js} +1 -1
- package/assets/esri/core/workers/chunks/{e5a06ce0ef6a9a90e100.js → 9f21436016ff7a899e79.js} +1 -1
- package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
- package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b05208d56a724a8f1661.js +1 -0
- package/assets/esri/core/workers/chunks/{b0365cbc3d2a41969e3b.js → b7eb486354994dc70855.js} +1 -1
- package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
- package/assets/esri/core/workers/chunks/c715fd32f814a0f14f40.js +1 -0
- package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/cf971e7b1b98d9c502d3.js +1 -0
- package/assets/esri/core/workers/chunks/{20975513be0a3a1da286.js → d1ca7c3a32ce00ed8b81.js} +1 -1
- package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js → d391bfbaf0e790cd10d6.js} +2 -2
- package/assets/esri/core/workers/chunks/{b017bac40dc8328013e3.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/db678a6e352275e507a9.js +1 -0
- package/assets/esri/core/workers/chunks/de2ebd9cc3d9e68d435b.js +1 -0
- package/assets/esri/core/workers/chunks/e599125e746c27de106e.js +1 -0
- package/assets/esri/core/workers/chunks/{05429f9d292a7a714309.js → ebcc94234d9d4be1941f.js} +1 -1
- package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
- package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
- package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
- package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
- package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/form/FormTemplate.js +1 -1
- package/form/elements/Element.js +1 -1
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/GroupElement.js +1 -1
- package/interfaces.d.ts +25 -23
- package/kernel.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/support/RasterJobHandler.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/rasterDatasets/pixelReader.js +1 -1
- package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/package.json +2 -2
- package/smartMapping/renderers/size.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/utils.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/support/PromiseQueue.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/support/errors.js +5 -0
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/assets/esri/core/workers/chunks/06ba43843e9c4988049b.js +0 -1
- package/assets/esri/core/workers/chunks/1d15d1b20dc10fde6def.js +0 -1
- package/assets/esri/core/workers/chunks/28020063048e644f17a5.js +0 -1
- package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +0 -1
- package/assets/esri/core/workers/chunks/38cc18fd93c18815ded0.js +0 -1
- package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
- package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +0 -1
- package/assets/esri/core/workers/chunks/63a6f3e70d2b6ea57e40.js +0 -1
- package/assets/esri/core/workers/chunks/695cdef5057e5461078a.js +0 -1
- package/assets/esri/core/workers/chunks/6bb7dbc46787b8e34bd9.js +0 -1
- package/assets/esri/core/workers/chunks/6ee2f0f708494102a493.js +0 -1
- package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +0 -1
- package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +0 -1
- package/assets/esri/core/workers/chunks/a31635a6366347dcef0f.js +0 -1
- package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
- package/assets/esri/core/workers/chunks/afc13d5b842275db7dbc.js +0 -1
- package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +0 -1
- package/assets/esri/core/workers/chunks/b96eb0ea506379182d62.js +0 -2
- package/assets/esri/core/workers/chunks/c476643002387f60ea42.js +0 -1
- package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +0 -1
- package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
- package/assets/esri/core/workers/chunks/ebf23b46db56aaa88841.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2568],{35448:(e,t,r)=>{r.d(t,{Eq:()=>n,bV:()=>a,nP:()=>s,r5:()=>o,ti:()=>d,vy:()=>l,wr:()=>i});const n={Regular:0,Provenance:1,Document:2},o={esriFieldTypeSmallInteger:0,esriFieldTypeInteger:1,esriFieldTypeSingle:2,esriFieldTypeDouble:3,esriFieldTypeString:4,esriFieldTypeDate:5,esriFieldTypeOID:6,esriFieldTypeGeometry:7,esriFieldTypeBlob:8,esriFieldTypeRaster:9,esriFieldTypeGUID:10,esriFieldTypeGlobalID:11,esriFieldTypeXML:12,esriFieldTypeBigInteger:13,esriFieldTypeDateOnly:14,esriFieldTypeTimeOnly:15,esriFieldTypeTimestampOffset:16},a={esriGeometryNull:0,esriGeometryPoint:1,esriGeometryMultipoint:2,esriGeometryPolyline:3,esriGeometryPolygon:4,esriGeometryEnvelope:5,esriGeometryAny:7,esriGeometryMultiPatch:9},i={esriMethodHintUNSPECIFIED:0,esriUUIDESRI:1,esriUUIDRFC4122:2},s={esriTypeUNSPECIFIED:0,esriTypeEntity:1,esriTypeRelationship:2,esriTypeBoth:4,esriTypeMetaEntityProvenance:8},d={esriGraphPropertyUNSPECIFIED:0,esriGraphPropertyRegular:1,esriGraphPropertyDocumentName:2,esriGraphPropertyDocumentTitle:3,esriGraphPropertyDocumentUrl:4,esriGraphPropertyDocumentText:5,esriGraphPropertyDocumentKeywords:6,esriGraphPropertyDocumentContentType:7,esriGraphPropertyDocumentMetadata:8,esriGraphPropertyDocumentFileExtension:9,esriGraphPropertyProvenanceInstanceId:10,esriGraphPropertyProvenanceSourceType:11,esriGraphPropertyProvenanceSourceName:12,esriGraphPropertyProvenanceSource:13,esriGraphPropertyProvenanceComment:14,esriGraphPropertyProvenanceTypeName:15,esriGraphPropertyProvenancePropertyName:16},l={esriIdentifierInfoTypeUNSPECIFIED:0,esriIdentifierInfoTypeDatabaseNative:1,esriIdentifierInfoTypeUniformProperty:2}},45724:(e,t,r)=>{r.d(t,{I:()=>d});var n=r(2741),o=r(44208);const a="esri/rest/knowledgeGraph/wasmInterface/";let i,s;async function d(){const e=i??s;if(e)return e;const t=!!(0,o.A)("wasm-simd");return s=l(t),s}async function l(e){if(e){const{default:e}=await r.e(5367).then(r.bind(r,15367)).then(e=>e.a);return e({locateFile:e=>(0,n.s)(a+e)})}const{default:t}=await r.e(9013).then(r.bind(r,29013)).then(e=>e.a);return t({locateFile:e=>(0,n.s)(a+e)})}},62568:(e,t,r)=>{r.r(t),r.d(t,{_checkAuthentication:()=>or,_esriRequestWrapper:()=>nr,_fetchWrapper:()=>tr,_getClientDataCacheCopy:()=>St,_setMaxQueryParsingDurationForTesting:()=>lr,_submitJobWrapper:()=>rr,clearClientDataCache:()=>er,clientDataCache:()=>kt,executeAddGraphFieldIndex:()=>qt,executeAddGraphProperties:()=>Et,executeAddNamedTypes:()=>It,executeApplyEdits:()=>jt,executeDeleteGraphFieldIndex:()=>$t,executeDeleteGraphProperty:()=>Ft,executeDeleteNamedType:()=>Dt,executeFindPaths:()=>Yt,executeFindPathsAsynchronous:()=>Wt,executeQuery:()=>Lt,executeQueryStreaming:()=>Ut,executeSearch:()=>zt,executeSearchStreaming:()=>Jt,executeUpdateGraphProperty:()=>Nt,executeUpdateNamedType:()=>Zt,executeUpdateSearchIndex:()=>Ot,fetchAllClientDataKeys:()=>Kt,fetchAsynchronousFindPathsResultData:()=>Xt,fetchClientDataAtKeys:()=>Vt,fetchKnowledgeGraph:()=>Qt,kgRestServices:()=>Rt,refreshDataModel:()=>Bt,refreshServiceDefinition:()=>Ht});var n,o=r(70333),a=r(43773),i=r(49186),s=r(53966),d=r(74887),l=r(91075),p=r(16930),u=r(31635),c=r(69622),h=r(10107),y=r(56507),g=(r(44208),r(87811),r(64108)),f=r(5443);let w=n=class extends c.A{constructor(e){super(e),this.outSpatialReference=null,this.processExtent=null,this.processSpatialReference=null,this.returnColumnName=!1,this.returnFeatureCollection=!1,this.returnM=!1,this.returnZ=!1}static from(e){return(0,y.PZ)(n,e)}};(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:f.A})],w.prototype,"processExtent",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"processSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnColumnName",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnFeatureCollection",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnM",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnZ",void 0),w=n=(0,u.Cg)([(0,g.$)("esri.rest.geoprocessor.GPOptions")],w);var m=r(17136),_=r(20437),v=r(25482);let b=class extends v.o{constructor(e){super(e),this.extent=null,this.height=null,this.href=null,this.opacity=1,this.rotation=0,this.scale=null,this.visible=!0,this.width=null}};(0,u.Cg)([(0,h.MZ)({type:f.A})],b.prototype,"extent",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"height",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"href",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"opacity",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"rotation",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"scale",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"visible",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"width",void 0),b=(0,u.Cg)([(0,g.$)("esri.layers.support.MapImage")],b);var C=r(2272),A=r(93223),G=r(2073);let M=class extends v.o{constructor(e){super(e),this.area=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],M.prototype,"area",void 0),(0,u.Cg)([(0,A.e)(G.UO)],M.prototype,"units",void 0),M=(0,u.Cg)([(0,g.$)("esri.rest.support.ArealUnit")],M);let x=class extends v.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],x.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],x.prototype,"url",void 0),x=(0,u.Cg)([(0,g.$)("esri.rest.support.DataFile")],x);var T=r(22671);let P=class extends v.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],P.prototype,"distance",void 0),(0,u.Cg)([(0,A.e)(G.Y8)],P.prototype,"units",void 0),P=(0,u.Cg)([(0,g.$)("esri.rest.support.LinearUnit")],P);var k=r(66552);const S="multi-value-",R=new k.J({GPArealUnit:"areal-unit",GPBoolean:"boolean",GPComposite:"composite",GPDataFile:"data-file",GPDate:"date",GPDouble:"double",GPFeatureRecordSetLayer:"feature-record-set-layer",Field:"field",GPLinearUnit:"linear-unit",GPLong:"long",GPRasterData:"raster-data",GPRasterDataLayer:"raster-data-layer",GPRecordSet:"record-set",GPString:"string",GPValueTable:"value-table","GPMultiValue:GPArealUnit":`${S}areal-unit`,"GPMultiValue:GPBoolean":`${S}boolean`,"GPMultiValue:GPComposite":`${S}composite`,"GPMultiValue:GPDataFile":`${S}data-file`,"GPMultiValue:GPDate":`${S}date`,"GPMultiValue:GPDouble":`${S}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${S}feature-record-set-layer`,"GPMultiValue:Field":`${S}field`,"GPMultiValue:GPLinearUnit":`${S}linear-unit`,"GPMultiValue:GPLong":`${S}long`,"GPMultiValue:GPRasterData":`${S}raster-data`,"GPMultiValue:GPRasterDataLayer":`${S}raster-data-layer`,"GPMultiValue:GPRecordSet":`${S}record-set`,"GPMultiValue:GPString":`${S}string`});let j=class extends v.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,u.Cg)([(0,A.e)(R,{ignoreUnknown:!1})],j.prototype,"dataType",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"paramName",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"value",void 0),j=(0,u.Cg)([(0,g.$)("esri.rest.support.ParameterValue")],j);var I=r(36005);let D=class extends v.o{constructor(e){super(e),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(e){return"ImageService"===e?"image-service":null}};async function Z(e,t){switch(e){case"areal-unit":return M.fromJSON(t);case"boolean":case"double":case"long":case"string":case"value-table":return t;case"date":return new Date(t);case"data-file":return x.fromJSON(t);case"linear-unit":return P.fromJSON(t);case"feature-record-set-layer":if("url"in t)return x.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(7330),r.e(3508),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(9708),r.e(8654),r.e(6647),r.e(3548)]).then(r.bind(r,68654))).default),{layerDefinition:n,featureSet:o}=t;return e.read({layerDefinition:n,featureSet:o},{origin:"portal-item"}),e.spatialReference=p.A.fromJSON(o.spatialReference??n.spatialReference??n.extent.spatialReference),e}return T.A.fromJSON(t);case"record-set":return"url"in t?x.fromJSON(t):T.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?b.fromJSON(t.mapImage):D.fromJSON(t);case"field":return _.A.fromJSON(t)}}async function E(e){const t=R.fromJSON(e.dataType),{paramName:r}=e,n=function(e){return e.startsWith(S)}(t)?await async function(e,t){const r=function(e){return e.replace(S,"")}(e),n="composite"===r?t.map(e=>Z(R.fromJSON(e.dataType),e.value)):t.map(e=>Z(r,e));return Promise.all(n)}(t,e.value):await Z(t,e.value);return new j({dataType:t,paramName:r,value:n})}function F(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>F({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,C.lF)(e,t,r)}(0,u.Cg)([(0,h.MZ)()],D.prototype,"format",void 0),(0,u.Cg)([(0,h.MZ)({json:{name:"itemID",write:!0}})],D.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)()],D.prototype,"type",void 0),(0,u.Cg)([(0,I.w)("type")],D.prototype,"readType",null),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],D.prototype,"url",void 0),D=(0,u.Cg)([(0,g.$)("esri.rest.support.RasterData")],D);var N,q=r(37807);const $=(0,k.O)()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),O=1e3;let L=class extends v.o{static{N=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:r}=this,{path:n}=(0,C.Dl)(r),o={...this.requestOptions,...e,query:{f:"json"}},i=`${n}/jobs/${t}/cancel`,{data:s}=await(0,a.A)(i,o),{messages:l,jobStatus:p,progress:u}=N.fromJSON(s);return this.set({messages:l,jobStatus:p,progress:u}),"job-cancelled"===p?this:new Promise((t,r)=>{(0,d.u7)(o.signal,()=>{this.clearCancelJobTimer(),r((0,d.NK)())}),this.clearCancelJobTimer();const n=()=>{this._cancelJobTimer||r((0,d.NK)()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(n,O);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":r(this);break;case"job-cancelled":t(this)}}).catch(e=>{r(e)})};this._cancelJobTimer=setTimeout(n,O)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,C.Dl)(this.sourceUrl),r={...this.requestOptions,...e,query:{...e?.query,f:"json"}},n=`${t}/jobs/${this.jobId}`,{data:o}=await(0,a.A)(n,r),{messages:i,jobStatus:s,progress:d}=N.fromJSON(o);return this.set({messages:i,jobStatus:s,progress:d}),this}async fetchResultData(e,t,r){t=w.from(t||{});const{returnColumnName:n,returnFeatureCollection:o,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,C.Dl)(this.sourceUrl),p=F({returnColumnName:n||null,returnFeatureCollection:o||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json",...r?.query},null),u={...this.requestOptions,...r,query:p},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:h}=await(0,a.A)(c,u);return E(h)}async fetchResultImage(e,t,r){const{path:n}=(0,C.Dl)(this.sourceUrl),o=F({...t.toJSON(),f:"json"}),i={...this.requestOptions,...r,query:o},s=`${n}/jobs/${this.jobId}/results/${e}`,{data:d}=await(0,a.A)(s,i);return E(d)}async fetchResultMapImageLayer(){const{path:e}=(0,C.Dl)(this.sourceUrl),t=e.indexOf("/GPServer/"),n=`${e.slice(0,Math.max(0,t))}/MapServer/jobs/${this.jobId}`;return new(0,(await Promise.all([r.e(3508),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(957),r.e(893),r.e(7048),r.e(7656),r.e(7548)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=O,signal:r,statusCallback:n,apiKey:o}=e;return new Promise((e,a)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),a((0,d.NK)())}),this.clearJobCompletionTimer();const i=()=>{this._jobCompletionTimer||a((0,d.NK)()),this.checkJobStatus({query:{token:o}}).then(({jobStatus:r})=>{switch(r){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":n&&n(this),this._jobCompletionTimer=setTimeout(i,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":a(this);break;default:this._jobCompletionTimer=setTimeout(i,t)}}).catch(e=>{a(e)})};this._jobCompletionTimer=setTimeout(i,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,u.Cg)([(0,h.MZ)()],L.prototype,"jobId",void 0),(0,u.Cg)([(0,A.e)($,{ignoreUnknown:!1})],L.prototype,"jobStatus",void 0),(0,u.Cg)([(0,h.MZ)({type:[q.A]})],L.prototype,"messages",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"progress",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"requestOptions",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],L.prototype,"sourceUrl",void 0),L=N=(0,u.Cg)([(0,g.$)("esri.rest.support.JobInfo")],L);let U=class extends c.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};(0,u.Cg)([(0,h.MZ)()],U.prototype,"headerKeys",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"exceededTransferLimit",void 0),U=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],U);let z=class extends c.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultRows",void 0),(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultHeader",void 0),z=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResult")],z);let J=class extends c.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultRowsStream",void 0),(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultHeader",void 0),J=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],J);let K=class extends v.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"unique",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"ascending",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],K.prototype,"fieldNames",void 0),K=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.FieldIndex")],K);let V=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=!0,this.required=!1,this.defaultVisibility=!0,this.systemMaintained=null,this.role="esriGraphPropertyUNSPECIFIED",this.defaultValue=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"fieldType",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"geometryType",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasM",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasZ",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"nullable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"editable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"required",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"defaultVisibility",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"systemMaintained",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],V.prototype,"defaultValue",void 0),V=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphProperty")],V);let Q=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.role="Regular",this.strict=null,this.properties=[],this.fieldIndexes=[],this.type=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:[V],json:{write:!0}})],Q.prototype,"properties",void 0),(0,u.Cg)([(0,h.MZ)({type:[K],json:{write:!0}})],Q.prototype,"fieldIndexes",void 0),Q=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphObjectType")],Q);let B=class extends Q{constructor(e){super(e),this.type="entity"}};B=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.EntityType")],B);let H=class extends Q{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],H.prototype,"endPoints",void 0),H=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.RelationshipType")],H);let W=class extends v.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"value",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"behavior",void 0),W=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],W);let Y=class extends v.o{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=[],this.entityTypes=[],this.relationshipTypes=[],this.metaEntityTypes=[],this.provenanceSourceTypeValues=[]}};(0,u.Cg)([(0,h.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],Y.prototype,"timestamp",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],Y.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Y.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"objectIdField",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"globalIdField",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"arcgisManaged",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"identifierInfo",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"searchIndexes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"entityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[H],json:{write:!0}})],Y.prototype,"relationshipTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"metaEntityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[W],json:{write:!0}})],Y.prototype,"provenanceSourceTypeValues",void 0),Y=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.DataModel")],Y);let X=class extends v.o{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"capabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsSearch",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"supportedQueryFormats",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"allowGeometryUpdates",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"searchMaxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"serviceCapabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"maxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"copyrightText",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"units",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],X.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"currentVersion",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"dateFieldsTimeReference",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"serviceItemId",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsDocuments",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"dataEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"schemaEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsProvenance",void 0),X=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.ServiceDefinition")],X);let ee=class extends v.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function te(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function re(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function ne(e,t,r,n=!1){const o=new r.ClientDataFetchRequestEncoder;o.deleteLater();for(const a of e){const e=oe(a,t,r,n);o.add_client_data_fetch_request_parameter(e)}o.encode();const a=o.get_encoding_result();return te(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function oe(e,t,r,n){const o=new r.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new r.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const i=t.get(e);return i&&!n&&(a.v_tag={v_tag:i.version}),a}(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ee.prototype,"url",void 0),(0,u.Cg)([(0,h.MZ)({type:Y,json:{write:!0}})],ee.prototype,"dataModel",void 0),(0,u.Cg)([(0,h.MZ)({type:X,json:{write:!0}})],ee.prototype,"serviceDefinition",void 0),ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.KnowledgeGraph")],ee);var ae=r(45724),ie=r(48526),se=r(86738),de=r(39829),le=r(82799);const pe={exclude:0,include:1};function ue(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}function ce(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,ye(o,t));return r}function he(e,t){if(e instanceof ie.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(e=>{e.forEach(e=>{n[a]=e,a++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof se.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof le.A||e instanceof de.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof le.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof de.A&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,a=e.rings);let i=0,s=0;return a.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{n[s]=e,s++})}),o[i]=t,i++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);throw new i.A("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function ye(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof l.A)return he(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}return ce(e,t)}var ge=r(35448);function fe(e,t){if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(!("originId"in e)){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),r}if("originId"in e&&"destinationId"in e){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.A("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function we(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:ge.r5[e.fieldType]},r.geometry_type={value:e.geometryType?ge.bV[e.geometryType]:ge.bV.esriGeometryNull},r.has_m=e.hasM??!1,r.has_z=e.hasZ??!1,r.nullable=e.nullable??!1,r.editable=e.editable,r.required=e.required,r.default_visibility=e.defaultVisibility,r.system_maintained=e.systemMaintained??!1,r.role={value:ge.ti[e.role]},r.default_value=be(e.defaultValue,t),r}function me(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function _e(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:ge.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=we(n,t);r.add_property(e)}return r}function ve(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function be(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof l.A?he(e,t):null}let Ce=class extends c.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"decoderError",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"resultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"results",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"updatedKnowledgeGraph",void 0),Ce=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],Ce);const Ae=Ce;let Ge=class extends Ae{constructor(e){super(e)}};Ge=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Ge);const Me=Ge;let xe=class extends Ae{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResults",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResults",void 0),xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],xe);const Te=xe;let Pe=class extends Ae{constructor(e){super(e)}};Pe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Pe);const ke=Pe;let Se=class extends Ae{constructor(e){super(e)}};Se=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],Se);const Re=Se;let je=class extends Ae{constructor(e){super(e)}};je=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],je);const Ie=je;let De=class extends Ae{constructor(e){super(e)}};De=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],De);const Ze=De;let Ee=class extends Ae{constructor(e){super(e)}};Ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Ee);const Fe=Ee;let Ne=class extends Ae{constructor(e){super(e)}};Ne=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ne);const qe=Ne;let $e=class extends Ae{constructor(e){super(e)}};$e=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],$e);const Oe=$e;function Le(e,t){const r=[];for(let n=0;n<t;n++){const t=e.get_result_at(n);r.push({name:t.get_name(),error:re(t.get_error())})}return r}function Ue(e){const t=e.get_results_count(),r=e.get_entity_type_add_results_count(),n=e.get_relationship_type_add_results_count(),o=new Te({resultsCount:t,results:Le(e,t),decoderError:re(e.error),entityAddResultsCount:r,relationshipAddResultsCount:n});for(let t=0;t<r;t++){const r=e.get_entity_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.entityAddResults.push({name:n,error:re(a)})}for(let t=0;t<n;t++){const r=e.get_relationship_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.relationshipAddResults.push({name:n,error:re(a)})}return o}function ze(e){const t=e.get_results_count();return new Fe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Je(e){const t=e.get_results_count();return new Ie({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ke(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ve(e){const t=e.get_results_count();return new Ze({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Qe(e){const t=e.get_results_count();return new qe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Be(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function He(e){const t=e.get_results_count();return new Me({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function We(e){const t=e.get_results_count();return new Re({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}var Ye=r(93637);let Xe=class extends c.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"supportedCategory",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"analyzers",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"searchProperties",void 0),Xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SearchIndex")],Xe);let et=!1;function tt(e){return e.deleteLater(),new B(nt(e))}function rt(e){return e.deleteLater(),new K({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:dt(e.fields)})}function nt(e){return{name:e.name,alias:e.alias,role:(0,Ye.i7)(ge.Eq,e.role.value),strict:e.strict,properties:lt(e.properties),fieldIndexes:pt(e.field_indexes)}}function ot(e){return e.deleteLater(),new V({alias:e.alias,name:e.name,fieldType:(0,Ye.i7)(ge.r5,e.field_type.value)??void 0,geometryType:(0,Ye.i7)(ge.bV,e.geometry_type.value)??null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:(0,Ye.i7)(ge.ti,e.role.value),defaultValue:e.default_value})}function at(e){e.deleteLater();const t=nt(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new H(Object.assign({endPoints:r},t))}function it(e){return new W({behavior:e.behavior,value:e.value})}function st(e){const t=[];for(let r=0;r<e.size();r++)t.push(tt(e.get(r)));return e.delete(),t}function dt(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function lt(e){const t=[];for(let r=0;r<e.size();r++){const n=ot(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(et=!0),t.push(n)}return e.delete(),t}function pt(e){const t=[];for(let r=0;r<e.size();r++)t.push(rt(e.get(r)));return e.delete(),t}function ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(at(e.get(r)));return e.delete(),t}function ct(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(it(n))}return e.delete(),t}function ht(e){const t=[];for(let r=0;r<e.size();r++){const n=new Xe,o=e.get(r);n.name=o.name,n.supportedCategory=(0,Ye.i7)(ge.nP,o.supported_category.value);const a=o.analyzers.size();for(let e=0;e<a;e++)n.analyzers.push({name:o.analyzers.get(e).name});o.analyzers.delete();for(let e=0;e<o.search_properties.keys().size();e++){const t=o.search_properties.keys().get(e),r=o.search_properties.get(t),a=[];for(let e=0;e<r.property_names.size();e++)a.push(r.property_names.get(e));n.searchProperties.set(t,{propertyNames:a})}t.push(n)}return e.delete(),t}var yt=r(25927),gt=(r(77901),r(40662)),ft=r(42095),wt=r(23150);function mt(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=_t(e,r),{coords:o,geometry_type:a,lengths:s}=e;if(a.value!==t)throw new i.A("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");let d=0;return s.forEach(e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=o[d],d++;t.push(e)}r.paths.push(t)}),r}function _t(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}const vt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function bt(e,t,r){return((e,t,r)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case 1:return function(e,t){const r={spatialReference:t};let n=2;_t(e,r);const o=e.coords;return r.x=o[0],r.y=o[1],e.has_z&&(r.z=o[n],n++),e.has_m&&(r.m=o[n]),new se.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=_t(e,r),o=e.lengths,a=e.coords,i=o[0];r.points=[];let s=0;for(let e=0;e<i;e++){const e=[];for(let t=0;t<n;t++)e[t]=a[s],s++;r.points.push(e)}return new ie.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,3);return new le.A({paths:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,4);return new de.A({rings:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 5:case 7:return vt().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return vt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return vt().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case 0:return function(e,t,r){return new gt.A(At(e,t,r))}(e,t,r);case 1:return Ct(e,t,r);case 2:return Gt(e,t,r);case 3:return function(e,t,r){const n=e.entity_count(),o=e.relationship_count(),a=[];for(let i=0;i<n;i++)a.push(Ct(e.get_entity_at(i),t,r)),i<o&&a.push(Gt(e.get_relationship_at(i),t,r));return new ft.A({path:a})}(e,t,r);case 4:return function(e,t,r){const n=[],o=e.count();for(let a=0;a<o;a++){const o=e.get_value_at(a);n.push(bt(o,t,r))}return n}(e,t,r);default:return vt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function Ct(e,t,r){const n=e.type_name,o=At(e,t,r),a=e.get_id();return new yt.A(Object.assign({typeName:n,id:a},o))}function At(e,t,r){const n={},o=e.key_count();for(let a=0;a<o;a++)n[e.get_key_at(a)]=bt(e.get_value_at(a),t,r);return{properties:n}}function Gt(e,t,r){const n=e.type_name,o=At(e,t,r);return new wt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function Mt(e){const t=[];for(let r=0;r<e.get_header_keys().size();r++)t.push(e.get_header_keys().get(r));const r=new p.A(e.get_out_sr());return new U({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit()})}let xt=class extends c.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};(0,u.Cg)([(0,h.MZ)()],xt.prototype,"hasError",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"error",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"editResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeRelationshipDeleteResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeProvenanceDeleteResults",void 0),xt=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],xt);const Tt=xt;function Pt(e){const t=e.has_error(),r=new Tt({hasError:t,error:t?re(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t);n.deleteLater();const o=e.get_edit_results_type_name_at(t),a=[],i=[],s=[],d=n.get_add_results_count(),l=n.get_update_results_count(),p=n.get_delete_results_count();for(let e=0;e<d;e++){const t=n.get_add_result_at(e);t.deleteLater(),a.push({id:t.id,error:re(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);t.deleteLater(),i.push({id:t.id,error:re(t.error)})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);t.deleteLater(),s.push({id:t.id,error:re(t.error)})}r.editResults.push({typeName:o,adds:a,updates:i,deletes:s})}const o=e.get_cascaded_rel_deletes_count();for(let t=0;t<o;t++){const n=e.get_cascaded_rel_deletes_at(t);n.deleteLater();const o=e.get_cascaded_rel_deletes_type_name_at(t),a=[];for(let e=0;e<n.get_count();e++){const t=n.get_result_at(e);t.deleteLater(),a.push({id:t.id,originId:t.origin_id,destinationId:t.dest_id,error:re(t.error)})}r.cascadeRelationshipDeleteResults.push({typeName:o,cascadeRelationshipDeletes:a})}if(e.has_cascading_provenance_deletes()){const t=e.get_cascading_provenance_deletes();t.deleteLater();const n=t.get_count();for(let e=0;e<n;e++){const n=t.get_result_at(e);n.deleteLater(),r.cascadeProvenanceDeleteResults.push({id:n.id,error:re(n.error)})}}return r}const kt=new Map,St=()=>new Map(kt.entries()),Rt={fetchKnowledgeGraph:async e=>{const t=new ee({url:e}),r=[];return r.push(Bt(t)),r.push(Ht(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await cr(e)},refreshServiceDefinition:async e=>{const t=(await(0,a.A)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new X(t),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await rr(`${n}${a}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await nr(`${n}${a}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(s.data.results.length<1)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",s);let d;for(const e of s.data.results)if("out_results_string"===e.paramName){d=e.value;break}if(!d)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",s);return d},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await or(e);const o=await ir(n,r);if(!e.serviceDefinition?.supportsProvenance&&"include"===t.provenanceBehavior)throw new i.A("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");o.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,o]of Object.entries(e.bindParameters))ar(t,o,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await Bt(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.A("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r),e.provenanceBehavior&&function(e,t){t.provenance_behavior={value:pe[e]}}(e.provenanceBehavior,n);try{n.encode()}catch(e){throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t,e);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new i.A("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await or(e);const o=await ir(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await Bt(t),!t.dataModel)throw new i.A("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,ae.I)(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,a=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());a.deleteLater(),a.cascade_delete=n,a.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=a.add_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new i.A("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=a.add_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),a.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=a.get_encoding_result();return te(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(s.get_byte_buffer())}(t,e),async function(e){return sr(e,(await(0,ae.I)()).GraphApplyEditsDecoder,Pt)}(await tr(o.data.url,o.data))},executeAddNamedTypes:async(e,t,r)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new i.A("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphNamedObjectTypeAddsRequestEncoder;r.deleteLater(),e.newEntityTypes?.forEach(e=>{r.add_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),_e(e,t,r)}(e,t))}),e.newRelationshipTypes?.forEach(e=>{r.add_relationship_type(function(e,t){const r=new t.RelationshipType;r.deleteLater();for(const n of e.endPoints){const e=new t.EndPoint;e.deleteLater(),e.origin_entity_type=n.originEntityType,e.dest_entity_type=n.destinationEntityType,r.add_end_point(e)}return _e(e,t,r)}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeAddsResponseDecoder,Ue)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeDeleteNamedType:async(e,t,r)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await or(e);const o=await ir(n,r);o.data.body="";const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Je)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeUpdateNamedType:async(e,t,r,n)=>{if(!t&&!Object.keys(r).length)throw new i.A("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t,r){const n=await(0,ae.I)(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;if(o.deleteLater(),r.entityTypes.some(e=>e.name===t))o.update_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),ve(e,r)}(e,n));else{if(!r.relationshipTypes.some(e=>e.name===t))throw new i.A("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(function(e,t){const r=new t.RelationshipType;return r.deleteLater(),ve(e,r)}(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(e){throw new i.A("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:e})}const a=o.get_encoding_result();return te(a.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(a.get_byte_buffer())}(r,t,e.dataModel);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeUpdateResponseDecoder,ze)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeAddGraphProperties:async(e,t,r,n)=>{if(!t&&!r.length)throw new i.A("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(we(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyAddsResponseDecoder,Ke)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphProperty:async(e,t,r,n)=>{if(!t&&!r)throw new i.A("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyDeleteResponseDecoder,Ve)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateGraphProperty:async(e,t,r,n,o)=>{if(!t&&!r&&!Object.keys(n).length)throw new i.A("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await or(e);const s=await ir(a,o);s.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(function(e,t){const r=new t.GraphProperty;return r.deleteLater(),e.hasOwnProperty("alias")&&(r.alias=e.alias),e.hasOwnProperty("editable")&&(r.editable=e.editable),e.hasOwnProperty("required")&&(r.required=e.required),e.hasOwnProperty("defaultVisibility")&&(r.default_visibility=e.defaultVisibility),e.hasOwnProperty("defaultValue")&&(r.default_value=be(e.defaultValue,t)),r}(t,r)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue");try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}(r,n);const d=await tr(s.data.url,s.data),l=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyUpdateResponseDecoder,Qe)}(d);return l.updatedKnowledgeGraph=await Qt(e.url),l},executeAddGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphIndexAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_field_index(function(e,t){const r=new t.FieldIndex;r.deleteLater(),r.name=e.name,r.unique=e.unique,r.ascending=e.ascending,r.description=e.description??"";for(const t of e.fieldNames)r.add_field(t);return r}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexAddsResponseDecoder,He)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexDeleteResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateSearchIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(r.addSearchProperties??{}).length&&!Object.keys(r.removeSearchProperties??{}).length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,me(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,me(t.removeSearchProperties,r));try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}(t,r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphUpdateSearchIndexResponseDecoder,Be)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,o=await(0,a.A)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=o.getHeader?.("content-type"),d=o.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:o.data})},executeSearch:async(e,t,r)=>{const n="provenance"===t.typeCategoryFilter?"metaEntityProvenance":t.typeCategoryFilter,o=`${e.url}/graph/search`,s=await(0,a.A)(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),d=s.getHeader?.("content-type"),l=s.data;if(d?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphSearchRequestEncoder;r.deleteLater(),r.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(r.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(ue(e.idsFilter,t))}catch(e){throw new i.A("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach(e=>{r.add_named_type_filter(e)});try{r.encode()}catch(e){throw new i.A("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const o=r.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,r={ignoreCache:!1})=>{if(!t.length)return new Map;let n=kt.get(e.url||"");n||(n=new Map,kt.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const s=await(0,ae.I)(),d=ne(t,n,s,r.ignoreCache),l=await ir(a,r.requestOptions);l.data.body=d;const p=await tr(l.data.url,l.data),u=p.headers.get("content-type");if(u?.includes("application/x-protobuf")){const e=new s.ClientDataFetchResponseDecoder;e.deleteLater();const t=await p.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&te(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e,t,r,n=!1){const o=new Map;for(let a=0;a<e.get_results_count();a++){const i=e.get_result_at(a);if(2!==i.get_fetch_result_case().value||0!==i.error().error_code){const e=i.get_key().key_string;r.has(e)&&t.delete(e);continue}const s=i.get_value(),d=i.get_key().key_string,l=r.get(d);let p;if(2===s.get_data_case().value&&l)p=l.value;else{if(1!==s.get_data_case().value)continue;{p=s.get_data().client_data_string;const e=i.get_value().get_v_tag().v_tag;n||t.set(d,{key:d,version:e,value:p})}}o.set(d,p)}return o}(e,n,o,r.ignoreCache)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:u,data:p})},fetchAllClientDataKeys:async(e,t)=>{const r=`${e.url}/clientData`,n=await(0,a.A)(r,{responseType:"array-buffer",query:{f:"pbf"},signal:t?.signal,timeout:t?.timeout}),o=n.getHeader?.("content-type"),s=n.data;if(o?.includes("application/x-protobuf")){const e=new((await(0,ae.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&te(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e){const t=e.get_keys(),r=new Array;for(let e=0;e<t.get_keys_count();e++){const n=t.get_key_at(e);1===n.get_client_data_key_type().value&&r.push(n.key_string)}return r}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>kt.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,n)=>async function(e,t,r,n){return r=w.from(r||{}),async function(e,t,r,n,o){const i={},s={},d=[];return function(e,t,r){for(const n in e){const o=e[n];if(o&&"object"==typeof o&&o instanceof T.A){const{features:e}=o;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,m.el)(d).then(d=>{const{outSpatialReference:l,processExtent:p,processSpatialReference:u,returnColumnName:c,returnFeatureCollection:h,returnM:y,returnZ:g}=r,{path:f}=(0,C.Dl)(e);for(const e in i){const[t,r]=i[e];s[e]=d.slice(t,r)}const w=l?l.wkid||l:null,m=u?u.wkid||u:null,_="execute"===t?{returnColumnName:c||void 0,returnFeatureCollection:h||void 0,returnM:y||void 0,returnZ:g||void 0}:null,v=F({...p?{context:{extent:p,outSR:w,processSR:m}}:{"env:outSR":w,"env:processSR":m},...n,..._,f:"json"},null,s),b={...o,query:v};return(0,a.A)(`${f}/${t}`,b)})}(e,"submitJob",r,t??{},n).then(({data:t})=>{const r=L.fromJSON(t);return r.sourceUrl=e,r})}(e,t,r,n),_esriRequestWrapper:async(e,t)=>(0,a.A)(e,t)};async function jt(e,t,r){return Rt.executeApplyEdits(e,t,r)}async function It(e,t,r){return Rt.executeAddNamedTypes(e,t,r)}async function Dt(e,t,r){return Rt.executeDeleteNamedType(e,t,r)}async function Zt(e,t,r,n){return Rt.executeUpdateNamedType(e,t,r,n)}async function Et(e,t,r,n){return Rt.executeAddGraphProperties(e,t,r,n)}async function Ft(e,t,r,n){return Rt.executeDeleteGraphProperty(e,t,r,n)}async function Nt(e,t,r,n,o){return Rt.executeUpdateGraphProperty(e,t,r,n,o)}async function qt(e,t,r,n){return Rt.executeAddGraphFieldIndex(e,t,r,n)}async function $t(e,t,r,n){return Rt.executeDeleteGraphFieldIndex(e,t,r,n)}async function Ot(e,t,r,n){return Rt.executeUpdateSearchIndex(e,t,r,n)}async function Lt(e,t,r){return Rt.executeQuery(e,t,r)}async function Ut(e,t,r){return Rt.executeQueryStreaming(e,t,r)}async function zt(e,t,r){return Rt.executeSearch(e,t,r)}async function Jt(e,t,r){return Rt.executeSearchStreaming(e,t,r)}function Kt(e,t){return Rt.fetchAllClientDataKeys(e,t)}function Vt(e,t,r){return Rt.fetchClientDataAtKeys(e,t,r)}async function Qt(e){return Rt.fetchKnowledgeGraph(e)}async function Bt(e){return Rt.refreshDataModel(e)}async function Ht(e){return Rt.refreshServiceDefinition(e)}async function Wt(e,t){return Rt.executeFindPathsAsynchronous(e,t)}async function Yt(e,t){return Rt.executeFindPaths(e,t)}async function Xt(e,t){return Rt.fetchAsynchronousFindPathsResultData(e,t)}function er(){return Rt.clearClientDataCache()}async function tr(e,t){return Rt._fetchWrapper(e,t)}async function rr(e,t,r,n){return Rt._submitJobWrapper(e,t,r,n)}async function nr(e,t){return Rt._esriRequestWrapper(e,t)}async function or(e){const t=o.id?.findCredential(e.url);t||(e.dataModel?await cr(e):await Bt(e))}function ar(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof l.A?r.set_param_key_value(e,he(t,n)):Array.isArray(t)?r.set_param_key_value(e,ue(t,n)):r.set_param_key_value(e,ce(t,n))}async function ir(e,t){return(0,a.A)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}async function sr(e,t,r){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const n=await e.arrayBuffer(),o=new t;try{return o.decode(new Uint8Array(n)),r(o)}finally{o.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}let dr=50;function lr(e){dr=e}function pr({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:r,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const a=[];let s,d,l=0;const u=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??Mt(e),d=s.outSpatialReference??new p.A({wkid:4326})),l||(l=e.get_header_keys().size());const t=new Array(l);for(let n=0;n<l;n++){const o=e.get_value(n);t[n]=bt(o,r,d)}if(a.push(t),o&&Date.now()-u>dr){c=!1;break}}if(e.has_error())throw new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:a,parsedAllResultsFromBuffer:c}}async function ur(e,t){const r=e.headers.get("content-type");if(e.headers.get("content-length")&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),r?.includes("application/x-protobuf")){const r=e.body?.getReader(),n=new((await(0,ae.I)()).GraphQueryDecoder);let o,a,l;n.deleteLater();const p=new Promise((e,t)=>{a=e,l=t});let u=!1,c=null;const h=new ReadableStream({pull:async function e(p){if(!r){const e=new i.A("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw l(e),e}const{done:h,value:y}=c?{done:!1,value:null}:await r.read().catch(e=>{throw l(e),r.releaseLock(),e});y&&(c=y);try{if(h){let e;if(n.has_error()?e=new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:n.error.error_code,errorMessage:n.error.error_message}):u||a(new U),r.releaseLock(),e)throw p.error(e),l(e),e;return void p.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=pr({wasmQueryDecoder:n,newArrayBufferToParse:y,dataModel:t,decodedHeader:o,limitMaxProcessingTime:!0});return g&&(c=null),!o&&s&&(o=s,a(s),u=!0),d.length>0?void p.enqueue(d):await e(p)}catch(e){throw s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(e),l(e),r.releaseLock(),(0,d.zf)(e)?e:new i.A("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:e})}}});return{readableStream:h,resultHeader:await p}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function cr(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,a.A)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),o=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,ae.I)()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!e)throw new i.A("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){e.deleteLater(),et=!1;const t=new Y({timestamp:e.timestamp,spatialReference:new p.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,Ye.i7)(ge.vy,e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value),databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:(0,Ye.i7)(ge.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:ht(e.search_indexes),entityTypes:st(e.entity_types),relationshipTypes:ut(e.relationship_types),metaEntityTypes:st(e.meta_entity_types),provenanceSourceTypeValues:ct(e.provenance_source_type_values.value_behavior_array)});return et&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("A big integer field was detected in the retrieved data model. The `big-integer` field type is not fully supported in web clients. Please see https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type"),t}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});var s=i(97768),r=i(74887),n=i(9775),o=i(32587),l=i(76030),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,this._queue=new n.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&!this.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,n=(0,r.Tw)(),o=t?(0,r.u7)(t,()=>s.abort()):null,l=(0,r.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),n.reject((0,r.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,n),this._controllers.set(e,s),n.promise.then(a,a),this._queue.push(e),this._scheduleNext(),n.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency&&!this.sharedConcurrency.full;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s),this.sharedConcurrency.current.value+=1;try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,r.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),v=i(20223),w=i(87045),b=i(76353),I=i(77301),R=i(70834);const S=new Map,C=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const r=s[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const r=s[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const r=s[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function T(e,t,i,s,r=null){const n=S.get(e);if(!n)return void(null==t&&C.putBlock(e,i,s,r));if(null==t||null==n[t])return void C.putBlock(e,i,s,r);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:r};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:w.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,b.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const r=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,r.size[0],r.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r;let{transposedVariableName:l}=t;const a=null!=o&&n&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=r,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(m);if(!r.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&r.hasMultidimensionalTranspose;if((0,b.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=r,n=3,o=s.x*n/2,l=s.y*n/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,n,n,u),{pixelBlock:d}=await this.fetchPixels(a,n,n,u);if(null==h)return{location:m,value:null};const f=Math.floor(n*n*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:v,rowOffset:w,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,v,t);if(!k?.pixels?.length)return{location:m,value:null};const M=w*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:r}=this;if(s.requestRawData&&r)return this._fetchPixels(e,t,i,s);const n=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),h=u-Math.round((n/2-a)/(c-a)*t);let d=0;const f=[];for(let r=0;r<=o;r++){const m=new p.A({xmin:0===r?a:-n/2,xmax:r===o?c-n*r:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===r?u-h:r===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&r>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,s),{nativeExtent:n,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=r;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const r=s.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(n.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(r){const t=(r[e].x+r[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new w.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:r,height:n,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new v.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<r.length;s++){const{x:n,y:o}=r[s];l.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=s**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,s){const{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,r,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,r,n){const[o,l]=n,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,r=m.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:r});const{extent:n,storageInfo:o}=e;if(o){o.origin=new f.A({x:n.xmin,y:n.ymax,spatialReference:r});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let r=(0,R.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=n;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(r=(0,R.OM)(n.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:r},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,v=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:b}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:b}=e[o-1]);else{const e=t**o;w*=e,b*=e}}const I=d.spatialReference,S=new f.A({x:w,y:b,spatialReference:I}),C=_===c&&v===u&&h.x%_===0&&h.y%v===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&v===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),v=Math.floor((a+u+m-1)/o),w=Math.floor((c+h+m-1)/l),b=n[e];if(!b)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=b;if(0===d&&(w<I||v<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=w;t++)for(let i=x;i<=v;i++){let r=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(r=i-g-y),t>=I&&r>=R&&C>=t&&S>=r){const i=this._fetchRawTile(e,t,r,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(w-_+1)*l,width:(v-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:r.x+x*o*B,xmax:r.x+(v+1)*o*B,ymin:r.y-(w+1)*l*D,ymax:r.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!s.transposedVariableName;if(!n){const s=r.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:o,maxCol:l,maxRow:a}=s;if(t<n||i<o||t>a||i>l)return Promise.resolve(null)}const o=n?s.transposeVariableName:s.sliceId,l=r.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const n=new AbortController,o=s.bandIds?.slice();if(o?.length&&r.isBsqTile){const r=new Set(o),l=[],a=Array.from(r);for(const r of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[r]}},{signal:n.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:n.signal});T(c,s.registryId,u,h,n),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[r,n]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([r[e],n[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const r={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(r.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=r,c=o/t,u=l/i,h=a<n&&c*u>=16,d=a===n&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/s;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+s)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,n);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,b.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map(e=>e[s]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(62788),r=i(95488);class n{constructor(e){this._observable=new r.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),r=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=[];if(t){const n=s(e,i);for(let e=0;e<n.length;e++)s(n[e],t).forEach(e=>r.push(e));return r}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)r.push(n[e]||n.item(e));return r}function r(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=s(e,i);return n.length>0?t?r(n[0],t):n[0]:null}function n(e,t=null){const i=t?r(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),r=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&r.push(n));return r}function l(e,t=null){const i=n(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=n(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>r,g7:()=>u,mX:()=>n,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>r});var s=i(19419);class r{constructor(e,t,i,r=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),r=i(49186),n=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:r,rasterIds:n}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===r.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&r.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=r.map(r=>r.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const v=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==v||(_=await(0,c.$Q)(_,e,v)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(e=>e.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(n);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new r.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:r,extent:n}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&r.equals(a)&&n.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let n=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);n=(0,h.uk)(n,t.spatialReference),t=r.execute(n,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>v});var s,r=i(31635),n=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:n=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,n),size:[r,r],spatialReference:n})}const a=(0,m.Vp)(n),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),u=1/(39.37*(0,l.GA)(n)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(n)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,r=i*u;h.push(new y.A({level:s,scale:i,resolution:r})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[r,r],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],r=t[s+1];if(i<=e)return s;if(r===e)return s+1;if(i>e&&r<e)return s+Math.log(i/e)/Math.log(i/r)}return s}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,o=e.y,s=i}const l=r.resolution*this.size[0],a=r.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,n=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,r=s*this.size[0],n=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+r,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const s=e+t,{scale:r,resolution:n}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:r,resolution:n}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,r.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,r.Cg)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,r.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,r.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,r.Cg)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,r.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,r.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,r.Cg)([(0,h.$)("esri.layers.support.TileInfo")],v)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),v=i(22796),w=i(87045),b=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,b.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");r=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,r,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,r),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,r=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,o=(0,T.m7)(s,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const r=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:r,symbolizer:this.symbolizer},i);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,b.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return w.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const n=this.getTileUrl(e,t,i);return(0,r.A)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const r=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,r);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const r=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(r.pixelBlock=r.pixelBlock?.extractBands(s.bandIds)),r}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new n.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},r=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(r)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const r=this.multidimensionalSubset?.areaOfInterest;if(r&&!r.contains(e))throw new n.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,b.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some(e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,b.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,b.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:r}=t;if("multipoint"===r)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=n/(o+(2===r.paths[0].length?1:0))),r=s.execute(t,l,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const n=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/n),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const r=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(r))&&f.push(r)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,r=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=r?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),n=t.statistics,o=n&&n.length>0?n[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const n=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:n,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,b.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",v.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,b.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const r=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),n=new I.A({rasterFunction:r});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:r}=this,{bandCount:n}=this.raster.rasterInfo,o=r?.length?r.some(e=>e>=n):n>=3;r&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),r=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:r})];const n=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:r,attributes:l});n.push(a)}),n}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:v.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),n=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends n.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,r.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,r.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>c,SharedConcurrency:()=>h});var s=i(97768),r=i(74887),n=i(9775),o=i(32587),l=i(76030),a=i(44794);class c{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.process=e.process,this.concurrency=e.concurrency,this.sharedConcurrency=e.sharedConcurrency??d,this._queue=new n.A(e.peeker)}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&!this.full}get full(){return this._processingItems.size>=this.concurrency||this.sharedConcurrency.full}abort(e){const t=this._controllers.get(e);t?.abort()}clear(){this._queue.clear();const e=Array.from(this._controllers.values());this._controllers.clear(),e.forEach(e=>e.abort()),this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((t,i)=>e(i))}_get(e){const t=this._deferreds.get(e);return t?.promise}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this._get(e);if(i)return i;const s=new AbortController,n=(0,r.Tw)(),o=t?(0,r.u7)(t,()=>s.abort()):null,l=(0,r.NY)(s.signal,()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),a(),n.reject((0,r.NK)())}),a=()=>{l.remove(),o?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()};return this._deferreds.set(e,n),this._controllers.set(e,s),n.promise.then(a,a),this._queue.push(e),this._scheduleNext(),n.promise}last(){return this._queue.last()}reset(){const e=Array.from(this._processingItems.values());this.sharedConcurrency.current.value-=this._processingItems.size,this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.has(e)&&(this._processingItems.delete(e),this.sharedConcurrency.current.value-=1)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)(()=>{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency&&!this.sharedConcurrency.full;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new u(e,i);this._processingItems.set(e,s),this.sharedConcurrency.current.value+=1;try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,r.$X)(t)?(s.promise=t,t.then(e=>this._processResult(s,e),e=>this._processError(s,e))):this._processResult(s,t)}}class u{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class h{constructor(e){this.limit=e,this.current=(0,a.v)(0)}get full(){return this.current.value>=this.limit}}const d=new h(1/0)},4916:(e,t,i)=>{i.d(t,{A:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),d=(i(44208),i(87811),i(64108)),p=i(5443),f=i(86738),m=i(16930),g=i(60694),y=i(10873),x=i(45617),_=i(91806),v=i(20223),w=i(87045),b=i(76353),I=i(77301),R=i(70834);const S=new Map,C=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()},this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?C.decreaseRefCount(e,i):0;if(null==t||null==s[t])return C.decreaseRefCount(e,i);const r=s[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function M(e,t,i){const s=S.get(e);if(!s)return null==t?C.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return C.getBlock(e,i)}const r=s[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const r=s[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function T(e,t,i,s,r=null){const n=S.get(e);if(!n)return void(null==t&&C.putBlock(e,i,s,r));if(null==t||null==n[t])return void C.putBlock(e,i,s,r);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:r};s.then(()=>o.isResolved=!0).catch(()=>o.isRejected=!0),n[t]?.cache.set(i,o)}function A(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):C.deleteBlock(e,i):null==t&&C.deleteBlock(e,i)}var z=i(16019),F=i(77649),P=i(28435),B=i(14636);let D=0,N=class extends o.o{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:w.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,R.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,b.qg)(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+D++}set url(e){this._set("url",(0,g.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,R.Hh)().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,i,s={}){const r=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,r);if(!o)throw new n.A("imagery-tile:out-of-bounds","Level for fetch tile out of range");return s={noClip:!0,...s},this.fetchPixels(o,r.size[0],r.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:o}=r;let{transposedVariableName:l}=t;const a=null!=o&&n&&(null!=s||(0,I.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=r,{datumTransformation:d}=t;let m=(0,R._I)(e,c,d);if(!u.intersects(m))return{location:m,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(m);if(!r.nativeExtent.intersects(e))return{location:e,value:null};m=e}let g=0;const y=null!=l&&null!=o&&r.hasMultidimensionalTranspose;if((0,b.qg)(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(m,t);const{pixelSize:s}=r,n=3,o=s.x*n/2,l=s.y*n/2,a=new p.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:h}=await e.fetchPixels(a,n,n,u),{pixelBlock:d}=await this.fetchPixels(a,n,n,u);if(null==h)return{location:m,value:null};const f=Math.floor(n*n*.5),g=!h.mask||h.mask[f]?h.pixels.map(e=>e[f]):null;let x;return null!=d&&(x=!d.mask||d.mask[f]?d.pixels.map(e=>e[f]):void 0),{location:m,value:g,processedValue:x,pyramidLevel:0}}if(!y)if(t.srcResolution)g=(0,R.t$)(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(g=await this.computeBestPyramidLevelForLocation(e,t),null==g)return{location:m,value:null};const x=this.identifyPixelLocation(m,g,null,y);if(null===x)return{location:m,value:null};const{row:_,col:v,rowOffset:w,colOffset:S,blockWidth:C}=x,k=await this._fetchRawTile(g,_,v,t);if(!k?.pixels?.length)return{location:m,value:null};const M=w*C+S;return this._processIdentifyResult(k,{srcLocation:m,position:M,pyramidLevel:g,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,R.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:r}=this;if(s.requestRawData&&r)return this._fetchPixels(e,t,i,s);const n=(0,R.FT)(e.spatialReference),o=(0,R.OM)(e);if(null==n||0===o||1===o&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),h=u-Math.round((n/2-a)/(c-a)*t);let d=0;const f=[];for(let r=0;r<=o;r++){const m=new p.A({xmin:0===r?a:-n/2,xmax:r===o?c-n*r:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),g=0===r?u-h:r===o?t-d:u;d+=g,f.push(g);const y=s.disableWrapAround&&r>0?null:this._fetchPixels(m,g,i,s);l.push(y)}const m=(await Promise.all(l)).map(e=>e?.pixelBlock);let g=null;const y={width:t,height:i};return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,P.z7)(m,y,{blockWidths:f}),{extent:e,srcExtent:(0,R._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:g}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,s),{nativeExtent:n,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new p.A({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:d,mosaicSize:f}=r;if(1===d.length&&null!=d[0]&&d[0].width===i.width&&d[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:f,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,P.z7)(d,f,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new n.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,R._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,F.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:n,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await(0,r.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,I.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const r=s.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,s.origin,s.spatialReference,s.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(n.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(r){const t=(r[e].x+r[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new w.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:r,height:n,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new v.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,r,n=0,o=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=o,t*=o,r.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<r.length;s++){const{x:n,y:o}=r[s];l.push({minCol:Math.floor((e.xmin-a+.1*n)/t/n),maxCol:Math.floor((e.xmax-a-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=s**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,s){const{spatialReference:r,nativeExtent:n,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,d=(0,R._I)(e,r,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:f,y:m}=p,g=(a.y-d.y)/m/h,y=(d.x-a.x)/f/u,x=Math.min(h-1,Math.floor((g-Math.floor(g))*h)),_=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:d}}getTileExtent(e,t,i,s,r,n){const[o,l]=n,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new p.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,r=m.A.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new p.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:r});const{extent:n,storageInfo:o}=e;if(o){o.origin=new f.A({x:n.xmin,y:n.ymax,spatialReference:r});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,s={}){let r=(0,R.OM)(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=n;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:d}=this,p=d.transform,m="gcs-shift"===p?.type,g=null!=(0,R.FT)(e.spatialReference);!m&&g||(r=(0,R.OM)(n.srcExtent,m));const y=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:r},s);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const x=d.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,v=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:w,y:b}=d.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:w,y:b}=e[o-1]);else{const e=t**o;w*=e,b*=e}}const I=d.spatialReference,S=new f.A({x:w,y:b,spatialReference:I}),C=_===c&&v===u&&h.x%_===0&&h.y%v===0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(I),T=I.isGeographic?1e-9:1e-4,{datumTransformation:A}=s;if(!M&&C&&1===y.pixelBlocks.length&&_===t&&v===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,T))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:y.pixelBlocks[0]};const z=g&&null!=(0,R.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,F=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");F&&!this.rasterJobHandler&&await(0,R.Hh)();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k.toJSON(),datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:F},s):(0,R.l0)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:k,datumTransformation:A,rasterTransform:p,hasWrapAround:r>0||z,isAdaptive:!1,includeGCSGrid:F});let N;const J=!s.requestRawData,O={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,y.extent.xmin):void 0,{pixelBlocks:E,mosaicSize:L,isPartiallyFilled:q}=y;let Z=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:E,srcMosaicSize:L,destDimension:J?{width:t,height:i}:null,coefs:J?D.coefficients:null,sampleSpacing:J?O:null,projectDirections:F,gcsGrid:F?D.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:H,blockWidths:null},s);({pixelBlock:N,localNorthDirections:Z}=e)}else{const e=(0,P.z7)(E,L,{alignmentInfo:H});N=J?(0,P.$i)(e,{width:t,height:i},D.coefficients,O,s.interpolation):e,F&&D.gcsGrid&&(Z=(0,P.QF)({width:t,height:i},D.gcsGrid),N=(0,B.Y2)(N,this.rasterInfo.dataType,Z))}return s.requestRawData||F?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N,transformGrid:D,localNorthDirections:Z,isPartiallyFilled:q}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:N}}async _fetchRawTiles(e,t,i,s){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:d}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,g=0,y=0;d&&null!=f&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=f),g*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),v=Math.floor((a+u+m-1)/o),w=Math.floor((c+h+m-1)/l),b=n[e];if(!b)return null;const{minRow:I,minCol:R,maxCol:S,maxRow:C}=b;if(0===d&&(w<I||v<R||_>C||x>S))return null;const k=new Array;let M=!1;const T=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=w;t++)for(let i=x;i<=v;i++){let r=i;if(!s.disableWrapAround&&d&&null!=f&&g<=i&&(r=i-g-y),t>=I&&r>=R&&C>=t&&S>=r){const i=this._fetchRawTile(e,t,r,s);T?k.push(new Promise(e=>{i.then(t=>e(t)).catch(()=>{M=!0,e(null)})})):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const A=await Promise.all(k),z={height:(w-_+1)*l,width:(v-x+1)*o},{spatialReference:F}=this.rasterInfo,P=this.getPyramidPixelSize(e),{x:B,y:D}=P;return{extent:new p.A({xmin:r.x+x*o*B,xmax:r.x+(v+1)*o*B,ymin:r.y-(w+1)*l*D,ymax:r.y-_*l*D,spatialReference:F}),pixelBlocks:A,mosaicSize:z,isPartiallyFilled:M}}_fetchRawTile(e,t,i,s){const{storageInfo:r}=this.rasterInfo,n=null!=r.transposeInfo&&!!s.transposedVariableName;if(!n){const s=r.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:o,maxCol:l,maxRow:a}=s;if(t<n||i<o||t>a||i>l)return Promise.resolve(null)}const o=n?s.transposeVariableName:s.sliceId,l=r.isBsqTile?s.bandIds:null,c=function(e,t,i){const s=[];return null!=t&&s.push(`sliceId=${t}`),null!=i&&s.push(`bandIds=${i.join(",")}`),s.length?`${e}?${s.join("&")}`:e}(this.rasterId,o,l),u=`${e}/${t}/${i}`;let h=M(c,s.registryId,u);if(null==h){const n=new AbortController,o=s.bandIds?.slice();if(o?.length&&r.isBsqTile){const r=new Set(o),l=[],a=Array.from(r);for(const r of o)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...s,bandIds:[r]}},{signal:n.signal}));h=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==o.length){const t=[];for(const i of o){let s=e[a.indexOf(i)];t.includes(s)&&(s=s.clone()),t.push(s)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):(0,P.Wy)(e)})}else h=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:s},{signal:n.signal});T(c,s.registryId,u,h,n),h.catch(()=>A(c,s.registryId,u))}return s.signal&&(0,a.u7)(s,()=>{k(c,s.registryId,u)}),h}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[r,n]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,B.Lu)([r[e],n[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,R.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const r={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(r.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=r,c=o/t,u=l/i,h=a<n&&c*u>=16,d=a===n&&this._requireTooManySrcTiles(o,l,t,i);if(h||d||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,R.Wo)(o,this.rasterInfo.spatialReference,e,r.datumTransformation);const d=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&d){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:r}=this.rasterInfo.storageInfo,n=e/i,o=t/s;return Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1])>=256*Math.max(1,(i+s)/1024)||n>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,R.t$)(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,R._l)(e,s,n);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{origin:h}=i.storageInfo,{width:d,height:p,ul:f}=(0,b.$g)(c,h,l,o);t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=d,t.srcHeight=p,t.ul=f}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:r,useTransposedTile:n}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map(e=>e[s]),n={location:i,value:t,pyramidLevel:r},o=this._computeMagDirValues(t.map(e=>[e]));return o?.length&&(n.magdirValue=o.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(s*o,s*o+o)),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let d=(0,I.QW)(l,h.transposedVariableName);if(u){const e=(0,I.xx)(d,h.multidimensionalDefinition,h.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),d=e.map(e=>d[e])}const p=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=p&&((0,z.Sp)(f,p),m=f.mask),{location:i,value:null,dataSeries:d.map((e,t)=>{const i={value:0===m?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new x.A({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};(0,s.Cg)([(0,u.MZ)()],N.prototype,"_rasterTileAlignmentInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_tileFetchQueue",void 0),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_isGlobalWrappableSource",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s.Cg)([(0,u.MZ)()],N.prototype,"_openPromise",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterJobHandler",null),(0,s.Cg)([(0,u.MZ)({readOnly:!0})],N.prototype,"rasterId",null),(0,s.Cg)([(0,u.MZ)(y.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetName",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],N.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"rasterInfo",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,u.MZ)()],N.prototype,"sourceJSON",void 0),N=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.BaseRaster")],N)},32587:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(62788),r=i(95488);class n{constructor(e){this._observable=new r.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach((i,s)=>e.call(t,i,s,this),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),r=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=[];if(t){const n=s(e,i);for(let e=0;e<n.length;e++)s(n[e],t).forEach(e=>r.push(e));return r}const n=e.getElementsByTagNameNS("*",i);if(!n||0===n.length)return[];for(let e=0;e<n.length;e++)r.push(n[e]||n.item(e));return r}function r(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=s(e,i);return n.length>0?t?r(n[0],t):n[0]:null}function n(e,t=null){const i=t?r(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),r=[];let n;for(let e=0;e<i.length;e++)n=i[e].textContent||i[e].nodeValue,n&&(n=n.trim(),""!==n&&r.push(n));return r}function l(e,t=null){const i=n(e,t);return i?.split(" ").map(e=>Number(e))??[]}function a(e,t){return o(e,t).map(e=>Number(e))}function c(e,t){const i=n(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>r,g7:()=>u,mX:()=>n,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>r});var s=i(19419);class r{constructor(e,t,i,r=(0,s.vt)()){this._level=e,this._row=t,this._col=i,this.extent=r}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new r(e.level,e.row,e.col,e.extent)}}},84169:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(31635),r=i(49186),n=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),d=i(22671);let p=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:r,rasterIds:n}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===r.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o}),s.requestRawData&&r.length>1&&!this.hasUniqueSourceStorageInfo&&(o=!1,s={...s,requestRawData:!1});const h=r.map(r=>r.fetchPixels(e,t,i,s)),d=await Promise.all(h),p=d.map(e=>e.pixelBlock),f=o||s.requestRawData?d.map(e=>e.srcTilePixelSize):null;if(s.skipRasterFunction||p.every(e=>null==e))return d[0];const m=d.find(e=>null!=e.pixelBlock)?.extent??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:f,primaryRasterIds:n});const{transformGrid:y}=d[0];if(!o||null==g||null==y){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return!s.noClip&&null!=g&&e&&(g=await(0,c.$Q)(g,m,e)),{...d[0],pixelBlock:g}}const x={rows:y.spacing[0],cols:y.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:t,height:i},coefs:y.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(g,{width:t,height:i},y.coefficients,x,l);const v=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||null==_||null==v||(_=await(0,c.$Q)(_,e,v)),{extent:e,srcExtent:d[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(e=>e.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,n=i.map(t=>t.rasterInfo?void 0:t.open(e));await Promise.all(n);const o=i.map(({rasterInfo:e})=>e),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new r.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=d.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:r,extent:n}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&r.equals(a)&&n.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel&&i.firstPyramidLevel===o.firstPyramidLevel&&i.pyramidBlockWidth===o.pyramidBlockWidth&&i.pyramidBlockHeight===o.pyramidBlockHeight&&i.pyramidScalingFactor===o.pyramidScalingFactor}(e,c)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let n=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);n=(0,h.uk)(n,t.spatialReference),t=r.execute(n,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],p.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"tileType",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"primaryRasters",void 0),p=(0,s.Cg)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],p)},87045:(e,t,i)=>{i.d(t,{A:()=>v});var s,r=i(31635),n=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(64108),d=i(43937),p=i(86738),f=i(16930),m=i(21325),g=i(28735),y=i(91806),x=i(72802);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:n=f.A.WebMercator,numLODs:o=24}=e;if(!(0,m.fn)(n)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new y.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new y.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new p.A(0,0,n),size:[r,r],spatialReference:n})}const a=(0,m.Vp)(n),c=e.origin?new p.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):new p.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),u=1/(39.37*(0,l.GA)(n)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new y.A({level:e,scale:t,resolution:s}))}else{let e=(0,m.EA)(n)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);h.push(new y.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,r=i*u;h.push(new y.A({level:s,scale:i,resolution:r})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[r,r],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return p.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],r=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,r[e.level]=e})),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],r=t[s+1];if(i<=e)return s;if(r===e)return s+1;if(i>e&&r<e)return s+Math.log(i/e)/Math.log(i/r)}return s}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if("number"==typeof t)n=t,o=i;else if((0,m.aI)(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;n=e.x,o=e.y,s=i}const l=r.resolution*this.size[0],a=r.resolution*this.size[1];return s??=new x.U(0,0,0),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((n-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;const s=e.level-i.level,r=i.resolution*this.size[0]/2**s,n=i.resolution*this.size[1]/2**s;return e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,r=s*this.size[0],n=s*this.size[1];return e[0]=this.origin.x+t.col*r,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+r,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],r=this.lods.length-t;for(let e=0;e<r;e++){const s=e+t,{scale:r,resolution:n}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new y.A({level:e,scale:r,resolution:n}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,r.Cg)([(0,a.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,r.Cg)([(0,a.MZ)({type:p.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,r.Cg)([(0,u.w)("origin")],v.prototype,"readOrigin",null),(0,r.Cg)([(0,a.MZ)({type:[y.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,r.Cg)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,r.Cg)([(0,u.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,r.Cg)([(0,d.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],v.prototype,"writeSize",null),(0,r.Cg)([(0,a.MZ)({type:f.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=s=(0,r.Cg)([(0,h.$)("esri.layers.support.TileInfo")],v)},89015:(e,t,i)=>{i.d(t,{o:()=>N});var s=i(31635),r=i(43773),n=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(64108),d=i(86738),p=i(16930),f=i(21325),m=i(60694),g=i(10873),y=i(45617),x=i(43577),_=i(13868),v=i(22796),w=i(87045),b=i(76353),I=i(84169),R=i(77301),S=i(77359),C=i(6049),k=i(70834),M=i(6952),T=i(12711),A=i(85676),z=i(94359),F=i(22048),P=i(49410),B=i(34606),D=i(51508);const N=e=>{const t=e;let N=class extends t{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,b.qg)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,z.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(F.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");r=e}const l=e.pixelSize??new d.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,r,l),p=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new n.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(p.pixelBlock,c,r),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,M.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,R.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,r=(0,R.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,o=(0,T.m7)(s,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const r=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:r,symbolizer:this.symbolizer},i);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&(0,b.qg)(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return w.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(J(this),s.requestAsImageElement){const n=this.getTileUrl(e,t,i);return(0,r.A)(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const r=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,t,i,r);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const r=await this.raster.fetchPixels(e,t,i,s);return s.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(r.pixelBlock=r.pixelBlock?.extractBands(s.bandIds)),r}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(B.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new n.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},r=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(r)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new D.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&(!s.hasMultidimensionalTranspose||!(0,R.DY)(t.multidimensionalDefinition)&&!t.transposedVariableName)&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null};const r=this.multidimensionalSubset?.areaOfInterest;if(r&&!r.contains(e))throw new n.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=(0,b.qg)(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some(e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date((0,R.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,R.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,R.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,b.qg)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;J(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,b.qg)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:r}=t;if("multipoint"===r)return t.points.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=(await Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(4929)]).then(i.bind(i,23346))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=n/(o+(2===r.paths[0].length?1:0))),r=s.execute(t,l,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new d.A({x:e[0],y:e[1],spatialReference:s})))}const n=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/n),c=l.height/a,u=l.width/a,{xmin:h,ymax:p}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const r=new d.A({x:h+(i+.5)*a,y:p-(e+.5)*a,spatialReference:s});(o||t.contains(r))&&f.push(r)}return f}_configDefaultInterpolation(){if(null==this.interpolation){J(this);const{raster:e}=this,t=(0,T.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){J(this);const{rasterInfo:t}=this.raster,i=(0,R.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,r=(0,T.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=r?.bandIds??(0,T.ci)(t)),!this.renderer||"override"===e){const e=(0,T.Mm)(this.raster),i=r?.renderer??(0,T.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),n=t.statistics,o=n&&n.length>0?n[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const n=(0,T.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,T.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=l):this.symbolizer=new A.A({rendererJSON:n,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,T.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,b.qg)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",v.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,b.qg)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const r=(0,C.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),n=new I.A({rasterFunction:r});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:r}=this,{bandCount:n}=this.raster.rasterInfo,o=r?.length?r.some(e=>e>=n):n>=3;r&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),r=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new P.A({location:e.location,pixelValue:e.value,locationId:t,resolution:r})];const n=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new P.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:r,attributes:l});n.push(a)}),n}};function J(e){if(!e.raster||!e.serviceRasterInfo)throw new n.A("imagery-tile","no raster")}return(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_cachedRasterFunctionJson",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_compatibleFullExtent",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s.Cg)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],N.prototype,"bandIds",void 0),(0,s.Cg)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],N.prototype,"copyright",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1}})],N.prototype,"fullExtent",null),(0,s.Cg)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],N.prototype,"interpolation",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"ioConfig",void 0),(0,s.Cg)([(0,l.MZ)({type:[y.A],json:{write:!0}})],N.prototype,"multidimensionalDefinition",null),(0,s.Cg)([(0,l.MZ)({type:x.A,json:{write:!0}})],N.prototype,"multidimensionalSubset",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"raster",void 0),(0,s.Cg)([(0,l.MZ)({type:v.A})],N.prototype,"rasterFunction",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"serviceRasterInfo",void 0),(0,s.Cg)([(0,l.MZ)()],N.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0,type:p.A,json:{read:!1}})],N.prototype,"spatialReference",void 0),(0,s.Cg)([(0,l.MZ)({type:w.A})],N.prototype,"tileInfo",void 0),(0,s.Cg)([(0,l.MZ)(g.OZ)],N.prototype,"url",null),(0,s.Cg)([(0,l.MZ)()],N.prototype,"renderer",null),(0,s.Cg)([(0,l.MZ)({types:z.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:z.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],N.prototype,"internalRenderer",null),(0,s.Cg)([(0,u.w)("internalRenderer")],N.prototype,"readRenderer",null),(0,s.Cg)([(0,l.MZ)({clonable:!1})],N.prototype,"symbolizer",void 0),N=(0,s.Cg)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],N),N}},91806:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),n=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(64108));let c=class extends n.o{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,r.Cg)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,r.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,r.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,r.Cg)([(0,a.$)("esri.layers.support.LOD")],c)}}]);
|