@arcgis/core 4.33.0-next.20250218 → 4.33.0-next.20250219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{f5ce6af342c02a4b0d15.js → 030384851fa745908a6e.js} +13 -12
  3. package/assets/esri/core/workers/chunks/0e6762d69b7449f8a997.js +1 -0
  4. package/assets/esri/core/workers/chunks/{5ad51a68d20b0d0d404f.js → 1661ac4e1b6c6af6ee0f.js} +1 -1
  5. package/assets/esri/core/workers/chunks/186db99d05ca1183d4e9.js +1 -0
  6. package/assets/esri/core/workers/chunks/{a42ae5d5e5f66d120b4d.js → 21c7265f1f2a718de7c6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2a88909a03600349dff9.js +1 -0
  8. package/assets/esri/core/workers/chunks/5352b374454bc4f73d55.js +1 -0
  9. package/assets/esri/core/workers/chunks/5984ab09ea8010f8a874.js +1 -0
  10. package/assets/esri/core/workers/chunks/{ec62fffe07c4382e8796.js → 6c64ccf5f64b5025b239.js} +1 -1
  11. package/assets/esri/core/workers/chunks/717d7e9912d948e44d8d.js +1 -0
  12. package/assets/esri/core/workers/chunks/b9292cd91005137a2094.js +1 -0
  13. package/assets/esri/core/workers/chunks/b9d2f60b2d587a2b6cd7.js +1 -0
  14. package/assets/esri/core/workers/chunks/cf285e45c18cd4399dde.js +1 -0
  15. package/assets/esri/core/workers/chunks/{42f21349f488a14198e4.js → d4a08800c75051a5131d.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3f077176c03a360e1edd.js → dc68246df91af766593a.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{290f613ef70590de9f15.js → e862f1b9ecafc6c92b86.js} +1 -1
  18. package/assets/esri/core/workers/chunks/e96f4c76c8bc78a7f80f.js +1 -0
  19. package/assets/esri/core/workers/chunks/f06231c14c0c0e5525bd.js +1 -0
  20. package/assets/esri/core/workers/chunks/f24aef061e60d2c2f597.js +1 -0
  21. package/assets/esri/core/workers/chunks/f664cc15238c8e9856a0.js +1 -0
  22. package/assets/esri/themes/base/widgets/_Print.scss +1 -0
  23. package/assets/esri/themes/base/widgets/_ResponsiveToolbar.scss +14 -0
  24. package/assets/esri/themes/dark/main.css +1 -1
  25. package/assets/esri/themes/light/main.css +1 -1
  26. package/assets/esri/themes/light/view.css +1 -1
  27. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  28. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  29. package/chunks/RealisticTree.glsl.js +18 -17
  30. package/copyright.txt +71 -0
  31. package/geometry/support/meshUtils/elevation.js +1 -1
  32. package/interfaces.d.ts +178 -60
  33. package/layers/BuildingSceneLayer.js +1 -1
  34. package/layers/FeatureLayer.js +1 -1
  35. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  36. package/layers/IntegratedMeshLayer.js +1 -1
  37. package/layers/OrientedImageryLayer.js +1 -1
  38. package/layers/PointCloudLayer.js +1 -1
  39. package/layers/SceneLayer.js +1 -1
  40. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  41. package/layers/graphics/OptimizedGeometry.js +1 -1
  42. package/layers/graphics/featureConversionUtils.js +1 -1
  43. package/layers/support/featureLayerUtils.js +1 -1
  44. package/package.json +1 -1
  45. package/portal/Portal.js +1 -1
  46. package/rest/support/AttributeBinsGrouping.js +1 -1
  47. package/rest/support/AttributeBinsQuery.js +1 -1
  48. package/support/revision.js +1 -1
  49. package/symbols/cim/cimAnalyzer.js +1 -1
  50. package/views/2d/FrameTask.js +1 -1
  51. package/views/2d/layers/features/sources/FeatureCache.js +1 -1
  52. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  53. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  54. package/views/2d/viewpointUtils.js +1 -1
  55. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  56. package/views/3d/layers/support/FeatureTile.js +1 -1
  57. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  58. package/views/3d/terrain/TileRenderer.js +1 -1
  59. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  60. package/views/3d/webgl-engine/materials/renderers/BufferRange.js +1 -1
  61. package/views/VideoView.js +1 -1
  62. package/views/View2D.js +1 -1
  63. package/views/Viewport2DMixin.js +5 -0
  64. package/views/webgl/Texture.js +1 -1
  65. package/widgets/BasemapLayerList.js +1 -1
  66. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  67. package/widgets/BatchAttributeForm/templates/support/contingentValuesUtils.js +5 -0
  68. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  69. package/widgets/BatchAttributeForm.js +1 -1
  70. package/widgets/CatalogLayerList.js +1 -1
  71. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  72. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  73. package/widgets/LayerList.js +1 -1
  74. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  75. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  76. package/widgets/OrientedImageryViewer/digitizationUtils.js +1 -1
  77. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  78. package/widgets/OrientedImageryViewer.js +1 -1
  79. package/widgets/Print.js +1 -1
  80. package/widgets/ShadowCast.js +1 -1
  81. package/widgets/Sketch/SketchViewModel.js +1 -1
  82. package/widgets/VideoPlayer.js +1 -1
  83. package/assets/esri/core/workers/chunks/1cbea0c0b20a2963a86d.js +0 -1
  84. package/assets/esri/core/workers/chunks/238bcf6514a1f214cc8a.js +0 -1
  85. package/assets/esri/core/workers/chunks/26b5397f63dc602612f2.js +0 -1
  86. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +0 -1
  87. package/assets/esri/core/workers/chunks/6039da57a2adedd3b83f.js +0 -1
  88. package/assets/esri/core/workers/chunks/842db06ce62758fab1e7.js +0 -1
  89. package/assets/esri/core/workers/chunks/916f0ca8e3aaed5a9508.js +0 -1
  90. package/assets/esri/core/workers/chunks/cb3148cf11a420d6e9ab.js +0 -1
  91. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +0 -1
  92. package/assets/esri/core/workers/chunks/d3f7ff03ab5b40062d89.js +0 -1
  93. package/assets/esri/core/workers/chunks/ed89a108b032b982b12f.js +0 -1
  94. package/assets/esri/core/workers/chunks/ef6279f5c63ab1e88c71.js +0 -1
  95. package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.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 t from"../../core/Collection.js";import o from"../../core/Error.js";import i from"../../core/Evented.js";import{drainHandles as a}from"../../core/handleUtils.js";import"../../core/has.js";import r from"../../core/Logger.js";import{destroyMaybe as s,abortMaybe as n}from"../../core/maybe.js";import{createAbortError as p,whenOrAbort as l,ignoreAbortErrors as h}from"../../core/promiseUtils.js";import{on as c,watch as d,when as u,whenOnce as y,syncAndInitial as m}from"../../core/reactiveUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as _}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as b,load as w,project as G,isLoaded as O}from"../../geometry/projection.js";import{geometryToCoordinates as T}from"../../geometry/support/coordsUtils.js";import{equals as E}from"../../geometry/support/spatialReferenceUtils.js";import S from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as M}from"../../layers/support/layerUtils.js";import k from"../../symbols/FillSymbol3DLayer.js";import A from"../../symbols/MeshSymbol3D.js";import C from"../../symbols/SimpleFillSymbol.js";import H from"../../symbols/SimpleLineSymbol.js";import D from"../../symbols/SimpleMarkerSymbol.js";import{symbolTypes as R}from"../../symbols/support/typeUtils.js";import{SupportedObjectResult as j,isSupportedObjectResultMessage as I}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as U}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as P}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as x}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as L}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import{sketchKeys as V}from"../../views/interactive/keybindings.js";import K from"../../views/interactive/sketch/SketchLabelOptions.js";import W from"../../views/interactive/sketch/SketchOptions.js";import Z from"../../views/interactive/sketch/SketchTooltipOptions.js";import q from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as z}from"../../views/interactive/snapping/SnappingManager.js";import N from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as B}from"../../views/interactive/snapping/snappingUtils.js";import{findFirstGraphicHit as $}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as Y}from"../../views/support/screenUtils.js";import{CreateOperationHandle as J,UpdateOperationHandle as Q}from"./support/OperationHandle.js";import{getModeFromCreateOptions as X,getDrawToolGeometryTypeFromCreateTool as ee}from"./support/sketchUtils.js";const te={defaultZ:0},oe={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0},tool:"transform"};let ie=class extends i.EventedAccessor{constructor(e){super(e),this._defaultSnappingManager=null,this._updatingHandles=new f,this._internalGraphicsLayer=new S({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new D({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new C({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new H({color:[130,130,130,1],width:2}),this.meshSymbol=new A({symbolLayers:new t([new k])}),this.updateGraphics=new t,this.updateOnGraphicClick=!0,this.creationMode="single",this.vertexSymbol=new D({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new W,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._originalPopupEnabled=null,this.defaultCreateOptions=te,this.defaultUpdateOptions=oe,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new N}initialize(){this.addHandles([c((()=>this.view?.map?.layers),"change",(e=>{e.removed.includes(this.layer)&&this.cancel()})),c((()=>this.layer?.graphics),"change",(e=>{if(null!=this._operationHandle)for(const t of e.removed)this.updateGraphics.includes(t)&&(this.updateGraphics.length>1?this._operationHandle.removeFromSelection(t):this._operationHandle.cancel())})),d((()=>this.layer?.elevationInfo??null),(e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)}),m),d((()=>this.view),(e=>{this._defaultSnappingManager=s(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new z({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))}),m),d((()=>this.view?.spatialReference),((e,t)=>{e&&t&&!e.equals(t)&&this.cancel()}))]),B(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=s(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this.emit("destroy")}get updating(){return this._updatingHandles.updating||null!=this.snappingManager&&this.snappingManager.updating}get activeTool(){return this._operationHandle?.tool??null}get activeCreateToolDrawMode(){return"create"===this._operationHandle?.type&&this._operationHandle.activeComponent&&"mode"in this._operationHandle.activeComponent?this._operationHandle.activeComponent.mode:null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...te,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...oe,...e,reshapeOptions:{...oe.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...oe.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=s(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new z({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&(t.cursor=null),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(u((()=>e.ready),(t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)}),m),o),this._set("view",e)}cancel(){this._moduleLoaderAbortController=n(this._moduleLoaderAbortController),this._viewReadyAbortController=n(this._viewReadyAbortController),this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e,layer:o}=this,i=t.toArray();o.removeMany(i),this.cancel(),this._emitDeleteEvent({graphics:i,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map((e=>e.clone())).toArray();return this.layer.addMany(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),p();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");L(o,this._internalGraphicsLayer);const a=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==a||this.destroyed)return void o.map.remove(this._internalGraphicsLayer);const r=()=>{if(a===this._operationHandle){const o=this.createGraphic,r=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map&&this.view.map.remove(this._internalGraphicsLayer),a.cancelled||null==o||i.add(o),this.emit("create",{graphic:o,state:r?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"}),r)return;const{creationMode:s}=this;if("continuous"===s){if(t?.geometryToPlace)return;this._updatingHandles.addPromise(h(this.create(e,t)))}else"update"===s&&o&&this._updatingHandles.addPromise(h(this.update([o])))}};a.on("complete",r),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),p();null!=i.activeTool&&(i.activeTool=null);const r=Array.isArray(e)?e:[e];if(null==e||!r?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(r.some((e=>e.layer!==o?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0))))return;const s=await this._updatingHandles.addPromise(this._setupUpdateOperation(r,t));this.destroyed||null==s||ue(s)||(L(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(s,t),this.emit("update",{graphics:r,state:"start",aborted:!1,tool:s.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||E(o.geometry.spatialReference,t.spatialReference)||(b(o.geometry.spatialReference,t.spatialReference)||O()||await w(),o.geometry=G(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._operationHandle?.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const i=await t.hitTest(e,{exclude:o});return $(i.results)}const o=[t.map.ground];t.map.allLayers.forEach((e=>{M(e.type)&&o.push(e)}));const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?_(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",(async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))}),F.WIDGET)]}async _handleImmediateClick(e){const t=await e.async((()=>this._getFirstHit(Y(e))));let o=null;if(null!=t){const i=t.graphic;this.updateGraphics.includes(i)||i.layer===this.layer?(e.stopPropagation(),o=i):"2d"!==this.view?.type||this._isComponentGraphic(i)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a=await this._setupDrawGraphicTool(e,o,i);return null==a?null:(o.tools.add(a),o.activeTool=a,this._setupCreateOperationHandle(a))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:r,geometryToPlace:s,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=X(p,e),c=ee(e),d=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=d?.preserveAspectRatio??l??"rectangle"!==e,y={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:i,defaultZ:a,forceUniformSize:u,graphicProperties:n,geometryToPlace:s,geometryType:c,mode:h,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:r,snappingManager:this.snappingManager,snapToScene:!1,view:t,...d};return"2d"===t.type?this._makeDrawGraphicTool2D(y):this._makeDrawGraphicTool3D(y)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return ue(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:se(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(t)||this.destroyed)return null;const{elevationInfo:o}=this.layer;return new t.module.DrawGraphicTool3D({...e,elevationInfo:o,snapToScene:!0,sketchOptions:this.sketchOptions})}_setupCreateOperationHandle(e){const t=this.view;if(!t)return this._logMissingView(),null;let o=null;const i=e.forceUniformSize,r=e.centered,s=[t.on("key-down",(t=>{if(t.key===V.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===V.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==V.vertexAdd||t.repeat)t.key===V.undo?(t.stopPropagation(),n.undo()):t.key===V.redo?(t.stopPropagation(),n.redo()):t.key!==V.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===V.center&&(t.repeat||(e.centered=!r,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}}),F.WIDGET),t.on("key-up",(t=>{t.key===V.pan?e.enabled=!0:t.key!==V.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===V.center&&(e.centered=r,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())}),F.WIDGET),e.on("vertex-add",(t=>{switch(o=null==o?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:o,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("cursor-update",(t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})})),e.on("vertex-remove",(t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("complete",(e=>{this._set("createGraphic",e.graphic),o="complete",e.aborted?n&&n.cancel():n&&n.complete()})),d((()=>this._getGraphicSymbolFromTool(e.geometryType)),(t=>{e.graphicSymbol=t}))],n=new J({activeComponent:e,tool:e.geometryType,type:"create",onEnd:()=>{a(s),t.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return n}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol}}async _setupUpdateOperation(e,t){const{layer:o,view:i}=this;if(!i)return this._logMissingView(),null;const a={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let r=a.tool??oe.tool;for(const s of e)o.remove(s),o.add(s);if("3d"===i.type){if(0===e.length)return null;switch(r){case"move":return this._setupMove3DOperation(e,a,i,r);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],a,i);case"transform":return this._setupGraphicTransform3DOperation(e,a,i)}}switch(r){case"move":return this._setupMove2DOperation(e,a,i);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,r,a,i);case"transform":if(1===e.length){const t=e[0].geometry?.type;"point"!==t&&"multipoint"!==t||(r="reshape")}return this._setupTransformOrReshape2DOperation(e,r,a,i)}}async _setupMove3DOperation(e,t,o,i,r=!1){const s=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(s))return s;const{ManipulatedObject3DGraphic:n,MoveTool3D:p}=s.module,l=new Map,h=()=>{l.forEach((e=>e.destroy())),l.clear()};for(const a of e){const e=new n({view:o,graphic:a}),t=U(e);if(t!==j.SUPPORTED)return h(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${I(t)}).`),null;l.set(a,e)}const c=new p({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(c),c.objects.addMany(Array.from(l.values())),r||this.updateGraphics.addMany(e);const d=[],u=new Q({activeComponent:c,tool:i,type:"update",onEnd:()=>{a(d),de(o,c),h()},undo:()=>{he(this.view,c),ne(u,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{pe(u,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:e=>{this.updateGraphics.push(e);const t=new n({view:o,graphic:e});l.set(e,t),c.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);if(u.history.undo.forEach((e=>e.updates.splice(t,1))),u.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void u.complete();const o=l.get(e);o&&(c.objects.remove(o),o.destroy(),l.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0),a=await this._setupReshape3DOperation(e,t,o,!0);a&&!ue(a)&&(u.onEnd(),u.destroy(),this._setUpdateOperationHandle(a,t))}});return d.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(u,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(u,e)}),F.WIDGET)),u}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&x(e[0])===j.SUPPORTED){const a=e[0],r=a.geometry;if(null!=r&&("point"===r.type||"mesh"===r.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=r&&("polygon"===r.type||"polyline"===r.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:r,enableScaling:s,enableZ:n}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,c=new h({graphic:e,view:o}),d=new l({object:c,view:o,enableRotation:r,enableScaling:s,enableZ:n,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),this.updateGraphics.add(e);const u=[],y=new Q({activeComponent:d,tool:i,type:"update",onEnd:()=>{a(u),de(o,d),c.destroy()},undo:()=>{he(this.view,d),ne(y,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{pe(y,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),y.onEnd(),y.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),y.complete()},toggleTool:()=>{}});return u.push(...this._getHandlesForComponent(y,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(y,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(y,e)}),F.WIDGET)),y}async _setupPolyTransform3DOperation(e,t,o,i=!1){const r="transform",{enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:l}=t,h=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(h))return h;const{ManipulatedObject3DGraphic:c,ExtentTransformTool:d}=h.module,u=this.view?.inputManager?.isModifierKeyDown(V.constraint),y=new c({view:o,graphic:e}),m=new d({object:y,view:o,enableRotation:s,enableScaling:n,enableZ:p,preserveAspectRatio:!!l!=!!u,sketchOptions:this.sketchOptions});o.tools.add(m),i||this.updateGraphics.add(e);const g=[],v=new Q({activeComponent:m,tool:r,type:"update",onEnd:()=>{a(g),de(o,m),y.destroy()},canUndo:()=>!m.destroyed&&m.canUndo,undo:()=>{m.destroyed||(m.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r}))},canRedo:()=>!m.destroyed&&m.canRedo,redo:()=>{m.destroyed||(m.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),v.onEnd(),v.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),v.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const i=await this._setupReshape3DOperation(e,t,o,!0);i&&!ue(i)&&(v.onEnd(),v.destroy(),this._setUpdateOperationHandle(i,t))}});return g.push(...this._getHandlesForComponent(v,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(v,e,t)),F.WIDGET),o.on("key-down",(e=>this._getCommonUpdateOperationKeyDownHandlers(v,e)),F.WIDGET),o.on("key-down",(e=>{e.key!==V.constraint||e.repeat||(m.preserveAspectRatio=!m.preserveAspectRatio,e.stopPropagation())}),F.WIDGET),o.on("key-up",(e=>{e.key===V.constraint&&(m.preserveAspectRatio=!m.preserveAspectRatio,e.stopPropagation())}),F.WIDGET)),v}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const r=await this._getGraphicMover(e,t,o);if(ue(r))return r;const s=new Q({activeComponent:r,tool:i,type:"update",onEnd:()=>{this._displayDefaultCursor(),a(l),a(p),r.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();ne(s,e),s.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();pe(s,e),s.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),r.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach((e=>e.updates.splice(t,1))),s.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?r.graphics=o:s.complete()}});let n=!1;const p=[o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(s,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key!==V.constraint||e.repeat||(n=!0,r.enableMoveAllGraphics=!r.enableMoveAllGraphics)}),F.WIDGET),o.on("key-up",(e=>{e.key===V.constraint&&n&&(n=!1,r.enableMoveAllGraphics=!r.enableMoveAllGraphics)}),F.WIDGET)],l=this._getHandlesForComponent(s,t);return s}async _setupReshape3DOperation(e,t,o,i=!1){const r="reshape",s=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(s))return s;const{ManipulatedObject3DGraphic:n,ReshapeTool3D:p}=s.module,l=new n({view:o,graphic:e}),h=P(l);if(h!==j.SUPPORTED)return l.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${I(h)}).`),null;const c=t.reshapeOptions,d=new p({view:o,object:l,enableZVertex:t.enableZ&&"move"===c?.vertexOperation,enableZShape:t.enableZ&&"move"===c?.shapeOperation,enableMoveObject:"move"===c?.shapeOperation||"move-xy"===c?.shapeOperation,enableMidpoints:"split"===c?.edgeOperation,enableEdgeOffset:"offset"===c?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),i||this.updateGraphics.add(l.graphic);const u=[],y=new Q({activeComponent:d,tool:r,type:"update",onEnd:()=>{a(u),de(o,d),l.destroy()},canUndo:()=>!d.destroyed&&d.canUndo,undo:()=>{d.destroyed||(d.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r}))},canRedo:()=>!d.destroyed&&d.canRedo,redo:()=>{d.destroyed||(d.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),y.onEnd(),y.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),y.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;y.onEnd(),y.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);ue(e)||this._setUpdateOperationHandle(e,t)}});return u.push(...this._getHandlesForComponent(y,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(y,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(y,e)}),F.WIDGET)),y}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const r="transform"===t?await this._getBox(e,o,i):await this._getReshape(e,o,i);if(ue(r))return r;const s=new Q({activeComponent:r,type:"update",onEnd:()=>{a(p),a(n),s.activeComponent&&!s.activeComponent.destroyed&&s.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{ne(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},redo:()=>{pe(s,this.updateGraphics.toArray()),s.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s.tool})},addToSelection:async e=>{let t=s.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),s.onEnd(),s.destroy();const a=await this._setupTransformOrReshape2DOperation(t,"transform",o,i);if(ue(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),s.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);s.history.undo.forEach((e=>e.updates.splice(t,1))),s.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();if(0===o.length)s.complete();else{const e=o[0].geometry;1!==o.length||null==e||"point"!==e.type&&"multipoint"!==e.type?s.activeComponent.graphics=o:s.toggleTool()}this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===s.tool&&("point"===t.type||"multipoint"===t.type)||"transform"===s.tool&&"extent"===t.type))return;let r=null;"transform"===s.tool?r=await this._getReshape([e],o,i):"reshape"===s.tool&&(r=await this._getBox([e],o,i)),ue(r)||(s.activeComponent?.destroy(),s.activeComponent=r,s.activeComponent&&(a(p),p=this._getHandlesForComponent(s,o)))}}),n=[i.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(s,e,o)),F.WIDGET),i.on("key-down",(e=>{if(this._getCommonUpdateOperationKeyDownHandlers(s,e),e.key===V.constraint&&!e.repeat&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),F.WIDGET),i.on("key-up",(e=>{if(e.key===V.constraint&&s){const e=s.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),F.WIDGET)];let p=this._getHandlesForComponent(s,o);return s}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,r=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return ue(r)?r:new r.module.default({enableMoveAllGraphics:i,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayGrabbingCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayPointerCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:r,preserveAspectRatio:s}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(ue(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(V.constraint);return new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightsEnabled:!!r?.enabled,preserveAspectRatio:!!s!=!!p,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const i="split"===t.reshapeOptions?.edgeOperation,a="move"===t.reshapeOptions?.shapeOperation,r=!!t.highlightOptions?.enabled,s=await this._requireModule(import("../../views/draw/support/Reshape.js"));return ue(s)?s:new s.module.default({enableMidpoints:i,enableMovement:a,graphic:e[0],highlightsEnabled:r,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map((e=>T(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map((e=>T(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",(({graphic:t,viewEvent:o})=>{o.native?.shiftKey&&(o.stopPropagation(),e.removeFromSelection(t))})),o.on("graphic-move-start",(t=>e.addToHistory(ce(t.allGraphics))))];case"box":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(ce(t.graphics)))),o.on("rotate-start",(t=>e.addToHistory(ce(t.graphics)))),o.on("scale-start",(t=>e.addToHistory(ce(t.graphics))))];case"reshape":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(ce([t.mover])))),o.on("reshape-start",(t=>e.addToHistory(ce([t.graphic])))),o.on("vertex-add",(t=>e.addToHistory(ce([t.oldGraphic])))),o.on("vertex-remove",(t=>e.addToHistory(ce([t.oldGraphic]))))];case"move-3d":return[o.events.on("record-undo",(({updates:t})=>{e.addToHistory({updates:t})})),o.events.on("move-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})})),o.events.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})})),o.events.on("move-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))];case"transform-3d":return[o.events.on("record-undo",(({updates:t})=>{e.addToHistory({updates:t})})),o.events.on("translate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})})),o.events.on("translate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})})),o.events.on("rotate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})})),o.events.on("rotate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})})),o.events.on("scale-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})})),o.events.on("scale-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})})),o.events.on("translate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})})),o.events.on("rotate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})})),o.events.on("scale",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))];case"reshape-3d":return[o.events.on("reshape",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})})),o.events.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})})),o.events.on("vertex-add",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.events.on("vertex-remove",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;return a.native?.shiftKey&&i.layer===this.layer?(a.stopPropagation(),e.removeFromSelection(i)):t.toggleToolOnClick?(a.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}async _getCommonUpdateOperationClickHandlers(e,t,o){const i=Y(t),a=await t.async((()=>this._getFirstHit(i)));if(null==a)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([a.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(a.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;return e.some((e=>null!=e&&(!(!i||e.layer!==this.layer)&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0))))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===V.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===V.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===V.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&V.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=s(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_displayPointerCursor(){this.view?.container&&"pointer"!==this.view.cursor&&(this.view.cursor="pointer")}_displayGrabbingCursor(){this.view?.container&&"grabbing"!==this.view.cursor&&(this.view.cursor="grabbing")}_displayDefaultCursor(){this.view?.container&&null!==this.view.cursor&&(this.view.cursor=null)}_logError(e,t,i){r.getLogger(this).error(new o(e,t,i))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}get test(){}wait(){return y((()=>!this.updating))}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(n(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await l(y((()=>e?.ready)),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",re("view"))}_logMissingLayer(){this._logError(ae,re("layer"))}};e([g()],ie.prototype,"_defaultSnappingManager",void 0),e([g()],ie.prototype,"updating",null),e([g({readOnly:!0})],ie.prototype,"_updatingHandles",void 0),e([g()],ie.prototype,"_operationHandle",void 0),e([g({readOnly:!0})],ie.prototype,"activeTool",null),e([g({readOnly:!0})],ie.prototype,"activeCreateToolDrawMode",null),e([g()],ie.prototype,"activeTooltip",null),e([g({types:R})],ie.prototype,"activeFillSymbol",void 0),e([g()],ie.prototype,"activeLineSymbol",void 0),e([g()],ie.prototype,"activeVertexSymbol",void 0),e([g()],ie.prototype,"allowDeleteKey",void 0),e([g({readOnly:!0})],ie.prototype,"createGraphic",null),e([g()],ie.prototype,"defaultCreateOptions",null),e([g()],ie.prototype,"defaultUpdateOptions",null),e([g({type:K,nonNullable:!0})],ie.prototype,"labelOptions",null),e([g()],ie.prototype,"layer",void 0),e([g({types:R})],ie.prototype,"pointSymbol",void 0),e([g({types:R})],ie.prototype,"polygonSymbol",void 0),e([g({types:R})],ie.prototype,"polylineSymbol",void 0),e([g()],ie.prototype,"meshSymbol",void 0),e([g({type:N,nonNullable:!0})],ie.prototype,"snappingOptions",null),e([g()],ie.prototype,"snappingManager",null),e([g({readOnly:!0})],ie.prototype,"state",null),e([g({type:Z,nonNullable:!0})],ie.prototype,"tooltipOptions",null),e([g({readOnly:!0})],ie.prototype,"updateGraphics",void 0),e([g()],ie.prototype,"updateOnGraphicClick",void 0),e([g()],ie.prototype,"creationMode",void 0),e([g({type:q,nonNullable:!0})],ie.prototype,"valueOptions",null),e([g({types:R})],ie.prototype,"vertexSymbol",void 0),e([g({value:null})],ie.prototype,"view",null),e([g({constructOnly:!0,type:W})],ie.prototype,"sketchOptions",void 0),ie=e([v("esri.widgets.Sketch.SketchViewModel")],ie);const ae="sketch:missing-property",re=e=>`Property '${e}' is missing on SketchViewModel.`;function se(e){return"polygon"===e||"rectangle"===e||"circle"===e}function ne(e,t){le("undo",e.history.undo,e.history.redo,t)}function pe(e,t){le("redo",e.history.redo,e.history.undo,t)}function le(e,t,o,i){const a=t.pop();if(!a)return;const r=a.updates,s=[];i.forEach(((t,o)=>{const i=r[o];null!=i&&("geometry"in i&&null!=i.geometry&&(s.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(s.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(s.push(i),i[e](t)))})),o.push({updates:s})}function he(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function ce(e){return{updates:e.map((({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e}))}}function de(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function ue(e){return"requireError"in e&&"aborted"===e.requireError}const ye=ie;export{ye as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import o from"../../core/Error.js";import i from"../../core/Evented.js";import{drainHandles as a}from"../../core/handleUtils.js";import"../../core/has.js";import s from"../../core/Logger.js";import{destroyMaybe as r,abortMaybe as n}from"../../core/maybe.js";import{createAbortError as p,whenOrAbort as l,ignoreAbortErrors as h}from"../../core/promiseUtils.js";import{on as c,watch as d,when as u,whenOnce as y,syncAndInitial as m}from"../../core/reactiveUtils.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as _}from"../../geometry/ellipsoidUtils.js";import{canProjectWithoutEngine as b,load as w,project as G,isLoaded as O}from"../../geometry/projection.js";import{geometryToCoordinates as T}from"../../geometry/support/coordsUtils.js";import{equals as E}from"../../geometry/support/spatialReferenceUtils.js";import S from"../../layers/GraphicsLayer.js";import{isIntegratedMeshLayer as k}from"../../layers/support/layerUtils.js";import M from"../../symbols/FillSymbol3DLayer.js";import A from"../../symbols/MeshSymbol3D.js";import C from"../../symbols/SimpleFillSymbol.js";import H from"../../symbols/SimpleLineSymbol.js";import D from"../../symbols/SimpleMarkerSymbol.js";import{symbolTypes as R}from"../../symbols/support/typeUtils.js";import{SupportedObjectResult as j,isSupportedObjectResultMessage as I}from"../../views/3d/interactive/editingTools/isSupportedObjectUtils.js";import{isSupportedObject as U}from"../../views/3d/interactive/editingTools/move/isSupportedObject.js";import{isSupportedObject as P}from"../../views/3d/interactive/editingTools/reshape/isSupportedObject.js";import{isSupportedGraphic as x}from"../../views/3d/interactive/editingTools/transform/isSupportedGraphic.js";import{addUniqueLayer as L}from"../../views/draw/support/layerUtils.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import{sketchKeys as V}from"../../views/interactive/keybindings.js";import K from"../../views/interactive/sketch/SketchLabelOptions.js";import W from"../../views/interactive/sketch/SketchOptions.js";import Z from"../../views/interactive/sketch/SketchTooltipOptions.js";import q from"../../views/interactive/sketch/SketchValueOptions.js";import{SnappingManager as z}from"../../views/interactive/snapping/SnappingManager.js";import N from"../../views/interactive/snapping/SnappingOptions.js";import{setupSnappingToggleHandles as B}from"../../views/interactive/snapping/snappingUtils.js";import{findFirstGraphicHit as $}from"../../views/support/hitTestSelectUtils.js";import{createScreenPointFromEvent as Y}from"../../views/support/screenUtils.js";import{CreateOperationHandle as J,UpdateOperationHandle as Q}from"./support/OperationHandle.js";import{getModeFromCreateOptions as X,getDrawToolGeometryTypeFromCreateTool as ee}from"./support/sketchUtils.js";const te={defaultZ:0},oe={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0},tool:"transform"};let ie=class extends i.EventedAccessor{constructor(e){super(e),this._defaultSnappingManager=null,this._updatingHandles=new f,this._internalGraphicsLayer=new S({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.layer=null,this.pointSymbol=new D({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new C({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new H({color:[130,130,130,1],width:2}),this.meshSymbol=new A({symbolLayers:new t([new M])}),this.updateGraphics=new t,this.updateOnGraphicClick=!0,this.creationMode="single",this.vertexSymbol=new D({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.sketchOptions=new W,this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._sketchContinuationFlag=!1,this._originalPopupEnabled=null,this.defaultCreateOptions=te,this.defaultUpdateOptions=oe,this.snappingOptions=e?.snappingManager?.options??e?.snappingOptions??new N}initialize(){this.addHandles([c((()=>this.view?.map?.layers),"change",(e=>{e.removed.includes(this.layer)&&this.cancel()})),c((()=>this.layer?.graphics),"change",(e=>{if(null!=this._operationHandle)for(const t of e.removed)this.updateGraphics.includes(t)&&(this.updateGraphics.length>1?this._operationHandle.removeFromSelection(t):this._operationHandle.cancel())})),d((()=>this.layer?.elevationInfo??null),(e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)}),m),d((()=>this.view),(e=>{this._defaultSnappingManager=r(this._defaultSnappingManager),e&&(this.snappingManager||(this._defaultSnappingManager=new z({view:e,options:this.snappingOptions})),"2d"===e.type?import("../../views/2d/interactive/editingTools.js"):"3d"===e.type&&(import("../../views/3d/interactive/editingTools.js"),import("../../views/3d/layers/GraphicsLayerView3D.js")))}),m),d((()=>this.view?.spatialReference),((e,t)=>{e&&t&&!e.equals(t)&&this.cancel()}))]),B(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._defaultSnappingManager=r(this._defaultSnappingManager),this._set("snappingManager",null),this._set("view",null),this._updatingHandles.destroy(),this.emit("destroy")}get updating(){return this._updatingHandles.updating||null!=this.snappingManager&&this.snappingManager.updating}get activeTool(){return this._operationHandle?.tool??null}get activeCreateToolDrawMode(){return"create"===this._operationHandle?.type&&this._operationHandle.activeComponent&&"mode"in this._operationHandle.activeComponent?this._operationHandle.activeComponent.mode:null}get activeTooltip(){const{activeComponent:e,destroyed:t}=this,o=!t&&e&&"tooltip"in e?e.tooltip:null;return o?.visible?o:null}get activeComponent(){return this._operationHandle?.activeComponent??null}get createGraphic(){return null==this.activeComponent||"draw-3d"!==this.activeComponent.type&&"draw-2d"!==this.activeComponent.type?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...te,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...oe,...e,reshapeOptions:{...oe.reshapeOptions,...e?.reshapeOptions},highlightOptions:{...oe.highlightOptions,...e?.highlightOptions}})}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get snappingOptions(){return this.snappingManager?.options??this._get("snappingOptions")}set snappingOptions(e){null!=this._defaultSnappingManager&&(this._defaultSnappingManager.options=e),this._set("snappingOptions",e)}get snappingManager(){return this._isOverridden("snappingManager")&&this._get("snappingManager"),this._defaultSnappingManager}set snappingManager(e){if(e)this._isOverridden("snappingManager")||(this._defaultSnappingManager=r(this._defaultSnappingManager)),this._override("snappingManager",e);else{const{view:e}=this;!this._defaultSnappingManager&&e&&(this._defaultSnappingManager=new z({options:this.snappingOptions,view:e})),this._clearOverride("snappingManager")}}get state(){const e=!(!this.view?.ready||!this.layer),t=this._operationHandle;return e&&t?"active":e?"ready":"disabled"}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}get view(){return this._get("view")}set view(e){const t=this._get("view");if(t){const{container:e,map:o}=t;e&&(t.cursor=null),o?.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const o="view-ready";this.removeHandles(o),e&&this.addHandles(u((()=>e.ready),(t=>{this.removeHandles(this._viewHandlesKey),t&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)}),m),o),this._set("view",e)}cancel(){this._moduleLoaderAbortController=n(this._moduleLoaderAbortController),this._viewReadyAbortController=n(this._viewReadyAbortController),this._sketchContinuationFlag=!0,this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const{state:e,updateGraphics:t}=this;if("active"===e&&t.length){const{activeTool:e,layer:o}=this,i=t.toArray();o.removeMany(i),this.cancel(),this._emitDeleteEvent({graphics:i,tool:e})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const e=this.updateGraphics.map((e=>e.clone())).toArray();return this.layer.addMany(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,t){this.cancel(),await this._waitViewReady();const{view:o,layer:i}=this;if(!o||"disabled"===this.state)throw i||this._logMissingLayer(),p();if(null!=o.activeTool&&(o.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");L(o,this._internalGraphicsLayer);const a=await this._updatingHandles.addPromise(this._setupCreateOperation(e,t));if(null==a||this.destroyed)return void o.map.remove(this._internalGraphicsLayer);const s=()=>{if(a===this._operationHandle){const o=this.createGraphic,s=this._operationHandle.cancelled;if(this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),this.view?.map&&this.view.map.remove(this._internalGraphicsLayer),a.cancelled||null==o||i.add(o),this._sketchContinuationFlag=!1,this.emit("create",{graphic:o,state:s?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"}),s||this._sketchContinuationFlag)return;const{creationMode:r}=this;if("continuous"===r){if(t?.geometryToPlace)return;this._updatingHandles.addPromise(h(this.create(e,t)))}else"update"===r&&o&&this._updatingHandles.addPromise(h(this.update([o])))}};a.on("complete",s),this._operationHandle=a,o.ready&&o.focus()}async place(e,t){return this.create("mesh",{mode:"click",hasZ:e.hasZ,geometryToPlace:e,...t})}async update(e,t){this.cancel(),await this._waitViewReady();const{layer:o,view:i,state:a}=this;if(!i||"disabled"===a)throw o||this._logMissingLayer(),p();null!=i.activeTool&&(i.activeTool=null);const s=Array.isArray(e)?e:[e];if(null==e||!s?.length)return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(s.some((e=>e.layer!==o?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):null==e.geometry&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0))))return;const r=await this._updatingHandles.addPromise(this._setupUpdateOperation(s,t));this.destroyed||null==r||ue(r)||(L(i,this._internalGraphicsLayer),this._setUpdateOperationHandle(r,t),this.emit("update",{graphics:s,state:"start",aborted:!1,tool:r.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const t=this.view;if(t){e=Array.isArray(e)?e:[e];for(const o of e)null==o.geometry||"mesh"===o.geometry.type||E(o.geometry.spatialReference,t.spatialReference)||(b(o.geometry.spatialReference,t.spatialReference)||O()||await w(),o.geometry=G(o.geometry,t.spatialReference))}else this._logMissingView()}undo(){this.canUndo()&&this._operationHandle?.undo()}redo(){this.canRedo()&&this._operationHandle?.redo()}canUndo(){return!!this._operationHandle?.canUndo()}canRedo(){return!!this._operationHandle?.canRedo()}toggleUpdateTool(){this._operationHandle?.toggleTool()}async _getFirstHit(e){const t=this.view;if(!t)return this._logMissingView(),null;if("2d"===t.type){const o=[];t.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||o.push(e)}));const i=await t.hitTest(e,{exclude:o});return $(i.results)}const o=[t.map.ground];t.map.allLayers.forEach((e=>{k(e.type)&&o.push(e)}));const i=await t.hitTest(e,{exclude:o});if(i.results.length>0){const e=i.results[0];if(null!=e&&"graphic"===e.type&&e.graphic&&(!i.ground.mapPoint||t.map.ground.opacity<1||i.ground.distance-(e.distance??0)>-Math.min(3*i.ground.distance,"global"===t.viewingMode?_(t.renderCoordsHelper.spatialReference).radius/t.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return e}return null}_generateViewHandles(e){return[e.on("immediate-click",(async e=>{const t="active"===this.state&&"create"===this._operationHandle?.type;"disabled"!==this.state&&!t&&this.updateOnGraphicClick&&await this._updatingHandles.addPromise(this._handleImmediateClick(e))}),F.WIDGET)]}async _handleImmediateClick(e){const t=await e.async((()=>this._getFirstHit(Y(e))));let o=null;if(null!=t){const i=t.graphic;this.updateGraphics.includes(i)||i.layer===this.layer?(e.stopPropagation(),o=i):"2d"!==this.view?.type||this._isComponentGraphic(i)||"active"!==this.state||this.cancel()}else"active"===this.state&&this.cancel();null==o||this.updateGraphics.includes(o)||await this.update([o],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}})}async _setupCreateOperation(e,t){const o=this.view;if(!o)return this._logMissingView(),null;const i={hasZ:"3d"===o.type,...this.defaultCreateOptions,...t},a=await this._setupDrawGraphicTool(e,o,i);return null==a?null:(o.tools.add(a),o.activeTool=a,this._setupCreateOperationHandle(a))}async _setupDrawGraphicTool(e,t,o){if("multipoint"===e&&"3d"===t.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!t)return this._logMissingView(),null;const{cursor:i,defaultZ:a,hasZ:s,geometryToPlace:r,graphicProperties:n,mode:p,preserveAspectRatio:l}=o,h=X(p,e),c=ee(e),d=o?.optionsPerTool?.has(e)?o.optionsPerTool.get(e):{},u=d?.preserveAspectRatio??l??"rectangle"!==e,y={centered:"rectangle"!==e&&!("circle"===e&&!u),cursor:i,defaultZ:a,forceUniformSize:u,graphicProperties:n,geometryToPlace:r,geometryType:c,mode:h,graphicSymbol:this._getGraphicSymbolFromTool(e),hasZ:s,snappingManager:this.snappingManager,snapToScene:!1,view:t,...d};return"2d"===t.type?this._makeDrawGraphicTool2D(y):this._makeDrawGraphicTool3D(y)}async _makeDrawGraphicTool2D(e){const t=await this._requireModule(import("../../views/2d/interactive/editingTools.js"));return ue(t)||this.destroyed?null:new t.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:re(e.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(e){const t=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(t)||this.destroyed)return null;const{elevationInfo:o}=this.layer;return new t.module.DrawGraphicTool3D({...e,elevationInfo:o,snapToScene:!0,sketchOptions:this.sketchOptions})}_setupCreateOperationHandle(e){const t=this.view;if(!t)return this._logMissingView(),null;let o=null;const i=e.forceUniformSize,s=e.centered,r=[t.on("key-down",(t=>{if(t.key===V.pan)t.stopPropagation(),t.repeat||(e.enabled=!1);else if(t.key===V.complete)t.stopPropagation(),e.completeCreateOperation();else if(t.key!==V.vertexAdd||t.repeat)t.key===V.undo?(t.stopPropagation(),n.undo()):t.key===V.redo?(t.stopPropagation(),n.redo()):t.key!==V.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType||t.repeat?t.key===V.center&&(t.repeat||(e.centered=!s,t.stopPropagation())):(e.forceUniformSize=!i,t.stopPropagation());else{const o=e.drawOperation.geometryType;"polyline"!==o&&"polygon"!==o&&"multipoint"!==o||(t.stopPropagation(),e.drawOperation.commitStagedVertex())}}),F.WIDGET),t.on("key-up",(t=>{t.key===V.pan?e.enabled=!0:t.key!==V.constraint||"rectangle"!==e.geometryType&&"circle"!==e.geometryType?t.key===V.center&&(e.centered=s,t.stopPropagation()):(e.forceUniformSize=i,t.stopPropagation())}),F.WIDGET),e.on("vertex-add",(t=>{switch(o=null==o?"start":"active",t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:o,tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("cursor-update",(t=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:t.vertices[0].coordinates,type:"cursor-update"},type:"create"})})),e.on("vertex-remove",(t=>{switch(t.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:t,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}})),e.on("complete",(e=>{this._set("createGraphic",e.graphic),o="complete",e.aborted?n&&n.cancel():n&&n.complete()})),d((()=>this._getGraphicSymbolFromTool(e.geometryType)),(t=>{e.graphicSymbol=t}))],n=new J({activeComponent:e,tool:e.geometryType,type:"create",onEnd:()=>{a(r),t.tools?.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return n}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":case"freehandPolyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":case"freehandPolygon":return this.polygonSymbol;case"mesh":return this.meshSymbol}}async _setupUpdateOperation(e,t){const{layer:o,view:i}=this;if(!i)return this._logMissingView(),null;const a={...this.defaultUpdateOptions,...t,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...t?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...t?.highlightOptions}};let s=a.tool??oe.tool;for(const r of e)o.remove(r),o.add(r);if("3d"===i.type){if(0===e.length)return null;switch(s){case"move":return this._setupMove3DOperation(e,a,i,s);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupReshape3DOperation(e[0],a,i);case"transform":return this._setupGraphicTransform3DOperation(e,a,i)}}switch(s){case"move":return this._setupMove2DOperation(e,a,i);case"reshape":return e.length>1?(this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null):this._setupTransformOrReshape2DOperation(e,s,a,i);case"transform":if(1===e.length){const t=e[0].geometry?.type;"point"!==t&&"multipoint"!==t||(s="reshape")}return this._setupTransformOrReshape2DOperation(e,s,a,i)}}async _setupMove3DOperation(e,t,o,i,s=!1){const r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(r))return r;const{ManipulatedObject3DGraphic:n,MoveTool3D:p}=r.module,l=new Map,h=()=>{l.forEach((e=>e.destroy())),l.clear()};for(const a of e){const e=new n({view:o,graphic:a}),t=U(e);if(t!==j.SUPPORTED)return h(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${I(t)}).`),null;l.set(a,e)}const c=new p({view:o,enableZ:t.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(c),c.objects.addMany(Array.from(l.values())),s||this.updateGraphics.addMany(e);const d=[],u=new Q({activeComponent:c,tool:i,type:"update",onEnd:()=>{a(d),de(o,c),h()},undo:()=>{he(this.view,c),ne(u,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{pe(u,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:e=>{this.updateGraphics.push(e);const t=new n({view:o,graphic:e});l.set(e,t),c.objects.push(t),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);if(u.history.undo.forEach((e=>e.updates.splice(t,1))),u.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0===this.updateGraphics.length)return void u.complete();const o=l.get(e);o&&(c.objects.remove(o),o.destroy(),l.delete(e))},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;if("transform"!==i)return;const e=this.updateGraphics.at(0),a=await this._setupReshape3DOperation(e,t,o,!0);a&&!ue(a)&&(u.onEnd(),u.destroy(),this._setUpdateOperationHandle(a,t))}});return d.push(...this._getHandlesForComponent(u,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(u,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(u,e)}),F.WIDGET)),u}_setupGraphicTransform3DOperation(e,t,o,i=!1){if(1===e.length&&x(e[0])===j.SUPPORTED){const a=e[0],s=a.geometry;if(null!=s&&("point"===s.type||"mesh"===s.type))return this._setupPointTransform3DOperation(a,t,o);if(null!=s&&("polygon"===s.type||"polyline"===s.type))return this._setupPolyTransform3DOperation(a,t,o,i)}return this._setupMove3DOperation(e,t,o,"transform",i)}async _setupPointTransform3DOperation(e,t,o){const i="transform",{enableRotation:s,enableScaling:r,enableZ:n}=t,p=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(p))return p;const{TransformTool3D:l,ManipulatedObject3DGraphic:h}=p.module,c=new h({graphic:e,view:o}),d=new l({object:c,view:o,enableRotation:s,enableScaling:r,enableZ:n,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),this.updateGraphics.add(e);const u=[],y=new Q({activeComponent:d,tool:i,type:"update",onEnd:()=>{a(u),de(o,d),c.destroy()},undo:()=>{he(this.view,d),ne(y,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:i})},redo:()=>{pe(y,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:i})},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),y.onEnd(),y.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),y.complete()},toggleTool:()=>{}});return u.push(...this._getHandlesForComponent(y,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(y,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(y,e)}),F.WIDGET)),y}async _setupPolyTransform3DOperation(e,t,o,i=!1){const s="transform",{enableRotation:r,enableScaling:n,enableZ:p,preserveAspectRatio:l}=t,h=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(h))return h;const{ManipulatedObject3DGraphic:c,ExtentTransformTool:d}=h.module,u=this.view?.inputManager?.isModifierKeyDown(V.constraint),y=new c({view:o,graphic:e}),m=new d({object:y,view:o,enableRotation:r,enableScaling:n,enableZ:p,preserveAspectRatio:!!l!=!!u,sketchOptions:this.sketchOptions});o.tools.add(m),i||this.updateGraphics.add(e);const g=[],v=new Q({activeComponent:m,tool:s,type:"update",onEnd:()=>{a(g),de(o,m),y.destroy()},canUndo:()=>!m.destroyed&&m.canUndo,undo:()=>{m.destroyed||(m.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s}))},canRedo:()=>!m.destroyed&&m.canRedo,redo:()=>{m.destroyed||(m.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),v.onEnd(),v.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),v.complete()},toggleTool:async()=>{if(1!==this.updateGraphics.length||!1===t.toggleToolOnClick)return;const i=await this._setupReshape3DOperation(e,t,o,!0);i&&!ue(i)&&(v.onEnd(),v.destroy(),this._setUpdateOperationHandle(i,t))}});return g.push(...this._getHandlesForComponent(v,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(v,e,t)),F.WIDGET),o.on("key-down",(e=>this._getCommonUpdateOperationKeyDownHandlers(v,e)),F.WIDGET),o.on("key-down",(e=>{e.key!==V.constraint||e.repeat||(m.preserveAspectRatio=!m.preserveAspectRatio,e.stopPropagation())}),F.WIDGET),o.on("key-up",(e=>{e.key===V.constraint&&(m.preserveAspectRatio=!m.preserveAspectRatio,e.stopPropagation())}),F.WIDGET)),v}async _setupMove2DOperation(e,t,o){const i="move";this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const s=await this._getGraphicMover(e,t,o);if(ue(s))return s;const r=new Q({activeComponent:s,tool:i,type:"update",onEnd:()=>{this._displayDefaultCursor(),a(l),a(p),s.destroy(),this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const e=this.updateGraphics.toArray();ne(r,e),r.refreshComponent(),this._emitUndoEvent({graphics:e,tool:i})},redo:()=>{const e=this.updateGraphics.toArray();pe(r,e),r.refreshComponent(),this._emitRedoEvent({graphics:e,tool:i})},addToSelection:async e=>{await this._updatingHandles.addPromise(this._updateSpatialReference(e)),this.updateGraphics.push(e),s.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),0!==this.updateGraphics.length?s.graphics=o:r.complete()}});let n=!1;const p=[o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key!==V.constraint||e.repeat||(n=!0,s.enableMoveAllGraphics=!s.enableMoveAllGraphics)}),F.WIDGET),o.on("key-up",(e=>{e.key===V.constraint&&n&&(n=!1,s.enableMoveAllGraphics=!s.enableMoveAllGraphics)}),F.WIDGET)],l=this._getHandlesForComponent(r,t);return r}async _setupReshape3DOperation(e,t,o,i=!1){const s="reshape",r=await this._requireModule(import("../../views/3d/interactive/editingTools.js"));if(ue(r))return r;const{ManipulatedObject3DGraphic:n,ReshapeTool3D:p}=r.module,l=new n({view:o,graphic:e}),h=P(l);if(h!==j.SUPPORTED)return l.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${I(h)}).`),null;const c=t.reshapeOptions,d=new p({view:o,object:l,enableZVertex:t.enableZ&&"move"===c?.vertexOperation,enableZShape:t.enableZ&&"move"===c?.shapeOperation,enableMoveObject:"move"===c?.shapeOperation||"move-xy"===c?.shapeOperation,enableMidpoints:"split"===c?.edgeOperation,enableEdgeOffset:"offset"===c?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});o.tools.add(d),i||this.updateGraphics.add(l.graphic);const u=[],y=new Q({activeComponent:d,tool:s,type:"update",onEnd:()=>{a(u),de(o,d),l.destroy()},canUndo:()=>!d.destroyed&&d.canUndo,undo:()=>{d.destroyed||(d.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s}))},canRedo:()=>!d.destroyed&&d.canRedo,redo:()=>{d.destroyed||(d.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s}))},addToSelection:async e=>{this.updateGraphics.add(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"}),y.onEnd(),y.destroy();const i=await this._setupMove3DOperation(this.updateGraphics.toArray(),t,o,"transform",!0);ue(i)||this._setUpdateOperationHandle(i,t)},removeFromSelection:e=>{this.updateGraphics.remove(e),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"}),y.complete()},toggleTool:async()=>{if(!1===t.toggleToolOnClick)return;y.onEnd(),y.destroy();const e=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),t,o,!0);ue(e)||this._setUpdateOperationHandle(e,t)}});return u.push(...this._getHandlesForComponent(y,t),o.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(y,e,t)),F.WIDGET),o.on("key-down",(e=>{this._getCommonUpdateOperationKeyDownHandlers(y,e)}),F.WIDGET)),y}async _setupTransformOrReshape2DOperation(e,t,o,i){this.updateGraphics.addMany(e),await this._updatingHandles.addPromise(this._updateSpatialReference(e));const s="transform"===t?await this._getBox(e,o,i):await this._getReshape(e,o,i);if(ue(s))return s;const r=new Q({activeComponent:s,type:"update",onEnd:()=>{a(p),a(n),r.activeComponent&&!r.activeComponent.destroyed&&r.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{ne(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},redo:()=>{pe(r,this.updateGraphics.toArray()),r.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:r.tool})},addToSelection:async e=>{let t=r.activeComponent;if("reshape"===t?.type){const t=[...this.updateGraphics,e];this.updateGraphics.removeAll(),r.onEnd(),r.destroy();const a=await this._setupTransformOrReshape2DOperation(t,"transform",o,i);if(ue(a))return;this._setUpdateOperationHandle(a,o)}else this.updateGraphics.add(e),t.graphics=this.updateGraphics.toArray(),t.refresh(),r.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[e],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async e=>{const t=this.updateGraphics.indexOf(e);r.history.undo.forEach((e=>e.updates.splice(t,1))),r.history.redo.forEach((e=>e.updates.splice(t,1))),this.updateGraphics.remove(e);const o=this.updateGraphics.toArray();if(0===o.length)r.complete();else{const e=o[0].geometry;1!==o.length||null==e||"point"!==e.type&&"multipoint"!==e.type?r.activeComponent.graphics=o:r.toggleTool()}this.emit("update",{graphics:o,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[e],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(this.updateGraphics.length>1)return;const e=this.updateGraphics.at(0),t=e.geometry;if(null!=t&&("reshape"===r.tool&&("point"===t.type||"multipoint"===t.type)||"transform"===r.tool&&"extent"===t.type))return;let s=null;"transform"===r.tool?s=await this._getReshape([e],o,i):"reshape"===r.tool&&(s=await this._getBox([e],o,i)),ue(s)||(r.activeComponent?.destroy(),r.activeComponent=s,r.activeComponent&&(a(p),p=this._getHandlesForComponent(r,o)))}}),n=[i.on("immediate-click",(e=>this._getCommonUpdateOperationClickHandlers(r,e,o)),F.WIDGET),i.on("key-down",(e=>{if(this._getCommonUpdateOperationKeyDownHandlers(r,e),e.key===V.constraint&&!e.repeat&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),F.WIDGET),i.on("key-up",(e=>{if(e.key===V.constraint&&r){const e=r.activeComponent;e&&"box"===e.type&&(e.preserveAspectRatio=!e.preserveAspectRatio)}}),F.WIDGET)];let p=this._getHandlesForComponent(r,o);return r}async _getGraphicMover(e,t,o){const{enableMoveAllGraphics:i,highlightOptions:a}=t,s=await this._requireModule(import("../../views/draw/support/GraphicMover.js"));return ue(s)?s:new s.module.default({enableMoveAllGraphics:i,highlightsEnabled:!!a?.enabled,indicatorsEnabled:!1,graphics:e,view:o,callbacks:{onGraphicMoveStart:({dx:e,dy:t,graphic:o})=>{this._displayGrabbingCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-start"},type:"update"})},onGraphicMove:({dx:e,dy:t,graphic:o})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move"},type:"update"}),onGraphicMoveStop:({dx:e,dy:t,graphic:o})=>{this._displayPointerCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(e,t,o){const{enableRotation:i,enableScaling:a,highlightOptions:s,preserveAspectRatio:r}=t,n=await this._requireModule(import("../../views/draw/support/Box.js"));if(ue(n))return n;const p=this.view?.inputManager?.isModifierKeyDown(V.constraint);return new n.module.default({graphics:e,enableRotation:i,enableScaling:a,highlightsEnabled:!!s?.enabled,preserveAspectRatio:!!r!=!!p,layer:this._internalGraphicsLayer,view:o,sketchOptions:this.sketchOptions,callbacks:{onMoveStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMove:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onMoveStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScale:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onScaleStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotate:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onRotateStop:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"})}})}async _getReshape(e,t,o){const i="split"===t.reshapeOptions?.edgeOperation,a="move"===t.reshapeOptions?.shapeOperation,s=!!t.highlightOptions?.enabled,r=await this._requireModule(import("../../views/draw/support/Reshape.js"));return ue(r)?r:new r.module.default({enableMidpoints:i,enableMovement:a,graphic:e[0],highlightsEnabled:s,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,view:o,callbacks:{onReshapeStart:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshape:e=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e},type:"update"}),onReshapeStop:({mover:e,type:t})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e,type:t},type:"update"}),onMoveStart:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMove:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onMoveStop:({dx:e,dy:t,mover:o,type:i})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e,dy:t,mover:o,type:i},type:"update"}),onVertexAdd:({added:e,type:t,vertices:o})=>{const i=e.map((e=>T(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:i,vertices:o,type:t},type:"update"})},onVertexRemove:({removed:e,type:t,vertices:o})=>{const i=e.map((e=>T(e.geometry)));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:i,vertices:o,type:t},type:"update"})}}})}_getHandlesForComponent(e,t){const o=e.activeComponent;if(!o)return[];switch(o.type){case"graphic-mover":return[o.on("graphic-click",(({graphic:t,viewEvent:o})=>{o.native?.shiftKey&&(o.stopPropagation(),e.removeFromSelection(t))})),o.on("graphic-move-start",(t=>e.addToHistory(ce(t.allGraphics))))];case"box":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(ce(t.graphics)))),o.on("rotate-start",(t=>e.addToHistory(ce(t.graphics)))),o.on("scale-start",(t=>e.addToHistory(ce(t.graphics))))];case"reshape":return[o.on("graphic-click",(o=>this._onTransformOrReshape2DGraphicClick(e,t,o))),o.on("move-start",(t=>e.addToHistory(ce([t.mover])))),o.on("reshape-start",(t=>e.addToHistory(ce([t.graphic])))),o.on("vertex-add",(t=>e.addToHistory(ce([t.oldGraphic])))),o.on("vertex-remove",(t=>e.addToHistory(ce([t.oldGraphic]))))];case"move-3d":return[o.events.on("record-undo",(({updates:t})=>{e.addToHistory({updates:t})})),o.events.on("move-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-start"},type:"update"})})),o.events.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:e.dx,dy:e.dy,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move"},type:"update"})})),o.events.on("move-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:e.objects.length>0?e.objects[0].graphic:null,type:"move-stop"},type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))];case"transform-3d":return[o.events.on("record-undo",(({updates:t})=>{e.addToHistory({updates:t})})),o.events.on("translate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-start"},type:"update"})})),o.events.on("translate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move-stop"},type:"update"})})),o.events.on("rotate-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-start"},type:"update"})})),o.events.on("rotate-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate-stop"},type:"update"})})),o.events.on("scale-start",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-start"},type:"update"})})),o.events.on("scale-stop",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale-stop"},type:"update"})})),o.events.on("translate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,dx:e.dxScreen,dy:e.dyScreen,type:"move"},type:"update"})})),o.events.on("rotate",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,angle:e.angle,type:"rotate"},type:"update"})})),o.events.on("scale",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:e.object.graphic,xScale:e.xScale,yScale:e.yScale,type:"scale"},type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))];case"reshape-3d":return[o.events.on("reshape",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})})),o.events.on("move",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...e,mover:e.object.graphic},type:"update"})})),o.events.on("vertex-add",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.events.on("vertex-remove",(e=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:e,type:"update"})})),o.events.on("immediate-click",(o=>{o.shiftKey?this._toggleSelection([o.object.graphic],e,t):e.toggleTool()}))]}}_onTransformOrReshape2DGraphicClick(e,t,o){const{graphic:i,viewEvent:a}=o;return a.native?.shiftKey&&i.layer===this.layer?(a.stopPropagation(),e.removeFromSelection(i)):t.toggleToolOnClick?(a.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,t){this._operationHandle=e;const o=this.view?.map;this._disablePopup(t);const i=()=>{if(e===this._operationHandle){const i=this.updateGraphics.toArray(),a=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),o&&o.remove(this._internalGraphicsLayer),this._restorePopup(t),this.emit("update",{graphics:i,state:"complete",aborted:e.cancelled,tool:a,toolEventInfo:null,type:"update"})}};e.on("complete",i)}async _getCommonUpdateOperationClickHandlers(e,t,o){const i=Y(t),a=await t.async((()=>this._getFirstHit(i)));if(null==a)return void e.complete();if(t.native.shiftKey&&this._toggleSelection([a.graphic],e,o))return void t.stopPropagation();this.updateGraphics.includes(a.graphic)?t.stopPropagation():e.complete()}_toggleSelection(e,t,o){const i=!!o.multipleSelectionEnabled;return e.some((e=>null!=e&&(!(!i||e.layer!==this.layer)&&(this.updateGraphics.includes(e)?t.removeFromSelection(e):t.addToSelection(e),!0))))}_getCommonUpdateOperationKeyDownHandlers(e,t){if(!e)return;const o=t.key;o===V.undo&&e.canUndo()?(t.stopPropagation(),e.undo()):o===V.redo&&e.canRedo()?(t.stopPropagation(),e.redo()):o===V.cancel?(t.stopPropagation(),e.cancel()):this.allowDeleteKey&&V.delete.includes(o)&&this._onDeleteKey(t)}_onDeleteKey(e){if(!this._operationHandle||"update"!==this._operationHandle.type)return;const t=this.activeComponent,o=this.updateGraphics.toArray();null!=t&&("reshape"!==t.type||1===o.length&&"point"===o[0].geometry?.type)&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=r(this._internalGraphicsLayer))}_isComponentGraphic(e){const{activeComponent:t}=this;return!(!e||null==t)&&(e.attributes?.esriSketchTool||"draw-2d"===t.type&&t.graphic===e||("box"===t.type||"reshape"===t.type)&&t.isUIGraphic(e))}_displayPointerCursor(){this.view?.container&&"pointer"!==this.view.cursor&&(this.view.cursor="pointer")}_displayGrabbingCursor(){this.view?.container&&"grabbing"!==this.view.cursor&&(this.view.cursor="grabbing")}_displayDefaultCursor(){this.view?.container&&null!==this.view.cursor&&(this.view.cursor=null)}_logError(e,t,i){s.getLogger(this).error(new o(e,t,i))}async _requireModule(e){const t=new AbortController;this._moduleLoaderAbortController=t;const o=await e;return this._moduleLoaderAbortController!==t||t.signal.aborted?{requireError:"aborted"}:{module:o}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}get test(){}wait(){return y((()=>!this.updating))}_disablePopupEnabled(e){return"3d"!==this.view?.type||this.updateOnGraphicClick||(e?.toggleToolOnClick??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(n(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await l(y((()=>e?.ready)),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",se("view"))}_logMissingLayer(){this._logError(ae,se("layer"))}};e([g()],ie.prototype,"_defaultSnappingManager",void 0),e([g()],ie.prototype,"updating",null),e([g({readOnly:!0})],ie.prototype,"_updatingHandles",void 0),e([g()],ie.prototype,"_operationHandle",void 0),e([g({readOnly:!0})],ie.prototype,"activeTool",null),e([g({readOnly:!0})],ie.prototype,"activeCreateToolDrawMode",null),e([g()],ie.prototype,"activeTooltip",null),e([g({types:R})],ie.prototype,"activeFillSymbol",void 0),e([g()],ie.prototype,"activeLineSymbol",void 0),e([g()],ie.prototype,"activeVertexSymbol",void 0),e([g()],ie.prototype,"allowDeleteKey",void 0),e([g({readOnly:!0})],ie.prototype,"createGraphic",null),e([g()],ie.prototype,"defaultCreateOptions",null),e([g()],ie.prototype,"defaultUpdateOptions",null),e([g({type:K,nonNullable:!0})],ie.prototype,"labelOptions",null),e([g()],ie.prototype,"layer",void 0),e([g({types:R})],ie.prototype,"pointSymbol",void 0),e([g({types:R})],ie.prototype,"polygonSymbol",void 0),e([g({types:R})],ie.prototype,"polylineSymbol",void 0),e([g()],ie.prototype,"meshSymbol",void 0),e([g({type:N,nonNullable:!0})],ie.prototype,"snappingOptions",null),e([g()],ie.prototype,"snappingManager",null),e([g({readOnly:!0})],ie.prototype,"state",null),e([g({type:Z,nonNullable:!0})],ie.prototype,"tooltipOptions",null),e([g({readOnly:!0})],ie.prototype,"updateGraphics",void 0),e([g()],ie.prototype,"updateOnGraphicClick",void 0),e([g()],ie.prototype,"creationMode",void 0),e([g({type:q,nonNullable:!0})],ie.prototype,"valueOptions",null),e([g({types:R})],ie.prototype,"vertexSymbol",void 0),e([g({value:null})],ie.prototype,"view",null),e([g({constructOnly:!0,type:W})],ie.prototype,"sketchOptions",void 0),ie=e([v("esri.widgets.Sketch.SketchViewModel")],ie);const ae="sketch:missing-property",se=e=>`Property '${e}' is missing on SketchViewModel.`;function re(e){return"polygon"===e||"rectangle"===e||"circle"===e}function ne(e,t){le("undo",e.history.undo,e.history.redo,t)}function pe(e,t){le("redo",e.history.redo,e.history.undo,t)}function le(e,t,o,i){const a=t.pop();if(!a)return;const s=a.updates,r=[];i.forEach(((t,o)=>{const i=s[o];null!=i&&("geometry"in i&&null!=i.geometry&&(r.push({geometry:t.geometry}),t.geometry=i.geometry),"symbol"in i&&null!=i.symbol&&(r.push({symbol:t.symbol}),t.symbol=i.symbol),"undo"in i&&(r.push(i),i[e](t)))})),o.push({updates:r})}function he(e,t){null!=e&&t.hasGrabbedManipulators&&(e.activeTool=null)}function ce(e){return{updates:e.map((({geometry:e})=>"mesh"===e?.type?{geometry:e.cloneShallow()}:{geometry:e}))}}function de(e,t){e.tools?.remove(t),t.destroyed||t.destroy()}function ue(e){return"requireError"in e&&"aborted"===e.requireError}const ye=ie;export{ye 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{clone as i}from"../core/lang.js";import{watch as t,initial as s}from"../core/reactiveUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as n}from"../intl/date.js";import a from"../views/VideoView.js";import d from"./Slider.js";import l from"./Widget.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import{css as h}from"./VideoPlayer/css.js";import v from"./VideoPlayer/VideoPlayerViewModel.js";import{loadMetadataSectionComponents as g,MetadataSection as w}from"./VideoPlayer/components/MetadataSection.js";import{loadPlayerActionsGroupComponents as y,PlayerActionsGroup as f}from"./VideoPlayer/components/PlayerActionsGroup.js";import{loadPlayerControlsGroupComponents as M,PlayerControlsGroup as V}from"./VideoPlayer/components/PlayerControlsGroup.js";import{defaultSettings as j}from"./VideoPlayer/components/SettingsButton.js";let _=class extends l{constructor(e,t){super(e,t),this._settings=i(j),this._metadataVisible=!1,this._slider=new d({visibleElements:{labels:!1,rangeLabels:!1},min:0,max:100,values:[0],thumbsConstrained:!1}),this.videoView=new a({container:document.createElement("div")}),this.viewModel=new v}initialize(){this.addHandles([t((()=>this.viewModel.layer),(()=>{this.videoView.layer=this.viewModel.layer}),s),this._slider.on(["thumb-change","thumb-drag"],(({value:e})=>{const i=e*this.viewModel.duration/100;this.viewModel.seekTo(i)}))])}loadDependencies(){return Promise.all([y(),M(),g(),c({progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")})])}get icon(){return"video-web"}set icon(e){this._overrideIfSome("icon",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){return u("div",{class:this.classes(h.base,m.widget)},u("calcite-panel",{heading:this.layer?.title||"Video Player"},this._renderLoadingScrim(),this._renderBuffering(),this._renderVideoSection(),this._renderActionBar(),this._renderMetadataSection()))}_renderLoadingScrim(){const{state:e}=this.viewModel;return this.videoView.ready?null:u("calcite-scrim",{loading:"error"!==e},"error"===e?this.messages.errorLoadingLayer:null)}_renderBuffering(){const{currentTime:e,buffered:i,duration:t}=this.viewModel,s=i/(t||1),r=e/(t||1);return this.viewModel.ended||s>r?null:u("calcite-progress",{type:"indeterminate"})}_renderVideoSection(){const{buffered:e,currentTime:i,duration:t}=this.viewModel,s=this.videoView.container;if(!s)return null;s.className=h.videoView;const r=e/(t||1),o=i/(t||1);return this._slider.values=[100*o],u("section",{afterCreate:P,bind:s},u("div",{class:h.sliderProgressContainer},u("progress",{class:h.progress,max:"1",value:`${r}`}),u("div",{class:h.slider},this._slider.render())))}_renderActionBar(){return u("div",{class:h.playerToolbar},u(f,{messages:this.messages,viewModel:this.viewModel}),u("div",{class:h.playerTimecode},b(this.viewModel.currentTime)," / ",b(this.viewModel.duration)),u(V,{messages:this.messages,settings:this._settings,toggleMetadata:()=>this._metadataVisible=!this._metadataVisible,viewModel:this.viewModel}))}_renderMetadataSection(){return this._metadataVisible?u(w,{messages:this.messages,viewModel:this.viewModel}):null}};function b(e){return n(1e3*Math.round(e),{minute:"2-digit",second:"2-digit"})}function P(e){const i=this;e.prepend(i)}e([r()],_.prototype,"_settings",void 0),e([r()],_.prototype,"icon",null),e([r()],_.prototype,"layer",null),e([r(),p("esri/widgets/VideoPlayer/t9n/VideoPlayer")],_.prototype,"messages",void 0),e([r()],_.prototype,"videoView",void 0),e([r({type:v})],_.prototype,"viewModel",void 0),e([r()],_.prototype,"view",null),_=e([o("esri.widgets.VideoPlayer")],_);const S=_;export{S as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{clone as i}from"../core/lang.js";import{watch as t,initial as o}from"../core/reactiveUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as n}from"../intl/date.js";import a from"../views/VideoView.js";import d from"./Slider.js";import l from"./Widget.js";import{loadCalciteComponents as c}from"./support/componentsUtils.js";import{globalCss as m}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import{css as h}from"./VideoPlayer/css.js";import v from"./VideoPlayer/VideoPlayerViewModel.js";import{loadMetadataSectionComponents as w,MetadataSection as g}from"./VideoPlayer/components/MetadataSection.js";import{loadPlayerActionsGroupComponents as f,PlayerActionsGroup as y}from"./VideoPlayer/components/PlayerActionsGroup.js";import{loadPlayerControlsGroupComponents as V,PlayerControlsGroup as b}from"./VideoPlayer/components/PlayerControlsGroup.js";import{defaultSettings as M}from"./VideoPlayer/components/SettingsButton.js";let j=class extends l{constructor(e,t){super(e,t),this._settings=i(M),this._metadataVisible=!1,this._slider=new d({visibleElements:{labels:!1,rangeLabels:!1},min:0,max:100,values:[0],thumbsConstrained:!1}),this.videoView=new a({container:document.createElement("div"),constraints:{rotationEnabled:!1},ui:{components:["zoom"]}}),this.viewModel=new v}initialize(){this.addHandles([t((()=>this.viewModel.layer),(()=>{this.videoView.layer=this.viewModel.layer}),o),this._slider.on(["thumb-change","thumb-drag"],(({value:e})=>{const i=e*this.viewModel.duration/100;this.viewModel.seekTo(i)}))])}loadDependencies(){return Promise.all([f(),V(),w(),c({progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")})])}get effect(){return this.videoView.effect}set effect(e){this.videoView.effect=e}get icon(){return"video-web"}set icon(e){this._overrideIfSome("icon",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get rotationEnabled(){return this.videoView.constraints.rotationEnabled}set rotationEnabled(e){this.videoView.constraints.rotationEnabled=e,this.videoView.ui.components=e?[...this.videoView.ui.components,"compass"]:this.videoView.ui.components.filter((e=>"compass"!==e))}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get zoomEnabled(){return this.videoView.navigation.mouseWheelZoomEnabled}set zoomEnabled(e){this.videoView.navigation.mouseWheelZoomEnabled=e,this.videoView.ui.components=e?[...this.videoView.ui.components,"zoom"]:this.videoView.ui.components.filter((e=>"zoom"!==e))}render(){return u("div",{class:this.classes(h.base,m.widget)},u("calcite-panel",{heading:this.layer?.title||"Video Player"},this._renderLoadingScrim(),this._renderBuffering(),this._renderVideoSection(),this._renderActionBar(),this._renderMetadataSection()))}_renderLoadingScrim(){const{state:e}=this.viewModel;return this.videoView.ready?null:u("calcite-scrim",{loading:"error"!==e},"error"===e?this.messages.errorLoadingLayer:null)}_renderBuffering(){const{currentTime:e,buffered:i,duration:t}=this.viewModel,o=i/(t||1),s=e/(t||1);return this.viewModel.ended||o>s?null:u("calcite-progress",{type:"indeterminate"})}_renderVideoSection(){const{buffered:e,currentTime:i,duration:t}=this.viewModel,o=this.videoView.container;if(!o)return null;o.className=h.videoView;const s=e/(t||1),r=i/(t||1);return this._slider.values=[100*r],u("section",{afterCreate:P,bind:o},u("div",{class:h.sliderProgressContainer},u("progress",{class:h.progress,max:"1",value:`${s}`}),u("div",{class:h.slider},this._slider.render())))}_renderActionBar(){return u("div",{class:h.playerToolbar},u(y,{messages:this.messages,viewModel:this.viewModel}),u("div",{class:h.playerTimecode},_(this.viewModel.currentTime)," / ",_(this.viewModel.duration)),u(b,{messages:this.messages,settings:this._settings,toggleMetadata:()=>this._metadataVisible=!this._metadataVisible,viewModel:this.viewModel}))}_renderMetadataSection(){return this._metadataVisible?u(g,{messages:this.messages,viewModel:this.viewModel}):null}};function _(e){return n(1e3*Math.round(e),{minute:"2-digit",second:"2-digit"})}function P(e){const i=this;e.prepend(i)}e([s()],j.prototype,"_settings",void 0),e([s()],j.prototype,"effect",null),e([s()],j.prototype,"icon",null),e([s()],j.prototype,"layer",null),e([s(),p("esri/widgets/VideoPlayer/t9n/VideoPlayer")],j.prototype,"messages",void 0),e([s()],j.prototype,"rotationEnabled",null),e([s()],j.prototype,"videoView",void 0),e([s({type:v})],j.prototype,"viewModel",void 0),e([s()],j.prototype,"view",null),e([s()],j.prototype,"zoomEnabled",null),j=e([r("esri.widgets.VideoPlayer")],j);const E=j;export{E as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3600],{13600:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Pe});var r=i(90237),s=i(13874),o=i(78888),n=i(69540),a=i(5503),l=i(49186),u=i(4718),p=i(53966),d=i(97768),y=i(92071),c=i(93637),h=i(74887),f=i(39516),m=i(84952),b=i(10107),g=i(79901),w=i(36005),_=i(40608),v=i(43937),T=i(89317),F=i(38141),M=i(16930),S=i(4146),I=i(52106),E=i(44208),A=i(92474),Z=i(61893),D=i(29953),j=i(56507),O=(i(87811),i(7695)),C=i(5443),q=i(39829),x=i(50498),L=i(96520),P=i(58501),R=i(22671);let G=0,k=class extends(A.A.LoadableMixin(Z.A.EsriPromiseMixin(a.A))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then((()=>this._applyEdits(e)))}openPorts(){return this.load().then((()=>this._connection.openPorts()))}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);(0,P.q)(e,this.layer.spatialReference,i);const r=R.A.fromJSON(i);if(!this._requiresClientGraphicMapping())return r;const s=this.layer.objectIdField;for(const e of r.features){const t=e.attributes[s],i=this._idToClientGraphic.get(t);i&&(e.geometry=i.geometry)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new l.A("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return(0,P.q)(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)))}queryObjectIds(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)))}queryExtent(e,t={}){return this.load(t).then((()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t))).then((e=>({count:e.count,extent:C.A.fromJSON(e.extent)})))}querySnapping(e,t={}){return this.load(t).then((()=>this._connection.invoke("querySnapping",e,t)))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}async _applyEdits(e){if(!this._connection)throw new l.A("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=e=>"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const t of e.deleteFeatures){const e=o(t);null!=e&&r.push(e)}const n=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures)for(const t of e.updateFeatures)if(s.push(this._serializeFeature(t)),n){const e=o(t);null!=e&&n.set(e,t)}(0,L.u)(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:a,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=a,i&&i.finish(u.uidToObjectId),this._updateClientGraphicIds(n,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const i=[];for(const{geometry:r}of e)null==r||"mesh"!==r.type||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const t=e.get(i.objectId);null!=t&&this._addIdToClientGraphic(t)}for(const e of t.deleteResults)e.success&&this._idToClientGraphic.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);r||null==o.geometry||(r=o.geometry.type),i[s]=n,t.set(`${n.uid}`,o)}const s=this;return{features:i,inferredGeometryType:r,finish(e){const i=s.sourceJSON.objectIdField;for(const r in e){const o=e[r],n=t.get(r);n&&(n.attributes||(n.attributes={}),-1===o?delete n.attributes[i]:n.attributes[i]=o,s._addIdToClientGraphic(n))}}}}_addIdToClientGraphic(e){if(!this._idToClientGraphic)return;const t=this.sourceJSON.objectIdField,i=e.attributes?.[t];null!=i&&this._idToClientGraphic.set(i,e)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,i=this._geometryForSerialization(e),r=(G++).toString();return i?{uid:r,geometry:i.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?q.A.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await(0,D.ho)("MemorySourceWorker",{strategy:(0,E.A)("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:i,objectIdField:r,hasM:s,hasZ:o,timeInfo:n,dateFieldsTimeZone:a}=this.layer,l="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const u=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",(e=>{p.A.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()})));const d={features:u.features,fields:t?.map((e=>e.toJSON())),geometryType:x.Ye.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&s,hasZ:"mesh"===this._layerOrSourceGeometryType||o,objectIdField:r,spatialReference:l?null:i&&i.toJSON(),timeInfo:n?.toJSON()??null,dateFieldsTimeZone:a},y=await this._connection.invoke("load",d,{signal:e});for(const e of y.warnings)p.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});y.featureErrors.length&&p.A.getLogger(this.layer).warn("#load()",`Encountered ${y.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:y.featureErrors});const c=y.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(u.inferredGeometryType)&&(c.geometryType=x.Ye.toJSON(u.inferredGeometryType)),this.sourceJSON=c,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),u.finish(y.assignedObjectIds)}};(0,r._)([(0,O.u)({Type:I.A,ensureType:(0,j.dp)(I.A)})],k.prototype,"itemType",void 0),(0,r._)([(0,b.MZ)()],k.prototype,"type",void 0),(0,r._)([(0,b.MZ)({constructOnly:!0})],k.prototype,"layer",void 0),(0,r._)([(0,b.MZ)({readOnly:!0})],k.prototype,"_workerGeometryType",null),(0,r._)([(0,b.MZ)()],k.prototype,"sourceJSON",void 0),k=(0,r._)([(0,_.$)("esri.layers.graphics.sources.MemorySource")],k);var J=i(52136),N=i(18768),V=i(63074),$=i(69208),Q=i(6455),B=i(47685),z=i(87718),K=i(87796),W=i(76294),X=i(16131),H=i(32756),U=i(8303),Y=i(69622);let ee=class extends Y.A{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};(0,r._)([(0,b.MZ)()],ee.prototype,"updating",void 0),(0,r._)([(0,b.MZ)()],ee.prototype,"status",void 0),ee=(0,r._)([(0,_.$)("esri.layers.support.PublishingInfo")],ee);const te=ee,ie=Symbol(),re=e=>{var t;let i=class extends e{constructor(){super(...arguments),this[t]=!0}static{t=ie}get publishingInfo(){if(this.destroyed)return null;const e=this._get("publishingInfo");if(e)return e;const t=new te;return this._checkPublishingStatus(t),t}_checkPublishingStatus(e){let t=0;const i=async s=>{let o;e.updating=!0;try{o=await this.fetchPublishingStatus()}catch(e){o="unavailable"}"published"!==o&&"unavailable"!==o||("publishing"===e.status&&this.refresh(),r.remove()),e.status=o,e.updating=!1,r.removed||(t=setTimeout(i,s,s+125))},r={removed:!1,remove(){this.removed=!0,clearTimeout(t)}};this.when().catch((()=>r.remove())),i(250),this.addHandles(r)}};return(0,r._)([(0,b.MZ)({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=(0,r._)([(0,_.$)("esri.layers.mixins.PublishableLayer")],i),i};var se=i(54310),oe=i(25036),ne=i(82935),ae=i(68109),le=i(60694),ue=i(10873),pe=i(15426),de=i(29005),ye=i(33143),ce=i(17036),he=i(30524),fe=i(46499),me=i(39383),be=i(22453),ge=i(96184),we=i(17311),_e=i(91908),ve=i(27733),Te=i(65494),Fe=i(8947),Me=i(13112),Se=i(61956),Ie=i(54218),Ee=i(30291),Ae=i(33910),Ze=i(92935),De=i(78553);const je="FeatureLayer";function Oe(e,t){return new l.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Ce(e){return e&&e instanceof a.A}const qe=(0,ce.p)();function xe(e,t,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let Le=class extends((0,K.j)((0,W.J)((0,z.F)(re((0,B.w6)((0,Q.FJ)((0,V.dM)((0,H.fY)((0,ne.e)((0,ae.d)((0,oe.j)((0,se.J)((0,N.b)((0,X.q)((0,U.A)((0,y.P)((0,$.d)((0,J.p)(n.A.ClonableMixin(S.A)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=M.A.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=(0,h.sg)((async(e,t,r)=>{const{save:s,saveAs:o}=await i.e(3359).then(i.bind(i,33359));switch(e){case Ze.X.SAVE:return s(this,t);case Ze.X.SAVE_AS:return o(this,r,t)}}))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this.initLayerProperties(e)))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(h.QP).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new l.A("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,pe.VA)(this,"load",e)));return this.addResolvingPromise(i),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,d.pR)(e),new we.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,(0,be.S)(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return(0,pe.C$)(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,i,r){r?.writeLayerSchema&&(0,c.sM)(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return(0,pe.jD)(t.layerDefinition||t)}readObjectIdField(e,t){return(0,pe.Zm)(t.layerDefinition||t)}get parsedUrl(){const e=(0,m.An)(this.url);return null!=e&&(null!=this.dynamicDataSource?e.path=(0,m.fj)(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=(0,m.fj)(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,he.yp)(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const r=t.drawingInfo?.renderer;if(r){const e=(0,Te.L)(r,t,i)??void 0;return e||p.A.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return(0,pe.PD)(t,i)}set source(e){const t=this._get("source");t!==e&&(Ce(t)&&this._resetMemorySource(t),Ce(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof a.A?new k({layer:this,items:e}):e:null}readSource(e,t){const i=R.A.fromJSON(t.featureSet);return new k({layer:this,items:i?.features??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e=e?.map((e=>de.A.fromJSON(e))),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){const i=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(i){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,le.yG)(this.url,i):i;let t=i;if(!t&&this.url){const e=(0,le.qg)(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),(0,le.cr)(t)}if("item-title"===this.sublayerTitleMode&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===i));e&&(i=e.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e?.map((e=>(e=ye.A.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,s),e)))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const i=await(0,pe.Xl)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,i){const r=await(0,pe.bt)(this,e,t,i,je);return this.lastEditsEventDate=new Date,r}async applyEdits(e,t){return(0,pe.ct)(this,e,t)}async uploadAssets(e,t){return(0,pe.rn)(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return(0,Ee.tn)(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await(0,h.qr)(Promise.all([i.e(364),i.e(8628),i.e(2593)]).then(i.bind(i,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,pe.VZ)(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,i=(0,f.mA)(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){const i=await(0,pe.mm)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return(0,pe.WP)(this,e,je)}getFeatureTitle(e,t={timeZone:"system",fetchMissingFields:!1}){return this._titleCreator.getTitle(this,e,t)}getFeatureType(e){return(0,pe.xd)(this.types,this.typeIdField,e)}getFieldDomain(e,t){const i=t?.feature,r=!!this.subtypes?.length;if(r&&!t?.excludeImpliedDomains){const t=(0,pe.pc)(this,e);if(t)return t}const s=r&&(0,pe.Nv)(this,i);if(s){const t=s?.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}const o=this.getFeatureType(i),n=this._getLayerDomain(e);if(o){const t=o.domains&&o.domains[e];if(t&&"inherited"!==t?.type)return t}if(n)return n;if(!t?.excludeImpliedDomains){const t=(0,pe.hx)(this,e);if(t)return t}return null}async queryAttachments(e,t){return(0,pe.lV)(this,e,t,je)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(Se.A.from(e)??i.createQuery(),t);if(r?.features)for(const e of r.features)e.layer=e.sourceLayer=i;return r}async queryObjectIds(e,t){return(await(0,pe.sg)(this,e,t,je)).filter(Ie.Et)}async queryFeatureCount(e,t){return(0,pe.Ye)(this,e,t,je)}async queryExtent(e,t){return(0,pe.B5)(this,e,t,je)}async queryRelatedFeatures(e,t){return(0,pe.hM)(this,e,t,je)}async queryRelatedFeaturesCount(e,t){return(0,pe.S2)(this,e,t,je)}async queryTopFeatures(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopFeatures||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopFeatures capability");const o=await i.e(7561).then(i.bind(i,57561)),n=await r.queryTopFeatures(o.default.from(e),t);if(n?.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryAttributeBins(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryAttributeBins||!s?.operations?.supportsQueryBins)throw new l.A(je,"Layer source does not support queryAttributeBins capability");(0,pe.ZJ)(e,s,je);const o=await Promise.all([i.e(7514),i.e(7136)]).then(i.bind(i,7514)),n=await r.queryAttributeBins(o.default.from(e),t);if(n.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryTopObjectIds(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopObjectIds||!s?.query.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopObjectIds capability");const o=await i.e(7561).then(i.bind(i,57561));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ie.Et)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopExtents||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopExtents capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopCount||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryFeatureCount capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopCount(o.default.from(e),t)}read(e,t){const i=e.featureCollection;if((i||"Feature Collection"===e.type)&&(this.resourceInfo=e),i){const e=i.layers;e&&1===e.length&&(super.read(e[0],t),null!=i.showLegend&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s?.push(Oe(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===i||"web-scene"===i)&&"tables"!==r)return s?.push(Oe(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s?.push(Oe(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===i||"web-scene"===i)&&"tables"===r)return s?.push(Oe(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new l.A(je,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||(0,_e.D)(this,e))}async save(e){return this._debouncedSaveOperations(Ze.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ze.X.SAVE_AS,t,e)}_readEditingEnabled(e,t,i){let r=e.layerDefinition?.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&"web-map"===i?.origin&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,i,r){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";(0,c.sM)("layerDefinition.capabilities",e,t),i&&!r?.writeLayerSchema&&(t.capabilities=e)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return(0,o.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return this.findFirstValidLayerId(t)}))}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),(0,he.yp)(this.renderer,this.fieldsIndex),(0,he.sv)(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),(0,Fe.L)(this,{origin:"service"})}async hasDataChanged(){return(0,pe.jp)(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach((e=>{const i=e.prototype?.attributes;i&&t&&delete i[t]}))}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new l.A("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new l.A("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this.addHandles([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};(0,r._)([(0,b.MZ)({clonable:!1,readOnly:!0})],Le.prototype,"_titleCreator",null),(0,r._)([(0,b.MZ)(ue.zQ)],Le.prototype,"attributeTableTemplate",void 0),(0,r._)([(0,w.w)("service","capabilities")],Le.prototype,"readCapabilities",null),(0,r._)([(0,b.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],Le.prototype,"charts",void 0),(0,r._)([(0,b.MZ)({readOnly:!0})],Le.prototype,"createQueryVersion",null),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.copyrightText"}}})],Le.prototype,"copyright",void 0),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.displayField"}}})],Le.prototype,"displayField",void 0),(0,r._)([(0,b.MZ)({types:Ae.Es,readOnly:!0})],Le.prototype,"defaultSymbol",void 0),(0,r._)([(0,b.MZ)({type:ve.L})],Le.prototype,"dynamicDataSource",void 0),(0,r._)([(0,b.MZ)({type:Boolean})],Le.prototype,"editingEnabled",null),(0,r._)([(0,w.w)(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Le.prototype,"readEditingEnabled",null),(0,r._)([(0,w.w)("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Le.prototype,"readEditingEnabledFromWebMap",null),(0,r._)([(0,v.K)(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Le.prototype,"writeEditingEnabled",null),(0,r._)([(0,v.K)("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Le.prototype,"writeEditingEnabledToWebMap",null),(0,r._)([(0,b.MZ)({readOnly:!0})],Le.prototype,"effectiveEditingEnabled",null),(0,r._)([(0,b.MZ)({clonable:!1,readOnly:!0})],Le.prototype,"featureTitleFields",null),(0,r._)([(0,b.MZ)({...qe.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:xe}}}}})],Le.prototype,"fields",void 0),(0,r._)([(0,b.MZ)(qe.fieldsIndex)],Le.prototype,"fieldsIndex",void 0),(0,r._)([(0,b.MZ)({type:F.A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Le.prototype,"formTemplate",void 0),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.extent"}}})],Le.prototype,"fullExtent",void 0),(0,r._)([(0,b.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:xe,writer(e,t,i){const r=e?pe.iX.toJSON(e):null;r&&(0,c.sM)(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:pe.iX.read}}})],Le.prototype,"geometryType",void 0),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.hasM"}}})],Le.prototype,"hasM",void 0),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.hasZ"}}})],Le.prototype,"hasZ",void 0),(0,r._)([(0,b.MZ)(ue.id)],Le.prototype,"id",void 0),(0,r._)([(0,b.MZ)({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Le.prototype,"infoFor3D",void 0),(0,r._)([(0,b.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Le.prototype,"isTable",void 0),(0,r._)([(0,w.w)("service","isTable",["type","geometryType"]),(0,w.w)("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Le.prototype,"readIsTable",null),(0,r._)([(0,v.K)("web-map","isTable")],Le.prototype,"writeIsTable",null),(0,r._)([(0,b.MZ)(ue.kF)],Le.prototype,"labelsVisible",void 0),(0,r._)([(0,b.MZ)({type:[fe.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:me.w,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:me.w,write:{enabled:!0,layerContainerTypes:T.K}}},name:"layerDefinition.drawingInfo.labelingInfo",read:me.w,write:!0}})],Le.prototype,"labelingInfo",void 0),(0,r._)([(0,b.MZ)((()=>{const e=(0,u.o8)(ue.Ih);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,i){(0,c.sM)(i,(0,De.p)(e),t)}}},e})())],Le.prototype,"opacity",void 0),(0,r._)([(0,b.MZ)(ue.fV)],Le.prototype,"legendEnabled",void 0),(0,r._)([(0,b.MZ)({type:["show","hide"],json:(()=>{const e=(0,u.o8)(ue.C1.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],Le.prototype,"listMode",void 0),(0,r._)([(0,w.w)("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],Le.prototype,"readGlobalIdField",null),(0,r._)([(0,b.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:xe}}}}})],Le.prototype,"objectIdField",void 0),(0,r._)([(0,w.w)("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],Le.prototype,"readObjectIdField",null),(0,r._)([(0,b.MZ)({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T.K}}})],Le.prototype,"operationalLayerType",void 0),(0,r._)([(0,b.MZ)(qe.outFields)],Le.prototype,"outFields",void 0),(0,r._)([(0,b.MZ)({readOnly:!0})],Le.prototype,"parsedUrl",null),(0,r._)([(0,b.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),(0,r._)([(0,b.MZ)(ue.M6)],Le.prototype,"popupEnabled",void 0),(0,r._)([(0,b.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],Le.prototype,"popupTemplate",void 0),(0,r._)([(0,b.MZ)({readOnly:!0})],Le.prototype,"defaultPopupTemplate",null),(0,r._)([(0,b.MZ)({types:Me.Hg,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Me.XJ,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T.K,overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema})}}})],Le.prototype,"renderer",null),(0,r._)([(0,w.w)("service","renderer",["drawingInfo.renderer","defaultSymbol"]),(0,w.w)("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Le.prototype,"readRenderer",null),(0,r._)([(0,b.MZ)()],Le.prototype,"resourceInfo",void 0),(0,r._)([(0,b.MZ)((()=>{const e=(0,u.o8)(ue.PY);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],Le.prototype,"screenSizePerspectiveEnabled",void 0),(0,r._)([(0,b.MZ)({clonable:!1})],Le.prototype,"source",null),(0,r._)([(0,g.w)("source")],Le.prototype,"castSource",null),(0,r._)([(0,w.w)("portal-item","source",["featureSet"]),(0,w.w)("web-map","source",["featureSet"])],Le.prototype,"readSource",null),(0,r._)([(0,b.MZ)({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],Le.prototype,"spatialReference",void 0),(0,r._)([(0,b.MZ)({type:Number})],Le.prototype,"subtypeCode",void 0),(0,r._)([(0,b.MZ)({type:[de.A]})],Le.prototype,"templates",void 0),(0,r._)([(0,w.w)("templates",["editFieldsInfo","creatorField","editorField","templates"])],Le.prototype,"readTemplates",null),(0,r._)([(0,b.MZ)({type:ge.A})],Le.prototype,"timeInfo",void 0),(0,r._)([(0,b.MZ)()],Le.prototype,"title",void 0),(0,r._)([(0,w.w)("service","title",["name"]),(0,w.w)("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Le.prototype,"readTitle",null),(0,r._)([(0,w.w)("web-map","title",["layerDefinition.name","title"])],Le.prototype,"readTitleFromWebMap",null),(0,r._)([(0,b.MZ)({type:String})],Le.prototype,"sublayerTitleMode",void 0),(0,r._)([(0,b.MZ)({json:{read:!1}})],Le.prototype,"type",void 0),(0,r._)([(0,b.MZ)({type:String})],Le.prototype,"typeIdField",void 0),(0,r._)([(0,w.w)("service","typeIdField"),(0,w.w)("typeIdField",["layerDefinition.typeIdField"])],Le.prototype,"readTypeIdField",null),(0,r._)([(0,b.MZ)({type:[ye.A]})],Le.prototype,"types",void 0),(0,r._)([(0,w.w)("service","types",["types"]),(0,w.w)("types",["layerDefinition.types"])],Le.prototype,"readTypes",null),(0,r._)([(0,b.MZ)({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Le.prototype,"visible",void 0),(0,r._)([(0,w.w)("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Le.prototype,"readVisible",null),Le=(0,r._)([(0,_.$)("esri.layers.FeatureLayer")],Le);const Pe=Le},68109:(e,t,i)=>{i.d(t,{d:()=>T});var r=i(90237),s=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),n=i(13874),a=i(69540),l=i(25482),u=i(93637),p=i(43937),d=i(50820),y=i(10873),c=i(46499),h=i(13112);let f=class extends(a.A.ClonableMixin(l.A)){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.renderer=null,this.visible=!0}};(0,r._)([(0,s.MZ)({type:[c.A],json:{write:!0}})],f.prototype,"labelingInfo",void 0),(0,r._)([(0,s.MZ)(y.kF)],f.prototype,"labelsVisible",void 0),(0,r._)([(0,s.MZ)({types:h.Hg,json:{write:!0}})],f.prototype,"renderer",void 0),(0,r._)([(0,s.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"visible",void 0),f=(0,r._)([(0,o.$)("esri.layers.support.TrackPartInfo")],f);const m=f;var b=i(96576),g=i(59868),w=i(10184);let _=class extends(a.A.ClonableMixin(l.A)){constructor(e){super(e),this.enabled=!0,this.fields=[],this.latestObservations=new m({renderer:new b.A({symbol:g.UK.clone()})}),this.maxDisplayDuration=null,this.maxDisplayObservationsPerTrack=0,this.popupEnabled=!0,this.popupTemplate=null,this.previousObservations=new m({renderer:new b.A({symbol:g.UK.clone()})}),this.trackLines=new m({renderer:new b.A({symbol:g.A7.clone()})}),this.timeField="startTimeField"}writeFields(e,t,i){const r=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));(0,u.sM)(i,r,t)}};(0,r._)([(0,s.MZ)({type:Boolean,json:{write:!0}})],_.prototype,"enabled",void 0),(0,r._)([(0,s.MZ)({type:[d.A],json:{write:!0}})],_.prototype,"fields",void 0),(0,r._)([(0,p.K)("fields")],_.prototype,"writeFields",null),(0,r._)([(0,s.MZ)({type:m,json:{write:!0}})],_.prototype,"latestObservations",void 0),(0,r._)([(0,s.MZ)({type:w.A,json:{write:!0}})],_.prototype,"maxDisplayDuration",void 0),(0,r._)([(0,s.MZ)({type:Number,json:{write:!0}})],_.prototype,"maxDisplayObservationsPerTrack",void 0),(0,r._)([(0,s.MZ)(y.M6)],_.prototype,"popupEnabled",void 0),(0,r._)([(0,s.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),(0,r._)([(0,s.MZ)({type:m,json:{write:!0}})],_.prototype,"previousObservations",void 0),(0,r._)([(0,s.MZ)({type:m,json:{write:!0}})],_.prototype,"trackLines",void 0),(0,r._)([(0,s.MZ)({type:["timeReceived","startTimeField","endTimeField"],json:{read:!0,write:!0}})],_.prototype,"timeField",void 0),_=(0,r._)([(0,o.$)("esri.layers.support.TrackInfo")],_);const v=_,T=e=>{let t=class extends e{constructor(){super(...arguments),this.trackInfo=null}};return(0,r._)([(0,s.MZ)({type:v})],t.prototype,"trackInfo",void 0),t=(0,r._)([(0,o.$)("esri.layers.mixins.TrackableLayer")],t),t}},8947:(e,t,i)=>{i.d(t,{L:()=>n});var r=i(60999),s=i(74887),o=i(67076);async function n(e,t,i){const n=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(n&&"unique-value"===n.type&&n.styleOrigin){const a=await(0,r.Ke)(n.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new o.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},96520:(e,t,i)=>{i.d(t,{u:()=>n});var r=i(83047),s=i(21325);function o(e,t,i){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=i)}function n(e,t,i){if(!e&&!t||!i)return;const s=(0,r.G9)(i);a(e,i,s),a(t,i,s)}function a(e,t,i){if(e)for(const r of e)l(r.geometry,t,i)}function l(e,t,i){if(!e?.spatialReference||(0,s.aI)(e.spatialReference,t))return;const n=(0,r.G9)(e.spatialReference)/i;if(1!==n)if("x"in e)null!=e.z&&(e.z*=n);else if("rings"in e)o(e,e.rings,n);else if("paths"in e)o(e,e.paths,n);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=n)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3186,7675,9340],{38961:(e,t,r)=>{r.d(t,{A:()=>u});var s=r(90237),i=r(5503),o=r(36708),n=r(10107),a=r(40608),l=r(80559);let p=class extends i.A{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,l.fm)((()=>this._refresh()),o.OH))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.A(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,n.MZ)()],p.prototype,"getCollections",void 0),(0,s._)([(0,n.MZ)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,n.MZ)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,a.$)("esri.core.CollectionFlattener")],p);const u=p},81583:(e,t,r)=>{r.d(t,{L:()=>a,g:()=>n});var s=r(60999),i=r(5503),o=r(92474);async function n(e,t){return await e.load(),a(e,t)}async function a(e,t){const r=[],n=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?n(...t):i.A.isCollection(t)?t.forEach((e=>n(e))):o.A.isLoadable(t)&&r.push(t))};t(n);let a=null;if(await(0,s.Tj)(r,(async e=>{const t=await(0,s.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||a||(a=t)})),a)throw a.error;return e}},39516:(e,t,r)=>{let s;async function i(){return null==s&&(s=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),s}async function o(e,t){const r=await i(),s=r.get(e,t);if(null==s)throw r.getError(e,t);return s}function n(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>o,IW:()=>a,mA:()=>n})},88303:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ye});var s=r(90237),i=r(5503),o=r(38961),n=r(49186),a=r(4718),l=r(81583),p=r(53966),u=r(92071),d=r(74887),y=r(84952),c=r(10107),h=(r(44208),r(36005)),f=r(40608),m=r(16930),g=r(4146),v=r(52106),_=r(13874),b=r(78888),w=r(66552),x=r(92474),M=r(61893),S=(r(87811),r(93223)),A=r(5443),F=r(13600),Z=r(4902),T=r(56507),I=r(10873);let O=class extends(Z.A.IdentifiableMixin(u.L)){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,t){return"string"==typeof t.alias?t.alias:"string"==typeof t.name?t.name:""}readIdOnlyOnce(e){return-1!==this.id?this.id:"number"==typeof e?e:-1}};(0,s._)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],O.prototype,"title",void 0),(0,s._)([(0,h.w)("service","title",["alias","name"])],O.prototype,"readTitle",null),(0,s._)([(0,c.MZ)()],O.prototype,"layer",void 0),(0,s._)([(0,c.MZ)({type:T.jz,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,isRequired:!0}}})],O.prototype,"id",void 0),(0,s._)([(0,h.w)("service","id")],O.prototype,"readIdOnlyOnce",null),(0,s._)([(0,c.MZ)((0,I.Qo)(String))],O.prototype,"modelName",void 0),(0,s._)([(0,c.MZ)((0,I.Qo)(Boolean))],O.prototype,"isEmpty",void 0),(0,s._)([(0,c.MZ)({type:Boolean,nonNullable:!0})],O.prototype,"legendEnabled",void 0),(0,s._)([(0,c.MZ)({type:Boolean,json:{name:"visibility",write:!0}})],O.prototype,"visible",void 0),(0,s._)([(0,c.MZ)({type:Number,json:{write:!0}})],O.prototype,"opacity",void 0),O=(0,s._)([(0,f.$)("esri.layers.buildingSublayers.BuildingSublayer")],O);const j=O;var E=r(4071),R=r(17036),L=r(95466),P=r(30524),B=r(83898),N=r(50805),q=r(13112),C=r(61956),k=r(54218),$=r(30291),z=r(88625),D=r(4654),Q=r(45671);const U=(0,R.p)();let V=class extends(x.A.LoadableMixin(M.A.EsriPromiseMixin(j))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new L.A(this.fields)}readAssociatedLayer(e,t){const r=this.layer.associatedFeatureServiceItem,s=t.associatedLayerID;return null!=r&&"number"==typeof s?new F.default({portalItem:r,customParameters:this.customParameters,layerId:s}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return null}get displayField(){return null!=this.associatedLayer?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const t=null!=e?e.signal:null,r=this._fetchService(t).then((()=>{this.indexInfo=(0,B.F)(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,p.A.getLogger(this),t)}));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){return(0,$.tn)(this,e)}async _fetchService(e){const t=(await(0,b.A)(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&null!=this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return null!=this.associatedLayer?this.associatedLayer.types??[]:[]}get typeIdField(){return null!=this.associatedLayer?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=null!=this.associatedLayer&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:E.P,{query:t,data:{supportsZ:r,supportsM:s,isVersioned:i}}=e;return{query:t,data:{supportsZ:r,supportsM:s,isVersioned:i}}}createQuery(){const e=new C.A;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this.layer,t.sourceLayer=this;return e}))}async queryObjectIds(e,t){const r=await this._getAssociatedLayerForQuery();return(await r.queryObjectIds(e||this.createQuery(),t)).filter(k.Et)}async queryCachedAttributes(e,t){const r=(0,P.hL)(this.fieldsIndex,await(0,Q.TO)(this,(0,Q.D8)(this)));return(0,D.s1)(this.parsedUrl.path,this.attributeStorageInfo,e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new n.A("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new v.A({attributes:r[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:null!=this.associatedLayer}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return null!=e&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),null==this.associatedLayer)throw new n.A("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n.A("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"parsedUrl",null),(0,s._)([(0,c.MZ)({type:N.W4,readOnly:!0})],V.prototype,"nodePages",void 0),(0,s._)([(0,c.MZ)({type:[N.uV],readOnly:!0})],V.prototype,"materialDefinitions",void 0),(0,s._)([(0,c.MZ)({type:[N.Ot],readOnly:!0})],V.prototype,"textureSetDefinitions",void 0),(0,s._)([(0,c.MZ)({type:[N.L0],readOnly:!0})],V.prototype,"geometryDefinitions",void 0),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"serviceUpdateTimeStamp",void 0),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"store",void 0),(0,s._)([(0,c.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],V.prototype,"rootNode",void 0),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"attributeStorageInfo",void 0),(0,s._)([(0,c.MZ)(U.fields)],V.prototype,"fields",void 0),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"fieldsIndex",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:F.default})],V.prototype,"associatedLayer",void 0),(0,s._)([(0,h.w)("service","associatedLayer",["associatedLayerID"])],V.prototype,"readAssociatedLayer",null),(0,s._)([(0,c.MZ)(U.outFields)],V.prototype,"outFields",void 0),(0,s._)([(0,c.MZ)({type:String,readOnly:!0})],V.prototype,"objectIdField",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:String,json:{read:!1}})],V.prototype,"displayField",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:String})],V.prototype,"apiKey",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:String})],V.prototype,"customParameters",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:A.A})],V.prototype,"fullExtent",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:m.A})],V.prototype,"spatialReference",null),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"version",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:z.A})],V.prototype,"elevationInfo",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:Number})],V.prototype,"minScale",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:Number})],V.prototype,"maxScale",null),(0,s._)([(0,c.MZ)({readOnly:!0,type:Number})],V.prototype,"effectiveScaleRange",null),(0,s._)([(0,c.MZ)({type:["hide","show"],json:{write:!0}})],V.prototype,"listMode",void 0),(0,s._)([(0,c.MZ)({types:q.XJ,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],V.prototype,"renderer",void 0),(0,s._)([(0,c.MZ)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],V.prototype,"definitionExpression",void 0),(0,s._)([(0,c.MZ)(I.M6)],V.prototype,"popupEnabled",void 0),(0,s._)([(0,c.MZ)({type:_.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],V.prototype,"popupTemplate",void 0),(0,s._)([(0,c.MZ)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],V.prototype,"normalReferenceFrame",void 0),(0,s._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],V.prototype,"defaultPopupTemplate",null),(0,s._)([(0,c.MZ)()],V.prototype,"types",null),(0,s._)([(0,c.MZ)()],V.prototype,"typeIdField",null),(0,s._)([(0,c.MZ)({json:{write:!1}}),(0,S.e)(new w.J({"3DObject":"3d-object",Point:"point"}))],V.prototype,"layerType",void 0),(0,s._)([(0,c.MZ)()],V.prototype,"geometryType",null),(0,s._)([(0,c.MZ)()],V.prototype,"profile",null),(0,s._)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],V.prototype,"capabilities",null),(0,s._)([(0,c.MZ)({readOnly:!0})],V.prototype,"statisticsInfo",void 0),V=(0,s._)([(0,f.$)("esri.layers.buildingSublayers.BuildingComponentSublayer")],V);const G=V;var H,J=r(67076);const K={type:i.A,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:W}}},read:!1}};function W(e,t,r){if(e&&Array.isArray(e))return new i.A(e.map((e=>{const t=function(e){return"group"===e.layerType?X:G}(e);if(t){const s=new t;return s.read(e,r),s}return r?.messages&&e&&r.messages.push(new J.A("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:r})),null})))}let X=H=class extends j{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return(0,l.L)(this,(e=>H.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)}))))}};var Y;(0,s._)([(0,c.MZ)({type:["hide","show","hide-children"],json:{write:!0}})],X.prototype,"listMode",void 0),(0,s._)([(0,c.MZ)(K)],X.prototype,"sublayers",void 0),X=H=(0,s._)([(0,f.$)("esri.layers.buildingSublayers.BuildingGroupSublayer")],X),(Y=X||(X={})).sublayersProperty=K,Y.readSublayers=W,Y.forEachSublayer=function e(t,r){t.forEach((t=>{r(t),"building-group"===t.type&&e(t.sublayers,r)}))};const ee=X;var te=r(52136),re=r(18768),se=r(69208),ie=r(16131),oe=r(8303),ne=r(25036),ae=r(58947),le=r(92009),pe=r(25482),ue=r(13069);let de=class extends pe.A{constructor(){super(...arguments),this.type=null}};(0,s._)([(0,c.MZ)({type:String,readOnly:!0,json:{write:{isRequired:!0}}})],de.prototype,"type",void 0),de=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterAuthoringInfo")],de);const ye=de;var ce;let he=ce=class extends pe.A{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new ce({filterType:this.filterType,filterValues:(0,a.o8)(this.filterValues)})}};(0,s._)([(0,c.MZ)({type:String,json:{write:{isRequired:!0}}})],he.prototype,"filterType",void 0),(0,s._)([(0,c.MZ)({type:[String],json:{write:{isRequired:!0}}})],he.prototype,"filterValues",void 0),he=ce=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterAuthoringInfoType")],he);const fe=he;var me;const ge=i.A.ofType(fe);let ve=me=class extends pe.A{clone(){return new me({filterTypes:(0,a.o8)(this.filterTypes)})}};(0,s._)([(0,c.MZ)({type:ge,json:{write:{isRequired:!0}}})],ve.prototype,"filterTypes",void 0),ve=me=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterAuthoringInfoBlock")],ve);const _e=ve;var be;const we=i.A.ofType(_e);let xe=be=class extends ye{constructor(){super(...arguments),this.type="checkbox"}clone(){return new be({filterBlocks:(0,a.o8)(this.filterBlocks)})}};(0,s._)([(0,c.MZ)({type:["checkbox"]})],xe.prototype,"type",void 0),(0,s._)([(0,c.MZ)({type:we,json:{write:{isRequired:!0}}})],xe.prototype,"filterBlocks",void 0),xe=be=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],xe);const Me=xe;let Se=class extends pe.A{};(0,s._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],Se.prototype,"type",void 0),Se=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterMode")],Se);const Ae=Se;var Fe;let Ze=Fe=class extends Ae{constructor(){super(...arguments),this.type="solid"}clone(){return new Fe}};(0,s._)([(0,c.MZ)({type:["solid"],readOnly:!0,json:{write:{isRequired:!0}}})],Ze.prototype,"type",void 0),Ze=Fe=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterModeSolid")],Ze);const Te=Ze;var Ie,Oe=r(51734);let je=Ie=class extends Ae{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new Ie({edges:(0,a.o8)(this.edges)})}};(0,s._)([(0,S.e)({wireFrame:"wire-frame"})],je.prototype,"type",void 0),(0,s._)([(0,c.MZ)(Oe.J)],je.prototype,"edges",void 0),je=Ie=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterModeWireFrame")],je);const Ee=je;var Re;let Le=Re=class extends Ae{constructor(){super(...arguments),this.type="x-ray"}clone(){return new Re}};(0,s._)([(0,c.MZ)({type:["x-ray"],readOnly:!0,json:{write:{isRequired:!0}}})],Le.prototype,"type",void 0),Le=Re=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterModeXRay")],Le);const Pe=Le;var Be;const Ne={nonNullable:!0,types:{key:"type",base:Ae,typeMap:{solid:Te,"wire-frame":Ee,"x-ray":Pe}},json:{read:e=>{switch(e?.type){case"solid":return Te.fromJSON(e);case"wireFrame":return Ee.fromJSON(e);case"x-ray":return Pe.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let qe=Be=class extends pe.A{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new Te,this.title=""}clone(){return new Be({filterExpression:this.filterExpression,filterMode:(0,a.o8)(this.filterMode),title:this.title})}};(0,s._)([(0,c.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"filterExpression",void 0),(0,s._)([(0,c.MZ)(Ne)],qe.prototype,"filterMode",void 0),(0,s._)([(0,c.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],qe.prototype,"title",void 0),qe=Be=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilterBlock")],qe);const Ce=qe;var ke;const $e=i.A.ofType(Ce);let ze=ke=class extends pe.A{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=(0,ue.lk)(),this.name=null}clone(){return new ke({description:this.description,filterBlocks:(0,a.o8)(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:(0,a.o8)(this.filterAuthoringInfo)})}};(0,s._)([(0,c.MZ)({type:String,json:{write:!0}})],ze.prototype,"description",void 0),(0,s._)([(0,c.MZ)({type:$e,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"filterBlocks",void 0),(0,s._)([(0,c.MZ)({types:{key:"type",base:ye,typeMap:{checkbox:Me}},json:{read:e=>"checkbox"===e?.type?Me.fromJSON(e):null,write:!0}})],ze.prototype,"filterAuthoringInfo",void 0),(0,s._)([(0,c.MZ)({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"id",void 0),(0,s._)([(0,c.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],ze.prototype,"name",void 0),ze=ke=(0,s._)([(0,f.$)("esri.layers.support.BuildingFilter")],ze);const De=ze;let Qe=class extends pe.A{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};(0,s._)([(0,c.MZ)({type:String})],Qe.prototype,"fieldName",void 0),(0,s._)([(0,c.MZ)({type:String})],Qe.prototype,"modelName",void 0),(0,s._)([(0,c.MZ)({type:String})],Qe.prototype,"label",void 0),(0,s._)([(0,c.MZ)({type:Number})],Qe.prototype,"min",void 0),(0,s._)([(0,c.MZ)({type:Number})],Qe.prototype,"max",void 0),(0,s._)([(0,c.MZ)({json:{read:e=>Array.isArray(e)&&(e.every((e=>"string"==typeof e))||e.every((e=>"number"==typeof e)))?e.slice():null}})],Qe.prototype,"mostFrequentValues",void 0),(0,s._)([(0,c.MZ)({type:[Number]})],Qe.prototype,"subLayerIds",void 0),Qe=(0,s._)([(0,f.$)("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],Qe);let Ue=class extends(x.A.LoadableMixin(M.A.EsriPromiseMixin(pe.A))){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||"loading"===this.loadStatus?this._get("fields"):(p.A.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}async _fetchService(e){const t=(await(0,b.A)(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(t,{origin:"service"})}};(0,s._)([(0,c.MZ)({constructOnly:!0,type:String})],Ue.prototype,"url",void 0),(0,s._)([(0,c.MZ)({readOnly:!0,type:[Qe],json:{read:{source:"summary"}}})],Ue.prototype,"fields",null),Ue=(0,s._)([(0,f.$)("esri.layers.support.BuildingSummaryStatistics")],Ue);const Ve=Ue;var Ge=r(24212);const He=i.A.ofType(De),Je=(0,a.o8)(ee.sublayersProperty),Ke=Je.json?.origins;Ke&&(Ke["web-scene"]={type:[G],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},Ke["portal-item"]={type:[G],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let We=class extends((0,ae.w6)((0,re.b)((0,ie.q)((0,oe.A)((0,ne.j)((0,u.P)((0,se.d)((0,te.p)(g.A))))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new o.A({getCollections:()=>[this.sublayers],getChildrenFunction:e=>"building-group"===e.type?e.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new He,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,t,r){const s=ee.readSublayers(e,t,r);return ee.forEachSublayer(s,(e=>e.layer=this)),this._allSublayerOverrides&&(function(e,t){t.forEach((t=>Xe(e,t)))}(s,this._allSublayerOverrides),this._allSublayerOverrides=null),s}write(e,t){return e=super.write(e,t),!t||"web-scene"!==t.origin&&"portal-item"!==t.origin||(this.sublayers?function(e,t,r){const s=[];ee.forEachSublayer(e,(e=>{const t=e.write({},r);Object.keys(t).length>1&&s.push(t)})),s.length>0&&(t.sublayers=s)}(this.sublayers,e,t):this._allSublayerOverrides&&function(e,t,r){const s=r?.origin&&e.get(r.origin);s&&(t.sublayers=[],s.overrides.forEach((e=>{t.sublayers.push((0,a.o8)(e))})))}(this._allSublayerOverrides,e,t)),e}read(e,t){if(super.read(e,t),("web-scene"===t?.origin||"portal-item"===t?.origin)&&Array.isArray(e?.sublayers)){const r=function(e,t){const r=new Map;for(const s of e)null!=s&&"object"==typeof s&&"number"==typeof s.id?r.set(s.id,s):t.messages?.push(new n.A("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:s}));return{overrides:r,context:t}}(e.sublayers,t);this.sublayers?Xe(this.sublayers,r):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(t.origin,r))}}readSummaryStatistics(e,t){if("string"==typeof t.statisticsHRef){const e=(0,y.fj)(this.parsedUrl?.path,t.statisticsHRef);return new Ve({url:e})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d.QP).then((()=>this._fetchService(t))).then((()=>this._fetchAssociatedFeatureService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}loadAll(){return(0,l.g)(this,(e=>{ee.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)})),this.summaryStatistics&&e(this.summaryStatistics)}))}async saveAs(e,t){return this._debouncedSaveOperations(ae.Xh.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(ae.Xh.SAVE,e)}validateLayer(e){if(!e.layerType||"Building"!==e.layerType)throw new n.A("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:t}=await(0,le.L)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=t}catch(e){p.A.getLogger(this).warn("Associated feature service item could not be loaded",e)}}_validateElevationInfo(){const e=this.elevationInfo,t="Building scene layers";(0,Ge.XF)(p.A.getLogger(this),(0,Ge.B)(t,"absolute-height",e)),(0,Ge.XF)(p.A.getLogger(this),(0,Ge.tW)(t,e))}};function Xe(e,t){const{overrides:r,context:s}=t;ee.forEachSublayer(e,(e=>e.read(r.get(e.id),s)))}(0,s._)([(0,c.MZ)({type:["BuildingSceneLayer"]})],We.prototype,"operationalLayerType",void 0),(0,s._)([(0,c.MZ)({readOnly:!0})],We.prototype,"allSublayers",void 0),(0,s._)([(0,c.MZ)(Je)],We.prototype,"sublayers",void 0),(0,s._)([(0,h.w)("service","sublayers")],We.prototype,"readSublayers",null),(0,s._)([(0,c.MZ)({type:He,nonNullable:!0,json:{write:!0}})],We.prototype,"filters",void 0),(0,s._)([(0,c.MZ)({type:String,json:{write:!0}})],We.prototype,"activeFilterId",void 0),(0,s._)([(0,c.MZ)({readOnly:!0,type:Ve})],We.prototype,"summaryStatistics",void 0),(0,s._)([(0,h.w)("summaryStatistics",["statisticsHRef"])],We.prototype,"readSummaryStatistics",null),(0,s._)([(0,c.MZ)({type:[String],json:{read:!1}})],We.prototype,"outFields",void 0),(0,s._)([(0,c.MZ)(I.Fm)],We.prototype,"fullExtent",void 0),(0,s._)([(0,c.MZ)(I.fV)],We.prototype,"legendEnabled",void 0),(0,s._)([(0,c.MZ)({type:["show","hide","hide-children"]})],We.prototype,"listMode",void 0),(0,s._)([(0,c.MZ)((0,I.Qo)(m.A))],We.prototype,"spatialReference",void 0),(0,s._)([(0,c.MZ)(I.Yj)],We.prototype,"elevationInfo",null),(0,s._)([(0,c.MZ)({json:{read:!1},readOnly:!0})],We.prototype,"type",void 0),(0,s._)([(0,c.MZ)()],We.prototype,"associatedFeatureServiceItem",void 0),We=(0,s._)([(0,f.$)("esri.layers.BuildingSceneLayer")],We);const Ye=We},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>u,ne:()=>p});var s=r(90237),i=r(93637),o=r(10107),n=(r(44208),r(53966),r(87811),r(40608)),a=r(91880);function l(e,t,r){if(!e)return null;const s=e.find((e=>!!e.field));if(!s)return null;const i=new a.A;return i.read(s,r),[i]}const p={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,s){const o=e.find((e=>!!e.field));o&&(0,i.sM)(r,[o.toJSON()],t)}}}},u=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,s._)([(0,o.MZ)(p)],t.prototype,"orderBy",void 0),t=(0,s._)([(0,n.$)("esri.layers.mixins.OrderedLayer")],t),t}},33143:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(90237),i=r(69540),o=r(25482),n=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),p=r(43937),u=r(80451),d=r(29005);let y=class extends(i.A.ClonableMixin(o.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,u.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s._)([(0,n.MZ)({json:{write:!0}})],y.prototype,"id",void 0),(0,s._)([(0,n.MZ)({json:{write:!0}})],y.prototype,"name",void 0),(0,s._)([(0,n.MZ)({json:{write:!0}})],y.prototype,"domains",void 0),(0,s._)([(0,a.w)("domains")],y.prototype,"readDomains",null),(0,s._)([(0,p.K)("domains")],y.prototype,"writeDomains",null),(0,s._)([(0,n.MZ)({type:[d.A],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,s._)([(0,l.$)("esri.layers.support.FeatureType")],y);const c=y},91880:(e,t,r)=>{r.d(t,{A:()=>d});var s,i=r(90237),o=r(66552),n=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const p=new o.J({asc:"ascending",desc:"descending"});let u=class extends n.A{static{s=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new s({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i._)([(0,a.MZ)({type:String,json:{write:!0}})],u.prototype,"field",void 0),(0,i._)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],u.prototype,"valueExpression",void 0),(0,i._)([(0,a.MZ)({type:p.apiValues,json:{type:p.jsonValues,read:p.read,write:p.write}})],u.prototype,"order",void 0),u=s=(0,i._)([(0,l.$)("esri.layers.support.OrderByInfo")],u);const d=u},17311:(e,t,r)=>{r.d(t,{A:()=>y});var s=r(90237),i=r(69622),o=r(60999),n=r(5503),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608)),p=r(30524),u=r(71386);let d=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,o.UT)((()=>(0,u.lw)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new n.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),s=this.fieldsIndex.get(r.at(-1)??"");s&&e.add(s.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){try{const{attributes:s}=t,i=r?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:o}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(r.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const r=this._createFormattedAttributes(e,t,i).global;return o({attributes:s,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:r,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const r=t.getObjectId();if(null==r)return t;if(!(0,p.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[r];const s=await e.queryFeatures(t);if(1===s?.features.length)return s.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),s=e?.name??r.fieldName;r.fieldName=s,t.set(s.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const s=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const o={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:s,attributes:o,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,p.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,s._)([(0,a.MZ)({readOnly:!0})],d.prototype,"_arcadeTask",null),(0,s._)([(0,a.MZ)()],d.prototype,"_featureUtils",void 0),(0,s._)([(0,a.MZ)({readOnly:!0})],d.prototype,"featureUtilsPromise",null),(0,s._)([(0,a.MZ)({readOnly:!0})],d.prototype,"calculatedExpressions",null),(0,s._)([(0,a.MZ)()],d.prototype,"displayField",void 0),(0,s._)([(0,a.MZ)()],d.prototype,"effectivePopupTemplate",void 0),(0,s._)([(0,a.MZ)()],d.prototype,"expressionsUsedInTitle",null),(0,s._)([(0,a.MZ)()],d.prototype,"fieldsIndex",void 0),(0,s._)([(0,a.MZ)()],d.prototype,"fieldInfoMap",null),(0,s._)([(0,a.MZ)()],d.prototype,"fields",void 0),(0,s._)([(0,a.MZ)()],d.prototype,"objectIdField",void 0),(0,s._)([(0,a.MZ)()],d.prototype,"requiredFields",null),d=(0,s._)([(0,l.$)("esri.layers.support.TitleCreator")],d);const y=d},4071:(e,t,r)=>{r.d(t,{$:()=>s,P:()=>i});const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},i={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsOrderByFields:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},41560:(e,t,r)=>{r.d(t,{Ch:()=>n,mW:()=>o});var s=r(34727),i=r(39516);function o(e,t){return{...t,filterMode:e.mode}}function n(e,t,r){const o=function(e){if("manual"===p(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:s}of e.filters)t[0]=Math.max(t[0],u(r)),t[1]=Math.min(t[1],d(s));return t}(e);if(o&&((0,s.gg)(t,o[0])||(0,s.ZH)(r,o[1])))return"";const n=Array.from(a(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=u(e.at(0)?.minScale),o=d(e.at(-1)?.maxScale);if((0,s.ZH)(i,t)||(0,s.gg)(o,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,s.ZH)(u(i.minScale),d(r.maxScale)))return!0}return!1}(n,t,r)?"1=1":n.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*a(e,t,r){if("manual"===p(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const s of e.filters)l(s.minScale,s.maxScale,t,r)&&(yield s)}}function l(e,t,r,i){return e=u(e),r=u(r),t=d(t),!(!(0,s.Sp)(r,e)&&(i??r)>e||(0,s.Hx)(t,r)||void 0!==i&&(0,s.Sp)(i,e))}function p(e){return"mode"in e?e.mode:e.filterMode}function u(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},32730:(e,t,r)=>{r.d(t,{BI:()=>m,D3:()=>h,XJ:()=>f,lc:()=>c,mX:()=>v,rU:()=>g,tH:()=>M});var s=r(799);const i="__begin__",o="__end__",n=new RegExp(i,"ig"),a=new RegExp(o,"ig"),l=new RegExp("^"+i,"i"),p=new RegExp(o+"$","i"),u='"',d=u+" + ",y=" + "+u;function c(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=c(e.labelExpression),t.type="conventional"),t}function m(e){const t=f(e);switch(t.type){case"conventional":return v(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return M(t.expression)}return null}function v(e){let t;return e?(t=(0,s.HC)(e,(e=>i+'$feature["'+e+'"]'+o)),t=l.test(t)?t.replace(l,""):u+t,t=p.test(t)?t.replace(p,""):t+u,t=t.replaceAll(n,d).replaceAll(a,y)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,w=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,x=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function M(e){if(!e)return null;let t=b.exec(e)||w.exec(e);return t?t[1]||t[3]:(t=x.exec(e),t?t[2]:null)}},58501:(e,t,r)=>{r.d(t,{q:()=>i});var s=r(62815);function i(e,t,r){if(!r?.features||!r.hasZ)return;const i=(0,s.N)(r.geometryType,t,e.outSpatialReference);if(null!=i)for(const e of r.features)i(e.geometry)}},22671:(e,t,r)=>{r.d(t,{A:()=>_});var s,i=r(90237),o=r(52106),n=r(66552),a=r(25482),l=r(4718),p=r(10107),u=(r(44208),r(53966),r(36005)),d=r(40608),y=r(43937),c=r(16930),h=r(65864),f=r(50498),m=r(20437);const g=new n.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=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,o.A)}writeGeometryType(e,t,r,s){if(e)return void g.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,h.rS)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=c.A.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(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 r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n?.(o[e].geometry)||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const p=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n),a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const s=c.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const o=e[t],n=r.fromJSON(o),a=o.geometry?.spatialReference;null==n.geometry||a||(n.geometry.spatialReference=s);const l=o.aggregateGeometries,p=n.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=s)}i.push(n)}return i}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(a[0]),i=r(a[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,h.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,h.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const o=(0,h.Bi)(e)?e.rings:e.paths;let n,a;for(let e=0,s=o.length;e<s;e++){const s=o[e];for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(n+=i[0],a+=i[1]):(n=i[0],a=i[1]),i[0]=t(n),i[1]=r(a)}}if(s&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=i(r[3])}}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const o=e.points;let n,a;for(let e=0,s=o.length;e<s;e++){const s=o[e];e>0?(n+=s[0],a+=s[1]):(n=s[0],a=s[1]),s[0]=t(n),s[1]=r(a)}if(s&&i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=s(t[2]),t[3]=i(t[3])}else if(s)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=s(t[2])}else if(i)for(let e=0,t=o.length;e<t;e++){const t=o[e];t[2]=i(t[2])}}:null}};(0,i._)([(0,p.MZ)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,p.MZ)({type:[o.A],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,u.w)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,p.MZ)({type:[m.A],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,p.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,y.K)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,p.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,p.MZ)({types:f.yR,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,u.w)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,p.MZ)({type:c.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,y.K)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,p.MZ)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,d.$)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v},41366:(e,t,r)=>{r.d(t,{K:()=>y,Q:()=>p});var s=r(90237),i=r(66552),o=r(53966),n=r(10107),a=(r(44208),r(87811),r(93223)),l=r(40608);const p=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),u="percent-of-total",d="field",y=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&d||r&&u||null,t&&r&&o.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==u||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,s._)([(0,n.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,s._)([(0,a.e)(p,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,s._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},45671:(e,t,r)=>{r.d(t,{D8:()=>o,TO:()=>i});var s=r(30524);async function i(e,t=e.popupTemplate){if(null==t)return[];const r=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:i}=t,{objectIdField:o,typeIdField:n,globalIdField:a,relationships:l}=e;if(r.includes("*"))return["*"];const p=i?(0,s.eX)(e):[],u=(0,s.DB)(e.fieldsIndex,[...r,...p]);return n&&u.push(n),u&&o&&e.fieldsIndex?.has(o)&&!u.includes(o)&&u.push(o),u&&a&&e.fieldsIndex?.has(a)&&!u.includes(a)&&u.push(a),l&&l.forEach((t=>{const{keyField:r}=t;u&&r&&e.fieldsIndex?.has(r)&&!u.includes(r)&&u.push(r)})),u}function o(e,t){return e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&null!=e.defaultPopupTemplate?e.defaultPopupTemplate:null}},92935:(e,t,r)=>{var s;r.d(t,{X:()=>s}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(s||(s={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7514],{7320:(e,t,i)=>{i.d(t,{g:()=>n});const n={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const n=new r(e.getPointX(t),e.getPointY(t),i),s=e.hasZ(t),o=e.hasM(t);return s&&(n.z=e.getPointZ(t)),o&&(n.m=e.getPointM(t)),n},exportPolygon:function(e,t,i){return new s(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new o(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new a(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const n=e.hasZ(t),r=e.hasM(t),s=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(n){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(r){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s}};class r{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class s{constructor(e,t,i,n){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class o{constructor(e,t,i,n){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class a{constructor(e,t,i,n){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class l{constructor(e,t,i,n,r){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=n,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},31464:(e,t,i)=>{i.d(t,{Cv:()=>f,Nk:()=>y,lK:()=>g});var n=i(4576),r=i(74887),s=i(57251),o=i(7320),a=i(21325),l=i(28735);const p=[0,0];function u(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,p),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,p),[i.xmax,i.ymax]=e(t.xmax,t.ymax,p),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:m(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const i=[];for(const n of e)i.push(m(n,t));return i}function m(e,t){const i=[];for(const n of e){const e=t(n[0],n[1],[0,0]);i.push(e),n.length>2&&e.push(n[2]),n.length>3&&e.push(n[3])}return i}async function y(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(n.Ru):[e];await(0,s.initializeProjection)(i.map((e=>({source:e,dest:t}))))}const d=u.bind(null,l.je),h=u.bind(null,l.tD);function f(e,t,i,n){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,a.fn)(t)||!(0,a.fn)(i)||(0,a.aI)(t,i))return e;if((0,l.y7)(t,i)){const t=(0,a.K8)(i)?d(e):h(e);return t.spatialReference=i,t}return(0,s.projectMany)(o.g,[e],t,i,null,n)[0]}const v=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,n){if(!e?.length||!t||!i||(0,a.aI)(t,i))return e;const s={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:n,resolve:(0,r.Tw)()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:n,resolve:r,geographicTransformation:p}=e;(0,l.y7)(i,n)?(0,a.K8)(n)?r(t.map(d)):r(t.map(h)):r((0,s.projectMany)(o.g,t,i,n,p,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function g(e,t,i,n){return v.push(e,t,i,n)}},58727:(e,t,i)=>{i.d(t,{GC:()=>f,T2:()=>v,VY:()=>m,dO:()=>x,iJ:()=>h,v8:()=>y});var n=i(49186),r=i(66552),s=i(83047),o=i(57251),a=i(90634),l=i(65864),p=i(17136),u=i(21325),c=i(31464);const m=new r.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),y=Object.freeze({}),d="frequency";async function h(e,t,i){const n=e.bin;return n.onField&&(n.onField=n.onField.trim()),n.onExpression?.value&&(n.onExpression.value=n.onExpression.value.trim()),n.splitBy&&(n.splitBy.value&&(n.splitBy.value=n.splitBy.value.trim()),n.splitBy.outAlias&&(n.splitBy.outAlias=n.splitBy.outAlias.trim())),n.stackBy&&(n.stackBy.value&&(n.stackBy.value=n.stackBy.value.trim()),n.stackBy.outAlias&&(n.stackBy.outAlias=n.stackBy.outAlias.trim())),"normalizationField"in n.parameters&&n.parameters.normalizationField&&(n.parameters.normalizationField=n.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:d}]),f(e,t,i)}async function f(e,t,i){const{outFields:n,orderByFields:r,groupByFieldsForStatistics:s,outStatistics:o}=e;if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(o)for(let e=0;e<o.length;e++)o[e].onStatisticField&&(o[e].onStatisticField=o[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),v(e,t,i)}async function v(e,t,r){if(!e)return null;let{where:o}=e;if(e.where=o=o?.trim(),(!o||/^1 *= *1$/.test(o)||t&&t===o)&&(e.where=null),!e.geometry)return e;let d=await async function(e){const{distance:t,units:r}=e,o=e.geometry;if(null==t||"vertexAttributes"in o)return o;const a=o.spatialReference,p=r?m.fromJSON(r):(0,s.Ij)(a),y=a&&((0,u.EA)(a)||(0,u.K8)(a))?o:await(0,c.Nk)(a,u.KK).then((()=>(0,c.Cv)(o,u.KK))),d=await i.e(9159).then(i.bind(i,49159));await d.load();const h=d.execute(y,t||1,{unit:p})??void 0;if(!h||!(0,l.Bi)(h)||0===h.rings.length)throw new n.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return h}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;d=(0,a.HA)(d),d.spatialReference=t}if(d){await(0,c.Nk)(d.spatialReference,r),d=function(e,t){const i=e.spatialReference;return g(e,t)&&(0,l.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(d,r);const t=(await(0,p.el)((0,l.rS)(d)))[0];if(null==t)throw y;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=i&&g(d,r)?{densificationStep:8*i}:void 0,s=t.toJSON(),o=(0,c.Cv)(s,s.spatialReference,r,n);if(!o)throw y;o.spatialReference=r,e.geometry=o}return e}function g(e,t){if(!e)return!1;const i=e.spatialReference;return((0,l.ZC)(e)||(0,l.Bi)(e)||(0,l.Rg)(e))&&!(0,u.aI)(i,t)&&!(0,o.canProjectWithoutEngine)(i,t)}function x(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},7514:(e,t,i)=>{i.r(t),i.d(t,{default:()=>b});var n=i(90237),r=i(51447),s=i(53966),o=i(79677);(0,r.uW)(s.A.getLogger("esri.TimeExtent"),"esri.TimeExtent",{replacement:"esri.time.TimeExtent",version:"4.31",warnOnce:!0});var a=i(69540),l=i(66552),p=i(25482),u=i(10107),c=i(56507),m=(i(44208),i(87811),i(93223)),y=i(40608),d=i(16930),h=i(65864),f=i(50498),v=i(58727),g=i(5834),x=i(41266),w=i(59977),M=i(11440),_=i(60909),Z=i(58174),S=i(7562),B=i(56400);const T=new l.J({asc:"ascending",desc:"descending"}),j={base:x.A,key:"type",typeMap:{"auto-interval":g.A,date:w.A,"fixed-boundaries":M.A,"fixed-interval":_.A}};let A=class extends(a.A.ClonableMixin(p.A)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!(0,B.wr)(e)&&s.A.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};(0,n._)([(0,u.MZ)({types:j,json:{name:"bin",write:!0}})],A.prototype,"binParameters",void 0),(0,n._)([(0,m.e)(T)],A.prototype,"binOrder",void 0),(0,n._)([(0,u.MZ)({type:Boolean,json:{write:!0}})],A.prototype,"cacheHint",void 0),(0,n._)([(0,u.MZ)({json:{write:!0}})],A.prototype,"datumTransformation",void 0),(0,n._)([(0,u.MZ)({type:d.A,json:{name:"defaultSR",write:!0}})],A.prototype,"defaultSpatialReference",void 0),(0,n._)([(0,u.MZ)({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],A.prototype,"distance",void 0),(0,n._)([(0,u.MZ)({types:f.yR,json:{read:h.rS,write:!0}})],A.prototype,"geometry",void 0),(0,n._)([(0,u.MZ)({type:String,json:{write:!0}})],A.prototype,"lowerBoundaryAlias",void 0),(0,n._)([(0,u.MZ)({type:d.A,json:{name:"outSR",write:!0}})],A.prototype,"outSpatialReference",void 0),(0,n._)([(0,u.MZ)({type:[S.A],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],A.prototype,"outStatistics",void 0),(0,n._)([(0,u.MZ)({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,i)=>{e&&(t[i]={ianaTimeZone:e})}}}})],A.prototype,"outTimeZone",null),(0,n._)([(0,u.MZ)({type:Boolean,json:{write:!0}})],A.prototype,"returnDistinctValues",void 0),(0,n._)([(0,m.e)(Z.x,{name:"spatialRel"})],A.prototype,"spatialRelationship",void 0),(0,n._)([(0,u.MZ)({type:o.A,json:{write:!0}})],A.prototype,"timeExtent",void 0),(0,n._)([(0,u.MZ)({type:String,json:{write:!0}})],A.prototype,"upperBoundaryAlias",void 0),(0,n._)([(0,u.MZ)({type:String,json:{read:v.VY.read,write:{writer:v.VY.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],A.prototype,"units",void 0),(0,n._)([(0,u.MZ)({type:String,json:{write:!0}})],A.prototype,"where",void 0),A=(0,n._)([(0,y.$)("esri.rest.support.AttributeBinsQuery")],A);const b=A;A.from=(0,c.dp)(A)},5834:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(90237),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(41366);function c(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let m=class extends((0,u.K)(p.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],m.prototype,"numBins",void 0),(0,n._)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:c}}})],m.prototype,"end",void 0),(0,n._)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:c}}})],m.prototype,"start",void 0),(0,n._)([(0,a.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],m.prototype,"type",void 0),m=(0,n._)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],m);const y=m;m.from=(0,o.dp)(m)},41266:(e,t,i)=>{i.d(t,{A:()=>v});var n=i(90237),r=i(69540),s=i(66552),o=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),p=i(40608),u=i(56507),c=i(98453);let m=class extends(r.A.ClonableMixin(o.A)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,n._)([(0,a.MZ)({type:String,json:{name:"outAlias",write:!0}})],m.prototype,"alias",void 0),(0,n._)([(0,a.MZ)({type:String})],m.prototype,"responseType",void 0),(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],m.prototype,"type",void 0),(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],m.prototype,"value",void 0),(0,n._)([(0,l.e)(c.m)],m.prototype,"valueType",void 0),m=(0,n._)([(0,p.$)("esri.rest.support.AttributeBinsGrouping")],m);const y=m;m.from=(0,u.dp)(m);const d=new s.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),h=new s.J({naturalLog:"natural-log",squareRoot:"square-root"});let f=class extends(r.A.ClonableMixin(o.A)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,n._)([(0,a.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],f.prototype,"expression",void 0),(0,n._)([(0,l.e)(d,{name:"onExpression.valueType"})],f.prototype,"expressionValueType",void 0),(0,n._)([(0,a.MZ)({type:String,json:{name:"onField",write:!0}})],f.prototype,"field",void 0),(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"firstDayOfWeek",void 0),(0,n._)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"hideUpperBound",void 0),(0,n._)([(0,a.MZ)({type:y,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],f.prototype,"splitBy",void 0),(0,n._)([(0,a.MZ)({type:y,json:{write:{target:{stackBy:{type:y},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>y.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],f.prototype,"stackBy",void 0),(0,n._)([(0,l.e)(h)],f.prototype,"transformation",void 0),f=(0,n._)([(0,p.$)("esri.rest.support.BinParametersBase")],f);const v=f},59977:(e,t,i)=>{i.d(t,{A:()=>x});var n=i(90237),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(69540),c=i(66552),m=i(25482);const y=(0,c.O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let d=class extends(u.A.ClonableMixin(m.A)){constructor(e){super(e),this.value=null,this.unit=null}};(0,n._)([(0,s.MZ)({type:Number,json:{name:"number",write:!0}})],d.prototype,"value",void 0),(0,n._)([(0,a.e)(y)],d.prototype,"unit",void 0),d=(0,n._)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],d);const h=d;function f(e,t,i){(0,r.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function v(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}d.from=(0,o.dp)(d);let g=class extends p.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=null,this.start=null,this.snapToData=null,this.type="date"}};(0,n._)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>v(t,"end")},write:{writer:f}}})],g.prototype,"end",void 0),(0,n._)([(0,s.MZ)({type:h,json:{name:"parameters",write:!0}})],g.prototype,"interval",void 0),(0,n._)([(0,s.MZ)({type:h,json:{name:"parameters.offset",write:!0}})],g.prototype,"offset",void 0),(0,n._)([(0,s.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],g.prototype,"returnFullIntervalBin",void 0),(0,n._)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>v(t,"start")},write:{writer:f}}})],g.prototype,"start",void 0),(0,n._)([(0,s.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],g.prototype,"snapToData",void 0),(0,n._)([(0,a.e)({dateBin:"date"},{readOnly:!0})],g.prototype,"type",void 0),g=(0,n._)([(0,l.$)("esri.rest.support.DateBinParameters")],g);const x=g;g.from=(0,o.dp)(g)},11440:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(90237),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266);let u=class extends p.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,n._)([(0,s.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,r.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map((e=>e.getTime())):e,t)}}}})],u.prototype,"boundaries",void 0),(0,n._)([(0,a.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],u.prototype,"type",void 0),u=(0,n._)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],u);const c=u;u.from=(0,o.dp)(u)},60909:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(90237),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(41366);function c(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let m=class extends((0,u.K)(p.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,n._)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:c}}})],m.prototype,"end",void 0),(0,n._)([(0,s.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],m.prototype,"interval",void 0),(0,n._)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:c}}})],m.prototype,"start",void 0),(0,n._)([(0,a.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],m.prototype,"type",void 0),m=(0,n._)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],m);const y=m;m.from=(0,o.dp)(m)}}]);