@arcgis/core 4.34.0-next.55 → 4.34.0-next.57
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/WebScene.js +1 -1
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +4 -0
- package/analysis/VolumeMeasurement/{CutFillOptions.js → VolumeMeasurementCutFillOptions.js} +1 -1
- package/analysis/VolumeMeasurementAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02a31483e09652a1a1a2.js +1 -0
- package/assets/esri/core/workers/chunks/0390f3aa624e3f380ce2.js +1 -0
- package/assets/esri/core/workers/chunks/047d6f7b1677cc7ab271.js +1 -0
- package/assets/esri/core/workers/chunks/04e652df94790f5ca08a.js +1 -0
- package/assets/esri/core/workers/chunks/{9f178cf73c63caaea190.js → 06d2251d6f6b3e44800a.js} +1 -1
- package/assets/esri/core/workers/chunks/07d5e0633cc2f765037f.js +1 -0
- package/assets/esri/core/workers/chunks/{fe5c37c69da3ec1e56ac.js → 08393d9cc2ed846dd5b4.js} +1 -1
- package/assets/esri/core/workers/chunks/{18ceea59e469a0f2721b.js → 094c741fa8139c3f40cf.js} +1 -1
- package/assets/esri/core/workers/chunks/0d946a226b846b3c0849.js +1 -0
- package/assets/esri/core/workers/chunks/{6530449cd1975deb61f1.js → 184d3c88ac2fc1d7e2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/2ded2446700f89155ccd.js +1 -0
- package/assets/esri/core/workers/chunks/{19391d60c76a1dc7c262.js → 2f7e192ee2066f863e1d.js} +1 -1
- package/assets/esri/core/workers/chunks/{6b11476b2004b4db576e.js → 3445ffd752262673fb13.js} +1 -1
- package/assets/esri/core/workers/chunks/38f09e36e174792646bd.js +1 -0
- package/assets/esri/core/workers/chunks/43a56c8fa4e5be18c12a.js +1 -0
- package/assets/esri/core/workers/chunks/{65e1f5b20a585e04655a.js → 44dc7ec52c4abb700783.js} +1 -1
- package/assets/esri/core/workers/chunks/4558f2e3e77831758fdc.js +1 -0
- package/assets/esri/core/workers/chunks/4753793daf0b7ff8b5ff.js +1 -0
- package/assets/esri/core/workers/chunks/52917b753c5ceab0c1f7.js +353 -0
- package/assets/esri/core/workers/chunks/{6940bb6524938894a246.js → 53873f26a2c24cd75e4a.js} +1 -1
- package/assets/esri/core/workers/chunks/561a2078458bc0339f83.js +1 -0
- package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +1 -0
- package/assets/esri/core/workers/chunks/{d0bf1fc6e3c198bc565d.js → 57486b18421a3c9690d0.js} +1 -1
- package/assets/esri/core/workers/chunks/5f079be7f322768aef21.js +1 -0
- package/assets/esri/core/workers/chunks/61a294f9411bf884f2ab.js +1 -0
- package/assets/esri/core/workers/chunks/{ad93a2621f75270f06cb.js → 69fbe363bb130fdd8146.js} +1 -1
- package/assets/esri/core/workers/chunks/{722931d1a60be461e521.js → 70cf81ec5a901782d2db.js} +1 -1
- package/assets/esri/core/workers/chunks/{24ac204d8a045aa821be.js → 7388e8c905d93dea1c05.js} +1 -1
- package/assets/esri/core/workers/chunks/749c7159e0902388e828.js +1 -0
- package/assets/esri/core/workers/chunks/76ff7ccfe583927918f3.js +969 -0
- package/assets/esri/core/workers/chunks/{ae73ac81bd10614c2b53.js → 7714228825fb44d506df.js} +1 -1
- package/assets/esri/core/workers/chunks/{6130bc641aa7c1bcaaa8.js → 7c23be93d394f1bee941.js} +1 -1
- package/assets/esri/core/workers/chunks/7c86af4f60cea383ed96.js +1 -0
- package/assets/esri/core/workers/chunks/7eda1c400658b6a99be8.js +1 -0
- package/assets/esri/core/workers/chunks/{97ae2fdb6cb98249f5fa.js → 7f80bbbd0897082c1af3.js} +1 -1
- package/assets/esri/core/workers/chunks/80a69897fa3ce1eaa6e7.js +1 -0
- package/assets/esri/core/workers/chunks/80bd5988180f4618fd61.js +1 -0
- package/assets/esri/core/workers/chunks/{62ade6f18b375795ddfd.js → 8257352421f453a669e9.js} +1 -1
- package/assets/esri/core/workers/chunks/8762928d10c3821738ad.js +1 -0
- package/assets/esri/core/workers/chunks/88a5e7415f8858c454f7.js +1 -0
- package/assets/esri/core/workers/chunks/893e5eb5c028c4704317.js +1 -0
- package/assets/esri/core/workers/chunks/8ead467a5af0d9bba804.js +1 -0
- package/assets/esri/core/workers/chunks/91e04d03b0013bcaad82.js +1 -0
- package/assets/esri/core/workers/chunks/{c7d4c296011c5393bcaa.js → 9275313e0f1f521b2658.js} +1 -1
- package/assets/esri/core/workers/chunks/{e666ca4d14b6490485d6.js → 92b60d4fb09711919601.js} +1 -1
- package/assets/esri/core/workers/chunks/977582cb3c8f17a2cb4c.js +1 -0
- package/assets/esri/core/workers/chunks/{5c556468e2a598ab793a.js → 9940e59033a8a1eff2a9.js} +1 -1
- package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +1 -0
- package/assets/esri/core/workers/chunks/{9928e432b884c75c3436.js → 9d920f3488d59e7f276c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a778a72456fefdf40115.js → a249e56a0be8cef33ba8.js} +1 -1
- package/assets/esri/core/workers/chunks/a3ee76b7e46d3fba7cf7.js +1 -0
- package/assets/esri/core/workers/chunks/{2cda605c302176905e84.js → a96ac5c68d84122e7751.js} +1 -1
- package/assets/esri/core/workers/chunks/acf13a64df2991a4cb6b.js +1 -0
- package/assets/esri/core/workers/chunks/{7a8d740d1226719a578a.js → b457b7dd907f06278bee.js} +1 -1
- package/assets/esri/core/workers/chunks/b5640f9623a9c9ded92a.js +1 -0
- package/assets/esri/core/workers/chunks/bb67d491f62a5cce96cd.js +1 -0
- package/assets/esri/core/workers/chunks/{71acded1b3c0057917a1.js → bbdbb618a18542f7a4a2.js} +1 -1
- package/assets/esri/core/workers/chunks/bc9f54a6b577c43189fd.js +1 -0
- package/assets/esri/core/workers/chunks/{6fe738748ce837811ff4.js → bd4125d163f372a7e978.js} +1 -1
- package/assets/esri/core/workers/chunks/bead38898c3f4d4d3569.js +1 -0
- package/assets/esri/core/workers/chunks/{22334a464f798b5279b2.js → c80c032c5b7a11db177a.js} +1 -1
- package/assets/esri/core/workers/chunks/cc748d4f4adb9c584aa4.js +1 -0
- package/assets/esri/core/workers/chunks/cf699b9bb530b87be14c.js +1 -0
- package/assets/esri/core/workers/chunks/{5d331f7628514a572f82.js → d6ab4d55f1023ee6ec6a.js} +1 -1
- package/assets/esri/core/workers/chunks/d71836cf70b9604832f1.js +1 -0
- package/assets/esri/core/workers/chunks/{4874aabdb5c60ca66216.js → db2b8d8cf7131554cf7e.js} +1 -1
- package/assets/esri/core/workers/chunks/de4da985c398c8bcf2e7.js +1 -0
- package/assets/esri/core/workers/chunks/ef85cd0e82d59db8a26f.js +33 -0
- package/assets/esri/core/workers/chunks/fd1fdb97a294a1b7041d.js +1 -0
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/support/boundsUtils.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/curveUtils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/rotate.js +5 -0
- package/geometry/support/extentUtils.js +1 -1
- package/geometry/support/rotate.js +1 -1
- package/graphic/ImageryGraphicOrigin.js +5 -0
- package/graphic/ImageryTileGraphicOrigin.js +5 -0
- package/graphic/KMLGraphicOrigin.js +5 -0
- package/graphic/WCSGraphicOrigin.js +5 -0
- package/graphic/isImageryGraphicOrigin.js +5 -0
- package/graphic/isImageryTileGraphicOrigin.js +5 -0
- package/graphic/isKMLGraphicOrigin.js +5 -0
- package/graphic/isWCSGraphicOrigin.js +5 -0
- package/interfaces.d.ts +10 -10
- package/kernel.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/FeatureLayer.js +1 -1
- package/layers/GroundLayer.js +5 -0
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/KMLSublayer.js +1 -1
- package/layers/support/featureReductionUtils.js +1 -1
- package/layers/support/kmlUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/KMLLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
- package/views/3d/analysis/Viewshed/{ArrowManipulator.js → ViewshedArrowManipulator.js} +1 -1
- package/views/3d/analysis/Viewshed/{FieldOfViewManipulation.js → ViewshedFieldOfViewManipulation.js} +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +5 -0
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementComputation.js → VolumeMeasurementCutFillComputation.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementController.js → VolumeMeasurementCutFillController.js} +1 -1
- package/views/3d/analysis/VolumeMeasurement/{CutFillVolumeMeasurementVisualization.js → VolumeMeasurementCutFillVisualization.js} +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
- package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/MultipointDrawAction.js +1 -1
- package/views/draw/PointDrawAction.js +1 -1
- package/views/draw/PolygonDrawAction.js +1 -1
- package/views/draw/PolylineDrawAction.js +1 -1
- package/views/draw/SegmentDrawAction.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/drawUtils.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/AppendVertex.js +1 -1
- package/views/interactive/editGeometry/operations/RotateVertex.js +1 -1
- package/views/interactive/editGeometry/operations/curveOperationUtils.js +1 -1
- package/views/interactive/tooltip/infos/SelectedVertexTooltipInfo.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/compare.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/widgets/ElevationProfile/support/profileUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/analysis/VolumeMeasurement/CutFillOptions.d.ts +0 -4
- package/assets/esri/core/workers/chunks/01e8b9dc77a57d1c2a52.js +0 -1
- package/assets/esri/core/workers/chunks/027cfcde29fe87aa2ffe.js +0 -1
- package/assets/esri/core/workers/chunks/03ee4d63aa8de44958ab.js +0 -1
- package/assets/esri/core/workers/chunks/0445de3a8968c0734c91.js +0 -1
- package/assets/esri/core/workers/chunks/09268dc856c3d5ce178f.js +0 -1
- package/assets/esri/core/workers/chunks/0a6d33d013628f671aea.js +0 -1
- package/assets/esri/core/workers/chunks/17776d9d3558d45ea7b5.js +0 -1
- package/assets/esri/core/workers/chunks/1a2278b9fe9666342728.js +0 -1
- package/assets/esri/core/workers/chunks/1e01aaebdeffdfc0c6bd.js +0 -1
- package/assets/esri/core/workers/chunks/222f981e876f60ae282f.js +0 -1
- package/assets/esri/core/workers/chunks/252ee00fd6c4ae0ee7fa.js +0 -1
- package/assets/esri/core/workers/chunks/277941bec15525dbd3a0.js +0 -1
- package/assets/esri/core/workers/chunks/2cb14d040e67a261b31c.js +0 -1
- package/assets/esri/core/workers/chunks/31c088966ccfff2ea1db.js +0 -1
- package/assets/esri/core/workers/chunks/3245d20ea4bb779f87ef.js +0 -1
- package/assets/esri/core/workers/chunks/3800764932a1c32cb29f.js +0 -1
- package/assets/esri/core/workers/chunks/46a470bea2a3601182dc.js +0 -1
- package/assets/esri/core/workers/chunks/4f8dab492331c9a2d67a.js +0 -1
- package/assets/esri/core/workers/chunks/5900dde7a201a7d47469.js +0 -1
- package/assets/esri/core/workers/chunks/5b2ff220aebe464dac23.js +0 -1
- package/assets/esri/core/workers/chunks/6801b92bce7a918fda6f.js +0 -1
- package/assets/esri/core/workers/chunks/772e81e9162e2240a7a6.js +0 -1
- package/assets/esri/core/workers/chunks/7b560ac0be93c6aa9940.js +0 -1
- package/assets/esri/core/workers/chunks/7bdfc7c7ce1d94c00745.js +0 -353
- package/assets/esri/core/workers/chunks/83737d86584bf1b32368.js +0 -1
- package/assets/esri/core/workers/chunks/854bfda25bb406814929.js +0 -1
- package/assets/esri/core/workers/chunks/87f68c2b9361bd3f8cac.js +0 -1
- package/assets/esri/core/workers/chunks/8c81156b1605a16acc29.js +0 -1
- package/assets/esri/core/workers/chunks/8f6ff09e7d2f01b79faf.js +0 -1
- package/assets/esri/core/workers/chunks/97a38d700f2cb8807d51.js +0 -1
- package/assets/esri/core/workers/chunks/9e9be7f6ea32957f1088.js +0 -33
- package/assets/esri/core/workers/chunks/cbec768cd98caff212f2.js +0 -1
- package/assets/esri/core/workers/chunks/d1842745a7699879a1e1.js +0 -1
- package/assets/esri/core/workers/chunks/d81c4afad4abe2d1d0b9.js +0 -1
- package/assets/esri/core/workers/chunks/de499e33035b56b6697d.js +0 -1
- package/assets/esri/core/workers/chunks/dfb12f42b8d319ffa5fc.js +0 -1
- package/assets/esri/core/workers/chunks/e04951ee32f041faaeca.js +0 -1
- package/assets/esri/core/workers/chunks/e10c5405f956b2cc59e4.js +0 -1
- package/assets/esri/core/workers/chunks/ead1acf95c3385630da8.js +0 -1001
- package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +0 -1
- package/assets/esri/core/workers/chunks/f4d7cbd33ef8710d7316.js +0 -1
- package/views/3d/analysis/Viewshed/ScaleOrientManipulation.js +0 -5
- package/views/3d/analysis/Viewshed/ViewshedAnalysisVisualization.js +0 -5
- package/views/3d/interactive/visualElements/ViewshedShapeVisualElement.js +0 -5
|
@@ -1 +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:()=>ar,_esriRequestWrapper:()=>or,_fetchWrapper:()=>rr,_getClientDataCacheCopy:()=>jt,_setMaxQueryParsingDurationForTesting:()=>pr,_submitJobWrapper:()=>nr,clearClientDataCache:()=>tr,clientDataCache:()=>kt,executeAddGraphFieldIndex:()=>$t,executeAddGraphProperties:()=>Ft,executeAddNamedTypes:()=>Dt,executeApplyEdits:()=>It,executeDeleteGraphFieldIndex:()=>qt,executeDeleteGraphProperty:()=>Ot,executeDeleteNamedType:()=>Zt,executeFindPaths:()=>Xt,executeFindPathsAsynchronous:()=>Yt,executeQuery:()=>Lt,executeQueryStreaming:()=>zt,executeSearch:()=>Jt,executeSearchStreaming:()=>Kt,executeUpdateGraphProperty:()=>Nt,executeUpdateNamedType:()=>Et,executeUpdateSearchIndex:()=>Ut,fetchAllClientDataKeys:()=>Vt,fetchAsynchronousFindPathsResultData:()=>er,fetchClientDataAtKeys:()=>Qt,fetchKnowledgeGraph:()=>Bt,kgRestServices:()=>Rt,refreshDataModel:()=>Ht,refreshServiceDefinition:()=>Wt});var n,o=r(70333),a=r(78888),i=r(49186),s=r(53966),d=r(74887),l=r(34275),p=r(91075),u=r(16930),c=r(31635),h=r(65008),y=r(10107),g=r(56507),f=(r(44208),r(87811),r(40608)),w=r(5443);let m=n=class extends h.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,g.PZ)(n,e)}};(0,c.Cg)([(0,y.MZ)({type:u.A})],m.prototype,"outSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:w.A})],m.prototype,"processExtent",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A})],m.prototype,"processSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnColumnName",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnFeatureCollection",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnM",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnZ",void 0),m=n=(0,c.Cg)([(0,f.$)("esri.rest.geoprocessor.GPOptions")],m);var _=r(17136),v=r(20437),b=r(25482);let C=class extends b.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,c.Cg)([(0,y.MZ)({type:w.A})],C.prototype,"extent",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"height",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"href",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"opacity",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"rotation",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"scale",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"visible",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"width",void 0),C=(0,c.Cg)([(0,f.$)("esri.layers.support.MapImage")],C);var A=r(2272),G=r(93223),M=r(2073);let x=class extends b.o{constructor(e){super(e),this.area=0,this.units=null}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],x.prototype,"area",void 0),(0,c.Cg)([(0,G.e)(M.UO)],x.prototype,"units",void 0),x=(0,c.Cg)([(0,f.$)("esri.rest.support.ArealUnit")],x);let T=class extends b.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,c.Cg)([(0,y.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],T.prototype,"itemId",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],T.prototype,"url",void 0),T=(0,c.Cg)([(0,f.$)("esri.rest.support.DataFile")],T);var P=r(22671);let S=class extends b.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],S.prototype,"distance",void 0),(0,c.Cg)([(0,G.e)(M.Y8)],S.prototype,"units",void 0),S=(0,c.Cg)([(0,f.$)("esri.rest.support.LinearUnit")],S);var k=r(66552);const j="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":`${j}areal-unit`,"GPMultiValue:GPBoolean":`${j}boolean`,"GPMultiValue:GPComposite":`${j}composite`,"GPMultiValue:GPDataFile":`${j}data-file`,"GPMultiValue:GPDate":`${j}date`,"GPMultiValue:GPDouble":`${j}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${j}feature-record-set-layer`,"GPMultiValue:Field":`${j}field`,"GPMultiValue:GPLinearUnit":`${j}linear-unit`,"GPMultiValue:GPLong":`${j}long`,"GPMultiValue:GPRasterData":`${j}raster-data`,"GPMultiValue:GPRasterDataLayer":`${j}raster-data-layer`,"GPMultiValue:GPRecordSet":`${j}record-set`,"GPMultiValue:GPString":`${j}string`});let I=class extends b.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,c.Cg)([(0,G.e)(R,{ignoreUnknown:!1})],I.prototype,"dataType",void 0),(0,c.Cg)([(0,y.MZ)()],I.prototype,"paramName",void 0),(0,c.Cg)([(0,y.MZ)()],I.prototype,"value",void 0),I=(0,c.Cg)([(0,f.$)("esri.rest.support.ParameterValue")],I);var D=r(36005);let Z=class extends b.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 E(e,t){switch(e){case"areal-unit":return x.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 T.fromJSON(t);case"linear-unit":return S.fromJSON(t);case"feature-record-set-layer":if("url"in t)return T.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(6131),r.e(8219),r.e(8096),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(4111),r.e(8506),r.e(9784),r.e(3516)]).then(r.bind(r,29784))).default),{layerDefinition:n,featureSet:o}=t;return e.read({layerDefinition:n,featureSet:o},{origin:"portal-item"}),e.spatialReference=u.A.fromJSON(o.spatialReference??n.spatialReference??n.extent.spatialReference),e}return P.A.fromJSON(t);case"record-set":return"url"in t?T.fromJSON(t):P.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?C.fromJSON(t.mapImage):Z.fromJSON(t);case"field":return v.A.fromJSON(t)}}async function F(e){const t=R.fromJSON(e.dataType),{paramName:r}=e,n=function(e){return e.startsWith(j)}(t)?await async function(e,t){const r=function(e){return e.replace(j,"")}(e),n="composite"===r?t.map(e=>E(R.fromJSON(e.dataType),e.value)):t.map(e=>E(r,e));return Promise.all(n)}(t,e.value):await E(t,e.value);return new I({dataType:t,paramName:r,value:n})}function O(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>O({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,A.lF)(e,t,r)}(0,c.Cg)([(0,y.MZ)()],Z.prototype,"format",void 0),(0,c.Cg)([(0,y.MZ)({json:{name:"itemID",write:!0}})],Z.prototype,"itemId",void 0),(0,c.Cg)([(0,y.MZ)()],Z.prototype,"type",void 0),(0,c.Cg)([(0,D.w)("type")],Z.prototype,"readType",null),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],Z.prototype,"url",void 0),Z=(0,c.Cg)([(0,f.$)("esri.rest.support.RasterData")],Z);var N,$=r(37807);const q=(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}),U=1e3;let L=class extends b.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,A.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,U);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,U)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,A.Dl)(this.sourceUrl),r={...this.requestOptions,...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=m.from(t||{});const{returnColumnName:n,returnFeatureCollection:o,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,A.Dl)(this.sourceUrl),p=O({returnColumnName:n||null,returnFeatureCollection:o||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json"},null),u={...this.requestOptions,...r,query:p},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:h}=await(0,a.A)(c,u);return F(h)}async fetchResultImage(e,t,r){const{path:n}=(0,A.Dl)(this.sourceUrl),o=O({...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 F(d)}async fetchResultMapImageLayer(){const{path:e}=(0,A.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(6131),r.e(8219),r.e(8096),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(4111),r.e(364),r.e(3249),r.e(7656),r.e(8407)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=U,signal:r,statusCallback:n}=e;return new Promise((e,o)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),o((0,d.NK)())}),this.clearJobCompletionTimer();const a=()=>{this._jobCompletionTimer||o((0,d.NK)()),this.checkJobStatus().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(a,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":o(this);break;default:this._jobCompletionTimer=setTimeout(a,t)}}).catch(e=>{o(e)})};this._jobCompletionTimer=setTimeout(a,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,c.Cg)([(0,y.MZ)()],L.prototype,"jobId",void 0),(0,c.Cg)([(0,G.e)(q,{ignoreUnknown:!1})],L.prototype,"jobStatus",void 0),(0,c.Cg)([(0,y.MZ)({type:[$.A]})],L.prototype,"messages",void 0),(0,c.Cg)([(0,y.MZ)()],L.prototype,"progress",void 0),(0,c.Cg)([(0,y.MZ)()],L.prototype,"requestOptions",void 0),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],L.prototype,"sourceUrl",void 0),L=N=(0,c.Cg)([(0,f.$)("esri.rest.support.JobInfo")],L);let z=class extends h.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};(0,c.Cg)([(0,y.MZ)()],z.prototype,"headerKeys",void 0),(0,c.Cg)([(0,y.MZ)()],z.prototype,"outSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)()],z.prototype,"exceededTransferLimit",void 0),z=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],z);let J=class extends h.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new z}};(0,c.Cg)([(0,y.MZ)()],J.prototype,"resultRows",void 0),(0,c.Cg)([(0,y.MZ)()],J.prototype,"resultHeader",void 0),J=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryResult")],J);let K=class extends h.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new z}};(0,c.Cg)([(0,y.MZ)()],K.prototype,"resultRowsStream",void 0),(0,c.Cg)([(0,y.MZ)()],K.prototype,"resultHeader",void 0),K=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],K);let V=class extends b.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],V.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"unique",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"ascending",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],V.prototype,"description",void 0),(0,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],V.prototype,"fieldNames",void 0),V=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.FieldIndex")],V);let Q=class extends b.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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"alias",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"fieldType",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"geometryType",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"hasM",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"hasZ",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"nullable",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"editable",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"required",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"defaultVisibility",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"systemMaintained",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"role",void 0),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],Q.prototype,"defaultValue",void 0),Q=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphProperty")],Q);let B=class extends b.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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"alias",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"role",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],B.prototype,"strict",void 0),(0,c.Cg)([(0,y.MZ)({type:[Q],json:{write:!0}})],B.prototype,"properties",void 0),(0,c.Cg)([(0,y.MZ)({type:[V],json:{write:!0}})],B.prototype,"fieldIndexes",void 0),B=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphObjectType")],B);let H=class extends B{constructor(e){super(e),this.type="entity"}};H=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.EntityType")],H);let W=class extends B{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],W.prototype,"endPoints",void 0),W=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.RelationshipType")],W);let Y=class extends b.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"value",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"behavior",void 0),Y=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],Y);let X=class extends b.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,c.Cg)([(0,y.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],X.prototype,"timestamp",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],X.prototype,"spatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"strict",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],X.prototype,"objectIdField",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],X.prototype,"globalIdField",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"arcgisManaged",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"identifierInfo",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"searchIndexes",void 0),(0,c.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],X.prototype,"entityTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[W],json:{write:!0}})],X.prototype,"relationshipTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],X.prototype,"metaEntityTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[Y],json:{write:!0}})],X.prototype,"provenanceSourceTypeValues",void 0),X=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.DataModel")],X);let ee=class extends b.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,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ee.prototype,"capabilities",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsSearch",void 0),(0,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ee.prototype,"supportedQueryFormats",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"allowGeometryUpdates",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"searchMaxRecordCount",void 0),(0,c.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ee.prototype,"serviceCapabilities",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"maxRecordCount",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"description",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"copyrightText",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"units",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],ee.prototype,"spatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"currentVersion",void 0),(0,c.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ee.prototype,"dateFieldsTimeReference",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"serviceItemId",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsDocuments",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"dataEditingNotSupported",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"schemaEditingNotSupported",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsProvenance",void 0),ee=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.ServiceDefinition")],ee);let te=class extends b.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function re(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function ne(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function oe(e,t,r,n=!1){const o=new r.ClientDataFetchRequestEncoder;o.deleteLater();for(const a of e){const e=ae(a,t,r,n);o.add_client_data_fetch_request_parameter(e)}o.encode();const a=o.get_encoding_result();return re(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function ae(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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"url",void 0),(0,c.Cg)([(0,y.MZ)({type:X,json:{write:!0}})],te.prototype,"dataModel",void 0),(0,c.Cg)([(0,y.MZ)({type:ee,json:{write:!0}})],te.prototype,"serviceDefinition",void 0),te=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.KnowledgeGraph")],te);var ie=r(45724),se=r(48526),de=r(86738),le=r(39829),pe=r(82799);const ue={exclude:0,include:1};function ce(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ge(e,t))}),r}function he(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,ge(o,t));return r}function ye(e,t){if(e instanceof se.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 de.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 pe.A||e instanceof le.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 pe.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof le.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 ge(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof p.A)return ye(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ge(e,t))}),r}return he(e,t)}var fe=r(35448);function we(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,Ce(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,Ce(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 me(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:fe.r5[e.fieldType]},r.geometry_type={value:e.geometryType?fe.bV[e.geometryType]:fe.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:fe.ti[e.role]},r.default_value=Ce(e.defaultValue,t),r}function _e(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function ve(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:fe.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=me(n,t);r.add_property(e)}return r}function be(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function Ce(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof p.A?ye(e,t):null}let Ae=class extends h.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"decoderError",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"resultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"results",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"updatedKnowledgeGraph",void 0),Ae=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],Ae);const Ge=Ae;let Me=class extends Ge{constructor(e){super(e)}};Me=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Me);const xe=Me;let Te=class extends Ge{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,c.Cg)([(0,y.MZ)()],Te.prototype,"entityAddResultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"relationshipAddResultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"entityAddResults",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"relationshipAddResults",void 0),Te=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],Te);const Pe=Te;let Se=class extends Ge{constructor(e){super(e)}};Se=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Se);const ke=Se;let je=class extends Ge{constructor(e){super(e)}};je=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],je);const Re=je;let Ie=class extends Ge{constructor(e){super(e)}};Ie=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],Ie);const De=Ie;let Ze=class extends Ge{constructor(e){super(e)}};Ze=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],Ze);const Ee=Ze;let Fe=class extends Ge{constructor(e){super(e)}};Fe=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Fe);const Oe=Fe;let Ne=class extends Ge{constructor(e){super(e)}};Ne=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ne);const $e=Ne;let qe=class extends Ge{constructor(e){super(e)}};qe=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],qe);const Ue=qe;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:ne(t.get_error())})}return r}function ze(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 Pe({resultsCount:t,results:Le(e,t),decoderError:ne(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:ne(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:ne(a)})}return o}function Je(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ke(e){const t=e.get_results_count();return new De({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ve(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Qe(e){const t=e.get_results_count();return new Ee({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Be(e){const t=e.get_results_count();return new $e({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function He(e){const t=e.get_results_count();return new Ue({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function We(e){const t=e.get_results_count();return new xe({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ye(e){const t=e.get_results_count();return new Re({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}var Xe=r(93637);let et=class extends h.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,c.Cg)([(0,y.MZ)()],et.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"supportedCategory",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"analyzers",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"searchProperties",void 0),et=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.SearchIndex")],et);let tt=!1;function rt(e){return e.deleteLater(),new H(ot(e))}function nt(e){return e.deleteLater(),new V({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:lt(e.fields)})}function ot(e){return{name:e.name,alias:e.alias,role:(0,Xe.i7)(fe.Eq,e.role.value),strict:e.strict,properties:pt(e.properties),fieldIndexes:ut(e.field_indexes)}}function at(e){return e.deleteLater(),new Q({alias:e.alias,name:e.name,fieldType:(0,Xe.i7)(fe.r5,e.field_type.value)??void 0,geometryType:(0,Xe.i7)(fe.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,Xe.i7)(fe.ti,e.role.value),defaultValue:e.default_value})}function it(e){e.deleteLater();const t=ot(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 W(Object.assign({endPoints:r},t))}function st(e){return new Y({behavior:e.behavior,value:e.value})}function dt(e){const t=[];for(let r=0;r<e.size();r++)t.push(rt(e.get(r)));return e.delete(),t}function lt(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function pt(e){const t=[];for(let r=0;r<e.size();r++){const n=at(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(tt=!0),t.push(n)}return e.delete(),t}function ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(nt(e.get(r)));return e.delete(),t}function ct(e){const t=[];for(let r=0;r<e.size();r++)t.push(it(e.get(r)));return e.delete(),t}function ht(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(st(n))}return e.delete(),t}function yt(e){const t=[];for(let r=0;r<e.size();r++){const n=new et,o=e.get(r);n.name=o.name,n.supportedCategory=(0,Xe.i7)(fe.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 gt=r(25927),ft=(r(77901),r(40662)),wt=r(42095),mt=r(23150);function _t(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=vt(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 vt(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 bt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function Ct(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;vt(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 de.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=vt(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 se.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:o}=_t(e,3);return new pe.A({paths:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:o}=_t(e,4);return new le.A({rings:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 5:case 7:return bt().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 bt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return bt().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 ft.A(Gt(e,t,r))}(e,t,r);case 1:return At(e,t,r);case 2:return Mt(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(At(e.get_entity_at(i),t,r)),i<o&&a.push(Mt(e.get_relationship_at(i),t,r));return new wt.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(Ct(o,t,r))}return n}(e,t,r);default:return bt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function At(e,t,r){const n=e.type_name,o=Gt(e,t,r),a=e.get_id();return new gt.A(Object.assign({typeName:n,id:a},o))}function Gt(e,t,r){const n={},o=e.key_count();for(let a=0;a<o;a++)n[e.get_key_at(a)]=Ct(e.get_value_at(a),t,r);return{properties:n}}function Mt(e,t,r){const n=e.type_name,o=Gt(e,t,r);return new mt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function xt(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 u.A(e.get_out_sr());return new z({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit()})}let Tt=class extends h.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[]}};(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"hasError",void 0),(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"error",void 0),(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"editResults",void 0),Tt=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],Tt);const Pt=Tt;function St(e){const t=e.has_error(),r=new Pt({hasError:t,error:t?ne(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t),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);a.push({id:t.id,error:ne(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);i.push({id:t.id,error:ne(t.error)})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);s.push({id:t.id,error:ne(t.error)})}r.editResults.push({typeName:o,adds:a,updates:i,deletes:s})}return r}const kt=new Map,jt=()=>new Map(kt.entries()),Rt={fetchKnowledgeGraph:async e=>{const t=new te({url:e}),r=[];return r.push(Ht(t)),r.push(Wt(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await hr(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 ee(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 or(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await nr(`${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 or(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await or(`${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 ar(e);const o=await sr(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,ie.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))ir(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 Ht(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:ue[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(0,l.OO)(structuredClone(o.get_byte_buffer()))}(t,e);const a=await rr(o.data.url,o.data);if(e.dataModel){const t=await cr(a,e.dataModel);return new K({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 ar(e);const o=await sr(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await Ht(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,ie.I)(),n=!!e.options?.cascadeDelete,o=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());o.deleteLater(),o.cascade_delete=n;try{let t;e.entityAdds?.forEach(e=>{t=o.add_entity(we(e,r)),re(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=o.add_relationship(we(e,r)),re(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=o.update_entity(we(e,r)),re(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=o.update_relationship(we(e,r)),re(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=o.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=o.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),o.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const a=o.get_encoding_result();return re(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),(0,l.OO)(structuredClone(a.get_byte_buffer()))}(t,e),async function(e){return dr(e,(await(0,ie.I)()).GraphApplyEditsDecoder,St)}(await rr(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 ar(e);const o=await sr(n,r);o.data.body=await async function(e){const t=await(0,ie.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(),ve(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 ve(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 re(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(t);const a=await rr(o.data.url,o.data),s=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeAddsResponseDecoder,ze)}(a);return s.updatedKnowledgeGraph=await Bt(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 ar(e);const o=await sr(n,r);o.data.body="";const a=await rr(o.data.url,o.data),s=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Ke)}(a);return s.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e,t,r){const n=await(0,ie.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(),be(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(),be(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 re(a.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),(0,l.OO)(structuredClone(a.get_byte_buffer()))}(r,t,e.dataModel);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeUpdateResponseDecoder,Je)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=await(0,ie.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(me(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 re(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyAddsResponseDecoder,Ve)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=new((await(0,ie.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 re(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),(0,l.OO)(structuredClone(r.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyDeleteResponseDecoder,Qe)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const s=await sr(a,o);s.data.body=await async function(e,t){const r=await(0,ie.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=Ce(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 re(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),(0,l.OO)(structuredClone(o.get_byte_buffer()))}(r,n);const d=await rr(s.data.url,s.data),p=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyUpdateResponseDecoder,Be)}(d);return p.updatedKnowledgeGraph=await Bt(e.url),p},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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=await(0,ie.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 re(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphIndexAddsResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=new((await(0,ie.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 re(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),(0,l.OO)(structuredClone(r.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphIndexDeleteResponseDecoder,Ye)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e,t){const r=await(0,ie.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,_e(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,_e(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 re(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),(0,l.OO)(structuredClone(o.get_byte_buffer()))}(t,r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphUpdateSearchIndexResponseDecoder,He)}(s);return d.updatedKnowledgeGraph=await Bt(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,ie.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=ur({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new J({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=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,ie.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=ur({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new J({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 ar(e);const o=await sr(n,r);o.data.body=await async function(e){const t=await(0,ie.I)(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!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(ce(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 n=r.get_encoding_result();if(0!==n.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return(0,l.OO)(structuredClone(n.get_byte_buffer()))}(t);const a=await rr(o.data.url,o.data);if(e.dataModel){const t=await cr(a,e.dataModel);return new K({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,ie.I)(),d=oe(t,n,s,r.ignoreCache),l=await sr(a,r.requestOptions);l.data.body=d;const p=await rr(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()&&re(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,ie.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&re(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=m.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 P.A){const{features:e}=o;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,_.el)(d).then(d=>{const{outSpatialReference:l,processExtent:p,processSpatialReference:u,returnColumnName:c,returnFeatureCollection:h,returnM:y,returnZ:g}=r,{path:f}=(0,A.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=O({...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 It(e,t,r){return Rt.executeApplyEdits(e,t,r)}async function Dt(e,t,r){return Rt.executeAddNamedTypes(e,t,r)}async function Zt(e,t,r){return Rt.executeDeleteNamedType(e,t,r)}async function Et(e,t,r,n){return Rt.executeUpdateNamedType(e,t,r,n)}async function Ft(e,t,r,n){return Rt.executeAddGraphProperties(e,t,r,n)}async function Ot(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 $t(e,t,r,n){return Rt.executeAddGraphFieldIndex(e,t,r,n)}async function qt(e,t,r,n){return Rt.executeDeleteGraphFieldIndex(e,t,r,n)}async function Ut(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 zt(e,t,r){return Rt.executeQueryStreaming(e,t,r)}async function Jt(e,t,r){return Rt.executeSearch(e,t,r)}async function Kt(e,t,r){return Rt.executeSearchStreaming(e,t,r)}function Vt(e,t){return Rt.fetchAllClientDataKeys(e,t)}function Qt(e,t,r){return Rt.fetchClientDataAtKeys(e,t,r)}async function Bt(e){return Rt.fetchKnowledgeGraph(e)}async function Ht(e){return Rt.refreshDataModel(e)}async function Wt(e){return Rt.refreshServiceDefinition(e)}async function Yt(e,t){return Rt.executeFindPathsAsynchronous(e,t)}async function Xt(e,t){return Rt.executeFindPaths(e,t)}async function er(e,t){return Rt.fetchAsynchronousFindPathsResultData(e,t)}function tr(){return Rt.clearClientDataCache()}async function rr(e,t){return Rt._fetchWrapper(e,t)}async function nr(e,t,r,n){return Rt._submitJobWrapper(e,t,r,n)}async function or(e,t){return Rt._esriRequestWrapper(e,t)}async function ar(e){const t=o.id?.findCredential(e.url);t||(e.dataModel?await hr(e):await Ht(e))}function ir(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 p.A?r.set_param_key_value(e,ye(t,n)):Array.isArray(t)?r.set_param_key_value(e,ce(t,n)):r.set_param_key_value(e,he(t,n))}async function sr(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 dr(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 lr=50;function pr(e){lr=e}function ur({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 p=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??xt(e),d=s.outSpatialReference??new u.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]=Ct(o,r,d)}if(a.push(t),o&&Date.now()-p>lr){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 cr(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,ie.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 z),r.releaseLock(),e)throw p.error(e),l(e),e;return void p.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=ur({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 hr(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,ie.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(),tt=!1;const t=new X({timestamp:e.timestamp,spatialReference:new u.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,Xe.i7)(fe.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,Xe.i7)(fe.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:yt(e.search_indexes),entityTypes:dt(e.entity_types),relationshipTypes:ct(e.relationship_types),metaEntityTypes:dt(e.meta_entity_types),provenanceSourceTypeValues:ht(e.provenance_source_type_values.value_behavior_array)});return tt&&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
|
+
"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:()=>ar,_esriRequestWrapper:()=>or,_fetchWrapper:()=>rr,_getClientDataCacheCopy:()=>jt,_setMaxQueryParsingDurationForTesting:()=>pr,_submitJobWrapper:()=>nr,clearClientDataCache:()=>tr,clientDataCache:()=>kt,executeAddGraphFieldIndex:()=>$t,executeAddGraphProperties:()=>Ft,executeAddNamedTypes:()=>Dt,executeApplyEdits:()=>It,executeDeleteGraphFieldIndex:()=>qt,executeDeleteGraphProperty:()=>Ot,executeDeleteNamedType:()=>Zt,executeFindPaths:()=>Xt,executeFindPathsAsynchronous:()=>Yt,executeQuery:()=>Lt,executeQueryStreaming:()=>zt,executeSearch:()=>Jt,executeSearchStreaming:()=>Kt,executeUpdateGraphProperty:()=>Nt,executeUpdateNamedType:()=>Et,executeUpdateSearchIndex:()=>Ut,fetchAllClientDataKeys:()=>Vt,fetchAsynchronousFindPathsResultData:()=>er,fetchClientDataAtKeys:()=>Qt,fetchKnowledgeGraph:()=>Bt,kgRestServices:()=>Rt,refreshDataModel:()=>Ht,refreshServiceDefinition:()=>Wt});var n,o=r(70333),a=r(78888),i=r(49186),s=r(53966),d=r(74887),l=r(34275),p=r(91075),u=r(16930),c=r(31635),h=r(65008),y=r(10107),g=r(56507),f=(r(44208),r(87811),r(40608)),w=r(5443);let m=n=class extends h.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,g.PZ)(n,e)}};(0,c.Cg)([(0,y.MZ)({type:u.A})],m.prototype,"outSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:w.A})],m.prototype,"processExtent",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A})],m.prototype,"processSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnColumnName",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnFeatureCollection",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnM",void 0),(0,c.Cg)([(0,y.MZ)({nonNullable:!0})],m.prototype,"returnZ",void 0),m=n=(0,c.Cg)([(0,f.$)("esri.rest.geoprocessor.GPOptions")],m);var _=r(17136),v=r(20437),b=r(25482);let C=class extends b.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,c.Cg)([(0,y.MZ)({type:w.A})],C.prototype,"extent",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"height",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"href",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"opacity",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"rotation",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"scale",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"visible",void 0),(0,c.Cg)([(0,y.MZ)()],C.prototype,"width",void 0),C=(0,c.Cg)([(0,f.$)("esri.layers.support.MapImage")],C);var A=r(2272),G=r(93223),M=r(2073);let x=class extends b.o{constructor(e){super(e),this.area=0,this.units=null}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],x.prototype,"area",void 0),(0,c.Cg)([(0,G.e)(M.UO)],x.prototype,"units",void 0),x=(0,c.Cg)([(0,f.$)("esri.rest.support.ArealUnit")],x);let T=class extends b.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,c.Cg)([(0,y.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],T.prototype,"itemId",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],T.prototype,"url",void 0),T=(0,c.Cg)([(0,f.$)("esri.rest.support.DataFile")],T);var P=r(22671);let S=class extends b.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],S.prototype,"distance",void 0),(0,c.Cg)([(0,G.e)(M.Y8)],S.prototype,"units",void 0),S=(0,c.Cg)([(0,f.$)("esri.rest.support.LinearUnit")],S);var k=r(66552);const j="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":`${j}areal-unit`,"GPMultiValue:GPBoolean":`${j}boolean`,"GPMultiValue:GPComposite":`${j}composite`,"GPMultiValue:GPDataFile":`${j}data-file`,"GPMultiValue:GPDate":`${j}date`,"GPMultiValue:GPDouble":`${j}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${j}feature-record-set-layer`,"GPMultiValue:Field":`${j}field`,"GPMultiValue:GPLinearUnit":`${j}linear-unit`,"GPMultiValue:GPLong":`${j}long`,"GPMultiValue:GPRasterData":`${j}raster-data`,"GPMultiValue:GPRasterDataLayer":`${j}raster-data-layer`,"GPMultiValue:GPRecordSet":`${j}record-set`,"GPMultiValue:GPString":`${j}string`});let I=class extends b.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,c.Cg)([(0,G.e)(R,{ignoreUnknown:!1})],I.prototype,"dataType",void 0),(0,c.Cg)([(0,y.MZ)()],I.prototype,"paramName",void 0),(0,c.Cg)([(0,y.MZ)()],I.prototype,"value",void 0),I=(0,c.Cg)([(0,f.$)("esri.rest.support.ParameterValue")],I);var D=r(36005);let Z=class extends b.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 E(e,t){switch(e){case"areal-unit":return x.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 T.fromJSON(t);case"linear-unit":return S.fromJSON(t);case"feature-record-set-layer":if("url"in t)return T.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(6131),r.e(8219),r.e(8096),r.e(13),r.e(1214),r.e(9953),r.e(1956),r.e(4796),r.e(3029),r.e(8761),r.e(8506),r.e(9784),r.e(5294)]).then(r.bind(r,29784))).default),{layerDefinition:n,featureSet:o}=t;return e.read({layerDefinition:n,featureSet:o},{origin:"portal-item"}),e.spatialReference=u.A.fromJSON(o.spatialReference??n.spatialReference??n.extent.spatialReference),e}return P.A.fromJSON(t);case"record-set":return"url"in t?T.fromJSON(t):P.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?C.fromJSON(t.mapImage):Z.fromJSON(t);case"field":return v.A.fromJSON(t)}}async function F(e){const t=R.fromJSON(e.dataType),{paramName:r}=e,n=function(e){return e.startsWith(j)}(t)?await async function(e,t){const r=function(e){return e.replace(j,"")}(e),n="composite"===r?t.map(e=>E(R.fromJSON(e.dataType),e.value)):t.map(e=>E(r,e));return Promise.all(n)}(t,e.value):await E(t,e.value);return new I({dataType:t,paramName:r,value:n})}function O(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>O({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,A.lF)(e,t,r)}(0,c.Cg)([(0,y.MZ)()],Z.prototype,"format",void 0),(0,c.Cg)([(0,y.MZ)({json:{name:"itemID",write:!0}})],Z.prototype,"itemId",void 0),(0,c.Cg)([(0,y.MZ)()],Z.prototype,"type",void 0),(0,c.Cg)([(0,D.w)("type")],Z.prototype,"readType",null),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],Z.prototype,"url",void 0),Z=(0,c.Cg)([(0,f.$)("esri.rest.support.RasterData")],Z);var N,$=r(37807);const q=(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}),U=1e3;let L=class extends b.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,A.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,U);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,U)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,A.Dl)(this.sourceUrl),r={...this.requestOptions,...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=m.from(t||{});const{returnColumnName:n,returnFeatureCollection:o,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,A.Dl)(this.sourceUrl),p=O({returnColumnName:n||null,returnFeatureCollection:o||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json"},null),u={...this.requestOptions,...r,query:p},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:h}=await(0,a.A)(c,u);return F(h)}async fetchResultImage(e,t,r){const{path:n}=(0,A.Dl)(this.sourceUrl),o=O({...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 F(d)}async fetchResultMapImageLayer(){const{path:e}=(0,A.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(6131),r.e(8219),r.e(8096),r.e(13),r.e(1214),r.e(1956),r.e(4796),r.e(8761),r.e(364),r.e(3249),r.e(7656),r.e(8407)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=U,signal:r,statusCallback:n}=e;return new Promise((e,o)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),o((0,d.NK)())}),this.clearJobCompletionTimer();const a=()=>{this._jobCompletionTimer||o((0,d.NK)()),this.checkJobStatus().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(a,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":o(this);break;default:this._jobCompletionTimer=setTimeout(a,t)}}).catch(e=>{o(e)})};this._jobCompletionTimer=setTimeout(a,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,c.Cg)([(0,y.MZ)()],L.prototype,"jobId",void 0),(0,c.Cg)([(0,G.e)(q,{ignoreUnknown:!1})],L.prototype,"jobStatus",void 0),(0,c.Cg)([(0,y.MZ)({type:[$.A]})],L.prototype,"messages",void 0),(0,c.Cg)([(0,y.MZ)()],L.prototype,"progress",void 0),(0,c.Cg)([(0,y.MZ)()],L.prototype,"requestOptions",void 0),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],L.prototype,"sourceUrl",void 0),L=N=(0,c.Cg)([(0,f.$)("esri.rest.support.JobInfo")],L);let z=class extends h.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};(0,c.Cg)([(0,y.MZ)()],z.prototype,"headerKeys",void 0),(0,c.Cg)([(0,y.MZ)()],z.prototype,"outSpatialReference",void 0),(0,c.Cg)([(0,y.MZ)()],z.prototype,"exceededTransferLimit",void 0),z=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],z);let J=class extends h.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new z}};(0,c.Cg)([(0,y.MZ)()],J.prototype,"resultRows",void 0),(0,c.Cg)([(0,y.MZ)()],J.prototype,"resultHeader",void 0),J=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryResult")],J);let K=class extends h.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new z}};(0,c.Cg)([(0,y.MZ)()],K.prototype,"resultRowsStream",void 0),(0,c.Cg)([(0,y.MZ)()],K.prototype,"resultHeader",void 0),K=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],K);let V=class extends b.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],V.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"unique",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"ascending",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],V.prototype,"description",void 0),(0,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],V.prototype,"fieldNames",void 0),V=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.FieldIndex")],V);let Q=class extends b.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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"alias",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"fieldType",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"geometryType",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"hasM",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"hasZ",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"nullable",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"editable",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"required",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"defaultVisibility",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"systemMaintained",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Q.prototype,"role",void 0),(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],Q.prototype,"defaultValue",void 0),Q=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphProperty")],Q);let B=class extends b.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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"alias",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],B.prototype,"role",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],B.prototype,"strict",void 0),(0,c.Cg)([(0,y.MZ)({type:[Q],json:{write:!0}})],B.prototype,"properties",void 0),(0,c.Cg)([(0,y.MZ)({type:[V],json:{write:!0}})],B.prototype,"fieldIndexes",void 0),B=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphObjectType")],B);let H=class extends B{constructor(e){super(e),this.type="entity"}};H=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.EntityType")],H);let W=class extends B{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,c.Cg)([(0,y.MZ)({json:{write:!0}})],W.prototype,"endPoints",void 0),W=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.RelationshipType")],W);let Y=class extends b.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"value",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],Y.prototype,"behavior",void 0),Y=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],Y);let X=class extends b.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,c.Cg)([(0,y.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],X.prototype,"timestamp",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],X.prototype,"spatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"strict",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],X.prototype,"objectIdField",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],X.prototype,"globalIdField",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"arcgisManaged",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"identifierInfo",void 0),(0,c.Cg)([(0,y.MZ)()],X.prototype,"searchIndexes",void 0),(0,c.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],X.prototype,"entityTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[W],json:{write:!0}})],X.prototype,"relationshipTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[H],json:{write:!0}})],X.prototype,"metaEntityTypes",void 0),(0,c.Cg)([(0,y.MZ)({type:[Y],json:{write:!0}})],X.prototype,"provenanceSourceTypeValues",void 0),X=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.DataModel")],X);let ee=class extends b.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,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ee.prototype,"capabilities",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsSearch",void 0),(0,c.Cg)([(0,y.MZ)({type:[String],json:{write:!0}})],ee.prototype,"supportedQueryFormats",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"allowGeometryUpdates",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"searchMaxRecordCount",void 0),(0,c.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ee.prototype,"serviceCapabilities",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"maxRecordCount",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"description",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"copyrightText",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"units",void 0),(0,c.Cg)([(0,y.MZ)({type:u.A,json:{write:!0}})],ee.prototype,"spatialReference",void 0),(0,c.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],ee.prototype,"currentVersion",void 0),(0,c.Cg)([(0,y.MZ)({type:Object,json:{write:!0}})],ee.prototype,"dateFieldsTimeReference",void 0),(0,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],ee.prototype,"serviceItemId",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsDocuments",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"dataEditingNotSupported",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"schemaEditingNotSupported",void 0),(0,c.Cg)([(0,y.MZ)({type:Boolean,json:{write:!0}})],ee.prototype,"supportsProvenance",void 0),ee=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.ServiceDefinition")],ee);let te=class extends b.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function re(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function ne(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function oe(e,t,r,n=!1){const o=new r.ClientDataFetchRequestEncoder;o.deleteLater();for(const a of e){const e=ae(a,t,r,n);o.add_client_data_fetch_request_parameter(e)}o.encode();const a=o.get_encoding_result();return re(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function ae(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,c.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],te.prototype,"url",void 0),(0,c.Cg)([(0,y.MZ)({type:X,json:{write:!0}})],te.prototype,"dataModel",void 0),(0,c.Cg)([(0,y.MZ)({type:ee,json:{write:!0}})],te.prototype,"serviceDefinition",void 0),te=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.KnowledgeGraph")],te);var ie=r(45724),se=r(48526),de=r(86738),le=r(39829),pe=r(82799);const ue={exclude:0,include:1};function ce(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ge(e,t))}),r}function he(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,ge(o,t));return r}function ye(e,t){if(e instanceof se.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 de.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 pe.A||e instanceof le.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 pe.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof le.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 ge(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof p.A)return ye(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ge(e,t))}),r}return he(e,t)}var fe=r(35448);function we(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,Ce(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,Ce(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 me(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:fe.r5[e.fieldType]},r.geometry_type={value:e.geometryType?fe.bV[e.geometryType]:fe.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:fe.ti[e.role]},r.default_value=Ce(e.defaultValue,t),r}function _e(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function ve(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:fe.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=me(n,t);r.add_property(e)}return r}function be(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function Ce(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof p.A?ye(e,t):null}let Ae=class extends h.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"decoderError",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"resultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"results",void 0),(0,c.Cg)([(0,y.MZ)()],Ae.prototype,"updatedKnowledgeGraph",void 0),Ae=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],Ae);const Ge=Ae;let Me=class extends Ge{constructor(e){super(e)}};Me=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Me);const xe=Me;let Te=class extends Ge{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,c.Cg)([(0,y.MZ)()],Te.prototype,"entityAddResultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"relationshipAddResultsCount",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"entityAddResults",void 0),(0,c.Cg)([(0,y.MZ)()],Te.prototype,"relationshipAddResults",void 0),Te=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],Te);const Pe=Te;let Se=class extends Ge{constructor(e){super(e)}};Se=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Se);const ke=Se;let je=class extends Ge{constructor(e){super(e)}};je=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],je);const Re=je;let Ie=class extends Ge{constructor(e){super(e)}};Ie=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],Ie);const De=Ie;let Ze=class extends Ge{constructor(e){super(e)}};Ze=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],Ze);const Ee=Ze;let Fe=class extends Ge{constructor(e){super(e)}};Fe=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Fe);const Oe=Fe;let Ne=class extends Ge{constructor(e){super(e)}};Ne=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ne);const $e=Ne;let qe=class extends Ge{constructor(e){super(e)}};qe=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],qe);const Ue=qe;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:ne(t.get_error())})}return r}function ze(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 Pe({resultsCount:t,results:Le(e,t),decoderError:ne(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:ne(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:ne(a)})}return o}function Je(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ke(e){const t=e.get_results_count();return new De({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ve(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Qe(e){const t=e.get_results_count();return new Ee({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Be(e){const t=e.get_results_count();return new $e({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function He(e){const t=e.get_results_count();return new Ue({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function We(e){const t=e.get_results_count();return new xe({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}function Ye(e){const t=e.get_results_count();return new Re({resultsCount:t,results:Le(e,t),decoderError:ne(e.error)})}var Xe=r(93637);let et=class extends h.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,c.Cg)([(0,y.MZ)()],et.prototype,"name",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"supportedCategory",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"analyzers",void 0),(0,c.Cg)([(0,y.MZ)()],et.prototype,"searchProperties",void 0),et=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.SearchIndex")],et);let tt=!1;function rt(e){return e.deleteLater(),new H(ot(e))}function nt(e){return e.deleteLater(),new V({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:lt(e.fields)})}function ot(e){return{name:e.name,alias:e.alias,role:(0,Xe.i7)(fe.Eq,e.role.value),strict:e.strict,properties:pt(e.properties),fieldIndexes:ut(e.field_indexes)}}function at(e){return e.deleteLater(),new Q({alias:e.alias,name:e.name,fieldType:(0,Xe.i7)(fe.r5,e.field_type.value)??void 0,geometryType:(0,Xe.i7)(fe.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,Xe.i7)(fe.ti,e.role.value),defaultValue:e.default_value})}function it(e){e.deleteLater();const t=ot(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 W(Object.assign({endPoints:r},t))}function st(e){return new Y({behavior:e.behavior,value:e.value})}function dt(e){const t=[];for(let r=0;r<e.size();r++)t.push(rt(e.get(r)));return e.delete(),t}function lt(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function pt(e){const t=[];for(let r=0;r<e.size();r++){const n=at(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(tt=!0),t.push(n)}return e.delete(),t}function ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(nt(e.get(r)));return e.delete(),t}function ct(e){const t=[];for(let r=0;r<e.size();r++)t.push(it(e.get(r)));return e.delete(),t}function ht(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(st(n))}return e.delete(),t}function yt(e){const t=[];for(let r=0;r<e.size();r++){const n=new et,o=e.get(r);n.name=o.name,n.supportedCategory=(0,Xe.i7)(fe.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 gt=r(25927),ft=(r(77901),r(40662)),wt=r(42095),mt=r(23150);function _t(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=vt(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 vt(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 bt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function Ct(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;vt(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 de.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=vt(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 se.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:o}=_t(e,3);return new pe.A({paths:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:o}=_t(e,4);return new le.A({rings:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 5:case 7:return bt().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 bt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return bt().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 ft.A(Gt(e,t,r))}(e,t,r);case 1:return At(e,t,r);case 2:return Mt(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(At(e.get_entity_at(i),t,r)),i<o&&a.push(Mt(e.get_relationship_at(i),t,r));return new wt.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(Ct(o,t,r))}return n}(e,t,r);default:return bt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function At(e,t,r){const n=e.type_name,o=Gt(e,t,r),a=e.get_id();return new gt.A(Object.assign({typeName:n,id:a},o))}function Gt(e,t,r){const n={},o=e.key_count();for(let a=0;a<o;a++)n[e.get_key_at(a)]=Ct(e.get_value_at(a),t,r);return{properties:n}}function Mt(e,t,r){const n=e.type_name,o=Gt(e,t,r);return new mt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function xt(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 u.A(e.get_out_sr());return new z({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit()})}let Tt=class extends h.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[]}};(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"hasError",void 0),(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"error",void 0),(0,c.Cg)([(0,y.MZ)()],Tt.prototype,"editResults",void 0),Tt=(0,c.Cg)([(0,f.$)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],Tt);const Pt=Tt;function St(e){const t=e.has_error(),r=new Pt({hasError:t,error:t?ne(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t),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);a.push({id:t.id,error:ne(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);i.push({id:t.id,error:ne(t.error)})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);s.push({id:t.id,error:ne(t.error)})}r.editResults.push({typeName:o,adds:a,updates:i,deletes:s})}return r}const kt=new Map,jt=()=>new Map(kt.entries()),Rt={fetchKnowledgeGraph:async e=>{const t=new te({url:e}),r=[];return r.push(Ht(t)),r.push(Wt(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await hr(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 ee(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 or(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await nr(`${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 or(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await or(`${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 ar(e);const o=await sr(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,ie.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))ir(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 Ht(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:ue[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(0,l.OO)(structuredClone(o.get_byte_buffer()))}(t,e);const a=await rr(o.data.url,o.data);if(e.dataModel){const t=await cr(a,e.dataModel);return new K({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 ar(e);const o=await sr(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await Ht(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,ie.I)(),n=!!e.options?.cascadeDelete,o=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());o.deleteLater(),o.cascade_delete=n;try{let t;e.entityAdds?.forEach(e=>{t=o.add_entity(we(e,r)),re(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=o.add_relationship(we(e,r)),re(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=o.update_entity(we(e,r)),re(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=o.update_relationship(we(e,r)),re(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=o.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=o.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),o.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const a=o.get_encoding_result();return re(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),(0,l.OO)(structuredClone(a.get_byte_buffer()))}(t,e),async function(e){return dr(e,(await(0,ie.I)()).GraphApplyEditsDecoder,St)}(await rr(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 ar(e);const o=await sr(n,r);o.data.body=await async function(e){const t=await(0,ie.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(),ve(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 ve(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 re(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(t);const a=await rr(o.data.url,o.data),s=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeAddsResponseDecoder,ze)}(a);return s.updatedKnowledgeGraph=await Bt(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 ar(e);const o=await sr(n,r);o.data.body="";const a=await rr(o.data.url,o.data),s=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Ke)}(a);return s.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e,t,r){const n=await(0,ie.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(),be(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(),be(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 re(a.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),(0,l.OO)(structuredClone(a.get_byte_buffer()))}(r,t,e.dataModel);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphNamedObjectTypeUpdateResponseDecoder,Je)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=await(0,ie.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(me(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 re(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyAddsResponseDecoder,Ve)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=new((await(0,ie.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 re(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),(0,l.OO)(structuredClone(r.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyDeleteResponseDecoder,Qe)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const s=await sr(a,o);s.data.body=await async function(e,t){const r=await(0,ie.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=Ce(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 re(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),(0,l.OO)(structuredClone(o.get_byte_buffer()))}(r,n);const d=await rr(s.data.url,s.data),p=await async function(e){return dr(e,(await(0,ie.I)()).GraphPropertyUpdateResponseDecoder,Be)}(d);return p.updatedKnowledgeGraph=await Bt(e.url),p},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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=await(0,ie.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 re(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),(0,l.OO)(structuredClone(n.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphIndexAddsResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e){const t=new((await(0,ie.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 re(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),(0,l.OO)(structuredClone(r.get_byte_buffer()))}(r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphIndexDeleteResponseDecoder,Ye)}(s);return d.updatedKnowledgeGraph=await Bt(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 ar(e);const a=await sr(o,n);a.data.body=await async function(e,t){const r=await(0,ie.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,_e(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,_e(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 re(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),(0,l.OO)(structuredClone(o.get_byte_buffer()))}(t,r);const s=await rr(a.data.url,a.data),d=await async function(e){return dr(e,(await(0,ie.I)()).GraphUpdateSearchIndexResponseDecoder,He)}(s);return d.updatedKnowledgeGraph=await Bt(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,ie.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=ur({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new J({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=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,ie.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=ur({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new J({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 ar(e);const o=await sr(n,r);o.data.body=await async function(e){const t=await(0,ie.I)(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],!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(ce(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 n=r.get_encoding_result();if(0!==n.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return(0,l.OO)(structuredClone(n.get_byte_buffer()))}(t);const a=await rr(o.data.url,o.data);if(e.dataModel){const t=await cr(a,e.dataModel);return new K({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,ie.I)(),d=oe(t,n,s,r.ignoreCache),l=await sr(a,r.requestOptions);l.data.body=d;const p=await rr(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()&&re(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,ie.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&re(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=m.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 P.A){const{features:e}=o;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,_.el)(d).then(d=>{const{outSpatialReference:l,processExtent:p,processSpatialReference:u,returnColumnName:c,returnFeatureCollection:h,returnM:y,returnZ:g}=r,{path:f}=(0,A.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=O({...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 It(e,t,r){return Rt.executeApplyEdits(e,t,r)}async function Dt(e,t,r){return Rt.executeAddNamedTypes(e,t,r)}async function Zt(e,t,r){return Rt.executeDeleteNamedType(e,t,r)}async function Et(e,t,r,n){return Rt.executeUpdateNamedType(e,t,r,n)}async function Ft(e,t,r,n){return Rt.executeAddGraphProperties(e,t,r,n)}async function Ot(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 $t(e,t,r,n){return Rt.executeAddGraphFieldIndex(e,t,r,n)}async function qt(e,t,r,n){return Rt.executeDeleteGraphFieldIndex(e,t,r,n)}async function Ut(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 zt(e,t,r){return Rt.executeQueryStreaming(e,t,r)}async function Jt(e,t,r){return Rt.executeSearch(e,t,r)}async function Kt(e,t,r){return Rt.executeSearchStreaming(e,t,r)}function Vt(e,t){return Rt.fetchAllClientDataKeys(e,t)}function Qt(e,t,r){return Rt.fetchClientDataAtKeys(e,t,r)}async function Bt(e){return Rt.fetchKnowledgeGraph(e)}async function Ht(e){return Rt.refreshDataModel(e)}async function Wt(e){return Rt.refreshServiceDefinition(e)}async function Yt(e,t){return Rt.executeFindPathsAsynchronous(e,t)}async function Xt(e,t){return Rt.executeFindPaths(e,t)}async function er(e,t){return Rt.fetchAsynchronousFindPathsResultData(e,t)}function tr(){return Rt.clearClientDataCache()}async function rr(e,t){return Rt._fetchWrapper(e,t)}async function nr(e,t,r,n){return Rt._submitJobWrapper(e,t,r,n)}async function or(e,t){return Rt._esriRequestWrapper(e,t)}async function ar(e){const t=o.id?.findCredential(e.url);t||(e.dataModel?await hr(e):await Ht(e))}function ir(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 p.A?r.set_param_key_value(e,ye(t,n)):Array.isArray(t)?r.set_param_key_value(e,ce(t,n)):r.set_param_key_value(e,he(t,n))}async function sr(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 dr(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 lr=50;function pr(e){lr=e}function ur({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 p=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??xt(e),d=s.outSpatialReference??new u.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]=Ct(o,r,d)}if(a.push(t),o&&Date.now()-p>lr){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 cr(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,ie.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 z),r.releaseLock(),e)throw p.error(e),l(e),e;return void p.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=ur({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 hr(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,ie.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(),tt=!1;const t=new X({timestamp:e.timestamp,spatialReference:new u.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,Xe.i7)(fe.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,Xe.i7)(fe.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:yt(e.search_indexes),entityTypes:dt(e.entity_types),relationshipTypes:ct(e.relationship_types),metaEntityTypes:dt(e.meta_entity_types),provenanceSourceTypeValues:ht(e.provenance_source_type_values.value_behavior_array)});return tt&&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})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9689],{18768:(e,t,i)=>{i.d(t,{b:()=>l});var s=i(31635),r=i(53966),n=i(10107),a=(i(44208),i(87811),i(40608)),o=i(60694);const l=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,o.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,o.Jf)(e,r.A.getLogger(this)))}};return(0,s.Cg)([(0,n.MZ)()],i.prototype,"title",null),(0,s.Cg)([(0,n.MZ)({type:String})],i.prototype,"url",null),i=(0,s.Cg)([(0,a.$)("esri.layers.mixins.ArcGISService")],i),i}},21312:(e,t,i)=>{i.d(t,{A:()=>m});var s,r=i(31635),n=i(10107),a=(i(44208),i(53966),i(87811),i(93223)),o=i(36005),l=i(40608),c=i(43937),u=i(5443),f=i(86738),h=i(82434);function p(e,t,i){const{x:s,y:r}=t;if(i<2)return{x:e[0]+s*e[2]+r*e[4],y:e[1]+s*e[3]+r*e[5]};if(2===i){const t=s*s,i=r*r,n=s*r;return{x:e[0]+s*e[2]+r*e[4]+t*e[6]+n*e[8]+i*e[10],y:e[1]+s*e[3]+r*e[5]+t*e[7]+n*e[9]+i*e[11]}}const n=s*s,a=r*r,o=s*r,l=n*s,c=n*r,u=s*a,f=r*a;return{x:e[0]+s*e[2]+r*e[4]+n*e[6]+o*e[8]+a*e[10]+l*e[12]+c*e[14]+u*e[16]+f*e[18],y:e[1]+s*e[3]+r*e[5]+n*e[7]+o*e[9]+a*e[11]+l*e[13]+c*e[15]+u*e[17]+f*e[19]}}function d(e,t,i){const{xmin:s,ymin:r,xmax:n,ymax:a,spatialReference:o}=t;let l=[];if(i<2)l.push({x:s,y:a}),l.push({x:n,y:a}),l.push({x:s,y:r}),l.push({x:n,y:r});else{let e=10;for(let t=0;t<e;t++)l.push({x:s,y:r+(a-r)*t/(e-1)}),l.push({x:n,y:r+(a-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)l.push({x:s+(n-s)*t/e,y:r}),l.push({x:s+(n-s)*t/e,y:a})}l=l.map(t=>p(e,t,i));const c=l.map(e=>e.x),f=l.map(e=>e.y);return new u.A({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,f),ymax:Math.max.apply(null,f),spatialReference:o})}let m=s=class extends h.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:i,coeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeForwardCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.coeffX=s,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,i,s,r,n,a]=e,o=s*a-n*r,l=n*r-s*a;return[(n*i-t*a)/o,(s*i-t*r)/l,a/o,r/l,-n/o,-s/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:i,inverseCoeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeInverseCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.inverseCoeffX=s,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=p(this.forwardCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=p(this.inverseCoefficients,e,this.polynomialOrder);return new f.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return d(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,n.MZ)({json:{write:!0}})],m.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,n.MZ)()],m.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,o.w)("forwardCoefficients",["coeffX","coeffY"])],m.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,c.K)("forwardCoefficients")],m.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,n.MZ)({json:{write:!0}})],m.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,o.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],m.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,c.K)("inverseCoefficients")],m.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,n.MZ)()],m.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,a.e)({PolynomialXform:"polynomial"})],m.prototype,"type",void 0),m=s=(0,r.Cg)([(0,l.$)("esri.layers.support.rasterTransforms.PolynomialTransform")],m)},24212:(e,t,i)=>{function s(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?l:c}(e).mode}(null==e||(e.hasZ??!1),t)}function r(e,t,i){return i&&i.mode!==t?`${e} only support ${t} elevation mode`:null}function n(e,t,i){return i?.mode===t?`${e} do not support ${t} elevation mode`:null}function a(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function o(e,t){t&&e.warn(".elevationInfo=",t)}i.d(t,{$7:()=>n,B:()=>r,XF:()=>o,tW:()=>a,w7:()=>s}),i(83047),i(16271);const l={mode:"absolute-height",offset:0},c={mode:"on-the-ground",offset:null}},25943:(e,t,i)=>{i.d(t,{d:()=>S});var s,r=i(31635),n=i(78888),a=i(65008),o=i(49186),l=i(36563),c=(i(44208),i(66344)),u=i(15142),f=i(74887),h=i(36708),p=i(96211),d=i(84952),m=i(10107),g=(i(53966),i(87811),i(40608)),y=i(72802),w=i(4718),v=i(69397),x=i(34275);class b{constructor(e){!function(e){if(!e?.location)throw new o.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,w.o8)(t));const s=this.location.width,r=this.location.height;let n=!0,a=!0;const l=function(e,t=!1){return e<=x.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(s*r/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(a=!1,l[c]|=1<<t):n=!1,31===t&&++c}a?(this._availability="unavailable",this.byteSize=40):n?(this._availability="available",this.byteSize=40):(this._availability=l,this.byteSize=40+(0,v.Qf)(l))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),s=i%32,r=i>>5,n=this._availability;return r<0||r>n.length?"unknown":n[r]&1<<s?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||n.A,{row:s,col:r,width:a,height:l}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:s,left:r,width:a,height:l},valid:!0,data:new Array(a*l).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==s||e.location.left!==r||e.location.width!==a||e.location.height!==l))throw new o.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:s,left:r,width:a,height:l}});return b.fromJSON(e)})}static fromJSON(e){return Object.freeze(new b(e))}}function I(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function C(e,t,i){return new o.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let S=class extends a.A{static{s=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=n.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new c.q(2097152),this.addHandles((0,h.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),h.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const s=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return s?s.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,s){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(C(e,t,i)):this._fetchTilemap(e,t,i,s).catch(e=>e).then(s=>{if(s instanceof b){const r=s.getAvailability(t,i);if("unavailable"===r)throw C(e,t,i);return r}if((0,f.zf)(s))throw s;return"unknown"})}fetchAvailabilityUpsample(e,t,i,s,r){s.level=e,s.row=t,s.col=i;const n=this.layer.tileInfo;n.updateTileInfo(s);const a=this.fetchAvailability(e,t,i,r).catch(e=>{if((0,f.zf)(e))throw e;if(n.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,r);throw e});return this._fetchAvailabilityUpsamplePrefetch(s.id,e,t,i,r,a),a}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,n,a){if(!this._prefetchingEnabled||null==e)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const c=new AbortController;a.then(()=>c.abort(),()=>c.abort());let u=!1;const h=(0,l.hA)(()=>{u||(u=!0,c.abort())});if(this.addHandles(h,o),await(0,p.md)(10,c.signal).catch(()=>{}),u||(u=!0,this.removeHandles(o)),(0,f.G4)(c))return;const d=new y.U(e,t,i,r),m={...n,signal:c.signal},g=this.layer.tileInfo;for(let e=0;s._prefetches.length<s._maxPrefetch&&g.upsampleTile(d);++e){const e=this.fetchAvailability(d.level,d.row,d.col,m);s._prefetches.push(e);const t=()=>{s._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:s._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,i,r);if(n)return Promise.resolve(n);const a=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{(0,f.u7)(a,()=>t((0,f.NK)()));const i=I(r);let n=this._pendingTilemapRequests[i];if(!n){n=b.fromDefinition(r,s).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=n,n.then(e,e)}n.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,s){s.level=e,s.row=t-t%this.size,s.col=i-i%this.size;const r=I(s);return this._tilemapCache.get(r)}get test(){}};(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"request",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],S.prototype,"size",void 0),S=s=(0,r.Cg)([(0,g.$)("esri.layers.support.TilemapCache")],S)},39689:(e,t,i)=>{i.r(t),i.d(t,{default:()=>We});var s=i(31635),r=i(13874),n=i(69540),a=i(49186),o=i(53966),l=i(92071),c=i(74887),u=i(36708),f=i(10107),h=i(56507),p=i(44208),d=(i(87811),i(40608)),m=i(99959);const g=Symbol("isImageryTileGraphicOrigin");var y;class w extends m.A{static{y=g}constructor(e){super(),this[y]=!0,this.type="imagery-tile",this.layer=e}}var v=i(4146),x=i(18768),b=i(63074),I=i(69208),C=i(89015),S=i(16131),A=i(8303),T=i(63660),R=i(56551),M=i(54310),O=i(25036),_=i(82935),F=i(10873),P=i(20437),k=i(74797),D=i(22796),N=i(76353),L=i(84169),E=i(4916),B=i(68197),z=i(5443),J=i(16930),$=i(73444),U=i(14140),j=i(16019);function V(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function Z(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function q(e){const t=(0,$.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function H(){return Math.round(255*Math.random())}function G(e){const t={},{parameters:i}=e;if(!i)return t;for(const[e,s]of Object.entries(i)){const{type:i,description:r,unit:n,categoryEncoding:a,observedProperty:o}=s;if("Parameter"===i&&(t[e]={},r&&(t[e].description=q(r)),n&&(t[e].unit=n.label?q(n.label):null,t[e].symbol=n.symbol?.value),a)){const i=Object.entries(a).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let s=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(!r)return;const n=e.label?q(e.label):null;if(r.Label=n,e.preferredColor){const t=B.A.fromHex(e.preferredColor);t&&(s=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),s&&i.forEach(e=>{null==e.Red&&(e.Red=H(),e.Green=H(),e.Blue=H())}));const r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};s&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function W(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let s=0;s<e.length;s++){const r=e[s];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,j.X1)(t,i)}function X(e,t,i){const s=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(n=1,e=>n*=e.count);var n;const a=[...s.slice(1),{name:"",count:1}].reverse().map(r).reverse();let o=0;for(let r=e.length-1;r>=0;r--)o+=a[s.findIndex(({name:t})=>t===e[r])]*(i%t[r]),i=Math.floor(i/t[r]);return o}var Y=i(45617),K=i(87186),Q=i(77301),ee=i(28435),te=i(6952);let ie=class extends E.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[n,a]=r.storageInfo.tileInfo.size,{sliceId:o}=s,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==r.dataType,tileSize:{width:n,height:a},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,s):(0,ee.J$)(c);return Promise.resolve(u)}const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){const t=this.source,{pixelBlocks:i,attributeTable:s,statistics:r,histograms:n,name:a,nativeExtent:o,transform:l}=t,c=i[0],{width:u,height:f,pixelType:h}=c,p=t.extent??new z.A({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new J.A({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,m={x:p.width/u,y:p.height/f},g={...t.keyProperties};s&&(g.DataType="Thematic");const y=new K.A({width:u,height:f,pixelType:h,extent:p,nativeExtent:o,attributeTable:s,transform:l,pixelSize:m,spatialReference:p.spatialReference,bandCount:c.pixels.length,keyProperties:g,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:d,histograms:n});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(y),this.createRemoteDatasetStorageInfo(y,512,512),this._set("rasterInfo",y),this.updateTileInfo(),y.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,y.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},e),y.multidimensionalInfo||(this.source=null),this.datasetName=a}async _buildInMemoryRaster(e,t,i){const{rasterInfo:s}=this,r=s.storageInfo.maximumPyramidLevel??0,n="thematic"!==s.dataType,o=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:r,useBilinear:n},i):Promise.resolve((0,ee.lD)(e,t,r,n)),l=null!=s.statistics,u=null!=s.histograms,f=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,te.f4)(e)),h=await(0,c.Lx)([o,f]);if(!h[0].value&&h[1].value)throw new a.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,l||(s.statistics=h[1].value?.statistics),u||(s.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let s=0;s<t.variables.length;s++){const r=t.variables[s];if(r.statistics)continue;const n=r.dimensions.map(e=>new Y.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),a=(0,Q.NG)(n,t),o=null==a?null:e[a];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},i):(0,te.eH)(o);r.statistics=l.statistics,r.histograms||(r.histograms=l.histograms)}}};(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,f.MZ)()],ie.prototype,"source",void 0),(0,s.Cg)([(0,f.MZ)()],ie.prototype,"url",null),ie=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.InMemoryRaster")],ie);const se=ie;var re=i(22671);let ne=class extends E.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const{extent:t,pixelBlocks:i,multidimensionalInfo:s,attributeTable:r,bandNames:n}=await this._fetchData(e),{statistics:a,histograms:o}=(0,te.eH)(i[0]),l=n?.map(e=>({BandName:e})),c={DataType:r?"Thematic":s?"Scientific":"Generic",BandProperties:l},u=new se({source:{extent:t,pixelBlocks:i,attributeTable:r?re.A.fromJSON(r):null,multidimensionalInfo:s,statistics:a,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new a.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new a.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new a.A(i,"Missing domain referencing in the grid coverage data");const s=Object.values(t.ranges);for(let e=0;e<s.length;e++){const{axisNames:t,shape:r,type:n,values:o}=s[e];if(!("ndarray"===n.toLowerCase()&&o?.length&&t?.length&&r?.length))throw new a.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!V(t[t.length-1])||!Z(t[t.length-2]))throw new a.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:i,extent:s,dimensions:r}=function(e){const{axes:t}=e.domain,i=Object.keys(t),s=[],r=[];let n=-1,a=-1,o=[];for(let e=0;e<i.length;e++){const l=i[e];V(l)?n=e:Z(l)&&(a=e);const c=t[l],u=[];if("values"in c){c.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));const e=u[1]-u[0];s.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{const{start:e,stop:t,num:i}=c,n=(t-e)/(i-1);s.push([e-.5*n,t+.5*n]),r.push(n);for(let t=0;t<i;t++)u.push(e+n*t)}o.push({name:l,values:u,extent:[u[0],u[u.length-1]]})}n>-1&&-1===a?a=0===n?1:0:a>-1&&-1===n?n=0===a?1:0:-1===a&&-1===n&&(n=0,a=1),o=o.filter((e,t)=>!(t===n||t===a));const{referencing:l}=e.domain,c=l.find(e=>e.coordinates.includes(i[n])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=null==u||"CRS84"===u?4326:Number(u),h=new J.A({wkid:f}),[p,d]=s[n],[m,g]=s[a],y=new z.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:h});return{width:Math.round(y.width/r[n]),height:Math.round(y.height/r[a]),extent:y,dimensions:o}}(e),{ranges:n}=e,a=Object.keys(n).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<a.length;e++){const t=a[e];r?.length&&o.push({name:t,dimensions:r})}const l=G(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const c=o.length?{variables:o}:void 0,u=[];for(let e=0;e<a.length;e++){const s=a[e],{values:o,dataType:l,axisNames:c,shape:f}=n[s],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,p=c.slice(0,-2),d=f.slice(0,-2),m="float"===l?"f32":W(o),g=t*i,y=o.length/g;for(let s=0;s<y;s++){const n=U.A.createEmptyBand(m,g),a=new Uint8Array(g).fill(255);let l=!1;const c=s*g;for(let e=0;e<g;e++){const t=o[c+e];null==t?(a[e]=0,l=!0):n[e]=t}if(0===e||r?.length){const e=new U.A({width:t,height:i,mask:l?a:null,pixels:[n],pixelType:m});e.updateStatistics(),r?.length?u[X(p,d,s)+h]=e:u.push(e)}else{const e=u[s];e.pixels.push(n),l?e.mask&&(e.mask=U.A.combineBandMasks([e.mask,a])):e.mask=l?a:null}}}const f=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:s,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:a}}(t)}};(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,f.MZ)({constructOnly:!0})],ne.prototype,"source",void 0),ne=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.CovJSONRaster")],ne);const ae=ne;var oe=i(4576),le=i(21325),ce=i(50103),ue=i(21312);function fe(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function he(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new J.A({wkid:t});if(e=String(e).trim(),(0,le.jp)(e))return new J.A({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const s=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),n=r>-1?r:i.indexOf("GEOGCS");if(-1===n)return null;const a=e.slice(n,e.lastIndexOf("]",s)+1).trim(),o=e.slice(s,e.lastIndexOf("]")).trim();t=pe(a);const l=new J.A(t?{wkid:t}:{wkt:a}),c=pe(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=pe(e),new J.A(0!==t?{wkid:t}:{wkt:e})):null}function pe(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function de(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,ce.g7)(e,"SRS")){if(!t.spatialReference){const i=(0,ce.mX)(e);t.spatialReference=he(i)}}else if((0,ce.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=(0,ce.V6)(e,"GeodataXform"),i=he((0,ce.v7)(t,"SpatialReference/WKID")||(0,ce.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=(0,ce.v7)(t,"PolynomialOrder")??1,r=(0,ce.Ui)(t,"CoeffX/Double"),n=(0,ce.Ui)(t,"CoeffY/Double"),a=(0,ce.Ui)(t,"InverseCoeffX/Double"),o=(0,ce.Ui)(t,"InverseCoeffY/Double"),l=fe(r,n),c=fe(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new ue.A({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else(0,ce.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,ce.mX)(e));else if((0,ce.g7)(e,"PAMRasterBand")){const i=function(e){const t=(0,ce.v7)(e,"NoDataValue"),i=(0,ce.V6)(e,"Histograms/HistItem"),s=(0,ce.v7)(i,"HistMin"),r=(0,ce.v7)(i,"HistMax"),n=(0,ce.v7)(i,"BucketCount"),a=(0,ce.mX)(i,"HistCounts")?.split("|").map(e=>Number(e));let o,l,c,u;(0,ce.IC)(e,"Metadata/MDI").forEach(e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}});const f=(0,ce.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=s&&null!=r?{min:s,max:r,size:n||a.length,counts:a}:null,sourceBandIndex:f,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map(e=>e.statistics).filter(oe.Ru):null;const s=!!i[0].histogram;t.histograms=s?i.map(e=>e.histogram).filter(oe.Ru):null}return t}var me=i(51244);let ge=class extends E.A{fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:r,transform:n}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new J.A({wkid:3857})),r?.length&&null==s&&(s=(0,te.Pg)(r));const{width:o,height:l}=t;let c=new z.A({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=n?n.forwardTransform(c):c;let f=!0;if(n){const e=n.forwardCoefficients;f=e&&0===e[1]&&0===e[2],f&&(n=null,c=u)}const h=new se({source:{extent:u,nativeExtent:c,transform:n,pixelBlocks:[t],statistics:s,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,me.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),r="gif"===s||"bmp"===s||!(0,p.A)("ios"),n=await this.decodePixelBlock(t,{format:s,useCanvas:r,hasNoZlibMask:!0});if(null==n)throw new a.A("image-aux-raster:open","the data cannot be decoded");return n}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:i=[],skipMapInfo:s}=this.ioConfig,r=s||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),n=this.datasetFormat,a="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,o=a&&i.includes(a)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+a,{responseType:"text",signal:t}),l=await(0,c.Lx)([r,o]);if(t?.aborted)throw(0,c.NK)();const u=de(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;u.transform=6===e?.length?new ue.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],ge.prototype,"datasetFormat",void 0),ge=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.ImageAuxRaster")],ge);const ye=ge;var we=i(97768),ve=i(84952),xe=i(86738),be=i(20223),Ie=i(87045),Ce=i(25943),Se=i(73037),Ae=i(82371);let Te=class extends E.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:n}=this.rasterInfo,{transposeInfo:a}=r,o=null!=a&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null;let f,h;if(r.isBsqTile){const e=(s.bandIds?.length?s.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...u,bandId:e},responseType:"array-buffer",signal:s.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);h=[];let n=0;for(const{data:e}of t)h.push(n),r.set(new Uint8Array(e),n),n+=e.byteLength;f=r.buffer}else f=(await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal})).data;if(!f)return null;const p=o?a.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=r.blockBoundary[e];if("jpg"!==r.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:w}=r,{x:v,y:x}=this.getPyramidPixelSize(e),b=Math.round((n.xmin-g.x)/v)%y,I=Math.round((n.xmax-g.x)/v)%y||y,C=Math.round((g.y-n.ymax)/x)%w,S=Math.round((g.y-n.ymin)/x)%w||w,A=i===m.minCol?b:0,T=t===m.minRow?C:0,R=i===m.maxCol?I:y,M=t===m.maxRow?S:w;return(0,ee.z$)(d,{x:A,y:T},{width:R-A,height:M-T}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{const i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,s]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let n=r-s+this._levelOffset;const a=i.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,i.row,i.col,t))break}catch{}if(n--,s++,i=this.identifyPixelLocation(a,s,t.datumTransformation),null===i)return null}return-1===n||null==i?null:s}async _open(e){const t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new a.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new a.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if(null==r)throw new a.A("image-server-raster:open","cannot initialize image service");(0,Ae.E9)(r,s);const n="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:r,maxLOD:n}=t;if(null!=r&&null!=n)return Ie.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=n)});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,n=s?t(s):-1/0;return Ie.A.fromJSON({...e,lods:e.lods.filter(e=>{const i=t(e.scale);return i<=r&&i>=n})})}return Ie.A.fromJSON(e)}(s.tileInfo,s):Ie.A.fromJSON(s.tileInfo);(0,we.Lw)(n);const[o,l]=this._computeMinMaxLOD(r,n),{extent:c,pixelSize:u}=r,f=.5/r.width*u.x,h=Math.max(u.x,u.y),{lods:p}=n;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>f||!p.some(e=>Math.abs(e.resolution-h)<f))&&(u.x=u.y=o.resolution,r.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),r.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=o.level-l.level,[m,g]=n.size,y=[],w=[];p.forEach((e,t)=>{e.level>=l.level&&e.level<=o.level&&y.push({x:e.resolution,y:e.resolution}),t<p.length-1&&w.push(Math.round(10*e.resolution/p[t+1].resolution)/10)}),y.sort((e,t)=>e.x-t.x);const v=this.computeBlockBoundary(c,m,g,n.origin,y,d),x=y.length>1?y.slice(1):null;let b;s.transposeInfo&&(b={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0});const I=w.length<=1||w.length>=3&&w.slice(0,-1).every(e=>e===w[0])?w[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/d))/10;if(r.storageInfo=new be.A({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:x,pyramidScalingFactor:I,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:n,isBsqTile:!!s.bsq,transposeInfo:b,blockBoundary:v}),function(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Se.A,e.extent=e.transform.forwardTransform(t))}(r),this._set("rasterInfo",r),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,ve.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Ce.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=J.A.fromJSON(t.spatialReference||e.spatialReference),n=new xe.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new K.A({width:i,height:s,bandCount:3,extent:z.A.fromJSON(e),spatialReference:r,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,Ae.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,n=await Promise.all([s,r]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,n=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),a=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[n,a];if("Raster"===o)return[r.find(e=>e.resolution===i.x)??n,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=n;c>0&&(u=r.find(e=>Math.abs(e.scale-c)<s),u||(u=r.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??n));let f=a;return l>0&&(f=r.find(e=>Math.abs(e.scale-l)<s)??a,this._levelOffset=f.level-a.level),[u,f]}};(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),(0,s.Cg)([(0,f.MZ)()],Te.prototype,"tileType",void 0),Te=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.ImageServerRaster")],Te);const Re=Te;var Me=i(47124);const Oe=new Map;Oe.set("Int8","s8"),Oe.set("UInt8","u8"),Oe.set("Int16","s16"),Oe.set("UInt16","u16"),Oe.set("Int32","s32"),Oe.set("UInt32","u32"),Oe.set("Float32","f32"),Oe.set("Float64","f32"),Oe.set("Double64","f32");const _e=new Map;_e.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),_e.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),_e.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),_e.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Fe=class extends E.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,s={}){const{blockWidth:r,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(r*n);return new U.A({width:r,height:n,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let g=0;for(g=0;g<d;g++)p&&!p.includes(g)||m.push(this.request(this._files.data,{range:{from:u[g].from,to:u[g].to},responseType:"array-buffer",signal:s.signal}));const y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[];let b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;const I=_e.get(this.rasterInfo.storageInfo.compression).decoderFormat,C=await this.decodePixelBlock(v.buffer,{width:r,height:n,format:I,planes:p?.length||l,offsets:x,pixelType:c});if(null==C)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==I&&!C.mask&&(S=S[0],null!=S)){const e=C.width*C.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(g=0;g<e;g++)Math.abs((C.pixels[0][g]-S)/S)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)C.pixels[0][g]!==S&&(t[g]=1);C.mask=t}let A=0,T=0;if(f!==r||h!==n){let e=C.mask;if(e)for(g=0;g<n;g++)if(T=g*r,g<h)for(A=f;A<r;A++)e[T+A]=0;else for(A=0;A<r;A++)e[T+A]=0;else for(e=new Uint8Array(r*n),C.mask=e,g=0;g<h;g++)for(T=g*r,A=0;A<f;A++)e[T+A]=1}return C}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:r}=this._parseHeader(i.data),{skipMapInfo:n,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!n){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,te.Pg)(t.histograms)))}n&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=r;const o=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,r,n,a;if(Me.Z){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),s=new Uint8Array(r),n=0;n<e.byteLength/4;n++)for(a=0;a<4;a++)s[4*n+a]=i[4*n+3-a];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:f,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(f/l/u**g)-1,t=Math.ceil(h/c/u**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return _e.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:r,pyramidScalingFactor:n}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,f,h=0,p=0;for(f=0;f<e;f++)p=n**f,c=Math.ceil(a/s/p),u=Math.ceil(o/r/p),h+=c*u;p=n**e,c=Math.ceil(a/s/p),u=Math.ceil(o/r/p),h+=t*c+i,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<c-1?s:Math.ceil(a/p)-s*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/p)-r*(u-1)}}_parseHeader(e){const t=(0,ce.V6)(e,"MRF_META/Raster");if(!t)throw new a.A("mrf:open","not a valid MRF format");const i=(0,ce.V6)(t,"Size"),s=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),o=((0,ce.mX)(t,"Compression")||"none").toLowerCase();if(!_e.has(o))throw new a.A("mrf:open","currently does not support compression "+o);const l=(0,ce.mX)(t,"DataType")||"UInt8",c=Oe.get(l);if(null==c)throw new a.A("mrf:open","currently does not support pixel type "+l);const u=(0,ce.V6)(t,"PageSize"),f=parseInt(u.getAttribute("x"),10),h=parseInt(u.getAttribute("y"),10),p=(0,ce.V6)(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map(e=>parseFloat(e)))),(0,ce.V6)(e,"MRF_META/CachedSource"))throw new a.A("mrf:open","currently does not support MRF referencing other data files");const g=(0,ce.V6)(e,"MRF_META/GeoTags"),y=(0,ce.V6)(g,"BoundingBox");let w,v=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),i=parseFloat(y.getAttribute("maxx")),s=parseFloat(y.getAttribute("maxy")),r=(0,ce.mX)(g,"Projection")||"";let n=J.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(n=new J.A({wkid:e}))}else n=he(r)??J.A.WGS84;else v=!0,n=new J.A({wkid:3857});w=new z.A(e,t,i,s),w.spatialReference=n}else v=!0,w=new z.A({xmin:-.5,ymin:.5-r,xmax:s-.5,ymax:.5,spatialReference:new J.A({wkid:3857})});const x=(0,ce.V6)(e,"MRF_META/Rsets"),b=parseInt(x?.getAttribute("scale")||"2",10),I=w.spatialReference,C=new be.A({origin:new xe.A({x:w.xmin,y:w.ymax,spatialReference:I}),blockWidth:f,blockHeight:h,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:o,pyramidScalingFactor:b}),S=new xe.A({x:w.width/s,y:w.height/r,spatialReference:I}),A=new K.A({width:s,height:r,extent:w,isPseudoSpatialReference:v,spatialReference:I,bandCount:n,pixelType:c,pixelSize:S,noDataValue:d,storageInfo:C}),T=(0,ce.mX)(e,"datafile"),R=(0,ce.mX)(e,"IndexFile");return{rasterInfo:A,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",_e.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return de(t)}catch{return null}}};(0,s.Cg)([(0,f.MZ)()],Fe.prototype,"_files",void 0),(0,s.Cg)([(0,f.MZ)()],Fe.prototype,"_storageIndex",void 0),(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Fe.prototype,"datasetFormat",void 0),Fe=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.MRFRaster")],Fe);const Pe=Fe;var ke=i(15265);function De(e){const t=e.fields,i=e.records,s=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),n=r.map(e=>e.name),a=[];let o=0,l=0;return i.forEach(e=>{const t={};for(t[s]=o++,l=1;l<n.length;l++)t[n[l]]=e[l-1];a.push({attributes:t})}),{displayFieldName:"",fields:r,features:a}}class Ne{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),r=t.getUint16(8,!0),n=t.getUint16(10,!0),a={version:i,recordCount:s,headerByteCount:r,recordByteCount:n};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ke.w)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>n;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)i.push((0,ke.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.slice(0,4),10),parseInt(s.slice(4,6),10)-1,parseInt(s.slice(6,8),10)))}o+=t.length}),c.push(i)):o+=n}}return{header:a,fields:l,records:c,recordSet:De({fields:l,records:c})}}}var Le=i(45664),Ee=i(12196);const Be=(e,t)=>e.get(t)?.values,ze=(e,t)=>e.get(t)?.values?.[0];let Je=class extends E.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=r&&this._headerInfo.hasMaskBand){const n=await this._fetchRawTiffTile(e,t,i,!0,s);null!=n&&n.pixels[0]instanceof Uint8Array&&(r.mask=n.pixels[0])}return r}async _open(e){const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:r,isBigTiff:n}=(0,Le.uT)(i),l=[],c={fileChunk:i,posIFD:r,fileOffset:0};await this._readIFDs(l,c,s,n?8:4,t);const{imageInfo:u,rasterInfo:f}=function(e){const t=(0,Le.uc)(e),{width:i,height:s,tileWidth:r,tileHeight:n,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:h,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g}=t;let y=he(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),w=!!t.isPseudoGeographic;null==y&&(w=!0,y=new J.A({wkid:3857}));const v=new z.A({...t.extent,spatialReference:y}),x=new xe.A(v?{x:v.xmin,y:v.ymax,spatialReference:y}:{x:0,y:0}),b=new be.A({blockWidth:r,blockHeight:n,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:l,origin:x,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidResolutions:p,blockBoundary:d}),I=new xe.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),C=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let S=null;const A=ze(e[0],"PHOTOMETRICINTERPRETATION"),T=Be(e[0],"COLORMAP");if(A<=3&&T?.length>3&&T.length%3==0){S=[];const e=T.length/3;for(let t=0;t<e;t++)S.push([t,T[t]>>>8,T[t+e]>>>8,T[t+2*e]>>>8])}const R=new K.A({width:i,height:s,bandCount:a,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:w,keyProperties:C,extent:v,colormap:S,statistics:g?g.statistics:null});if(m?.length&&(R.nativeExtent=new z.A({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new ue.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new xe.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),p){const{x:e,y:t}=R.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(l),h=(0,Le.zS)(l),p=(0,Le.r9)(l);if(this._headerInfo={littleEndian:s,isBigTiff:n,ifds:l,pyramidIFDs:h,maskIFDs:p,...u},this._set("rasterInfo",f),!u.isSupported)throw new a.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new a.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");f.isPseudoSpatialReference&&o.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=l[0].get("PREDICTOR")?.values?.[0],m=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===m&&2===d)throw new a.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:g,skipExtensions:y=[]}=this.ioConfig;if(!y.includes("aux.xml")&&!g){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,te.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new xe.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,f)}y.includes("vat.dbf")||1!==f.bandCount||"u8"!==f.pixelType||g||(f.attributeTable=await this._fetchAuxiliaryTable(e),null!=f.attributeTable&&(f.keyProperties.DataType="thematic")),g&&this.updateImageSpaceRasterInfo(f),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:s,posIFD:r}=e;return(r+8>=i.byteLength||r<0)&&(s=r+s,i=(await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:t})).data,r=0),{fileChunk:i,fileOffset:s,posIFD:r}}async _readIFDs(e,t,i,s=4,r){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,r);const n=await this._readIFD(t,i,Ee.NB,s,r);if(!n?.ifd)throw new a.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;t.posIFD=n.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,s,r)}async _readIFD(e,t,i=Ee.NB,s=4,r){let{fileChunk:n,posIFD:a,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,Le.JM)(n,t,a,o,i,s);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,r),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2];a=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:n,posIFD:a,fileOffset:o},r),c=await this._readIFD(l,t,Ee.YC,2,r);e.data=c?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return l}return l.requiredBufferSize?(n=(await this.request(this.url,{range:{from:o,to:o+a+l.requiredBufferSize+8},responseType:"array-buffer",signal:r})).data,n.byteLength<a+l.requiredBufferSize?null:(e.fileChunk=n,e.fileOffset=o,this._readIFD(e,t,i,s,r))):null}async _fillOffsets(e,t,i,s){const r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;const n=r.map(e=>e.offlineOffsetSize),a=Math.min.apply(null,n.map(e=>e[0])),o=Math.max.apply(null,n.map(e=>e[0]+e[1]));let l=1===n.length||o-a<=this._bufferSize;if(!l&&n.length>1&&(n.sort((e,t)=>e[0]-t[0]),l=n.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,n[0][0])===o),l){const e=await this._fetchOffsets(a,Math.max(o,a+this._bufferSize),s);return void r.forEach(i=>(0,Le.Cr)(e,t,i,a))}const c=r.map(async e=>{const i=e.offlineOffsetSize,r=await this._fetchOffsets(i[0],i[1]+i[0],s);(0,Le.Cr)(r,t,e,i[0])});await Promise.all(c)}async _fetchOffsets(e,t,i){const s=[],r=this._chunkSize,n=Math.ceil((t-e)/r);let a=e;for(let e=0;e<n;e++)s.push(this.request(this.url,{range:{from:a,to:e===n-1?t:a+r-1},responseType:"array-buffer",signal:i})),a+=r;const o=await Promise.all(s);if(1===n)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<n;e++)l.set(new Uint8Array(o[e].data),e*r);return l.buffer}async _fetchRawTiffTile(e,t,i,s,r={}){const n=this._getTileLocation(e,t,i,s);if(!n)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=n,u=a.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),f=await Promise.all(u),h=f.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===f.length?f[0].data:new ArrayBuffer(h),d=[0],m=[0];if(f.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<f.length;t++){const s=f[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,m[t]=s.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==w)return null;let v,x,b;if(o!==g||l!==y){let e=w.mask;if(e)for(v=0;v<y;v++)if(b=v*g,v<l)for(x=o;x<g;x++)e[b+x]=0;else for(x=0;x<g;x++)e[b+x]=0;else for(e=new Uint8Array(g*y),w.mask=e,v=0;v<l;v++)for(b=v*g,x=0;x<o;x++)e[b+x]=1}return w}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:r,blockBoundary:n}=this.rasterInfo.storageInfo,a=0===e?0:e-(r-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,Le.XO)(l,o),u=Be(l,"TILEOFFSETS");if(void 0===u)return null;const f=Be(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=n[a];if(t>d||i>m||t<h||i<p)return null;const g=ze(l,"IMAGEWIDTH"),y=ze(l,"IMAGELENGTH"),w=ze(l,"TILEWIDTH"),v=ze(l,"TILELENGTH"),x=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(d+1)*(m+1)+t*(m+1)+i;x[s]={from:u[e],to:u[e]+f[e]-1}}}else{const e=t*(m+1)+i;x.push({from:u[e],to:u[e]+f[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:l,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return de(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Ne.parse(t);return i?.recordSet?re.A.fromJSON(i.recordSet):null}catch{return null}}};(0,s.Cg)([(0,f.MZ)()],Je.prototype,"_files",void 0),(0,s.Cg)([(0,f.MZ)()],Je.prototype,"_headerInfo",void 0),(0,s.Cg)([(0,f.MZ)()],Je.prototype,"_bufferSize",void 0),(0,s.Cg)([(0,f.MZ)()],Je.prototype,"_chunkSize",void 0),(0,s.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Je.prototype,"datasetFormat",void 0),Je=(0,s.Cg)([(0,d.$)("esri.layers.support.rasterDatasets.TIFFRaster")],Je);const $e=Je,Ue=new Map;Ue.set("MRF",{desc:"Meta Raster Format",constructor:Pe}),Ue.set("TIFF",{desc:"GeoTIFF",constructor:$e}),Ue.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Re}),Ue.set("JPG",{desc:"JPG Raster Format",constructor:ye}),Ue.set("PNG",{desc:"PNG Raster Format",constructor:ye}),Ue.set("GIF",{desc:"GIF Raster Format",constructor:ye}),Ue.set("BMP",{desc:"BMP Raster Format",constructor:ye}),Ue.set("CovJSON",{desc:"COVJSON Raster Format",constructor:ae}),Ue.set("MEMORY",{desc:"In Memory Raster Format",constructor:se});class je{static get supportedFormats(){const e=new Set;return Ue.forEach((t,i)=>e.add(i)),e}static async open(e){const{url:t,ioConfig:i,source:s,sourceJSON:r}=e;let n=e.datasetFormat??i?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===s?.type?.toLowerCase()?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const o={url:t,source:s,sourceJSON:r,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(e=>{null==o[e]&&delete o[e]}),n){if(!this.supportedFormats.has(n))throw new a.A("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new a.A("rasterfactory:open",`cannot open raster: ${t}`);const i=new(0,Ue.get(n).constructor)(o);return await i.open({signal:e.signal}),i}const l=Array.from(Ue.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let c=0;const u=()=>{if(n=l[c++],!n)return null;if("CRF"===n)return null;const t=new(0,Ue.get(n).constructor)(o);return t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){Ue.has(e.toUpperCase())||Ue.set(e.toUpperCase(),{desc:t,constructor:i})}}var Ve=i(6049),Ze=i(24212),qe=i(30291),He=i(88625);let Ge=class extends((0,b.dM)((0,O.j)((0,S.q)((0,A.A)((0,R.H)((0,I.d)((0,C.o)((0,T.G)((0,_.e)((0,x.b)((0,M.J)((0,l.P)((0,n.O)(v.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new w(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,c.sg)(async(e,t,s)=>{const{save:r,saveAs:n}=await i.e(9838).then(i.bind(i,59838));switch(e){case 0:return r(this,t);case 1:return n(this,s,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,k.rZ)("Pixel Value"),(0,k.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){const t=(0,k.jC)(i);e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i=(0,k.DV)(t),s=(0,k.y6)();e.push(i,s)}if(r){const t=(0,k.AL)(r);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==k.F_.rawServicePixelValue)),s=(0,qe.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:r}=this.raster;return s?.fieldInfos&&r&&(0,k.h4)(s.fieldInfos,r),s}async generateRasterInfo(e,t){if(e=(0,h.PZ)(D.A,e),await this.load(),!e||"none"===e.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:i}=await this._openFunctionRaster(e,t);return i}catch(e){if(e instanceof a.A)throw e;throw new a.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,N.q)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:s}=this;if(!t&&!s)throw new a.A("imagery-tile-layer:open","missing url or source parameter");s?await this._openFromSource(s,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}const i=this.raster.rasterInfo;if(!i)throw new a.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,N.p)(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const s=[e];t&&(0,Ve.UD)(t.toJSON(),s);const r=await Promise.all(s.map(e=>je.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),n=r.findIndex(e=>null==e);if(n>-1)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${s[n]}`);return this._primaryRasters=r,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await je.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new a.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",s="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!s)throw new a.A("imagery-tile-layer:open",i);"MEMORY"===s&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const r=await je.open({url:"",source:e,datasetFormat:s,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new a.A("imagery-tile-layer:open",i);this._primaryRasters=[r],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=r}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);const s=(0,Ve.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),r=new L.A({rasterFunction:s});return await r.open(t),r}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof a.A&&o.A.getLogger(this).error("imagery-tile-layer:open",e.message),o.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(){const e=this.elevationInfo;(0,Ze.XF)(o.A.getLogger(this),(0,Ze.$7)("ImageryTile layers","relative-to-scene",e)),(0,Ze.XF)(o.A.getLogger(this),(0,Ze.tW)("ImageryTile layers",e))}};(0,s.Cg)([(0,f.MZ)({clonable:!1})],Ge.prototype,"_primaryRasters",void 0),(0,s.Cg)([(0,f.MZ)({type:He.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Ge.prototype,"elevationInfo",null),(0,s.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],Ge.prototype,"graphicOrigin",void 0),(0,s.Cg)([(0,f.MZ)(F.fV)],Ge.prototype,"legendEnabled",void 0),(0,s.Cg)([(0,f.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ge.prototype,"isReference",void 0),(0,s.Cg)([(0,f.MZ)({type:["show","hide"]})],Ge.prototype,"listMode",void 0),(0,s.Cg)([(0,f.MZ)({json:{read:!0,write:!0}})],Ge.prototype,"blendMode",void 0),(0,s.Cg)([(0,f.MZ)({type:D.A,json:{name:"renderingRule",write:!0}})],Ge.prototype,"rasterFunction",void 0),(0,s.Cg)([(0,f.MZ)()],Ge.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,f.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Ge.prototype,"version",void 0),(0,s.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ge.prototype,"type",void 0),(0,s.Cg)([(0,f.MZ)({type:["ArcGISTiledImageServiceLayer"]})],Ge.prototype,"operationalLayerType",void 0),(0,s.Cg)([(0,f.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],Ge.prototype,"popupEnabled",void 0),(0,s.Cg)([(0,f.MZ)({type:r.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ge.prototype,"popupTemplate",void 0),(0,s.Cg)([(0,f.MZ)({readOnly:!0})],Ge.prototype,"defaultPopupTemplate",null),(0,s.Cg)([(0,f.MZ)({readOnly:!0,type:[P.A]})],Ge.prototype,"fields",void 0),(0,s.Cg)([(0,f.MZ)({readOnly:!0,type:[P.A]})],Ge.prototype,"rasterFields",null),(0,s.Cg)([(0,f.MZ)({constructOnly:!0})],Ge.prototype,"source",void 0),Ge=(0,s.Cg)([(0,d.$)("esri.layers.ImageryTileLayer")],Ge);const We=Ge},56551:(e,t,i)=>{i.d(t,{H:()=>h});var s=i(31635),r=i(10107),n=(i(44208),i(53966),i(87811),i(40608)),a=i(69540),o=i(25482),l=i(56507),c=i(93223),u=i(94359);let f=class extends((0,a.O)(o.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"name",void 0),(0,s.Cg)([(0,r.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,c.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],f.prototype,"method",void 0),(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],f.prototype,"value",void 0),(0,s.Cg)([(0,r.MZ)({type:[l.jz],json:{write:{isRequired:!0}}})],f.prototype,"bandIds",void 0),(0,s.Cg)([(0,r.MZ)({types:u.uy,json:{write:!0,origins:{"web-scene":{types:u.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],f.prototype,"renderer",void 0),f=(0,s.Cg)([(0,n.$)("esri.renderers.support.RasterPresetRenderer")],f);const h=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,s.Cg)([(0,r.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,s.Cg)([(0,r.MZ)({type:[f],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,s.Cg)([(0,n.$)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},69397:(e,t,i)=>{i.d(t,{$B:()=>r,Qf:()=>c,Qh:()=>o,RS:()=>n,ez:()=>h,lM:()=>a,qK:()=>f});var s=i(34275);function r(e){return 32+e.length}const n=16;function a(e){if(!e)return 0;let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let i=h;for(let s=0;s<t;s++)i+=l(e[s]);return i}(e);let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):f;case"string":return r(e);case"number":return n;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,s.iu)(t)?t.byteLength+p:Array.isArray(t)?u(t,n):0:0),0)}function u(e,t){return h+e.length*t}const f=32,h=16,p=145},73037:(e,t,i)=>{i.d(t,{A:()=>c});var s,r=i(31635),n=i(10107),a=(i(44208),i(53966),i(87811),i(93223)),o=i(40608),l=i(82434);let c=s=class extends l.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new s({tolerance:this.tolerance})}};(0,r.Cg)([(0,a.e)({GCSShiftXform:"gcs-shift"})],c.prototype,"type",void 0),(0,r.Cg)([(0,n.MZ)()],c.prototype,"tolerance",void 0),c=s=(0,r.Cg)([(0,o.$)("esri.layers.support.rasterTransforms.GCSShiftTransform")],c)},82371:(e,t,i)=>{i.d(t,{E9:()=>d,Tw:()=>h,X6:()=>p});var s=i(78888),r=i(5443),n=i(86738),a=i(16930),o=i(87186),l=i(20223),c=i(2272),u=i(22671);async function f(e,t,i){const f=(0,c.Dl)(e),{rasterFunction:h,sourceJSON:p}=t||{},d=h?JSON.stringify(h.rasterFunctionDefinition||h):null,m=(0,c.lF)({...f.query,renderingRule:d,f:"json"}),g=(0,c.jV)(m,i);e=f.path;const y=p||await(0,s.A)(e,g).then(e=>e.data),w=y.hasRasterAttributeTable?(0,s.A)(`${e}/rasterAttributeTable`,g):null,v=y.hasColormap?(0,s.A)(`${e}/colormap`,g):null,x=y.hasHistograms?(0,s.A)(`${e}/histograms`,g):null,b=y.currentVersion>=10.3?(0,s.A)(`${e}/keyProperties`,g):null,I=y.hasMultidimensions?(0,s.A)(`${e}/multidimensionalInfo`,g):null,C=await Promise.allSettled([w,v,x,b,I]);let S=null;if(y.minValues&&y.minValues.length===y.bandCount){S=[];for(let e=0;e<y.minValues.length;e++)S.push({min:y.minValues[e],max:y.maxValues[e],avg:y.meanValues[e],stddev:y.stdvValues[e]})}const A=r.A.fromJSON(y.extent),T=Math.ceil(A.width/y.pixelSizeX-.1),R=Math.ceil(A.height/y.pixelSizeY-.1),M=a.A.fromJSON(y.spatialReference||y.extent.spatialReference),O="fulfilled"===C[0].status?C[0].value?.data:null,_=O?.features?.length?u.A.fromJSON(O):null,F="fulfilled"===C[1].status?C[1].value?.data.colormap:null,P=F?.length?F:null,k="fulfilled"===C[2].status?C[2].value?.data.histograms:null,D=k?.[0]?.counts?.length?k:null,N="fulfilled"===C[3].status?C[3].value?.data??{}:{},L="fulfilled"===C[4].status?C[4].value?.data.multidimensionalInfo:null,E=L?.variables?.length?L:null;E&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")})});const{defaultVariable:B,serviceDataType:z}=y;B&&B!==N.DefaultVariable&&(N.DefaultVariable=B),z?.includes("esriImageServiceDataTypeVector")&&!z.includes(N.DataType)&&(N.DataType=z.replace("esriImageServiceDataType",""));let J=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==J)&&(J=y.noDataValues);const $=y.transposeInfo?new l.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new n.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:M}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new o.A({width:T,height:R,bandCount:y.bandCount,extent:r.A.fromJSON(y.extent),spatialReference:M,pixelSize:new n.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:M}),pixelType:y.pixelType.toLowerCase(),statistics:S,attributeTable:_,colormap:P,histograms:D,keyProperties:N,noDataValue:J,multidimensionalInfo:E,storageInfo:$})}function h(e,t,i){return f(e,{sourceJSON:t},i)}function p(e,t,i){return f(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},82434:(e,t,i)=>{i.d(t,{A:()=>o});var s=i(31635),r=i(25482),n=i(10107),a=(i(44208),i(53966),i(87811),i(40608));let o=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,s.Cg)([(0,n.MZ)()],o.prototype,"affectsPixelSize",null),(0,s.Cg)([(0,n.MZ)({json:{write:!0}})],o.prototype,"spatialReference",void 0),o=(0,s.Cg)([(0,a.$)("esri.layers.support.rasterTransforms.BaseRasterTransform")],o)}}]);
|