// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built require({cache:{"esri/views/interactive/sketch/SketchValueOptions":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../support/angularMeasurementUtils".split(" "),function(a,b,d,l,g,k,h,z){b=class extends b{constructor(E){super(E);this.directionMode="relative";this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case "relative":return this.relativeDirectionIsBilateral? z.DirectionMode.RelativeBilateral:z.DirectionMode.Relative;case "absolute":return z.DirectionMode.Absolute}}};a.__decorate([d.property({type:String,nonNullable:!0})],b.prototype,"directionMode",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"relativeDirectionIsBilateral",void 0);a.__decorate([d.property()],b.prototype,"effectiveDirectionMode",null);return b=a.__decorate([h.subclass("esri.views.interactive.sketch.SketchValueOptions")],b)})},"esri/views/support/angularMeasurementUtils":function(){define("exports ../../core/Cyclical ../../core/quantityUtils ../../core/unitUtils ../../core/libs/gl-matrix-2/math/vec2 ../../core/libs/gl-matrix-2/factories/vec2f64 ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../geometry/projection/projectVectorToVector ../../geometry/support/geodesicUtils ../../geometry/support/spatialReferenceUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w){function v(e,t){if(null!=e&&null!=t)return e=q(e,t),null!=e?d.createAngle(e,"radians","geographic"):void 0}function c(e,t,F){if(e&&t&&F&&(e=q(e,t),t=q(t,F),null!=e&&null!=t))return d.createAngle(t-e,"radians","geographic")}function f(e,t){if(null!=e)switch(t){case a.DirectionMode.Absolute:return m(e);case a.DirectionMode.Relative:return e=n(e),e=B.normalize(e,0,!0),-180===e&&(e=180),d.createAngle(e,"degrees","geographic");case a.DirectionMode.RelativeBilateral:return e= n(e),e=Math.abs(B.normalize(e,0,!0)),d.createAngle(e,"degrees","geographic")}}function m(e){e=n(e);e=u.normalize(e,0,!0);return d.createAngle(e,"degrees","geographic")}function n(e){if(null!=e)return d.convertRotationType(l.convertUnit(e.value,e.unit,"degrees"),e.rotationType,"geographic")}a.DirectionMode=void 0;(function(e){e.Absolute="absolute";e.Relative="relative";e.RelativeBilateral="relative-bilateral"})(a.DirectionMode||(a.DirectionMode={}));const q=(()=>{const e=z.create(),t=z.create();return(F, y)=>{h.set(e,F.x,F.y,F.z??0);h.set(t,y.x,y.y,y.z??0);return A(e,t,F.spatialReference,y.spatialReference)}})(),A=(()=>{const e=k.create(),t=z.create(),F=z.create();return(y,D,I,S)=>{if(!h.exactEquals(y,D)){var M=r.geodesicCompatibleSpatialReference(I),G=r.geodesicCompatibleSpatialReference(S);if(M&&G&&w.equals(M,G)&&E.projectVectorToVector(y,I,t,M)&&E.projectVectorToVector(D,S,F,G))return{azimuth:y}=r.inverseGeodeticSolver(p,t,F,M),null!=y?l.convertUnit(y,"degrees","radians"):void 0;e[0]=D[0]-y[0]; e[1]=D[1]-y[1];y=g.angle(k.UNIT_Y,e);0>e[0]&&(y=x-y);return y}}})(),C=(()=>{const e=z.create();return(t,F,y,D,I,S="geodesic")=>{h.copy(e,F);I=n(I);if("geodesic"===S&&(S=r.geodesicCompatibleSpatialReference(y))&&E.projectVectorToVector(e,y,e,S))return r.directGeodeticSolver(t,e,I,D,S),t[2]=F[2],E.projectVectorToVector(t,S,t,y)?!0:!1;y=d.convertRotationType(I,"geographic","arithmetic");y=l.convertUnit(y,"degrees","radians");h.set(t,F[0]+D*Math.cos(y),F[1]+D*Math.sin(y),F[2]);return!0}})(),p=new r.InverseGeodeticSolverResult, x=2*Math.PI,u=b.cyclicalDegrees,B=new b.Cyclical(-180,180);a.convertAngle=function(e,t,F){let y=l.convertUnit(e.value,e.unit,"degrees");y=d.convertRotationType(y,e.rotationType,F);y=l.convertUnit(y,"degrees",t);return d.createAngle(y,t,F)};a.directionBetweenPoints=v;a.directionForVertices=function(e,t,F,y=a.DirectionMode.Absolute){if(t&&F)switch(y){case a.DirectionMode.Absolute:return v(t,F);case a.DirectionMode.Relative:return f(c(e,t,F),a.DirectionMode.Relative);case a.DirectionMode.RelativeBilateral:return f(c(e, t,F),a.DirectionMode.RelativeBilateral)}};a.getDegreesArithmetic=function(e){if(null!=e)return d.convertRotationType(l.convertUnit(e.value,e.unit,"degrees"),e.rotationType,"arithmetic")};a.getDegreesGeographic=n;a.getNormalizedDirection=f;a.getNormalizedGeographicOrientation=m;a.pointFromDistanceAlongAzimuth=C;a.radiansGeographicBetweenVec=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/quantityUtils":function(){define(["exports","./unitUtils"],function(a,b){function d(f, m){return{type:b.unitType(m),value:f,unit:m}}function l(f,m){return{type:b.unitType(m),value:f,unit:m}}function g(f,m){return{type:b.unitType(m),value:f,unit:m}}function k(f,m,n="arithmetic"){return{type:b.unitType(m),value:f,unit:m,rotationType:n}}function h(f,m){const n=z(f,m);return"angle"===f.type?k(n,m,f.rotationType):d(n,m)}function z(f,m){return b.convertUnit(f.value,f.unit,m)}const E=l(0,"meters"),r=g(0,"square-meters"),w=k(0,"radians"),v=k(0,"degrees"),c=k(0,"degrees","geographic");a.convertRotationType= function(f,m,n){if(m===n)return f;switch(n){case "arithmetic":case "geographic":return-f+90}};a.createAngle=k;a.createArea=g;a.createLength=l;a.createQuantity=d;a.createScalar=function(f){return{value:f}};a.isBaseUnit=function(f){return b.isBaseUnit(f.unit)};a.max=function(f,m){return null==f?m:null==m?f:f.value>b.convertUnit(m.value,m.unit,f.unit)?f:m};a.min=function(f,m){return null==f?m:null==m?f:f.valueT?Math.PI:Math.acos(T)}function K(O){return"vec2("+O[0]+", "+O[1]+")"}function L(O,N){return O[0]===N[0]&&O[1]===N[1]}function R(O,N){const T=O[0];O=O[1];const aa=N[0];N=N[1];const ha=b.getEpsilon();return Math.abs(T-aa)<=ha*Math.max(1,Math.abs(T),Math.abs(aa))&&Math.abs(O-N)<=ha*Math.max(1,Math.abs(O),Math.abs(N))}function H(O,N,T,aa,ha){let ea=N[0]-T[0];T=N[1]-T[1];ha=(aa[0]*ea+aa[1]*T)*(ha-1);ea=aa[0]*ha;T=aa[1]*ha; O[0]=N[0]+ea;O[1]=N[1]+T;return O}const V=Object.freeze(Object.defineProperty({__proto__:null,add:g,angle:G,ceil:E,copy:d,cross:e,dist:n,distance:n,div:z,divide:z,dot:B,equals:R,exactEquals:L,floor:r,inverse:x,len:A,length:A,lerp:t,max:v,min:w,mul:h,multiply:h,negate:p,normalize:u,projectAndScale:H,random:F,rotate:M,round:c,scale:f,scaleAndAdd:m,set:l,sqrDist:q,sqrLen:C,squaredDistance:q,squaredLength:C,str:K,sub:k,subtract:k,transformMat2:y,transformMat2d:D,transformMat3:I,transformMat4:S},Symbol.toStringTag, {value:"Module"}));a.add=g;a.angle=G;a.ceil=E;a.copy=d;a.cross=e;a.dist=n;a.distance=n;a.div=z;a.divide=z;a.dot=B;a.equals=R;a.exactEquals=L;a.floor=r;a.inverse=x;a.len=A;a.length=A;a.lerp=t;a.max=v;a.min=w;a.mul=h;a.multiply=h;a.negate=p;a.normalize=u;a.projectAndScale=H;a.random=F;a.rotate=M;a.round=c;a.scale=f;a.scaleAndAdd=m;a.set=l;a.sqrDist=q;a.sqrLen=C;a.squaredDistance=q;a.squaredLength=C;a.str=K;a.sub=k;a.subtract=k;a.transformMat2=y;a.transformMat2d=D;a.transformMat3=I;a.transformMat4=S; a.vec2=V;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/vec2f64":function(){define(["exports"],function(a){function b(){return[0,0]}function d(n){return[n[0],n[1]]}function l(n,q){return[n,q]}function g(n,q=[0,0]){const A=Math.min(2,n.length);for(let C=0;Cz.length)return!1;h.x=z[0];h.y=z[1];h.z=z[2];h.spatialReference=E;return l.projectPointToVector(h,r,w,v)}const h=g.makeDehydratedPoint(0,0,0,d.WGS84);a.projectVectorToVector=k;a.projectVectorToVectorAsync=async function(z,E,r,w,v,c){await b.initializeProjection(E,w,null,c);return k(z,E,r,w,v)};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/geometry/projection/projectPointToVector":function(){define(["exports","../../core/libs/gl-matrix-2/factories/vec3f64","../projection","./projectBuffer"],function(a,b,d,l){function g(h,z,E,r){if(d.canProjectWithoutEngine(h.spatialReference,E))return k[0]=h.x,k[1]=h.y,k[2]=h.z??r??0,l.projectBuffer(k,h.spatialReference,0,z,E,0,1);h=d.tryProjectWithZConversion(h,E);if(!h)return!1;z[0]=h?.x;z[1]=h?.y;z[2]=h?.z??r??0;return!0}const k=b.create();a.projectPointToVector=g;a.projectPointToVectorAsync= async function(h,z,E,r,w){await d.initializeProjection(h.spatialReference,E,null,w);return g(h,z,E,r)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/dehydratedPoint":function(){define(["exports"],function(a){a.makeDehydratedPoint=function(b,d,l,g){return{x:b,y:d,z:l,hasZ:null!=l,hasM:!1,spatialReference:g,type:"point"}};a.setDehydratedPoint=function(b,d,l,g,k){b.x=d;b.y=l;b.z=g;b.hasZ=null!=g;b.spatialReference=k};Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/geometry/support/geodesicUtils":function(){define("exports ../../geometry ../../core/Error ../../core/unitUtils ./geodesicConstants ./spatialReferenceUtils ../Polyline ../Polygon ../Point ../SpatialReference".split(" "),function(a,b,d,l,g,k,h,z,E,r){function w(p){if(!p)return null;if(k.isGeographic(p)&&p.wkid){var x=g.spheroids[p.wkid];if(x)return x}if(p=p.wkt2||p.wkt)if((p=g.wktSpheroidRegex.exec(p))&&2===p.length?(x=p[1].split(","),!x||3>x.length?p=null:(p=parseFloat(x[1]), x=parseFloat(x[2]),p=isNaN(p)||isNaN(x)?null:{a:p,f:0===x?0:1/x})):p=null,p)return p;return null}function v(p){p=w(p);if(null!=p&&"b"in p&&"eSq"in p&&"radius"in p)return p;const x=p.a*(1-p.f);return Object.assign(p,{b:x,eSq:1-(x/p.a)**2,radius:(2*p.a+x)/3,densificationRatio:1E4/((2*p.a+x)/3)})}function c(p){return null!=p&&0>p?p+360:p}function f(p,x,u){const {a:B,eSq:e}=v(u);u=Math.sqrt(e);const t=Math.sin(x[1]*g.toRadians);x=B*x[0]*g.toRadians;u=0!m(t.spatialReference)))throw new d("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const u=[];for(var B=0;B!m(e.spatialReference)))throw new d("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const u=[];for(let e=0;eu||360{Z=ba[Z];null!=Z&&("geometry"in Z&&null!=Z.geometry&&(la.push({geometry:ia.geometry}),ia.geometry=Z.geometry),"symbol"in Z&&null!=Z.symbol&&(la.push({symbol:ia.symbol}), ia.symbol=Z.symbol),"undo"in Z&&(la.push(Z),Z[J](ia)))});X.push({updates:la})}}function Aa(J){return{updates:J.map(({geometry:U})=>"mesh"===U?.type?{geometry:U.cloneShallow()}:{geometry:U})}}function Y(J){return"requireError"in J&&"aborted"===J.requireError}const da=J=>Object.freeze(Object.defineProperty({__proto__:null,default:J},Symbol.toStringTag,{value:"Module"})),ka={defaultZ:0},qa={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"};k=class extends k.EventedAccessor{constructor(J){super(J);this._numUpdating=0;this._defaultSnappingManager=null;this._internalGraphicsLayer=new C({listMode:"hide",internal:!0,title:"SVM Internal"});this._operationHandle=null;this._viewHandlesKey="viewHandles";this.activeVertexSymbol=this.activeLineSymbol=this.activeFillSymbol=null;this.allowDeleteKey= !0;this.layer=null;this.pointSymbol=new O({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}});this.polygonSymbol=new N({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}});this.polylineSymbol=new T({color:[130,130,130,1],width:2});this.meshSymbol=new aa({symbolLayers:new l([new ha])});this.updateGraphics=new l;this.updateOnGraphicClick=!0;this.vertexSymbol=new O({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}});this.sketchOptions=new I; this._originalPopupEnabled=this._viewReadyAbortController=this._moduleLoaderAbortController=null;this.defaultCreateOptions=ka;this.defaultUpdateOptions=qa;this.snappingOptions=J?.snappingManager?.options??J?.snappingOptions??new K}initialize(){this.addHandles([w.on(()=>this.view?.map?.layers,"change",J=>{J.removed.includes(this.layer)&&this.cancel()}),w.on(()=>this.layer?.graphics,"change",J=>{if(null!=this._operationHandle)for(const U of J.removed)this.updateGraphics.includes(U)&&(1this.layer?.elevationInfo??null,J=>{J!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=J)},w.syncAndInitial),w.watch(()=>this.view,J=>{this._defaultSnappingManager=E.destroyMaybe(this._defaultSnappingManager);J&&(this.snappingManager||(this._defaultSnappingManager=new G.SnappingManager({view:J,options:this.snappingOptions})),"2d"===J.type?new Promise((U,X)=> a(["../../views/2d/interactive/editingTools"],U,X)):"3d"===J.type&&(new Promise((U,X)=>a(["../../views/3d/interactive/editingTools"],U,X)),new Promise((U,X)=>a(["../../views/3d/layers/GraphicsLayerView3D"],W=>U(da(W)),X))))},w.syncAndInitial),w.watch(()=>this.view?.spatialReference,(J,U)=>{J&&U&&!J.equals(U)&&this.cancel()})]);L.setupSnappingToggleHandles(this)}destroy(){this.cancel();this._removeDefaultLayer();this._defaultSnappingManager=E.destroyMaybe(this._defaultSnappingManager);this._set("snappingManager", null);this._set("view",null);this.emit("destroy")}get updating(){return 0J.ready,X=>{this.removeHandles(this._viewHandlesKey);X&&this.addHandles(this._generateViewHandles(J),this._viewHandlesKey)},w.syncAndInitial),"view-ready");this._set("view",J)}cancel(){this._moduleLoaderAbortController=E.abortMaybe(this._moduleLoaderAbortController);this._viewReadyAbortController=E.abortMaybe(this._viewReadyAbortController);this._operationHandle&& this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const {state:J,updateGraphics:U}=this;if("active"===J&&U.length){const {activeTool:X,layer:W}=this,ba=U.toArray();W.removeMany(ba);this.cancel();this._emitDeleteEvent({graphics:ba,tool:X})}}duplicate(){if("active"===this.state&&this.updateGraphics.length){const J=this.updateGraphics.map(U=>U.clone()).toArray();this.layer.addMany(J);this.emit("duplicate",{graphics:J,type:"duplicate"});return J}return[]}async create(J, U){this.cancel();await this._waitViewReady();const {view:X,layer:W}=this;if(!X||"disabled"===this.state)throw W||this._logMissingLayer(),r.createAbortError();null!=X.activeTool&&(X.activeTool=null);if(J){t.addUniqueLayer(X,this._internalGraphicsLayer);var ba=await this._setupCreateOperation(J,U);null==ba||this.destroyed?X.map.remove(this._internalGraphicsLayer):(ba.on("complete",()=>{if(ba===this._operationHandle){const la=this.createGraphic,ia=this._operationHandle.cancelled;this._operationHandle.destroy(); this._operationHandle=null;this._set("createGraphic",null);this.view?.map&&this.view.map.remove(this._internalGraphicsLayer);ba.cancelled||null==la||W.add(la);this.emit("create",{graphic:la,state:ia?"cancel":"complete",tool:J,toolEventInfo:null,type:"create"})}}),this._operationHandle=ba,X.ready&&X.focus())}else this._logError("sketch:missing-parameter","Missing parameter 'tool'.")}async place(J,U){return this.create("mesh",{mode:"click",hasZ:J.hasZ,geometryToPlace:J,...U})}async update(J,U){this.cancel(); await this._waitViewReady();const {layer:X,view:W,state:ba}=this;if(!W||"disabled"===ba)throw X||this._logMissingLayer(),r.createAbortError();null!=W.activeTool&&(W.activeTool=null);const la=Array.isArray(J)?J:[J];null!=J&&la?.length?la.some(ia=>ia.layer!==X?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):null==ia.geometry?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."), !0):!1)||(J=await this._setupUpdateOperation(la,U),this.destroyed||null==J||Y(J)||(t.addUniqueLayer(W,this._internalGraphicsLayer),this._setUpdateOperationHandle(J,U),this.emit("update",{graphics:la,state:"start",aborted:!1,tool:J.tool,toolEventInfo:null,type:"update"}))):this._logError("sketch:missing-parameter","Missing parameter 'graphics'.")}async _updateSpatialReference(J){const U=this.view;if(U){this._beginAsyncOperation();J=Array.isArray(J)?J:[J];for(const X of J)null==X.geometry||"mesh"=== X.geometry.type||A.equals(X.geometry.spatialReference,U.spatialReference)||(n.canProjectWithoutEngine(X.geometry.spatialReference,U.spatialReference)||n.isLoaded()||await n.load(),X.geometry=n.project(X.geometry,U.spatialReference));this._endAsyncOperation()}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(J){var U= this.view;if(!U)return this._logMissingView(),null;if("2d"===U.type){const W=[];U.map.allLayers.forEach(ba=>{"vector-tile"!==ba.type&&"imagery"!==ba.type||W.push(ba)});U=await U.hitTest(J,{exclude:W});return R.findFirstGraphicHit(U.results)}const X=[U.map.ground];U.map.allLayers.forEach(W=>{p.isIntegratedMeshLayer(W.type)&&X.push(W)});J=await U.hitTest(J,{exclude:X});if(0U.map.ground.opacity|| J.ground.distance-(W.distance??0)>-Math.min(3*J.ground.distance,"global"===U.viewingMode?m.getReferenceEllipsoid(U.renderCoordsHelper.spatialReference).radius/U.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return W}return null}_generateViewHandles(J){return[J.on("immediate-click",async U=>{var X="active"===this.state&&"create"===this._operationHandle?.type;if("disabled"!==this.state&&!X&&this.updateOnGraphicClick){this._beginAsyncOperation();var W=await U.async(()=>this._getFirstHit(H.createScreenPointFromEvent(U))); X=null;null!=W?(W=W.graphic,this.updateGraphics.includes(W)||W.layer===this.layer?(U.stopPropagation(),X=W):"2d"!==J.type||this._isComponentGraphic(W)||"active"!==this.state||this.cancel()):"active"===this.state&&this.cancel();null==X||this.updateGraphics.includes(X)||await this.update([X],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}});this._endAsyncOperation()}},F.ViewEventPriorities.WIDGET)]}async _setupCreateOperation(J,U){const X=this.view;if(!X)return this._logMissingView(), null;J=await this._setupDrawGraphicTool(J,X,{hasZ:"3d"===X.type,...this.defaultCreateOptions,...U});if(null==J)return null;X.tools.add(J);X.activeTool=J;return this._setupCreateOperationHandle(J)}async _setupDrawGraphicTool(J,U,X){if("multipoint"===J&&"3d"===U.type)return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!U)return this._logMissingView(),null;const {cursor:W,defaultZ:ba,hasZ:la,geometryToPlace:ia,graphicProperties:Z,mode:ca,preserveAspectRatio:sa}= X;X="rectangle"===J||"circle"===J?"hybrid":"click";const pa=sa??"rectangle"!==J;J={centered:"rectangle"!==J&&!("circle"===J&&!pa),cursor:W,defaultZ:ba,forceUniformSize:pa,graphicProperties:Z,geometryToPlace:ia,geometryType:J,graphicSymbol:this._getGraphicSymbolFromTool(J),hasZ:la,mode:ca??X,snappingManager:this.snappingManager,snapToScene:!1,view:U};return"2d"===U.type?this._makeDrawGraphicTool2D(J):this._makeDrawGraphicTool3D(J)}async _makeDrawGraphicTool2D(J){const U=await this._requireModule(new Promise((X, W)=>a(["../../views/2d/interactive/editingTools"],X,W)));return Y(U)||this.destroyed?null:new U.module.DrawGraphicTool2D({...J,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:ea(J.geometryType)?this.activeFillSymbol:null,sketchOptions:this.sketchOptions})}async _makeDrawGraphicTool3D(J){const U=await this._requireModule(new Promise((W,ba)=>a(["../../views/3d/interactive/editingTools"],W,ba)));if(Y(U)||this.destroyed)return null; const {elevationInfo:X}=this.layer;return new U.module.DrawGraphicTool3D({...J,elevationInfo:X,snapToScene:!0,sketchOptions:this.sketchOptions})}_setupCreateOperationHandle(J){const U=this.view;if(!U)return this._logMissingView(),null;let X=null;const W=J.forceUniformSize,ba=J.centered,la=[U.on("key-down",Z=>{if(Z.key===y.sketchKeys.pan)Z.stopPropagation(),Z.repeat||(J.enabled=!1);else if(Z.key===y.sketchKeys.complete)Z.stopPropagation(),J.completeCreateOperation();else if(Z.key!==y.sketchKeys.vertexAdd|| Z.repeat)Z.key===y.sketchKeys.undo?(Z.stopPropagation(),ia.undo()):Z.key===y.sketchKeys.redo?(Z.stopPropagation(),ia.redo()):Z.key!==y.sketchKeys.constraint||"rectangle"!==J.geometryType&&"circle"!==J.geometryType||Z.repeat?Z.key!==y.sketchKeys.center||Z.repeat||(J.centered=!ba,Z.stopPropagation()):(J.forceUniformSize=!W,Z.stopPropagation());else{const ca=J.drawOperation.geometryType;if("polyline"===ca||"polygon"===ca||"multipoint"===ca)Z.stopPropagation(),J.drawOperation.commitStagedVertex()}},F.ViewEventPriorities.WIDGET), U.on("key-up",Z=>{Z.key===y.sketchKeys.pan?J.enabled=!0:Z.key!==y.sketchKeys.constraint||"rectangle"!==J.geometryType&&"circle"!==J.geometryType?Z.key===y.sketchKeys.center&&(J.centered=ba,Z.stopPropagation()):(J.forceUniformSize=W,Z.stopPropagation())},F.ViewEventPriorities.WIDGET),J.on("vertex-add",Z=>{X=null==X?"start":"active";switch(Z.operation){case "apply":this.emit("create",{graphic:J.graphic,state:X,tool:this.activeTool,toolEventInfo:Z,type:"create"});break;case "undo":this._emitUndoEvent({graphics:[J.graphic], tool:J.geometryType});break;case "redo":this._emitRedoEvent({graphics:[J.graphic],tool:J.geometryType})}}),J.on("cursor-update",Z=>{0{switch(Z.operation){case "apply":this.emit("create",{graphic:J.graphic,state:"active",tool:this.activeTool,toolEventInfo:Z,type:"create"}); break;case "undo":this._emitUndoEvent({graphics:[J.graphic],tool:J.geometryType});break;case "redo":this._emitRedoEvent({graphics:[J.graphic],tool:J.geometryType})}}),J.on("complete",Z=>{this._set("createGraphic",Z.graphic);X="complete";Z.aborted?ia&&ia.cancel():ia&&ia.complete()}),w.watch(()=>this._getGraphicSymbolFromTool(J.geometryType),Z=>{J.graphicSymbol=Z})],ia=new V.CreateOperationHandle({activeComponent:J,tool:J.geometryType,type:"create",onEnd:()=>{la.forEach(Z=>Z.remove());la.length=0;U.tools?.remove(J)}, undo:()=>{J.canUndo&&J.undo()},redo:()=>{J.canRedo&&J.redo()},canUndo:()=>J.canUndo,canRedo:()=>J.canRedo});return ia}_getGraphicSymbolFromTool(J){switch(J){case "point":case "multipoint":return this.pointSymbol;case "polyline":return this.polylineSymbol;case "circle":case "rectangle":case "polygon":return this.polygonSymbol;case "mesh":return this.meshSymbol}}async _setupUpdateOperation(J,U){const {layer:X,view:W}=this;if(!W)return this._logMissingView(),null;U={...this.defaultUpdateOptions,...U, reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...U?.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...U?.highlightOptions}};let ba=U.tool??qa.tool;for(var la of J)X.remove(la),X.add(la);if("3d"===W.type){if(0===J.length)return null;switch(ba){case "move":return this._setupMove3DOperation(J,U,W,ba);case "reshape":return 1a(["../../views/3d/interactive/editingTools"],na,ya)));if(Y(la))return la;const {ManipulatedObject3DGraphic:ia,MoveTool3D:Z}=la.module,ca=new Map,sa=()=>{ca.forEach(na=>na.destroy());ca.clear()};for(const na of J){la=new ia({view:X,graphic:na});const ya=u.isSupportedObject(la);if(ya!==x.SupportedObjectResult.SUPPORTED)return sa(),this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${x.isSupportedObjectResultMessage(ya)}).`), null;ca.set(na,la)}const pa=new Z({view:X,enableZ:U.enableZ,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});X.tools.add(pa);pa.objects.addMany(Array.from(ca.values()));ba||this.updateGraphics.addMany(J);const ta=[],ra=new V.UpdateOperationHandle({activeComponent:pa,tool:W,type:"update",onEnd:()=>{ta.forEach(na=>na.remove());ta.length=0;X.tools?.remove(pa);pa.destroyed||pa.destroy();sa()},undo:()=>{var na=this.view;null!=na&&pa.hasGrabbedManipulators&&(na.activeTool=null);ma(ra, this.updateGraphics.toArray());this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:W})},redo:()=>{wa(ra,this.updateGraphics.toArray());this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:W})},addToSelection:na=>{this.updateGraphics.push(na);const ya=new ia({view:X,graphic:na});ca.set(na,ya);pa.objects.push(ya);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[na],removed:[],type:"selection-change"}, type:"update"})},removeFromSelection:na=>{const ya=this.updateGraphics.indexOf(na);ra.history.undo.forEach(P=>P.updates.splice(ya,1));ra.history.redo.forEach(P=>P.updates.splice(ya,1));this.updateGraphics.remove(na);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[na],type:"selection-change"},type:"update"});if(0===this.updateGraphics.length)ra.complete();else{var ua=ca.get(na);ua&&(pa.objects.remove(ua),ua.destroy(), ca.delete(na))}},toggleTool:async()=>{if(1===this.updateGraphics.length&&!1!==U.toggleToolOnClick&&"transform"===W){var na=this.updateGraphics.at(0);(na=await this._setupReshape3DOperation(na,U,X,!0))&&!Y(na)&&(ra.onEnd(),ra.destroy(),this._setUpdateOperationHandle(na,U))}}});ta.push(...this._getHandlesForComponent(ra,U),X.on("immediate-click",na=>this._getCommonUpdateOperationClickHandlers(ra,na,U),F.ViewEventPriorities.WIDGET),X.on("key-down",na=>{this._getCommonUpdateOperationKeyDownHandlers(ra, na)},F.ViewEventPriorities.WIDGET));return ra}_setupGraphicTransform3DOperation(J,U,X,W=!1){if(1===J.length&&e.isSupportedGraphic(J[0])===x.SupportedObjectResult.SUPPORTED){const ba=J[0],la=ba.geometry;if(null!=la&&("point"===la.type||"mesh"===la.type))return this._setupPointTransform3DOperation(ba,U,X);if(null!=la&&("polygon"===la.type||"polyline"===la.type))return this._setupPolyTransform3DOperation(ba,U,X,W)}return this._setupMove3DOperation(J,U,X,"transform",W)}async _setupPointTransform3DOperation(J, U,X){const {enableRotation:W,enableScaling:ba,enableZ:la}=U,ia=await this._requireModule(new Promise((na,ya)=>a(["../../views/3d/interactive/editingTools"],na,ya)));if(Y(ia))return ia;const {TransformTool3D:Z,ManipulatedObject3DGraphic:ca}=ia.module,sa=new ca({graphic:J,view:X}),pa=new Z({object:sa,view:X,enableRotation:W,enableScaling:ba,enableZ:la,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});X.tools.add(pa);this.updateGraphics.add(J);const ta=[],ra=new V.UpdateOperationHandle({activeComponent:pa, tool:"transform",type:"update",onEnd:()=>{ta.forEach(na=>na.remove());ta.length=0;X.tools?.remove(pa);pa.destroyed||pa.destroy();sa.destroy()},undo:()=>{var na=this.view;null!=na&&pa.hasGrabbedManipulators&&(na.activeTool=null);ma(ra,this.updateGraphics.toArray());this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:"transform"})},redo:()=>{wa(ra,this.updateGraphics.toArray());this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:"transform"})},addToSelection:async na=>{this.updateGraphics.add(na); this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[na],removed:[],type:"selection-change"},type:"update"});ra.onEnd();ra.destroy();na=await this._setupMove3DOperation(this.updateGraphics.toArray(),U,X,"transform",!0);Y(na)||this._setUpdateOperationHandle(na,U)},removeFromSelection:na=>{this.updateGraphics.remove(na);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool, toolEventInfo:{added:[],removed:[na],type:"selection-change"},type:"update"});ra.complete()},toggleTool:()=>{}});ta.push(...this._getHandlesForComponent(ra,U),X.on("immediate-click",na=>this._getCommonUpdateOperationClickHandlers(ra,na,U),F.ViewEventPriorities.WIDGET),X.on("key-down",na=>{this._getCommonUpdateOperationKeyDownHandlers(ra,na)},F.ViewEventPriorities.WIDGET));return ra}async _setupPolyTransform3DOperation(J,U,X,W=!1){const {enableRotation:ba,enableScaling:la,enableZ:ia,preserveAspectRatio:Z}= U;var ca=await this._requireModule(new Promise((ua,P)=>a(["../../views/3d/interactive/editingTools"],ua,P)));if(Y(ca))return ca;const {ManipulatedObject3DGraphic:sa,ExtentTransformTool:pa}=ca.module;ca=this.view?.inputManager?.isModifierKeyDown(y.sketchKeys.constraint);const ta=new sa({view:X,graphic:J}),ra=new pa({object:ta,view:X,enableRotation:ba,enableScaling:la,enableZ:ia,preserveAspectRatio:!!Z!==!!ca,sketchOptions:this.sketchOptions});X.tools.add(ra);W||this.updateGraphics.add(J);const na= [],ya=new V.UpdateOperationHandle({activeComponent:ra,tool:"transform",type:"update",onEnd:()=>{na.forEach(ua=>ua.remove());na.length=0;X.tools?.remove(ra);ra.destroyed||ra.destroy();ta.destroy()},canUndo:()=>ra.canUndo,undo:()=>{ra.undo();this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:"transform"})},canRedo:()=>ra.canRedo,redo:()=>{ra.redo();this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:"transform"})},addToSelection:async ua=>{this.updateGraphics.add(ua);this.emit("update", {graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[ua],removed:[],type:"selection-change"},type:"update"});ya.onEnd();ya.destroy();ua=await this._setupMove3DOperation(this.updateGraphics.toArray(),U,X,"transform",!0);Y(ua)||this._setUpdateOperationHandle(ua,U)},removeFromSelection:ua=>{this.updateGraphics.remove(ua);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[], removed:[ua],type:"selection-change"},type:"update"});ya.complete()},toggleTool:async()=>{if(1===this.updateGraphics.length&&!1!==U.toggleToolOnClick){var ua=await this._setupReshape3DOperation(J,U,X,!0);ua&&!Y(ua)&&(ya.onEnd(),ya.destroy(),this._setUpdateOperationHandle(ua,U))}}});na.push(...this._getHandlesForComponent(ya,U),X.on("immediate-click",ua=>this._getCommonUpdateOperationClickHandlers(ya,ua,U),F.ViewEventPriorities.WIDGET),X.on("key-down",ua=>this._getCommonUpdateOperationKeyDownHandlers(ya, ua),F.ViewEventPriorities.WIDGET),X.on("key-down",ua=>{ua.key!==y.sketchKeys.constraint||ua.repeat||(ra.preserveAspectRatio=!ra.preserveAspectRatio,ua.stopPropagation())},F.ViewEventPriorities.WIDGET),X.on("key-up",ua=>{ua.key===y.sketchKeys.constraint&&(ra.preserveAspectRatio=!ra.preserveAspectRatio,ua.stopPropagation())},F.ViewEventPriorities.WIDGET));return ya}async _setupMove2DOperation(J,U,X){this.updateGraphics.addMany(J);await this._updateSpatialReference(J);const W=await this._getGraphicMover(J, U,X);if(Y(W))return W;const ba=new V.UpdateOperationHandle({activeComponent:W,tool:"move",type:"update",onEnd:()=>{this._displayDefaultCursor();Z.forEach(ca=>ca.remove());ia.forEach(ca=>ca.remove());Z=[];ia=[];W.destroy();this._internalGraphicsLayer?.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const ca=this.updateGraphics.toArray();ma(ba,ca);ba.refreshComponent();this._emitUndoEvent({graphics:ca,tool:"move"})},redo:()=>{const ca=this.updateGraphics.toArray();wa(ba,ca);ba.refreshComponent(); this._emitRedoEvent({graphics:ca,tool:"move"})},addToSelection:async ca=>{await this._updateSpatialReference(ca);this.updateGraphics.push(ca);W.graphics=this.updateGraphics.toArray();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[ca],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:ca=>{const sa=this.updateGraphics.indexOf(ca);ba.history.undo.forEach(ta=>ta.updates.splice(sa,1));ba.history.redo.forEach(ta=> ta.updates.splice(sa,1));this.updateGraphics.remove(ca);const pa=this.updateGraphics.toArray();this.emit("update",{graphics:pa,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[ca],type:"selection-change"},type:"update"});0===this.updateGraphics.length?ba.complete():W.graphics=pa}});let la=!1,ia=[X.on("immediate-click",ca=>this._getCommonUpdateOperationClickHandlers(ba,ca,U),F.ViewEventPriorities.WIDGET),X.on("key-down",ca=>{this._getCommonUpdateOperationKeyDownHandlers(ba, ca);ca.key!==y.sketchKeys.constraint||ca.repeat||(la=!0,W.enableMoveAllGraphics=!W.enableMoveAllGraphics)},F.ViewEventPriorities.WIDGET),X.on("key-up",ca=>{ca.key===y.sketchKeys.constraint&&la&&(la=!1,W.enableMoveAllGraphics=!W.enableMoveAllGraphics)},F.ViewEventPriorities.WIDGET)],Z=this._getHandlesForComponent(ba,U);return ba}async _setupReshape3DOperation(J,U,X,W=!1){const ba=await this._requireModule(new Promise((ta,ra)=>a(["../../views/3d/interactive/editingTools"],ta,ra)));if(Y(ba))return ba; const {ManipulatedObject3DGraphic:la,ReshapeTool3D:ia}=ba.module,Z=new la({view:X,graphic:J});J=B.isSupportedObject(Z);if(J!==x.SupportedObjectResult.SUPPORTED)return Z.destroy(),this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${x.isSupportedObjectResultMessage(J)}).`),null;J=U.reshapeOptions;const ca=new ia({view:X,object:Z,enableZVertex:U.enableZ&&"move"===J?.vertexOperation,enableZShape:U.enableZ&&"move"===J?.shapeOperation,enableMoveObject:"move"===J?.shapeOperation|| "move-xy"===J?.shapeOperation,enableMidpoints:"split"===J?.edgeOperation,enableEdgeOffset:"offset"===J?.edgeOperation,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions});X.tools.add(ca);W||this.updateGraphics.add(Z.graphic);const sa=[],pa=new V.UpdateOperationHandle({activeComponent:ca,tool:"reshape",type:"update",onEnd:()=>{sa.forEach(ta=>ta.remove());sa.length=0;X.tools?.remove(ca);ca.destroyed||ca.destroy();Z.destroy()},canUndo:()=>ca.canUndo,undo:()=>{ca.undo();this._emitUndoEvent({graphics:this.updateGraphics.toArray(), tool:"reshape"})},canRedo:()=>ca.canRedo,redo:()=>{ca.redo();this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:"reshape"})},addToSelection:async ta=>{this.updateGraphics.add(ta);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[ta],removed:[],type:"selection-change"},type:"update"});pa.onEnd();pa.destroy();ta=await this._setupMove3DOperation(this.updateGraphics.toArray(),U,X,"transform",!0);Y(ta)||this._setUpdateOperationHandle(ta, U)},removeFromSelection:ta=>{this.updateGraphics.remove(ta);this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[ta],type:"selection-change"},type:"update"});pa.complete()},toggleTool:async()=>{if(!1!==U.toggleToolOnClick){pa.onEnd();pa.destroy();var ta=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),U,X,!0);Y(ta)||this._setUpdateOperationHandle(ta,U)}}});sa.push(...this._getHandlesForComponent(pa, U),X.on("immediate-click",ta=>this._getCommonUpdateOperationClickHandlers(pa,ta,U),F.ViewEventPriorities.WIDGET),X.on("key-down",ta=>{this._getCommonUpdateOperationKeyDownHandlers(pa,ta)},F.ViewEventPriorities.WIDGET));return pa}async _setupTransformOrReshape2DOperation(J,U,X,W){this.updateGraphics.addMany(J);await this._updateSpatialReference(J);J="transform"===U?await this._getBox(J,X,W):await this._getReshape(J,X,W);if(Y(J))return J;const ba=new V.UpdateOperationHandle({activeComponent:J,type:"update", onEnd:()=>{ia.forEach(Z=>Z.remove());la.forEach(Z=>Z.remove());ia=[];la=[];ba.activeComponent&&!ba.activeComponent.destroyed&&ba.activeComponent.destroy();this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{ma(ba,this.updateGraphics.toArray());ba.refreshComponent();this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:ba.tool})},redo:()=>{wa(ba,this.updateGraphics.toArray());ba.refreshComponent();this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:ba.tool})}, addToSelection:async Z=>{var ca=ba.activeComponent;if("reshape"===ca?.type){ca=[...this.updateGraphics,Z];this.updateGraphics.removeAll();ba.onEnd();ba.destroy();ca=await this._setupTransformOrReshape2DOperation(ca,"transform",X,W);if(Y(ca))return;this._setUpdateOperationHandle(ca,X)}else this.updateGraphics.add(Z),ca.graphics=this.updateGraphics.toArray(),ca.refresh(),ba.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[Z], removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async Z=>{const ca=this.updateGraphics.indexOf(Z);ba.history.undo.forEach(pa=>pa.updates.splice(ca,1));ba.history.redo.forEach(pa=>pa.updates.splice(ca,1));this.updateGraphics.remove(Z);const sa=this.updateGraphics.toArray();if(0===sa.length)ba.complete();else{const pa=sa[0].geometry;1!==sa.length||null==pa||"point"!==pa.type&&"multipoint"!==pa.type?ba.activeComponent.graphics=sa:ba.toggleTool()}this.emit("update",{graphics:sa, state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[Z],type:"selection-change"},type:"update"})},toggleTool:async()=>{if(!(1sa.remove()),ia=this._getHandlesForComponent(ba,X)))}}});let la=[W.on("immediate-click",Z=>this._getCommonUpdateOperationClickHandlers(ba,Z,X),F.ViewEventPriorities.WIDGET),W.on("key-down",Z=>{this._getCommonUpdateOperationKeyDownHandlers(ba,Z);Z.key===y.sketchKeys.constraint&&!Z.repeat&&ba&&(Z=ba.activeComponent)&&"box"===Z.type&&(Z.preserveAspectRatio=!Z.preserveAspectRatio)},F.ViewEventPriorities.WIDGET),W.on("key-up",Z=>{Z.key===y.sketchKeys.constraint&& ba&&(Z=ba.activeComponent)&&"box"===Z.type&&(Z.preserveAspectRatio=!Z.preserveAspectRatio)},F.ViewEventPriorities.WIDGET)],ia=this._getHandlesForComponent(ba,X);return ba}async _getGraphicMover(J,U,X){const {enableMoveAllGraphics:W,highlightOptions:ba}=U;U=await this._requireModule(new Promise((la,ia)=>a(["../../views/draw/support/GraphicMover"],Z=>la(da(Z)),ia)));return Y(U)?U:new U.module.default({enableMoveAllGraphics:W,highlightsEnabled:!!ba?.enabled,indicatorsEnabled:!1,graphics:J,view:X,callbacks:{onGraphicMoveStart:({dx:la, dy:ia,graphic:Z})=>{this._displayGrabbingCursor();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:la,dy:ia,mover:Z,type:"move-start"},type:"update"})},onGraphicMove:({dx:la,dy:ia,graphic:Z})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:la,dy:ia,mover:Z,type:"move"},type:"update"}),onGraphicMoveStop:({dx:la,dy:ia,graphic:Z})=>{this._displayPointerCursor(); this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:la,dy:ia,mover:Z,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(J,U,X){const {enableRotation:W,enableScaling:ba,highlightOptions:la,preserveAspectRatio:ia}=U;U=await this._requireModule(new Promise((ca,sa)=>a(["../../views/draw/support/Box"],pa=>ca(da(pa)),sa)));if(Y(U))return U; const Z=this.view?.inputManager?.isModifierKeyDown(y.sketchKeys.constraint);return new U.module.default({graphics:J,enableRotation:W,enableScaling:ba,highlightsEnabled:!!la?.enabled,preserveAspectRatio:!!ia!==!!Z,layer:this._internalGraphicsLayer,view:X,sketchOptions:this.sketchOptions,callbacks:{onMoveStart:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onMove:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(), state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onMoveStop:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onScaleStart:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onScale:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1, tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onScaleStop:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onRotateStart:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"}),onRotate:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca}, type:"update"}),onRotateStop:ca=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ca},type:"update"})}})}async _getReshape(J,U,X){const W="split"===U.reshapeOptions?.edgeOperation,ba="move"===U.reshapeOptions?.shapeOperation;U=!!U.highlightOptions?.enabled;const la=await this._requireModule(new Promise((ia,Z)=>a(["../../views/draw/support/Reshape"],ca=>ia(da(ca)),Z)));return Y(la)?la:new la.module.default({enableMidpoints:W, enableMovement:ba,graphic:J[0],highlightsEnabled:U,layer:this._internalGraphicsLayer,snappingManager:this.snappingManager,sketchOptions:this.sketchOptions,view:X,callbacks:{onReshapeStart:ia=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ia},type:"update"}),onReshape:ia=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...ia},type:"update"}),onReshapeStop:({mover:ia, type:Z})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:ia,type:Z},type:"update"}),onMoveStart:({dx:ia,dy:Z,mover:ca,type:sa})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:ia,dy:Z,mover:ca,type:sa},type:"update"}),onMove:({dx:ia,dy:Z,mover:ca,type:sa})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool, toolEventInfo:{dx:ia,dy:Z,mover:ca,type:sa},type:"update"}),onMoveStop:({dx:ia,dy:Z,mover:ca,type:sa})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:ia,dy:Z,mover:ca,type:sa},type:"update"}),onVertexAdd:({added:ia,type:Z,vertices:ca})=>{ia=ia.map(sa=>q.geometryToCoordinates(sa.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:ia,vertices:ca, type:Z},type:"update"})},onVertexRemove:({removed:ia,type:Z,vertices:ca})=>{ia=ia.map(sa=>q.geometryToCoordinates(sa.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:ia,vertices:ca,type:Z},type:"update"})}}})}_getHandlesForComponent(J,U){const X=J.activeComponent;if(!X)return[];switch(X.type){case "graphic-mover":return[X.on("graphic-click",({graphic:W,viewEvent:ba})=>{ba.native?.shiftKey&&(ba.stopPropagation(), J.removeFromSelection(W))}),X.on("graphic-move-start",W=>J.addToHistory(Aa(W.allGraphics)))];case "box":return[X.on("graphic-click",W=>this._onTransformOrReshape2DGraphicClick(J,U,W)),X.on("move-start",W=>J.addToHistory(Aa(W.graphics))),X.on("rotate-start",W=>J.addToHistory(Aa(W.graphics))),X.on("scale-start",W=>J.addToHistory(Aa(W.graphics)))];case "reshape":return[X.on("graphic-click",W=>this._onTransformOrReshape2DGraphicClick(J,U,W)),X.on("move-start",W=>J.addToHistory(Aa([W.mover]))),X.on("reshape-start", W=>J.addToHistory(Aa([W.graphic]))),X.on("vertex-add",W=>J.addToHistory(Aa([W.oldGraphic]))),X.on("vertex-remove",W=>J.addToHistory(Aa([W.oldGraphic])))];case "move-3d":return[X.events.on("record-undo",({updates:W})=>{J.addToHistory({updates:W})}),X.events.on("move-start",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:0{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:W.dx,dy:W.dy,mover:0{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:0 {W.shiftKey?this._toggleSelection([W.object.graphic],J,U):J.toggleTool()})];case "transform-3d":return[X.events.on("record-undo",({updates:W})=>{J.addToHistory({updates:W})}),X.events.on("translate-start",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,dx:W.dxScreen,dy:W.dyScreen,type:"move-start"},type:"update"})}),X.events.on("translate-stop",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(), state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,dx:W.dxScreen,dy:W.dyScreen,type:"move-stop"},type:"update"})}),X.events.on("rotate-start",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,angle:W.angle,type:"rotate-start"},type:"update"})}),X.events.on("rotate-stop",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool, toolEventInfo:{mover:W.object.graphic,angle:W.angle,type:"rotate-stop"},type:"update"})}),X.events.on("scale-start",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,xScale:W.xScale,yScale:W.yScale,type:"scale-start"},type:"update"})}),X.events.on("scale-stop",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic, xScale:W.xScale,yScale:W.yScale,type:"scale-stop"},type:"update"})}),X.events.on("translate",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,dx:W.dxScreen,dy:W.dyScreen,type:"move"},type:"update"})}),X.events.on("rotate",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,angle:W.angle,type:"rotate"},type:"update"})}), X.events.on("scale",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:W.object.graphic,xScale:W.xScale,yScale:W.yScale,type:"scale"},type:"update"})}),X.events.on("immediate-click",W=>{W.shiftKey?this._toggleSelection([W.object.graphic],J,U):J.toggleTool()})];case "reshape-3d":return[X.events.on("reshape",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...W, mover:W.object.graphic},type:"update"})}),X.events.on("move",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...W,mover:W.object.graphic},type:"update"})}),X.events.on("vertex-add",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:W,type:"update"})}),X.events.on("vertex-remove",W=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active", aborted:!1,tool:this.activeTool,toolEventInfo:W,type:"update"})}),X.events.on("immediate-click",W=>{W.shiftKey?this._toggleSelection([W.object.graphic],J,U):J.toggleTool()})]}}_onTransformOrReshape2DGraphicClick(J,U,X){const {graphic:W,viewEvent:ba}=X;if(ba.native?.shiftKey&&W.layer===this.layer)return ba.stopPropagation(),J.removeFromSelection(W);if(U.toggleToolOnClick)return ba.stopPropagation(),J.toggleTool()}_setUpdateOperationHandle(J,U){this._operationHandle=J;const X=this.view?.map;this._disablePopup(U); J.on("complete",()=>{if(J===this._operationHandle){const W=this.updateGraphics.toArray(),ba=this._operationHandle.tool;this._operationHandle.destroy();this._operationHandle=null;this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray());this.updateGraphics.removeAll();X&&X.remove(this._internalGraphicsLayer);this._restorePopup(U);this.emit("update",{graphics:W,state:"complete",aborted:J.cancelled,tool:ba,toolEventInfo:null,type:"update"})}})}async _getCommonUpdateOperationClickHandlers(J, U,X){const W=H.createScreenPointFromEvent(U),ba=await U.async(()=>this._getFirstHit(W));null==ba?J.complete():U.native.shiftKey&&this._toggleSelection([ba.graphic],J,X)?U.stopPropagation():this.updateGraphics.includes(ba.graphic)?U.stopPropagation():J.complete()}_toggleSelection(J,U,X){const W=!!X.multipleSelectionEnabled;return J.some(ba=>null==ba?!1:W&&ba.layer===this.layer?(this.updateGraphics.includes(ba)?U.removeFromSelection(ba):U.addToSelection(ba),!0):!1)}_getCommonUpdateOperationKeyDownHandlers(J, U){if(J){var X=U.key;X===y.sketchKeys.undo&&J.canUndo()?(U.stopPropagation(),J.undo()):X===y.sketchKeys.redo&&J.canRedo()?(U.stopPropagation(),J.redo()):X===y.sketchKeys.cancel?(U.stopPropagation(),J.cancel()):this.allowDeleteKey&&y.sketchKeys.delete.includes(X)&&this._onDeleteKey(U)}}_onDeleteKey(J){if(this._operationHandle&&"update"===this._operationHandle.type){var U=this.activeComponent,X=this.updateGraphics.toArray();null!=U&&("reshape"!==U.type||1===X.length&&"point"===X[0].geometry?.type)&& (J.stopPropagation(),this.delete())}}_removeDefaultLayer(){this._internalGraphicsLayer&&(this.view?.map?.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=E.destroyMaybe(this._internalGraphicsLayer))}_isComponentGraphic(J){const {activeComponent:U}=this;return J&&null!=U?J.attributes?.esriSketchTool||"draw-2d"===U.type&&U.graphic===J||("box"===U.type||"reshape"===U.type)&&U.isUIGraphic(J):!1}_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(J,U,X){z.getLogger(this).error(new g(J,U,X))}async _requireModule(J){const U=new AbortController;this._moduleLoaderAbortController=U;J=await J;return this._moduleLoaderAbortController!==U||U.signal.aborted?{requireError:"aborted"}:{module:J}}_emitUndoEvent(J){this.emit("undo", {...J,type:"undo"})}_emitRedoEvent(J){this.emit("redo",{...J,type:"redo"})}_emitDeleteEvent(J){this.emit("delete",{...J,type:"delete"})}get test(){}wait(){return w.whenOnce(()=>!this.updating)}_beginAsyncOperation(){this._numUpdating+=1;this.notifyChange("updating")}_endAsyncOperation(){--this._numUpdating;this.notifyChange("updating")}_disablePopupEnabled(J){return"3d"!==this.view?.type||this.updateOnGraphicClick||(J?.toggleToolOnClick??!1)}_disablePopup(J){this._disablePopupEnabled(J)&&this.view&& null==this._originalPopupEnabled&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(J){this._disablePopupEnabled(J)&&this.view&&null!=this._originalPopupEnabled&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const J=this.view;J?(E.abortMaybe(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await r.whenOrAbort(w.whenOnce(()=>J?.ready),this._viewReadyAbortController.signal)): this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",xa("view"))}_logMissingLayer(){this._logError("sketch:missing-property",xa("layer"))}};b.__decorate([v.property()],k.prototype,"_defaultSnappingManager",void 0);b.__decorate([v.property()],k.prototype,"updating",null);b.__decorate([v.property()],k.prototype,"_operationHandle",void 0);b.__decorate([v.property({readOnly:!0})],k.prototype,"activeTool",null);b.__decorate([v.property()],k.prototype,"activeFillSymbol",void 0); b.__decorate([v.property()],k.prototype,"activeLineSymbol",void 0);b.__decorate([v.property()],k.prototype,"activeVertexSymbol",void 0);b.__decorate([v.property()],k.prototype,"allowDeleteKey",void 0);b.__decorate([v.property({readOnly:!0})],k.prototype,"createGraphic",null);b.__decorate([v.property()],k.prototype,"defaultCreateOptions",null);b.__decorate([v.property()],k.prototype,"defaultUpdateOptions",null);b.__decorate([v.property({type:D,nonNullable:!0})],k.prototype,"labelOptions",null);b.__decorate([v.property()], k.prototype,"layer",void 0);b.__decorate([v.property({types:d.symbolTypes})],k.prototype,"pointSymbol",void 0);b.__decorate([v.property({types:d.symbolTypes})],k.prototype,"polygonSymbol",void 0);b.__decorate([v.property({types:d.symbolTypes})],k.prototype,"polylineSymbol",void 0);b.__decorate([v.property()],k.prototype,"meshSymbol",void 0);b.__decorate([v.property({type:K,nonNullable:!0})],k.prototype,"snappingOptions",null);b.__decorate([v.property()],k.prototype,"snappingManager",null);b.__decorate([v.property({readOnly:!0})], k.prototype,"state",null);b.__decorate([v.property({type:S,nonNullable:!0})],k.prototype,"tooltipOptions",null);b.__decorate([v.property({readOnly:!0})],k.prototype,"updateGraphics",void 0);b.__decorate([v.property()],k.prototype,"updateOnGraphicClick",void 0);b.__decorate([v.property({type:M,nonNullable:!0})],k.prototype,"valueOptions",null);b.__decorate([v.property({types:d.symbolTypes})],k.prototype,"vertexSymbol",void 0);b.__decorate([v.property({value:null})],k.prototype,"view",null);b.__decorate([v.property({constructOnly:!0, type:I})],k.prototype,"sketchOptions",void 0);k=b.__decorate([f.subclass("esri.widgets.Sketch.SketchViewModel")],k);const xa=J=>`Property '${J}' is missing on SketchViewModel.`;return k})},"esri/layers/GraphicsLayer":function(){define("../chunks/tslib.es6 ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../core/support/OwningCollection ./Layer ./mixins/BlendLayer ./mixins/ScaleRangeLayer ../support/GraphicsCollection ../symbols/support/ElevationInfo".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v){d=class extends E.BlendLayer(r.ScaleRangeLayer(z)){constructor(c){super(c);this.elevationInfo=null;this.graphics=new w.GraphicsCollection;this.screenSizePerspectiveEnabled=!0;this.type="graphics";this.internal=!1}destroy(){this.removeAll();this.graphics.destroy()}add(c){this.graphics.add(c);return this}addMany(c){this.graphics.addMany(c);return this}removeAll(){this.graphics.removeAll();return this}remove(c){this.graphics.remove(c)}removeMany(c){this.graphics.removeMany(c)}on(c, f){return super.on(c,f)}graphicChanged(c){this.emit("graphic-update",c)}};a.__decorate([b.property({type:v})],d.prototype,"elevationInfo",void 0);a.__decorate([b.property(h.owningCollectionProperty(w.GraphicsCollection,"graphics"))],d.prototype,"graphics",void 0);a.__decorate([b.property({type:["show","hide"]})],d.prototype,"listMode",void 0);a.__decorate([b.property()],d.prototype,"screenSizePerspectiveEnabled",void 0);a.__decorate([b.property({readOnly:!0})],d.prototype,"type",void 0);a.__decorate([b.property({constructOnly:!0})], d.prototype,"internal",void 0);return d=a.__decorate([k.subclass("esri.layers.GraphicsLayer")],d)})},"esri/views/3d/interactive/editingTools/isSupportedObjectUtils":function(){define(["exports","../../../../core/has"],function(a,b){a.SupportedObjectResult=void 0;(function(d){d[d.SUPPORTED=0]="SUPPORTED";d[d.GRAPHICS_LAYER_MISSING=1]="GRAPHICS_LAYER_MISSING";d[d.GEOMETRY_MISSING=2]="GEOMETRY_MISSING";d[d.GEOMETRY_TYPE_UNSUPPORTED=3]="GEOMETRY_TYPE_UNSUPPORTED";d[d.ELEVATION_MODE_UNSUPPORTED=4]="ELEVATION_MODE_UNSUPPORTED"; d[d.SYMBOL_TYPE_UNSUPPORTED=5]="SYMBOL_TYPE_UNSUPPORTED"})(a.SupportedObjectResult||(a.SupportedObjectResult={}));a.isSupportedObjectResultMessage=function(d){switch(d){case a.SupportedObjectResult.GRAPHICS_LAYER_MISSING:return"not owned by a graphics layer";case a.SupportedObjectResult.GEOMETRY_MISSING:return"no geometry";case a.SupportedObjectResult.GEOMETRY_TYPE_UNSUPPORTED:return"the geometry type is not supported";case a.SupportedObjectResult.ELEVATION_MODE_UNSUPPORTED:return"the elevation mode is not supported"; case a.SupportedObjectResult.SYMBOL_TYPE_UNSUPPORTED:return"the symbol type is not supported"}return""};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/interactive/editingTools/move/isSupportedObject":function(){define(["exports","../../../../../core/has","../../../../../support/elevationInfoUtils","../isSupportedObjectUtils"],function(a,b,d,l){a.isSupportedObject=function(g){if(g.graphic&&"graphics"!==g.graphic.layer?.type)return l.SupportedObjectResult.GRAPHICS_LAYER_MISSING; const k=g.operations?.data.type;if(!k)return l.SupportedObjectResult.GEOMETRY_TYPE_UNSUPPORTED;switch(k){case "polygon":case "point":case "polyline":case "mesh":break;default:return l.SupportedObjectResult.GEOMETRY_TYPE_UNSUPPORTED}return d.hasEffectiveFeatureExpressionInfo(g.elevationInfo)?l.SupportedObjectResult.ELEVATION_MODE_UNSUPPORTED:l.SupportedObjectResult.SUPPORTED};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/support/elevationInfoUtils":function(){define(["exports", "../core/unitUtils","../symbols/support/unitConversionUtils"],function(a,b,d){function l(q,A){return A?.mode?A.mode:(q?m:n).mode}function g(q,A){return null!=A?A:q?m:n}function k(q,A){return l(null!=q?q.hasZ:!1,A)}function h(q){const A=r(q);q=k(q.geometry,A);const C=null!=A&&"on-the-ground"!==q?f(A):0;return{mode:q,offset:C,featureExpressionInfo:A?.featureExpressionInfo}}function z(q){return"0"===q?.featureExpressionInfo?.expression}function E(q){if(!q||"on-the-ground"===q.mode)return!1;q=q?.featureExpressionInfo? q.featureExpressionInfo.expression:null;return!(!q||"0"===q)}function r(q){return q.layer&&"elevationInfo"in q.layer?q.layer.elevationInfo:null}function w(q,A){if(!q?.offset)return 0;const {offset:C,unit:p}=q;if("decimal-degrees"===p)return 0;q="unknown"!==p&&p?p:"meters";return(A=b.verticalLengthUnitFromSpatialReference(A))?b.convertUnit(C,q,A):0}function v(q,A,C,p,x,u,B=null){if(null!=u){var e=null!=B?B.mode:"absolute-height";if("on-the-ground"===e)return 0;({absoluteZ:u}=c(A,C,p,x,q,u));a:{B=w(B, x);switch(e){case "absolute-height":q=u-B;break a;case "relative-to-ground":q=u-((q.elevationProvider.getElevation(A,C,p,x,"ground")??0)+B);break a;case "relative-to-scene":q=u-((q.elevationProvider.getElevation(A,C,p,x,"scene")??0)+B);break a}q=void 0}return q}}function c(q,A,C,p,x,u){const B=w(u,p);switch(u.mode){case "absolute-height":return{absoluteZ:C+B,elevation:0};case "on-the-ground":return C=x.elevationProvider.getElevation(q,A,0,p,"ground")??0,{absoluteZ:C,elevation:C};case "relative-to-ground":return q= x.elevationProvider.getElevation(q,A,C,p,"ground")??0,{absoluteZ:C+q+B,elevation:q};case "relative-to-scene":return q=x.elevationProvider.getElevation(q,A,C,p,"scene")??0,{absoluteZ:C+q+B,elevation:q}}}function f(q){return(q?.offset??0)*d.getMetersPerUnit(q?.unit)}const m={mode:"absolute-height",offset:0},n={mode:"on-the-ground",offset:null};a.absoluteHeightElevationInfo=m;a.elevationContextAffectsAlignment=function(q,A){if(null==A)return!1;({mode:A}=A);return null!=A&&("scene"===q&&"relative-to-scene"=== A||"ground"===q&&"absolute-height"!==A)};a.elevationModeRequiredMessage=function(q,A,C){return C&&C.mode!==A?`${q} only support ${A} elevation mode`:null};a.elevationModeUnsupportedMessage=function(q,A,C){return C?.mode===A?`${q} do not support ${A} elevation mode`:null};a.featureExpressionInfoIsZero=z;a.featureExpressionUnsupportedMessage=function(q,A){return null!=A?.featureExpressionInfo&&"0"!==A.featureExpressionInfo.expression?`${q} do not support featureExpressionInfo`:null};a.getConvertedElevation= function(q,A,C,p=null){return v(q,A.x,A.y,A.hasZ?A.z:0,A.spatialReference,C,p)};a.getConvertedElevationFromVector=function(q,A,C,p,x=null){return v(q,A[0],A[1],2"object"===h.type)?"on-the-ground"!==d.getGraphicEffectiveElevationMode(g)&&d.hasGraphicFeatureExpressionInfo(g)?l.SupportedObjectResult.ELEVATION_MODE_UNSUPPORTED: l.SupportedObjectResult.SUPPORTED:l.SupportedObjectResult.SYMBOL_TYPE_UNSUPPORTED};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/draw/support/layerUtils":function(){define(["exports"],function(a){a.addUniqueLayer=function(b,d,l){if(d&&b?.map){({map:b}=b);var g=b.layers.find(k=>k===d);g||b.add(d,l);g&&null!=l&&b.layers.reorder(g,l)}};a.findLayerView=function(b,d){const l="subtype-sublayer"===d?.type?d.parent:d;return b.allLayerViews.find(g=>{g=g.layer;return g===l||"sublayers"in g&&null!=g.sublayers&&g.sublayers.includes(l)})};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/keybindings":function(){define("exports ../../core/arrayUtils ../../core/handleUtils ../../core/MapUtils ../input/InputManager ../input/keys".split(" "),function(a,b,d,l,g,k){k={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight", modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:k.primaryKey,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:"z",redo:"r"};class h{constructor(){this._bindings=new Map}add(E,r){return this.addToggle(E,w=>{"key-down"===w.type&&r(w)})}addToggle(E,r){const w=z.fromDefinition(E,r),v=l.getOrCreateMapValue(this._bindings,w.key, ()=>[]);v.push(w);return d.makeHandle(()=>b.remove(v,w))}register(E,r=g.ViewEventPriorities.WIDGET){return d.handlesGroup([E.on("key-down",w=>this.dispatch(E.inputManager,w),r),E.on("key-up",w=>this.dispatch(E.inputManager,w),r)])}dispatch(E,r){const w=this._bindings.get(r.key);if(w)for(const v of w)v.process(E,r)}}class z{constructor(E,r,w,v,c){this.key=E;this.modifiers=r;this.repeats=w;this.continuePropagation=v;this.callback=c}process(E,r){if(!(r.key!==this.key||"repeat"in r&&r.repeat&&!this.repeats)){for(const w of this.modifiers)if(!E.isModifierKeyDown(w))return; this.continuePropagation||r.stopPropagation();this.callback(r)}}static fromDefinition(E,r){if("string"===typeof E)return new z(E,[],!1,!1,r);const {key:w,modifier:v,repeats:c,continuePropagation:f}=E;return new z(w,v?Array.isArray(v)?v:[v]:[],!!c,!!f,r)}}a.KeyBindings=h;a.mediaKeys=k;a.sketchKeys={redo:"r",undo:"z",center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "};a.snappingKeys={toggle:"Control"};a.tooltipKeys={enterInputMode:"Tab", commit:"Enter",discard:"Escape",next:"Tab"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/sketch/SketchLabelOptions":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,d,l,g,k,h){b=class extends b{constructor(z){super(z);this.enabled=!1}};a.__decorate([d.property({type:Boolean, nonNullable:!0})],b.prototype,"enabled",void 0);return b=a.__decorate([h.subclass("esri.views.interactive.sketch.SketchLabelOptions")],b)})},"esri/views/interactive/sketch/SketchOptions":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./SketchLabelOptions ./SketchTooltipOptions ./SketchValueOptions".split(" "),function(a, b,d,l,g,k,h,z,E,r){b=class extends b{constructor(w){super(w);this.labels=new z;this.tooltips=new E;this.values=new r}};a.__decorate([d.property({nonNullable:!0,type:z})],b.prototype,"labels",void 0);a.__decorate([d.property({nonNullable:!0,type:E})],b.prototype,"tooltips",void 0);a.__decorate([d.property({nonNullable:!0,type:r})],b.prototype,"values",void 0);return b=a.__decorate([h.subclass("esri.views.interactive.sketch.SketchOptions")],b)})},"esri/views/interactive/sketch/SketchTooltipOptions":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./SketchTooltipElevationOptions ./SketchTooltipVisibleElements".split(" "), function(a,b,d,l,g,k,h,z,E){b=class extends b{constructor(r){super(r);this.forceEnabled=this.enabled=!1;this.helpMessageIcon=this.helpMessage=null;this.inputEnabled=!0;this.elevation=new z.SketchTooltipElevationOptions;this.visibleElements=new E;this.visualVariables=null;this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"enabled",void 0);a.__decorate([d.property()],b.prototype,"forceEnabled",void 0); a.__decorate([d.property()],b.prototype,"effectiveEnabled",null);a.__decorate([d.property()],b.prototype,"helpMessage",void 0);a.__decorate([d.property()],b.prototype,"helpMessageIcon",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"inputEnabled",void 0);a.__decorate([d.property({type:z.SketchTooltipElevationOptions,nonNullable:!0})],b.prototype,"elevation",void 0);a.__decorate([d.property({type:E,nonNullable:!0})],b.prototype,"visibleElements",void 0);a.__decorate([d.property()], b.prototype,"visualVariables",void 0);a.__decorate([d.property()],b.prototype,"xyMode",void 0);return b=a.__decorate([h.subclass("esri.views.interactive.sketch.SketchTooltipOptions")],b)})},"esri/views/interactive/sketch/SketchTooltipElevationOptions":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,d,l,g,k,h,z){a.SketchTooltipElevationOptions=class extends d{constructor(E){super(E);this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};b.__decorate([l.property({type:String,nonNullable:!0})],a.SketchTooltipElevationOptions.prototype,"mode",void 0);a.SketchTooltipElevationOptions=b.__decorate([z.subclass("esri.views.interactive.sketch.SketchTooltipElevationOptions")],a.SketchTooltipElevationOptions);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/sketch/SketchTooltipVisibleElements":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,d,l,g,k,h){b=class extends b{constructor(z){super(z);this.header=this.elevation=this.distance=this.direction=this.coordinates=this.area=!0;this.helpMessage=!1;this.totalLength=this.size=this.scale=this.rotation=this.radius=this.orientation=!0}};a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"area",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"coordinates",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype, "direction",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"distance",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"elevation",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"header",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"helpMessage",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"orientation",void 0);a.__decorate([d.property({type:Boolean, nonNullable:!0})],b.prototype,"radius",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"rotation",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"scale",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"size",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"totalLength",void 0);return b=a.__decorate([h.subclass("esri.views.interactive.sketch.SketchTooltipVisibleElements")],b)})},"esri/views/interactive/snapping/SnappingManager":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Evented ../../../core/has ../../../core/promiseUtils ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/projection ../../../support/elevationInfoUtils ../sketch/normalizedPoint ./Settings ./SnappingDomain ./snappingFactory ./SnappingOptions ./snappingUtils ./candidates/DrapedEdgeSnappingCandidate ./candidates/EdgeSnappingCandidate ./candidates/IntersectionSnappingCandidate ./candidates/LineSnappingCandidate ./candidates/ParallelLineSnappingCandidate ./candidates/RightAngleSnappingCandidate ./candidates/RightAngleTriangleSnappingCandidate ../support/viewUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A,C,p,x,u,B,e,t,F,y){function D(G,K){return!K||null==K.direction&&null==K.distance?!0:G instanceof p.DrapedEdgeSnappingCandidate||G instanceof x.EdgeSnappingCandidate||G instanceof B.LineSnappingCandidate||G instanceof e.ParallelLineSnappingCandidate||G instanceof F.RightAngleTriangleSnappingCandidate||G instanceof t.RightAngleSnappingCandidate&&(null!=K.direction||G.selfSnappingType!==t.SelfSnappingRightAngleType.LastVertex)?!1:!0}function I(G,K){let L= -1;for(let R=0;R {const {effectiveFeatureEnabled:G,effectiveSelfEnabled:K,touchSensitivityMultiplier:L,distance:R}=this.options;return{effectiveFeatureEnabled:G,effectiveSelfEnabled:K,touchSensitivityMultiplier:L,distance:R}},()=>{this.doneSnapping();this.emit("changed")},h.sync),h.watch(()=>this.options,G=>{for(const K of this._engines)K.options=G},h.sync),h.watch(()=>({viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,snappingEnginesFactory:this.snappingEnginesFactory}),({viewReady:G,snappingEnginesFactory:K})=> this._recreateEngines(G,K),h.syncAndInitial)])}destroy(){this._destroyEngines()}get updating(){return this._engines.some(G=>G.updating)}_recreateEngines(G,K){this._destroyEngines();if(G){var {view:L,options:R}=this;this._engines=K(L,R)}}_destroyEngines(){for(const G of this._engines)G.destroy();this._engines=[]}get _squaredMouseProximityThreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const {distance:G,touchSensitivityMultiplier:K}=this.options, L=G*K;return L*L}snap(G){return null!=G.scenePoint?this._snapMultiPoint(G):this._snapSinglePoint(G)}update(G){const {point:K,context:L}=G;this._removeVisualization();const R=this._currentMainCandidate;if(null==R)return K;var H=this._selectUpdateInput(G);if(null==H)return K;({spatialReference:G}=L);var V=v.project(H,G);if(null==V)return K;({view:H}=this);const {elevationInfo:O,visualizer:N}=L,T=[];V=f.fromPoint(V,H,O);const aa=R.constraint.closestTo(V);if(!this._arePointsWithinScreenThreshold(V,aa, L)||!D(R,L.drawConstraints))return this._resetSnappingState(),K;R.targetPoint=f.markAsTarget(aa);T.push(...R.hints);for(const ha of this._currentOtherActiveCandidates)D(ha,L.drawConstraints)&&(ha.targetPoint=f.markAsTarget(aa),T.push(...ha.hints));null!=N&&this.addHandles(N.draw(T,{spatialReference:G,elevationInfo:S(L),view:H,selfSnappingZ:L.selfSnappingZ}),"visualization-handle");return f.toElevationAlignedDehydratedPoint(aa,H,K,L)}doneSnapping(){this._removeVisualization();this._resetSnappingState()}_selectUpdateInput({point:G, scenePoint:K}){switch(this._currentSnappedType){case M.MAIN:return G;case M.SCENE:return K}}_resetSnappingState(){this._currentMainCandidate=null;this._currentOtherActiveCandidates=[];this._currentSnappedType=M.MAIN}_removeVisualization(){this.removeHandles("visualization-handle")}async _snapSinglePoint({point:G,context:K,signal:L}){const {view:R}=this;var {elevationInfo:H}=K;H=f.fromPoint(G,R,H);const V=await this._fetchCandidates(H,n.SnappingDomain.ALL,K,L);return this._createSnapResult(H,M.MAIN, V,R,G,K,L)}async _snapMultiPoint({point:G,scenePoint:K,context:L,signal:R}){const {view:H}=this,{coordinateHelper:V,elevationInfo:O,spatialReference:N}=L;await v.initializeProjection(K.spatialReference,N);K=v.project(K,N);var T=f.fromPoint(K,H,O);const aa=await this._fetchCandidates(T,n.SnappingDomain.FEATURE,L,R);if(0H.fetchCandidates(G,K,L,R)))).flat()}_createSnapResult(G,K,L,R,H,V,O){return{get valid(){return!k.isAborted(O)},apply:()=>{const {spatialReference:N}=V,{snappedPoint:T,hints:aa}=this._processCandidates(G,K,L,V);this._removeVisualization();null!=V.visualizer&&this.addHandles(V.visualizer.draw(aa, {spatialReference:N,elevationInfo:c.absoluteHeightElevationInfo,view:R,selfSnappingZ:V.selfSnappingZ}),"visualization-handle");return f.toElevationAlignedDehydratedPoint(T,R,H,V)}}}_processCandidates(G,K,L,R){if(1>L.length)return this.doneSnapping(),{snappedPoint:G,hints:[]};this._currentSnappedType!==K&&this._resetSnappingState();C.sortCandidatesInPlace(G,L);const H=this._currentMainCandidate;if(null!=H){var V=H instanceof u.IntersectionSnappingCandidate?0<=I(L,H.first)&&0<=I(L,H.second)?0:-1:I(L, H);if(0<=V)if(L[V]instanceof u.IntersectionSnappingCandidate){if(this._arePointsWithinScreenThreshold(G,H.targetPoint,R))return this._updateSnappingCandidate(H,K,L,R)}else return this._intersectWithOtherCandidates(V,L,G,K,R)}return this._intersectWithOtherCandidates(0,L,G,K,R)}_intersectWithOtherCandidates(G,K,L,R,H){const {coordinateHelper:V}=H,O=K[G],N=[];for(let T=0;TT[1]-aa[1]),N[0][1]L/H}function M(L,R,H,V,O,N,{spatialReference:T}){R=m.copy(K,R);R[0]+=H;R[1]+=V;R[2]+=O;return(H=I.vectorToScreenPoint(R,T,C.absoluteHeightElevationInfo,N))?e.screenDistance(H,L):Infinity}b.FeatureSnappingEngine=class extends l{get updating(){return this._snappingSources.some(L=>null==L?.valid|| !0===L.valid&&!0===L.snappingSource?.updating)||this._updatingHandles.updating}constructor(L){super(L);this.options=null;this._domain=B.SnappingDomain.FEATURE;this._updatingHandles=new A.UpdatingHandles;this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){const L=E.mapCollectionAsync(()=>this.options?._effectiveFeatureSources,(R,H)=> this._createSourceInfo(R,H));this._snappingSources=L;this.addHandles([k.destroyHandle(L),E.watch(()=>({rulesEnabled:!!this.options?.attributeRulesEnabled,sources:this._snappingSources.filter(g.isSome)}),({rulesEnabled:R,sources:H})=>{for(const V of H)V.attributeRulesEnabled=R},E.sync)])}destroy(){this._set("options",null);this._updatingHandles.destroy()}async fetchCandidates(L,R,H,V){if(!(R&this._domain&&null!=this.options&&this.options.effectiveFeatureEnabled))return[];const O=[];R=this._computeScreenSizeDistanceParameters(L, H);for(const T of this._snappingSources){if(!T?.valid||!T.snappingSource?.layerSource?.enabled||T.layerView?.suspended)continue;const aa=T.getFetchCandidatesParameters(L,H,R);for(var N of aa)O.push(T.snappingSource.fetchCandidates(N,V).then(ha=>ha.filter(ea=>!this._candidateIsExcluded(T.snappingSource,ea,H.excludeFeature))))}N=(await z.allSettledValues(O)).flat();this._addRightAngleCandidates(N,L,R,H);z.throwIfAborted(V);e.sortCandidatesInPlace(L,N);return N}_addRightAngleCandidates(L,R,H,V){var O= null!=V.vertexHandle?V.vertexHandle.rightEdge?.rightVertex?.pos:null!=V.editGeometryOperations&&"polygon"===V.editGeometryOperations.data.type?V.editGeometryOperations.data.components[0]?.getFirstVertex()?.pos:null,N=null!=V.vertexHandle?V.vertexHandle.leftEdge?.leftVertex?.pos:null!=V.editGeometryOperations?V.editGeometryOperations.data.components[0]?.getLastVertex()?.pos:null,{view:T}=this;O=x.fromAnyMapPoint(O,T,V);V=x.fromAnyMapPoint(N,T,V);N=L.length;for(T=0;T=T*T+H*H&&(H=f.squaredDistance(x.asVec2(N),x.asVec2(aa))>f.squaredDistance(x.asVec2(N),x.asVec2(ha))?aa:ha,L=new D.RightAngleSnappingCandidate({targetPoint:x.markAsTarget(N),otherVertex:R, otherVertexType:D.OtherVertexType.NEXT,previousVertex:H,constraint:new p.VerticalHalfPlaneConstraint(R,N),objectId:L.objectId,isDraped:L.isDraped,domain:B.SnappingDomain.FEATURE}),O.push(L))}}_computeScreenSizeDistanceParameters(L,R){let H=null!=this.options?this.options.distance*("touch"===R.pointer?this.options.touchSensitivityMultiplier:1):0;return null==this.view?{x:H,y:H,z:H,distance:H}:"2d"===this.view.type?(H*=this.view.resolution,{x:H,y:H,z:H,distance:H}):this._computeScreenSizeDistanceParameters3D(L, H,this.view,R)}_computeScreenSizeDistanceParameters3D(L,R,H,V){var {spatialReference:O}=V;H.renderCoordsHelper.toRenderCoords(L,O,G);const N=H.state.camera.computeScreenPixelSizeAt(G);var T=N*H.renderCoordsHelper.unitInMeters,aa=T/r.getMetersPerUnitForSR(O);const ha=T/r.getMetersPerVerticalUnitForSR(O);T=R*aa;const ea=R*ha,ma=I.vectorToScreenPoint(L,O,C.absoluteHeightElevationInfo,H);O=ma?M(ma,L,aa,0,0,H,V):0;aa=ma?M(ma,L,0,aa,0,H,V):0;L=ma?M(ma,L,0,0,ha,H,V):0;return{x:0===O?0:T/O,y:0===aa?0:T/aa, z:0===L?0:ea/L,distance:N*R}}_candidateIsExcluded(L,R,H){if(null==H)return!1;R=this._getCandidateObjectId(R);if(null==R)return!1;L=L.layerSource.layer;return"graphics"===L.type?H.uid===R:H.sourceLayer===L&&H.attributes&&"objectIdField"in L?H.attributes[L.objectIdField]===R:!1}_getCandidateObjectId(L){return L instanceof y.FeatureSnappingCandidate?L.objectId:null}async _createSourceInfo(L,R){const H=L.layer;H.loaded||(await H.load(),z.throwIfAborted(R));const {view:V}=this;L=await this._createFeatureSnappingSourceType(L); z.throwIfAborted(R);return null==L?new u.FeatureSnappingSourceInfo({}):new u.FeatureSnappingSourceInfo({snappingSource:L,view:V,layer:H})}async _createFeatureSnappingSourceType(L){switch(L.layer.type){case "feature":case "geojson":case "csv":case "oriented-imagery":case "subtype-group":case "wfs":return this._createFeatureSnappingSourceFeatureLayer(L);case "graphics":return this._createFeatureSnappingSourceGraphicsLayer(L);case "map-notes":return this._createFeatureSnappingSourceMapNotesLayer(L); case "scene":case "building-scene":return this._createFeatureSnappingSourceSceneLayer(L)}return null}async _createFeatureSnappingSourceSceneLayer(L){const {view:R}=this;return null==R||"3d"!==R.type?null:new ((await this._getSourceModule("scene")).SceneLayerSnappingSource)({layerSource:L,view:R})}async _createFeatureSnappingSourceFeatureLayer(L){switch(L.layer.source?.type){case "feature-layer":case "oriented-imagery":return new ((await this._getSourceModule("featureService")).FeatureServiceSnappingSource)({spatialReference:this.spatialReference, view:this.view,layerSource:L});case "memory":case "csv":case "geojson":case "wfs":if("mesh"!==L.layer.geometryType)return new ((await this._getSourceModule("featureCollection")).FeatureCollectionSnappingSource)({layerSource:L,view:this.view})}return null}async _createFeatureSnappingSourceGraphicsLayer(L){return new ((await this._getSourceModule("graphics")).GraphicsSnappingSource)({getGraphicsLayers:()=>[L.layer],spatialReference:this.spatialReference,view:this.view,layerSource:L})}async _createFeatureSnappingSourceMapNotesLayer(L){return new ((await this._getSourceModule("notes")).GraphicsSnappingSource)({getGraphicsLayers:()=> L.layer.sublayers?.toArray()??[],spatialReference:this.spatialReference,view:this.view,layerSource:L})}async _getSourceModule(L){var R=this._sourceModules[L];if(null==R.loader){R=this._loadSourceModule(L);this._sourceModules[L]={module:null,loader:R};const H=await R;this._sourceModules[L]={module:H,loader:R};return H}return null==R.module?R.loader:R.module}_loadSourceModule(L){const R=this._updatingHandles;switch(L){case "featureService":return R.addPromise(new Promise((H,V)=>a(["./featureSources/FeatureServiceSnappingSource"], H,V)));case "featureCollection":return R.addPromise(new Promise((H,V)=>a(["./featureSources/FeatureCollectionSnappingSource"],H,V)));case "graphics":return R.addPromise(new Promise((H,V)=>a(["./featureSources/GraphicsSnappingSource"],H,V)));case "notes":return R.addPromise(new Promise((H,V)=>a(["./featureSources/GraphicsSnappingSource"],H,V)));case "scene":return R.addPromise(new Promise((H,V)=>a(["./featureSources/SceneLayerSnappingSource"],H,V)))}}get test(){}};d.__decorate([w.property({constructOnly:!0})], b.FeatureSnappingEngine.prototype,"spatialReference",void 0);d.__decorate([w.property({constructOnly:!0})],b.FeatureSnappingEngine.prototype,"view",void 0);d.__decorate([w.property()],b.FeatureSnappingEngine.prototype,"options",void 0);d.__decorate([w.property({readOnly:!0})],b.FeatureSnappingEngine.prototype,"updating",null);d.__decorate([w.property()],b.FeatureSnappingEngine.prototype,"_snappingSources",void 0);b.FeatureSnappingEngine=d.__decorate([c.subclass("esri.views.interactive.snapping.FeatureSnappingEngine")], b.FeatureSnappingEngine);const G=n.create(),K=n.create();Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/sketch/constraints":function(){define("exports ../../../core/arrayUtils ../../../core/mathUtils ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../chunks/vec42 ../../../core/libs/gl-matrix-2/factories/vec4f64 ../../../geometry/support/geodesicConstants ../../../geometry/support/geodesicUtils ../../../geometry/support/plane ../../../chunks/sphere ../../3d/support/mathUtils ./normalizedPoint ../../support/geometry3dUtils ../../support/geometry2dUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q){function A(P,Q){if(P instanceof aa){var fa=[];for(const ja of P.constraints)(P=ja.intersect(Q))&&fa.push(P);return y(fa)}if(Q instanceof aa)return A(Q,P);if(P instanceof ba)return B(P,Q);if(Q instanceof ba)return B(Q,P);if(D(P)){({point:fa}=P);if(D(Q))return k.exactEquals(fa,Q.point)?P:void 0;Q=Q.closestTo(fa);return k.equals(Q,fa)?P:void 0}if(I(P)){if(D(Q))return A(Q,P);if(I(Q))return t(n.intersectLineLikes(P.lineLike,Q.lineLike));if(S(Q))return pa(P,Q); if(M(Q))return t(n.intersectVerticalPlaneAndLineLike(Q.planeLike,P.lineLike));if(G(Q))return t(n.intersectLineLikeAndVerticalCylinder(P.lineLike,Q.center,Q.radius));if(L(Q))return t(n.intersectLineLikeAndCircle(P.lineLike,Q));if(K(Q))return C(P,Q);if(R(Q))return p(P,Q)}else if(S(P)){if(D(Q)||I(Q))return A(Q,P);if(S(Q))return n.isClose(P.z,Q.z)?P:void 0;if(M(Q))return x(P,Q);if(G(Q)){const [ja,oa]=Q.center;return new ea(m.fromValues(ja,oa,P.z),Q.radius)}if(L(Q))return ra(P,Q);if(K(Q))return n.isClose(Q.center[2], P.z)?Q:void 0;if(R(Q))return u(P,Q)}else if(M(P)){if(D(Q)||I(Q)||S(Q))return A(Q,P);if(M(Q))return e(n.intersectVerticalPlanes(P.planeLike,Q.planeLike));if(G(Q))return e(n.intersectVerticalPlaneAndVerticalCylinder(P.planeLike,Q.center,Q.radius));if(L(Q))return ya(P,Q);if(K(Q))return na(P,Q);if(R(Q))return ua(P,Q)}else if(G(P)){if(D(Q)||I(Q)||S(Q)||M(Q))return A(Q,P);if(G(Q))return e(n.intersectVerticalCylinders(m.asVec2(P.center),P.radius,m.asVec2(Q.center),Q.radius));if(!L(Q)){if(K(Q))return fa= l.squaredDistance(m.asVec2(P.center),m.asVec2(Q.center)),n.isClose(fa,0)&&n.isClose(P.radius,Q.radius)||(P=n.intersectVerticalCylinders(m.asVec2(P.center),P.radius,m.asVec2(Q.center),Q.radius),Q=F(P,Q.center[2])),Q;R(Q)}}else if(L(P)){if(D(Q)||I(Q)||S(Q)||M(Q)||G(Q))return A(Q,P);L(Q)||(K(Q)?Q.asCircle():R(Q))}else if(K(P)){if(D(Q)||I(Q)||S(Q)||M(Q)||G(Q)||L(Q))return A(Q,P);if(K(Q))return n.vectorsHaveCloseZ(Q.center,P.center)?(fa=l.squaredDistance(m.asVec2(Q.center),m.asVec2(P.center)),n.isClose(fa, 0)&&n.isClose(Q.radius,P.radius)||(P=n.intersectVerticalCylinders(m.asVec2(Q.center),Q.radius,m.asVec2(P.center),P.radius),Q=F(P,Q.center[2]))):Q=void 0,Q;R(Q)}else if(R(P)){if(D(Q)||I(Q)||S(Q)||M(Q)||G(Q)||K(Q))return A(Q,P);R(Q)}}function C({lineLike:P},{center:Q,radius:fa}){const ja=Q[2];P=n.intersectLineLikeAndVerticalCylinder(P,Q,fa).filter(oa=>n.isClose(oa[2],ja));return t(P)}function p({lineLike:P},{sphere:Q}){return t(c.intersectLine(Q,P.start,P.end))}function x({z:P},{planeLike:Q}){const [fa, ja]=Q.start,[oa,va]=Q.end,Ba=m.fromValues(fa,ja,P);P=m.fromValues(oa,va,P);return Q.type===n.VerticalPlaneType.PLANE?new N(Ba,P):new T(Ba,P)}function u(P,{center:Q,radius:fa}){const ja=Math.abs(Q[2]-P.z);if(!(ja>fa)||n.isClose(ja,fa))if(P=m.fromValues(Q[0],Q[1],P.z),fa=Math.sqrt(fa**2-ja**2),!n.isClose(fa,0))return new ea(P,fa)}function B(P,Q){const {planeLike:fa,getZ:ja}=P,oa=[];if(D(Q))P.addIfOnTheGround(oa,n.intersectVerticalPlaneAndPoint(fa,Q.point));else if(I(Q))P.addIfOnTheGround(oa,n.intersectVerticalPlaneAndLineLike(fa, Q.lineLike));else if(G(Q))for(const [va,Ba]of n.intersectVerticalPlaneAndVerticalCylinder(fa,Q.center,Q.radius))P=ja(va,Ba),null!=P&&oa.push(h.fromValues(va,Ba,P));else if(M(Q)||Q instanceof ba)for(const [va,Ba]of n.intersectVerticalPlanes(fa,Q.planeLike))P=ja(va,Ba)??0,oa.push(h.fromValues(va,Ba,P));return t(oa)}function e(P){return y(P.map(([Q,fa])=>{const ja=m.fromValues(Q,fa,0);Q=m.fromValues(Q,fa,1);return new N(ja,Q)}))}function t(P){return y(P.map(Q=>Q?new V(m.fromVec3(Q)):void 0))}function F(P, Q){return t(P.map(([fa,ja])=>[fa,ja,Q]))}function y(P){if(0!==P.length)return 1===P.length?P[0]??void 0:new aa(P.filter(b.isSome))}function D(P){return P instanceof V}function I(P){return P instanceof O}function S(P){return P instanceof Aa}function M(P){return P instanceof da}function G(P){return P instanceof ha}function K(P){return P instanceof ea}function L(P){return P instanceof ma}function R(P){return P instanceof W}class H{intersect(P){return A(this,P)}closestPoints(P){return[this.closestTo(P)]}} class V extends H{constructor(P){super();this.point=P}equals(P){return this===P||D(P)&&k.exactEquals(this.point,P.point)}closestTo(){return m.clone(this.point)}}class O extends H{constructor(P,Q,fa){super();this.start=P;this.end=Q;this.lineLike={start:P,end:Q,type:fa}}equals(P){return this===P||I(P)&&this.lineLike.type===P.lineLike.type&&k.exactEquals(this.start,P.start)&&k.exactEquals(this.end,P.end)}closestTo(P){const Q=m.createWritable();n.projectPointToLineLike(P,this.lineLike,Q);return Q}}class N extends O{constructor(P, Q){super(P,Q,q.LineType.LINE)}}class T extends O{constructor(P,Q){super(P,Q,q.LineType.RAY)}}class aa extends H{constructor(P){super();this.constraints=P}equals(P){return this===P||P instanceof aa&&b.equals(this.constraints,P.constraints,(Q,fa)=>Q.equals(fa))}closestTo(P){let Q=Infinity,fa;for(const ja of this.constraints){const oa=ja.closestTo(P),va=k.squaredDistance(P,oa);vaQ===this?[]:Q.closestPoints(P))}} class ha extends H{constructor(P,Q){super();this.center=P;this.radius=Q}equals(P){return this===P||G(P)&&this.center[0]===P.center[0]&&this.center[1]===P.center[1]&&this.radius===P.radius}closestTo(P){const Q=m.createWritable();n.projectPointToVerticalCylinder(P,this.center,this.radius,Q);return Q}}class ea extends H{constructor(P,Q){super();this.center=P;this.radius=Q}equals(P){return this===P||K(P)&&k.exactEquals(this.center,P.center)&&this.radius===P.radius}closestTo(P){const Q=m.createWritable(); n.projectPointToVerticalCylinder(P,this.center,this.radius,Q);Q[2]=this.center[2];return Q}asCircle(){return new ma(m.clone(this.center),this.radius,m.fromValues(0,0,1))}}class ma extends H{constructor(P,Q,fa,ja){super();this.center=P;this.radius=Q;this.normal=fa;this.slicePlane=ja}equals(P){return this===P||L(P)&&k.exactEquals(this.center,P.center)&&k.exactEquals(this.normal,P.normal)&&this.radius===P.radius}closestTo(P){const {center:Q,radius:fa}=this;v.projectPoint(this.getPlane(za),P,wa);var ja= k.sub(wa,wa,Q),oa=k.squaredLength(ja);if(n.isClose(oa,0))return m.clone(P);const va=fa/Math.sqrt(oa);oa=m.createWritable();k.scaleAndAdd(oa,Q,ja,va);({slicePlane:ja}=this);return ja&&!n.isPointInsidePlane(ja,oa)?ta(ja,this)?.closestTo(P)??m.clone(P):oa}getPlane(P=v.create()){return v.fromPositionAndNormal(this.center,this.normal,P)}}const wa=h.create(),za=v.create();class Aa extends H{constructor(P){super();this.z=P}equals(P){return this===P||S(P)&&this.z===P.z}closestTo(P){return m.fromValues(P[0], P[1],this.z)}getPlane(P=v.create()){k.set(Y,0,0,this.z);return v.fromPositionAndNormal(Y,h.UNIT_Z,P)}}const Y=h.create();class da extends H{constructor(P,Q,fa){super();this.start=P;this.end=Q;this.planeLike={start:m.asVec2(P),end:m.asVec2(Q),type:fa}}equals(P){return this===P||M(P)&&this.planeLike.type===P.planeLike.type&&k.exactEquals(this.start,P.start)&&k.exactEquals(this.end,P.end)}closestTo(P){const Q=m.createWritable();n.projectPointToVerticalPlane(P,this.planeLike,Q);return Q}closestEndTo(P){const {start:Q, end:fa}=this.planeLike;return 0{const P=v.create();return(Q,fa)=>{const {start:ja,end:oa}=Q;if(n.vectorsHaveCloseZ(ja,oa)&&n.isClose(ja[2],fa.z))return Q;Q=m.createWritable();if(v.intersectLine(fa.getPlane(P),ja,oa,Q))return new V(Q)}})(),ta=(()=>{const P=E.create(),Q=h.create(),fa=h.create();return(ja,oa,va)=>{const {normal:Ba,center:Ea,radius:Fa}=oa;f.tangentFrame(Ba,Q,fa);const Ga=v.getNormal(ja);var Da=Fa*k.dot(Ga,Q),Ca=Fa*k.dot(Ga,fa);z.set(P,Ea[0],Ea[1],Ea[2],1);const Ja=z.dot(ja,P),Ha=Math.hypot(Da,Ca),Ia=n.isClose(Ha, 0);if(n.isClose(v.distance(ja,Ea),0)){if(Ia)return oa;if(n.isClose(Fa,0))return!va||n.isPointInsidePlane(va,Ea)?new V(m.clone(Ea)):void 0;k.cross(Q,Ga,Ba);k.normalize(Q,Q);Da=[];Ca=h.clone(Ea);k.scaleAndAdd(Ca,Ca,Q,Fa);va&&!n.isPointInsidePlane(va,Ca)||Da.push(Ca);Ca=h.clone(Ea);k.scaleAndAdd(Ca,Ca,Q,-Fa);va&&!n.isPointInsidePlane(va,Ca)||Da.push(Ca);return t(Da)}if(!(Ia||(ja=-Ja/Ha,1{const P=v.create();return(Q,fa)=>ta(Q.getPlane(P),fa,fa.slicePlane)})(),na=(()=>{const P=v.create();return(Q,{center:fa,radius:ja})=>{ja=n.intersectVerticalPlaneAndVerticalCylinder(Q.planeLike,fa,ja);fa=fa[2];Q.getSlicePlane(P);Q=[];for(const [oa,va]of ja)ja= [oa,va,fa],n.isPointInsidePlane(P,ja)&&Q.push(ja);return t(Q)}})(),ya=(()=>{const P=v.create(),Q=v.create();return(fa,ja)=>ta(fa.getPlane(P),ja,fa.getSlicePlane(Q))})(),ua=(()=>{const P=v.create();return(Q,{center:fa,radius:ja})=>{var oa=Q.getPlane(P);const va=v.signedDistance(oa,fa);var Ba=Math.abs(va);if(!(Ba>ja)||n.isClose(Ba,ja)){ja=Math.sqrt(ja**2-va**2);if(n.isClose(ja,0))return Q=m.createWritable(),v.projectPoint(oa,fa,Q),new V(Q);Ba=m.createWritable();oa=h.clone(v.getNormal(oa));k.scaleAndAdd(Ba, fa,oa,va);return new ma(Ba,ja,oa,Q.getSlicePlane())}}})();a.CircleConstraint=ma;a.Constraint=H;a.CoordinateConstraint=la;a.DrapedLineConstraint=ba;a.GeodesicConstraint=ia;a.HorizontalCircleConstraint=ea;a.HorizontalPlaneConstraint=Aa;a.LineConstraint=N;a.LineLikeConstraint=O;a.PointConstraint=V;a.RayConstraint=T;a.SetConstraint=aa;a.SphereConstraint=W;a.VerticalCylinderConstraint=ha;a.VerticalHalfPlaneConstraint=U;a.VerticalPlaneConstraint=X;a.VerticalPlaneLikeConstraint=da;a.constraintOrSet=y;a.isPoint= D;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/plane":function(){define("exports ../../core/mathUtils ../../chunks/vec32 ../../core/libs/gl-matrix-2/factories/vec3f64 ../../chunks/vec42 ./vector ./vectorStacks ../../views/3d/support/mathUtils".split(" "),function(a,b,d,l,g,k,h,z){function E(D=e){return[D[0],D[1],D[2],D[3]]}function r(D,I){return w(I[0],I[1],I[2],I[3],D)}function w(D,I,S,M,G=E()){G[0]=D;G[1]=I;G[2]=S;G[3]=M;return G}function v(D,I,S){var M= I[0]*I[0]+I[1]*I[1]+I[2]*I[2];M=1E-5S)return!1; I(C,M);let L=G,R=!1;for(;LMath.abs(d.dot(u,B));if(!R)return 0===M&&1===G&&2===K?!1:f(D,I,S,0,1,2);c(C,p,x,D);return!0}function m(D,I,S){D=d.scale(h.sv3d.get(),D,d.dot(D,I));d.subtract(S,I,D);return S}function n(D,I){return d.dot(D,I)+D[3]}function q(D,I,S,M,G){const K=d.dot(D, S);if(0===K)return!1;D=-(d.dot(D,I)+D[3])/K;M&t.CLAMP&&(D=b.clamp(D,0,1));if(!(M&t.INFINITE_MIN)&&0>D||!(M&t.INFINITE_MAX)&&1D&&0<=S)return!1;if(-1E-6S)return 0D||0>S)&&!(0>D&&0>S))return!0;D/=S;0I.c0&&(I.c0=D);return I.c0<=I.c1};a.clipInfinite=function(D,I){const S=d.dot(D,I.ray.direction);D=-n(D,I.ray.origin);if(-1E-6S)return 0I.c0&&(I.c0=D);return I.c0<=I.c1};a.copy=r;a.create=E;a.distance=function(D,I){return Math.abs(n(D,I))};a.equals=g;a.exactEquals=A;a.fromArray=function(D,I,S=!0){const M= I.length/3;return f(D,(G,K)=>d.set(G,I[3*K],I[3*K+1],I[3*K+2]),S?M-1:M)};a.fromManyPoints=f;a.fromNormalAndOffset=function(D,I,S){d.copy(S,D);S[3]=I;return S};a.fromPoints=c;a.fromPositionAndNormal=v;a.fromValues=w;a.fromVectorsAndPoint=function(D,I,S,M){d.cross(x,I,D);return v(S,x,M)};a.getNormal=function(D){return D};a.intersectLine=function(D,I,S,M){S=d.subtract(h.sv3d.get(),S,I);return q(D,I,S,F,M)};a.intersectLineSegment=function(D,I,S){return q(D,I.origin,I.vector,t.NONE,S)};a.intersectLineSegmentClamp= function(D,I,S){return q(D,I.origin,I.vector,t.CLAMP,S)};a.intersectRay=function(D,I,S){return null!=I?q(D,I.origin,I.direction,y,S):!1};a.isPointInside=function(D,I){return 0<=n(D,I)};a.negate=function(D,I){I[0]=-D[0];I[1]=-D[1];I[2]=-D[2];I[3]=-D[3];return I};a.projectPoint=function(D,I,S){const M=d.scale(h.sv3d.get(),D,-D[3]);I=d.subtract(h.sv3d.get(),I,M);D=m(D,I,h.sv3d.get());d.add(S,D,M);return S};a.projectPointLocal=function(D,I,S,M){var G=h.sv3d.get(),K=h.sv3d.get();z.tangentFrame(D,G,K); I=d.subtract(h.sv3d.get(),S,I);G=k.projectPointSignedLength(G,I);K=k.projectPointSignedLength(K,I);D=k.projectPointSignedLength(D,I);return d.set(M,G,K,D)};a.projectVector=m;a.setOffsetFromPoint=function(D,I,S){I!==D&&r(D,I);D[3]=-d.dot(D,S);return D};a.signedDistance=n;a.up=e;a.wrap=function(D=e[0],I=e[1],S=e[2],M=e[3]){return w(D,I,S,M,h.sv4d.get())};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/vector":function(){define(["exports","../../core/mathUtils", "../../chunks/vec32","../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,d,l){const g=l.create(),k=l.create();a.angle=function(h,z){h=d.dot(h,z)/(d.length(h)*d.length(z));return-b.acosClamped(h)};a.angleAroundAxis=function(h,z,E){d.normalize(g,h);d.normalize(k,z);h=d.dot(g,k);h=b.acosClamped(h);z=d.cross(g,g,k);return 0>d.dot(z,E)?2*Math.PI-h:h};a.projectPoint=function(h,z,E){z=d.dot(h,z)/d.dot(h,h);return d.scale(E,h,z)};a.projectPointSignedLength=function(h,z){return d.dot(h,z)/d.length(h)}; Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/support/vectorStacks":function(){define(["exports","../../core/VectorStack"],function(a,b){const d=b.VectorStack.createVec2f64(),l=b.VectorStack.createVec3f64(),g=b.VectorStack.createVec4f64(),k=b.VectorStack.createMat3f64(),h=b.VectorStack.createMat4f64();b=b.VectorStack.createQuatf64();a.sm3d=k;a.sm4d=h;a.sq4d=b;a.sv2d=d;a.sv3d=l;a.sv4d=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/VectorStack":function(){define("exports ./has ./nextTick ./libs/gl-matrix-2/factories/mat3f64 ./libs/gl-matrix-2/factories/mat4f64 ./libs/gl-matrix-2/factories/quatf64 ./libs/gl-matrix-2/factories/vec2f64 ./libs/gl-matrix-2/factories/vec3f64 ./libs/gl-matrix-2/factories/vec4f64".split(" "), function(a,b,d,l,g,k,h,z,E){class r{constructor(w){this._create=w;this._items=[];this._itemsPtr=0}get(){0===this._itemsPtr&&d.nextTick(()=>this._reset());this._itemsPtr>=this._items.length&&this._items.push(this._create());return this._items[this._itemsPtr++]}_reset(){const w=2*this._itemsPtr;this._items.length>w&&(this._items.length=w);this._itemsPtr=0}static createVec2f64(){return new r(h.create)}static createVec3f64(){return new r(z.create)}static createVec4f64(){return new r(E.create)}static createMat3f64(){return new r(l.create)}static createMat4f64(){return new r(g.create)}static createQuatf64(){return new r(k.create)}get test(){}} a.VectorStack=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/3d/support/mathUtils":function(){define(["exports","../../../core/mathUtils","../../../chunks/vec32","../../../core/libs/gl-matrix-2/factories/vec3f64"],function(a,b,d,l){const g=l.create(),k=l.create(),h=l.create(),z=l.create(),E=l.create();a.angle=function(r,w,v){r=d.normalize(z,r);w=d.normalize(E,w);const c=b.acosClamped(d.dot(r,w));return v&&(r=d.cross(h,r,w),0>d.dot(r,v))?-c:c};a.bilerp=function(r,w,v, c,f,m){r+=(w-r)*f;return r+(v+(c-v)*f-r)*m};a.cosCapped=function(r,w){return r>w?Math.cos(w):Math.cos(r)};a.fovx2fovy=function(r,w,v){return 2*Math.atan(v*Math.tan(.5*r)/w)};a.fovy2fovx=function(r,w,v){return 2*Math.atan(w*Math.tan(.5*r)/v)};a.makeOrthonormal=function(r,w,v){v=v||r;const c=d.dot(r,w);d.set(v,r[0]-c*w[0],r[1]-c*w[1],r[2]-c*w[2]);d.normalize(v,v)};a.makePiecewiseLinearFunction=function(r){const w=r.length;return v=>{if(v<=r[0][0])return r[0][1];if(v>=r[w-1][0])return r[w-1][1];let c= 1;for(;v>r[c][0];)c++;const f=r[c][0];v=(f-v)/(f-r[c-1][0]);return v*r[c-1][1]+(1-v)*r[c][1]}};a.maxScale=function(r){return Math.sqrt(Math.max(r[0]*r[0]+r[4]*r[4]+r[8]*r[8],r[1]*r[1]+r[5]*r[5]+r[9]*r[9],r[2]*r[2]+r[6]*r[6]+r[10]*r[10]))};a.midpoint3d=function(r,w){d.set(w,0,0,0);if(0n){n=Math.acos(n);const q=((1-v)*f+v*m)/Math.sin(n);m=q/m*Math.sin(v*n);d.scale(z,r,q/f*Math.sin((1-v)*n));d.scale(E,w,m);return d.add(c,z,E)}return d.lerp(c,r,w,v)};a.slerpTangent=function(r,w,v,c=l.create(),f=l.create()){const m= d.length(r),n=d.length(w);var q=d.dot(r,w)/(m*n);if(.9999999999999999>q){q=Math.acos(q);const A=Math.sin(q),C=Math.sin(v*q),p=Math.sin((1-v)*q),x=(1-v)*m+v*n,u=x/A,B=u/n*C;d.scale(z,r,u/m*p);d.scale(E,w,B);d.add(c,z,E);d.scale(z,r,1/m*(-Math.cos((1-v)*q)*q*x+p*(-m+n)));d.scale(E,w,1/n*(Math.cos(v*q)*q*x+C*(-m+n)));d.add(f,z,E);d.scale(f,f,1/A);return f}d.lerp(c,r,w,v);d.subtract(f,w,r);d.normalize(f,f);return f};a.tangentFrame=function(r,w,v){Math.abs(r[0])>Math.abs(r[1])?d.set(w,0,1,0):d.set(w,1, 0,0);d.cross(v,r,w);d.cross(w,v,r);d.normalize(v,v);d.normalize(w,w)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/chunks/sphere":function(){define("exports ../core/has ../core/Logger ../core/mathUtils ../core/libs/gl-matrix-2/math/mat4 ./vec32 ../core/libs/gl-matrix-2/factories/vec3f64 ./vec42 ../core/libs/gl-matrix-2/factories/vec4f64 ../core/libs/gl-matrix-2/math/common ../geometry/support/Axis ../geometry/support/ray ../geometry/support/vector ../geometry/support/vectorStacks".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f){function m(){return E.create()}function n(Y,da){return z.copy(da,Y)}function q(Y,da){return E.fromValues(Y[0],Y[1],Y[2],da)}function A(Y){return Y}function C(Y){Y[0]=Y[1]=Y[2]=Y[3]=0}function p(Y,da){Y[0]=Y[1]=Y[2]=0;Y[3]=da;return Y}function x(Y){return Y[3]}function u(Y){return Y}function B(Y,da,ka,qa){return E.fromValues(Y,da,ka,qa)}function e(Y,da,ka){Y!==ka&&(ka[0]=Y[0],ka[1]=Y[1],ka[2]=Y[2]);ka[3]=Y[3]+da;return ka}function t(Y,da,ka){Y!==ka&&n(Y,ka);return ka} function F(Y,da,ka){if(null==da||!D(Y,da,ha))return!1;let {t0:qa,t1:xa}=ha;if(0>qa||xaqa)return!1;if(ka){const {origin:J,direction:U}=da;ka[0]=J[0]+U[0]*qa;ka[1]=J[1]+U[1]*qa;ka[2]=J[2]+U[2]*qa}return!0}function y(Y,da,ka){da=v.fromPoints(da,ka);if(!D(Y,da,ha))return[];const {origin:qa,direction:xa}=da,{t0:J,t1:U}=ha;da=X=>{const W=h.create();k.scaleAndAdd(W,qa,xa,X);return K(Y,W,W)};return Math.abs(J-U)Y)return!1;Y=Math.sqrt(Y);ka.t0=(-U-Y)/(2*da);ka.t1=(-U+Y)/(2*da);return!0}function I(Y,da){return F(Y,da,null)}function S(Y,da,ka){if(F(Y,da,ka))return ka;Y=M(Y,da,f.sv3d.get());k.add(ka,da.origin,k.scale(f.sv3d.get(),da.direction,k.distance(da.origin,Y)/k.length(da.direction))); return ka}function M(Y,da,ka){const qa=f.sv3d.get(),xa=f.sm4d.get();k.cross(qa,da.origin,da.direction);const J=Y[3];k.cross(ka,qa,da.origin);k.scale(ka,ka,1/k.length(ka)*J);Y=R(Y,da.origin);da=c.angle(da.origin,ka);g.fromRotation(xa,da+Y,qa);k.transformMat4(ka,ka,xa);return ka}function G(Y,da,ka){if(F(Y,da,ka))return ka;v.closestPoint(da,Y,ka);return K(Y,ka,ka)}function K(Y,da,ka){da=k.subtract(f.sv3d.get(),da,Y);da=k.scale(f.sv3d.get(),da,Y[3]/k.length(da));return k.add(ka,da,Y)}function L(Y,da){da= k.subtract(f.sv3d.get(),da,Y);da=k.squaredLength(da);return Math.sqrt(Math.abs(da-Y[3]*Y[3]))}function R(Y,da){da=k.subtract(f.sv3d.get(),da,Y);da=k.length(da);Y=Y[3];return l.acosClamped(Y/(Y+Math.abs(Y-da)))}function H(Y,da,ka,qa){Y=k.subtract(ma,da,Y);switch(ka){case w.Axis.X:return ka=l.cartesianToSpherical(Y,ma)[2],k.set(qa,-Math.sin(ka),Math.cos(ka),0);case w.Axis.Y:return Y=l.cartesianToSpherical(Y,ma),ka=Y[1],Y=Y[2],da=Math.sin(ka),k.set(qa,-da*Math.cos(Y),-da*Math.sin(Y),Math.cos(ka));case w.Axis.Z:return k.normalize(qa, Y)}}function V(Y,da){da=k.subtract(wa,da,Y);return k.length(da)-Y[3]}function O(Y,da,ka,qa){const xa=V(Y,da);Y=H(Y,da,w.Axis.Z,wa);ka=k.scale(wa,Y,ka-xa);return k.add(qa,da,ka)}function N(Y,da){da=k.squaredDistance(Y,da);Y=Y[3];return da<=Y*Y}function T(Y,da,ka=E.create()){const qa=k.distance(Y,da),xa=Y[3],J=da[3];if(qa+Jh()),w=g.create();a.closestPoint= function(v,c,f){c=l.dot(v.direction,l.subtract(f,c,v.origin));l.add(f,v.origin,l.scale(f,v.direction,c));return f};a.closestPoints=function(v,c,f,m){const n=v.direction,q=c.direction;var A=l.sub(w,c.origin,v.origin);const C=l.dot(n,q),p=l.dot(q,A);A=l.dot(n,A);const x=l.dot(n,n),u=l.dot(q,q),B=(C*A-p*x)/(x*u-C*C);l.add(f,v.origin,l.scale(w,n,(C*p+A*u)/(x*u-C*C)));l.add(m,c.origin,l.scale(w,q,B));return[f,m]};a.copy=function(v,c=h()){return E(v.origin,v.direction,c)};a.create=h;a.distance2=function(v, c){v=l.cross(k.sv3d.get(),l.normalize(k.sv3d.get(),v.direction),l.subtract(k.sv3d.get(),c,v.origin));return l.dot(v,v)};a.equals=function(v,c){return b.equals(v.origin,c.origin)&&b.equals(v.direction,c.direction)};a.fromPoints=function(v,c,f=h()){l.copy(f.origin,v);l.subtract(f.direction,c,v);return f};a.fromValues=E;a.wrap=function(v,c){const f=r.get();f.origin=v;f.direction=c;return f};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/ObjectStack":function(){define(["exports", "./nextTick"],function(a,b){class d{constructor(l){this._allocator=l;this._items=[];this._itemsPtr=0;this._grow()}get(){0===this._itemsPtr&&b.nextTick(()=>this._reset());this._itemsPtr===this._items.length&&this._grow();return this._items[this._itemsPtr++]}_reset(){this._items.length=Math.min(Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3072),this._items.length);this._itemsPtr=0}_grow(){for(let l=0;l{const G=k.create(),K=k.create(),L=k.create();return({start:R,end:H},{center:V,radius:O,normal:N,slicePlane:T})=>{var aa=z.fromPositionAndNormal(V,N,I);if(n(z.distance(aa,R),0)&&n(z.distance(aa,H),0)){E.tangentFrame(N,G,K);aa=(ha,ea)=>{g.subtract(L,ea,V);d.set(ha,g.dot(L,G),g.dot(L, K));return ha};H=r.intersectLineLikeAndCircle({start:aa(p,R),end:aa(x,H),type:r.LineType.LINE},l.ZEROS,O);R=[];for(const [ha,ea]of H)H=g.copy(k.create(),V),g.scaleAndAdd(H,H,G,ha),g.scaleAndAdd(H,H,K,ea),T&&!q(T,H)||R.push(H);return R}N=k.create();return z.intersectLine(aa,R,H,N)?!n(g.distance(N,V),O)||T&&!q(T,N)?[]:[N]:[]}})();a.VerticalPlaneType=void 0;(function(G){G[G.PLANE=0]="PLANE";G[G.HALF_PLANE=1]="HALF_PLANE"})(a.VerticalPlaneType||(a.VerticalPlaneType={}));const C={[a.VerticalPlaneType.PLANE]:r.LineType.LINE, [a.VerticalPlaneType.HALF_PLANE]:r.LineType.RAY},p=l.create(),x=l.create(),u=k.create(),B=k.create(),e=k.create(),t=k.create(),F=k.create(),y=k.create(),D=k.create(),I=z.create(),S={start:k.create(),end:k.create(),type:r.LineType.LINE},M={start:k.create(),end:k.create(),type:r.LineType.LINE};Object.defineProperty(a,"LineType",{enumerable:!0,get:()=>r.LineType});a.intersectLineAndPoint=f;a.intersectLineLikeAndCircle=A;a.intersectLineLikeAndVerticalCylinder=function({start:G,end:K,type:L},R,H){const V= [];K=g.subtract(u,K,G);var O=d.subtract(x,G,R);R=d.squaredLength(K);const N=2*d.dot(K,O);H=d.squaredLength(O)-H*H;H=N*N-4*R*H;0===H?(R=-N/(2*R),(L===r.LineType.LINE||0<=R)&&V.push(g.scaleAndAdd(k.create(),G,K,R))):0K+R||eal.fromValues(L,R))};a.isClose=n;a.isPointInsidePlane=q;a.pointToLineLikeDistance=v;a.pointToVerticalCylinderDistance=function(G,K,L){return d.distance(G,K)-L};a.pointToVerticalPlaneDistance=function(G,K){return v(m(S,G[2],K),G)};a.pointsInsidePlane=function(G,K){return K.filter(L=>q(G,L))};a.projectPointToLineLike=w;a.projectPointToVerticalCylinder=function(G,K,L,R=k.create()){const H=d.subtract(p,G,K),V=d.length(H);d.scaleAndAdd(R,K,H,0===V?1:L/V);R[2]=G[2];return R};a.projectPointToVerticalPlane= function(G,K,L){return w(G,m(S,G[2],K),L)};a.vectorsHaveCloseZ=function(G,K){return n(G[2],K[2])};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/geometry2dUtils":function(){define(["exports","../../core/mathUtils","../../core/libs/gl-matrix-2/math/vec2","../../core/libs/gl-matrix-2/factories/vec2f64"],function(a,b,d,l){function g(c,f){return c[0]*f[1]-c[1]*f[0]}function k(c,f,m){f=d.dot(m,f)/d.squaredLength(m);return d.scale(c,m,f)}function h(c,f,m,n,q=m){d.subtract(E, n,m);d.subtract(w,f,q);k(v,w,E);return d.add(c,q,v)}function z(c,f,m,n){d.subtract(E,f,m);f=n/d.length(E);return d.scaleAndAdd(c,m,E,f)}a.LineType=void 0;(function(c){c[c.RAY=0]="RAY";c[c.LINE=1]="LINE"})(a.LineType||(a.LineType={}));const E=l.create(),r=l.create(),w=l.create(),v=l.create();a.cross=g;a.intersectCircleAndPoint=function(c,f,m){z(w,m,c,f);return b.floatEqualAbsolute(w[0],m[0])&&b.floatEqualAbsolute(w[1],m[1])?[l.clone(m)]:[]};a.intersectLineAndPoint=function(c,f){h(w,f,c.start,c.end); return b.floatEqualAbsolute(w[0],f[0])&&b.floatEqualAbsolute(w[1],f[1])?[l.clone(f)]:[]};a.intersectLineAndRay=function(c,f){const m=c.start;var n=f.start,q=f.end;const A=d.subtract(E,c.end,m);var C=d.subtract(r,q,n);q=g(A,C);if(1E-6>=Math.abs(q))return[];n=d.subtract(w,m,n);C=g(C,n)/q;q=g(A,n)/q;if(0<=C){if(0<=q||f.type===a.LineType.LINE)return[d.scaleAndAdd(v,m,A,C)]}else if(c.type===a.LineType.LINE&&(0<=q||f.type===a.LineType.LINE))return[d.scaleAndAdd(v,m,A,C)];return[]};a.intersectLineLikeAndCircle= function(c,f,m){const n=[],q=d.subtract(E,c.end,c.start);var A=d.subtract(r,c.start,f);f=d.squaredLength(q);const C=2*d.dot(q,A);m=d.squaredLength(A)-m*m;m=C*C-4*f*m;0===m?(f=-C/(2*f),(c.type===a.LineType.LINE||0<=f)&&n.push(d.scaleAndAdd(v,c.start,q,f))):0q.layer===this.layer)}get valid(){const {_valid:q,snappingSource:A,layer:C}=this;return A&&C?q:!1}get subtypeFilter(){const {layer:q,snappingSource:A}=this;if(!c.isSubtypeGroupLayer(q)|| !q.subtypes?.length||!A)return{mode:"not-in-use",filter:null};const C=A.layerSource.sublayerSources.filter(x=>x.enabled&&x.layer.visible&&m.scaleBoundsPredicate(this.view?.scale,x.layer.effectiveScaleRange.minScale,x.layer.effectiveScaleRange.maxScale)).map(x=>x.layer.subtypeCode);if(!C.length)return{mode:"none-visible",filter:null};if(C.length===q.subtypes.length)return{mode:"all-visible",filter:null};const p=q.fieldsIndex.get(q.subtypeField)?.name??q.subtypeField;return 1===C.length?{mode:"in-use", filter:`${p} = ${C.getItemAt(0)}`}:{mode:"in-use",filter:`${p} IN (${C.join(", ")})`}}get floorFilter(){const {view:q,layer:A}=this;return q&&A?v.getFloorFilterClause({view:q,layer:A}):null}constructor(q){super(q);this._valid=this.rulesTable=this.snappingSource=this.layer=null}initialize(){if(this.snappingSource&&this.layer){var {layer:q,snappingSource:A}=this;"refresh"in q&&this.addHandles(q.on("refresh",()=>A.refresh()));this.loadRules();this.addHandles([g.watch(()=>A.updating,C=>A.layerSource.updating= C,g.syncAndInitial),g.watch(()=>A.availability,C=>A.layerSource.availability=C,g.syncAndInitial)])}else this._valid=!1}getFetchCandidatesParameters(q,A,C){if(!this.valid)return[];const {layer:p,layerView:x,floorFilter:u,rulesTable:B,subtypeFilter:e}=this;q={distance:C,mode:this.view?.type??"2d",point:q,coordinateHelper:A.coordinateHelper,returnEdge:!0,vertexMode:"all",filter:x&&"filter"in x?x.filter:null};u&&(q.filter=n(q.filter,u));if("not-in-use"!==e.mode&&"all-visible"!==e.mode){if("none-visible"=== e.mode)return[];q.filter?q.filter.where=k.sqlAnd(q.filter.where,e.mode):q.filter=new w({where:e.filter})}if(!this.attributeRulesEnabled)return[q];C=A.feature;const t="subtype-sublayer"===C?.sourceLayer?.type?C.sourceLayer.parent:C?.sourceLayer;if(B&&C&&f.isUtilityNetworkWebMap(this.view?.map)&&(c.isFeatureLayer(p)||c.isSubtypeGroupLayer(p))&&p.layerId&&(c.isFeatureLayer(t)||c.isSubtypeGroupLayer(t))&&this.view.map.utilityNetworks?.find(y=>y.isUtilityLayer(t))){if("loaded"!==B.loadStatus)return[]; A=[];var F=p.layerId;F=B.getFeatureSQL(t,C)?.[F];if(!F)return[];C=F.anyVertex;(F=F.endVertex)&&C&&F===C&&(F="");F&&A.push({...q,returnEdge:!1,vertexMode:"ends",filter:n(q.filter,F)});C&&A.push({...q,returnEdge:!1,vertexMode:"all",filter:n(q.filter,C)});return A}return[q]}async loadRules(){this._valid=null;const {layer:q,view:A,attributeRulesEnabled:C}=this;if(C&&q&&A&&f.isUtilityNetworkWebMap(A?.map)&&(c.isFeatureLayer(q)||c.isSubtypeGroupLayer(q)))try{await Promise.allSettled(A.map.utilityNetworks?.map(x=> x.load())??[]);const p=A.map.utilityNetworks?.find(x=>x.isUtilityLayer(q));p&&(this.rulesTable=await p.getRulesTable(),await this.rulesTable?.load())}catch(p){this._valid=!1;l.getLogger("esri.views.interactive.snapping.FeatureSnappingSourceInfo").error("Failed to load rules table for snapping source",q.title);return}this._valid=!0}remove(){this.destroy()}destroy(){this.snappingSource?.destroy()}};b.__decorate([h.property({constructOnly:!0})],a.FeatureSnappingSourceInfo.prototype,"layer",void 0);b.__decorate([h.property({constructOnly:!0})], a.FeatureSnappingSourceInfo.prototype,"snappingSource",void 0);b.__decorate([h.property({constructOnly:!0})],a.FeatureSnappingSourceInfo.prototype,"view",void 0);b.__decorate([h.property({value:!1})],a.FeatureSnappingSourceInfo.prototype,"attributeRulesEnabled",null);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype,"layerView",null);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype,"rulesTable",void 0);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype, "valid",null);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype,"subtypeFilter",null);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype,"floorFilter",null);b.__decorate([h.property()],a.FeatureSnappingSourceInfo.prototype,"_valid",void 0);a.FeatureSnappingSourceInfo=b.__decorate([r.subclass("esri.views.interactive.snapping.FeatureSnappingSourceInfo")],a.FeatureSnappingSourceInfo);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/floorFilterUtils":function(){define(["exports"], function(a){function b(d,l){if(!d?.length)return null;d=d.filter(g=>""!==g).map(g=>`'${g}'`);d.push("''");return`${l} IN (${d.join(",")}) OR ${l} IS NULL`}a.getFloorFilterClause=function(d){const l=d.layer;return"floorInfo"in l&&l.floorInfo?.floorField&&"floors"in d.view?b(d.view.floors,l.floorInfo.floorField):null};a.getLayerFloorFilterClause=function(d,l){return"floorInfo"in l&&l.floorInfo?.floorField?b(d,l.floorInfo.floorField):null};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/interactive/snapping/snappingUtils":function(){define("exports ../../../core/reactiveUtils ../../../core/SetUtils ../../../core/sql ../../../core/timeUtils ../../../chunks/vec32 ../../../layers/graphics/dehydratedPoint ../../../rest/support/Query ../../input/InputManager ../keybindings ../sketch/normalizedPoint ../../../webmap/utils".split(" "),function(a,b,d,l,g,k,h,z,E,r,w,v){function c(m,n){const q=m.x-n.x;m=m.y-n.y;return q*q+m*m}a.LineSegmentHintType=void 0;(function(m){m[m.TARGET= 0]="TARGET";m[m.REFERENCE=1]="REFERENCE";m[m.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(a.LineSegmentHintType||(a.LineSegmentHintType={}));const f=Symbol("snapping-toggle");a.editEdgeToSnappingEdge=function(m,n,q){return{left:w.fromAnyMapPoint(m.leftVertex.pos,n,q),right:w.fromAnyMapPoint(m.rightVertex.pos,n,q)}};a.isUtilityNetworkWebMap=function(m){return v.isWebMap(m)&&"utilityNetworks"in m&&!!m.utilityNetworks?.length};a.makeFilter=function(m){return m.createQuery()};a.makeSnappingQuery=function({point:m, distance:n,returnEdge:q,vertexMode:A,coordinateHelper:{spatialReference:C},filter:p},x,u){u=null!=u?u.clone():new z({where:"1\x3d1"});if(p){u.geometry=p.geometry;u.distance=p.distance;u.spatialRelationship=p.spatialRelationship;u.where=l.sqlAnd(u.where,p.where);u.timeExtent=g.mergeTimeExtents(u.timeExtent,p.timeExtent);var B=u;var e=u.objectIds;p=p.objectIds;e=e||p?p?e?Array.from(d.intersection(new Set(e),new Set(p))):p:e:null;B.objectIds=e}return{point:h.makeDehydratedPoint(m[0],m[1],m[2],C.toJSON()), mode:x,distance:n,returnEdge:q,vertexMode:A,query:u.toJSON()}};a.objectEqual=function(m,n){const q=m.length===n.length&&m[0]===n[0]&&m[1]===n[1];switch(m.length){case 2:return q;case 3:return q&&m[2]===n[2];case 4:return q&&m[2]===n[2]&&m[3]===n[3]}return!1};a.screenDistance=function(m,n){return Math.sqrt(c(m,n))};a.setupSnappingToggleHandles=function(m,n=()=>{}){const q=b.watch(()=>({view:m.view,snappingOptions:m.snappingOptions}),({view:A,snappingOptions:C})=>{m.removeHandles(f);if(A&&C){var p= E.ViewEventPriorities.TOOL;A=[A.on("key-down",x=>{x.key!==r.snappingKeys.toggle||x.repeat||(C.enabledToggled=!0,n())},p),A.on("key-up",x=>{x.key===r.snappingKeys.toggle&&(C.enabledToggled=!1,n())},p),A.on("pointer-move",x=>{x=x.native.ctrlKey;C.enabledToggled!==x&&(C.enabledToggled=x,n())},p)];m.addHandles(A,f)}},b.syncAndInitial);m.addHandles(q)};a.sortCandidatesInPlace=function(m,n){n.sort((q,A)=>{q=k.squaredDistance(q.targetPoint,m);A=k.squaredDistance(A.targetPoint,m);return q-A})};a.squaredScreenDistance= c;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/webmap/utils":function(){define(["exports"],function(a){a.isWebMap=function(b){return null!=b&&"object"===typeof b&&"declaredClass"in b&&"esri.WebMap"===b.declaredClass};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/candidates/DrapedEdgeSnappingCandidate":function(){define(["exports","../../sketch/constraints","../snappingUtils","./FeatureSnappingCandidate","../hints/LineSnappingHint"], function(a,b,d,l,g){class k extends l.FeatureSnappingCandidate{constructor(h){super({...h,isDraped:!0,constraint:new b.DrapedLineConstraint(h.edgeStart,h.edgeEnd,h.getGroundElevation)})}get hints(){return[new g.LineSnappingHint(d.LineSegmentHintType.REFERENCE,this.constraint.start,this.constraint.end,this.isDraped,this.domain)]}}a.DrapedEdgeSnappingCandidate=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/candidates/FeatureSnappingCandidate":function(){define(["exports", "../SnappingDomain","./SnappingCandidate"],function(a,b,d){class l extends d.SnappingCandidate{constructor({targetPoint:g,objectId:k,constraint:h,isDraped:z}){super(g,h,z,b.SnappingDomain.FEATURE);this.objectId=k}}a.FeatureSnappingCandidate=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/candidates/SnappingCandidate":function(){define(["exports"],function(a){class b{constructor(d,l,g,k){this.targetPoint=d;this.constraint=l;this.isDraped=g;this.domain= k}}a.SnappingCandidate=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/hints/LineSnappingHint":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../chunks/vec32 ../SnappingDomain ./SnappingHint".split(" "),function(a,b,d,l,g,k){class h extends k.SnappingHint{constructor(z,E,r,w,v=g.SnappingDomain.ALL,c=!0,f=!0){super(w,v);this.type=z;this.lineStart=E;this.lineEnd=r;this.fadeLeft=c;this.fadeRight=f}equals(z){return z instanceof h?this.type===z.type&&l.exactEquals(this.lineStart,z.lineStart)&&l.exactEquals(this.lineEnd,z.lineEnd)&&this.fadeLeft===z.fadeLeft&&this.fadeRight===z.fadeRight:!1}get length(){return l.distance(this.lineStart,this.lineEnd)}}a.LineSnappingHint=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/hints/SnappingHint":function(){define(["exports"],function(a){class b{constructor(d,l){this.isDraped=d;this.domain=l}}a.SnappingHint=b;Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/candidates/EdgeSnappingCandidate":function(){define(["exports","../../sketch/constraints","../snappingUtils","./FeatureSnappingCandidate","../hints/LineSnappingHint"],function(a,b,d,l,g){class k extends l.FeatureSnappingCandidate{constructor(h){super({...h,constraint:new b.LineConstraint(h.edgeStart,h.edgeEnd)})}get hints(){return[new g.LineSnappingHint(d.LineSegmentHintType.REFERENCE,this.constraint.start,this.constraint.end, this.isDraped,this.domain)]}}a.EdgeSnappingCandidate=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/candidates/RightAngleSnappingCandidate":function(){define("exports ../SnappingDomain ../snappingUtils ./SnappingCandidate ../hints/LineSnappingHint ../hints/RightAngleSnappingHint".split(" "),function(a,b,d,l,g,k){class h extends l.SnappingCandidate{constructor({targetPoint:z,constraint:E,previousVertex:r,otherVertex:w,otherVertexType:v,isDraped:c, selfSnappingType:f,objectId:m,domain:n}){super(z,E,c,n??b.SnappingDomain.SELF);this.previousVertex=r;this.otherVertex=w;this.otherVertexType=v;this.selfSnappingType=f??a.SelfSnappingRightAngleType.None;this.objectId=m??null}get hints(){const z=this.previousVertex,E=this.otherVertexType===a.OtherVertexType.CENTER?this.otherVertex:this.targetPoint,r=this.otherVertexType===a.OtherVertexType.CENTER?this.targetPoint:this.otherVertex;return[new g.LineSnappingHint(d.LineSegmentHintType.TARGET,E,r,this.isDraped, this.domain),new g.LineSnappingHint(d.LineSegmentHintType.REFERENCE,z,E,this.isDraped,this.domain),new k.RightAngleSnappingHint(this.previousVertex,E,r,this.isDraped,this.domain)]}}a.OtherVertexType=void 0;(function(z){z[z.NEXT=0]="NEXT";z[z.CENTER=1]="CENTER"})(a.OtherVertexType||(a.OtherVertexType={}));a.SelfSnappingRightAngleType=void 0;(function(z){z[z.None=0]="None";z[z.LastVertex=1]="LastVertex";z[z.FirstVertex=2]="FirstVertex";z[z.ExistingEdge=3]="ExistingEdge"})(a.SelfSnappingRightAngleType|| (a.SelfSnappingRightAngleType={}));a.RightAngleSnappingCandidate=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/hints/RightAngleSnappingHint":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../chunks/vec32 ../SnappingDomain ./SnappingHint".split(" "),function(a,b,d,l,g,k){class h extends k.SnappingHint{constructor(z,E,r,w,v=g.SnappingDomain.ALL){super(w,v);this.previousVertex=z;this.centerVertex=E;this.nextVertex= r}equals(z){return z instanceof h?l.exactEquals(this.previousVertex,z.previousVertex)&&l.exactEquals(this.centerVertex,z.centerVertex)&&l.exactEquals(this.nextVertex,z.nextVertex):!1}}a.RightAngleSnappingHint=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/support/viewUtils":function(){define("exports ../../../core/screenUtils ../../../core/libs/gl-matrix-2/math/vec2 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../layers/graphics/dehydratedPoint ../../../support/elevationInfoUtils".split(" "), function(a,b,d,l,g,k,h){function z(m,n,q,A,C=g.create()){m=l.copy(w,m);m[2]=h.getConvertedElevationFromVector(A,m,n,q)||0;A.renderCoordsHelper.toRenderCoords(m,n,C);return C}function E(m,n,q,A){if("2d"===A.type)return r.x=m[0],r.y=m[1],r.spatialReference=n,A.toScreen(r);z(m,n,q,A,w);A.state.camera.projectToScreen(w,f);return b.createScreenPoint(f[0],f[1])}const r=k.makeDehydratedPoint(0,0,0,null),w=g.create(),v=b.createRenderScreenPointArray(),c=b.createRenderScreenPointArray(),f=b.createScreenPointArray(); a.anyMapPointToRender=function(m,n,q,A,C=g.create()){m=n.toXYZ(m);m[2]=h.getConvertedElevationFromVector(A,m,n.spatialReference,q)||0;A.renderCoordsHelper.toRenderCoords(m,n.spatialReference,C);return C};a.anyMapPointToScreenPoint=function(m,n,q,A){return E(n.toXYZ(m),n.spatialReference,q,A)};a.renderScreenSpaceTangent=function(m,n,q,A){q.projectToRenderScreen(m,v);q.projectToRenderScreen(n,c);d.subtract(A,c,v);d.normalize(A,A)};a.vectorToRender=z;a.vectorToScreenPoint=E;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/interactive/snapping/SelfSnappingEngine":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Collection ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ./LineSnapper ./ParallelLineSnapper ./RightAngleSnapper ./RightAngleTriangleSnapper ./SnappingDomain ./snappingUtils".split(" "),function(a,b,d,l,g,k,h,z,E,r,w,v,c, f,m){a.SelfSnappingEngine=class extends d{constructor(n){super(n);this.updating=!1;this._snappers=new l;this._domain=f.SnappingDomain.SELF}initialize(){this._snappers.push(new w.ParallelLineSnapper(this.view,this.options),new r.LineSnapper(this.view,this.options),new v.RightAngleSnapper(this.view,this.options),new c.RightAngleTriangleSnapper(this.view,this.options))}set options(n){this._set("options",n);for(const q of this._snappers)q.options=n}async fetchCandidates(n,q,A){if(!(q&this._domain&&this.options.effectiveSelfEnabled))return[]; q=[];for(const C of this._snappers.items)for(const p of C.snap(n,A))q.push(p);m.sortCandidatesInPlace(n,q);return q}};b.__decorate([g.property({readOnly:!0})],a.SelfSnappingEngine.prototype,"updating",void 0);b.__decorate([g.property({constructOnly:!0})],a.SelfSnappingEngine.prototype,"view",void 0);b.__decorate([g.property()],a.SelfSnappingEngine.prototype,"options",null);a.SelfSnappingEngine=b.__decorate([E.subclass("esri.views.interactive.snapping.SelfSnappingEngine")],a.SelfSnappingEngine);Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/LineSnapper":function(){define("exports ../../../core/Cyclical ../../../core/quantityUtils ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../support/elevationInfoUtils ../sketch/normalizedPoint ./SnappingAlgorithm ./snappingUtils ./candidates/LineSnappingCandidate ../support/viewUtils ../../support/angularMeasurementUtils ../../support/geodesicLengthMeasurementUtils ../../support/geometry3dUtils ../../support/geometry2dUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f){function m(q,A,C,p,{spatialReference:x}){var u=w.radiansGeographicBetweenVec(A,C,x,x);if(null==u)return!1;const B=w.radiansGeographicBetweenVec(C,p,x,x);if(null==B)return!1;A=v.geodesicDistance(C,p,x);if(null==A)return!1;u=Math.abs(b.cyclicalPI.shortestSignedDiff(u,B))>Math.PI/2?b.cyclical2PI.normalize(u+Math.PI):u;w.pointFromDistanceAlongAzimuth(q,C,x,d.valueInUnit(A,"meters"),d.createAngle(u,"radians","geographic"),"geodesic");q[2]=p[2];return!0}class n extends h.SnappingAlgorithm{snapNewVertex(q, A){var C=A.editGeometryOperations.data.components[0],p=C.edges.length;const x=[];if(1>p)return x;var {spatialReference:u}=A;u=r.vectorToScreenPoint(q,u,g.absoluteHeightElevationInfo,this.view);const {view:B}=this;p=C=C.edges[p-1];do{if(this.edgeExceedsShortLineThreshold(p,A)){const e=z.editEdgeToSnappingEdge(p,B,A);this._processCandidateProposal(e.left,e.right,q,u,A,x)}p=p.leftVertex.leftEdge}while(p&&p!==C);return x}snapExistingVertex(q,A){const C=[],p=A.vertexHandle;var x=p.component;if(2>x.edges.length)return C; const {view:u}=this;var {spatialReference:B}=A;B=r.vectorToScreenPoint(q,B,g.absoluteHeightElevationInfo,u);var e=p.leftEdge,t=p.rightEdge;e&&t&&this.edgeExceedsShortLineThreshold(e,A)&&this.edgeExceedsShortLineThreshold(t,A)&&this._processCandidateProposal(k.fromAnyMapPoint(e.leftVertex.pos,u,A),k.fromAnyMapPoint(t.rightVertex.pos,u,A),q,B,A,C);e=x=x.edges[0];do e!==p.leftEdge&&e!==p.rightEdge&&this.edgeExceedsShortLineThreshold(e,A)&&(t=z.editEdgeToSnappingEdge(e,u,A),this._processCandidateProposal(t.left, t.right,q,B,A,C)),e=e.rightVertex.rightEdge;while(e&&e!==x);return C}_processCandidateProposal(q,A,C,p,x,u){const {spatialReference:B,pointer:e}=x,t=l.create();m(t,q,A,C,x)||(c.projectPointToLineLike(C,{start:q,end:A,type:f.LineType.LINE},t),t[2]=C[2]);C=k.markAsTarget(k.fromVec3(t));z.squaredScreenDistance(p,r.vectorToScreenPoint(C,B,g.absoluteHeightElevationInfo,this.view))this.squaredShortLineThreshold}isVertical(r,w,{spatialReference:v}){v=b.getMetersPerUnitForSR(v);return d.distance(g.asVec2(r),g.asVec2(w))*vq)return C;const {view:p}=this,x=r.vectorToScreenPoint(f,m.spatialReference,l.absoluteHeightElevationInfo,p);A=g.fromAnyMapPoint(n.vertices[A-1].pos,p,m);const u=g.fromAnyMapPoint(n.vertices[0].pos,p,m);q=n=n.edges[q-1];do{if(this.edgeExceedsShortLineThreshold(q,m)){const B=z.editEdgeToSnappingEdge(q,p,m);this._checkEdgeForParallelLines(B, A,f,x,m,C);this._checkEdgeForParallelLines(B,u,f,x,m,C)}q=q.leftVertex.leftEdge}while(q&&q!==n);return C}snapExistingVertex(f,m){const n=[],q=m.vertexHandle;var A=q.component;if(3>A.edges.length)return n;const {view:C}=this,p=r.vectorToScreenPoint(f,m.spatialReference,l.absoluteHeightElevationInfo,C),x=q.leftEdge,u=q.rightEdge,B=A.vertices[0],e=g.fromAnyMapPoint(B.pos,C,m),t=A.vertices[A.vertices.length-1],F=g.fromAnyMapPoint(t.pos,C,m);let y=A=A.edges[0];do{if(y!==x&&y!==u&&this.edgeExceedsShortLineThreshold(y, m)){const D=z.editEdgeToSnappingEdge(y,C,m);x&&this._checkEdgeForParallelLines(D,g.fromAnyMapPoint(x.leftVertex.pos,C,m),f,p,m,n);u&&this._checkEdgeForParallelLines(D,g.fromAnyMapPoint(u.rightVertex.pos,C,m),f,p,m,n);q===B?this._checkEdgeForParallelLines(D,F,f,p,m,n):q===t&&this._checkEdgeForParallelLines(D,e,f,p,m,n)}y=y.rightVertex.rightEdge}while(y&&y!==A);return n}_checkEdgeForParallelLines(f,m,n,q,A,C){var p=f.left;const x=f.right;w.projectPointToLine(c,g.asVec2(m),g.asVec2(p),g.asVec2(x));if(!(b.squaredDistance(c, g.asVec2(m))new E.LineSnappingHint(h.LineSegmentHintType.REFERENCE,v.edge.left,v.edge.right,this.isDraped,this.domain,v.fadeLeft,v.fadeRight))]}addReferenceLine(v){const c={edge:v,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach(f=>{b.exactEquals(v.right,f.edge.left)&&(f.fadeLeft=!1,c.fadeRight=!1);b.exactEquals(v.right,f.edge.right)&&(f.fadeRight=!1,c.fadeRight=!1);b.exactEquals(v.left,f.edge.right)&&(f.fadeRight=!1,c.fadeLeft= !1);b.exactEquals(v.left,f.edge.left)&&(f.fadeLeft=!1,c.fadeLeft=!1)});this._referenceLines.push(c)}}a.ParallelLineSnappingCandidate=w;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/hints/ParallelSnappingHint":function(){define("exports ../../../../core/has ../../../../core/Logger ../../../../chunks/vec32 ../SnappingDomain ./SnappingHint".split(" "),function(a,b,d,l,g,k){class h extends k.SnappingHint{constructor(z,E,r,w=g.SnappingDomain.ALL){super(r, w);this.lineStart=z;this.lineEnd=E}equals(z){return z instanceof h?l.exactEquals(this.lineStart,z.lineStart)&&l.exactEquals(this.lineEnd,z.lineEnd):!1}}a.ParallelSnappingHint=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/RightAngleSnapper":function(){define("exports ../../../core/Cyclical ../../../core/quantityUtils ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../support/elevationInfoUtils ../sketch/constraints ../sketch/normalizedPoint ./SnappingAlgorithm ./snappingUtils ./candidates/RightAngleSnappingCandidate ../support/viewUtils ../../support/angularMeasurementUtils ../../support/geodesicLengthMeasurementUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n){function q(x,u,B,e,{spatialReference:t}){u=m.radiansGeographicBetweenVec(u,B,t,t);if(null==u)return!1;var F=m.radiansGeographicBetweenVec(B,e,t,t);if(null==F)return!1;F=Math.sign(b.cyclical2PI.shortestSignedDiff(u,F))*Math.PI*.5;u=d.createAngle(u+F,"radians","geographic");F=h.create();e=n.geodesicDistance(B,e,t);if(null==e)return!1;m.pointFromDistanceAlongAzimuth(F,B,t,d.valueInUnit(e,"meters"),u,"geodesic");k.subtract(x,F,B);return!0}class A extends w.SnappingAlgorithm{snapNewVertex(x, u){var B=u.editGeometryOperations.data.components[0];const e=[];if(2>B.vertices.length)return e;var {view:t}=this;t=f.vectorToScreenPoint(x,u.spatialReference,z.absoluteHeightElevationInfo,t);const F=B.vertices.at(-1);this._checkForSnappingCandidate(c.SelfSnappingRightAngleType.LastVertex,e,F.leftEdge,F,F.leftEdge.leftVertex,x,t,u);B=B.vertices[0];this._checkForSnappingCandidate(c.SelfSnappingRightAngleType.FirstVertex,e,B.rightEdge,B,B.rightEdge.rightVertex,x,t,u);return e}snapExistingVertex(x,u){const B= [];var e=u.vertexHandle;if(3>e.component.vertices.length)return B;var {view:t}=this;t=f.vectorToScreenPoint(x,u.spatialReference,z.absoluteHeightElevationInfo,t);var F=e.leftEdge;e=e.rightEdge;F?.leftVertex.leftEdge&&(F=F.leftVertex.leftEdge,this._checkForSnappingCandidate(c.SelfSnappingRightAngleType.ExistingEdge,B,F,F.rightVertex,F.leftVertex,x,t,u));e?.rightVertex.rightEdge&&(e=e.rightVertex.rightEdge,this._checkForSnappingCandidate(c.SelfSnappingRightAngleType.ExistingEdge,B,e,e.leftVertex,e.rightVertex, x,t,u));return B}_checkForSnappingCandidate(x,u,B,e,t,F,y,D){if(this.edgeExceedsShortLineThreshold(B,D)){B=this.view;e=r.fromAnyMapPoint(e.pos,B,D);t=r.fromAnyMapPoint(t.pos,B,D);B=p;if(!q(B,t,e,F,D)){const I=l.subtract(C,r.asVec2(e),r.asVec2(t));k.set(B,I[1],-I[0],0)}this._checkForSnappingCandidateAlongProjectedRay(x,u,t,e,p,F,y,D)}}_checkForSnappingCandidateAlongProjectedRay(x,u,B,e,t,F,y,D){const {spatialReference:I,pointer:S}=D;var M=l.subtract(C,r.asVec2(F),r.asVec2(e));M=l.dot(t,M)/l.squaredLength(t); const G=l.scaleAndAdd(C,r.asVec2(e),t,M);F=r.markAsTarget(r.fromValues(G[0],G[1],F[2]));v.squaredScreenDistance(y,f.vectorToScreenPoint(F,I,z.absoluteHeightElevationInfo,this.view))>this.squaredProximityThreshold(S)||this.isVertical(F,e,D)||this.isVertical(e,B,D)||(t=k.scaleAndAdd(h.create(),e,t,Math.sign(M)),u.push(new c.RightAngleSnappingCandidate({targetPoint:F,constraint:new E.VerticalHalfPlaneConstraint(e,r.fromVec3(t)),previousVertex:B,otherVertex:e,otherVertexType:c.OtherVertexType.CENTER, selfSnappingType:x,isDraped:"on-the-ground"===D.elevationInfo?.mode})))}}const C=g.create(),p=h.create();a.RightAngleSnapper=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/RightAngleTriangleSnapper":function(){define("exports ../../../core/libs/gl-matrix-2/math/vec2 ../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../support/elevationInfoUtils ../sketch/normalizedPoint ./SnappingAlgorithm ./snappingUtils ./candidates/RightAngleTriangleSnappingCandidate ../support/viewUtils ../../support/geometry2dUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r){class w extends k.SnappingAlgorithm{snapNewVertex(c,f){var m=f.editGeometryOperations.data.components[0];const n=[];var q=m.vertices.length;if("polygon"!==f.editGeometryOperations.data.type||2>q)return n;var {view:A}=this;q=m.vertices[q-1];m=g.fromAnyMapPoint(m.vertices[0].pos,A,f);A=g.fromAnyMapPoint(q.pos,A,f);this._processCandidateProposal(m,A,c,f,n);return n}snapExistingVertex(c,f){const m=[];var n=f.vertexHandle,q=n.component;if(2>q.edges.length||"polyline"===f.editGeometryOperations.data.type&& (0===n.index||n.index===q.vertices.length-1))return m;const {view:A}=this;q=g.fromAnyMapPoint(n.leftEdge.leftVertex.pos,A,f);n=g.fromAnyMapPoint(n.rightEdge.rightVertex.pos,A,f);this._processCandidateProposal(q,n,c,f,m);return m}_processCandidateProposal(c,f,m,n,q){if(this.exceedsShortLineThreshold(c,f,n)){var A=b.lerp(v,g.asVec2(c),g.asVec2(f),.5),C=.5*b.distance(g.asVec2(c),g.asVec2(f));A=r.projectPointToCircle(v,g.asVec2(m),A,C);A=g.markAsTarget(g.fromValues(A[0],A[1],m[2]));var {spatialReference:p, pointer:x}=n;m=E.vectorToScreenPoint(m,p,l.absoluteHeightElevationInfo,this.view);h.squaredScreenDistance(m,E.vectorToScreenPoint(A,p,l.absoluteHeightElevationInfo,this.view))u.layer===x.layer.parent);q?q.sublayerSources.includes(x)||q.sublayerSources.add(x):x.layer.parent&&(q=new E({layer:x.layer.parent}),q.sublayerSources.add(x),n.add(q))}for(var A of n)q=A.sublayerSources.filter(x=>!m.includes(x)),A.sublayerSources.removeMany(q);n.removeMany(n.filter(x=>0===x.sublayerSources.length));f=f.filter(v);A=this._get("_effectiveFeatureSources")??new l;const {added:C,removed:p}=d.difference(A.toArray(),[...f,...n]);A.removeMany(p);A.addMany(C); return A}};a.__decorate([k.property()],b.prototype,"enabled",void 0);a.__decorate([k.property()],b.prototype,"enabledToggled",void 0);a.__decorate([k.property()],b.prototype,"forceDisabled",void 0);a.__decorate([k.property()],b.prototype,"selfEnabled",void 0);a.__decorate([k.property()],b.prototype,"featureEnabled",void 0);a.__decorate([k.property()],b.prototype,"attributeRulesEnabled",void 0);a.__decorate([k.property({type:l.ofType(E)})],b.prototype,"featureSources",void 0);a.__decorate([k.property()], b.prototype,"distance",void 0);a.__decorate([k.property()],b.prototype,"touchSensitivityMultiplier",void 0);a.__decorate([k.property({readOnly:!0})],b.prototype,"effectiveEnabled",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"effectiveSelfEnabled",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"effectiveFeatureEnabled",null);a.__decorate([k.property({readOnly:!0})],b.prototype,"_effectiveFeatureSources",null);return b=a.__decorate([z.subclass("esri.views.interactive.snapping.SnappingOptions")], b)})},"esri/views/interactive/snapping/FeatureSnappingLayerSource":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Collection ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,d,l,g,k,h,z){b=class extends b{constructor(E){super(E);this.layer=null;this.enabled=!0;this.updating=!1;this.availability=1;this.sublayerSources=new d}}; a.__decorate([l.property({constructOnly:!0})],b.prototype,"layer",void 0);a.__decorate([l.property()],b.prototype,"enabled",void 0);a.__decorate([l.property()],b.prototype,"updating",void 0);a.__decorate([l.property()],b.prototype,"availability",void 0);a.__decorate([l.property()],b.prototype,"sublayerSources",void 0);return b=a.__decorate([z.subclass("esri.views.interactive.snapping.FeatureSnappingLayerSource")],b)})},"esri/views/interactive/snapping/candidates/IntersectionSnappingCandidate":function(){define(["exports", "../../sketch/constraints","../SnappingDomain","./SnappingCandidate","../hints/IntersectionSnappingHint"],function(a,b,d,l,g){class k extends l.SnappingCandidate{constructor(h,z,E,r){super(h,new b.PointConstraint(h),r,d.SnappingDomain.ALL);this.first=z;this.second=E}get hints(){this.first.targetPoint=this.targetPoint;this.second.targetPoint=this.targetPoint;return[...this.first.hints,...this.second.hints,new g.IntersectionSnappingHint(this.targetPoint,this.isDraped,this.domain)]}}a.IntersectionSnappingCandidate= k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/hints/IntersectionSnappingHint":function(){define(["exports","../../../../chunks/vec32","../SnappingDomain","./SnappingHint"],function(a,b,d,l){class g extends l.SnappingHint{constructor(k,h,z=d.SnappingDomain.ALL){super(h,z);this.intersectionPoint=k}equals(k){return k instanceof g?b.exactEquals(this.intersectionPoint,k.intersectionPoint):!1}}a.IntersectionSnappingHint=g;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/views/support/hitTestSelectUtils":function(){define(["exports"],function(a){function b(d){return"graphic"===d?.type}a.filterGraphicHits=function(d){return d.filter(b)};a.findFirstGraphicHit=function(d){return d.find(b)??null};a.hitTestSelectSimilarDistance=async function(d,l){if("2d"===d.type)return d.hitTest(l);d=await d.hitTest(l);if(0===d.results.length)return d;l=d.results[0];const g=1.05*(l.distance??0),k=d.results.findIndex(h=>(h.distance??0)>g);-1!==k&&(d.results= d.results.slice(0,k));l&&d.ground.distance>g&&(d.ground.mapPoint=null);return d};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Sketch/support/OperationHandle":function(){define("exports ../../../chunks/tslib.es6 ../../../core/compilerUtils ../../../core/Evented ../../../core/accessorSupport/decorators/property ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,d,l,g,k,h,z){a.OperationHandle=class extends l.EventedAccessor{constructor(E){super(E); this.cancelled=!1;this.history={undo:[],redo:[]};this.type=null}get tool(){if(!this.activeComponent)return null;switch(this.activeComponent.type){case "graphic-mover":case "move-3d":return"move";case "box":case "transform-3d":return"transform";case "reshape":case "reshape-3d":return"reshape";case "draw-2d":case "draw-3d":return this.activeComponent.geometryType;default:d.neverReached(this.activeComponent)}return null}addToHistory(E){this.history.redo=[];this.history.undo.push(E)}resetHistory(){this.history.redo= [];this.history.undo=[]}canUndo(){return 0{this.canUndo()&&E()})}set redo(E){this._set("redo",()=>{this.canRedo()&&E()})}};b.__decorate([g.property()], a.OperationHandle.prototype,"activeComponent",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"cancelled",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"history",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"tool",null);b.__decorate([g.property()],a.OperationHandle.prototype,"type",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"canUndo",null);b.__decorate([g.property()],a.OperationHandle.prototype,"canRedo",null);b.__decorate([g.property()], a.OperationHandle.prototype,"onEnd",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"undo",null);b.__decorate([g.property()],a.OperationHandle.prototype,"redo",null);b.__decorate([g.property()],a.OperationHandle.prototype,"toggleTool",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"addToSelection",void 0);b.__decorate([g.property()],a.OperationHandle.prototype,"removeFromSelection",void 0);a.OperationHandle=b.__decorate([z.subclass("esri.widgets.Sketch.support.OperationHandle")], a.OperationHandle);a.CreateOperationHandle=class extends a.OperationHandle{};b.__decorate([g.property()],a.CreateOperationHandle.prototype,"activeComponent",void 0);a.CreateOperationHandle=b.__decorate([z.subclass("esri.widgets.Sketch.support.OperationHandle.CreateOperationHandle")],a.CreateOperationHandle);a.UpdateOperationHandle=class extends a.OperationHandle{};b.__decorate([g.property()],a.UpdateOperationHandle.prototype,"activeComponent",void 0);a.UpdateOperationHandle=b.__decorate([z.subclass("esri.widgets.Sketch.support.OperationHandle.UpdateOperationHandle")], a.UpdateOperationHandle);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/Sketch/VisibleElements":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../support/SnappingControls/VisibleElements".split(" "),function(a,b,d,l,g,k,h,z){let E=class extends b{constructor(w){super(w);this.mesh=this.multipoint=this.circle= this.rectangle=this.polygon=this.polyline=this.point=!0}};a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"point",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"polyline",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"polygon",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"rectangle",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"circle",void 0);a.__decorate([d.property({type:Boolean, nonNullable:!0})],E.prototype,"multipoint",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],E.prototype,"mesh",void 0);E=a.__decorate([h.subclass("esri.widgets.Sketch.VisibleElements.CreateToolVisibilityMap")],E);let r=class extends b{constructor(w){super(w);this["rectangle-selection"]=!0;this["lasso-selection"]=!0;this["custom-selection"]=!0}};a.__decorate([d.property({nonNullable:!0})],r.prototype,"rectangle-selection",void 0);a.__decorate([d.property({nonNullable:!0})],r.prototype, "lasso-selection",void 0);a.__decorate([d.property({nonNullable:!0})],r.prototype,"custom-selection",void 0);r=a.__decorate([h.subclass("esri.widgets.Sketch.VisibleElements.SelectionToolVisibilityMap")],r);b=class extends b{constructor(w){super(w);this.createTools=new E;this.directionModePicker=!1;this.labelsToggle=this.duplicateButton=!0;this.selectionTools=new r;this.snappingControls=this.settingsMenu=!0;this.snappingControlsElements=new z;this.undoRedoMenu=this.tooltipsToggle=!0}};a.__decorate([d.property({type:E, nonNullable:!0})],b.prototype,"createTools",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"directionModePicker",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"duplicateButton",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"labelsToggle",void 0);a.__decorate([d.property({type:r,nonNullable:!0})],b.prototype,"selectionTools",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"settingsMenu", void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"snappingControls",void 0);a.__decorate([d.property({type:z,nonNullable:!0})],b.prototype,"snappingControlsElements",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"tooltipsToggle",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"undoRedoMenu",void 0);return b=a.__decorate([h.subclass("esri.widgets.Sketch.VisibleElements")],b)})},"esri/widgets/support/SnappingControls/VisibleElements":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,d,l,g,k,h){b=class extends b{constructor(z){super(z);this.featureEnabledToggle=this.enabledToggle=!0;this.header=!1;this.selfEnabledToggle=this.layerListToggleLayersButton=this.layerList=!0}};a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"enabledToggle",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"featureEnabledToggle",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"header",void 0);a.__decorate([d.property({type:Boolean, nonNullable:!0})],b.prototype,"layerList",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"layerListToggleLayersButton",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"selfEnabledToggle",void 0);return b=a.__decorate([h.subclass("esri.widgets.support.SnappingControls.VisibleElements")],b)})},"esri/widgets/support/globalCss":function(){define(["exports"],function(a){a.globalCss={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled", button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation", loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table", widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/SelectionToolbar":function(){define("require ../../chunks/tslib.es6 ../../core/deprecate ../../core/handleUtils ../../core/Logger ../../core/maybe ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/RandomLCG ../../core/has ../../core/accessorSupport/decorators/subclass ../Widget ../../chunks/componentsUtils ./globalCss ./widgetUtils ./decorators/messageBundle ./jsxFactory ./SelectionToolbar/SelectionToolbarViewModel".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A){const C={lassoTool:!0,rectangleTool:!0},p={createTool:"polygon",mode:"freehand"},x={createTool:"rectangle"};E=class extends v{constructor(u,B){super(u,B);this.messages=this.activeToolInfo=this._viewModelHandlesGroup=null;this.toolConfigs=[];this.viewModel=new A;this.visibleElements={...C};this._viewModelHandlesGroup=l.handlesGroup([this.viewModel.on("complete",e=>{this._set("activeToolInfo",null);this.emit("complete",e)})])}destroy(){this._viewModelHandlesGroup= k.removeMaybe(this._viewModelHandlesGroup)}loadDependencies(){return c.loadCalciteComponents({action:()=>new Promise((u,B)=>a(["../../chunks/calcite-action"],u,B)),icon:()=>new Promise((u,B)=>a(["../../chunks/calcite-icon"],u,B))})}get label(){return this.messages?.widgetLabel??""}set label(u){this._overrideIfSome("label",u)}get layers(){d.deprecatedProperty(g.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."});return this.viewModel.sources}set layers(u){d.deprecatedProperty(g.getLogger(this), "layers",{replacement:"Use SelectionToolbar.sources instead."});this.viewModel.sources=u}get sources(){return this.viewModel.sources}set sources(u){this.viewModel.sources=u}get view(){return this.viewModel.view}set view(u){this.viewModel.view=u}castVisibleElements(u){return{...C,...u}}get visibleToolCount(){const {view:u,toolConfigs:B,visibleElements:e}=this;return(B?.length??0)+("2d"===u?.type?(e.lassoTool?1:0)+(e.rectangleTool?1:0):0)}activate(u){this.cancel();if("disabled"!==this.viewModel.state)switch(u){case "lasso":this._activateTool("lasso"); break;case "rectangle":this._activateTool("rectangle");break;default:this._activateTool(u)}}cancel(){this.viewModel.cancel();this._set("activeToolInfo",null)}render(){return q.tsx("div",{"aria-label":this.label,class:this.classes("esri-selection-toolbar",f.globalCss.widget)},q.tsx("div",{class:"esri-selection-toolbar__container"},this._renderDefaultTools(),this._renderCustomTools()))}_renderDefaultTools(){if("2d"===this.view?.type)return[this._renderRectangleTool(),this._renderLassoTool()]}_renderCustomTools(){if(this.toolConfigs?.length)return this.toolConfigs.map(({toolName:u, icon:B})=>q.tsx("calcite-action",{active:this.activeToolInfo?.toolName===u,bind:this,class:"esri-selection-toolbar__tool-button",disabled:"disabled"===this.viewModel.state,onclick:()=>this._onCustomToolClick(u),scale:"s",text:u,title:u},q.tsx("calcite-icon",{icon:B||"selection",scale:"s"})))}_renderLassoTool(){const {activeToolInfo:u,messages:B,visibleElements:e}=this;if(e.lassoTool){var t=B.selectByLasso;return q.tsx("calcite-action",{active:"lasso"===u?.toolName,bind:this,disabled:"disabled"=== this.viewModel.state,onclick:this._onLassoToolClick,scale:"s",text:t,title:t},q.tsx("calcite-icon",{icon:"lasso-select",scale:"s"}))}}_renderRectangleTool(){const {activeToolInfo:u,messages:B,visibleElements:e}=this;if(e.rectangleTool){var t=B.selectByRectangle;return q.tsx("calcite-action",{active:"rectangle"===u?.toolName,bind:this,disabled:"disabled"===this.viewModel.state,onclick:this._onRectangleToolClick,scale:"s",text:t,title:t},q.tsx("calcite-icon",{icon:"cursor-marquee",scale:"s"}))}}_onCustomToolClick(u){this._toggleTool(u)}_onLassoToolClick(){this._toggleTool("lasso")}_onRectangleToolClick(){this._toggleTool("rectangle")}_activateTool(u){var B= this._getToolOptions(u);B&&(B=this.viewModel.activate(B))&&this._set("activeToolInfo",{toolName:u,operation:B})}_toggleTool(u){if(this.activeToolInfo){const B=this.activeToolInfo.toolName;this.cancel();if(B===u)return}this._activateTool(u)}_getToolOptions(u){return"lasso"===u?p:"rectangle"===u?x:this.toolConfigs.find(B=>B.toolName===u)}};b.__decorate([h.property({readOnly:!0})],E.prototype,"activeToolInfo",void 0);b.__decorate([h.property()],E.prototype,"label",null);b.__decorate([h.property()],E.prototype, "layers",null);b.__decorate([h.property(),n.messageBundle("esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar")],E.prototype,"messages",void 0);b.__decorate([h.property()],E.prototype,"sources",null);b.__decorate([h.property()],E.prototype,"toolConfigs",void 0);b.__decorate([h.property()],E.prototype,"view",null);b.__decorate([h.property()],E.prototype,"viewModel",void 0);b.__decorate([h.property()],E.prototype,"visibleElements",void 0);b.__decorate([z.cast("visibleElements")],E.prototype, "castVisibleElements",null);b.__decorate([h.property()],E.prototype,"visibleToolCount",null);return E=b.__decorate([w.subclass("esri.widgets.support.SelectionToolbar")],E)})},"esri/widgets/support/SelectionToolbar/SelectionToolbarViewModel":function(){define("../../../chunks/tslib.es6 ../../../core/deprecate ../../../core/Evented ../../../core/handleUtils ../../../core/Logger ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../layers/support/layerUtils ../../../views/draw/support/layerUtils ../../../views/support/layerViewUtils ../Selector2D/SelectionOperation".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m){d=class extends d.EventedAccessor{constructor(n){super(n);this.sources=this.activeOperation=this._operationHandlesGroup=null}initialize(){this.addHandles([h.watch(()=>this._sources,n=>{this.activeOperation&&(this.activeOperation.sources=n)})])}destroy(){this._operationHandlesGroup=k.removeMaybe(this._operationHandlesGroup)}get _sources(){const {sources:n,view:q}=this;return q&&n?.length?n.flatMap(A=>{if(f.isSelectableLayerView2D(A))return A;if(v.isKnowledgeGraphLayer(A)|| v.isLinkChartLayer(A)){var C=A.layers||[];const p=C.map(x=>{const u=c.findLayerView(q,x)||void 0;return f.isSelectableLayerView2D(u)?u:x});return p.length?p.toArray():C.length?C.toArray():A}C=c.findLayerView(q,A)||void 0;return f.isSelectableLayerView2D(C)?C:A}):[]}get layers(){b.deprecatedProperty(g.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."});return this.sources}set layers(n){b.deprecatedProperty(g.getLogger(this),"layers",{replacement:"Use SelectionToolbar.sources instead."}); this.sources=n}get state(){const {_sources:n,view:q}=this;return this.activeOperation?"active":q?.ready&&(n?.length||q?.selectionManager.sources.length)?"ready":"disabled"}cancel(){"active"===this.state&&(this.activeOperation?.cancel(),this._set("activeOperation",null))}activate(n){const {_sources:q,state:A,view:C}=this;if("disabled"!==A&&(q?.length||C?.selectionManager.sources.length)&&this.view)return"active"===A&&this.cancel(),n=new m({view:this.view,sources:q,options:n}),this._operationHandlesGroup= l.handlesGroup([n.selection.on("change",p=>this.emit("selection-change",p)),n.once("complete",p=>this._onOperationComplete(p))]),this._set("activeOperation",n),n}_onOperationComplete(n){this._operationHandlesGroup=k.removeMaybe(this._operationHandlesGroup);this._set("activeOperation",null);this.emit("complete",n)}};a.__decorate([z.property()],d.prototype,"_sources",null);a.__decorate([z.property({readOnly:!0})],d.prototype,"activeOperation",void 0);a.__decorate([z.property()],d.prototype,"layers", null);a.__decorate([z.property()],d.prototype,"sources",void 0);a.__decorate([z.property({readOnly:!0})],d.prototype,"state",null);a.__decorate([z.property()],d.prototype,"view",void 0);return d=a.__decorate([w.subclass("esri.widgets.support.SelectionToolbar.SelectionToolbarViewModel")],d)})},"esri/widgets/support/Selector2D/SelectionOperation":function(){define("../../../chunks/tslib.es6 ../../../geometry ../../../core/asyncUtils ../../../core/Collection ../../../core/Evented ../../../core/handleUtils ../../../core/promiseUtils ../../../core/screenUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../geometry/support/coordsUtils ../../../views/draw/DrawScreenTool ../../../views/interactive/keybindings ./selectorUtils ../../../geometry/Point ../../../geometry/Polygon".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A,C){b=class extends g.EventedAccessor{constructor(p){super(p);this.options=this._processTask=null;this.selection=new l;this.sources=null;this._process=h.debounce(async(x,u)=>{const {callback:B,selector:e,completed:t}=x,F=d.createTask(async y=>{const {sources:D,selection:I,view:S}=this;(D?.length||S?.selectionManager.sources.length)&&S?(e&&null!=D&&(y=await q.getSelectionFromGeometry({currentSelection:I,selector:e,signal:y,sources:D,view:S}),t&&S.selectionManager?.updateSelection({current:I.toArray(), ...y})),B&&B()):I.removeAll()});h.onAbort(u,()=>F.abort());this._processTask=F;return F.promise},100)}initialize(){this._setup()}cancel(){this.removeAllHandles();this._processTask?.abort()}async _setup(){const {view:p}=this;await p.whenReady();if(!this.destroyed){var x=this.options,u=x?.createTool??"rectangle",B=x?.mode??("polygon"===u?"click":"hybrid"),e=Symbol();this._tool=new m.DrawScreenTool({view:p,mode:B,geometryType:u});x?.selectOnComplete||this.addHandles(this._tool.on(["cursor-update","vertex-add", "vertex-remove"],()=>h.ignoreAbortErrors(this._process({selector:this._selectionArea}))),e);this.addHandles([p.on("key-down",t=>{if(!t.repeat)switch(t.key){case n.sketchKeys.constraint:this._tool.uniformSizeToggled=!0;t.stopPropagation();break;case n.sketchKeys.center:this._tool.centeredToggled=!0,t.stopPropagation()}}),p.on("key-up",t=>{switch(t.key){case n.sketchKeys.constraint:this._tool.uniformSizeToggled=!1;t.stopPropagation();break;case n.sketchKeys.center:this._tool.centeredToggled=!1,t.stopPropagation()}}), this._tool.on("complete",async t=>{this.removeHandles(e);const F=()=>{this.removeAllHandles();this.emit("complete",{aborted:t.aborted,selection:this.selection.toArray()})};t.aborted?(this.cancel(),this.selection.removeAll(),F()):await this._process({selector:this._selectionArea,callback:F,completed:!0})})],e);this.addHandles(k.makeHandle(()=>p.tools.remove(this._tool)));p.addAndActivateTool(this._tool)}}get _selectionArea(){const p=z.createScreenPoint();var x=this._tool.coordinates;const u=this.view.spatialReference, B=e=>{p.x=e[0];p.y=e[1];const {x:t,y:F}=this.view.toMap(p);return[t,F]};if(1===x.length){const [e,t]=B(x[0]);return new A({x:e,y:t,spatialReference:u})}x=this._tool.coordinates.map(B);if(0!==x.length)return f.isClockwise(x)||x.reverse(),new C({spatialReference:u,rings:[x]})}};a.__decorate([E.property()],b.prototype,"options",void 0);a.__decorate([E.property({readOnly:!0})],b.prototype,"selection",void 0);a.__decorate([E.property()],b.prototype,"sources",void 0);a.__decorate([E.property({constructOnly:!0})], b.prototype,"view",void 0);return b=a.__decorate([c.subclass("esri.widgets.support.Selector2D.SelectionOperation")],b)})},"esri/views/draw/DrawScreenTool":function(){define("exports ../../chunks/tslib.es6 ../../core/Evented ../../core/handleUtils ../../core/maybe ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../../core/libs/gl-matrix-2/factories/mat2df64 ./DrawOperation ./drawSurfaces ./support/createUtils ./support/surfaceCoordinateSystems ../interactive/InteractiveToolBase ../overlay/OutlineOverlayItem".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q){function A(C){switch(C){case "polygon":case "point":return C;case "circle":case "rectangle":return"segment"}}a.DrawScreenTool=class extends d.EventedMixin(n.InteractiveToolBase){constructor(C){super(C);this._overlayItem=void 0;this.mode=this.geometryType=null;this.type="draw-screen"}initialize(){this.drawOperation=this._makeDrawOperation();const C=p=>this.drawOperation.on(p,x=>{this._updateVisuals();this.emit(p,x)});this.addHandles([C("vertex-add"),C("vertex-remove"), C("vertex-update"),C("cursor-update"),C("complete")]);this.finishToolCreation()}destroy(){this.drawOperation=g.destroyMaybe(this.drawOperation);this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centeredToggled(C){this._set("centeredToggled",C);this._updateVisuals()}set enabled(C){this.drawOperation.interactive=C;this._set("enabled",C)}set uniformSizeToggled(C){this._set("uniformSizeToggled",C);this._updateVisuals()}get updating(){return this.drawOperation?.updating?? !1}get cursor(){return"point"===this.geometryType?"default":"crosshair"}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(C){if(!this.destroyed)this.drawOperation.onInputEvent(C)}redo(){this.drawOperation.redo()}undo(){this.drawOperation.undo()}reset(){}_makeDrawOperation(){const {view:C}=this;return new v.DrawOperation({view:C,manipulators:this.manipulators,geometryType:A(this.geometryType),drawingMode:this.mode,hasZ:!1,defaultZ:0,snapToSceneEnabled:!1,drawSurface:new c.ScreenDrawSurface, hasM:!1,snappingManager:null,snappingVisualizer:null,graphic:null,cursor:this.cursor})}get coordinates(){var {drawOperation:C}=this;if(!C?.geometryIncludingUncommittedVertices.length)return[];var {coordinateHelper:p}=C,x=C.committableVertex,u=C.committedVertices.slice();null!=x&&u.push(p.pointToArray(x));const B=u.length;switch(this.geometryType){case "circle":case "rectangle":p=new m.AffineCoordinateSystem(w.IDENTITY,c.ScreenDrawSurface.spatialReference);x="circle"===this.geometryType?f.createCircle: f.createSquare;const e="circle"===this.geometryType?f.createEllipse:f.createRectangle;return 1===B&&C.isCompleted?(u=u[0],C=p.makeMapPoint(u[0]+48,u[1]),x([u,C],p,!0)?.geometry.rings[0]??[]):2===B?(C=this.centeredToggled!==("rectangle"!==this.geometryType),(this.uniformSizeToggled!==("rectangle"!==this.geometryType)?x(u,p,C)?.geometry.rings[0]:e(u,p,C)?.geometry.rings[0])??[]):[]}return u}_updateVisuals(){if(!this._overlayItem){const C=new q({strokeDash:[5],strokeDashColor:[255,255,255,255]});this.view.overlay?.addItem(C); this.addHandles(l.makeHandle(()=>{this.view.overlay?.removeItem(C);C?.destroy();this._overlayItem=void 0}));this._overlayItem=C}this._overlayItem.coordinates=this.coordinates}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}};b.__decorate([k.property({value:!1})],a.DrawScreenTool.prototype,"centeredToggled",null);b.__decorate([k.property()],a.DrawScreenTool.prototype,"drawOperation",void 0);b.__decorate([k.property({value:!0})],a.DrawScreenTool.prototype,"enabled",null); b.__decorate([k.property({value:!1})],a.DrawScreenTool.prototype,"uniformSizeToggled",null);b.__decorate([k.property({constructOnly:!0})],a.DrawScreenTool.prototype,"geometryType",void 0);b.__decorate([k.property({constructOnly:!0})],a.DrawScreenTool.prototype,"mode",void 0);b.__decorate([k.property({readOnly:!0})],a.DrawScreenTool.prototype,"type",void 0);b.__decorate([k.property({readOnly:!0})],a.DrawScreenTool.prototype,"updating",null);b.__decorate([k.property({constructOnly:!0,nonNullable:!0})], a.DrawScreenTool.prototype,"view",void 0);b.__decorate([k.property()],a.DrawScreenTool.prototype,"cursor",null);a.DrawScreenTool=b.__decorate([r.subclass("esri.views.draw.DrawScreenTool")],a.DrawScreenTool);a.geometryTypeToDrawOperationGeometryType=A;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/libs/gl-matrix-2/factories/mat2df64":function(){define(["exports"],function(a){function b(){return[1,0,0,1,0,0]}function d(z){return[z[0],z[1],z[2],z[3],z[4],z[5]]}function l(z, E,r,w,v,c){return[z,E,r,w,v,c]}function g(z,E){return new Float64Array(z,E,6)}const k=b(),h=Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:k,clone:d,create:b,createView:g,fromValues:l},Symbol.toStringTag,{value:"Module"}));a.IDENTITY=k;a.clone=d;a.create=b;a.createView=g;a.fromValues=l;a.mat2df64=h;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/draw/DrawOperation":function(){define("exports ../../chunks/tslib.es6 ../../core/Accessor ../../core/Evented ../../core/lang ../../core/maybe ../../core/memoize ../../core/promiseUtils ../../core/ReactiveSet ../../core/reactiveUtils ../../core/screenUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/diffUtils ../../core/support/UpdatingHandles ../../layers/graphics/dehydratedFeatureComparison ../../support/elevationInfoUtils ../ViewingMode ./DrawingMode ./DrawManipulator ../interactive/coordinateHelper ../interactive/dragEventPipeline ../interactive/editGeometry/EditGeometry ../interactive/editGeometry/EditGeometryOperations ../interactive/sketch/constraints ../interactive/sketch/constraintUtils ../interactive/sketch/SketchLabelOptions ../interactive/snapping/SnappingContext ../interactive/snapping/SnappingDragPipelineStep ../interactive/snapping/SnappingOperation ../interactive/snapping/snappingUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A,C,p,x,u,B,e,t,F,y,D,I,S,M,G,K){const L=Symbol(),R=Symbol();a.DrawOperation=class extends l.EventedMixin(d){constructor(H){super(H);this._hideDefaultCursor=this._createOperationCompleted=!1;this._pointerDownStates=new E;this._stagedPointerType=this._stagedScreenPoint=null;this._updatingHandles=new q.UpdatingHandles;this._stagedPointerId=null;this.constraintsEnabled=!1;this.constraints=void 0;this._getPointConstraint=h.memoize(D.getPointConstraint);this._getPolylineOrPolygonConstraint= h.memoize(D.getPolylineOrPolygonConstraint);this.defaultZ=this.constraintZ=null;this.isDraped=!0;this.labelOptions=new I;this.cursor=null;this.loading=!1;this.secondToLastVertex=this.lastVertex=this.firstVertex=this.snapToSceneEnabled=null;null==H.elevationInfo&&(this.elevationInfo=C.getEffectiveElevationInfo(!!H.hasZ))}initialize(){const {geometryType:H,view:V}=this,O=V.spatialReference,N="viewingMode"in V.state?V.state.viewingMode:p.ViewingMode.Local,T="segment"===H||"multipoint"===H?"polyline": H;this.coordinateHelper=B.createCoordinateHelper(this.hasZ,this.hasM,O);this._editGeometryOperations=new F.EditGeometryOperations(new t.EditGeometry(T,this.coordinateHelper),N);this._snappingOperation=new G.SnappingOperation({view:V});this.addHandles([r.watch(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:ea,constraint:ma},wa)=>{const {snappingOptions:za}=this;za&&(za.forceDisabled=null!=ma&&y.isPoint(ma));if(null!=wa&&ea===wa.stagedPoint&&ma!==wa.constraint)return this._onKeyboardBasedChange(); this._processCursor(ea??this._screenToMap(this._stagedScreenPoint))},{equals:(ea,ma)=>ea.stagedPoint===ma.stagedPoint&&k.equalsMaybe(ea.constraint,ma.constraint)}),r.watch(()=>this.view.viewpoint,(ea,ma)=>{ea&&ma&&n.diff(ea,ma)&&this._onKeyboardBasedChange()})]);this._activeComponent=new t.Component(O,N);this._editGeometryOperations.data.components.push(this._activeComponent);const aa=this.segmentLabels;null!=aa&&(aa.context={view:V,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo, labelOptions:this.labelOptions},this.addHandles(r.watch(()=>this.labelOptions.enabled,ea=>{aa.visible=ea},r.syncAndInitial)));this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],ea=>{const ma=ea.vertices.map(Aa=>({componentIndex:0,vertexIndex:Aa.index,coordinates:this.coordinateHelper.vectorToArray(Aa.pos)})),wa=ma.map(Aa=>Aa.coordinates);var za=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;A.pointEquals(za, this.firstVertex)||(this.firstVertex=za);za=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;A.pointEquals(za,this.lastVertex)||(this.lastVertex=za);za=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;A.pointEquals(za,this.secondToLastVertex)||(this.secondToLastVertex=za);this._processCursor(this.cursorVertex);switch(ea.type){case "vertex-add":this.emit(ea.type,{...ea,added:wa,vertices:ma});break; case "vertex-update":this.emit(ea.type,{...ea,updated:wa,vertices:ma});break;case "vertex-remove":this.emit(ea.type,{...ea,removed:wa,vertices:ma})}}));const ha=this._manipulator=new u.DrawManipulator({consumesClicks:!1,grabbableForEvent:ea=>"click"!==this.drawingMode?!0:"touch"===ea.pointerType&&this._snappingEnabled&&1===this._pointerDownStates.size});this.manipulators.add(ha);ha.grabbable="point"!==H;this.addHandles([ha.events.on("immediate-click",ea=>this._onImmediateClick(ea)),ha.events.on("immediate-double-click", ea=>this._onImmediateDoubleClick(ea)),r.watch(()=>this.drawingMode,()=>{this.removeHandles(L);this.addHandles(this._createManipulatorDragPipeline(ha),L)},r.syncAndInitial),r.watch(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:ea})=>{ha.cursor=ea},r.syncAndInitial)]);K.setupSnappingToggleHandles(this,()=>{var ea=this._getSnappingContext(this.view.inputManager.latestPointerType??"mouse");null!=this.snappingManager&&(ea=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager, ea),this._updatingHandles.addPromise(z.ignoreAbortErrors(ea)))})}destroy(){k.destroyMaybe(this.segmentLabels);k.destroyMaybe(this._snappingOperation);this._editGeometryOperations=k.destroyMaybe(this._editGeometryOperations);this._updatingHandles.destroy()}get _isDragging(){const {_stagedPointerId:H,_manipulator:V}=this;return null!=H&&this._pointerDownStates.has(H)||V.grabbing||!V.interactive}get _snappingEnabled(){return null!=this.snappingManager&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const H= this._updateAndGetEffectiveDrawSurface();return"3d"===this.view.type&&this.drawSurface!==H}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(H=>this.coordinateHelper.vectorToArray(H.pos))}get _constraint(){const {constraints:H,constraintsEnabled:V}=this;if(H&&V)switch(this.geometryType){case "point":return this._getPointConstraint(H);case "polygon":case "polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex, this.secondToLastVertex,H)}}set drawingMode(H){this._set("drawingMode",H??x.defaultDrawingMode)}get effectiveCursor(){return this.loading?"progress":this._hideDefaultCursor?null:this.cursor||"crosshair"}get interactive(){return this._manipulator.interactive}set interactive(H){this._manipulator.interactive=H}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return null!=this.snappingManager?this.snappingManager.options: null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return"mouse"===this._stagedPointerType?this.cursorVertex:null}get committableVertex(){const {cursorVertex:H,lastVertex:V,firstVertex:O,geometryType:N}=this;return"polygon"===N&&A.pointNear(H,O)||A.pointNear(H,V)?null:H}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const {committedVertices:H,committableVertex:V,coordinateHelper:O}=this,N=H.slice();null!=V&&N.push(O.pointToArray(V)); return N}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const {committableVertex:H}=this;null!=H&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(H))}complete(H){H=H?.aborted||!1;this._snappingOperation.abort();this.snappingManager?.doneSnapping();const {geometryType:V,numCommittedVertices:O}=this,N="multipoint"===V&&0===O||"polyline"===V&&2>O||"polygon"===V&&3>O;"segment"!==V&&"point"!==V||this.commitStagedVertex();this._createOperationCompleted= !N;if(this.isCompleted||H)this._stagedPointerType=this._stagedPointerId=this._stagedScreenPoint=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((T,aa)=>({componentIndex:0,vertexIndex:aa,coordinates:T})),aborted:H,type:"complete"})}onInputEvent(H){switch(H.type){case "pointer-down":this._pointerDownStates.add(H.pointerId);break;case "pointer-up":this._pointerDownStates.delete(H.pointerId)}switch(H.type){case "pointer-move":return this._onPointerMove(H);case "hold":return this._onHold(H)}}redo(){this._editGeometryOperations.redo()}undo(){null!= this.snappingManager&&this.snappingManager.doneSnapping();this._editGeometryOperations.undo()}_processCursor(H){const V=g.clone(this.cursorVertex);H=(H=g.clone(H))&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(H)??H);H=this._snapToClosingVertex(H);H=this._applyConstraints(H);A.pointNear(V,H)||(this._set("cursorVertex",H),this.segmentLabels?.set("stagedVertex",null!=H?this.coordinateHelper.pointToVector(H):null),null==H||"mouse"!==this._stagedPointerType?this.emit("cursor-remove"):this.emit("cursor-update", {updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(H)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(H){if(null==H||this._isDragging||"polygon"!==this.geometryType||2>=this.numCommittedVertices)return H;const V=this._mapToScreen(H);if(!V)return H;const O=this._activeComponent;return this._vertexWithinPointerDistance(O.vertices[0].pos,V)?this.firstVertex:this._vertexWithinPointerDistance(O.vertices.at(-1).pos, V)?this.lastVertex:H}_createManipulatorDragPipeline(H){switch(this.drawingMode){case "click":return this._createManipulatorDragPipelineClick(H);case "freehand":return this._createManipulatorDragPipelineFreehand(H);case "hybrid":return this._createManipulatorDragPipelineHybrid(H)}}_createManipulatorDragPipelineClick(H){return e.createManipulatorDragEventPipeline(H,(V,O,N,T)=>{const aa="touch"===T&&this._snappingEnabled;if(!this.isCompleted&&aa){var {snappingStep:ha,cancelSnapping:ea}=M.createSnapDragEventPipelineStep({predicate:()=> aa,snappingManager:this.snappingManager,snappingContext:new S.SnappingContext({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:T,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});N=N.next(ma=>{aa&&null!=this.snappingManager&&this.snappingManager.doneSnapping();return ma}).next(ea);O.next(this._screenToMapDragEventStep()).next(ma=>{"start"===ma.action&& (this._processCursor(ma.mapStart),("segment"===this.geometryType||aa&&!this.numCommittedVertices)&&this.commitStagedVertex());return ma}).next(e.sceneSnappingAtLocation(this.view,this.elevationInfo)).next(...ha).next(ma=>{aa&&(this._processCursor(ma.mapEnd),"end"===ma.action&&this.commitStagedVertex());return ma}).next(ma=>{"end"===ma.action&&("mouse"!==this._stagedPointerType&&this._snappingOperation.abort(),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete());return ma})}})}_createManipulatorDragPipelineFreehand(H){return e.createManipulatorDragEventPipeline(H, (V,O)=>{this.isCompleted||O.next(this._screenToMapDragEventStep()).next(N=>{"start"===N.action&&(this._snappingOperation.abort(),null==this.committableVertex&&this._processCursor(N.mapStart),"segment"===this.geometryType&&this.commitStagedVertex());return N}).next(N=>{switch(N.action){case "start":case "update":this._processCursor(N.mapEnd);"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case "end":this.complete()}return N})})}_createManipulatorDragPipelineHybrid(H){return e.createManipulatorDragEventPipeline(H, (V,O)=>{this.isCompleted||O.next(this._screenToMapDragEventStep()).next(N=>{"start"===N.action&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),R),this._processCursor(N.mapStart),this.commitStagedVertex());return N}).next(N=>{switch(N.action){case "start":case "update":this._processCursor(N.mapEnd);"polygon"!==this.geometryType&&"polyline"!==this.geometryType||this.commitStagedVertex();break;case "end":"mouse"!==this._stagedPointerType&&this._snappingOperation.abort(), this.removeHandles(R),"segment"!==this.geometryType&&"point"!==this.geometryType||this.complete()}return N})})}get _drawAtFixedElevation(){const {constraintsEnabled:H,constraintZ:V,geometryType:O,numCommittedVertices:N}=this;return H?null!=V||"segment"===O&&0{"start"===V.action&&(H=this._screenToMap(V.screenStart));if(null==H)return null;const O=this._screenToMap(V.screenEnd);return null!=O?{...V,mapStart:H,mapEnd:O}:null}}_vertexWithinPointerDistance(H,V){const O=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(H)); null!=O?(H=O.x-V.x,V=O.y-V.y,V=25>=H*H+V*V):V=!1;return V}_getSnappingContext(H){const V=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new S.SnappingContext({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:H,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:null!=V?{value:V,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};b.__decorate([v.property()],a.DrawOperation.prototype,"_hideDefaultCursor", void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"_stagedPointerId",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"_isDragging",null);b.__decorate([v.property()],a.DrawOperation.prototype,"_snappingOperation",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"_snappingEnabled",null);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"graphic",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"constraintsEnabled",void 0);b.__decorate([v.property()], a.DrawOperation.prototype,"constraints",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"_constraint",null);b.__decorate([v.property()],a.DrawOperation.prototype,"constraintZ",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"defaultZ",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"isDraped",void 0);b.__decorate([v.property({value:x.defaultDrawingMode})],a.DrawOperation.prototype,"drawingMode",null);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype, "elevationDrawSurface",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"elevationInfo",void 0);b.__decorate([v.property({constructOnly:!0,type:I})],a.DrawOperation.prototype,"labelOptions",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"geometryType",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"hasM",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"hasZ",void 0);b.__decorate([v.property()], a.DrawOperation.prototype,"cursor",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"effectiveCursor",null);b.__decorate([v.property()],a.DrawOperation.prototype,"loading",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"manipulators",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"drawSurface",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"segmentLabels",void 0);b.__decorate([v.property({constructOnly:!0})], a.DrawOperation.prototype,"snappingManager",void 0);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"snappingVisualizer",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"snapToSceneEnabled",void 0);b.__decorate([v.property({readOnly:!0})],a.DrawOperation.prototype,"cursorVertex",null);b.__decorate([v.property({readOnly:!0})],a.DrawOperation.prototype,"visualizationCursorVertex",null);b.__decorate([v.property()],a.DrawOperation.prototype,"committableVertex",null); b.__decorate([v.property()],a.DrawOperation.prototype,"firstVertex",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"lastVertex",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"secondToLastVertex",void 0);b.__decorate([v.property()],a.DrawOperation.prototype,"updating",null);b.__decorate([v.property({constructOnly:!0})],a.DrawOperation.prototype,"view",void 0);a.DrawOperation=b.__decorate([m.subclass("esri.views.draw.DrawOperation")],a.DrawOperation);a.defaultCursor="crosshair"; a.defaultLoadingCursor="progress";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/core/memoize":function(){define(["exports"],function(a){a.memoize=function(b){let d,l=[],g,k=!1;return function(...h){var z;if(z=k&&d===this)a:if(h.length!==l.length)z=!1;else{for(z=0;zl.call(g,k,h,this),g)}has(l){a.trackAccess(this._observable);return this._set.has(l)}keys(){a.trackAccess(this._observable);return this._set.keys()}values(){a.trackAccess(this._observable);return this._set.values()}[Symbol.iterator](){a.trackAccess(this._observable);return this._set[Symbol.iterator]()}get [Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}return d})},"esri/layers/graphics/dehydratedFeatureComparison":function(){define(["exports", "../../core/has","../../core/mathUtils","../../geometry/support/spatialReferenceUtils"],function(a,b,d,l){function g(r,w){if(r===w)return!0;if(null==r||null==w||r.length!==w.length)return!1;for(let v=0;v{if("cancel"===t.action)null!=e&&(e.execute({action:"cancel"}),e=B=null);else{var F={action:t.action,screenStart:t.start,screenEnd:t.screenPoint};"start"===t.action&&null==B&&(B=new p,e=new p,u(x,B,e,t.pointerType,F));null!=B&&B.execute(F);"end"===t.action&&null!=B&&(e=B=null)}}}function c(x){let u=null;return B=>{"start"===B.action&&(u=m(x,B.mapStart.spatialReference));if(null==u)return null;const e=B.mapEnd.x-B.mapStart.x, t=B.mapEnd.y-B.mapStart.y,F=(B.mapEnd.z??0)-(B.mapStart.z??0);u.move(e,t,F,B.action);return{...B,translationX:e,translationY:t,translationZ:F}}}function f(x,u){return null==x?null:x.spatialReference.equals(u)?x.clone():h.project(x,u)}function m(x,u){const B=x.operations;if(!B)return null;const e=B.data.geometry;u=E.hydratedSpatialReference(u);if(e.spatialReference.equals(u))return n(x,B,()=>{});if("mesh"!==e.type){u=f(e,u);if(null==u)return null;const t=e.spatialReference;u=w.EditGeometryOperations.fromGeometry(u, B.viewingMode);return n(x,u,()=>{const F=h.project(e,t);B.trySetGeometry(F)})}if(z.isMeshWithRelativeVertexSpace(e)){u=f(e.origin,u);if(!u)return null;const t=e.spatialReference,F=w.EditGeometryOperations.fromGeometry(u,B.viewingMode);return n(x,B,()=>{const y=h.project(F.data.geometry,t);B.move(y.x-e.origin.x,y.y-e.origin.y,(y.z??0)-(e.origin.z??0))})}return null}function n(x,u,B){let e=0,t=0,F=0;return{move:(y,D,I,S)=>{"start"===S&&(F=t=e=0);y-=e;D-=t;I-=F;u.move(y,D,I);e+=y;t+=D;F+=I;B();"end"=== S&&x.endInteraction?.()}}}function q(x){const u=x.operations?.createResetState();return B=>{u?.remove();return B}}function A(x,u,B){const e=u.elevationProvider.getElevation(x.x,x.y,x.z??0,x.spatialReference,"scene")??0;x=E.clonePoint(x);x.z=e;x.hasZ=!0;x.z=r.getZForElevationMode(x,u,B);return x}const C=()=>{};class p{constructor(){this.execute=C}next(x,u=new p){null!=x&&(this.execute=B=>{B=x(B);null!=B&&u.execute(B)});return u}}a.EventPipeline=p;a.addMapDelta=function(){let x=0,u=0,B=0;return e=> {"start"===e.action&&(x=e.mapStart.x,u=e.mapStart.y,B=e.mapStart.z);const t=e.mapEnd.x-x,F=e.mapEnd.y-u,y=e.mapEnd.z-B;x=e.mapEnd.x;u=e.mapEnd.y;B=e.mapEnd.z;return{...e,mapDeltaX:t,mapDeltaY:F,mapDeltaZ:y,mapDeltaSpatialReference:e.mapStart.spatialReference}}};a.addScreenDelta=function(){let x=0,u=0;return B=>{"start"===B.action&&(x=B.screenStart.x,u=B.screenStart.y);const e=B.screenEnd.x-x,t=B.screenEnd.y-u;x=B.screenEnd.x;u=B.screenEnd.y;return{...B,screenDeltaX:e,screenDeltaY:t}}};a.constrainToMapAxis= function(x,u){const B=[x.x,x.y,x.z??0],e=[Math.cos(u),Math.sin(u)];x=Math.sqrt(e[0]*e[0]+e[1]*e[1]);if(0===x)return null;e[0]/=x;e[1]/=x;const t=F=>{const y=(F.x-B[0])*e[0]+(F.y-B[1])*e[1];F.x=B[0]+y*e[0];F.y=B[1]+y*e[1]};return F=>{t(F.mapStart);t(F.mapEnd);return{...F,axis:e}}};a.createDragEventPipelineCallback=v;a.createManipulatorDragEventPipeline=function(x,u){return x.events.on("drag",v(x,u))};a.dragAtLocation=function(x,u){let B=null,e=0,t=0;return F=>{"start"===F.action&&(B=x.toScreen?.(u), null!=B&&(0>B.x||B.x>x.width||0>B.y||B.y>x.height?B=null:(e=F.screenStart.x-B.x,t=F.screenStart.y-B.y)));if(null==B)return null;var y=g.clamp(F.screenEnd.x-e,0,x.width);const D=g.clamp(F.screenEnd.y-t,0,x.height);y=k.createScreenPoint(y,D);F.screenStart=B;F.screenEnd=y;return F}};a.dragManipulatedObject=c;a.dragManipulatedObjectMany=function(x){const u=x.map(B=>c(B)).filter(b.isSome);return B=>{const e=B.mapEnd.x-B.mapStart.x,t=B.mapEnd.y-B.mapStart.y,F=B.mapEnd.z-B.mapStart.z;u.forEach(y=>y(B)); return{...B,translationX:e,translationY:t,translationZ:F}}};a.resetManipulatedObject=q;a.resetManipulatedObjectMany=function(x){const u=x.map(B=>q(B)).filter(B=>null!=B);return B=>{u.forEach(e=>e(B));return B}};a.resetProperties=function(x,u){const B=new Map;for(const e of u)B.set(e,l.clone(x[e]));return e=>{B.forEach((t,F)=>{x[F]=t});return e}};a.sceneSnappingAtLocation=function(x,u,B=[]){if("2d"===x.type)return t=>t;let e=null;return t=>{"start"===t.action&&(e=x.toMap(t.screenStart,{exclude:B}), null!=e&&(e.z=r.getZForElevationMode(e,x,u)));const F=x.toMap(t.screenEnd,{exclude:B});null!=F&&(F.z=r.getZForElevationMode(F,x,u));return{...t,scenePoints:null!=e&&null!=F?{sceneStart:e,sceneEnd:F}:null}}};a.sceneSnappingAtProjectedLocation=function(x,u){if("2d"===x.type)return e=>e;let B=null;return e=>{"start"===e.action&&(B=A(e.mapStart,x,u));const t=A(e.mapEnd,x,u);return{...e,scenePoints:null!=B&&null!=t?{sceneStart:B,sceneEnd:t}:null}}};a.screenToMap=function(x,u=null,B){let e=null;const t= null==u||x.spatialReference?.equals(u)?y=>y:y=>null!=y?h.project(y,u):y,F={exclude:[],...B};return y=>{"start"===y.action&&(e=t(x.toMap(y.screenStart,F)));if(null==e)return null;const D=t(x.toMap(y.screenEnd,F));return null!=D?{...y,mapStart:e,mapEnd:D}:null}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/graphics/hydratedFeatures":function(){define("exports ../../geometry ../../Graphic ../../core/has ../../core/lang ../../core/typedArrayUtil ../../geometry/support/jsonUtils ./dehydratedPoint ../../geometry/SpatialReference".split(" "), function(a,b,d,l,g,k,h,z,E){function r(C){return"declaredClass"in C}function w(C){return"declaredClass"in C}function v(C){return"declaredClass"in C}function c(C){return null==C?null:r(C)?C:h.fromJSON(f(C))}function f(C){const {wkid:p,wkt:x,wkt2:u,latestWkid:B}=C.spatialReference,e={wkid:p,wkt:x,wkt2:u,latestWkid:B};switch(C.type){case "point":const {x:t,y:F,z:y,m:D}=C;return{x:t,y:F,z:y,m:D,spatialReference:e};case "polygon":const {rings:I,hasZ:S,hasM:M}=C;return{rings:m(I),hasZ:S,hasM:M,spatialReference:e}; case "polyline":const {paths:G,hasZ:K,hasM:L}=C;return{paths:m(G),hasZ:K,hasM:L,spatialReference:e};case "extent":const {xmin:R,xmax:H,ymin:V,ymax:O,zmin:N,zmax:T,mmin:aa,mmax:ha,hasZ:ea,hasM:ma}=C;return{xmin:R,xmax:H,ymin:V,ymax:O,zmin:N,zmax:T,mmin:aa,mmax:ha,hasZ:ea,hasM:ma,spatialReference:e};case "multipoint":const {points:wa,hasZ:za,hasM:Aa}=C;return{points:A(wa)?n(wa):wa,hasZ:za,hasM:Aa,spatialReference:e}}}function m(C){return q(C)?C.map(p=>n(p)):C}function n(C){return C.map(p=>Array.from(p))} function q(C){for(const p of C)if(0!==p.length)return A(p);return!1}function A(C){return 0{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation});e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation});e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices, operation:e.operation})})}destroy(){this._listener.remove()}splitEdge(u,B){return this._apply(new w.SplitEdge(this.data,u,B))}updateVertices(u,B,e=h.AccumulationBehavior.ACCUMULATE_STEPS){return this._apply(new E.UpdateVertices(this.data,u,B),e)}move(u,B,e,t=h.AccumulationBehavior.ACCUMULATE_STEPS){return k.isMeshEditGeometry(this.data)?this._apply(new f.MoveMesh(this.data,u,B,e),t):this.moveVertices(this.data.allVertices,u,B,e,t)}moveVertices(u,B,e,t,F=h.AccumulationBehavior.ACCUMULATE_STEPS){return k.isMeshEditGeometry(this.data)? this._apply(new f.MoveMesh(this.data,B,e,t),F):this.updateVertices(u,new m.MoveVertex(this.data.coordinateHelper,B,e,t),F)}scale(u,B,e,t,F=h.AccumulationBehavior.ACCUMULATE_STEPS,y=E.AccumulationType.CUMULATIVE){return this.scaleVertices(this.data.allVertices,u,B,e,t,F,y)}scaleVertices(u,B,e,t,F,y=h.AccumulationBehavior.ACCUMULATE_STEPS,D=E.AccumulationType.CUMULATIVE){return this.updateVertices(u,new A.ScaleVertex(B,e,t,F,D),y)}rotate(u,B,e=h.AccumulationBehavior.ACCUMULATE_STEPS,t=E.AccumulationType.CUMULATIVE){return this.rotateVertices(this.data.allVertices, u,B,e,t)}rotateVertices(u,B,e,t=h.AccumulationBehavior.ACCUMULATE_STEPS,F=E.AccumulationType.CUMULATIVE){return this.updateVertices(u,new q.RotateVertex(B,e,F),t)}removeVertices(u){return this._apply(new r.RemoveVertices(this.data,u,this._minNumVerticesPerType))}appendVertex(u){return 0===this.data.components.length?null:this._apply(new z.AppendVertex(this.data,this.data.components[0],u))}setVertexPosition(u,B){return this._apply(new v.SetVertexPosition(this.data,u,B))}offsetEdge(u,B,e,t=h.AccumulationBehavior.ACCUMULATE_STEPS){return this.updateVertices([B.leftVertex, B.rightVertex],new n.OffsetEdgeVertex(this.data.coordinateHelper,u,B,e),t)}trySetGeometry(u,B=h.AccumulationBehavior.ACCUMULATE_STEPS){const {data:e}=this,{coordinateHelper:t}=e;if(e.type===u.type&&e.spatialReference.equals(u.spatialReference)&&t.hasZ()===u.hasZ&&t.hasM()===u.hasM&&g.hasCompatibleTopology(e.geometry,u)&&!k.isMeshEditGeometry(e))return u=Array.from(k.EditGeometry.fromGeometry(u,this.viewingMode).iterateVertices(),F=>F.pos),this.setVertexPositions(u,B)}setVertexPositions(u,B=h.AccumulationBehavior.ACCUMULATE_STEPS){return this._apply(new C.SetAllVertexPositions(this.data, u),B)}createResetState(){if(k.isMeshEditGeometry(this.data))return this._createResetStateMesh();const u=this.data.geometry.clone();return d.makeHandle(()=>this.trySetGeometry(u))}closeComponent(u){return this.data.components.includes(u)?this._apply(new c.CloseComponent(this.data,u)):null}canRemoveVertex(u){return u.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const u=new p.UndoGroup;this._apply(u);return d.makeHandle(()=>u.close())}undo(){if(0{u.vertexSpace.origin=t})}const e=u.vertexAttributes.clonePositional();return d.makeHandle(()=>{u.vertexAttributes= e;u.vertexAttributesChanged()})}static fromGeometry(u,B){return new x(k.EditGeometry.fromGeometry(u,B),B)}}a.EditGeometryOperations=x;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/EditGeometry":function(){define("exports ../../../core/arrayUtils ../../../core/compilerUtils ../../../core/Evented ../../../geometry/Polygon ../../../geometry/Polyline ../coordinateHelper ./unnormalizationHelper".split(" "),function(a,b,d,l,g,k,h,z){function E(f,m, n){const q=f.coordinateHelper;n=new v(m.spatialReference,n);n.index=0;const A=new r(n);A.index=0;A.pos=q.pointToVector(m);n.vertices.push(A);f.components.push(n)}class r{constructor(f){this.component=f;this.rightEdge=this.leftEdge=null;this.type="vertex";this.index=null}get pos(){return this._pos}set pos(f){this._pos=f;this.component.unnormalizeVertexPositions()}}class w{constructor(f,m,n){this.component=f;this.leftVertex=m;this.rightVertex=n;this.type="edge";m.rightEdge=this;n.leftEdge=this}}class v{constructor(f, m){this._spatialReference=f;this._viewingMode=m;this.vertices=[];this.edges=[];this.index=null}unnormalizeVertexPositions(){1>=this.vertices.length||z.unnormalize(this.vertices,z.getUnnormalizationInfo(this._spatialReference,this._viewingMode))}updateVertexIndex(f,m){if(0!==this.vertices.length){var n=this.vertices[0],q=null;do q=f,q.index=m++,f=q.rightEdge?q.rightEdge.rightVertex:null;while(null!=f&&f!==n);q.leftEdge&&q!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(q), this.vertices.length-1)}}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return 2n.vertices.length)continue;const q=[];let A=n.vertices.find(p=>null==p.leftEdge);const C=A;do q.push(m(A.pos)),A=A.rightEdge?A.rightEdge.rightVertex:null;while(A&&A!==C);f.push(q)}return new k({paths:f,spatialReference:this.spatialReference, hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const f=[],m=this.coordinateHelper.vectorToArray;for(const n of this.components){if(1>n.vertices.length)continue;const q=[],A=n.vertices[0];let C=A;const p=C;do q.push(m(C.pos)),C=null!=C.rightEdge?C.rightEdge.rightVertex:null;while(C&&C!==p);n.isClosed()&&q.push(m(A.pos));f.push(q)}return new g({rings:f,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(f, m){var n=h.createCoordinateHelper(f.hasZ,f.hasM,f.spatialReference);n=new c(f.type,n);switch(f.type){case "polygon":var q=f.spatialReference,A=n.coordinateHelper;f=f.rings;for(var C=0;C{let w=r.pos[0];for(;wg.upperBoundX;)w-=z;k=Math.min(k,w);h=Math.max(h,w);r.pos[0]=w});var E=h-k;z-E{0>r.pos[0]&&(r.pos[0]+=z)})}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/interfaces":function(){define(["exports"], function(a){a.AccumulationBehavior=void 0;var b=a.AccumulationBehavior||(a.AccumulationBehavior={});b[b.NEW_STEP=0]="NEW_STEP";b[b.ACCUMULATE_STEPS=1]="ACCUMULATE_STEPS";Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/AppendVertex":function(){define(["exports","../EditGeometry"],function(a,b){class d{constructor(l,g,k){this._editGeometry=l;this._component=g;this._pos=k;this._right=this._left=this._originalEdge=this._addedVertex=null}apply(){let l= "redo";null==this._addedVertex&&(l="apply",this._addedVertex=new b.Vertex(this._component));const g=this._component.getLastVertex();if(null==g)this._component.vertices.push(this._addedVertex),this._addedVertex.pos=this._pos,this._addedVertex.index=0;else{let k=null;g.rightEdge&&(this._originalEdge=g.rightEdge,k=this._originalEdge.rightVertex,this._component.edges.splice(this._component.edges.indexOf(this._originalEdge),1));this._component.vertices.push(this._addedVertex);this._addedVertex.pos=this._pos; null==this._left&&(this._left=new b.Edge(this._component,g,this._addedVertex));this._component.edges.push(this._left);g.rightEdge=this._left;null!=this._originalEdge&&null!=k&&(null==this._right&&(this._right=new b.Edge(this._component,this._addedVertex,k)),this._component.edges.push(this._right),k.leftEdge=this._right);this._component.updateVertexIndex(this._addedVertex,g.index+1)}this._editGeometry.notifyChanges({operation:l,addedVertices:[this._addedVertex]})}undo(){null!=this._addedVertex&&(this._component.vertices.splice(this._component.vertices.indexOf(this._addedVertex), 1),null!=this._left&&(this._component.edges.splice(this._component.edges.indexOf(this._left),1),this._left.leftVertex.rightEdge=null),null!=this._right&&(this._component.edges.splice(this._component.edges.indexOf(this._right),1),this._right.rightVertex.leftEdge=null),null!=this._originalEdge&&(this._component.edges.push(this._originalEdge),this._originalEdge.leftVertex.rightEdge=this._originalEdge,this._originalEdge.rightVertex.leftEdge=this._originalEdge),null!=this._left?this._component.updateVertexIndex(this._left.leftVertex, this._left.leftVertex.index):this._component.updateVertexIndex(this._addedVertex,0),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this._addedVertex]}))}accumulate(){return!1}}a.AppendVertex=d;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/UpdateVertices":function(){define(["exports"],function(a){class b{constructor(d,l,g){this._editGeometry=d;this._vertices=l;this.operation=g;this._undone=!1}apply(){this._vertices.forEach(d=> this.operation.apply(d));this._editGeometry.components.forEach(d=>d.unnormalizeVertexPositions());this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(d=>this.operation.undo(d));this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices});this._undone=!0}canAccumulate(d){if(this._undone||d._vertices.length!==this._vertices.length)return!1;for(let l=0;lthis.operation.accumulate(l,d.operation)),this.operation.accumulateParams(d.operation),this._editGeometry.components.forEach(l=>l.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0):!1}}a.AccumulationType=void 0;(function(d){d[d.CUMULATIVE=0]="CUMULATIVE";d[d.REPLACE=1]="REPLACE"})(a.AccumulationType|| (a.AccumulationType={}));a.UpdateVertices=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/RemoveVertices":function(){define(["exports","../EditGeometry"],function(a,b){class d{constructor(l,g,k=0){this._editGeometry=l;this._vertices=g;this._minNumberOfVertices=k;this.removedVertices=null}apply(){let l="redo";if(null==this.removedVertices){const g=this.removedVertices=[];this._vertices.forEach(k=>{k=this._removeVertex(k);null!=k&&g.push(k)}); l="apply"}else this.removedVertices.forEach(g=>{this._removeVertex(g.removedVertex)});this._editGeometry.notifyChanges({operation:l,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(l=>{this._undoRemoveVertex(l)});this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(l){const g=l.component;if(g.vertices.length<=this._minNumberOfVertices)return null;const k={removedVertex:l,createdEdge:null},h=l.leftEdge,z=l.rightEdge; g.vertices.splice(g.vertices.indexOf(l),1);h&&(g.edges.splice(g.edges.indexOf(h),1),h.leftVertex.rightEdge=null);z&&(g.edges.splice(g.edges.indexOf(z),1),z.rightVertex.leftEdge=null);0===l.index&&z&&0l.unnormalizeVertexPositions());this._editGeometry.notifyChanges({operation:d,updatedVertices:[this._vertex]})}}a.SetVertexPosition=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/CloseComponent":function(){define(["exports","../../../../core/arrayUtils","../EditGeometry"],function(a, b,d){class l{constructor(g,k){this._editGeometry=g;this._component=k;this._createdEdge=null}apply(){let g="redo";if(null==this._createdEdge){g="apply";const k=this._component.getFirstVertex(),h=this._component.getLastVertex();if(this._component.isClosed()||3>this._component.vertices.length||null==k||null==h)return;this._createdEdge=new d.Edge(this._component,h,k)}this._createdEdge.leftVertex.rightEdge=this._createdEdge;this._createdEdge.rightVertex.leftEdge=this._createdEdge;this._component.edges.push(this._createdEdge); this._editGeometry.notifyChanges({operation:g})}undo(){null!=this._createdEdge&&(b.remove(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}}a.CloseComponent=l;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/MoveMesh":function(){define(["exports"],function(a){class b{constructor(d, l,g,k){this._editGeometry=d;this.dx=l;this.dy=g;this.dz=k;this._firstTime=!0}apply(){const d=this._firstTime?"apply":"redo";this._firstTime=!1;this._apply(d,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(d){const l=this._editGeometry.geometry;return d instanceof b&&d._editGeometry.geometry===l?(this._apply("apply",d.dx,d.dy,d.dz),this.dx+=d.dx,this.dy+=d.dy,this.dz+=d.dz,!0):!1}_apply(d,l,g,k){const h=this._editGeometry.geometry;h.offset(l,g,k);if(l=this._editGeometry.components[0].getFirstVertex())l.pos= this._editGeometry.coordinateHelper.pointToVector(h.anchor),this._editGeometry.notifyChanges({operation:d,updatedVertices:[l]})}}a.MoveMesh=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/MoveVertex":function(){define(["exports"],function(a){class b{constructor(d,l,g,k){this._helper=d;this.dx=l;this.dy=g;this.dz=k}_move(d,l,g,k){this._helper.addDelta(d.pos,l,g,k)}apply(d){this._move(d,this.dx,this.dy,this.dz)}undo(d){this._move(d,-this.dx, -this.dy,-this.dz)}canAccumulate(d){return d instanceof b}accumulate(d,l){this._move(d,l.dx,l.dy,l.dz)}accumulateParams(d){this.dx+=d.dx;this.dy+=d.dy;this.dz+=d.dz}}a.MoveVertex=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/OffsetEdgeVertex":function(){define("exports ../../../../core/mathUtils ../../../../core/libs/gl-matrix-2/math/vec2 ../../../../core/libs/gl-matrix-2/factories/vec2f64 ../../../../chunks/vec32 ../../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../../geometry/support/plane ../../../../geometry/support/vector ../../../support/geometry2dUtils".split(" "), function(a,b,d,l,g,k,h,z,E){class r{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(c,f,m,n=0,q=v.IMMEDIATE){this._helper=c;this._planeType=f;this._edge=m;this.distance=n;this._plane=h.create();this._offsetPlane=h.create();this._minDistance=-Infinity;this._maxDistance=Infinity;this._selectedArrow=1;q===v.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(); this._initializePlane();this._initializeDistanceConstraints()}_initializeNeighbors(){const c=this._toXYZ(this._edge.leftVertex.pos),f=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),m=this._toXYZ(this._edge.rightVertex.pos),n=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=g.direction(k.create(),c,m);f?(this._left=this._computeNeighbor(c,f,this._edgeDirection),this._right=this._computeNeighbor(m,n,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(m, n,this._edgeDirection),this._left=this._computeNeighbor(c,f,this._edgeDirection,this._right))}_toXYZ(c){return null!=c?this._helper.toXYZ(c):null}_pointToXYZ(c){return this._toXYZ(this._helper.pointToVector(c))}_computeNeighbor(c,f,m,n){const q=k.create();if(f)return g.direction(q,c,f),n=!this._passesBisectingAngleThreshold(q,m),{start:c,end:f,direction:n?this._bisectVectorsPerpendicular(m,q):q,isOriginalDirection:!n};this._helper.hasZ()?n&&(g.cross(q,m,n.direction),g.cross(q,q,m),g.normalize(q,q), Math.sign(q[1])!==Math.sign(m[0])&&g.scale(q,q,-1)):g.set(q,-m[1],m[0],0);return{start:c,end:f,direction:q,isOriginalDirection:!0}}_passesBisectingAngleThreshold(c,f){c=Math.abs(z.angle(f,c));return c>=w&&c<=Math.PI-w}_bisectVectorsPerpendicular(c,f){c=0>g.dot(c,f)?c:g.negate(k.create(),c);const m=Math.abs(g.dot(c,f));if(!(.001>m||.999g.dot(c,f)&&g.negate(f,f);h.fromPositionAndNormal(this._left.start,this._bisectDirection(c,f),this._plane)}_computeNormalDirection(c){c=g.cross(k.create(),c.direction,this._edgeDirection);g.normalize(c,c);c=g.cross(k.create(),this._edgeDirection,c);this._planeType===a.PlaneType.XY&&(c[2]=0);return g.normalize(c,c)}_initializeDistanceConstraints(){null==this._left.end||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(h.signedDistance(this._plane, this._left.end));null==this._right.end||this.requiresSplitEdgeRight||this._updateDistanceConstraint(h.signedDistance(this._plane,this._right.end));this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(c){0>=c&&(this._minDistance=Math.max(this._minDistance,c));0<=c&&(this._maxDistance=Math.min(this._maxDistance,c))}_updateIntersectDistanceConstraint(c){var f=h.getNormal(c);const m=this._edgeDirection;var n=g.add(k.create(),this._left.start,this._left.direction);const q=g.add(k.create(), this._right.start,this._right.direction);var A=this._pointInBasis2D(l.create(),f,m,this._left.start),C=this._pointInBasis2D(l.create(),f,m,n),p=this._pointInBasis2D(l.create(),f,m,this._right.start);f=this._pointInBasis2D(l.create(),f,m,q);[p]=E.intersectLineAndRay({start:C,end:A,type:E.LineType.LINE},{start:f,end:p,type:E.LineType.LINE});p&&(A=d.subtract(l.create(),A,C),d.normalize(A,A),C=d.subtract(l.create(),p,C),C=d.dot(A,C),n=g.add(k.create(),n,g.scale(k.create(),this._left.direction,-C)),c= h.signedDistance(c,n),this._updateDistanceConstraint(c))}_pointInBasis2D(c,f,m,n){c[0]=z.projectPointSignedLength(f,n);c[1]=z.projectPointSignedLength(m,n);return c}_offset(c,f){Number.isFinite(this._minDistance)&&(f=Math.max(this._minDistance,f));Number.isFinite(this._maxDistance)&&(f=Math.min(this._maxDistance,f));h.copy(this._offsetPlane,this._plane);this._offsetPlane[3]-=f;f=(n,q,A)=>null!=q&&h.intersectLine(this._offsetPlane,n,g.add(k.create(),n,q),A);const m=k.create();(c===this._edge.leftVertex? f(this._left.start,this._left.direction,m):f(this._right.start,this._right.direction,m))&&this._helper.copy(this._helper.fromXYZ(m,void 0,this._helper.getM(c.pos)),c.pos)}selectArrowFromStartPoint(c){this._selectedArrow=h.isPointInside(this.plane,this._pointToXYZ(c))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(c){return h.signedDistance(this.plane,this._pointToXYZ(c))}apply(c){this._offset(c,this.distance)}undo(c){this._offset(c,0)}canAccumulate(c){return c instanceof r&&this._edge.leftVertex.index===c._edge.leftVertex.index&&this._edge.rightVertex.index===c._edge.rightVertex.index&&this._edge.component===c._edge.component&&this._maybeEqualsVec3(this._left.direction,c._left.direction)&&this._maybeEqualsVec3(this._right.direction,c._right.direction)&&g.equals(h.getNormal(this._plane),h.getNormal(c._plane))}accumulate(c,f){this._offset(c,this._plane[3]-f._plane[3]+f.distance)}accumulateParams(c){this.distance=c.distance-c._plane[3]+this._plane[3]}clone(){const c= new r(this._helper,this._planeType,this._edge,this.distance,v.DEFERRED);h.copy(c._plane,this._plane);h.copy(c._offsetPlane,this._offsetPlane);c._maxDistance=this._maxDistance;c._minDistance=this._minDistance;c._left=this._cloneNeighbor(this._left);c._right=this._cloneNeighbor(this._right);c._edgeDirection=g.copy(k.create(),this._edgeDirection);return c}_maybeEqualsVec3(c,f){return null==c&&null==f||null!=c&&null!=f&&g.equals(c,f)}_cloneNeighbor({start:c,end:f,direction:m,isOriginalDirection:n}){return{start:g.copy(k.create(), c),end:null!=f?g.copy(k.create(),f):null,direction:g.copy(k.create(),m),isOriginalDirection:n}}}const w=b.deg2rad(15);a.PlaneType=void 0;(function(c){c[c.XYZ=0]="XYZ";c[c.XY=1]="XY"})(a.PlaneType||(a.PlaneType={}));var v;(function(c){c[c.IMMEDIATE=0]="IMMEDIATE";c[c.DEFERRED=1]="DEFERRED"})(v||={});a.OffsetEdgeVertex=r;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/RotateVertex":function(){define(["exports","../../../../core/arrayUtils", "../../../../core/libs/gl-matrix-2/math/vec2","./UpdateVertices"],function(a,b,d,l){class g{constructor(k,h,z=l.AccumulationType.CUMULATIVE){this.origin=k;this.angle=h;this._accumulationType=z}_rotate(k,h){d.rotate(k.pos,k.pos,this.origin,h)}apply(k){this._rotate(k,this.angle)}undo(k){this._rotate(k,-this.angle)}canAccumulate(k){return k instanceof g&&b.equals(this.origin,k.origin)}accumulate(k,h){this._rotate(k,h._accumulationType===l.AccumulationType.REPLACE?h.angle-this.angle:h.angle)}accumulateParams(k){this.angle= k._accumulationType===l.AccumulationType.REPLACE?k.angle:this.angle+k.angle}}a.RotateVertex=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/ScaleVertex":function(){define(["exports","../../../../core/arrayUtils","../../../../core/libs/gl-matrix-2/factories/vec2f64","../../../../core/libs/gl-matrix-2/math/vec2","./UpdateVertices"],function(a,b,d,l,g){class k{constructor(h,z,E,r,w=g.AccumulationType.CUMULATIVE){this.origin=h;this.axis1= z;this.factor1=E;this.factor2=r;this._accumulationType=w;this.axis2=d.fromValues(z[1],-z[0])}_scale(h,z,E){l.projectAndScale(h.pos,h.pos,this.origin,this.axis1,z);l.projectAndScale(h.pos,h.pos,this.origin,this.axis2,E)}apply(h){this._scale(h,this.factor1,this.factor2)}undo(h){this._scale(h,1/this.factor1,1/this.factor2)}canAccumulate(h){return h instanceof k&&b.equals(this.origin,h.origin)&&b.equals(this.axis1,h.axis1)}accumulate(h,z){z._accumulationType===g.AccumulationType.REPLACE?this._scale(h, z.factor1/this.factor1,z.factor2/this.factor2):this._scale(h,z.factor1,z.factor2)}accumulateParams(h){const z=h._accumulationType===g.AccumulationType.REPLACE;this.factor1=z?h.factor1:this.factor1*h.factor1;this.factor2=z?h.factor2:this.factor2*h.factor2}}a.ScaleVertex=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/SetAllVertexPositions":function(){define(["exports"],function(a){class b{constructor(d,l){this._editGeometry=d;this._newPositions= l}apply(){const d=null==this._originalPositions?"apply":"redo";if(!this._originalPositions){const l=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(g=>l.clone(g.pos))}this._apply(d,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(d){return d instanceof b?(this._newPositions=d._newPositions,this._apply("apply",this._newPositions),!0):!1}_apply(d,l){const g=this._editGeometry.coordinateHelper,k= this._editGeometry.allVertices;for(let h=0;hh.unnormalizeVertexPositions());this._editGeometry.notifyChanges({operation:d,updatedVertices:k})}}a.SetAllVertexPositions=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/editGeometry/operations/UndoGroup":function(){define(["exports"],function(a){const b=Symbol();class d{constructor(g){this._operations=[];this._closed=!1;this[l]=!0;g&& (this._operations=g,this._closed=!0)}close(){this._closed=!0}apply(){for(const g of this._operations)g.apply()}undo(){for(let g=this._operations.length-1;0<=g;g--)this._operations[g].undo()}accumulate(g){if(this._closed)return!1;const k=this._operations.length?this._operations[this._operations.length-1]:null;k&&k.accumulate(g)||(this._operations.push(g),g.apply());return!0}}var l=b;a.UndoGroup=d;a.isUndoGroup=function(g){return b in g};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})}, "esri/views/interactive/sketch/constraintUtils":function(){define("exports ../../../geometry ../../../core/quantityUtils ../../../core/unitUtils ../../../chunks/vec32 ../../../geometry/projection/projectVectorToVector ../../../geometry/support/geodesicUtils ../../../layers/graphics/dehydratedPoint ../../../support/elevationInfoUtils ./constraints ./normalizedPoint ../../support/angularMeasurementUtils ../../../geometry/SpatialReference".split(" "),function(a,b,d,l,g,k,h,z,E,r,w,v,c){function f(y, D,I,S){if(null!=I&&null!=y){var M=p(y,S);if(null!=M){I=v.getDegreesGeographic(I);var G=L=>{if(null!=L){var R=w.createWritable();L=d.createAngle(L,"degrees","geographic");if(v.pointFromDistanceAlongAzimuth(R,M,S.measurementSR,10,L,S.mode))return new r.VerticalHalfPlaneConstraint(M,R)}},K=()=>{if(null!=D&&null!=y)return v.getDegreesGeographic(v.directionBetweenPoints(D,y))};switch(S.directionMode){case v.DirectionMode.Absolute:return G(I);case v.DirectionMode.Relative:return K=K(),null==K?void 0:G(K+ I);case v.DirectionMode.RelativeBilateral:return K=K(),null==K?void 0:r.constraintOrSet([G(K+I),G(K-I)])}}}}function m(y,D){y=u(y,D)?.value??void 0;return null!=y?new r.HorizontalPlaneConstraint(y):void 0}function n(y,D,I){const {context:S,longitude:M,latitude:G,direction:K,distance:L,elevation:R}=I;if(null!=M||null!=G||null!=L||null!=R||null!=K)return null!=M||null!=G?(y=v.getDegreesGeographic(M),D=v.getDegreesGeographic(G),I=x(R,S),new r.CoordinateConstraint(y,D,I)):q(y,D,I)}function q(y,D,{context:I, direction:S,distance:M,elevation:G}){if(null==D)return m(G,I);const {view:K,elevationInfo:L,measurementSR:R}=I,H=w.fromPoint(D,K,L);if(R&&k.projectVectorToVector(H,D.spatialReference,B,R)){var [V,O]=B,N=null!=M?d.valueInUnit(M,"meters"):void 0;S=v.getDegreesGeographic(S);var T=x(G,I);G=aa=>{const ha=new r.GeodesicConstraint([V,O],R,N,T,aa);return null==N||null==aa||null==T&&I.hasZ?ha:new r.PointConstraint(ha.closestTo(H))};if(null==S)return G(void 0);M=()=>{if(null!=y&&null!=D)return v.getDegreesGeographic(v.directionBetweenPoints(y, D))};switch(I.directionMode){case v.DirectionMode.Absolute:return G(S);case v.DirectionMode.Relative:return M=M(),null==M?void 0:G(M+S);case v.DirectionMode.RelativeBilateral:return M=M(),null==M?void 0:r.constraintOrSet([G(M+S),G(M-S)])}}}function A({x:y,y:D,elevation:I,context:S}){F.x=y?.value??0;F.y=D?.value??0;F.spatialReference=S.spatialReference;const M=p(F,S,e);return new r.CoordinateConstraint(null!=y&&null!=M?M[0]:void 0,null!=D&&null!=M?M[1]:void 0,x(I,S))}function C(y){let D;for(const I of y)I&& (D=D?.intersect(I)??I);return D}function p(y,D,I=w.createWritable()){const {view:S,elevationInfo:M,measurementSR:G,origin:K,mode:L}=D;w.fromPoint(y,S,M,I);if(k.projectVectorToVector(I,y.spatialReference,I,G))return"geodesic"!==L&&g.subtract(I,I,K),I}function x(y,D){y=u(y,D);return null!=y?d.valueInUnit(y,"meters"):void 0}function u(y,{view:D,origin:I,elevationInfo:S,hasZ:M,measurementSR:G}){if(null!=y&&M&&(M=l.verticalLengthUnitFromSpatialReference(G),null!=M)){var [K,L]=I;y=d.valueInUnit(y,M);D= "3d"===D?.type?E.getConvertedElevationFromXYZ(D,K,L,y,G,S):y;if(null!=D)return d.createLength(D,M)}}const B=w.createWritable(),e=w.createWritable(),t=w.createWritable(),F=z.makeDehydratedPoint(0,0,0,c.WGS84);a.constraintSpaceToPoint=function(y,D,I,S){const {view:M,measurementSR:G,spatialReference:K,origin:L,mode:R}=I;"geodesic"===R?g.copy(t,y):g.add(t,y,L);if(k.projectVectorToVector(t,G,t,K))return w.toElevationAlignedDehydratedPoint(t,M,D,I,S)};a.getConstraintContext=function(y,D,I,S,M,G){let K= "geodesic",L=h.geodesicCompatibleSpatialReference(I);const R=w.createWritable();w.fromPoint(y,D,S,R);R[2]=0;L&&k.projectVectorToVector(R,I,R,L)||(K="euclidean",L=I);return{mode:K,view:D,elevationInfo:S,hasZ:M,directionMode:G,spatialReference:y.spatialReference,measurementSR:L,origin:R}};a.getGeodesicConstraint=n;a.getPointConstraint=function(y){return"geodesic"===y.context.mode?n(null,null,y):A(y)};a.getPolylineOrPolygonConstraint=function(y,D,I){const {context:S,x:M,y:G,distance:K,direction:L,elevation:R}= I;if("geodesic"===S.mode)return n(D,y,I);if(null!=M||null!=G)return A(I);if(null==K||null==y)I=void 0;else{var H=l.lengthUnitFromSpatialReference(S.measurementSR);null==H?I=void 0:(I=p(y,S),null==I?I=void 0:(H=d.valueInUnit(K,H),I=new r.VerticalCylinderConstraint(I,H)))}return C([I,f(y,D,L,S),m(R,S)])};a.intersectAll=C;a.pointToConstraintSpace=p;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/SnappingContext":function(){define(["exports"],function(a){class b{constructor(d){this.drawConstraints= this.selfSnappingZ=this.visualizer=this.excludeFeature=this.vertexHandle=null;this.editGeometryOperations=d.editGeometryOperations;this.elevationInfo=d.elevationInfo;this.pointer=d.pointer;this.vertexHandle=d.vertexHandle;this.excludeFeature=d.excludeFeature;this.feature=d.feature;this.visualizer=d.visualizer;this.selfSnappingZ=d.selfSnappingZ;this.drawConstraints=d.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}} a.SnappingContext=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/SnappingDragPipelineStep":function(){define("exports ../../../core/maybe ../../../core/promiseUtils ../../../core/reactiveUtils ../../../layers/graphics/dehydratedFeatureComparison ../../../layers/graphics/hydratedFeatures ../../../support/elevationInfoUtils ../dragEventPipeline ./SnappingContext ../../support/Scheduler".split(" "),function(a,b,d,l,g,k,h,z,E,r){function w(C,p,x){return d.debounce(async({frameTask:u, point:B,scenePoint:e,context:t,event:F,delta:y,getLastState:D},I)=>{const S=await u.schedule(()=>C.snap({point:B,scenePoint:e,context:t,signal:I}),I);S.valid&&(u=await u.schedule(()=>S.apply(),I),D=D(),null!=D.point&&B!==D.point&&(u=C.update({point:D.point,scenePoint:D.scenePoint,context:t})),null!=D.updatePoint&&g.pointEquals(u,D.updatePoint)||(n(F.mapEnd,u,y,p),x.execute(F)))})}function v(C){return"3d"===C.type?C.resourceController.scheduler.registerTask(r.TaskPriority.SNAPPING):r.ImmediateTask} function c(C,p,x){return{context:new E.SnappingContext({editGeometryOperations:C.editGeometryOperations,elevationInfo:C.elevationInfo,pointer:C.pointer,vertexHandle:null!=p.info?p.info.handle:null,excludeFeature:C.excludeFeature,feature:C.feature,visualizer:C.visualizer}),originalPos:null!=p.snapOrigin?C.coordinateHelper.vectorToDehydratedPoint(p.snapOrigin):p.mapStart,originalScenePos:null!=p.scenePoints?p.scenePoints.sceneStart:null,frameTask:x}}function f(C,[p,x,u]){C=k.clonePoint(C);C.x+=p;C.y+= x;C.hasZ&&(C.z+=u);return C}function m(C,p){return[C.x-p.x,C.y-p.y,C.hasZ&&p.hasZ?C.z-p.z:0]}function n(C,p,[x,u,B],e){C.x=p.x+x;C.y=p.y+u;e&&C.hasZ&&p.hasZ&&(C.z=p.z+B)}function q(C,p){if(!C.hasZ())return null;var x=p.vertices;p=null;for(const u of x){x=C.getZ(u.pos);if(null!=p&&null!=x&&1E-6!0,snappingManager:p,snappingContext:x,updatingHandles:u,useZ:B=!0}){const e= new z.EventPipeline;if(null==p)return{snappingStep:[A,e],cancelSnapping:A};let t=null,F=null,y,D=null;const I=()=>{t=b.abortMaybe(t);p.doneSnapping();F?.frameTask.remove();F=null;y=b.removeMaybe(y);D=null},S=w(p,B,e);let M=null,G=null,K=null;return{snappingStep:[L=>{if(!C(L))return L;const {action:R}=L;if("start"===R){var {info:H}=L;const O=v(p.view);F=c(x,L,O);F.context.selfSnappingZ=null;B||null==H||(H=q(x.coordinateHelper,H.handle.component),null!=H&&(F.context.selfSnappingZ={value:H,elevationInfo:x.elevationInfo?? h.absoluteHeightElevationInfo}))}if(null!=F){const {context:O,originalScenePos:N,originalPos:T}=F,{mapEnd:aa,mapStart:ha,scenePoints:ea}=L,ma=f(T,m(aa,ha)),wa=m(ha,T),za={...L,action:"update"},Aa=F.context;var V=null==N||null==ea?null:f(N,m(ea.sceneEnd,ea.sceneStart));K=H=p.update({point:ma,scenePoint:V,context:O});n(aa,H,wa,B);M=ma;G=V;if("end"!==R){const {frameTask:Y}=F;null==t&&(t=new AbortController);D=da=>{u.addPromise(d.ignoreAbortErrors(S({frameTask:Y,event:za,context:Aa,point:ma,scenePoint:V, delta:wa,getLastState:()=>({point:M,scenePoint:G,updatePoint:da.forceUpdate?null:K})},t.signal)))};D({forceUpdate:!1});null==y&&(y=l.watch(()=>p.options.effectiveEnabled,()=>D?.({forceUpdate:!0})))}}"end"===R&&I();return L},e],cancelSnapping:L=>{I();return L}}};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/Scheduler":function(){define("exports ../../core/Handles ../../core/has ../../core/Logger ../../core/maybe ../../core/PerformanceSampler ../../core/PooledArray ../../core/promiseUtils ../../core/reactiveUtils ../../core/signal ../../core/time ../../layers/support/PromiseQueue ./debugFlags ./RenderState ./Yield".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m){function n(y){return q.has(y)?q.get(y):"number"===typeof y?y:1}a.TaskPriority=void 0;(function(y){y.RESOURCE_CONTROLLER_IMMEDIATE="immediate";y.RESOURCE_CONTROLLER="schedule";y.SLIDE="slide";y.STREAM_DATA_LOADER="stream loader";y.ELEVATION_QUERY="elevation query";y.TERRAIN_SURFACE="terrain";y.SURFACE_GEOMETRY_UPDATES="surface geometry updates";y.LOD_RENDERER="LoD renderer";y.GRAPHICS_CORE="Graphics3D";y.I3S_CONTROLLER="I3S";y.POINT_CLOUD_LAYER="point cloud"; y.FEATURE_TILE_FETCHER="feature fetcher";y.OVERLAY="overlay";y.STAGE="stage";y.GRAPHICS_DECONFLICTOR="graphics deconflictor";y.FILTER_VISIBILITY="Graphics3D filter visibility";y.SCALE_VISIBILITY="Graphics3D scale visibility";y.FRUSTUM_VISIBILITY="Graphics3D frustum visibility";y.POINT_OF_INTEREST_FREQUENT="POI frequent";y.POINT_OF_INTEREST_INFREQUENT="POI infrequent";y.LABELER="labeler";y.FEATURE_QUERY_ENGINE="feature query";y.FEATURE_TILE_TREE="feature tile tree";y.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree"; y.ELEVATION_ALIGNMENT="elevation alignment";y.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene";y.TEXT_TEXTURE_ATLAS="text texture atlas";y.TEXTURE_UNLOAD="texture unload";y.LINE_OF_SIGHT_TOOL="line of sight tool";y.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool";y.ELEVATION_PROFILE="elevation profile";y.SNAPPING="snapping";y.SHADOW_ACCUMULATOR="shadow accumulator";y.CLOUDS_GENERATOR="clouds generator";y[y.NONE=0]="NONE";y[y.TEST_PRIO=1]="TEST_PRIO"})(a.TaskPriority||(a.TaskPriority= {}));const q=new Map([[a.TaskPriority.RESOURCE_CONTROLLER_IMMEDIATE,0],[a.TaskPriority.RESOURCE_CONTROLLER,4],[a.TaskPriority.SLIDE,0],[a.TaskPriority.STREAM_DATA_LOADER,0],[a.TaskPriority.ELEVATION_QUERY,0],[a.TaskPriority.TERRAIN_SURFACE,1],[a.TaskPriority.SURFACE_GEOMETRY_UPDATES,1],[a.TaskPriority.LOD_RENDERER,2],[a.TaskPriority.GRAPHICS_CORE,2],[a.TaskPriority.I3S_CONTROLLER,2],[a.TaskPriority.POINT_CLOUD_LAYER,2],[a.TaskPriority.FEATURE_TILE_FETCHER,2],[a.TaskPriority.OVERLAY,4],[a.TaskPriority.STAGE, 4],[a.TaskPriority.GRAPHICS_DECONFLICTOR,4],[a.TaskPriority.FILTER_VISIBILITY,4],[a.TaskPriority.SCALE_VISIBILITY,4],[a.TaskPriority.FRUSTUM_VISIBILITY,4],[a.TaskPriority.CLOUDS_GENERATOR,4],[a.TaskPriority.POINT_OF_INTEREST_FREQUENT,6],[a.TaskPriority.POINT_OF_INTEREST_INFREQUENT,30],[a.TaskPriority.LABELER,8],[a.TaskPriority.FEATURE_QUERY_ENGINE,8],[a.TaskPriority.FEATURE_TILE_TREE,16],[a.TaskPriority.FEATURE_TILE_TREE_ACTIVE,0],[a.TaskPriority.ELEVATION_ALIGNMENT,12],[a.TaskPriority.ELEVATION_ALIGNMENT_SCENE, 14],[a.TaskPriority.TEXT_TEXTURE_ATLAS,12],[a.TaskPriority.TEXTURE_UNLOAD,12],[a.TaskPriority.LINE_OF_SIGHT_TOOL,16],[a.TaskPriority.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[a.TaskPriority.SNAPPING,0],[a.TaskPriority.SHADOW_ACCUMULATOR,30]]),A=w.Milliseconds(6.5),C=w.Milliseconds(1),p=w.Milliseconds(30),x=w.Milliseconds(1E3/30),u=w.Milliseconds(100);var B;(function(y){class D{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(M=>M.needsUpdate)}constructor(){this._updating= r.signal(!0);this._microTaskQueued=!1;this._frameNumber=0;this.performanceInfo={total:new k("total"),tasks:new Map};this._frameTaskTimes=new Map;this._budget=new S;this._state=f.RenderState.INTERACTING;this._tasks=new h;this._runQueue=new h;this._load=0;this._idleStateCallbacks=new h;this._debug=this._forceTask=this._idleUpdatesStartFired=!1;this._debugHandle=E.watch(()=>c.SCHEDULER_LOG_SLOW_TASKS,M=>this._debug=M,E.initial);for(const M of Object.keys(a.TaskPriority))this.performanceInfo.tasks.set(a.TaskPriority[M], new k(a.TaskPriority[M]))}destroy(){this._tasks.toArray().forEach(M=>M.remove());this._tasks.clear();g.removeMaybe(this._debugHandle);this._microTaskQueued=!1;this._updatingChanged()}taskRunningChanged(M){this._updatingChanged();M&&0{this._microTaskQueued&&(this._microTaskQueued=!1,0this._removeIdleStateCallbacks(K),set idleBegin(R){L._idleUpdatesStartFired&&(K.idleEnd(),L._state===f.RenderState.IDLE&&R());K.idleBegin=R},set idleEnd(R){K.idleEnd=R}}}get load(){return this._load}set state(M){this._state!== M&&(this._state=M,this.state!==f.RenderState.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(G=>G.idleEnd())))}get state(){return this._state}updateBudget(M){++this._frameNumber;let G=A,K=M.frameDuration,L=C;switch(this.state){case f.RenderState.IDLE:G=w.Milliseconds(0);K=w.Milliseconds(Math.max(u,M.frameDuration));L=p;break;case f.RenderState.INTERACTING:K=w.Milliseconds(Math.max(x,M.frameDuration))}K=w.Milliseconds(K-M.elapsedFrameTime-G);if(this.state!== f.RenderState.IDLE&&KM.idleBegin()));this._runIdle();break;case f.RenderState.INTERACTING:this._runInteracting();break;default:this._runAnimating()}}stopFrame(){this._budget.reset(w.Milliseconds(0), this._state);this._budget.madeProgress()}_removeIdleStateCallbacks(M){this._idleUpdatesStartFired&&M.idleEnd();this._idleStateCallbacks.removeUnordered(M)}removeTask(M){this._tasks.removeUnordered(M);this._runQueue.removeUnordered(M);this._updatingChanged()}_updateTask(M){this._tasks.forAll(G=>{G.name===M&&G.setPriority(M)})}_getState(M){if(this._runQueue.some(K=>K.name===M))return a.TaskState.SCHEDULED;let G=a.TaskState.IDLE;this._tasks.forAll(K=>{K.name===M&&K.needsUpdate&&(1>=K.schedulePriority? G=a.TaskState.READY:G!==a.TaskState.READY&&(G=a.TaskState.WAITING))});return G}_getRuntime(M){let G=0;this._tasks.forAll(K=>{K.name===M&&(G+=K.runtime)});return G}_resetRuntimes(){this._tasks.forAll(M=>M.runtime=0)}_getRunning(){const M=new Map;this._tasks.forAll(K=>{K.needsUpdate&&M.set(K.name,(M.get(K.name)||0)+1)});if(0===M.size)return null;let G="";M.forEach((K,L)=>{G=1K.needsUpdate?++G:G,0);this._load=.9*this._load+M*(1-.9)}_schedule(){this._runQueue.filterInPlace(M=>{if(M.needsUpdate)return!0;M.schedulePriority=M.basePriority;return!1});for(this._tasks.forAll(M=>{0===M.basePriority&&M.needsUpdate&&!this._runQueue.includes(M)&&M.blockFrame!==this._frameNumber&&this._runQueue.unshift(M)});0===this._runQueue.length;){let M=!1;this._tasks.forAll(G=>{if(G.needsUpdate&&0!==G.schedulePriority&&0!==G.basePriority&&G.blockFrame!==this._frameNumber)switch(M= !0,G.schedulePriority){case 1:G.schedulePriority=0;this._runQueue.push(G);break;default:--G.schedulePriority}});if(!M)return this._updatingChanged(),!1}this._updatingChanged();return!0}_run(){const M=this._budget.now();this._startFrameTaskTimes();do for(;0=this._budget.remaining){this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-M);return}}while(this._schedule());this._updatingChanged();this._recordFrameTaskTimes(this._budget.now()-M)}_startFrameTaskTimes(){for(const M of Object.keys(a.TaskPriority))this._frameTaskTimes.set(a.TaskPriority[M], 0)}_recordFrameTaskTimes(M){this._frameTaskTimes.forEach((G,K)=>this.performanceInfo.tasks.get(K).record(G));this.performanceInfo.total.record(M)}get test(){}}y.Scheduler=D;class I{get task(){return this._task.value}get updating(){return this._queue.running}constructor(M,G,K){this._scheduler=M;this.name=G;this.runtime=this.blockFrame=0;this._queue=new v.PromiseQueue;this._handles=new b;this.schedulePriority=this._basePriority=n(G);this._task=r.signal(null!=K?K:this._queue);this._handles.add(E.when(()=> this.task.running,L=>M.taskRunningChanged(L)))}remove(){this.processQueue(e);this._scheduler.removeTask(this);this.schedule=F.schedule;this.reschedule=F.reschedule;this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(M){if(this.name!==M){this.name=M;M=n(M);if(0===this._basePriority||0!==this.schedulePriority)this.schedulePriority=M;this._basePriority=M}}get priority(){return this.name}set priority(M){this.setPriority(M)}get needsUpdate(){return this.updating||this.task.running}schedule(M, G,K){return this._queue.push(M,G,K)}reschedule(M,G,K){return this._queue.unshift(M,G,K)}processQueue(M){return this._queue.runTask(M)}}class S{constructor(){this._begin="undefined"!==typeof performance?performance.now():0;this._budget=0;this._state=f.RenderState.IDLE;this._progressed=this._done=!1;this._enabled=!0}run(M){if(this.done)return!1;!0===M()&&this.madeProgress();return!0}get done(){return this._done}get budget(){return this._budget}madeProgress(){this._progressed=!0;return this._done=this.elapsed>= this._budget&&this._enabled}get state(){return this._state}get enabled(){return this._enabled}set enabled(M){this._enabled=M}reset(M,G){this._begin=this.now();this._budget=M;this._state=G;this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._done=this._progressed=!1}get hasProgressed(){return this._progressed}}y.Budget=S})(B||={});a.TaskState=void 0;(function(y){y.SCHEDULED= "s";y.READY="r";y.WAITING="w";y.IDLE="i"})(a.TaskState||(a.TaskState={}));const e=(()=>{const y=new B.Budget;y.enabled=!1;return y})();class t{remove(){}processQueue(){}schedule(y,D,I){try{if(z.isAborted(D)){const S=z.createAbortError();return I?Promise.resolve(I(S)):Promise.reject(S)}return z.when(y(e))}catch(S){return Promise.reject(S)}}reschedule(y,D,I){return this.schedule(y,D,I)}}const F=new t;a.ImmediateTask=F;a.getTaskPriority=n;a.newScheduler=function(){return new B.Scheduler};a.noBudget= e;a.taskPriorities=q;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/layers/support/PromiseQueue":function(){define(["exports","../../core/promiseUtils","../../core/signal","../../views/support/Yield"],function(a,b,d,l){class g{constructor(){this._tasks=[];this._runningTasks=d.signal(0)}get length(){return this._tasks.length}get running(){return 0this._tasks.push(new k(r,w,h,z,E)))).finally(()=>--this._runningTasks.value)}unshift(h,z,E){++this._runningTasks.value;return(new Promise((r,w)=>this._tasks.unshift(new k(r,w,h,z,E)))).finally(()=>--this._runningTasks.value)}_process(h){if(0===this._tasks.length)return!1;const z=this._tasks.shift();try{const E=b.isAborted(z.signal);if(E&&!z.abortCallback)z.reject(b.createAbortError());else{const r=E?z.abortCallback?.(b.createAbortError()): z.callback(h);b.isPromiseLike(r)?r.then(z.resolve,z.reject):z.resolve(r)}}catch(E){z.reject(E)}return!0}cancelAll(){const h=b.createAbortError();for(const z of this._tasks)if(z.abortCallback){const E=z.abortCallback(h);z.resolve(E)}else z.reject(h);this._tasks.length=0}}class k{constructor(h,z,E,r,w){this.resolve=h;this.reject=z;this.callback=E;this.signal=r;this.abortCallback=w}}a.PromiseQueue=g;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/Yield":function(){define(["exports"], function(a){const b=Symbol("Yield");a.Yield=b;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/debugFlags":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass".split(" "),function(a,b,d,l,g,k,h){b=class extends b{constructor(){super(...arguments);this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=this.SCHEDULER_LOG_SLOW_TASKS= !1}};a.__decorate([d.property()],b.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0);a.__decorate([d.property()],b.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0);b=a.__decorate([h.subclass("esri.views.support.debugFlags")],b);return new b})},"esri/views/support/RenderState":function(){define(["exports"],function(a){a.RenderState=void 0;var b=a.RenderState||(a.RenderState={});b[b.ANIMATING=0]="ANIMATING";b[b.INTERACTING=1]="INTERACTING";b[b.IDLE=2]="IDLE";Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/views/interactive/snapping/SnappingOperation":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/maybe ../../../core/promiseUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../support/Scheduler".split(" "),function(a,b,d,l,g,k,h,z,E,r,w){a.SnappingOperation=class extends d{constructor(v){super(v); this.constrainResult=c=>c;this._stagedPoint=this._abortController=this._frameTask=this._snapPoints=null;this._snap=g.debounce(async(c,f,m,n)=>{const q=this._frameTask;if(null!=q){var A=await q.schedule(()=>f.snap({...c,context:m,signal:n}),n);A.valid&&await q.schedule(()=>{this.stagedPoint=A.apply();c!==this._snapPoints&&null!=this._snapPoints&&(this.stagedPoint=f.update({...this._snapPoints,context:m}))},n)}})}get stagedPoint(){return this._stagedPoint}set stagedPoint(v){this._stagedPoint=this.constrainResult(v)}initialize(){const v= "3d"===this.view.type?this.view?.resourceController?.scheduler:null;this._frameTask=null!=v?v.registerTask(w.TaskPriority.SNAPPING):w.ImmediateTask}destroy(){this._abortController=l.abortMaybe(this._abortController);this._frameTask=l.removeMaybe(this._frameTask)}update(v,c,f){this._snapPoints=v;const {point:m,scenePoint:n}=v;return this.stagedPoint=v=c.update({point:m,scenePoint:n,context:f})}async snap(v,c,f){const {point:m,scenePoint:n}=v;this.stagedPoint=c.update({point:m,scenePoint:n,context:f}); this._snapPoints=v;null==this._abortController&&(this._abortController=new AbortController);return this._snap(v,c,f,this._abortController.signal)}async snapAgainNearPreviousMapPoint(v,c){null!=this._snapPoints&&await this.snap(this._snapPoints,v,c)}abort(){this._abortController=l.abortMaybe(this._abortController);this._snapPoints=null}};b.__decorate([k.property({constructOnly:!0})],a.SnappingOperation.prototype,"view",void 0);b.__decorate([k.property()],a.SnappingOperation.prototype,"stagedPoint", null);b.__decorate([k.property()],a.SnappingOperation.prototype,"constrainResult",void 0);b.__decorate([k.property()],a.SnappingOperation.prototype,"_stagedPoint",void 0);a.SnappingOperation=b.__decorate([r.subclass("esri.views.interactive.snapping.SnappingOperation")],a.SnappingOperation);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/draw/drawSurfaces":function(){define("exports ../../geometry ../../core/screenUtils ../../layers/graphics/dehydratedPoint ../../layers/graphics/hydratedFeatures ../../support/elevationInfoUtils ../../geometry/SpatialReference ../../geometry/Point".split(" "), function(a,b,d,l,g,k,h,z){class E{constructor(c,f,m,n=null){this._elevationInfo=c;this.defaultZ=f;this._view=m;this._excludeGraphics=n}screenToMap(c){const {defaultZ:f,_view:m}=this;c=m.sceneIntersectionHelper.intersectElevationFromScreen(d.createScreenPointArray(c.x,c.y),this._elevationInfo,f??0,this._excludeGraphics);null==f&&null!=c&&(c.z=void 0);return c}mapToScreen(c){c=l.makeDehydratedPoint(c.x,c.y,k.getConvertedElevation(this._view,c,this._elevationInfo),c.spatialReference);return this._view.toScreen(c)}constrainZ(c){const {defaultZ:f}= this;null!=f&&c.z!==f&&(c=g.clonePoint(c),c.z=f);return c}}class r{constructor(c,f,m=[]){this.view=c;this.elevationInfo=f;this.exclude=m}screenToMap(c){c=this.view.toMap(c,{exclude:this.exclude,excludeHud:!0});null!=c&&(c.z=k.getZForElevationMode(c,this.view,this.elevationInfo));return c}mapToScreen(c){let f=c;null!=this.elevationInfo&&(f=l.makeDehydratedPoint(c.x,c.y,k.getConvertedElevation(this.view,c,this.elevationInfo),c.spatialReference));return this.view.toScreen(f)}constrainZ(c){return c}} class w{constructor(c,f=!1,m=0){this.view=c;this.hasZ=f;this.defaultZ=m;this.mapToScreen=n=>c.toScreen(n);this.screenToMap=f?n=>{n=c.toMap(n);n.z=m;return n}:n=>c.toMap(n)}constrainZ(c){const {defaultZ:f}=this;this.hasZ&&c.z!==f&&(c=g.clonePoint(c),c.z=f);return c}}class v{screenToMap(c){const {x:f,y:m}=c;return new z({x:f,y:m,spatialReference:v.spatialReference})}mapToScreen(c){return d.createScreenPoint(c.x,c.y)}constrainZ(c){return c}}v.spatialReference=new h;a.ElevationDrawSurface=E;a.MapDrawSurface= w;a.SceneDrawSurface=r;a.ScreenDrawSurface=v;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/draw/support/createUtils":function(){define("exports ../../../geometry ../../../core/arrayUtils ../../../core/lang ../../../core/unitUtils ../../../chunks/vec32 ../../../core/libs/gl-matrix-2/factories/vec3f64 ../../../geometry/Circle ../../../geometry/geometryEngine ../../../geometry/support/coordsUtils ../../../geometry/support/spatialReferenceUtils ./surfaceCoordinateSystems ../../../geometry/Point ../../../geometry/Multipoint ../../../geometry/Polyline ../../../geometry/Polygon".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n){function q(e,t){t=new c({x:e[0],y:e[1],spatialReference:t});2{d.equals(D[0],D[D.length-1])&&1!==D.length||D.push(D[0])});e=new n({rings:e,spatialReference:t});e.rings.forEach(D=>{r.isClockwise(D)||D.reverse()});F&&r.unnormalizeGeometryOnDatelineCrossing(e);y&&e.isSelfIntersecting&&w.isValid(t)&&(e=E.simplify(e));return e}function C(e,t,F){const y=p(t[3],t[2],F),D=p(t[1],t[2],F), I=p(t[0],t[1],F);t=p(t[0],t[3],F);return{geometry:e,midpoints:null!=y&&null!=D&&null!=I&&null!=t?{top:y,right:D,bottom:I,left:t}:null}}function p(e,t,F){u[0]=e.x;u[1]=e.y;u[2]=0;B[0]=t.x;B[1]=t.y;B[2]=0;k.lerp(u,u,B,.5);x.x=u[0];x.y=B[1];x.z=B[2];e=F.localToMap(x);return null!=e?q(e,F.spatialReference):null}const x=v.makeSurfacePoint(0,0,0),u=h.create(),B=h.create();a.createCircle=function(e,t,F,y){var D=t.mapToLocalMultiple(e),I=e=null;F?(e=D[0],I=D[1]):(e=D[0],F=D[1],I=Math.round(F.x-e.x),F=Math.round(F.y- e.y),D=Math.max(Math.abs(I),Math.abs(F)),e=v.makeSurfacePoint(0Math.abs(F)?e.x-D/2:e.x,Math.abs(I)>Math.abs(F)?e.y:e.y-D/2));F=t.localToMap(e);D=t.localToMap(I);if(null==F||null==D)return null;t.doUnnormalization&&r.unnormalizeVerticesOnDatelineCrossing([[F,D]],t.spatialReference);F=q(F,t.spatialReference);D=q(D,t.spatialReference);const S=g.getMetersPerUnitForSR(t.spatialReference);var M=0;w.isValid(t.spatialReference)?M=S* E.distance(F,D,null):(M=e.x-I.x,e=e.y-I.y,M=S*Math.sqrt(M*M+e*e)*(y||1));t=new z({center:F,radius:M,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:A(t.rings,t.spatialReference,!1),center:F,edge:D}};a.createEllipse=function(e,t,F){function y(H){return v.makeSurfacePoint(M*Math.cos(H)+S.x,G*Math.sin(H)+S.y)}var D=t.mapToLocalMultiple(e);e=D[0];var I=D[1];D=Math.round(I.x-e.x);I=Math.round(I.y-e.y);const S=v.makeSurfacePoint(F?e.x:e.x+D/2,F?e.y:e.y+I/2),M=F?D:D/2,G=F?I:I/2; F=[];e=2*Math.PI/60;for(D=0;60>D;D++)F.push(y(D*e));F.push(F[0]);const {spatialReference:K,doUnnormalization:L}=t;F=A([F.map(H=>t.localToMap(H)).filter(d.isSome)],K,L,!1);e=t.localToMap(y(Math.PI/2));D=t.localToMap(y(0));I=t.localToMap(y(-Math.PI/2));const R=t.localToMap(y(Math.PI));return{geometry:F,midpoints:null!=e&&null!=D&&null!=I&&null!=R?{top:q(e,K),right:q(D,K),bottom:q(I,K),left:q(R,K)}:null}};a.createMultipoint=function(e,t){return new f({points:e,spatialReference:t})};a.createPoint=q;a.createPolygon= A;a.createPolyline=function(e,t,F){e=new m({paths:e,spatialReference:t});F&&r.unnormalizeGeometryOnDatelineCrossing(e);return e};a.createRectangle=function(e,t,F){var y=t.mapToLocalMultiple(e);1===y.length&&(e=y[0],y=[v.makeSurfacePoint(e.x-48,e.y+48),v.makeSurfacePoint(e.x+48,e.y-48),v.makeSurfacePoint(e.x+48,e.y-48),v.makeSurfacePoint(e.x-48,e.y+48)]);e=[];var D=y[0].x,I=y[0].y,S=y[1].x;y=y[1].y;if(F){F=Math.round(S-D);const M=Math.round(y-I);e.push(v.makeSurfacePoint(D-F,I-M),v.makeSurfacePoint(S, I-M),v.makeSurfacePoint(S,y),v.makeSurfacePoint(D-F,y))}else e.push(v.makeSurfacePoint(D,I),v.makeSurfacePoint(S,I),v.makeSurfacePoint(S,y),v.makeSurfacePoint(D,y));F=A([e.map(M=>t.localToMap(M)).filter(d.isSome)],t.spatialReference,t.doUnnormalization,!0);return C(F,e,t)};a.createSquare=function(e,t,F){var y=t.mapToLocalMultiple(e);e=[];var D=y[0].x,I=y[0].y,S=Math.round(y[1].x-D);const M=Math.round(y[1].y-I);y=Math.max(Math.abs(S),Math.abs(M));F?(F=D+y,S=I+y,D-=y,I-=y,e.push(v.makeSurfacePoint(F, I),v.makeSurfacePoint(D,I),v.makeSurfacePoint(D,S),v.makeSurfacePoint(F,S))):(F=0t.localToMap(G)).filter(d.isSome)],t.spatialReference,t.doUnnormalization,!0);return C(I,e,t)};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/geometry/Circle":function(){define("../chunks/tslib.es6 ../core/unitUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./ellipsoidUtils ./Point ./Polygon ./SpatialReference ./support/geodesicUtils ./support/webMercatorUtils ./support/WKIDUnitConversion".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f){var m;l=m=class extends r{constructor(...n){super(...n);this.center=null;this.geodesic=!1;this.numberOfPoints=60;this.radius=1E3;this.radiusUnit="meters"}normalizeCtorArgs(n,q){if(!n?.center){if(n?.rings)return super.normalizeCtorArgs(n,q);n={center:n}}return{...super.normalizeCtorArgs(),...n,...q}}initialize(){var n=this.center;const q=this.numberOfPoints;this.hasZ=n?.hasZ??!1;if(0===this.rings.length&&n){var A=b.convertUnit(this.radius,this.radiusUnit,"meters"), C=n.spatialReference,p="geographic";if(C.isWebMercator)p="webMercator";else if(null!=(C.wkid&&f[C.wkid])||(C.wkt2||C.wkt)&&b.isProjectedWKT(C.wkt2||C.wkt))p="projected";if(this.geodesic){let x;switch(p){case "webMercator":x=c.webMercatorToGeographic(n);break;case "projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case "geographic":x=n}n=this._createGeodesicCircle(x,A,q);"webMercator"===p&&(n=c.geographicToWebMercator(n))}else{let x; "webMercator"===p||"projected"===p?x=A/b.getMetersPerUnit(n.spatialReference):"geographic"===p&&(x=b.lengthToDegrees(A,"meters",z.getReferenceEllipsoid(n.spatialReference).radius));n=this._createPlanarCircle(n,x,q)}this.spatialReference=n.spatialReference;this.addRing(n.rings[0])}}clone(){const {center:n,numberOfPoints:q,radius:A,radiusUnit:C,geodesic:p}=this;return new m({center:n?.clone(),numberOfPoints:q,radius:A,radiusUnit:C,geodesic:p})}_createGeodesicCircle(n,q,A){let C=0;const p=[];for(;360> C;){const x=[0,0];v.directGeodeticSolver(x,[n.x,n.y],C,q,w.WGS84);this.hasZ&&x.push(n.z);p.push(x);C+=360/A}p.push(p[0]);return new r(p)}_createPlanarCircle(n,q,A){const C=[],p=2*Math.PI/A;for(let u=0;uthis.mapToLocal(A)).filter(d.isSome)}get doUnnormalization(){return!1}}class m extends f{constructor(q,A,C=null){super(A);this._defaultZ=C;this.transform=g.create();this.transformInv=g.create();this.transform=g.clone(q);l.invert(this.transformInv,this.transform)}makeMapPoint(q, A){return v(q,A,this._defaultZ)}mapToLocal(q){return c(this.transform[0]*q[0]+this.transform[2]*q[1]+this.transform[4],this.transform[1]*q[0]+this.transform[3]*q[1]+this.transform[5])}localToMap(q){return v(this.transformInv[0]*q.x+this.transformInv[2]*q.y+this.transformInv[4],this.transformInv[1]*q.x+this.transformInv[3]*q.y+this.transformInv[5],this._defaultZ)}}class n extends f{constructor(q,A){super(q.spatialReference);this.view=q;this.defaultZ=null;this.pWS=E.create();this.tangentFrameUpWS=E.create(); this.tangentFrameRightWS=E.create();this.tangentFrameForwardWS=E.create();this.localFrameRightWS=E.create();this.localFrameUpWS=E.create();this.worldToLocalTransform=h.create();this.localToWorldTransform=h.create();this.scale=1;this.scale=q.resolution;this.referenceMapPoint=A;this.defaultZ=A.hasZ?A.z:null;q=q.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS);this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,r.Axis.X,this.tangentFrameRightWS); this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,r.Axis.Y,this.tangentFrameUpWS);this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,r.Axis.Z,this.tangentFrameForwardWS);A=E.create();z.scale(A,this.tangentFrameForwardWS,z.dot(q,this.tangentFrameForwardWS));z.subtract(this.localFrameRightWS,q,A);z.normalize(this.localFrameRightWS,this.localFrameRightWS);z.cross(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS);k.rotationTo(this.worldToLocalTransform,this.localFrameRightWS, this.tangentFrameRightWS);k.invert(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return"global"===this.view.viewingMode}makeMapPoint(q,A){return v(q,A,this.defaultZ)}mapToLocal(q){const A=E.create();this.view.renderCoordsHelper.toRenderCoords(new w({x:q[0],y:q[1],spatialReference:this.spatialReference}),A);z.transformQuat(A,A,this.worldToLocalTransform);q=this.view.renderCoordsHelper.fromRenderCoords(A,new w({spatialReference:this.view.spatialReference}));return null!= q?c(q.x/this.scale,q.y/this.scale):null}localToMap(q){const A=E.create();this.view.renderCoordsHelper.toRenderCoords(new w({x:q.x*this.scale,y:q.y*this.scale,spatialReference:this.spatialReference}),A);z.transformQuat(A,A,this.localToWorldTransform);q=this.view.renderCoordsHelper.fromRenderCoords(A,new w({spatialReference:this.view.spatialReference}));return null!=q?v(q.x,q.y,this.defaultZ):null}}a.AffineCoordinateSystem=m;a.SceneViewCoordinateSystem=n;a.SurfaceCoordinateSystem=f;a.createViewAlignedCoordinateSystem= function(q,A){return"2d"===q.type?new m(q.state.transform,q.spatialReference,2{this._detachManipulator(l)});this._manipulators.removeAll()}attach(){this._manipulators.forEach(l=> {this._updateManipulatorAttachment(l)});this._attached=!0}detach(){this._manipulators.forEach(l=>{this._detachManipulator(l)});this._attached=!1}destroy(){this.detach();this._manipulators.forEach(({manipulator:l})=>l.destroy());this._manipulators.destroy();this._resourceContexts=null}on(l,g){return this._manipulators.on(l,k=>{g(k)})}forEach(l){for(const g of this._manipulators.items)l(g)}some(l){return this._manipulators.items.some(l)}toArray(){const l=[];this.forEach(g=>l.push(g.manipulator));return l}intersect(l, g){let k=null,h=Number.MAX_VALUE;this._manipulators.forEach(({manipulator:z,attached:E})=>{E&&z.interactive&&(E=z.intersectionDistance(l,g),null!=E&&E`${m},${n}`).join(" "),stroke:this._strokeBackgroundStyle,"stroke-width":this.strokeWidth}),r.tsx("polygon",{fill:"transparent",points:w.map(([m,n])=>`${m},${n}`).join(" "),stroke:this._strokeStyle,"stroke-dasharray":this.strokeDash.length? this.strokeDash.join(" "):void 0,"stroke-width":this.strokeWidth})))}renderCanvas(){}};a.__decorate([d.property()],b.prototype,"coordinates",void 0);a.__decorate([d.property()],b.prototype,"strokeDash",void 0);a.__decorate([d.property()],b.prototype,"strokeWidth",void 0);a.__decorate([d.property()],b.prototype,"strokeColor",void 0);a.__decorate([d.property()],b.prototype,"strokeDashColor",void 0);a.__decorate([d.property()],b.prototype,"fillColor",void 0);a.__decorate([d.property()],b.prototype,"visible", void 0);a.__decorate([d.property()],b.prototype,"isDecoration",void 0);a.__decorate([d.property({readOnly:!0})],b.prototype,"_strokeStyle",null);a.__decorate([d.property({readOnly:!0})],b.prototype,"_strokeBackgroundStyle",null);a.__decorate([d.property({readOnly:!0})],b.prototype,"_fillStyle",null);a.__decorate([d.property({readOnly:!0})],b.prototype,"_renderCoordinates",null);return b=a.__decorate([h.subclass("esri.views.overlay.OutlineOverlayItem")],b)})},"esri/widgets/support/Selector2D/selectorUtils":function(){define("require exports ../../../core/promiseUtils ../../../layers/support/fieldUtils ../../../layers/support/layerUtils ../../../renderers/support/clickToleranceUtils ../../../views/support/drapedUtils ../../../views/support/layerViewUtils".split(" "), function(a,b,d,l,g,k,h,z){async function E(){return new Promise((u,B)=>a(["../../../geometry/geometryEngineJSON"],u,B))}async function r(){return E().then(({contains:u,intersects:B,overlaps:e,simplify:t})=>({contains:u,intersects:B,overlaps:e,simplify:t}))}function w(u){const B=[];for(let e=0;e{g.isFeatureLayer(F)?B.push(F):(g.isKnowledgeGraphLayer(F)||g.isLinkChartLayer(F))&& F.layers?.length?B.push(...F.layers.toArray()):g.isMapNotesLayer(F)&&F.sublayers?.length?t.push(...F.sublayers.toArray()):g.isGraphicsLayer(F)?t.push(F):z.isSelectableLayerView2D(F)&&e.push(F)});return{layers:B,layerViews:e,graphicsLayers:t}}function c(u,B){if(u.includes(B))return!0;const e=B.getObjectId(),{layer:t,uid:F}=B;return null!=e?u.some(y=>{if(t===y.layer)return e===y.getObjectId()}):u.some(y=>{if(t===y.layer)return F===y.uid})}async function f(u){const {layerViews:B,selector:e,signal:t, view:F}=u;return d.whenOrAbort(Promise.allSettled(B.map(async y=>{const D=y.createQuery(),{geometry:I}=n(e,y.layer,F);D.outFields=["*"];D.geometry=I;D.returnGeometry=!0;D.outSpatialReference=F.spatialReference;return y.queryFeatures(D,{signal:t}).then(({features:S})=>S)})),t)}async function m(u){const {layers:B,selector:e,signal:t,view:F}=u;return d.whenOrAbort(Promise.allSettled(B.map(async y=>y.queryFeatures(q(y.createQuery(),e,y,F),{signal:t}).then(({features:D})=>D))),t)}function n(u,B,e){const t= l.getDisplayFieldName({displayField:"displayField"in B?B.displayField:null,fields:B.fields}),F=[B.objectIdField];null!=t&&B.fieldsIndex.has(t)&&F.push(t);B="renderer"in B?k.calculateTolerance({renderer:B.renderer}):0;return{geometry:"point"===u.type?h.createQueryGeometry(u,B,e):u,outFields:F}}function q(u,B,e,t){const {outFields:F,geometry:y}=n(B,e,t);u.outFields=F;u.geometry=y;u.returnGeometry=!0;u.outSpatialReference=t.spatialReference;return u}async function A(u){const {selector:B,candidates:e, view:t}=u;if(!e?.length||!B)return[];const {spatialReference:F}=t,y=await r();return e.filter(D=>y.intersects(F,B,D.geometry))}const C=async(u,B,e)=>{B=B.flatMap(t=>t.graphics.toArray())??[];return A({candidates:B,selector:u,view:e})},p=async(u,B,e,t)=>(u=await d.ignoreAbortErrors(m({selector:u,signal:t,layers:B,view:e})))?w(u):[],x=async(u,B,e,t)=>(u=await d.ignoreAbortErrors(f({selector:u,signal:t,layerViews:B,view:e})))?w(u):[];b.getGeometryEngineOperations=r;b.getQueryOptionsFromLayer=n;b.getSelectionFromFeatureLayerViews= f;b.getSelectionFromFeatureLayers=m;b.getSelectionFromGeometry=async function(u){const {currentSelection:B,selector:e,signal:t,sources:F,view:y}=u;if(!F?.length)return{added:[],removed:[]};const {layers:D,layerViews:I,graphicsLayers:S}=v(F),M=(await d.whenOrAbort(Promise.all([p(e,D,y,t),x(e,I,y,t),C(e,S,y)]),t)).flat();if(!B)return{added:M,removed:[]};const G=B.toArray();u=M.filter(L=>!c(G,L));const K=G.filter(L=>!c(M,L));B.removeMany(K);B.addMany(u);return{added:u,removed:K}};b.getSelectionFromGeometryEngine= A;b.importGeometryEngine=E;Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/renderers/support/clickToleranceUtils":function(){define(["exports"],function(a){function b(g,k){return k?"xoffset"in k&&k.xoffset?Math.max(g,Math.abs(k.xoffset)):"yoffset"in k&&k.yoffset?Math.max(g,Math.abs(k.yoffset||0)):g:g}function d(g,k){if("number"===typeof g)return g;if(g?.stops?.length){g=g.stops;let h=k=0;for(let z=0;z"size"===E.type).map(E=>{const {maxSize:r,minSize:w}=E;return(d(r,g)+d(w,g))/2});let h=0;const z=k.length;if(0===z)return g;for(let E=0;E{h=b(h,z.symbol)}); return h}if("class-breaks"===k.type){let h=g;k.classBreakInfos.forEach(z=>{h=b(h,z.symbol)});return h}return g};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/views/support/drapedUtils":function(){define(["exports","../../geometry","../../core/unitUtils","../../renderers/support/clickToleranceUtils","../../geometry/Extent"],function(a,b,d,l,g){function k(z,E,r,w=new g){let v=0;if("2d"===r.type)v=E*(r.resolution??0);else if("3d"===r.type){var c=r.overlayPixelSizeInMapUnits(z), f=r.basemapSpatialReference;v=null==f||f.equals(r.spatialReference)?E*c:d.getMetersPerUnitForSR(f)/d.getMetersPerUnitForSR(r.spatialReference)}E=z.x-v;c=z.y-v;f=z.x+v;z=z.y+v;({spatialReference:r}=r);w.xmin=Math.min(E,f);w.ymin=Math.min(c,z);w.xmax=Math.max(E,f);w.ymax=Math.max(c,z);w.spatialReference=r;return w}const h=new g;a.createQueryGeometry=k;a.intersectsDrapedGeometry=function(z,E,r){z=r.toMap(z);if(null==z)return!1;const w=l.calculateTolerance();return k(z,w,r,h).intersects(E)};Object.defineProperty(a, Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/SketchTooltipControls":function(){define("require ../../chunks/tslib.es6 ../../core/arrayUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../../views/interactive/sketch/SketchOptions ../../views/interactive/tooltip/components/directionModeIcons ../Widget ../../chunks/componentsUtils ./globalCss ./LabeledSwitch ./widgetUtils ./decorators/messageBundle ./jsxFactory ./SketchTooltipControls/VisibleElements".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q){g=class extends r{constructor(A,C){super(A,C);this.viewModel=null;this.visibleElements=new q;this.sketchOptions=new z;this.viewType=void 0;this._onTooltipsEnabledChange=p=>{this.sketchOptions.tooltips.enabled=p};this._onLabelsEnabledChange=p=>{this.sketchOptions.labels.enabled=p};this._onDirectionModeChange=p=>{this.sketchOptions.values.directionMode=p.target.selectedItem.value}}loadDependencies(){return Promise.all([w.loadCalciteComponents({block:()=>new Promise((A, C)=>a(["../../chunks/calcite-block"],A,C)),label:()=>new Promise((A,C)=>a(["../../chunks/calcite-label"],A,C)),icon:()=>new Promise((A,C)=>a(["../../chunks/calcite-icon"],A,C)),"radio-button":()=>new Promise((A,C)=>a(["../../chunks/calcite-radio-button"],A,C)),"radio-button-group":()=>new Promise((A,C)=>a(["../../chunks/calcite-radio-button-group"],A,C))}),c.loadLabeledSwitchComponents()])}render(){const {label:A,visibleElements:C}=this,p=this._renderContent();return n.tsx("div",{"aria-label":A,class:this.classes("esri-sketch-tooltip-controls", v.globalCss.widget)},p?n.tsx("calcite-block",{class:"esri-sketch-tooltip-controls__block",heading:C.header?this.label:"",key:"content-block",open:!0},n.tsx("div",{class:"esri-sketch-tooltip-controls__block-content",key:"content"},p)):void 0)}get label(){return this.messages?.widgetLabel??""}set label(A){this._overrideIfSome("label",A)}_renderContent(){const {visibleElements:A,viewType:C}=this,p=[A.tooltipsToggle?this._renderTooltipsToggle():null,A.labelsToggle&&"2d"!==C?this._renderLabelsToggle(): null,A.directionModePicker?this._renderDirectionModePicker():null].filter(d.isSome);return 0===p.length?null:p}_renderTooltipsToggle(){const {messages:A,sketchOptions:C}=this;return n.tsx(c.LabeledSwitch,{checked:C.tooltips.effectiveEnabled,hint:A.tooltipsToggleHint,key:`${this.id}__tooltips`,label:A.tooltipsToggle,onChange:this._onTooltipsEnabledChange})}_renderLabelsToggle(){const {messages:A,sketchOptions:C}=this;return n.tsx(c.LabeledSwitch,{checked:C.labels.enabled,hint:A.labelsToggleHint,key:`${this.id}__labels`, label:A.labelsToggle,onChange:this._onLabelsEnabledChange})}_renderDirectionModePicker(){const {messages:A,sketchOptions:C}=this,{directionMode:p}=C.values;return n.tsx("calcite-label",{key:"direction-mode",layout:"default",scale:"s"},A.directionModePicker,n.tsx("calcite-radio-button-group",{key:"radio-button-group",layout:"horizontal",name:this.id,scale:"s",value:p,onCalciteRadioButtonGroupChange:this._onDirectionModeChange},this._renderDirectionModeOption("relative",p,A.directionModeRelative),this._renderDirectionModeOption("absolute", p,A.directionModeAbsolute)))}_renderDirectionModeOption(A,C,p){return n.tsx("calcite-label",{key:A,layout:"inline",scale:"s"},n.tsx("calcite-radio-button",{checked:A===C,scale:"s",value:A}),n.tsx("div",{class:"esri-sketch-tooltip-controls__radio-button-label-wrapper",key:"label-wrapper"},n.tsx("calcite-icon",{icon:E.directionModeIcons[A],scale:"s"}),p))}};b.__decorate([l.property()],g.prototype,"label",null);b.__decorate([l.property({type:q,nonNullable:!0})],g.prototype,"visibleElements",void 0); b.__decorate([l.property(),m.messageBundle("esri/widgets/support/SketchTooltipControls/t9n/SketchTooltipControls")],g.prototype,"messages",void 0);b.__decorate([l.property({nonNullable:!0,type:z})],g.prototype,"sketchOptions",void 0);b.__decorate([l.property({type:String})],g.prototype,"viewType",void 0);return g=b.__decorate([h.subclass("esri.widgets.support.SketchTooltipControls")],g)})},"esri/views/interactive/tooltip/components/directionModeIcons":function(){define(["exports"],function(a){a.directionModeIcons= {absolute:"absolute-direction",relative:"relative-direction"};Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/LabeledSwitch":function(){define(["require","exports","../../chunks/componentsUtils","./widgetUtils","./jsxFactory"],function(a,b,d,l,g){b.LabeledSwitch=function({checked:k,disabled:h,hint:z,key:E,label:r,onChange:w}){return g.tsx("calcite-label",{class:"esri-labeled-switch__label",disabled:h,key:E,layout:"inline-space-between",scale:"s"},g.tsx("div", {class:"esri-labeled-switch__label-content",key:"label-content"},z?g.tsx(g.tsxFragment,null,g.tsx("div",null,r),g.tsx("calcite-icon",{class:"esri-labeled-switch__icon",icon:"information",id:E,scale:"s"}),g.tsx("calcite-tooltip",{class:"esri-labeled-switch__tooltip",referenceElement:E},z)):r),g.tsx("calcite-switch",{checked:k,disabled:h,scale:"s",onCalciteSwitchChange:v=>w(v.target.checked)}))};b.loadLabeledSwitchComponents=()=>Promise.all([d.loadCalciteComponents({icon:()=>new Promise((k,h)=>a(["../../chunks/calcite-icon"], k,h)),label:()=>new Promise((k,h)=>a(["../../chunks/calcite-label"],k,h)),switch:()=>new Promise((k,h)=>a(["../../chunks/calcite-switch"],k,h)),tooltip:()=>new Promise((k,h)=>a(["../../chunks/calcite-tooltip"],k,h))})]);Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/SketchTooltipControls/VisibleElements":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass".split(" "), function(a,b,d,l,g,k,h){b=class extends b{constructor(z){super(z);this.header=this.directionModePicker=!1;this.tooltipsToggle=this.labelsToggle=!0}};a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"directionModePicker",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"header",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"labelsToggle",void 0);a.__decorate([d.property({type:Boolean,nonNullable:!0})],b.prototype,"tooltipsToggle", void 0);return b=a.__decorate([h.subclass("esri.widgets.support.SketchTooltipControls.VisibleElements")],b)})},"esri/widgets/support/SnappingControls":function(){define("require ../../chunks/tslib.es6 ../../core/arrayUtils ../../core/maybe ../../core/uid ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/accessorSupport/decorators/subclass ../Widget ../../chunks/componentsUtils ./globalCss ./LabeledSwitch ./widgetUtils ./decorators/messageBundle ./jsxFactory ./SnappingControls/SnappingControlsViewModel ./SnappingControls/snappingLayerListUtils ./SnappingControls/VisibleElements".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A,C){h=class extends r{constructor(p,x){super(p,x);this._layerListFilter=this._defaultViewModel=null;this.layerListOpen=!0;this.messages=null;this.visibleElements=new C;this._enableSnappingSwitchChange=t=>{this.snappingOptions.enabled=t};this._featureEnabledSwitchChange=t=>{this.snappingOptions.featureEnabled=t};this._selfEnabledSwitchChange=t=>{this.snappingOptions.selfEnabled=t};this._onToggleLayersButtonClick=t=>{this.viewModel.toggleSnappingForAllLayers(!this.viewModel.allLayersEnabled); requestAnimationFrame(()=>t.target.setFocus())};const {snappingOptions:u,view:B,viewModel:e}=p;this.viewModel=e??(this._defaultViewModel=new q({snappingOptions:u,view:B}))}normalizeCtorArgs(p){const {snappingOptions:x,view:u,viewModel:B,...e}=p;return e}destroy(){this.viewModel!==this._defaultViewModel&&(this._defaultViewModel=l.destroyMaybe(this._defaultViewModel))}loadDependencies(){return Promise.all([w.loadCalciteComponents({block:()=>new Promise((p,x)=>a(["../../chunks/calcite-block"],p,x)), button:()=>new Promise((p,x)=>a(["../../chunks/calcite-button"],p,x)),input:()=>new Promise((p,x)=>a(["../../chunks/calcite-input"],p,x)),list:()=>new Promise((p,x)=>a(["../../chunks/calcite-list"],p,x)),"list-item":()=>new Promise((p,x)=>a(["../../chunks/calcite-list-item"],p,x)),checkbox:()=>new Promise((p,x)=>a(["../../chunks/calcite-checkbox"],p,x))}),c.loadLabeledSwitchComponents()])}get icon(){return"snap-to-point"}set icon(p){this._overrideIfSome("icon",p)}get label(){return this.messages?.widgetLabel?? ""}set label(p){this._overrideIfSome("label",p)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(p){this.viewModel.snappingOptions=p}get view(){return this.viewModel.view}set view(p){this.viewModel.view=p}set viewModel(p){if(p!==this._get("viewModel")){if(null==this._defaultViewModel||this._defaultViewModel!==p)this._defaultViewModel=l.destroyMaybe(this._defaultViewModel);this._set("viewModel",p)}}render(){const {label:p}=this;return n.tsx("div",{"aria-label":p,class:this.classes("esri-snapping-controls", v.globalCss.widget)},n.tsx("div",{class:"esri-snapping-controls__container"},this._renderContent()))}_renderContent(){return[this._renderToggles(),this._renderLayerList()]}_renderToggles(){const {visibleElements:p}=this;var x=[p.selfEnabledToggle?this._renderSelfEnabledToggle():null,p.featureEnabledToggle?this._renderFeatureEnabledToggle():null].filter(d.isSome);x=[p.enabledToggle?this._renderEnabledToggle():null,0{this._layerListFilter=""===e?null:new RegExp(e,"i")};u=9this.layerListOpen=e.target.open},u,this._renderToggleLayersButton(),n.tsx("calcite-list",{class:"esri-snapping-controls__layer-list",selectionMode:"none"},this._renderLayerListItemCollection(x.layerListViewModel.operationalItems)))}_renderLayerListItemCollection(p){const x=this._layerListFilter;return p.map(u=>{switch(x?A.itemTitleMatchesFilter(u,x):null){case "children":const B=u.children.filter(e=>!1!==A.itemTitleMatchesFilter(e, x));return this._renderLayerListItemGroup(u,B);case "self":case null:return this._renderLayerListItemOrGroup(u);case !1:return"self"===A.itemTitleMatchesFilter(u.parent,x)?this._renderLayerListItemOrGroup(u):null}}).toArray().filter(d.isSome)}_renderToggleLayersButton(){if(!this.visibleElements.layerListToggleLayersButton)return null;const {viewModel:{allLayersEnabled:p},messages:x}=this,u=p?x.disableAllLayers:x.enableAllLayers;return n.tsx("calcite-button",{appearance:"transparent",class:"esri-snapping-controls__layer-list__button", label:u,name:"layer-toggle",onclick:this._onToggleLayersButtonClick},u)}_renderLayerListItemOrGroup(p){if(p.children.length)return this._renderLayerListItemGroup(p);const {messages:{untitledLayer:x}}=this,u=()=>{this.viewModel.toggleSnappingForLayers([p.layer.id],"enabled"!==p.enabled)};return n.tsx("calcite-list-item",{class:"esri-snapping-controls__layer-list__item",key:`${this.id}-list-item-${p.uid}`,label:p.title||x,onCalciteListItemSelect:B=>{B.stopPropagation();u()}},n.tsx("calcite-checkbox", {checked:"enabled"===p.enabled,slot:"actions-start",onCalciteCheckboxChange:u}))}_renderLayerListItemGroup(p,x){const {children:u,title:B}=p,e=B||this.messages.untitledLayer,t=B&&""!==B?B:g.generateUID(),F=x??u,y=()=>{this.viewModel.toggleSnappingForLayers(p.childLayerIds,"enabled"!==p.enabled)};return n.tsx("calcite-list-item",{class:"esri-snapping-controls__layer-list__group",key:t,label:e,open:!!x?.length,onCalciteListItemSelect:D=>{D.stopPropagation();y()}},n.tsx("calcite-checkbox",{checked:"enabled"=== p.enabled,indeterminate:"indeterminate"===p.enabled,slot:"actions-start",onCalciteCheckboxChange:y}),n.tsx("calcite-list",null,this._renderLayerListItemCollection(F)))}get _enabledToggleDisabled(){const p=this.snappingOptions;return p.enabledToggled||p.forceDisabled}get _secondaryElementsDisabled(){return this._enabledToggleDisabled||!this.snappingOptions.enabled}};b.__decorate([k.property()],h.prototype,"_defaultViewModel",void 0);b.__decorate([k.property()],h.prototype,"_layerListFilter",void 0); b.__decorate([k.property()],h.prototype,"label",null);b.__decorate([k.property({type:Boolean,nonNullable:!0})],h.prototype,"layerListOpen",void 0);b.__decorate([k.property(),m.messageBundle("esri/widgets/support/SnappingControls/t9n/SnappingControls")],h.prototype,"messages",void 0);b.__decorate([k.property()],h.prototype,"snappingOptions",null);b.__decorate([k.property()],h.prototype,"view",null);b.__decorate([k.property()],h.prototype,"viewModel",null);b.__decorate([k.property({type:C,nonNullable:!0})], h.prototype,"visibleElements",void 0);b.__decorate([k.property()],h.prototype,"_enabledToggleDisabled",null);b.__decorate([k.property()],h.prototype,"_secondaryElementsDisabled",null);return h=b.__decorate([E.subclass("esri.widgets.support.SnappingControls")],h)})},"esri/widgets/support/SnappingControls/SnappingControlsViewModel":function(){define("../../../chunks/tslib.es6 ../../../core/Accessor ../../../core/Error ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../../views/interactive/snapping/FeatureSnappingLayerSource ../../../views/interactive/snapping/SnappingOptions ../../LayerList/support/layerListUtils ./SnappingLayerListViewModel".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c){b=class extends b{constructor(f){super(f);this.layerListViewModel=new c.SnappingLayerListViewModel;this.snappingOptions=new w;this.view=null}initialize(){this.addHandles([l.watch(()=>({viewModel:this.layerListViewModel,view:this.view}),({viewModel:f,view:m})=>{f.view=m},l.initial),l.watch(()=>({viewModel:this.layerListViewModel,sources:this.snappingOptions?.featureSources}),({viewModel:f,sources:m})=>{f.featureSnappingSources=m},l.initial)])}get allLayersEnabled(){return(this.layerListViewModel?.selectableItems?? []).every(f=>"enabled"===f.enabled)}get allLayersDisabled(){return(this.layerListViewModel?.selectableItems??[]).every(f=>!f.enabled)}get layersEnabledCount(){return this.layerListViewModel?.selectableItems?.filter(f=>"enabled"===f.enabled).length??0}get state(){return this.snappingOptions?"ready":"disabled"}toggleSnappingForLayers(f,m){f?.forEach(n=>m?this.enableSnappingForLayer(n):this.disableSnappingForLayer(n))}toggleSnappingForAllLayers(f){this.layerListViewModel.selectableItems.forEach(({layer:{id:m}})=> {f?this.enableSnappingForLayer(m):this.disableSnappingForLayer(m)})}enableSnappingForLayer(f){if(f=this._findSnappingSourceForLayer(f)??this._makeSnappingSourceForLayer(f))f.enabled=!0}disableSnappingForLayer(f){if(f=this._findSnappingSourceForLayer(f))f.enabled=!1}updateEnabledFeatureSources(f){for(const m of this.snappingOptions.featureSources)v.canDisplayLayer(m.layer)&&(m.enabled=f.includes(m.layer.id))}_findSnappingSourceForLayer(f){return this.snappingOptions.featureSources.find(m=>m.layer.id=== f)}_makeSnappingSourceForLayer(f){var m=this.layerListViewModel.operationalItemsFlat.find(n=>n.layer.id===f)?.layer;if(!m)throw new d("snapping-controls:layer-not-found",`cannot enable snapping for layer with id ${f} because no such layer was found in the view`);if("group"!==m.type)return m=new r({layer:m}),this.snappingOptions.featureSources.add(m),m}};a.__decorate([g.property()],b.prototype,"allLayersEnabled",null);a.__decorate([g.property()],b.prototype,"allLayersDisabled",null);a.__decorate([g.property({constructOnly:!0})], b.prototype,"layerListViewModel",void 0);a.__decorate([g.property()],b.prototype,"layersEnabledCount",null);a.__decorate([g.property({type:w,nonNullable:!0})],b.prototype,"snappingOptions",void 0);a.__decorate([g.property()],b.prototype,"state",null);a.__decorate([g.property()],b.prototype,"view",void 0);return b=a.__decorate([E.subclass("esri.widgets.support.SnappingControls.SnappingControlsViewModel")],b)})},"esri/widgets/LayerList/support/layerListUtils":function(){define(["exports"],function(a){function b(h){return h?.listMode?? void 0}function d(h){if(h&&!("type"in h&&"wmts"===h.type))return"sublayers"in h?"sublayers":"layers"in h?"layers":void 0}function l(h,z){h?.sort((E,r)=>{E="uid"in E?z.indexOf(E.uid):-1;r="uid"in r?z.indexOf(r.uid):-1;return E>r?-1:E!r.hidden).length&&!z&&!E};a.minDragEnabledItems=2;a.minFilterItems=10;a.sortChildLayersToIds=function(h,z){if(h=h?.layer){var E=d(h);if(E){if("layers"===E&&"layers"in h)var r=h.layers;else"sublayers"===E&&"sublayers"in h&&(r=h.sublayers);l(r,z)}}};a.sortLayersToIds=l;Object.defineProperty(a,Symbol.toStringTag, {value:"Module"})})},"esri/widgets/support/SnappingControls/SnappingLayerListViewModel":function(){define("exports ../../../chunks/tslib.es6 ../../../core/Collection ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../LayerList/LayerListViewModel ./snappingLayerListUtils ./SnappingListItem".split(" "),function(a,b,d,l,g,k,h,z,E,r,w){a.SnappingLayerListViewModel=class extends E{constructor(){super(...arguments); this.featureSnappingSources=new d}get operationalItemsFlat(){return this.operationalItems.flatten(v=>v.children)}get selectableItems(){return this.operationalItemsFlat.filter(v=>!v.children?.length)}_compileList(){var v=this.view?.map?.layers;v&&(v=v.filter(r.isValidSnappingLayer),this._watchLayersListMode(v),v=this._getViewableLayers(v),v?.length?(this._createNewItems(v),this._removeItems(v),this._sortItems(v)):this._removeAllItems())}_createListItem(v){return new w.SnappingListItem({layer:v,view:this.view, getFeatureSnappingSources:()=>this.featureSnappingSources})}};b.__decorate([l.property()],a.SnappingLayerListViewModel.prototype,"featureSnappingSources",void 0);b.__decorate([l.property()],a.SnappingLayerListViewModel.prototype,"operationalItems",void 0);b.__decorate([l.property()],a.SnappingLayerListViewModel.prototype,"operationalItemsFlat",null);b.__decorate([l.property()],a.SnappingLayerListViewModel.prototype,"selectableItems",null);a.SnappingLayerListViewModel=b.__decorate([z.subclass("esri.widgets.support.SnappingControls.SnappingLayerListViewModel")], a.SnappingLayerListViewModel);Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/LayerList/LayerListViewModel":function(){define("../../chunks/tslib.es6 ../../core/Collection ../../core/Evented ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./ListItem ./support/layerListUtils".split(" "),function(a,b,d,l,g,k,h,z,E,r,w){const v=b.ofType(r);b=class extends d.EventedAccessor{constructor(c){super(c); this.checkPublishStatusEnabled=!1;this.listItemCreatedFunction=null;this.listModeDisabled=!1;this.operationalItems=new v;this.view=null}initialize(){this.addHandles([l.watch(()=>!0===this.view?.ready,()=>this._viewHandles(),l.initial),l.watch(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled,this.listModeDisabled],()=>this._recompileList())],"view")}destroy(){this._removeAllItems();this.view=null}get state(){const {view:c}=this;return c?.ready?"ready":c?"loading":"disabled"}get totalItems(){return this.operationalItems.flatten(c=> c.children).length}triggerAction(c,f){c&&!c.disabled&&this.emit("trigger-action",{action:c,item:f})}moveListItem(c,f,m,n){const q=c?.layer;if(q&&"subtype-sublayer"!==q.type&&"sublayer"!==q.type){var A=this.view?.map?.layers,C=f?w.getItemLayers(f):A;A=m?w.getItemLayers(m):A;if(C&&A){var {operationalItems:p}=this,x=m?.children||p;n=A.length-n;c.parent=m||null;(f?.children||p).remove(c);C.remove(q);x.includes(c)||x.add(c,n);A.includes(q)||A.add(q,n);this._compileList()}}}_createLayerViewHandles(c){this.removeHandles("layer-views"); this._compileList();c&&this.addHandles(c.on("change",()=>this._compileList()),"layer-views")}_createMapLayerHandles(c){this.removeHandles("map-layers");this._compileList();c&&this.addHandles(c.on("change",()=>this._compileList()),"map-layers")}_createListItem(c){const {view:f,listItemCreatedFunction:m,checkPublishStatusEnabled:n,listModeDisabled:q}=this;return new r({checkPublishStatusEnabled:n,listModeDisabled:q,layer:c,listItemCreatedFunction:m,view:f})}_removeAllItems(){this.operationalItems.destroyAll()}_getViewableLayers(c){return c? this.listModeDisabled?c:c.filter(f=>"hide"!==w.findLayerListMode(f)):void 0}_watchLayersListMode(c){this.removeHandles("layer-list-mode");c&&!this.listModeDisabled&&this.addHandles(l.watch(()=>c.filter(f=>"listMode"in f).map(f=>f.listMode).toArray(),()=>this._compileList()),"layer-list-mode")}_compileList(){var c=this.view?.map?.layers;this._watchLayersListMode(c);c=this._getViewableLayers(c);c?.length?(this._createNewItems(c),this._removeItems(c),this._sortItems(c)):this._removeAllItems()}_createNewItems(c){const {operationalItems:f}= this;c.forEach(m=>{f.some(n=>n.layer===m)||f.add(this._createListItem(m))})}_removeItems(c){const {operationalItems:f}=this,m=[];f.forEach(n=>{n&&c&&c.includes(n.layer)||m.push(n)});f.destroyMany(m)}_sortItems(c){const {operationalItems:f}=this;f.sort((m,n)=>{m=c.indexOf(m.layer);n=c.indexOf(n.layer);return m>n?-1:m this.view?.map?.allLayers,f=>this._createMapLayerHandles(f),l.initial),l.watch(()=>this.view?.allLayerViews,f=>this._createLayerViewHandles(f),l.initial)],"view-layers"):this._removeAllItems()}};a.__decorate([g.property()],b.prototype,"checkPublishStatusEnabled",void 0);a.__decorate([g.property()],b.prototype,"listItemCreatedFunction",void 0);a.__decorate([g.property({nonNullable:!0})],b.prototype,"listModeDisabled",void 0);a.__decorate([g.property({type:v})],b.prototype,"operationalItems",void 0); a.__decorate([g.property({readOnly:!0})],b.prototype,"state",null);a.__decorate([g.property()],b.prototype,"totalItems",null);a.__decorate([g.property()],b.prototype,"view",void 0);return b=a.__decorate([E.subclass("esri.widgets.LayerList.LayerListViewModel")],b)})},"esri/widgets/LayerList/ListItem":function(){define("../../chunks/tslib.es6 ../../core/Accessor ../../core/arrayUtils ../../core/Collection ../../core/Identifiable ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/accessorSupport/decorators/cast ../../core/has ../../core/accessorSupport/decorators/subclass ../../core/accessorSupport/get ../../support/actions/ActionBase ../../support/actions/ActionButton ../../support/actions/ActionSlider ../../support/actions/ActionToggle ./ListItemPanel ./support/layerListUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q){var A;E=l.ofType({key:"type",defaultKeyValue:"button",base:v,typeMap:{button:c,toggle:m,slider:f}});const C=l.ofType(E);b=A=class extends g.IdentifiableMixin(b){constructor(p){super(p);this.actionsSections=new C;this.checkPublishStatusEnabled=this.actionsOpen=!1;this.children=new (l.ofType(A));this.childrenSortable=!0;this.hidden=!1;this.listItemCreatedFunction=this.layer=null;this.open=this.listModeDisabled=!1;this.view=this.parent=this.panel=null}initialize(){this.addHandles([k.watch(()=> [this.layer,this.layer?.listMode,this.listModeDisabled],()=>this._watchLayerProperties(this.layer),k.initial),k.watch(()=>this.checkPublishStatusEnabled,p=>this._updateChildrenPublishing(p),k.initial),k.watch(()=>this.view,p=>this._updateChildrenView(p),k.initial),k.watch(()=>this.panel,p=>this._setListItemOnPanel(p),k.initial)]);"function"===typeof this.listItemCreatedFunction&&this.listItemCreatedFunction.call(null,{item:this})}destroy(){this.panel?.destroy();this.children.destroyAll();this.view= null}get connectionStatus(){const {layerView:p,publishing:x}=this;if(!x&&p&&"connectionStatus"in p)return p.connectionStatus}get error(){return this.layer?.loadError}get incompatible(){const {layerView:p}=this;return p&&"spatialReferenceSupported"in p?!p.spatialReferenceSupported:!1}get layerView(){const {layer:p,view:x}=this;if(!p||!x||"sublayer"===p.type)return null;const u="subtype-sublayer"===p.type?p.parent:p;return x.allLayerViews.find(B=>B.layer===u)??null}castPanel(p){this.panel?.open&&!p.hasOwnProperty("open")&& (p.open=!0);return p?new n(p):null}get sortable(){return"knowledge-graph-sublayer"===this.layer?.type?!1:this._get("sortable")}set sortable(p){this._set("sortable",p)}get title(){const p=w.get(this,"layer.layer");return(!p||p&&w.get(this,"layer.layer.loaded"))&&w.get(this,"layer.title")||w.get(this,"layer.attributes.title")||""}set title(p){this._override("title",p)}get publishing(){const {layer:p,checkPublishStatusEnabled:x}=this;return x&&p&&"publishingInfo"in p&&"publishing"===p.publishingInfo?.status}get updating(){const {layerView:p, connectionStatus:x,layer:u,publishing:B}=this;return B||x?!1:p?p.updating:"loading"===u?.loadStatus||!1}get visible(){return this.layer?.visible}set visible(p){const x=this.layer;x&&(x.visible=p)}get visibleAtCurrentScale(){return this.layerView?.visibleAtCurrentScale??!0}get visibleAtCurrentTimeExtent(){return this.layerView?.visibleAtCurrentTimeExtent??!0}get visibilityMode(){return q.findLayerVisibilityMode(this.layer)}clone(){return new A({actionsSections:this.actionsSections.clone(),actionsOpen:this.actionsOpen, checkPublishStatusEnabled:this.checkPublishStatusEnabled,children:this.children.clone(),childrenSortable:this.childrenSortable,hidden:this.hidden,layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,open:this.open,panel:this.panel,parent:this.parent,sortable:this.sortable,title:this.title,view:this.view,visible:this.visible})}_setListItemOnPanel(p){p&&(p.listItem=this)}_updateChildrenPublishing(p){const x=this.children;x&&x.forEach(u=>u.checkPublishStatusEnabled= p)}_updateChildrenView(p){const x=this.children;x&&x.forEach(u=>u.view=p)}_createChildren(p){const {listModeDisabled:x,children:u}=this;p=p.filter(B=>!u.some(e=>e.layer===B));u.addMany(this._createChildItems(p,x))}_destroyChildren(p){const {children:x}=this,u=x.filter(B=>!p.includes(B.layer));x.destroyMany(u)}_sortChildren(p){this.children.sort((x,u)=>p.indexOf(u.layer)-p.indexOf(x.layer))}_destroyAllChildren(){this.removeHandles("child-list-mode");this.children.destroyAll()}_watchChildLayerListMode(p){this.removeHandles("child-list-mode"); this.listModeDisabled||this.addHandles(p.toArray().map(x=>k.watch(()=>x.listMode,()=>this._compileChildren(p))),"child-list-mode")}_compileChildren(p){const x=this.listModeDisabled?p:p?.filter(u=>"hide"!==q.findLayerListMode(u));x?.length?(this._createChildren(x),this._destroyChildren(x),this._sortChildren(x),this._watchChildLayerListMode(p)):this._destroyAllChildren()}_watchSublayerChanges(p){p&&this.addHandles(p.on("change",()=>this._compileChildren(p)),"layer")}_initializeChildLayers(p){this._compileChildren(p); this._watchSublayerChanges(p)}_createChildItems(p,x){return p.map(u=>x||q.canDisplayLayer(u)?new A({layer:u,checkPublishStatusEnabled:this.checkPublishStatusEnabled,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,parent:this,view:this.view}):null).filter(d.isSome).reverse()}_watchLayerProperties(p){this.removeHandles("layer");this.removeHandles("child-list-mode");if(p)if("hide-children"===(!this.listModeDisabled&&q.findLayerListMode(p)))this.children.destroyAll(); else{var x=q.getNormalizedChildLayerProperty(p);x&&this.addHandles(k.watch(()=>p[x],u=>{p.hasOwnProperty(x)&&this._initializeChildLayers(u)},k.initial),"layer")}}};a.__decorate([h.property({type:C})],b.prototype,"actionsSections",void 0);a.__decorate([h.property()],b.prototype,"actionsOpen",void 0);a.__decorate([h.property()],b.prototype,"checkPublishStatusEnabled",void 0);a.__decorate([h.property({type:l})],b.prototype,"children",void 0);a.__decorate([h.property()],b.prototype,"childrenSortable", void 0);a.__decorate([h.property({readOnly:!0})],b.prototype,"connectionStatus",null);a.__decorate([h.property({readOnly:!0})],b.prototype,"error",null);a.__decorate([h.property()],b.prototype,"hidden",void 0);a.__decorate([h.property({readOnly:!0})],b.prototype,"incompatible",null);a.__decorate([h.property()],b.prototype,"layer",void 0);a.__decorate([h.property({readOnly:!0})],b.prototype,"layerView",null);a.__decorate([h.property()],b.prototype,"listItemCreatedFunction",void 0);a.__decorate([h.property({nonNullable:!0})], b.prototype,"listModeDisabled",void 0);a.__decorate([h.property()],b.prototype,"open",void 0);a.__decorate([h.property({type:n})],b.prototype,"panel",void 0);a.__decorate([z.cast("panel")],b.prototype,"castPanel",null);a.__decorate([h.property()],b.prototype,"parent",void 0);a.__decorate([h.property({value:!0})],b.prototype,"sortable",null);a.__decorate([h.property()],b.prototype,"title",null);a.__decorate([h.property({readOnly:!0})],b.prototype,"publishing",null);a.__decorate([h.property({readOnly:!0})], b.prototype,"updating",null);a.__decorate([h.property()],b.prototype,"view",void 0);a.__decorate([h.property()],b.prototype,"visible",null);a.__decorate([h.property({readOnly:!0})],b.prototype,"visibleAtCurrentScale",null);a.__decorate([h.property({readOnly:!0})],b.prototype,"visibleAtCurrentTimeExtent",null);a.__decorate([h.property({readOnly:!0})],b.prototype,"visibilityMode",null);return b=A=a.__decorate([r.subclass("esri.widgets.LayerList.ListItem")],b)})},"esri/support/actions/ActionSlider":function(){define("../../chunks/tslib.es6 ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./ActionBase".split(" "), function(a,b,d,l,g,k,h){var z;d=z=class extends h{constructor(E){super(E);this.displayValueEnabled=!1;this.max=1;this.min=0;this.step=.1;this.type="slider";this.value=null}clone(){return new z({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,displayValueEnabled:this.displayValueEnabled,max:this.max,min:this.min,step:this.step,value:this.value})}};a.__decorate([b.property()],d.prototype,"displayValueEnabled", void 0);a.__decorate([b.property()],d.prototype,"max",void 0);a.__decorate([b.property()],d.prototype,"min",void 0);a.__decorate([b.property()],d.prototype,"step",void 0);a.__decorate([b.property()],d.prototype,"value",void 0);return d=z=a.__decorate([k.subclass("esri.support.actions.ActionSlider")],d)})},"esri/widgets/LayerList/ListItemPanel":function(){define("require ../../chunks/tslib.es6 ../../core/Identifiable ../../core/maybe ../../core/reactiveUtils ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Widget ./support/layerListUtils ../support/widget ../support/jsxFactory".split(" "), function(a,b,d,l,g,k,h,z,E,r,w,v,c,f){d=class extends d.IdentifiableMixin(w){constructor(m,n){super(m,n);this.content=this.className=this._legend=null;this.flowEnabled=!1;this.listItem=this.image=null;this.open=!1;this.visible=!0}initialize(){this.addHandles([g.watch(()=>this._canCreateLegend,()=>this._createLegend(),g.initial),g.watch(()=>[this._legend,this._legendOptions],()=>this._updateLegend(),g.initial)])}destroy(){this._legend=l.destroyMaybe(this._legend)}get _canCreateLegend(){const {content:m, listItem:n}=this;return n?"legend"===m?!0:null!=m&&(Array.isArray(m)?m.includes("legend"):!1):!1}get _legendOptions(){const {listItem:m,_legendLayerInfo:n}=this,q=m?.view;return n&&q?{view:q,layerInfos:[n]}:{}}get _legendLayerInfo(){const m=this.listItem?.layer;if(!m||"subtype-sublayer"===m.type)return null;var n=v.isSublayer(m)?m:null;const q=m?.parent;return(n=null!=q&&"type"in q&&"map-image"===q.type?n?.source:null)&&q?{layer:q,title:"",sublayerIds:[n.mapLayerId]}:{layer:m,title:""}}get disabled(){const {listItem:m, _legend:n,content:q}=this;return m?Array.isArray(q)&&1this._renderContent(q)):this._renderContent(m): null}async _createLegend(){l.destroyMaybe(this._legend);this._legend=null;if(this._canCreateLegend){var {default:m}=await new Promise((n,q)=>a(["../Legend"],A=>n(Object.freeze(Object.defineProperty({__proto__:null,default:A},Symbol.toStringTag,{value:"Module"}))),q));this._legend=new m(this._legendOptions)}}_attachToNode(m){m.appendChild(this)}_updateLegend(){const m=this._legend;m&&m.set(this._legendOptions)}_getWidget(m){return"legend"===m?this._legend:c.isWidget(m)?m:null}_getFirstWidget(){const {content:m}= this;return Array.isArray(m)?m.map(n=>this._getWidget(n)).find(n=>n):this._getWidget(m)}};b.__decorate([k.property()],d.prototype,"_legend",void 0);b.__decorate([k.property()],d.prototype,"_canCreateLegend",null);b.__decorate([k.property()],d.prototype,"_legendOptions",null);b.__decorate([k.property()],d.prototype,"_legendLayerInfo",null);b.__decorate([k.property()],d.prototype,"className",void 0);b.__decorate([k.property()],d.prototype,"content",void 0);b.__decorate([k.property()],d.prototype,"disabled", null);b.__decorate([k.property()],d.prototype,"flowEnabled",void 0);b.__decorate([k.property()],d.prototype,"icon",null);b.__decorate([k.property()],d.prototype,"image",void 0);b.__decorate([k.property()],d.prototype,"listItem",void 0);b.__decorate([k.property()],d.prototype,"open",void 0);b.__decorate([k.property()],d.prototype,"title",null);b.__decorate([k.property()],d.prototype,"visible",void 0);return d=b.__decorate([r.subclass("esri.widgets.LayerList.ListItemPanel")],d)})},"esri/widgets/support/SnappingControls/snappingLayerListUtils":function(){define(["exports", "../../LayerList/support/layerListUtils"],function(a,b){const d=h=>l(h)||g(h),l=h=>{if(!("type"in h))return!1;switch(h.type){case "feature":case "geojson":case "csv":case "graphics":case "wfs":case "map-notes":case "oriented-imagery":case "scene":case "building-scene":case "subtype-sublayer":return!0;default:return!1}},g=h=>{const z=b.getNormalizedChildLayerProperty(h);if(null!=z&&h.hasOwnProperty(z)&&null!=h[z])for(const E of h[z])if(d(E))return!0;return!1},k=(h,z)=>{if(null!=z&&null!=h){if(z.test(h.title))return"self"; if(h.children.some(E=>!1!==k(E,z)))return"children"}return!1};a.isValidSnappingLayer=d;a.isValidSnappingLayerGroup=g;a.isValidSnappingLayerSource=l;a.itemTitleMatchesFilter=k;Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"esri/widgets/support/SnappingControls/SnappingListItem":function(){define("exports ../../../chunks/tslib.es6 ../../../core/arrayUtils ../../../core/Collection ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/accessorSupport/decorators/subclass ../../LayerList/ListItem ../../LayerList/support/layerListUtils ./snappingLayerListUtils".split(" "), function(a,b,d,l,g,k,h,z,E,r,w){var v;a.SnappingListItem=v=class extends E{constructor(c){super(c);this.children=new l;this.parent=null}get enabled(){const {children:c}=this;if(0===c.length)return null!=this.featureSource?this.featureSource.enabled?"enabled":"disabled":"disabled";let f=!1,m=!1;for(const n of c){if("indeterminate"===n.enabled)return n.enabled;"enabled"===n.enabled?f=!0:"disabled"===n.enabled&&(m=!0);if(m&&f)return"indeterminate"}return m?"disabled":"enabled"}get childLayerIds(){return this.children.toArray().flatMap(c=> [c.layer.id,...c.childLayerIds])}get featureSource(){const {layer:c,getFeatureSnappingSources:f}=this;return f().find(m=>m.layer===c)}_initializeChildLayers(c){c&&(c=c.filter(w.isValidSnappingLayer),super._initializeChildLayers(c))}_createChildItems(c){return c.map(f=>r.canDisplayLayer(f)?new v({layer:f,parent:this,view:this.view,getFeatureSnappingSources:this.getFeatureSnappingSources}):null).filter(d.isSome).reverse()}};b.__decorate([g.property()],a.SnappingListItem.prototype,"enabled",null);b.__decorate([g.property()], a.SnappingListItem.prototype,"children",void 0);b.__decorate([g.property()],a.SnappingListItem.prototype,"childLayerIds",null);b.__decorate([g.property()],a.SnappingListItem.prototype,"featureSource",null);b.__decorate([g.property({constructOnly:!0})],a.SnappingListItem.prototype,"getFeatureSnappingSources",void 0);b.__decorate([g.property()],a.SnappingListItem.prototype,"parent",void 0);a.SnappingListItem=v=b.__decorate([z.subclass("esri.widgets.support.SnappingControls.SnappingListItem")],a.SnappingListItem); Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})})},"*noref":1}}); define("require ../chunks/tslib.es6 ../intl ../core/handleUtils ../core/maybe ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ../views/interactive/sketch/SketchValueOptions ./Widget ./Sketch/SketchViewModel ./Sketch/VisibleElements ../chunks/componentsUtils ./support/globalCss ./support/SelectionToolbar ./support/SketchTooltipControls ./support/SnappingControls ./support/widgetUtils ./support/decorators/messageBundle ./support/decorators/vmEvent ./support/jsxFactory ../intl/substitute".split(" "),function(a, b,d,l,g,k,h,z,E,r,w,v,c,f,m,n,q,A,C,p,x,u,B,e,t,F){d=class extends f{constructor(y,D){super(y,D);this._activeCreateOptions=null;this._menuOpen=!1;this._viewModelHandlesGroup=this._selectionToolbar=null;this.availableCreateTools=["point","polyline","polygon","rectangle","circle"];this.creationMode="continuous";this.layout="horizontal";this.messagesCommon=this.messages=null;this.visibleElements=new n;this._activateCreateTool=this._activateCreateTool.bind(this);this.viewModel=y?.viewModel||new m}initialize(){const {layer:y, view:D}=this,I=new C({view:"2d"===D?.type?D:null,sources:y?[y]:null});this.addHandles([h.watch(()=>this.viewModel,S=>{this._viewModelHandlesGroup=g.removeMaybe(this._viewModelHandlesGroup);S&&(this._viewModelHandlesGroup=l.handlesGroup([S.on("create",M=>{this.scheduleRender();this._onCreateOperation(M)}),S.on("update",()=>this.scheduleRender()),S.on("delete",M=>this.emit("delete",M)),S.on("undo",()=>this.scheduleRender()),S.on("redo",()=>this.scheduleRender()),h.watch(()=>S.layer,M=>{this._selectionToolbar&& (this._selectionToolbar.sources=M?[M]:null)}),h.watch(()=>S.view,M=>{this._selectionToolbar&&(this._selectionToolbar.view="2d"===M?.type?M:null)}),h.watch(()=>S.state,()=>this.notifyChange("state"))]))},h.syncAndInitial),h.when(()=>I.activeToolInfo,()=>this.viewModel.cancel()),I.on("complete",S=>this._onSelectionOperationComplete(S)),h.watch(()=>{const {selectionTools:S}=this.visibleElements;return{lassoTool:!!S?.["lasso-selection"],rectangleTool:!!S?.["rectangle-selection"]}},S=>{Object.assign(I.visibleElements, S)},h.syncAndInitial)]);this._selectionToolbar=I}loadDependencies(){return q.loadCalciteComponents({action:()=>new Promise((y,D)=>a(["../chunks/calcite-action"],y,D)),icon:()=>new Promise((y,D)=>a(["../chunks/calcite-icon"],y,D))})}destroy(){this._selectionToolbar?.destroy();this._viewModelHandlesGroup=g.removeMaybe(this._viewModelHandlesGroup)}get activeTool(){const y=this._selectionToolbar?.activeToolInfo;if(y)switch(y.toolName){case "lasso":return"lasso-selection";case "rectangle":return"rectangle-selection"; case "default":return"custom-selection"}return this.viewModel.activeTool}get createGraphic(){return this.viewModel.createGraphic}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(y){this.viewModel.defaultCreateOptions=y}get defaultUpdateOptions(){return this.viewModel.defaultUpdateOptions}set defaultUpdateOptions(y){this.viewModel.defaultUpdateOptions=y}get icon(){return"pencil"}set icon(y){this._overrideIfSome("icon",y)}get label(){return this.messages?.widgetLabel?? ""}set label(y){this._overrideIfSome("label",y)}get labelOptions(){return this.viewModel.labelOptions}set labelOptions(y){this.viewModel.labelOptions=y}get layer(){return this.viewModel.layer}set layer(y){this.viewModel.layer=y}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(y){this.viewModel.snappingOptions=y}get state(){return this._selectionToolbar?.activeToolInfo?"active":this.viewModel.state}get tooltipOptions(){return this.viewModel.tooltipOptions}set tooltipOptions(y){this.viewModel.tooltipOptions= y}get updateGraphics(){return this.viewModel.updateGraphics}get valueOptions(){return this.viewModel.valueOptions}set valueOptions(y){this.viewModel.valueOptions=y}get view(){return this.viewModel.view}set view(y){this.viewModel.view=y}set viewModel(y){const D=this._get("viewModel");y!==D&&(D&&g.destroyMaybe(D),this._set("viewModel",y))}get _effectiveAvailableCreateTools(){const {availableCreateTools:y,visibleElements:D}=this;return y?.filter(I=>!!D.createTools?.[I])}create(y,D){this._activeCreateOptions= D||null;return k.ignoreAbortErrors(this.viewModel.create(y,D))}update(y,D){return k.ignoreAbortErrors(this.viewModel.update(y,D))}complete(){this.viewModel.complete()}cancel(){this._selectionToolbar?.cancel();this.viewModel.cancel()}undo(){this.viewModel.undo();this.view?.focus()}redo(){this.viewModel.redo();this.view?.focus()}delete(){this.viewModel.delete()}duplicate(){return this.viewModel.duplicate()}render(){const {label:y,layout:D,viewModel:{state:I}}=this;return t.tsx("div",{"aria-label":y, class:this.classes("esri-sketch",A.globalCss.widget,{[A.globalCss.disabled]:"disabled"===I,["esri-sketch--vertical"]:"vertical"===D,["esri-sketch--horizontal"]:"horizontal"===D})},t.tsx("div",{class:"esri-sketch__panel",role:"toolbar"},this._renderTopPanelContents()),t.tsx("div",{class:this.classes("esri-sketch__panel","esri-sketch__info-panel")},this._renderInfoPanelContents()))}_renderTopPanelContents(){const y=this.classes("esri-sketch__section","esri-sketch__tool-section"),{_effectiveAvailableCreateTools:D, visibleElements:I,viewModel:S}=this;return[S.updateOnGraphicClick||this._selectionToolbar?.visibleToolCount?t.tsx("div",{class:y,key:"selection-button-container",role:"menu"},this._renderDefaultSelectionButton(),this._renderSelectionToolbar()):null,D?.length?t.tsx("div",{class:y,role:"menu"},this._renderDrawActions()):null,I.undoRedoMenu?t.tsx("div",{class:y,key:"undo-redo-menu-button-container",role:"menu"},this._renderUndoRedoMenuButtons()):null,I.settingsMenu?t.tsx("div",{class:"esri-sketch__section", key:"settings-menu-button-container"},this._renderSettingsMenuButton()):null]}_renderInfoPanelContents(){if(this._menuOpen)return this._renderSettingsMenu();if(this.updateGraphics.length)return[t.tsx("div",{class:this.classes("esri-sketch__section","esri-sketch__info-section","esri-sketch__info-count-section"),key:"feature-count-container"},this._renderFeatureCount()),t.tsx("div",{class:this.classes("esri-sketch__section","esri-sketch__info-section"),key:"delete-button-container"},this._renderDuplicateButton(), this._renderDeleteButton())]}_renderSettingsMenu(){const {messagesCommon:y,snappingOptions:D,view:I,viewModel:S,visibleElements:M}=this,G={directionModePicker:M.directionModePicker,labelsToggle:M.labelsToggle,tooltipsToggle:M.tooltipsToggle};return t.tsx("div",{class:"esri-sketch__menu-container","data-testid":"menu",key:"settings-menu-container",role:"menu"},t.tsx("header",{class:"esri-sketch__menu-header",key:"settings-menu-header"},t.tsx("span",{class:"esri-sketch__menu-title"},y.settings)),u.someElementsAreVisible(G)? t.tsx(p,{sketchOptions:S.sketchOptions,viewType:I?.type,visibleElements:G}):void 0,M.snappingControls&&I&&D?t.tsx(x,{snappingOptions:D,view:I,visibleElements:M.snappingControlsElements}):void 0)}_renderFeatureCount(){const {layout:y,messages:D,updateGraphics:{length:I}}=this,S=F.substitute(D.selectedCount,{count:I});return t.tsx("div",{"aria-label":S,class:"esri-sketch__feature-count-badge"},t.tsx("span",{class:"esri-sketch__feature-count-number"},"vertical"===y?I:S))}_renderDuplicateButton(){if(this.visibleElements.duplicateButton){var y= this.messages;y=1{switch(D){case "point":return this._renderAction(D,y.drawPoint, "pin");case "polyline":return this._renderAction(D,y.drawPolyline,"line");case "polygon":return this._renderAction(D,y.drawPolygon,"polygon");case "rectangle":return this._renderAction(D,y.drawRectangle,"rectangle");case "circle":return this._renderAction(D,y.drawCircle,"circle")}})}_renderAction(y,D,I){return t.tsx("calcite-action",{active:this.activeTool===y,bind:this,disabled:"disabled"===this.state,onclick:()=>this._activateCreateTool(y),scale:"s",text:D,title:D},t.tsx("calcite-icon",{icon:I, scale:"s"}))}_renderUndoRedoMenuButtons(){return[this._renderUndoButton(),this._renderRedoButton()]}_renderUndoButton(){const y=this.messages.undo;return t.tsx("calcite-action",{bind:this,disabled:!this.viewModel.canUndo()||"disabled"===this.state,onclick:this.undo,scale:"s",text:y,title:y},t.tsx("calcite-icon",{icon:u.isRTL(this.container)?"redo":"undo",scale:"s"}))}_renderRedoButton(){const y=this.messages.redo;return t.tsx("calcite-action",{bind:this,disabled:!this.viewModel.canRedo()||"disabled"=== this.state,onclick:this.redo,scale:"s",text:y,title:y},t.tsx("calcite-icon",{icon:u.isRTL(this.container)?"undo":"redo",scale:"s"}))}_renderSettingsMenuButton(){const y=this.messagesCommon.settings;return t.tsx("calcite-action",{active:this._menuOpen,bind:this,"data-testid":"settings-menu-action",disabled:"disabled"===this.state,onclick:this._toggleMenu,scale:"s",text:y,title:y},t.tsx("calcite-icon",{icon:"gear",scale:"s"}))}_activateCreateTool(y){this.activeTool===y?this.cancel():(this._selectionToolbar?.cancel(), this.create(y))}_onCreateOperation(y){if("complete"===y.state){var {creationMode:D}=this,{type:I}=y;if("create"===I){const {tool:S,graphic:M}=y;y=this._activeCreateOptions;this._activeCreateOptions=null;"continuous"===D?this.create(S,y):"update"===D&&this.update([M])}}}_toggleMenu(){this._menuOpen=!this._menuOpen;this.scheduleRender()}_onDuplicateSelect(){const y=this.duplicate(),D=this.viewModel.activeTool;"transform"!==D&&"reshape"!==D||this.update(y,{tool:D})}_onSelectionOperationComplete(y){const {viewModel:{defaultUpdateOptions:D}}= this,{selection:I}=y;!y.aborted&&I.length&&(y=D.tool,this.update(I,{...D,tool:1{if(!y?.length)return null;const D=new Set(["point","polyline","polygon","rectangle","circle"]);return y.filter(I=>D.has(I))}})],d.prototype,"availableCreateTools",void 0);b.__decorate([z.property({readOnly:!0})], d.prototype,"createGraphic",null);b.__decorate([z.property()],d.prototype,"creationMode",void 0);b.__decorate([z.property()],d.prototype,"defaultCreateOptions",null);b.__decorate([z.property()],d.prototype,"defaultUpdateOptions",null);b.__decorate([z.property()],d.prototype,"icon",null);b.__decorate([z.property()],d.prototype,"label",null);b.__decorate([z.property()],d.prototype,"labelOptions",null);b.__decorate([z.property()],d.prototype,"layer",null);b.__decorate([z.property({type:["horizontal", "vertical"]})],d.prototype,"layout",void 0);b.__decorate([z.property(),B.messageBundle("esri/widgets/Sketch/t9n/Sketch")],d.prototype,"messages",void 0);b.__decorate([z.property(),B.messageBundle("esri/t9n/common")],d.prototype,"messagesCommon",void 0);b.__decorate([z.property()],d.prototype,"snappingOptions",null);b.__decorate([z.property()],d.prototype,"state",null);b.__decorate([z.property()],d.prototype,"tooltipOptions",null);b.__decorate([z.property({readOnly:!0})],d.prototype,"updateGraphics", null);b.__decorate([z.property({type:c,nonNullable:!0})],d.prototype,"valueOptions",null);b.__decorate([z.property()],d.prototype,"view",null);b.__decorate([z.property(),e.vmEvent(["create","update","undo","redo"])],d.prototype,"viewModel",null);b.__decorate([z.property({type:n,nonNullable:!0})],d.prototype,"visibleElements",void 0);b.__decorate([z.property()],d.prototype,"_effectiveAvailableCreateTools",null);return d=b.__decorate([v.subclass("esri.widgets.Sketch")],d)});