@arcgis/core 4.33.0-next.20250331 → 4.33.0-next.20250402
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/applications/SceneViewer/sceneViewerUtils.d.ts +1 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0297e55a49ca0d1231ef.js +1 -0
- package/assets/esri/core/workers/chunks/{98da74243df03e0cc70d.js → 067dda58592fbf4fb812.js} +1 -1
- package/assets/esri/core/workers/chunks/0cd5f15b8558b23e5fcd.js +1 -0
- package/assets/esri/core/workers/chunks/0db4c0071282dd94f3b2.js +1 -0
- package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +1 -0
- package/assets/esri/core/workers/chunks/{4d95cc85f4b73e857b1f.js → 11badb73d43059374ad8.js} +1 -1
- package/assets/esri/core/workers/chunks/{dcb043986fb065de0366.js → 16607e71804eff64c0e1.js} +1 -1
- package/assets/esri/core/workers/chunks/18f8b41bd761e9ab60d0.js +1 -0
- package/assets/esri/core/workers/chunks/{ed831e51c2a03ee95879.js → 19e83b184d8b4d0b3007.js} +1 -1
- package/assets/esri/core/workers/chunks/{5de3aee547113bfd59df.js → 1b87fa15470cce26feea.js} +1 -1
- package/assets/esri/core/workers/chunks/{dde03a893f9cef8e0f45.js → 1d322685016263f86cf5.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4b80c8f4c45fd78bde1.js → 23de8aeed5b82c682cbe.js} +1 -1
- package/assets/esri/core/workers/chunks/269531e770376ed9e4fd.js +1 -0
- package/assets/esri/core/workers/chunks/2791f1f2791087d0217f.js +1 -0
- package/assets/esri/core/workers/chunks/{48ad7beb48dcc2693cc3.js → 2ab7d36409e9af3ac3da.js} +1 -1
- package/assets/esri/core/workers/chunks/{a7a1832274892e99c388.js → 30a047bd66f333bb7d2d.js} +1 -1
- package/assets/esri/core/workers/chunks/{94292c7afff18694d55e.js → 322cb1b1871d03b69f0a.js} +37 -37
- package/assets/esri/core/workers/chunks/37e49d1a1407c193dcd0.js +1 -0
- package/assets/esri/core/workers/chunks/3b7284516a0e34a9e85e.js +1 -0
- package/assets/esri/core/workers/chunks/{6cb5ce0a6bb85c624a21.js → 400f95295bbfced31076.js} +1 -1
- package/assets/esri/core/workers/chunks/401ff3c83789c72e9ac9.js +1 -0
- package/assets/esri/core/workers/chunks/{6339a24874c698594101.js → 40b33c9bd271cddbd837.js} +1 -1
- package/assets/esri/core/workers/chunks/48fbf887da6d19838bf0.js +1 -0
- package/assets/esri/core/workers/chunks/4ba34124054752b363c0.js +1 -0
- package/assets/esri/core/workers/chunks/4cc77769009901a112ec.js +39 -0
- package/assets/esri/core/workers/chunks/{ba4d91816f6a0bf0d812.js → 4dc135e0133d58a06d67.js} +1 -1
- package/assets/esri/core/workers/chunks/5aae4e127e888f69435a.js +1 -0
- package/assets/esri/core/workers/chunks/{0943695a1dcd21c45e83.js → 5b32c2a1b276352593dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{087a09b4c41abef6b516.js → 5c757e20c0543e6a49b3.js} +1 -1
- package/assets/esri/core/workers/chunks/6280e1fe944ea4a71b91.js +1 -0
- package/assets/esri/core/workers/chunks/{9c59fc2df8081e65a128.js → 628395830c78b95b46dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{edcc0fefd57323d2cb67.js → 6828e4936db0121a9638.js} +1 -1
- package/assets/esri/core/workers/chunks/{1cd9b5ef62582b25df9b.js → 69b5d0ef14fb521b0fd7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b52a3a48d2d3ff22542d.js → 6a8cf1f51cc4adc268d3.js} +1 -1
- package/assets/esri/core/workers/chunks/6e679703b5d6fc1b91a5.js +1 -0
- package/assets/esri/core/workers/chunks/6f3731f19497cbc6ea74.js +1 -0
- package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +1 -0
- package/assets/esri/core/workers/chunks/7649d59b0b7d53818a29.js +1 -0
- package/assets/esri/core/workers/chunks/{fe3ed029b07bb1e4aef3.js → 77ae11dbd3e1eeacd7ee.js} +1 -1
- package/assets/esri/core/workers/chunks/7978b66cdfe078960ddd.js +1 -0
- package/assets/esri/core/workers/chunks/7b8f0b63b968ff40d00d.js +1 -0
- package/assets/esri/core/workers/chunks/7e00122014d0a55363a8.js +319 -0
- package/assets/esri/core/workers/chunks/{f452ca61842dbe8de9af.js → 7ea5bbb52e84be9a608e.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb9d2bb8b44a93347274.js → 7ef9bcd58af499a14a08.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2f8702a9f54fff23ad9.js → 7f31dbe0ca8974a10be8.js} +1 -1
- package/assets/esri/core/workers/chunks/80427cd9f0c2e07f21c3.js +1 -0
- package/assets/esri/core/workers/chunks/{77199b4b39ee8b4303de.js → 82a58a405332d43a328f.js} +1 -1
- package/assets/esri/core/workers/chunks/{626db8488f9d931cf55c.js → 899f197556b6ced6eddf.js} +2 -2
- package/assets/esri/core/workers/chunks/8aae03e347ab18ae6ee2.js +1 -0
- package/assets/esri/core/workers/chunks/8d49c79e549e90371303.js +1 -0
- package/assets/esri/core/workers/chunks/{a9b6377f1fef5826f28d.js → 8f35416a5036897d6289.js} +1 -1
- package/assets/esri/core/workers/chunks/91439b59260b0fb04be9.js +1 -0
- package/assets/esri/core/workers/chunks/{bdeac9196f28aff93e68.js → 93d06a1a0b700ddb3807.js} +1 -1
- package/assets/esri/core/workers/chunks/{a01c86910fe4984eb788.js → 9574896c90b39fa7ecb4.js} +1 -1
- package/assets/esri/core/workers/chunks/96978d039f183565bffa.js +1 -0
- package/assets/esri/core/workers/chunks/9a641fb94819574e48f6.js +1 -0
- package/assets/esri/core/workers/chunks/{72c7126dbd27fa48fcdb.js → a3421383e48379012c9c.js} +1 -1
- package/assets/esri/core/workers/chunks/b28b699de6deb7e9fa53.js +1 -0
- package/assets/esri/core/workers/chunks/{1a5f96b1b892ecceb36a.js → b4a1f3f3a036226d6810.js} +1 -1
- package/assets/esri/core/workers/chunks/{f8d1c7df671733c3325c.js → b64f708f821dd2bb51cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{3e4204502f6e09483c60.js → b7a1185ac49480fc1410.js} +1 -1
- package/assets/esri/core/workers/chunks/{738e4f46feb3758456e0.js → baa9fd23414f03ef90bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa712f850fd129ca5ed8.js → bba6d7615d8f3862fe70.js} +1 -1
- package/assets/esri/core/workers/chunks/{1cf8a431e5da946c7d27.js → bd0dbad694ce5531deab.js} +1 -1
- package/assets/esri/core/workers/chunks/c1bd47cde53918f454ca.js +1 -0
- package/assets/esri/core/workers/chunks/{1d0473dd43c88ab5776d.js → c589d32f8efcca6bf712.js} +1 -1
- package/assets/esri/core/workers/chunks/{081699532b183db1e7c2.js → cda6ae4c5cb67e22b454.js} +1 -1
- package/assets/esri/core/workers/chunks/{e2029267cddb8e2effab.js → d58fae2fc9d148e015ae.js} +1 -1
- package/assets/esri/core/workers/chunks/{460afde071df9f35182d.js → e14449f07ed3386f4f2b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0fbd4c6bffe0cb98d14.js → e592731ac12b9bc646ff.js} +1 -1
- package/assets/esri/core/workers/chunks/e5aff9b10877fb04d6de.js +1 -0
- package/assets/esri/core/workers/chunks/e6469173c65531d6524a.js +1 -0
- package/assets/esri/core/workers/chunks/e6544e966f14fb410157.js +1 -0
- package/assets/esri/core/workers/chunks/e8312c999b3f0c9ef09e.js +1 -0
- package/assets/esri/core/workers/chunks/{cb386923200272cf26a9.js → e9e517a2141e504eec64.js} +1 -1
- package/assets/esri/core/workers/chunks/eb011e8b14db37ddb110.js +1 -0
- package/assets/esri/core/workers/chunks/{f809cbfb744adb4fad29.js → efb0f3ec2344adcb24f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{999e8dbe6f4d0665b3ab.js → f5fcba6ca6f43bf1d65d.js} +1 -1
- package/assets/esri/core/workers/chunks/fa9ef9e8eae505371965.js +1 -0
- package/assets/esri/core/workers/chunks/fb5b852d0f72df014377.js +1 -0
- package/assets/esri/core/workers/chunks/ff62b813fff4a015a8a6.js +1 -0
- package/core/has.js +1 -1
- package/core/sql/WhereClause.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
- package/geometry/asserts.js +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +96 -8
- package/layers/TileLayer.js +1 -1
- package/layers/graphics/applyEditsUtils.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/support/sourceUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/VideoElement.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/networks/support/UtilityNetworkLookupHelper.js +1 -1
- package/package.json +3 -3
- package/portal/support/geometryServiceUtils.js +1 -1
- package/renderers/support/DictionaryScriptEvaluator.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/ElevationInfo.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/versionManagement/VersioningState.js +1 -1
- package/views/2d/engine/webgl/Mesh2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
- package/views/3d/layers/i3s/I3SQueryFeatureStore.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
- package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
- package/views/layers/PointCloudLayerView.d.ts +1 -1
- package/views/layers/PointCloudLayerView.js +5 -0
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/textureUtils.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +5 -0
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +5 -0
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/dataCaptureUtils.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/028e2e0fa6971aaaaae8.js +0 -1
- package/assets/esri/core/workers/chunks/0e82365be7d9257e7cb2.js +0 -1
- package/assets/esri/core/workers/chunks/1322096a72e910f23167.js +0 -1
- package/assets/esri/core/workers/chunks/186387a561364a11e574.js +0 -1
- package/assets/esri/core/workers/chunks/3808f10747cecc8a1a9b.js +0 -1
- package/assets/esri/core/workers/chunks/3f7c57d5f3bdefa74d18.js +0 -1
- package/assets/esri/core/workers/chunks/424e2058228e5f6a183d.js +0 -1
- package/assets/esri/core/workers/chunks/4816cf647eca2f4cecc2.js +0 -1
- package/assets/esri/core/workers/chunks/4aa0a58ded4465ea28bd.js +0 -1
- package/assets/esri/core/workers/chunks/4bb65ef7b3a02ebe416e.js +0 -1
- package/assets/esri/core/workers/chunks/4d798da25a726f179089.js +0 -319
- package/assets/esri/core/workers/chunks/4ffdff269aae8c293cb4.js +0 -1
- package/assets/esri/core/workers/chunks/564cc81c232c97646833.js +0 -1
- package/assets/esri/core/workers/chunks/5820808c7659460969d4.js +0 -1
- package/assets/esri/core/workers/chunks/5d01f0b86566d08ba29d.js +0 -1
- package/assets/esri/core/workers/chunks/6c378e7a6ca29d530880.js +0 -1
- package/assets/esri/core/workers/chunks/7d1c39c2a80e20a0595f.js +0 -1
- package/assets/esri/core/workers/chunks/86ee278919038260696e.js +0 -39
- package/assets/esri/core/workers/chunks/8752f807c05d1ec215e8.js +0 -1
- package/assets/esri/core/workers/chunks/8ef5e6f1c606e5e41002.js +0 -1
- package/assets/esri/core/workers/chunks/921b41b101957cfc1cfd.js +0 -1
- package/assets/esri/core/workers/chunks/9ef509e0853ad41f7690.js +0 -1
- package/assets/esri/core/workers/chunks/9f18de17fbcad0e5c140.js +0 -1
- package/assets/esri/core/workers/chunks/a53e9f5092de715da025.js +0 -1
- package/assets/esri/core/workers/chunks/aa3a45e8228216c1739b.js +0 -1
- package/assets/esri/core/workers/chunks/ab0113d1269675dcd520.js +0 -1
- package/assets/esri/core/workers/chunks/b23d16745674486ddd6c.js +0 -1
- package/assets/esri/core/workers/chunks/b3c126e8a0a722c03efc.js +0 -1
- package/assets/esri/core/workers/chunks/c7aa4a8263e21f631004.js +0 -1
- package/assets/esri/core/workers/chunks/cc441051a52bfbda9caf.js +0 -1
- package/assets/esri/core/workers/chunks/ccc6f6f7052985bebdab.js +0 -1
- package/assets/esri/core/workers/chunks/d3912886ac2910290f43.js +0 -1
- package/assets/esri/core/workers/chunks/d8b903b4147b090576f2.js +0 -1
- package/assets/esri/core/workers/chunks/da8a002d18544def5383.js +0 -1
- package/assets/esri/core/workers/chunks/f28eaf1d3a7f12788bcf.js +0 -1
- package/assets/esri/core/workers/chunks/f9bedb421d4e115a888f.js +0 -1
- package/assets/esri/core/workers/chunks/faed301a25252c619cff.js +0 -1
- package/assets/esri/core/workers/chunks/fc9758006a7135c7d9c3.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as h,isMultipoint as u}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as p}from"../../intl/messages.js";import d from"../../layers/FeatureLayer.js";import g from"../../layers/GraphicsLayer.js";import y from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as m,getOwningPortalUrl as f}from"../../layers/support/layerUtils.js";import w from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as _}from"../../networks/support/utils.js";import b from"../../portal/Portal.js";import{hasUserTypeExtension as A}from"../../portal/support/utils.js";import{trace as v}from"../../rest/networks/trace.js";import k from"../../rest/networks/support/TraceLocation.js";import I from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as G}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as R}from"./support/GeometryHandler.js";import{GraphicHandler as F,barrierColor as L,startingPointColor as T}from"./support/GraphicHandler.js";import{ResultAreaHandler as H}from"./support/ResultAreaHandler.js";import{UtilityHelper as N}from"./support/UtilityHelper.js";const S=()=>p("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),P=()=>p("esri/core/t9n/Units"),U=`utility-network-trace-flags-${Date.now()}`,V=`utility-network-trace-results-${Date.now()}`,B=`utility-network-trace-sketch-${Date.now()}`;function C(e){return e instanceof y}function E(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function j(e){return"layer"in e}function D(e){return void 0!==e.layerViews}function O(e){return"graphics"===e.type}function M(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function x(e){const t=new d({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await f(e.layerUrl),r=new b({url:t});await r.load();const s=r?.user?.username;return!!s&&A(r,s,"utilityNetwork")}return!0}let q=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new N,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new R,this.graphicHandler=new F,this._resultAreaHandler=new H;(async()=>{const[e,t]=await Promise.all([S(),P()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach((t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then((s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}}))}))}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then((e=>{e&&this.selectTracesOnLoad()}))}addFlagByHit(e,t){const r=!!this.view&&this.view.popupEnabled,s=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise(((i,a)=>{r&&s(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(l=>{if("complete"===l.state){const o=this._getGraphicLayer(B);o&&l.graphic&&o.remove(l.graphic),this.queryFlagByHitTest(l,e,t).then((r=>{this.emit("add-flag-complete",{type:e,symbol:t}),i(r)})).catch((r=>{this.emit("add-flag-error",{type:e,symbol:t}),a(r)})).finally((()=>{r&&s(!0),this._clickHandler?.remove()}))}})),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})}))}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some((e=>e.globalId===a&&e.type===t))){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o((()=>null!=this.view&&!this.view.updating));return(await Promise.all(this.flags.map((async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?L:T,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}})))).filter((e=>!e))}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(V)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))})),this._flags=r}async callTrace(){const e=this.traces.filter((e=>e.selected));return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach((e=>{this.removeResultGraphicFromView(e)})),this.traceResults=[],this.removeSelection(),await Promise.all(e.map((async(e,t)=>{const r=e,s=new I({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then((e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then((e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))})))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}})).catch((e=>{throw this._activeProgress=!1,e}))}))),!0)}cancelAddFlagByHit(){this._sketchViewModel.cancel()}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach((r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)})),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach((r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)}))}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter((e=>e.selected));t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some((e=>"starting-point"===e.type))||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter((e=>null!==e.allTerminals)).some((e=>!e.selectedTerminals.length))&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some((e=>e))}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter((t=>t.trace.globalId===e.globalId));r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter((t=>t.trace.globalId!==e.globalId))}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(h(t[0])||u(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,v(t,r,{timeout:this._traceTimeout}).then((t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date}))).catch((t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date})))}async getNonspatialTraceLocationInitialFeature(){return new Promise(((e,t)=>{this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(async r=>{if("complete"!==r.state)return;const s=this._getGraphicLayer(B);s&&r.graphic&&s.remove(r.graphic);const i=this.view?.toScreen(r.graphic?.geometry);if(!i)return;const a=await(this.view?.hitTest(i));if(a?.results.length){const r=a.results.find((e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer)));r?e(r):t(null)}})),this._sketchViewModel.create("point")}))}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach((e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)}));const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof w){try{const t=e.map;await t.loadAll()}finally{this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await x(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll()}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)})),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach((t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])})),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter((e=>e?.parsedUrl?.path===s[0].layerUrl)).filter(m)??[];this._getUniqueMapLayerViews(t).filter((({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl)).forEach((({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)}));const l=(await Promise.all(a.map((async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await _(s,!1);return a})))).filter((({featureSet:e})=>e.features.length>0));return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then((e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach((e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter((e=>e.globalId===a)).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}})),this._flags=s,!0}return!1}))}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(V)?.graphics;e.graphicEnabled=!1;const s=r?.filter((t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId));s?.forEach((e=>{this._getGraphicLayer(V)?.remove(e)}))}removeFlag(e){const t=this._flags.filter((t=>{if(t.id!==e.id)return t}));this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach((e=>{e&&e.remove()})),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach((r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}})),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach((e=>{e.selected=!1})),this.traces=e,this.view&&(this._getGraphicLayer(B)?.removeAll(),this._getGraphicLayer(U)?.removeAll(),this._getGraphicLayer(V)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach((e=>{j(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&E(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))}))}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then((e=>{this.emit("select-features",{resultSet:e})}))}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach((r=>{t===r.globalId&&(r.selected=e)})),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach((e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)})))}zoomToAsset(e){this.view?.goTo(e).catch((e=>console.error(e)))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(B),this._createGraphicLayer(U),this._createGraphicLayer(V),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(B),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter((({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e)).toArray(),s=e=>{for(const r of e.layerViews)D(r)?s(r):t.push(r)};return r.forEach((e=>{switch(e.layer.type){case"group":D(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some((t=>t.layer.id===e.layer.id))||t.push(e)}})),t}_processFlags(e){const t=[];return e.forEach((e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach((r=>{const s=new k({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)}));else{const r=new k({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}})),t}_getDisplayField(e){return"subtype-sublayer"===e?.layer?.type?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.layer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.layer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach((e=>{e.code===t&&(r=e.name)}))}else if(null!=e.types&&e.types.length>0){const s=e.types.filter((e=>e.id===t));s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter((e=>e.name.toLowerCase()===t.toLowerCase()));if(i.length>0&&C(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter((({code:e})=>e===r));e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce(((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e)),{})}async _lookupFlagByHit(e){const t=e.graphic?.geometry,r=[];if(t&&h(t)&&this.view){const s=this.view.toScreen(t);if(s){const t=await this.view.hitTest(s,{include:this._validUNLayers});if(t?.results.length){const s=t.results.find((e=>null!==e.layer));if(s.graphic?.geometry)if("polyline"===s.graphic.geometry.type){const t={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(s.graphic.geometry,e.graphic?.geometry,s.graphic.geometry.spatialReference),displayValue:this._getDisplayField(s.graphic),mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...t},r.push(s)}else if(("point"===s.graphic.geometry.type||"polygon"===s.graphic.geometry.type)&&this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(s.graphic),t=this._getDisplayField(s.graphic),i={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:t,mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...i},r.push(s)}}}}return r}_createFlagProperty(e,t,r){const s=new k;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach((e=>{M(e)&&r(e)})):t.some((t=>t.layerId===e.layerId))&&e.fields.some((e=>"assetgroup"===e.name.toLowerCase()))&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)M(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(U)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new g({id:e,internal:!0,listMode:"hide",title:e});G(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&O(r))return r}return null}};e([n()],q.prototype,"_activeProgress",void 0),e([n()],q.prototype,"_flags",void 0),e([n()],q.prototype,"traces",void 0),e([n()],q.prototype,"defaultGraphicColor",void 0),e([n()],q.prototype,"enableResultArea",void 0),e([n()],q.prototype,"flags",void 0),e([n()],q.prototype,"gdbVersion",void 0),e([n()],q.prototype,"messages",void 0),e([n()],q.prototype,"messagesUnits",void 0),e([n()],q.prototype,"resultAreaProperties",null),e([n()],q.prototype,"selectedTraces",void 0),e([n()],q.prototype,"selectOnComplete",void 0),e([n()],q.prototype,"showGraphicsOnComplete",void 0),e([n()],q.prototype,"showSelectionAttributes",void 0),e([n({readOnly:!0})],q.prototype,"state",null),e([n()],q.prototype,"traceResults",void 0),e([n()],q.prototype,"utilityNetwork",void 0),e([n({value:null})],q.prototype,"view",null),q=e([c("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],q);const z=q;export{z as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as h,isMultipoint as u}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as p}from"../../intl/messages.js";import d from"../../layers/FeatureLayer.js";import g from"../../layers/GraphicsLayer.js";import y from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as m,getOwningPortalUrl as f}from"../../layers/support/layerUtils.js";import w from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as _}from"../../networks/support/utils.js";import b from"../../portal/Portal.js";import{hasUserTypeExtension as A}from"../../portal/support/utils.js";import{trace as v}from"../../rest/networks/trace.js";import k from"../../rest/networks/support/TraceLocation.js";import I from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as G}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as R}from"./support/GeometryHandler.js";import{GraphicHandler as F,barrierColor as L,startingPointColor as T}from"./support/GraphicHandler.js";import{ResultAreaHandler as H}from"./support/ResultAreaHandler.js";import{UtilityHelper as N}from"./support/UtilityHelper.js";const S=()=>p("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),P=()=>p("esri/core/t9n/Units"),U=`utility-network-trace-flags-${Date.now()}`,V=`utility-network-trace-results-${Date.now()}`,B=`utility-network-trace-sketch-${Date.now()}`;function C(e){return e instanceof y}function E(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function j(e){return"layer"in e}function D(e){return void 0!==e.layerViews}function O(e){return"graphics"===e.type}function M(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function x(e){const t=new d({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await f(e.layerUrl),r=new b({url:t});await r.load();const s=r?.user?.username;return!!s&&A(r,s,"utilityNetwork")}return!0}let q=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new N,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new R,this.graphicHandler=new F,this._resultAreaHandler=new H;(async()=>{const[e,t]=await Promise.all([S(),P()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach((t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then((s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}}))}))}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then((e=>{e&&this.selectTracesOnLoad()}))}addFlagByHit(e,t){const r=!!this.view&&this.view.popupEnabled,s=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise(((i,a)=>{r&&s(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(l=>{if("complete"===l.state){const o=this._getGraphicLayer(B);o&&l.graphic&&o.remove(l.graphic),this.queryFlagByHitTest(l,e,t).then((r=>{this.emit("add-flag-complete",{type:e,symbol:t}),i(r)})).catch((r=>{this.emit("add-flag-error",{type:e,symbol:t}),a(r)})).finally((()=>{r&&s(!0),this._clickHandler?.remove()}))}})),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})}))}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some((e=>e.globalId===a&&e.type===t))){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o((()=>null!=this.view&&!this.view.updating));return(await Promise.all(this.flags.map((async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?L:T,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}})))).filter((e=>!e))}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(V)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))})),this._flags=r}async callTrace(){const e=this.traces.filter((e=>e.selected));return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach((e=>{this.removeResultGraphicFromView(e)})),this.traceResults=[],this.removeSelection(),await Promise.all(e.map((async(e,t)=>{const r=e,s=new I({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then((e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then((e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))})))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}})).catch((e=>{throw this._activeProgress=!1,e}))}))),!0)}cancelAddFlagByHit(){this._sketchViewModel.cancel()}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach((r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)})),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach((r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)}))}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter((e=>e.selected));t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some((e=>"starting-point"===e.type))||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter((e=>null!==e.allTerminals)).some((e=>!e.selectedTerminals.length))&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some((e=>e))}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter((t=>t.trace.globalId===e.globalId));r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter((t=>t.trace.globalId!==e.globalId))}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(h(t[0])||u(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,v(t,r,{timeout:this._traceTimeout}).then((t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date}))).catch((t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date})))}async getNonspatialTraceLocationInitialFeature(){return new Promise(((e,t)=>{this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",(async r=>{if("complete"!==r.state)return;const s=this._getGraphicLayer(B);s&&r.graphic&&s.remove(r.graphic);const i=this.view?.toScreen(r.graphic?.geometry);if(!i)return;const a=await(this.view?.hitTest(i));if(a?.results.length){const r=a.results.find((e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer)));r?e(r):t(null)}})),this._sketchViewModel.create("point")}))}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach((e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)}));const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof w){try{const t=e.map;await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await x(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach((r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)})),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach((t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])})),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter((e=>e?.parsedUrl?.path===s[0].layerUrl)).filter(m)??[];this._getUniqueMapLayerViews(t).filter((({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl)).forEach((({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)}));const l=(await Promise.all(a.map((async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await _(s,!1);return a})))).filter((({featureSet:e})=>e.features.length>0));return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then((e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach((e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter((e=>e.globalId===a)).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(U)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}})),this._flags=s,!0}return!1}))}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(V)?.graphics;e.graphicEnabled=!1;const s=r?.filter((t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId));s?.forEach((e=>{this._getGraphicLayer(V)?.remove(e)}))}removeFlag(e){const t=this._flags.filter((t=>{if(t.id!==e.id)return t}));this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach((e=>{e&&e.remove()})),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach((r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}})),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach((e=>{e.selected=!1})),this.traces=e,this.view&&(this._getGraphicLayer(B)?.removeAll(),this._getGraphicLayer(U)?.removeAll(),this._getGraphicLayer(V)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach((e=>{j(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&E(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))}))}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then((e=>{this.emit("select-features",{resultSet:e})}))}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach((r=>{t===r.globalId&&(r.selected=e)})),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach((e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)})))}zoomToAsset(e){this.view?.goTo(e).catch((e=>console.error(e)))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(B),this._createGraphicLayer(U),this._createGraphicLayer(V),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(B),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter((({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e)).toArray(),s=e=>{for(const r of e.layerViews)D(r)?s(r):t.push(r)};return r.forEach((e=>{switch(e.layer.type){case"group":D(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some((t=>t.layer.id===e.layer.id))||t.push(e)}})),t}_processFlags(e){const t=[];return e.forEach((e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach((r=>{const s=new k({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)}));else{const r=new k({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}})),t}_getDisplayField(e){return"subtype-sublayer"===e?.layer?.type?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.layer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.layer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach((e=>{e.code===t&&(r=e.name)}))}else if(null!=e.types&&e.types.length>0){const s=e.types.filter((e=>e.id===t));s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter((e=>e.name.toLowerCase()===t.toLowerCase()));if(i.length>0&&C(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter((({code:e})=>e===r));e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce(((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e)),{})}async _lookupFlagByHit(e){const t=e.graphic?.geometry,r=[];if(t&&h(t)&&this.view){const s=this.view.toScreen(t);if(s){const t=await this.view.hitTest(s,{include:this._validUNLayers});if(t?.results.length){const s=t.results.find((e=>null!==e.layer));if(s.graphic?.geometry)if("polyline"===s.graphic.geometry.type){const t={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(s.graphic.geometry,e.graphic?.geometry,s.graphic.geometry.spatialReference),displayValue:this._getDisplayField(s.graphic),mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...t},r.push(s)}else if(("point"===s.graphic.geometry.type||"polygon"===s.graphic.geometry.type)&&this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(s.graphic),t=this._getDisplayField(s.graphic),i={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:t,mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...i},r.push(s)}}}}return r}_createFlagProperty(e,t,r){const s=new k;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach((e=>{M(e)&&r(e)})):t.some((t=>t.layerId===e.layerId))&&e.fields.some((e=>"assetgroup"===e.name.toLowerCase()))&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)M(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(U)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new g({id:e,internal:!0,listMode:"hide",title:e});G(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&O(r))return r}return null}};e([n()],q.prototype,"_activeProgress",void 0),e([n()],q.prototype,"_flags",void 0),e([n()],q.prototype,"traces",void 0),e([n()],q.prototype,"defaultGraphicColor",void 0),e([n()],q.prototype,"enableResultArea",void 0),e([n()],q.prototype,"flags",void 0),e([n()],q.prototype,"gdbVersion",void 0),e([n()],q.prototype,"messages",void 0),e([n()],q.prototype,"messagesUnits",void 0),e([n()],q.prototype,"resultAreaProperties",null),e([n()],q.prototype,"selectedTraces",void 0),e([n()],q.prototype,"selectOnComplete",void 0),e([n()],q.prototype,"showGraphicsOnComplete",void 0),e([n()],q.prototype,"showSelectionAttributes",void 0),e([n({readOnly:!0})],q.prototype,"state",null),e([n()],q.prototype,"traceResults",void 0),e([n()],q.prototype,"utilityNetwork",void 0),e([n({value:null})],q.prototype,"view",null),q=e([c("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],q);const z=q;export{z as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import o from"../../core/Error.js";import e from"../../core/Logger.js";import{watch as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import n from"../../layers/FeatureLayer.js";import{getOwningPortalUrl as d}from"../../layers/support/layerUtils.js";import c from"../../portal/Portal.js";import{hasUserTypeExtension as u}from"../../portal/support/utils.js";let h=class extends t{constructor(r){super(r),this._updatingHandlesLoad=new l,this._updatingHandlesExecute=new l}initialize(){this.addHandles([i((()=>[this.utilityNetwork,this.view]),(()=>{this._setUp()}),{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this.utilityNetwork}set utilityNetwork(r){this._get("utilityNetwork")!==r&&this._set("utilityNetwork",r)}get view(){return this.view}set view(r){this._get("view")!==r&&this._set("view",r)}async executeNamedTraceConfiguration(r){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(r))}async executeTraceConfiguration(r){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(r))}async _executeNamedTraceConfiguration(r){if("disabled"===this.state){const r="trace-analysis-view-model:load-error";throw this._logError(r,this.loadError),new o(r,this.loadError)}this._executionError=null;return await this.utilityNetwork.trace(r).catch((r=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),r}))}async _executeTraceConfiguration(r){if("disabled"===this.state){const r="trace-analysis-view-model:load-error";throw this._logError(r,this.loadError),new o(r,this.loadError)}this._executionError=null;return await this.utilityNetwork.trace(r).catch((r=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),r}))}_logError(r,t){e.getLogger(this).error(new o(r,t))}async _setUp(){const{utilityNetwork:r,view:t}=this;this._updatingHandlesLoad.addPromise((async()=>{this._loadError=null;const e="trace-analysis-view-model:load-error";if(!t)throw this._loadError="no-view",this._logError(e,this.loadError),new o(e,this.loadError);if("2d"!==t.type)throw this._loadError="sceneView-not-supported",this._logError(e,this._loadError),new o(e,this.loadError);if("utility"!==r?.type)throw this._loadError="no-utility-network",this._logError(e,this.loadError),new o(e,this.loadError);r.loaded||await r.load().catch((r=>{throw this._loadError="no-utility-network",this._logError(e,this.loadError),r})),this._checkUserTypeExtension(r)})())}async _checkUserTypeExtension(r){const t=new n({url:r.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const e=t.version;if(Number(e)<=11.1){const t=await d(r.layerUrl),e=new c({url:t});await e.load();const i=e.user?.username??"";if(!await u(e,i,"utilityNetwork")){const r="trace-analysis-view-model:load-error";throw this._loadError="no-user-type-extension",this._logError(r,this.loadError),new o(r,this.loadError)}}}};r([s()],h.prototype,"_executionError",void 0),r([s()],h.prototype,"_loadError",void 0),r([s()],h.prototype,"executionError",null),r([s()],h.prototype,"loadError",null),r([s({readOnly:!0})],h.prototype,"state",null),r([s()],h.prototype,"utilityNetwork",null),r([s()],h.prototype,"view",null),h=r([a("esri.widgets.UtilityNetworkTraceAnalysis.UtilityNetworkTraceAnalysisViewModel")],h);const p=h;export{p as default};
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import o from"../../core/Error.js";import e from"../../core/Logger.js";import{watch as i}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../core/support/UpdatingHandles.js";import n from"../../layers/FeatureLayer.js";import{getOwningPortalUrl as d}from"../../layers/support/layerUtils.js";import c from"../../portal/Portal.js";import{hasUserTypeExtension as u}from"../../portal/support/utils.js";let h=class extends t{constructor(r){super(r),this._updatingHandlesLoad=new l,this._updatingHandlesExecute=new l}initialize(){this.addHandles([i((()=>[this.utilityNetwork,this.view]),(()=>{this._setUp()}),{initial:!0})])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get executionError(){return this._executionError}get loadError(){return this._loadError}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":"ready"}get utilityNetwork(){return this.utilityNetwork}set utilityNetwork(r){this._get("utilityNetwork")!==r&&this._set("utilityNetwork",r)}get view(){return this.view}set view(r){this._get("view")!==r&&this._set("view",r)}async executeNamedTraceConfiguration(r){return this._updatingHandlesExecute.addPromise(this._executeNamedTraceConfiguration(r))}async executeTraceConfiguration(r){return this._updatingHandlesExecute.addPromise(this._executeTraceConfiguration(r))}async _executeNamedTraceConfiguration(r){if("disabled"===this.state){const r="trace-analysis-view-model:load-error";throw this._logError(r,this.loadError),new o(r,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(r).catch((r=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),r}))}async _executeTraceConfiguration(r){if("disabled"===this.state){const r="trace-analysis-view-model:load-error";throw this._logError(r,this.loadError),new o(r,this.loadError??"")}this._executionError=null;return await this.utilityNetwork.trace(r).catch((r=>{throw this._executionError="trace-error",this._logError("trace-analysis-view-model:execution-error",this.executionError),r}))}_logError(r,t){e.getLogger(this).error(new o(r,t??""))}async _setUp(){const{utilityNetwork:r,view:t}=this;this._updatingHandlesLoad.addPromise((async()=>{this._loadError=null;const e="trace-analysis-view-model:load-error";if(!t)throw this._loadError="no-view",this._logError(e,this.loadError),new o(e,this.loadError??"");if("2d"!==t.type)throw this._loadError="sceneView-not-supported",this._logError(e,this._loadError),new o(e,this.loadError??"");if("utility"!==r?.type)throw this._loadError="no-utility-network",this._logError(e,this.loadError),new o(e,this.loadError??"");r.loaded||await r.load().catch((r=>{throw this._loadError="no-utility-network",this._logError(e,this.loadError),r})),this._checkUserTypeExtension(r)})())}async _checkUserTypeExtension(r){const t=new n({url:r.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const e=t.version;if(Number(e)<=11.1){const t=await d(r.layerUrl),e=new c({url:t});await e.load();const i=e.user?.username??"";if(!await u(e,i,"utilityNetwork")){const r="trace-analysis-view-model:load-error";throw this._loadError="no-user-type-extension",this._logError(r,this.loadError),new o(r,this.loadError??"")}}}};r([s()],h.prototype,"_executionError",void 0),r([s()],h.prototype,"_loadError",void 0),r([s()],h.prototype,"executionError",null),r([s()],h.prototype,"loadError",null),r([s({readOnly:!0})],h.prototype,"state",null),r([s()],h.prototype,"utilityNetwork",null),r([s()],h.prototype,"view",null),h=r([a("esri.widgets.UtilityNetworkTraceAnalysis.UtilityNetworkTraceAnalysisViewModel")],h);const p=h;export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import o from"../../core/Collection.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as n,on as s}from"../../core/reactiveUtils.js";import{removeTrailingSlash as a}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{getOwningPortalUrl as p}from"../../layers/support/layerUtils.js";import l from"../../portal/Portal.js";import{hasUserTypeExtension as h,hasPrivilege as m}from"../../portal/support/utils.js";import c from"../../rest/featureService/FeatureService.js";import{createFeatureServices as g}from"../../rest/featureService/utils.js";import{getVersioningStates as w}from"../../versionManagement/utils.js";import f from"../../versionManagement/VersioningState.js";import E from"../../versionManagement/VersionManagementService.js";import{createVersionAdapters as L}from"../../versionManagement/versionAdapters/utils.js";let _=class extends r{constructor(e){super(e),this._portalLookup=new Map,this._updatingHandlesLoad=new v,this._updatingHandlesExecute=new v,this.advancedEditingUserTypeExtensionLookup=new Map,this.executionError=void 0,this.featureServiceLookup=new Map,this.loadError=void 0,this.serverVersionLookup=new Map,this.serviceNameLookup=new Map,this.userLookup=new Map,this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionAdministratorLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map,this.view=null,this.versioningStates=null}initialize(){this._viewChangeHandle(),this.addHandles([n((()=>this.view),(()=>{this._resetAllLookupProperties(),this._viewChangeHandle()})),n((()=>this.versioningStates),(()=>{this._resetVersioningLookupProperties(),this._setVersioningStatesLookups()}))])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":this.executionError?"failed":"ready"}async alterVersion(e){return this._updatingHandlesExecute.addPromise(this._alterVersionInternal(e))}async changeVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._changeVersionInternal(e,r,o))}async createVersion(e){return this._updatingHandlesExecute.addPromise(this._createVersionInternal(e))}async deleteVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._deleteVersionInternal(e,r,o))}async getVersionInfos(e){return this._updatingHandlesExecute.addPromise(this._getVersionInfosInternal(e))}async _alterVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.versioningStateLookup.get(e.featureServerUrl);if(!r)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(!this.serverVersionLookup.has(e.featureServerUrl)||this.serverVersionLookup.get(e.featureServerUrl)<=11.1)throw this._logError("version-management-view-model:execution-error","no-valid-enterprise-version"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const{featureServerUrl:o,versionIdentifier:i,...n}=e,s=await r.alterVersion(i,n).catch((e=>{throw this._logExecutionError(e),e}));return await this.getVersionInfos(o),s}async _changeVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.changeVersion(n).catch((e=>{throw this._logExecutionError(e),e}))}_updateVersionableItems(e){this._updatingHandlesLoad.addPromise((async()=>{L(e.added).forEach((e=>{const r=e.featureServiceUrl,o=this.versioningStateLookup.get(r);o&&(o.versionableItems.find((r=>r.versionableItem===e.versionableItem))||o.versionableItems.add(e))}));L(e.removed).forEach((e=>{const{allLayers:r,allTables:o}=this.view.map,t=e.featureServiceUrl,i=this.versioningStateLookup.get(t);if(!i)return void this._logError("version-management-view-model:execution-error","no-version-management-service-found");const n=e=>("feature"===e.type||"subtype-group"===e.type)&&(e.url?.includes(t)??!1);[...r.filter(n),...o.filter(n)].length||(this.featureServiceLookup.delete(t),this.serviceNameLookup.delete(t),this.versioningStateLookup.delete(t),this.versioningStates.remove(i));const s=i.versionableItems.find((r=>r.versionableItem===e.versionableItem));s&&i.versionableItems.remove(s)}))})())}async _createVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=e.featureServerUrl,o=this.versioningStateLookup.get(r);if(!o)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);const i=this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl),n=this.userLookup.get(r).toUpperCase(),s=this._isEmptyString(e.ownerName)?n:e.ownerName?.trim().toUpperCase();if(s!==n){if(this.serverVersionLookup.get(r)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!i)throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError)}let a=await(this.versioningStateLookup.get(r)?.getVersionInfos());if("SDE"===s?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase()||a?.find((r=>r.versionIdentifier.name.toUpperCase()===(s+"."+e.versionName).toUpperCase()||r.versionIdentifier.name.toUpperCase()===(n+"."+e.versionName).toUpperCase())))throw this._logError("version-management-view-model:execution-error","no-valid-version-name"),new t("version-management-view-model:execution-error",this.executionError);const d=await o.versionManagementService.createVersion({versionName:e.versionName,access:s!==n?"public":e.access,description:e.description}).catch((e=>{throw this._logExecutionError(e),e}));if(s!==n){const{guid:o,name:t}=d.versionIdentifier,i={featureServerUrl:r,versionIdentifier:{guid:o,name:t},access:e.access,ownerName:s};await this.alterVersion(i)||this.deleteVersion(r,n+"."+e.versionName,d.versionIdentifier.guid)}return await this.getVersionInfos(r),a=await(this.versioningStateLookup.get(r)?.getVersionInfos()),a?.find((e=>e.versionIdentifier.guid===d.versionIdentifier.guid))}async _deleteVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);if(this.serverVersionLookup.get(e)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError);if(!this.advancedEditingUserTypeExtensionLookup.get(e))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError);const n={name:r,guid:o};return await i.deleteVersion(n).catch((e=>{throw this._logExecutionError(e),new t("version-management-view-model:execution-error",this.executionError)}))}async _getVersionInfosInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError);this._setExecutionError();const r=this.featureServiceLookup.get(e)?.featureService;if(!r)throw this._logError("version-management-view-model:execution-error","no-feature-service-found"),new t("version-management-view-model:execution-error",this.executionError);r.loaded||await r.load().catch((e=>{throw this._logExecutionError(e),e}));const o=r.url;this.serverVersionLookup.set(o,r.sourceJSON?.currentVersion??0),this.serverVersionLookup.get(o)<=11.1&&this.advancedEditingUserTypeExtensionLookup.set(o,!1);const i=this.userLookup.get(e);this._portalLookup.get(e)&&i?(this.advancedEditingUserTypeExtensionLookup.set(o,await h(this._portalLookup.get(e),i,"advediting")),this.versionAdministratorLookup.set(o,await m(this._portalLookup.get(e),i,"features:user:manageVersions"))):(this.advancedEditingUserTypeExtensionLookup.set(o,!1),this.versionAdministratorLookup.set(o,!1));const n=this.versioningStateLookup.get(e);if(!n)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError);n.loaded||await n.load().catch((e=>{throw this._logExecutionError(e),e}));return await n.getVersionInfos(!0).catch((e=>{throw this._logExecutionError(e),e}))}_isEmptyString(e){return!e||0===e.trim().length}_logError(e,r){switch(i.getLogger(this).error(new t(e,r)),e){case"version-management-view-model:load-error":this._setLoadError(r);break;case"version-management-view-model:execution-error":this._setExecutionError(r)}}_logExecutionError(e){this._logError("version-management-view-model:execution-error",e.message)}async _viewChangeHandle(){this._updatingHandlesLoad.addPromise((async()=>{if(this._setLoadError(),!this.view)return void this._setLoadError("no-view-property");if(this.view&&"2d"!==this.view.type)return void this._logError("version-management-view-model:load-error","sceneView-not-supported");this.removeHandles("map-change-handle"),this.addHandles([n((()=>this.view?.map),(()=>{this._resetAllLookupProperties(),this._mapChangeHandle(this.versioningStates)}))],"map-change-handle");const e=await this._getVersioningStates();await this._mapChangeHandle(e)})())}async _mapChangeHandle(e){this._updatingHandlesLoad.addPromise((async()=>{this._setLoadError(),this.removeHandles("map-layers-tables-change-handle"),this.addHandles([s((()=>this.view?.map.allLayers),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))})),s((()=>this.view?.map.allTables),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))}))],"map-layers-tables-change-handle"),await this._propertiesChangeInternal(e)})())}async _propertiesChangeInternal(e){this._updatingHandlesLoad.addPromise((async()=>{const r=e=>"feature"===e.type||"subtype-group"===e.type,{allLayers:o,allTables:t}=this.view.map;if(this._setLoadError(),this.featureServiceLookup=g([...o.filter(r),...t.filter(r)]),this.featureServiceLookup.size){this._updateFeatureServiceLookup(e),this.serviceNameLookup=new Map;for(const e of this.featureServiceLookup.values()){const{featureService:r,featureService:{url:o}}=e;if(!this.serviceNameLookup.has(o)){if(r.loaded||await r.load().catch((e=>{i.getLogger(this).error(e)})),!r.versionManagementServiceUrl){this.featureServiceLookup.delete(o);continue}const e=await p(o),t=new l({authMode:"immediate",url:e});await t.load().catch((e=>{i.getLogger(this).error(e)}));const n=t.user?.username;if(!r.loaded||!t.loaded||!n)continue;this.serviceNameLookup.set(a(o),o.split("/").at(-2)),this.userLookup.set(o,n),this._portalLookup.set(o,t)}}this.removeHandles("versioning-states-change-handle"),e.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(e),this.versioningStates=e}else this._logError("version-management-view-model:load-error","no-feature-services")})())}_updateFeatureServiceLookup(e){for(const r of e){const e=r.featureServiceUrl;if(!this.featureServiceLookup.has(e)){const o=new c({url:e}),t=r.versionableItems.toArray().flatMap((e=>"network"===e.type?null:e.versionableItem)).filter((e=>!!e));this.featureServiceLookup.set(e,{featureService:o,layers:t})}}}async _updateVersioningStates(e){for(const r of this.featureServiceLookup.values()){const t=r.featureService;if(!t.versionManagementServiceUrl)continue;if(!e.find((e=>e.featureServiceUrl===t.url))&&t.versionManagementServiceUrl){const i=new o(L(r.layers)),n=new f({versionManagementService:new E({url:t.versionManagementServiceUrl}),versionableItems:i});e.add(n),this._handleVersioningStateLookupUpdate(n)}await this.getVersionInfos(t.url)}}async _getVersioningStates(){return this.versioningStates&&this.versioningStates.length?this.versioningStates:this.view?await w(this.view,!1):(this._logError("version-management-view-model:load-error","no-view-property"),new o)}_handleVersioningStateLookupUpdate(e){this.versioningStateLookup.set(e.featureServiceUrl,e),this._addHandlesToVersioningState(e),this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier),this.versionManagementServiceLookup.set(e.featureServiceUrl,e.versionManagementService)}async _setVersioningStatesLookups(){this._updatingHandlesLoad.addPromise((async()=>{this.versioningStates&&(this.removeHandles("versioning-states-change-handle"),this._updateFeatureServiceLookup(this.versioningStates),this.versioningStates.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(this.versioningStates))})())}_addHandlesToVersioningState(e){this.addHandles([n((()=>e.versionInfos),(()=>{this.versionInfoLookup.set(e.featureServiceUrl,e.versionInfos)})),n((()=>e.currentVersionInfo?.versionIdentifier),(()=>{this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier)}))],"versioning-states-change-handle")}_resetVersioningLookupProperties(){this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map}_resetAllLookupProperties(){this._portalLookup=new Map,this.advancedEditingUserTypeExtensionLookup=new Map,this.serverVersionLookup=new Map,this.userLookup=new Map,this.versioningStates=new o,this._resetVersioningLookupProperties(),this._resetServiceRelatedLookupProperties()}_resetServiceRelatedLookupProperties(){this.featureServiceLookup=new Map,this.serviceNameLookup=new Map}_setExecutionError(e){this._set("executionError",e)}_setLoadError(e){this._set("loadError",e)}};e([d()],_.prototype,"_portalLookup",void 0),e([d()],_.prototype,"advancedEditingUserTypeExtensionLookup",void 0),e([d({readOnly:!0})],_.prototype,"executionError",void 0),e([d()],_.prototype,"featureServiceLookup",void 0),e([d({readOnly:!0})],_.prototype,"loadError",void 0),e([d()],_.prototype,"serverVersionLookup",void 0),e([d()],_.prototype,"serviceNameLookup",void 0),e([d({readOnly:!0})],_.prototype,"state",null),e([d()],_.prototype,"userLookup",void 0),e([d()],_.prototype,"versionIdentifierLookup",void 0),e([d()],_.prototype,"versionInfoLookup",void 0),e([d()],_.prototype,"versionAdministratorLookup",void 0),e([d()],_.prototype,"versionManagementServiceLookup",void 0),e([d()],_.prototype,"versioningStateLookup",void 0),e([d()],_.prototype,"view",void 0),e([d()],_.prototype,"versioningStates",void 0),_=e([u("esri.widgets.VersionManagement.VersionManagementViewModel")],_);const S=_;export{S as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import o from"../../core/Collection.js";import t from"../../core/Error.js";import i from"../../core/Logger.js";import{watch as n,on as s}from"../../core/reactiveUtils.js";import{removeTrailingSlash as a}from"../../core/urlUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{getOwningPortalUrl as p}from"../../layers/support/layerUtils.js";import l from"../../portal/Portal.js";import{hasUserTypeExtension as h,hasPrivilege as m}from"../../portal/support/utils.js";import c from"../../rest/featureService/FeatureService.js";import{createFeatureServices as g}from"../../rest/featureService/utils.js";import{getVersioningStates as w}from"../../versionManagement/utils.js";import f from"../../versionManagement/VersioningState.js";import E from"../../versionManagement/VersionManagementService.js";import{createVersionAdapters as L}from"../../versionManagement/versionAdapters/utils.js";let _=class extends r{constructor(e){super(e),this._portalLookup=new Map,this._updatingHandlesLoad=new v,this._updatingHandlesExecute=new v,this.advancedEditingUserTypeExtensionLookup=new Map,this.executionError=void 0,this.featureServiceLookup=new Map,this.loadError=void 0,this.serverVersionLookup=new Map,this.serviceNameLookup=new Map,this.userLookup=new Map,this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionAdministratorLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map,this.view=null,this.versioningStates=null}initialize(){this._viewChangeHandle(),this.addHandles([n((()=>this.view),(()=>{this._resetAllLookupProperties(),this._viewChangeHandle()})),n((()=>this.versioningStates),(()=>{this._resetVersioningLookupProperties(),this._setVersioningStatesLookups()}))])}destroy(){this._updatingHandlesLoad.destroy(),this._updatingHandlesExecute.destroy()}get state(){return this._updatingHandlesLoad.updating?"loading":this.loadError?"disabled":this._updatingHandlesExecute.updating?"executing":this.executionError?"failed":"ready"}async alterVersion(e){return this._updatingHandlesExecute.addPromise(this._alterVersionInternal(e))}async changeVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._changeVersionInternal(e,r,o))}async createVersion(e){return this._updatingHandlesExecute.addPromise(this._createVersionInternal(e))}async deleteVersion(e,r,o){return this._updatingHandlesExecute.addPromise(this._deleteVersionInternal(e,r,o))}async getVersionInfos(e){return this._updatingHandlesExecute.addPromise(this._getVersionInfosInternal(e))}async _alterVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError??"");this._setExecutionError();const r=this.versioningStateLookup.get(e.featureServerUrl);if(!r)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError??"");if(!this.serverVersionLookup.has(e.featureServerUrl)||this.serverVersionLookup.get(e.featureServerUrl)<=11.1)throw this._logError("version-management-view-model:execution-error","no-valid-enterprise-version"),new t("version-management-view-model:execution-error",this.executionError??"");if(!this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError??"");const{featureServerUrl:o,versionIdentifier:i,...n}=e,s=await r.alterVersion(i,n).catch((e=>{throw this._logExecutionError(e),e}));return await this.getVersionInfos(o),s}async _changeVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError??"");this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError??"");const n={name:r,guid:o};return await i.changeVersion(n).catch((e=>{throw this._logExecutionError(e),e}))}_updateVersionableItems(e){this._updatingHandlesLoad.addPromise((async()=>{L(e.added).forEach((e=>{const r=e.featureServiceUrl,o=this.versioningStateLookup.get(r);o&&(o.versionableItems.find((r=>r.versionableItem===e.versionableItem))||o.versionableItems.add(e))}));L(e.removed).forEach((e=>{const{allLayers:r,allTables:o}=this.view.map,t=e.featureServiceUrl,i=this.versioningStateLookup.get(t);if(!i)return void this._logError("version-management-view-model:execution-error","no-version-management-service-found");const n=e=>("feature"===e.type||"subtype-group"===e.type)&&(e.url?.includes(t)??!1);[...r.filter(n),...o.filter(n)].length||(this.featureServiceLookup.delete(t),this.serviceNameLookup.delete(t),this.versioningStateLookup.delete(t),this.versioningStates.remove(i));const s=i.versionableItems.find((r=>r.versionableItem===e.versionableItem));s&&i.versionableItems.remove(s)}))})())}async _createVersionInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError??"");this._setExecutionError();const r=e.featureServerUrl,o=this.versioningStateLookup.get(r);if(!o)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError??"");const i=this.advancedEditingUserTypeExtensionLookup.get(e.featureServerUrl),n=this.userLookup.get(r).toUpperCase(),s=this._isEmptyString(e.ownerName)?n:e.ownerName?.trim().toUpperCase();if(s!==n){if(this.serverVersionLookup.get(r)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError??"");if(!i)throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError??"")}let a=await(this.versioningStateLookup.get(r)?.getVersionInfos());if("SDE"===s?.toUpperCase()&&"DEFAULT"===e.versionName.toUpperCase()||a?.find((r=>r.versionIdentifier.name.toUpperCase()===(s+"."+e.versionName).toUpperCase()||r.versionIdentifier.name.toUpperCase()===(n+"."+e.versionName).toUpperCase())))throw this._logError("version-management-view-model:execution-error","no-valid-version-name"),new t("version-management-view-model:execution-error",this.executionError??"");const d=await o.versionManagementService.createVersion({versionName:e.versionName,access:s!==n?"public":e.access,description:e.description}).catch((e=>{throw this._logExecutionError(e),e}));if(s!==n){const{guid:o,name:t}=d.versionIdentifier,i={featureServerUrl:r,versionIdentifier:{guid:o,name:t},access:e.access,ownerName:s};await this.alterVersion(i)||this.deleteVersion(r,n+"."+e.versionName,d.versionIdentifier.guid)}return await this.getVersionInfos(r),a=await(this.versioningStateLookup.get(r)?.getVersionInfos()),a?.find((e=>e.versionIdentifier.guid===d.versionIdentifier.guid))}async _deleteVersionInternal(e,r,o){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError??"");this._setExecutionError();const i=this.versioningStateLookup.get(e);if(!i)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError??"");if(this.serverVersionLookup.get(e)<=11.1)throw this._logError("version-management-view-model:execution-error","versioning-api-error"),new t("version-management-view-model:execution-error",this.executionError??"");if(!this.advancedEditingUserTypeExtensionLookup.get(e))throw this._logError("version-management-view-model:execution-error","no-advanced-editing-user-type-extension"),new t("version-management-view-model:execution-error",this.executionError??"");const n={name:r,guid:o};return await i.deleteVersion(n).catch((e=>{throw this._logExecutionError(e),new t("version-management-view-model:execution-error",this.executionError??"")}))}async _getVersionInfosInternal(e){if("disabled"===this.state)throw this._logError("version-management-view-model:load-error",this.loadError),new t("version-management-view-model:load-error",this.loadError??"");this._setExecutionError();const r=this.featureServiceLookup.get(e)?.featureService;if(!r)throw this._logError("version-management-view-model:execution-error","no-feature-service-found"),new t("version-management-view-model:execution-error",this.executionError??"");r.loaded||await r.load().catch((e=>{throw this._logExecutionError(e),e}));const o=r.url;this.serverVersionLookup.set(o,r.sourceJSON?.currentVersion??0),this.serverVersionLookup.get(o)<=11.1&&this.advancedEditingUserTypeExtensionLookup.set(o,!1);const i=this.userLookup.get(e);this._portalLookup.get(e)&&i?(this.advancedEditingUserTypeExtensionLookup.set(o,await h(this._portalLookup.get(e),i,"advediting")),this.versionAdministratorLookup.set(o,await m(this._portalLookup.get(e),i,"features:user:manageVersions"))):(this.advancedEditingUserTypeExtensionLookup.set(o,!1),this.versionAdministratorLookup.set(o,!1));const n=this.versioningStateLookup.get(e);if(!n)throw this._logError("version-management-view-model:execution-error","no-versioning-state-found"),new t("version-management-view-model:execution-error",this.executionError??"");n.loaded||await n.load().catch((e=>{throw this._logExecutionError(e),e}));return await n.getVersionInfos(!0).catch((e=>{throw this._logExecutionError(e),e}))}_isEmptyString(e){return!e||0===e.trim().length}_logError(e,r){switch(i.getLogger(this).error(new t(e,r??"")),e){case"version-management-view-model:load-error":this._setLoadError(r);break;case"version-management-view-model:execution-error":this._setExecutionError(r)}}_logExecutionError(e){this._logError("version-management-view-model:execution-error",e.message)}async _viewChangeHandle(){this._updatingHandlesLoad.addPromise((async()=>{if(this._setLoadError(),!this.view)return void this._setLoadError("no-view-property");if(this.view&&"2d"!==this.view.type)return void this._logError("version-management-view-model:load-error","sceneView-not-supported");this.removeHandles("map-change-handle"),this.addHandles([n((()=>this.view?.map),(()=>{this._resetAllLookupProperties(),this._mapChangeHandle(this.versioningStates)}))],"map-change-handle");const e=await this._getVersioningStates();await this._mapChangeHandle(e)})())}async _mapChangeHandle(e){this._updatingHandlesLoad.addPromise((async()=>{this._setLoadError(),this.removeHandles("map-layers-tables-change-handle"),this.addHandles([s((()=>this.view?.map.allLayers),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))})),s((()=>this.view?.map.allTables),"change",(e=>{(e.added.some((({type:e})=>"feature"===e))||e.removed.some((({type:e})=>"feature"===e))||e.added.some((({type:e})=>"subtype-group"===e))||e.removed.some((({type:e})=>"subtype-group"===e)))&&(this._resetServiceRelatedLookupProperties(),this._propertiesChangeInternal(this.versioningStates),this._updateVersionableItems(e))}))],"map-layers-tables-change-handle"),await this._propertiesChangeInternal(e)})())}async _propertiesChangeInternal(e){this._updatingHandlesLoad.addPromise((async()=>{const r=e=>"feature"===e.type||"subtype-group"===e.type,{allLayers:o,allTables:t}=this.view.map;if(this._setLoadError(),this.featureServiceLookup=g([...o.filter(r),...t.filter(r)]),this.featureServiceLookup.size){this._updateFeatureServiceLookup(e),this.serviceNameLookup=new Map;for(const e of this.featureServiceLookup.values()){const{featureService:r,featureService:{url:o}}=e;if(!this.serviceNameLookup.has(o)){if(r.loaded||await r.load().catch((e=>{i.getLogger(this).error(e)})),!r.versionManagementServiceUrl){this.featureServiceLookup.delete(o);continue}const e=await p(o),t=new l({authMode:"immediate",url:e});await t.load().catch((e=>{i.getLogger(this).error(e)}));const n=t.user?.username;if(!r.loaded||!t.loaded||!n)continue;this.serviceNameLookup.set(a(o),o.split("/").at(-2)),this.userLookup.set(o,n),this._portalLookup.set(o,t)}}this.removeHandles("versioning-states-change-handle"),e.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(e),this.versioningStates=e}else this._logError("version-management-view-model:load-error","no-feature-services")})())}_updateFeatureServiceLookup(e){for(const r of e){const e=r.featureServiceUrl;if(!this.featureServiceLookup.has(e)){const o=new c({url:e}),t=r.versionableItems.toArray().flatMap((e=>"network"===e.type?null:e.versionableItem)).filter((e=>!!e));this.featureServiceLookup.set(e,{featureService:o,layers:t})}}}async _updateVersioningStates(e){for(const r of this.featureServiceLookup.values()){const t=r.featureService;if(!t.versionManagementServiceUrl)continue;if(!e.find((e=>e.featureServiceUrl===t.url))&&t.versionManagementServiceUrl){const i=new o(L(r.layers)),n=new f({versionManagementService:new E({url:t.versionManagementServiceUrl}),versionableItems:i});e.add(n),this._handleVersioningStateLookupUpdate(n)}await this.getVersionInfos(t.url)}}async _getVersioningStates(){return this.versioningStates&&this.versioningStates.length?this.versioningStates:this.view?await w(this.view,!1):(this._logError("version-management-view-model:load-error","no-view-property"),new o)}_handleVersioningStateLookupUpdate(e){this.versioningStateLookup.set(e.featureServiceUrl,e),this._addHandlesToVersioningState(e),this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier),this.versionManagementServiceLookup.set(e.featureServiceUrl,e.versionManagementService)}async _setVersioningStatesLookups(){this._updatingHandlesLoad.addPromise((async()=>{this.versioningStates&&(this.removeHandles("versioning-states-change-handle"),this._updateFeatureServiceLookup(this.versioningStates),this.versioningStates.forEach((e=>this._handleVersioningStateLookupUpdate(e))),await this._updateVersioningStates(this.versioningStates))})())}_addHandlesToVersioningState(e){this.addHandles([n((()=>e.versionInfos),(()=>{this.versionInfoLookup.set(e.featureServiceUrl,e.versionInfos)})),n((()=>e.currentVersionInfo?.versionIdentifier),(()=>{this.versionIdentifierLookup.set(e.featureServiceUrl,e.currentVersionInfo?.versionIdentifier)}))],"versioning-states-change-handle")}_resetVersioningLookupProperties(){this.versionIdentifierLookup=new Map,this.versionInfoLookup=new Map,this.versionManagementServiceLookup=new Map,this.versioningStateLookup=new Map}_resetAllLookupProperties(){this._portalLookup=new Map,this.advancedEditingUserTypeExtensionLookup=new Map,this.serverVersionLookup=new Map,this.userLookup=new Map,this.versioningStates=new o,this._resetVersioningLookupProperties(),this._resetServiceRelatedLookupProperties()}_resetServiceRelatedLookupProperties(){this.featureServiceLookup=new Map,this.serviceNameLookup=new Map}_setExecutionError(e){this._set("executionError",e)}_setLoadError(e){this._set("loadError",e)}};e([d()],_.prototype,"_portalLookup",void 0),e([d()],_.prototype,"advancedEditingUserTypeExtensionLookup",void 0),e([d({readOnly:!0})],_.prototype,"executionError",void 0),e([d()],_.prototype,"featureServiceLookup",void 0),e([d({readOnly:!0})],_.prototype,"loadError",void 0),e([d()],_.prototype,"serverVersionLookup",void 0),e([d()],_.prototype,"serviceNameLookup",void 0),e([d({readOnly:!0})],_.prototype,"state",null),e([d()],_.prototype,"userLookup",void 0),e([d()],_.prototype,"versionIdentifierLookup",void 0),e([d()],_.prototype,"versionInfoLookup",void 0),e([d()],_.prototype,"versionAdministratorLookup",void 0),e([d()],_.prototype,"versionManagementServiceLookup",void 0),e([d()],_.prototype,"versioningStateLookup",void 0),e([d()],_.prototype,"view",void 0),e([d()],_.prototype,"versioningStates",void 0),_=e([u("esri.widgets.VersionManagement.VersionManagementViewModel")],_);const S=_;export{S as default};
|
package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{ignoreAbortErrors as a,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as h}from"../../../layers/support/layerUtils.js";import p from"../../../rest/networks/support/NetworkElement.js";import m from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as g}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as w}from"../../Feature/support/featureUtils.js";const A=100;let b=class extends(s.ClonableMixin(i.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await a(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await a(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,A),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,A)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:i,source:a}=this;return e||i&&!r?"loading":t||o?"querying":!s||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=h(t)?t.parent:t;return w(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),i=o.allLayers.filter(s),a=o.allTables.filter(s),n=i.concat(a).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const i=t.fieldsIndex.get(g.assetGroup),a=t.fieldsIndex.get(g.assetType),n=null!=o,c=null!=s,l="("+e.map((t=>`'${t}'`)).join(", ")+")",u=n?` AND ${i?.name} = ${o}`:"",d=n&&c?` AND ${a?.name} = ${s}`:"",y=`${t.globalIdField} IN ${l}`+u+d,h=new m({outFields:["*"],cacheHint:this.supportsCacheHint,where:y});return await this._queryAll(h,t,{signal:r?.signal})}async _createAssociationFeatureObjects(t,e,o,s,r,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,i)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e,i=a.get(r.globalId)??[];await Promise.all(i.map((async e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;if(e.layer&&"getFeatureTitle"in e.layer){const s=await e.layer.getFeatureTitle(e);n.push({title:s,association:t,feature:e,terminalName:o})}else n.push({association:t,feature:e,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,i=e.get(s)??new r;i.add(t),e.set(s,i)}))}async _queryAll(t,e,o){const s=[];let r=0,i=!1;t.num=e.sourceJSON?.maxRecordCount??2e3;do{t.start=r;const a=await e.queryFeatures(t,o);s.push(...a.features),i=a.exceededTransferLimit,i&&(r+=a.features.length)}while(i);return s}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:i}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(i&&e&&s&&r&&o))return;const a=h(e)?e.parent:e,n=new p({globalId:o,networkSourceId:r.getSourceIdByLayerId(a.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,d=new Map;s.forEach((t=>{d.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",d))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",d))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",d))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",d))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",d))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",d))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const y=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,i=u.get(e.type),a=null!=s?await this._countAssociatedFeatures(o,i,s,r,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}}));await Promise.allSettled(y)}async _countAssociatedFeatureCount(t,e,o,s,r){const i=t.fieldsIndex.get(g.assetGroup),a=t.fieldsIndex.get(g.assetType),n=null!=s,c="("+e.map((t=>`'${t}'`)).join(", ")+")",l=` AND ${i?.name} = ${o}`,u=n?` AND ${a?.name} = ${s}`:"",d=`${t.globalIdField} IN ${c}`+l+u;return t.queryFeatureCount({where:d,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(i)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&r&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,d=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:i}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=d.get(r)||[];a.push(i),d.set(r,a)}));const y=await this._createAssociationFeatureObjects(c,d,s,l,u,e);this._parseFeatureObjects(y,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,i=o.get(e)?.associatedNetworkSourceId,a=s.has(r);return null!=i&&i!==r||!a}};t([d()],b.prototype,"_loaded",void 0),t([d()],b.prototype,"_queryAbortController",void 0),t([d()],b.prototype,"_queryPageAbortController",void 0),t([d()],b.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],b.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],b.prototype,"canLoad",null),t([d({readOnly:!0})],b.prototype,"canQuery",null),t([d()],b.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],b.prototype,"source",void 0),t([d()],b.prototype,"description",void 0),t([d({value:3})],b.prototype,"displayCount",null),t([d({type:e})],b.prototype,"graphic",void 0),t([d()],b.prototype,"layer",void 0),t([d()],b.prototype,"map",void 0),t([d({readOnly:!0})],b.prototype,"objectId",null),t([d({readOnly:!0})],b.prototype,"objectIdField",null),t([d({readOnly:!0})],b.prototype,"globalId",null),t([d({readOnly:!0})],b.prototype,"globalIdField",null),t([d()],b.prototype,"featureCount",void 0),t([d()],b.prototype,"associationTypes",void 0),t([d()],b.prototype,"activeAssociationType",null),t([d()],b.prototype,"showAllEnabled",void 0),t([d()],b.prototype,"state",null),t([d()],b.prototype,"title",void 0),t([d({readOnly:!0})],b.prototype,"utilityNetwork",null),t([d({readOnly:!0})],b.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],b.prototype,"structureAssociations",null),t([d({readOnly:!0})],b.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"contentAssociations",null),t([d({readOnly:!0})],b.prototype,"containerAssociations",null),t([d({readOnly:!0})],b.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],b.prototype,"associationFeatures",null),t([d({readOnly:!0})],b.prototype,"associationViewModels",null),b=t([y("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],b);const _=b;export{_ as default};
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import i from"../../../core/Identifiable.js";import{ignoreAbortErrors as a,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{sqlIn as y}from"../../../core/sql.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as h}from"../../../core/accessorSupport/decorators/subclass.js";import{queryAllJSON as p}from"../../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as m}from"../../../layers/support/layerUtils.js";import g from"../../../rest/networks/support/NetworkElement.js";import w from"../../../rest/support/FeatureSet.js";import b from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as _}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as A}from"../../Feature/support/featureUtils.js";const C=100;let f=class extends(s.ClonableMixin(i.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await a(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await a(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,C),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,C)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return t?.globalIdField}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:i,source:a}=this;return e||i&&!r?"loading":t||o?"querying":!s||"popup"===a&&0===this.featureCount?"disabled":"ready"}get utilityNetwork(){const{layer:t,map:e}=this;if(!t?.loaded||!e)return null;const o=m(t)?t.parent:t;return A(e,o)}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),i=o.allLayers.filter(s),a=o.allTables.filter(s),n=i.concat(a).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const i=this._getFeatureQueryWhereClause(t,e,o,s),a=new b({where:i,outFields:["*"],cacheHint:this.supportsCacheHint}),n=w.fromJSON(await p(t,a,r));return n.features.forEach((e=>{e.layer=t,e.sourceLayer=t})),n.features}async _createAssociationFeatureObjects(t,e,o,s,r,i){if(0===t.length)return[];const a=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,i)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=a.get(t.attributes[e.globalIdField])??[];o.push(t),a.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return await Promise.all(t.toArray().map((async t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e,i=a.get(r.globalId)??[];await Promise.all(i.map((async e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;if(e.layer&&"getFeatureTitle"in e.layer){const s=await e.layer.getFeatureTitle(e);n.push({title:s,association:t,feature:e,terminalName:o})}else n.push({association:t,feature:e,terminalName:o})})))}))),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,i=e.get(s)??new r;i.add(t),e.set(s,i)}))}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:i}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(i&&e&&s&&r&&o))return;const a=m(e)?e.parent:e,n=new g({globalId:o,networkSourceId:r.getSourceIdByLayerId(a.layerId)}),c=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":c.add("attachment");break;case"container":case"content":c.add("containment");break;case"connectivity":c.add("connectivity"),c.add("junction-junction-connectivity"),c.add("junction-edge-from-connectivity"),c.add("junction-edge-midspan-connectivity"),c.add("junction-edge-to-connectivity")}}));const l=await(r?.queryAssociations({elements:[n],types:Array.from(c)},{signal:t?.signal})),u=new Map,y=new Map;s.forEach((t=>{y.set(t.type,t),u.set(t.type,[])})),l.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"connectivity",y))break;u.get("connectivity")?.push(e.globalId)}else{if(this._shouldDiscardNetworkElement(s,"connectivity",y))break;u.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"content",y))break;u.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"container",y))break;u.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(this._shouldDiscardNetworkElement(e,"attachment",y))break;u.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(this._shouldDiscardNetworkElement(s,"structure",y))break;u.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const d=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,i=u.get(e.type),a=null!=s?await this._countAssociatedFeatures(o,i,s,r,t):i.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",a);break;case"structure":this._set("structureFeatureCount",a);break;case"content":this._set("contentFeatureCount",a);break;case"container":this._set("containerFeatureCount",a);break;case"connectivity":this._set("connectivityFeatureCount",a)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,s,r){const i=this._getFeatureQueryWhereClause(t,e,o,s);return t.queryFeatureCount({where:i,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const i=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(i)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:i,canQuery:a,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),i?.load()]),!(a&&o&&r&&i))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,y=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:i}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},a=y.get(r)||[];a.push(i),y.set(r,a)}));const d=await this._createAssociationFeatureObjects(c,y,s,l,u,e);this._parseFeatureObjects(d,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}_shouldDiscardNetworkElement(t,e,o){if(!t)return!1;const{networkSourceIdsInUse:s}=this,{networkSourceId:r}=t,i=o.get(e)?.associatedNetworkSourceId,a=s.has(r);return null!=i&&i!==r||!a}_getFeatureQueryWhereClause(t,e,o,s){const r=t.globalIdField,i=t.fieldsIndex.get(_.assetGroup),a=t.fieldsIndex.get(_.assetType),n=null!=o,c=null!=s;return[r?y(r,e):null,n?`(${i?.name} = ${o})`:null,n&&c?`(${a?.name} = ${s})`:null].filter(Boolean).join(" AND ")}};t([d()],f.prototype,"_loaded",void 0),t([d()],f.prototype,"_queryAbortController",void 0),t([d()],f.prototype,"_queryPageAbortController",void 0),t([d()],f.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],f.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],f.prototype,"canLoad",null),t([d({readOnly:!0})],f.prototype,"canQuery",null),t([d()],f.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],f.prototype,"source",void 0),t([d()],f.prototype,"description",void 0),t([d({value:3})],f.prototype,"displayCount",null),t([d({type:e})],f.prototype,"graphic",void 0),t([d()],f.prototype,"layer",void 0),t([d()],f.prototype,"map",void 0),t([d({readOnly:!0})],f.prototype,"objectId",null),t([d({readOnly:!0})],f.prototype,"objectIdField",null),t([d({readOnly:!0})],f.prototype,"globalId",null),t([d({readOnly:!0})],f.prototype,"globalIdField",null),t([d()],f.prototype,"featureCount",void 0),t([d()],f.prototype,"associationTypes",void 0),t([d()],f.prototype,"activeAssociationType",null),t([d()],f.prototype,"showAllEnabled",void 0),t([d()],f.prototype,"state",null),t([d()],f.prototype,"title",void 0),t([d({readOnly:!0})],f.prototype,"utilityNetwork",null),t([d({readOnly:!0})],f.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],f.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],f.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],f.prototype,"structureAssociations",null),t([d({readOnly:!0})],f.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],f.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],f.prototype,"contentAssociations",null),t([d({readOnly:!0})],f.prototype,"containerAssociations",null),t([d({readOnly:!0})],f.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],f.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],f.prototype,"associationFeatures",null),t([d({readOnly:!0})],f.prototype,"associationViewModels",null),f=t([h("esri.widgets.support.UtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],f);const F=f;export{F as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4755,7136,8628],{17136:(e,t,a)=>{a.d(t,{O7:()=>I,el:()=>v});var r=a(92602),n=a(49186),s=a(53966),i=a(39829),o=a(82799),l=a(80754),u=a(21325),d=a(28735),p=a(78888),c=a(65864),f=a(2272),h=a(84952),y=a(92300);const g=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function m(e){return"polygon"===e[0].type}function A(e){return"polyline"===e[0].type}function b(e,t,a){if(t){const t=function(e,t){if(!(e instanceof o.A||e instanceof i.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw g().error(e),new n.A(e)}const a=(0,l.r8)(e),r=[];for(const e of a){const a=[];r.push(a),a.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const n=e[r][0],s=e[r][1],i=e[r+1][0],o=e[r+1][1],l=Math.sqrt((i-n)*(i-n)+(o-s)*(o-s)),u=(o-s)/l,d=(i-n)/l,p=l/t;if(p>1){for(let e=1;e<=p-1;e++){const r=e*t,i=d*r+n,o=u*r+s;a.push([i,o])}const e=(l+Math.floor(p-1)*t)/2,r=d*e+n,i=u*e+s;a.push([r,i])}a.push([i,o])}}return function(e){return"polygon"===e.type}(e)?new i.A({rings:r,spatialReference:e.spatialReference}):new o.A({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.ci)(t,!0)}return a&&(e=(0,l.kS)(e,a)),e}function w(e,t,a){if(Array.isArray(e)){const r=e[0];if(r>t){const a=(0,l.kd)(r,t);e[0]=r+a*(-2*t)}else if(r<a){const t=(0,l.kd)(r,a);e[0]=r+t*(-2*a)}}else{const r=e.x;if(r>t){const a=(0,l.kd)(r,t);e=e.clone().offset(a*(-2*t),0)}else if(r<a){const t=(0,l.kd)(r,a);e=e.clone().offset(t*(-2*a),0)}}return e}function F(e,t){let a=-1;for(let r=0;r<t.cutIndexes.length;r++){const n=t.cutIndexes[r],s=t.geometries[r],i=(0,l.r8)(s);for(let e=0;e<i.length;e++){const t=i[e];t.some((a=>{if(a[0]<180)return!0;{let a=0;for(let e=0;e<t.length;e++){const r=t[e][0];a=r>a?r:a}a=Number(a.toFixed(9));const r=-360*(0,l.kd)(a,180);for(let a=0;a<t.length;a++){const t=s.getPoint(e,a);s.setPoint(e,a,t.clone().offset(r,0))}return!0}}))}if(n===a){if(m(e))for(const t of(0,l.r8)(s))e[n]=e[n].addRing(t);else if(A(e))for(const t of(0,l.r8)(s))e[n]=e[n].addPath(t)}else a=n,e[n]=s}return e}async function v(e,t,a){if(!Array.isArray(e))return v([e],t);t&&"string"!=typeof t&&g().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??r.A.geometryServiceUrl;let s,m,A,I,R,S,$,E,k=0;const O=[],x=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,m=(0,u.Vp)(s),A=s.isWebMercator,S=A?102100:4326,I=l.j7[S].maxX,R=l.j7[S].minX,$=l.j7[S].plus180Line,E=l.j7[S].minus180Line),m)if("mesh"===t.type)x.push(t);else if("point"===t.type)x.push(w(t.clone(),I,R));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,I,R))),x.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,m);x.push(e.rings?new i.A(e):e)}else if(t.extent){const e=t.extent,a=(0,l.kd)(e.xmin,R)*(2*I);let r=0===a?t.clone():(0,l.kS)(t.clone(),a);e.offset(a,0);let{xmin:n,xmax:s}=e;n=Number(n.toFixed(9)),s=Number(s.toFixed(9)),e.intersects($)&&s!==I?(k=s>k?s:k,r=b(r,A),O.push(r),x.push("cut")):e.intersects(E)&&n!==R?(k=s*(2*I)>k?s*(2*I):k,r=b(r,A,360),O.push(r),x.push("cut")):x.push(r)}else x.push(t.clone());else x.push(t);else x.push(t);let M=(0,l.kd)(k,I),L=-90;const j=M,T=new o.A;for(;M>0;){const e=360*M-180;T.addPath([[e,L],[e,-1*L]]),L*=-1,M--}if(O.length>0&&j>0){const t=F(O,await async function(e,t,a,r){const n=(0,f.Dl)(e),s=t[0].spatialReference,i={...r,responseType:"json",query:{...n.query,f:"json",sr:(0,u.YX)(s),target:JSON.stringify({geometryType:(0,c.$B)(t[0]),geometries:t}),cutter:JSON.stringify(a)}},o=await(0,p.A)(n.path+"/cut",i),{cutIndexes:l,geometries:d=[]}=o.data;return{cutIndexes:l,geometries:d.map((e=>{const t=(0,c.rS)(e);return t.spatialReference=s,t}))}}(n,O,T,a)),r=[],s=[];for(let a=0;a<x.length;a++){const n=x[a];if("cut"!==n)s.push(n);else{const n=t.shift(),i=e[a];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&n.rings.length>=i.rings.length?(r.push(n),s.push("simplify")):s.push(A?(0,d.Gh)(n):n)}}if(!r.length)return s;const i=await async function(e,t,a){const r="string"==typeof e?(0,h.An)(e):e,n=t[0].spatialReference,s=(0,c.$B)(t[0]),i={...a,query:{...r.query,f:"json",sr:(0,u.YX)(n),geometries:JSON.stringify((0,y.X)(t))}},{data:o}=await(0,p.A)(r.path+"/simplify",i);return(0,y.V)(o.geometries,s,n)}(n,r,a),o=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?o.push(t):o.push(A?(0,d.Gh)(i.shift()):i.shift())}return o}const B=[];for(let e=0;e<x.length;e++){const t=x[e];if("cut"!==t)B.push(t);else{const e=O.shift();B.push(!0===A?(0,d.Gh)(e):e)}}return B}function I(e,t,a){const r=(0,u.Vp)(a);if(null==r)return e;const[n,s]=r.valid,i=2*s;let o=0,l=0;t>s?o=Math.ceil(Math.abs(t-s)/i):t<n&&(o=-Math.ceil(Math.abs(t-n)/i)),e>s?l=Math.ceil(Math.abs(e-s)/i):e<n&&(l=-Math.ceil(Math.abs(e-n)/i));let d=e+(o-l)*i;const p=d-t;return p>s?d-=i:p<n&&(d+=i),d}},78628:(e,t,a)=>{a.d(t,{applyEdits:()=>v,r3:()=>b,uploadAssets:()=>O,zp:()=>F});var r=a(52106),n=a(5503),s=a(49186),i=a(4718),o=a(53966),l=a(74887),u=a(84952),d=a(13069),p=a(17136),c=a(21325),f=a(47685),h=a(30524),y=a(20557),g=a(83531);function m(e){return null!=e?.applyEdits}function A(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function b(e){return e.every(A)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(w)}async function v(e,t,a,r={}){let u;const p="gdbVersion"in e?e.gdbVersion:null,c=r.gdbVersion??p;if((0,f.Mk)(e)&&e.url)u=(0,f.Zk)(e.url,e.layerId,c,"original-and-current-features"===r.returnServiceEditsOption);else{u=(0,l.Tw)(),u.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:u.promise};e.emit("apply-edits",t)}try{const{results:l,edits:p}=await async function(e,t,a,r){if(await e.load(),!m(t))throw new s.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,g.tk)(e))throw new s.A(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:l}=await async function(e,t,a){const r=(0,g.BR)(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),l=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=null!=e.infoFor3D;if(function(e,t,a,r,n,i){if(!e||!r&&!n)throw new s.A(`${i}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&a?.globalIdUsed&&!a.usingFeatureServiceEndpoint)throw new s.A(`${i}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&n)throw new s.A(`${i}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!a?.globalIdUsed&&n)throw new s.A(`${i}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}(t,r,a,!!i,!!l,`${e.type}-layer`),!r.data.isVersioned&&a?.gdbVersion)throw new s.A(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&a?.rollbackOnFailureEnabled)throw new s.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const p={...a};if(null!=p.rollbackOnFailureEnabled||r.editing.supportsRollbackOnFailure||(p.rollbackOnFailureEnabled=!0),p.rollbackOnFailureEnabled||"original-and-current-features"!==p.returnServiceEditsOption||(!1===p.rollbackOnFailureEnabled&&o.A.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),p.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&p.returnServiceEditsInSourceSR)throw new s.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(p.returnServiceEditsInSourceSR&&"original-and-current-features"!==p.returnServiceEditsOption)throw new s.A(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c=function(e,t,a){const r=function(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&n.A.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}(e);if(r.addFeatures?.length&&!t.operations.supportsAdd)throw new s.A(`${a}:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures?.length&&!t.operations.supportsUpdate)throw new s.A(`${a}:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures?.length&&!t.operations.supportsDelete)throw new s.A(`${a}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(E),r.updateFeatures=r.updateFeatures.map(E),r.addAssetFeatures=[],r}(t,r,`${e.type}-layer`),f=a?.globalIdUsed||u,h=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(f){const{globalIdField:t}=e;if(null==t)throw new s.A(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");c.addFeatures.forEach((e=>function(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=(0,d.yS)())}(e,t)))}return c.addFeatures.forEach((t=>function(e,t,a,r){I(e,t,a,r),R(e,t)}(t,e,f,h))),c.updateFeatures.forEach((t=>function(e,t,a,r){I(e,t,a,r),R(e,t);const n=(0,g.BR)(t);if("geometry"in e&&null!=e.geometry&&!n?.editing.supportsGeometryUpdate)throw new s.A(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,f,h))),c.deleteFeatures.forEach((t=>function(e,t,a,r){I(e,t,a,r)}(t,e,f,h))),c.addAttachments.forEach((t=>S(t,e))),c.updateAttachments.forEach((t=>S(t,e))),u&&await async function(e,t){const{infoFor3D:a}=t;if(null==a)return;if(!(0,y.JQ)(a))throw new s.A(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:r}=e;for(const t of e.addFeatures??[])k(t)&&r.push(t);for(const t of e.updateFeatures??[])k(t)&&r.push(t)}(c,e),{edits:await $(c),options:p}}(e,a,r);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,l)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,a,r),c=e=>e.filter((e=>!e.error)).map(i.o8),f={edits:p,addedFeatures:c(l.addFeatureResults),updatedFeatures:c(l.updateFeatureResults),deletedFeatures:c(l.deleteFeatureResults),addedAttachments:c(l.addAttachmentResults),updatedAttachments:c(l.updateAttachmentResults),deletedAttachments:c(l.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:l.editMoment?new Date(l.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return l.editedFeatureResults?.length&&(f.editedFeatures=l.editedFeatureResults),u.resolve(f),l}catch(e){throw u.reject(e),e}}function I(e,t,a,r){if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new s.A(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const a of r){const r=e.attributes[a.name];if(void 0!==r&&!(0,h.OG)(a,r))throw new s.A(`${t.type}-layer:invalid-parameter`,`Big-integer field '${a.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new s.A(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new s.A(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function R(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:a}=e,{spatialReference:r,vertexSpace:n}=a,i=t.spatialReference,o="local"===n.type,l=(0,c.EA)(i),u=(0,c.aI)(i,r),d=u||(0,c.oT)(i)&&((0,c.oT)(r)||(0,c.K8)(r));if(!(o&&l&&d||!o&&!l&&u))throw new s.A(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${n.type} vertex space and a spatial reference wkid:${r.wkid} to a layer with a spatial reference wkid:${i.wkid} is not supported.`)}}function S(e,t){const{feature:a,attachment:r}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name||r.name))throw new s.A(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&r.uploadId)throw new s.A(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof r.data){const e=(0,u.r$)(r.data);if(e&&!e.isBase64)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function $(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map((e=>e.geometry)),n=await(0,p.el)(r),s=t.length,i=a.length;return n.slice(0,s).forEach(((e,a)=>t[a].geometry=e)),n.slice(s,s+i).forEach(((e,t)=>a[t].geometry=e)),e}function E(e){const t=new r.A;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function k(e){return"mesh"===e?.geometry?.type}function O(e,t,a,r){if(!m(t))throw new s.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new s.A(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(a,r)}},80754:(e,t,a)=>{a.d(t,{j7:()=>i,kS:()=>l,kd:()=>o,r8:()=>u});var r=a(82799),n=a(16930),s=a(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const a=u(e);for(const e of a)for(const a of e)a[0]+=t;return e}function u(e){return(0,s.Bi)(e)?e.rings:e.paths}},92300:(e,t,a)=>{a.d(t,{V:()=>s,X:()=>n});var r=a(65864);function n(e){return{geometryType:(0,r.$B)(e[0]),geometries:e.map((e=>e.toJSON()))}}function s(e,t,a){const n=(0,r.xD)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=a,t}))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[690],{9093:(t,n,r)=>{function e(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}r.d(n,{o8:()=>a,vt:()=>e,zK:()=>o});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:a,create:e,fromValues:function(t,n,r,e,a,o,u,c,i,s,f,h,M,l,m,I){return[t,n,r,e,a,o,u,c,i,s,f,h,M,l,m,I]}},Symbol.toStringTag,{value:"Module"}))},27921:(t,n,r)=>{r.d(n,{C:()=>s,Cr:()=>M,LV:()=>i,Qj:()=>f,T7:()=>S,Tj:()=>p,Ui:()=>v,_I:()=>O,fA:()=>h,gv:()=>g,lU:()=>l,mP:()=>E,mR:()=>T,vt:()=>c});var e=r(34727),a=r(38954),o=r(51850),u=(r(87317),r(44280),r(32114));function c(t=C){return[t[0],t[1],t[2],t[3]]}function i(t=C[0],n=C[1],r=C[2],e=C[3]){return h(t,n,r,e,u.Km.get())}function s(t,n){return h(n[0],n[1],n[2],n[3],t)}function f(t){return t}function h(t,n,r,e,a=c()){return a[0]=t,a[1]=n,a[2]=r,a[3]=e,a}function M(t,n,r,e=c()){const a=r[0]-n[0],o=r[1]-n[1],u=r[2]-n[2],i=t[0]-n[0],s=t[1]-n[1],f=t[2]-n[2],h=o*f-u*s,M=u*i-a*f,l=a*s-o*i,m=h*h+M*M+l*l,I=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return e[0]=h*I,e[1]=M*I,e[2]=l*I,e[3]=-(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]),e}function l(t,n,r,e=0,o=Math.floor(r*(1/3)),u=Math.floor(r*(2/3))){if(r<3)return!1;n(I,e);let c=o,i=!1;for(;c<r-1&&!i;)n(b,c),c++,i=!(0,a.p)(I,b);if(!i)return!1;for(c=Math.max(c,u),i=!1;c<r&&!i;)n(_,c),c++,(0,a.d)(d,I,b),(0,a.n)(d,d),(0,a.d)(N,b,_),(0,a.n)(N,N),i=!(0,a.p)(I,_)&&!(0,a.p)(b,_)&&Math.abs((0,a.f)(d,N))<m;return i?(M(I,b,_,t),!0):(0!==e||1!==o||2!==u)&&l(t,n,r,0,1,2)}r(32728);const m=.99619469809,I=(0,o.vt)(),b=(0,o.vt)(),_=(0,o.vt)(),d=(0,o.vt)(),N=(0,o.vt)();function E(t,n,r){return n!==t&&s(t,n),t[3]=-(0,a.f)(t,r),t}function T(t,n,r,e){return(0,a.e)(_,n,t),function(t,n,r){const e=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],a=Math.abs(e-1)>1e-5&&e>1e-12?1/Math.sqrt(e):1;return r[0]=n[0]*a,r[1]=n[1]*a,r[2]=n[2]*a,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}(r,_,e)}function v(t,n,r){return null!=n&&y(A(t,n.origin,n.direction,j,r))}function S(t,n,r){return y(A(t,n.origin,n.vector,P.NONE,r))}function g(t,n,r){return y(A(t,n.origin,n.vector,P.CLAMP,r))}function p(t,n){return q(t,n)>=0}function O(t,n,r){const e=(0,a.h)(u.rq.get(),t,-t[3]),o=function(t,n,r){const e=(0,a.h)(u.rq.get(),t,(0,a.f)(t,n));return(0,a.d)(r,n,e),r}(t,(0,a.d)(u.rq.get(),n,e),u.rq.get());return(0,a.g)(r,o,e),r}function q(t,n){return(0,a.f)(t,n)+t[3]}var D,x;function y(t){return t===D.INTERSECTS_INSIDE_OUT||t===D.INTERSECTS_OUTSIDE_IN}function A(t,n,r,o,u){const c=(0,a.f)(t,r),i=q(t,n);if(0===c)return i>=0?D.INSIDE:D.OUTSIDE;let s=-i/c;return o&P.CLAMP&&(s=(0,e.qE)(s,0,1)),!(o&P.INFINITE_MIN)&&s<0||!(o&P.INFINITE_MAX)&&s>1?i>=0?D.INSIDE:D.OUTSIDE:((0,a.g)(u,n,(0,a.h)(u,r,s)),i>=0?D.INTERSECTS_INSIDE_OUT:D.INTERSECTS_OUTSIDE_IN)}(x=D||(D={}))[x.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",x[x.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",x[x.INSIDE=2]="INSIDE",x[x.OUTSIDE=3]="OUTSIDE";const C=[0,0,1,0];var P;!function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"}(P||(P={})),P.INFINITE_MIN,P.INFINITE_MAX;const j=P.INFINITE_MAX},29242:(t,n,r)=>{function e(){return[1,0,0,0,1,0,0,0,1]}function a(t,n,r,e,a,o,u,c,i){return[t,n,r,e,a,o,u,c,i]}r.d(n,{fA:()=>a,vt:()=>e,zK:()=>o});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:e,fromValues:a},Symbol.toStringTag,{value:"Module"}))},32114:(t,n,r)=>{r.d(n,{Rc:()=>l,J8:()=>m,rq:()=>h,Km:()=>M}),r(44208);var e=r(26390),a=r(29242),o=r(9093),u=r(82534),c=r(48163),i=r(51850),s=r(91829);class f{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,e.d)((()=>this._reset())),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new f(c.vt)}static createVec3f64(){return new f(i.vt)}static createVec4f64(){return new f(s.vt)}static createMat3f64(){return new f(a.vt)}static createMat4f64(){return new f(o.vt)}static createQuatf64(){return new f(u.vt)}get test(){}}f.createVec2f64();const h=f.createVec3f64(),M=f.createVec4f64(),l=(f.createMat3f64(),f.createMat4f64()),m=f.createQuatf64()},32728:(t,n,r)=>{r.d(n,{hG:()=>o,wp:()=>u}),r(34727);var e=r(38954),a=r(51850);function o(t){const n=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],r=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],e=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(n,r,e))}function u(t,n){const r=Math.sqrt(n[0]*n[0]+n[4]*n[4]+n[8]*n[8]),a=Math.sqrt(n[1]*n[1]+n[5]*n[5]+n[9]*n[9]),o=Math.sqrt(n[2]*n[2]+n[6]*n[6]+n[10]*n[10]);return(0,e.i)(t,r,a,o),t}(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)(),(0,a.vt)()},38954:(t,n,r)=>{r.d(n,{A:()=>m,B:()=>l,C:()=>f,D:()=>I,E:()=>h,G:()=>F,I:()=>w,a:()=>j,b:()=>_,c:()=>u,d:()=>s,e:()=>p,f:()=>g,g:()=>i,h:()=>b,i:()=>c,j:()=>d,k:()=>E,l:()=>o,m:()=>O,n:()=>S,o:()=>P,p:()=>C,q:()=>D,s:()=>N,t:()=>q,u:()=>v,v:()=>T,w:()=>x,x:()=>M,y:()=>R,z:()=>V});var e=r(51850),a=r(34304);function o(t){const n=t[0],r=t[1],e=t[2];return Math.sqrt(n*n+r*r+e*e)}function u(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function c(t,n,r,e){return t[0]=n,t[1]=r,t[2]=e,t}function i(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t}function s(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t}function f(t,n,r){return t[0]=n[0]*r[0],t[1]=n[1]*r[1],t[2]=n[2]*r[2],t}function h(t,n,r){return t[0]=n[0]/r[0],t[1]=n[1]/r[1],t[2]=n[2]/r[2],t}function M(t,n){return t[0]=Math.abs(n[0]),t[1]=Math.abs(n[1]),t[2]=Math.abs(n[2]),t}function l(t,n){return t[0]=Math.sign(n[0]),t[1]=Math.sign(n[1]),t[2]=Math.sign(n[2]),t}function m(t,n,r){return t[0]=Math.min(n[0],r[0]),t[1]=Math.min(n[1],r[1]),t[2]=Math.min(n[2],r[2]),t}function I(t,n,r){return t[0]=Math.max(n[0],r[0]),t[1]=Math.max(n[1],r[1]),t[2]=Math.max(n[2],r[2]),t}function b(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t}function _(t,n,r,e){return t[0]=n[0]+r[0]*e,t[1]=n[1]+r[1]*e,t[2]=n[2]+r[2]*e,t}function d(t,n){const r=n[0]-t[0],e=n[1]-t[1],a=n[2]-t[2];return Math.sqrt(r*r+e*e+a*a)}function N(t,n){const r=n[0]-t[0],e=n[1]-t[1],a=n[2]-t[2];return r*r+e*e+a*a}function E(t){const n=t[0],r=t[1],e=t[2];return n*n+r*r+e*e}function T(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t}function v(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t}function S(t,n){const r=n[0],e=n[1],a=n[2];let o=r*r+e*e+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=n[0]*o,t[1]=n[1]*o,t[2]=n[2]*o),t}function g(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function p(t,n,r){const e=n[0],a=n[1],o=n[2],u=r[0],c=r[1],i=r[2];return t[0]=a*i-o*c,t[1]=o*u-e*i,t[2]=e*c-a*u,t}function O(t,n,r,e){const a=n[0],o=n[1],u=n[2];return t[0]=a+e*(r[0]-a),t[1]=o+e*(r[1]-o),t[2]=u+e*(r[2]-u),t}function q(t,n,r){const e=n[0],a=n[1],o=n[2];return t[0]=r[0]*e+r[4]*a+r[8]*o+r[12],t[1]=r[1]*e+r[5]*a+r[9]*o+r[13],t[2]=r[2]*e+r[6]*a+r[10]*o+r[14],t}function D(t,n,r){const e=n[0],a=n[1],o=n[2];return t[0]=e*r[0]+a*r[3]+o*r[6],t[1]=e*r[1]+a*r[4]+o*r[7],t[2]=e*r[2]+a*r[5]+o*r[8],t}function x(t,n,r){const e=r[0],a=r[1],o=r[2],u=r[3],c=n[0],i=n[1],s=n[2],f=a*s-o*i,h=o*c-e*s,M=e*i-a*c,l=a*M-o*h,m=o*f-e*M,I=e*h-a*f,b=2*u;return t[0]=c+f*b+2*l,t[1]=i+h*b+2*m,t[2]=s+M*b+2*I,t}const y=(0,e.vt)(),A=(0,e.vt)();function C(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]}function P(t,n,r){const e=r[0]-n[0],a=r[1]-n[1],o=r[2]-n[2];let u=e*e+a*a+o*o;return u>0?(u=1/Math.sqrt(u),t[0]=e*u,t[1]=a*u,t[2]=o*u,t):(t[0]=0,t[1]=0,t[2]=0,t)}const j=s,U=f,z=h,F=d,R=N,w=o,V=E;Object.freeze(Object.defineProperty({__proto__:null,abs:M,add:i,angle:function(t,n){S(y,t),S(A,n);const r=g(y,A);return r>1?0:r<-1?Math.PI:Math.acos(r)},bezier:function(t,n,r,e,a,o){const u=1-o,c=u*u,i=o*o,s=c*u,f=3*o*c,h=3*i*u,M=i*o;return t[0]=n[0]*s+r[0]*f+e[0]*h+a[0]*M,t[1]=n[1]*s+r[1]*f+e[1]*h+a[1]*M,t[2]=n[2]*s+r[2]*f+e[2]*h+a[2]*M,t},ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t},clamp:function(t,n=0,r=1){return t[0]=Math.min(Math.max(t[0],n),r),t[1]=Math.min(Math.max(t[1],n),r),t[2]=Math.min(Math.max(t[2],n),r),t},copy:u,cross:p,crossAndNormalize:function(t,n,r){const e=n[0],a=n[1],o=n[2],u=r[0],c=r[1],i=r[2],s=a*i-o*c,f=o*u-e*i,h=e*c-a*u,M=Math.sqrt(s*s+f*f+h*h);return t[0]=s/M,t[1]=f/M,t[2]=h/M,t},direction:P,dist:F,distance:d,div:z,divide:h,dot:g,equals:function(t,n){if(t===n)return!0;const r=t[0],e=t[1],o=t[2],u=n[0],c=n[1],i=n[2],s=(0,a.FD)();return Math.abs(r-u)<=s*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(e-c)<=s*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-i)<=s*Math.max(1,Math.abs(o),Math.abs(i))},exactEquals:C,floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t},hermite:function(t,n,r,e,a,o){const u=o*o,c=u*(2*o-3)+1,i=u*(o-2)+o,s=u*(o-1),f=u*(3-2*o);return t[0]=n[0]*c+r[0]*i+e[0]*s+a[0]*f,t[1]=n[1]*c+r[1]*i+e[1]*s+a[1]*f,t[2]=n[2]*c+r[2]*i+e[2]*s+a[2]*f,t},inverse:v,len:w,length:o,lerp:O,max:I,min:m,mul:U,multiply:f,negate:T,normalize:S,random:function(t,n=1){const r=a.Ov,e=2*r()*Math.PI,o=2*r()-1,u=Math.sqrt(1-o*o)*n;return t[0]=Math.cos(e)*u,t[1]=Math.sin(e)*u,t[2]=o*n,t},rotateX:function(t,n,r,e){const a=[],o=[];return a[0]=n[0]-r[0],a[1]=n[1]-r[1],a[2]=n[2]-r[2],o[0]=a[0],o[1]=a[1]*Math.cos(e)-a[2]*Math.sin(e),o[2]=a[1]*Math.sin(e)+a[2]*Math.cos(e),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},rotateY:function(t,n,r,e){const a=[],o=[];return a[0]=n[0]-r[0],a[1]=n[1]-r[1],a[2]=n[2]-r[2],o[0]=a[2]*Math.sin(e)+a[0]*Math.cos(e),o[1]=a[1],o[2]=a[2]*Math.cos(e)-a[0]*Math.sin(e),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},rotateZ:function(t,n,r,e){const a=[],o=[];return a[0]=n[0]-r[0],a[1]=n[1]-r[1],a[2]=n[2]-r[2],o[0]=a[0]*Math.cos(e)-a[1]*Math.sin(e),o[1]=a[0]*Math.sin(e)+a[1]*Math.cos(e),o[2]=a[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t},scale:b,scaleAndAdd:_,set:c,sign:l,sqrDist:R,sqrLen:V,squaredDistance:N,squaredLength:E,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:j,subtract:s,transformMat3:D,transformMat4:q,transformQuat:x},Symbol.toStringTag,{value:"Module"}))},44280:(t,n,r)=>{r.d(n,{EJ:()=>i,g7:()=>c,gr:()=>u});var e=r(34727),a=r(38954),o=r(51850);function u(t,n){return(0,a.f)(t,n)/(0,a.l)(t)}function c(t,n){const r=(0,a.f)(t,n)/((0,a.l)(t)*(0,a.l)(n));return-(0,e.XM)(r)}function i(t,n,r){(0,a.n)(s,t),(0,a.n)(f,n);const o=(0,a.f)(s,f),u=(0,e.XM)(o),c=(0,a.e)(s,s,f);return(0,a.f)(c,r)<0?2*Math.PI-u:u}const s=(0,o.vt)(),f=(0,o.vt)()},48163:(t,n,r)=>{function e(){return[0,0]}function a(t,n){return[t,n]}function o(){return a(1,1)}function u(){return a(1,0)}function c(){return a(0,1)}r.d(n,{Un:()=>i,fA:()=>a,vt:()=>e});const i=o(),s=u(),f=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:i,UNIT_X:s,UNIT_Y:f,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:e,freeze:function(t,n){return[t,n]},fromArray:function(t,n=[0,0]){const r=Math.min(2,t.length);for(let e=0;e<r;++e)n[e]=t[e];return n},fromValues:a,ones:o,unitX:u,unitY:c,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},77690:(t,n,r)=>{r.d(n,{B8:()=>c,Ge:()=>M,I0:()=>h,KC:()=>i,hZ:()=>o,hs:()=>f,lw:()=>s,mg:()=>u,z0:()=>a});var e=r(34304);function a(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t}function o(t,n,r,e,a,o,u,c,i,s){return t[0]=n,t[1]=r,t[2]=e,t[3]=a,t[4]=o,t[5]=u,t[6]=c,t[7]=i,t[8]=s,t}function u(t,n){if(t===n){const r=n[1],e=n[2],a=n[5];t[1]=n[3],t[2]=n[6],t[3]=r,t[5]=n[7],t[6]=e,t[7]=a}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t}function c(t,n){const r=n[0],e=n[1],a=n[2],o=n[3],u=n[4],c=n[5],i=n[6],s=n[7],f=n[8],h=f*u-c*s,M=-f*o+c*i,l=s*o-u*i;let m=r*h+e*M+a*l;return m?(m=1/m,t[0]=h*m,t[1]=(-f*e+a*s)*m,t[2]=(c*e-a*u)*m,t[3]=M*m,t[4]=(f*r-a*i)*m,t[5]=(-c*r+a*o)*m,t[6]=l*m,t[7]=(-s*r+e*i)*m,t[8]=(u*r-e*o)*m,t):null}function i(t,n){const r=n[0],e=n[1],a=n[2],o=n[3],u=n[4],c=n[5],i=n[6],s=n[7],f=n[8];return t[0]=u*f-c*s,t[1]=a*s-e*f,t[2]=e*c-a*u,t[3]=c*i-o*f,t[4]=r*f-a*i,t[5]=a*o-r*c,t[6]=o*s-u*i,t[7]=e*i-r*s,t[8]=r*u-e*o,t}function s(t,n,r){const e=n[0],a=n[1],o=n[2],u=n[3],c=n[4],i=n[5],s=n[6],f=n[7],h=n[8],M=r[0],l=r[1],m=r[2],I=r[3],b=r[4],_=r[5],d=r[6],N=r[7],E=r[8];return t[0]=M*e+l*u+m*s,t[1]=M*a+l*c+m*f,t[2]=M*o+l*i+m*h,t[3]=I*e+b*u+_*s,t[4]=I*a+b*c+_*f,t[5]=I*o+b*i+_*h,t[6]=d*e+N*u+E*s,t[7]=d*a+N*c+E*f,t[8]=d*o+N*i+E*h,t}function f(t,n,r){const e=r[0],a=r[1],o=r[2];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=a*n[3],t[4]=a*n[4],t[5]=a*n[5],t[6]=o*n[6],t[7]=o*n[7],t[8]=o*n[8],t}function h(t,n){const r=n[0],e=n[1],a=n[2],o=n[3],u=r+r,c=e+e,i=a+a,s=r*u,f=e*u,h=e*c,M=a*u,l=a*c,m=a*i,I=o*u,b=o*c,_=o*i;return t[0]=1-h-m,t[3]=f-_,t[6]=M+b,t[1]=f+_,t[4]=1-s-m,t[7]=l-I,t[2]=M-b,t[5]=l+I,t[8]=1-s-h,t}function M(t,n){const r=n[0],e=n[1],a=n[2],o=n[3],u=n[4],c=n[5],i=n[6],s=n[7],f=n[8],h=n[9],M=n[10],l=n[11],m=n[12],I=n[13],b=n[14],_=n[15],d=r*c-e*u,N=r*i-a*u,E=r*s-o*u,T=e*i-a*c,v=e*s-o*c,S=a*s-o*i,g=f*I-h*m,p=f*b-M*m,O=f*_-l*m,q=h*b-M*I,D=h*_-l*I,x=M*_-l*b;let y=d*x-N*D+E*q+T*O-v*p+S*g;return y?(y=1/y,t[0]=(c*x-i*D+s*q)*y,t[1]=(i*O-u*x-s*p)*y,t[2]=(u*D-c*O+s*g)*y,t[3]=(a*D-e*x-o*q)*y,t[4]=(r*x-a*O+o*p)*y,t[5]=(e*O-r*D-o*g)*y,t[6]=(I*S-b*v+_*T)*y,t[7]=(b*E-m*S-_*N)*y,t[8]=(m*v-I*E+_*d)*y,t):null}function l(t,n,r){return t[0]=n[0]-r[0],t[1]=n[1]-r[1],t[2]=n[2]-r[2],t[3]=n[3]-r[3],t[4]=n[4]-r[4],t[5]=n[5]-r[5],t[6]=n[6]-r[6],t[7]=n[7]-r[7],t[8]=n[8]-r[8],t}const m=s,I=l;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,r){return t[0]=n[0]+r[0],t[1]=n[1]+r[1],t[2]=n[2]+r[2],t[3]=n[3]+r[3],t[4]=n[4]+r[4],t[5]=n[5]+r[5],t[6]=n[6]+r[6],t[7]=n[7]+r[7],t[8]=n[8]+r[8],t},adjoint:i,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t},determinant:function(t){const n=t[0],r=t[1],e=t[2],a=t[3],o=t[4],u=t[5],c=t[6],i=t[7],s=t[8];return n*(s*o-u*i)+r*(-s*a+u*c)+e*(i*a-o*c)},equals:function(t,n){const r=t[0],a=t[1],o=t[2],u=t[3],c=t[4],i=t[5],s=t[6],f=t[7],h=t[8],M=n[0],l=n[1],m=n[2],I=n[3],b=n[4],_=n[5],d=n[6],N=n[7],E=n[8],T=(0,e.FD)();return Math.abs(r-M)<=T*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(a-l)<=T*Math.max(1,Math.abs(a),Math.abs(l))&&Math.abs(o-m)<=T*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(u-I)<=T*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-b)<=T*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(i-_)<=T*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(s-d)<=T*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(f-N)<=T*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(h-E)<=T*Math.max(1,Math.abs(h),Math.abs(E))},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromMat4:a,fromQuat:h,fromRotation:function(t,n){const r=Math.sin(n),e=Math.cos(n);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0],t[7]=n[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:c,isOrthoNormal:function(t){const n=(0,e.FD)(),r=t[0],a=t[1],o=t[2],u=t[3],c=t[4],i=t[5],s=t[6],f=t[7],h=t[8];return Math.abs(1-(r*r+u*u+s*s))<=n&&Math.abs(1-(a*a+c*c+f*f))<=n&&Math.abs(1-(o*o+i*i+h*h))<=n},mul:m,multiply:s,multiplyScalar:function(t,n,r){return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=n[7]*r,t[8]=n[8]*r,t},multiplyScalarAndAdd:function(t,n,r,e){return t[0]=n[0]+r[0]*e,t[1]=n[1]+r[1]*e,t[2]=n[2]+r[2]*e,t[3]=n[3]+r[3]*e,t[4]=n[4]+r[4]*e,t[5]=n[5]+r[5]*e,t[6]=n[6]+r[6]*e,t[7]=n[7]+r[7]*e,t[8]=n[8]+r[8]*e,t},normalFromMat4:M,normalFromMat4Legacy:function(t,n){const r=n[0],e=n[1],a=n[2],o=n[4],u=n[5],c=n[6],i=n[8],s=n[9],f=n[10],h=f*u-c*s,M=-f*o+c*i,l=s*o-u*i,m=r*h+e*M+a*l;if(!m)return null;const I=1/m;return t[0]=h*I,t[1]=(-f*e+a*s)*I,t[2]=(c*e-a*u)*I,t[3]=M*I,t[4]=(f*r-a*i)*I,t[5]=(-c*r+a*o)*I,t[6]=l*I,t[7]=(-s*r+e*i)*I,t[8]=(u*r-e*o)*I,t},projection:function(t,n,r){return t[0]=2/n,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,n,r){const e=n[0],a=n[1],o=n[2],u=n[3],c=n[4],i=n[5],s=n[6],f=n[7],h=n[8],M=Math.sin(r),l=Math.cos(r);return t[0]=l*e+M*u,t[1]=l*a+M*c,t[2]=l*o+M*i,t[3]=l*u-M*e,t[4]=l*c-M*a,t[5]=l*i-M*o,t[6]=s,t[7]=f,t[8]=h,t},scale:f,scaleByVec2:function(t,n,r){const e=r[0],a=r[1];return t[0]=e*n[0],t[1]=e*n[1],t[2]=e*n[2],t[3]=a*n[3],t[4]=a*n[4],t[5]=a*n[5],t},set:o,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:I,subtract:l,translate:function(t,n,r){const e=n[0],a=n[1],o=n[2],u=n[3],c=n[4],i=n[5],s=n[6],f=n[7],h=n[8],M=r[0],l=r[1];return t[0]=e,t[1]=a,t[2]=o,t[3]=u,t[4]=c,t[5]=i,t[6]=M*e+l*u+s,t[7]=M*a+l*c+f,t[8]=M*o+l*i+h,t},transpose:u},Symbol.toStringTag,{value:"Module"}))},82534:(t,n,r)=>{function e(){return[0,0,0,1]}function a(t){return[t[0],t[1],t[2],t[3]]}r.d(n,{o8:()=>a,vt:()=>e,zK:()=>o});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:a,create:e,fromValues:function(t,n,r,e){return[t,n,r,e]}},Symbol.toStringTag,{value:"Module"}))}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4342,5952],{22671:(e,t,i)=>{i.d(t,{A:()=>_});var r,o=i(90237),n=i(52106),s=i(66552),a=i(25482),l=i(4718),p=i(10107),c=(i(44208),i(53966),i(36005)),u=i(40608),d=i(43937),y=i(16930),h=i(65864),f=i(50498),m=i(20437);const g=new s.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=r=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,n.A)}writeGeometryType(e,t,i,r){if(e)return void g.write(e,t,i,r);const{features:o}=this;if(o)for(const e of o)if(null!=e?.geometry)return void g.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,r=(0,h.rS)(e);return r&&!i&&t.spatialReference&&(r.spatialReference=y.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let i=0;i<t.features.length;i++){const r=t.features[i];if(r.geometry){const t=e?.[i];r.geometry=t?.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,i],translate:[r,o]}=e,n=this.features,s=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-r)/t)),(e=>Math.round((o-e)/i)));for(let e=0,t=n.length;e<t;e++)s?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:i}=this;if(!i)return this;const{translate:[r,o],scale:[n,s]}=i;let a=null,l=null;if(this.hasZ&&null!=i?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=i;a=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=i;l=i=>null==i?i:i*t+e}const p=this._getHydrationFunction(e,(e=>e*n+r),(e=>o-e*s),a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}readFeaturesWithClass(e,t,i){const r=y.A.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const n=e[t],s=i.fromJSON(n),a=n.geometry?.spatialReference;null==s.geometry||a||(s.geometry.spatialReference=r);const l=n.aggregateGeometries,p=s.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],i=l[e],o=i?.spatialReference;null==t||o||(t.spatialReference=r)}o.push(s)}return o}_quantizePoints(e,t,i){let r,o;const n=[];for(let s=0,a=e.length;s<a;s++){const a=e[s];if(s>0){const e=t(a[0]),s=i(a[1]);e===r&&s===o||(n.push([e-r,s-o]),r=e,o=s)}else r=t(a[0]),o=i(a[1]),n.push([r,o])}return n.length>0?n:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,h.Bi)(e)?e.rings:e.paths,o=[];for(let e=0,n=r.length;e<n;e++){const n=r[e],s=this._quantizePoints(n,t,i);s&&o.push(s)}return o.length>0?((0,h.Bi)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,i);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,r,o){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,h.Bi)(e)?e.rings:e.paths;let s,a;for(let e=0,r=n.length;e<r;e++){const r=n[e];for(let e=0,o=r.length;e<o;e++){const o=r[e];e>0?(s+=o[0],a+=o[1]):(s=o[0],a=o[1]),o[0]=t(s),o[1]=i(a)}}if(r&&o)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2]),i[3]=o(i[3])}}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2])}}else if(o)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=o(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(e.zmin)),o&&null!=e.mmax&&null!=e.mmin&&(e.mmax=o(e.mmax),e.mmin=o(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let s,a;for(let e=0,r=n.length;e<r;e++){const r=n[e];e>0?(s+=r[0],a+=r[1]):(s=r[0],a=r[1]),r[0]=t(s),r[1]=i(a)}if(r&&o)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2]),t[3]=o(t[3])}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2])}else if(o)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=o(t[2])}}:null}};(0,o._)([(0,p.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,p.MZ)({type:[n.A],json:{write:!0}})],v.prototype,"features",void 0),(0,o._)([(0,c.w)("features")],v.prototype,"readFeatures",null),(0,o._)([(0,p.MZ)({type:[m.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,o._)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],v.prototype,"geometryType",void 0),(0,o._)([(0,d.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,o._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,o._)([(0,p.MZ)({types:f.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,o._)([(0,c.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,o._)([(0,p.MZ)({type:y.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,o._)([(0,d.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,o._)([(0,p.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=r=(0,o._)([(0,u.$)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v},32756:(e,t,i)=>{i.d(t,{Rr:()=>l,fY:()=>c,ne:()=>p});var r=i(90237),o=i(93637),n=i(10107),s=(i(44208),i(53966),i(87811),i(40608)),a=i(91880);function l(e,t,i){if(!e)return null;const r=e.find((e=>!!e.field));if(!r)return null;const o=new a.A;return o.read(r,i),[o]}const p={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,i,r){const n=e.find((e=>!!e.field));n&&(0,o.sM)(i,[n.toJSON()],t)}}}},c=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,r._)([(0,n.MZ)(p)],t.prototype,"orderBy",void 0),t=(0,r._)([(0,s.$)("esri.layers.mixins.OrderedLayer")],t),t}},33143:(e,t,i)=>{i.d(t,{A:()=>y});var r=i(90237),o=i(69540),n=i(25482),s=i(10107),a=(i(44208),i(53966),i(87811),i(36005)),l=i(40608),p=i(43937),c=i(80451),u=i(29005);let d=class extends(o.A.ClonableMixin(n.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,c.rS)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,r._)([(0,s.MZ)({json:{write:!0}})],d.prototype,"id",void 0),(0,r._)([(0,s.MZ)({json:{write:!0}})],d.prototype,"name",void 0),(0,r._)([(0,s.MZ)({json:{write:!0}})],d.prototype,"domains",void 0),(0,r._)([(0,a.w)("domains")],d.prototype,"readDomains",null),(0,r._)([(0,p.K)("domains")],d.prototype,"writeDomains",null),(0,r._)([(0,s.MZ)({type:[u.A],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,r._)([(0,l.$)("esri.layers.support.FeatureType")],d);const y=d},46140:(e,t,i)=>{i.d(t,{R:()=>o});var r=i(49186);let o=class e{constructor(e,t,i=""){this.major=e,this.minor=t,this._context=i}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",i=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${i}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,i=""){const[o,n]=t.split("."),s=/^\s*\d+\s*$/;if(!o?.match||!s.test(o))throw new r.A((i&&i+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!s.test(n))throw new r.A((i&&i+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(o,10),l=parseInt(n,10);return new e(a,l,i)}}},55674:(e,t,i)=>{i.d(t,{Ad:()=>y,Gj:()=>m,QY:()=>d,lL:()=>g,xR:()=>h});var r=i(66131),o=i(49186),n=(i(44208),i(44729)),s=i(15032),a=i(65864),l=i(95466),p=i(43668),c=i(98623);const u=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const i of u)t.hasArcadeDependency(i)&&e.add(i);return e}function y(e,t){return f.create(e,t,null,["$feature","$view"])}function h(e,t,i){return f.create(e,t,i,["$feature","$view","$config"])}class f{static async create(e,t,i,r){const{arcade:n,Dictionary:s}=await(0,p.l)();let a;try{a=n.parseScript(e)}catch(t){throw new o.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=n.scriptUsesGeometryEngine(a);l&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,a,null,!1,l);const c={vars:r.reduce(((e,t)=>({...e,[t]:null})),{}),spatialReference:t,useAsync:!1},u=n.compileScript(a,c);let d=null;null!=i&&(d=new s(i),d.immutable=!0);const y=new s;return y.immutable=!1,y.setField("scale",0),new f(e,n,a,u,t,y,d,s)}constructor(e,t,i,r,o,n,s,a){this.script=e,this._arcade=t,this._syntaxTree=i,this._compiled=r,this._spatialReference=o,this._viewDict=n,this._configDict=s,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new m,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const i=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:o,currentEnd:n}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=o?null!=i?r.lY.epochToArcadeDate(o,i):r.lY.unknownEpochToArcadeDate(o):void 0,currentEnd:null!=n?null!=i?r.lY.epochToArcadeDate(n,i):r.lY.unknownEpochToArcadeDate(n):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class m{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,i){const r=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=r.fields,this._boundSchema.fieldsIndex=r,this._boundSchema.spatialReference=i}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const i=this._getField(e);if(i)switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(this._boundTarget.attributes[i.name]);case"time-only":case"esriFieldTypeTimeOnly":return s.k.fromReader(this._boundTarget.attributes[i.name]);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return r.lY.fromReaderAsTimeStampOffset(this._boundTarget.attributes[i.name]);case"date":case"esriFieldTypeDate":{const t=this._boundTarget.attributes[i.name];return this.isUnknownDateTimeField(e)?r.lY.unknownEpochToArcadeDate(t):r.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU)}default:return this._boundTarget.attributes[i.name]}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map((e=>e.name))}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const i in e)t.push({name:i,alias:i,type:"string"==typeof e[i]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,i)=>{i.d(t,{q:()=>o});var r=i(62815);function o(e,t,i){if(!i?.features||!i.hasZ)return;const o=(0,r.N)(i.geometryType,t,e.outSpatialReference);if(null!=o)for(const e of i.features)o(e.geometry)}},73681:(e,t,i)=>{i.d(t,{n:()=>l});var r=i(49186),o=i(53966),n=i(46140),s=i(95466),a=i(55674);class l{static async from(e,t,i){const s=e.dictionary_version?n.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),u={};if(t)for(const e in t)u[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)u.hasOwnProperty(t.name)||(u[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(i))d.delete(e);d.size&&o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const y=await(0,a.xR)(e.expression,null,u);if(!y)throw new r.A("Unable to create dictionary renderer expression");const h=!s||!s.greaterEqual(4,0);h&&o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:s});const f=new p(i,h);return new l(h,c,y,f)}constructor(e,t,i,r){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=i,this._reader=r}get itemNames(){return this._itemNames}evaluate(e,t,i,r){try{return this._reader.bind(e,i,r),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new s.A(e);const t=e.map((e=>({...e,type:"esriFieldTypeString"})));return new s.A(t)}}class p extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t?"":""+this._boundTarget.attributes[t.name]}}},91880:(e,t,i)=>{i.d(t,{A:()=>u});var r,o=i(90237),n=i(66552),s=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(40608));const p=new n.J({asc:"ascending",desc:"descending"});let c=class extends s.A{static{r=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new r({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,o._)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,o._)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,o._)([(0,a.MZ)({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],c.prototype,"order",void 0),c=r=(0,o._)([(0,l.$)("esri.layers.support.OrderByInfo")],c);const u=c},97927:(e,t,i)=>{i.r(t),i.d(t,{default:()=>W});var r=i(90237),o=i(49186),n=i(4718),s=i(93637),a=i(10107),l=(i(44208),i(53966),i(40608)),p=i(13600),c=i(82935),u=i(66552),d=i(69540),y=i(25482),h=(i(87811),i(69622)),f=i(21325);let m=class extends h.A{set horizontalWKID(e){e?(0,f.fn)({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&(0,f.fn)({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:t,principalOffsetPoint:i,radialDistortionCoefficients:r,tangentialDistortionCoefficients:o}=this;return e?.length>1&&!Number.isNaN(t)&&i?.length>1&&r?.length>1&&o?.length>1}};(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"affineTransformations",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"focalLength",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"principalOffsetPoint",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"radialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"tangentialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"horizontalWKID",null),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"verticalWKID",null),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"x",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"y",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"z",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],m.prototype,"type",void 0),m=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.CameraOrientation")],m);const g=m;let v=class extends(d.A.ClonableMixin(y.A.JSONSupportMixin(g))){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,heading:s,pitch:a,roll:l,affineTransformations:p,focalLength:c,principalOffsetPoint:u,radialDistortionCoefficients:d,tangentialDistortionCoefficients:y}=this,h=[e,t,i,r,o,n,s,a,l];return this.isAdvanced&&(p?.forEach((e=>h.push(e))),h.push(c),u?.forEach((e=>h.push(e))),d?.forEach((e=>h.push(e))),y?.forEach((e=>h.push(e)))),h.map((e=>Number.isNaN(e)?"":e)).join("|")}};(0,r._)([(0,a.MZ)({json:{write:!0}})],v.prototype,"type",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"heading",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"x",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"y",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.CameraOrientationHPR")],v);const _=v;let w=class extends(d.A.ClonableMixin(y.A.JSONSupportMixin(g))){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:t,longitude:i,ellipsoidRadius:r,squaredEccentricity:o,properties:n}=this,s=`${n}`.split("|");return s.splice(1,1),`${e}|${t}|${i}|${r}|${o}|${s.join("|")}`}};(0,r._)([(0,a.MZ)({json:{write:!0}})],w.prototype,"type",void 0),(0,r._)([(0,a.MZ)({json:{write:!0},type:Number})],w.prototype,"latitude",void 0),(0,r._)([(0,a.MZ)({json:{write:!0},type:Number})],w.prototype,"longitude",void 0),(0,r._)([(0,a.MZ)({json:{write:!0},type:Number})],w.prototype,"ellipsoidRadius",void 0),(0,r._)([(0,a.MZ)({json:{write:!0},type:Number})],w.prototype,"squaredEccentricity",void 0),(0,r._)([(0,a.MZ)({json:{write:!0}})],w.prototype,"properties",void 0),w=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.CameraOrientationLTP")],w);const b=w;let M=class extends(d.A.ClonableMixin(y.A.JSONSupportMixin(g))){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,omega:s,phi:a,kappa:l,affineTransformations:p,focalLength:c,principalOffsetPoint:u,radialDistortionCoefficients:d,tangentialDistortionCoefficients:y}=this,h=[e,t,i,r,o,n,s,a,l];return this.isAdvanced&&(p?.forEach((e=>h.push(e))),h.push(c),u?.forEach((e=>h.push(e))),d?.forEach((e=>h.push(e))),y?.forEach((e=>h.push(e)))),h.map((e=>isNaN(e)?"":e)).join("|")}};(0,r._)([(0,a.MZ)({json:{write:!0}})],M.prototype,"type",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],M.prototype,"affineTransformations",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"focalLength",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],M.prototype,"principalOffsetPoint",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],M.prototype,"radialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],M.prototype,"tangentialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"omega",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"phi",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"kappa",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"x",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"y",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],M.prototype,"z",void 0),M=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.CameraOrientationOPK")],M);const j=M;let x=class extends(d.A.ClonableMixin(y.A.JSONSupportMixin(g))){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:t,principalOffsetPoint:i,radialDistortionCoefficients:r,tangentialDistortionCoefficients:o}=this;return e?.length>1||!Number.isNaN(t)||i?.length>1||r?.length>1||o?.length>1}toString(){const{type:e,horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,yaw:s,pitch:a,roll:l,affineTransformations:p,focalLength:c,principalOffsetPoint:u,radialDistortionCoefficients:d,tangentialDistortionCoefficients:y}=this,h=[e,t,i,r,o,n,s,a,l];return this.isAdvanced&&(p?.forEach((e=>h.push(e))),h.push(c),u?.forEach((e=>h.push(e))),u?.forEach((e=>h.push(e))),d?.forEach((e=>h.push(e))),y?.forEach((e=>h.push(e)))),h.map((e=>Number.isNaN(e)?"":e)).join("|")}};(0,r._)([(0,a.MZ)({json:{write:!0}})],x.prototype,"type",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],x.prototype,"affineTransformations",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"focalLength",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],x.prototype,"principalOffsetPoint",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],x.prototype,"radialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:[Number],json:{write:!0}})],x.prototype,"tangentialDistortionCoefficients",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"yaw",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"pitch",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"roll",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"x",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"y",void 0),(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],x.prototype,"z",void 0),x=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.CameraOrientationYPR")],x);const Z=x;var S;!function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"}(S||(S={}));const P=new Map;P.set(`${S.OPK}`,{desc:"Using Omega Phi Kappa",constructor:j}),P.set(`${S.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:_}),P.set(`${S.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:Z}),P.set(`${S.LTP}`,{desc:"Using Local Tangent Plane",constructor:b});let T=class extends(d.A.ClonableMixin(y.A)){constructor(){super(...arguments),this.url=null}};(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],T.prototype,"lod",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:!0}})],T.prototype,"rasterFunction",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:!0}})],T.prototype,"url",void 0),T=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],T);let N=class extends(d.A.ClonableMixin(y.A)){constructor(){super(...arguments),this.constantElevation=null}};function D(e,t,i){return e?null!=(r=e)&&"number"==typeof r.constantElevation?new N(e):function(e,t,i){let{url:r}=e;return r?(r=function(e,t,i){return t&&(e=`${t}${e}`),i&&(e+=`${i}`),e}(r,t,i),new T({...e,url:r})):null}(e,t,i):e;var r}(0,r._)([(0,a.MZ)({type:Number,json:{write:!0}})],N.prototype,"constantElevation",void 0),N=(0,r._)([(0,l.$)("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],N);const O=new u.J({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new u.J({Feet:"feet",Meter:"meter"}),I=new u.J({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;R.set(`${S.HPR}`,(function(e){const[t,i,r,o,n,s,a,l,p,c,u,d,y,h,f,m,g,v,_,w,b,M]=e.slice(1);return{horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,heading:s,pitch:a,roll:l,...$([p,c,u,d,y,h],[m,g],[v,_,w],[b,M],f)}})),R.set(`${S.YPR}`,(function(e){const[t,i,r,o,n,s,a,l,p,c,u,d,y,h,f,m,g,v,_,w,b,M]=e.slice(1);return{horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,yaw:s,pitch:a,roll:l,...$([p,c,u,d,y,h],[m,g],[v,_,w],[b,M],f)}})),R.set(`${S.OPK}`,(function(e){const[t,i,r,o,n,s,a,l,p,c,u,d,y,h,f,m,g,v,_,w,b,M]=e.slice(1);return{horizontalWKID:t,verticalWKID:i,x:r,y:o,z:n,omega:s,phi:a,kappa:l,...$([p,c,u,d,y,h],[m,g],[v,_,w],[b,M],f)}})),R.set(`${S.LTP}`,(function(e){const[t,i,r,o,n,...s]=e.slice(1),a=R.get(n),l=P.get(n)?.constructor;return a&&l?{latitude:t,longitude:i,ellipsoidRadius:r,squaredEccentricity:o,properties:new l(a([n,"",...s]))}:null}));const F=e=>{const t=e.map((e=>parseFloat(e))).filter((e=>!isNaN(e)));if(t.length===e.length)return t};function $(e,t,i,r,o){const n=F(e),s=F(t),a=F(i),l=F(r);return{affineTransformations:6===n?.length?n:void 0,focalLength:6===n?.length?parseFloat(o):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==a?.length?[0,0,0]:a,tangentialDistortionCoefficients:2!==l?.length?[0,0]:l}}var E=i(43440),z=i(79677),C=i(92935);const L=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),K=(e,t)=>!L.has(t)&&e;function G(e,t,i,r){const{name:o,write:n,read:s}=((e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}})(e,t,i),a={name:o,write:n,read:s,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:K(n,e),read:K(s,e)},"web-map":{name:o,write:n,read:s}}};return r&&a.origins?(a.type=r,a.origins["web-map"].type=r,a.origins["web-scene"].type=r,a):a}let J=class extends p.default{constructor(){super(...arguments),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return D(e,t,i)}async save(e){return this._debouncedSaveOperations(C.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(C.X.SAVE_AS,t,e)}findFirstValidLayerId(e){return e.layers?.find((e=>this.supportedSourceTypes.has(e.type)))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new o.A("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};var q;(0,r._)([(0,a.MZ)({type:E.A,json:{write:!1,read:!1}})],J.prototype,"attributeTableTemplate",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("cameraHeading")})],J.prototype,"cameraHeading",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("cameraHeight")})],J.prototype,"cameraHeight",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("cameraPitch")})],J.prototype,"cameraPitch",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("cameraRoll")})],J.prototype,"cameraRoll",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("coveragePercent")})],J.prototype,"coveragePercent",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("demPathPrefix")})],J.prototype,"demPathPrefix",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("demPathSuffix")})],J.prototype,"demPathSuffix",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("depthImagePathPrefix")})],J.prototype,"depthImagePathPrefix",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("depthImagePathSuffix")})],J.prototype,"depthImagePathSuffix",void 0),(0,r._)([(0,a.MZ)({type:Object,json:G("elevationSource")})],J.prototype,"elevationSource",void 0),(0,r._)([(0,a.MZ)({readOnly:!0})],J.prototype,"effectiveElevationSource",null),(0,r._)([(0,a.MZ)({type:Number,json:G("farDistance")})],J.prototype,"farDistance",void 0),(0,r._)([(0,a.MZ)()],J.prototype,"geometryType",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("horizontalFieldOfView")})],J.prototype,"horizontalFieldOfView",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("horizontalMeasurementUnit")})],J.prototype,"horizontalMeasurementUnit",void 0),(0,r._)([(0,a.MZ)({type:String,json:{...G("imageGeometryField"),default:"ImageGeometry"}})],J.prototype,"imageGeometryField",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("imagePathPrefix")})],J.prototype,"imagePathPrefix",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("imagePathSuffix")})],J.prototype,"imagePathSuffix",void 0),(0,r._)([(0,a.MZ)({type:String,json:{...G("imageReferenceField"),default:"OIObjectID"}})],J.prototype,"imageReferenceField",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("imageRotation")})],J.prototype,"imageRotation",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("maximumDistance")})],J.prototype,"maximumDistance",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("nearDistance")})],J.prototype,"nearDistance",void 0),(0,r._)([(0,a.MZ)({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],J.prototype,"operationalLayerType",void 0),(0,r._)([(0,a.MZ)({json:{...G("orientationAccuracy",((e,t,i)=>{(0,s.sM)(i,e.join(";"),t)}),(e=>{const t=e?.split(";")?.map(Number);return function(e){return Array.isArray(e)&&9===e?.length&&!e.some(isNaN)}(t)?t:[0,0,0,0,0,0,0,0,0]}),String)}})],J.prototype,"orientationAccuracy",void 0),(0,r._)([(0,a.MZ)({json:{...G("orientedImageryType",I.write,I.read,I.jsonValues.slice(1))}})],J.prototype,"orientedImageryType",void 0),(0,r._)([(0,a.MZ)({json:{read:!1},value:"oriented-imagery",readOnly:!0})],J.prototype,"type",void 0),(0,r._)([(0,a.MZ)({type:O.apiValues,json:{...G("timeIntervalUnit",O.write,O.read,O.jsonValues)}})],J.prototype,"timeIntervalUnit",void 0),(0,r._)([(0,a.MZ)((q=(0,n.o8)(c.B),q.json?(q.json.origins=q.json.origins??{},q.json.origins["web-scene"]={write:!1,read:!1},q):q))],J.prototype,"useViewTime",void 0),(0,r._)([(0,a.MZ)({type:Number,json:G("verticalFieldOfView")})],J.prototype,"verticalFieldOfView",void 0),(0,r._)([(0,a.MZ)({type:A.apiValues,json:{...G("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],J.prototype,"verticalMeasurementUnit",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("videoPathPrefix")})],J.prototype,"videoPathPrefix",void 0),(0,r._)([(0,a.MZ)({type:String,json:G("videoPathSuffix")})],J.prototype,"videoPathSuffix",void 0),(0,r._)([(0,a.MZ)({type:z.A,json:{origins:{"web-scene":{write:!1,read:!1}}}})],J.prototype,"visibilityTimeExtent",void 0),J=(0,r._)([(0,l.$)("esri.layers.OrientedImageryLayer")],J);const W=J}}]);
|