(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-743c160e"],{"1bd2":function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var s=i("a4ee"),n=i("b2b2"),o=i("fab3"),r=i("59b2"),a=(i("b50f"),i("c120"),i("cea0"),i("d386"));const c=e=>{let t=class extends(Object(o["b"])(e)){constructor(){super(...arguments),this.parent=null}get updating(){return!1}get visible(){const e=!Object(n["k"])(this.parent)||this.parent.visible&&!this.parent.suspended;return this.analysis.visible&&e}};return Object(s["a"])([Object(r["b"])({readOnly:!0})],t.prototype,"type",void 0),Object(s["a"])([Object(r["b"])({constructOnly:!0})],t.prototype,"analysis",void 0),Object(s["a"])([Object(r["b"])({constructOnly:!0})],t.prototype,"parent",void 0),Object(s["a"])([Object(r["b"])({constructOnly:!0})],t.prototype,"view",void 0),Object(s["a"])([Object(r["b"])({readOnly:!0})],t.prototype,"updating",null),Object(s["a"])([Object(r["b"])({readOnly:!0})],t.prototype,"visible",null),t=Object(s["a"])([Object(a["a"])("esri.views.3d.analysis.AnalysisView3D")],t),t}},"29a2":function(e,t,i){"use strict";i.d(t,"a",(function(){return r})),i.d(t,"b",(function(){return a}));var s=i("b2b2"),n=i("8188"),o=i("0cb9");function r(e,t,i,r=!1){const a=Object(n["D"])(e,t);return Object(s["j"])(a)?null:(a.hasZ&&!r||!Object(s["k"])(i)||(a.z=Object(s["u"])(Object(o["b"])(i,a),0)),a)}function a(e,t,i){i.warnOnce(`Failed to project analysis geometry (id: '${e.id}'), projection from spatial reference (wkid: '${t.wkid}') to view spatial reference is not supported. Projection may be possible after calling projection.load().`)}},"5fae":function(e,t,i){"use strict";i.d(t,"a",(function(){return b}));var s=i("b2b2"),n=i("d791"),o=i("afe1"),r=i("f53a"),a=i("b7c2"),c=i("5a22"),l=i("748fd");class b extends r["a"]{constructor(e){super(e.view),this._resources=null,this._transform=Object(o["d"])()}get object(){return Object(s["k"])(this._resources)?this._resources.object:null}get transform(){return this._transform}set transform(e){Object(n["d"])(this._transform,e),Object(s["k"])(this._resources)&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(Object(s["j"])(this._resources))return;const e=this._resources.object,t=this.view._stage;t.removeMany(e.geometries),e.removeAllGeometries(),this.createGeometries(e),this.visible||e.setVisible(this.visible),t.addMany(e.geometries)}createResources(){this.destroyResources();const e=this.view._stage;if(!e)return;const t=new l["a"]({isPickable:!1,updatePolicy:a["m"].SYNC});e.add(t);const i=new c["a"]({castShadow:!1});i.transformation=this._transform,this.createExternalResources(),this.createGeometries(i),e.addMany(i.geometries),this.forEachExternalMaterial(t=>e.add(t)),e.add(i),t.add(i),this.visible||i.setVisible(!1),this._resources={layer:t,object:i}}destroyResources(){const e=this.view._stage;!Object(s["j"])(this._resources)&&e&&(e.remove(this._resources.object),e.remove(this._resources.layer),this.forEachExternalMaterial(t=>{e.remove(t),t.dispose()}),e.removeMany(this._resources.object.geometries),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){Object(s["j"])(this._resources)||this._resources.object.setVisible(e)}}},"94e6":function(e,t,i){"use strict";i.d(t,"a",(function(){return p}));var s=i("b2b2"),n=i("d791"),o=i("afe1"),r=i("e431"),a=i("0b2d"),c=i("7577"),l=i("5ef2"),b=i("5fae"),u=i("d408"),d=i("35b3"),h=i("86ba");class p extends b["a"]{constructor(e){super(e),this._renderOccluded=d["c"].OccludeAndTransparent,this._width=1,this._color=Object(l["c"])(1,0,1,1),this._innerWidth=1,this._innerColor=null,this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._writeDepthEnabled=!0,this._falloff=0,this._polygonOffset=!1,this.applyProps(e)}setGeometryFromRenderSpacePoint(e){const t=1e3,i=[];i.push([[e[0]-t,e[1]+0,e[2]+0],[e[0]+t,e[1]+0,e[2]+0]]),i.push([[e[0]-0,e[1]-t,e[2]+0],[e[0]+0,e[1]+t,e[2]+0]]),i.push([[e[0]-0,e[1]+0,e[2]-t],[e[0]+0,e[1]+0,e[2]+t]]),this.geometry=i}setGeometryFromExtent(e){const t=this.view.spatialReference,i=Object(a["f"])(),s=Object(a["f"])(),n=100,o=[];Object(r["y"])(i,e[0],e[1],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),Object(r["y"])(i,e[2],e[1],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),Object(r["y"])(i,e[2],e[3],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),Object(r["y"])(i,e[0],e[3],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),Object(r["y"])(i,e[0],e[1],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),Object(r["y"])(i,e[0],e[1],n),this.view.renderCoordsHelper.toRenderCoords(i,t,s),o.push([s[0],s[1],s[2]]),this.geometry=[o]}setGeometryFromFrustum(e){const t=[];e.lines.forEach(e=>{t.push([e.origin[0],e.origin[1],e.origin[2]]),t.push([e.endpoint[0],e.endpoint[1],e.endpoint[2]])}),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],i=e.origin,s=e.basis1,n=e.basis2,o=.5,r=Object(a["f"])(),c=Object(a["f"])(),l=Object(a["f"])(),b=Object(a["f"])();r[0]=i[0]-s[0]*o-n[0]*o,r[1]=i[1]-s[1]*o-n[1]*o,r[2]=i[2]-s[2]*o-n[2]*o,c[0]=i[0]-s[0]*o+n[0]*o,c[1]=i[1]-s[1]*o+n[1]*o,c[2]=i[2]-s[2]*o+n[2]*o,l[0]=i[0]+s[0]*o+n[0]*o,l[1]=i[1]+s[1]*o+n[1]*o,l[2]=i[2]+s[2]*o+n[2]*o,b[0]=i[0]+s[0]*o-n[0]*o,b[1]=i[1]+s[1]*o-n[1]*o,b[2]=i[2]+s[2]*o-n[2]*o,t.push([r[0],r[1],r[2]]),t.push([c[0],c[1],c[2]]),t.push([l[0],l[1],l[2]]),t.push([b[0],b[1],b[2]]),t.push([r[0],r[1],r[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;this.transform=Object(n["g"])(O,t);const{points:i}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[i]}setGeometryFromSegments(e,t=a["c"]){this.transform=Object(n["g"])(O,t),this.geometry=e.map(e=>e.createRenderGeometry(t,this.view.renderCoordsHelper).points)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){Object(c["g"])(e,this._color)||(Object(c["c"])(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){Object(s["k"])(e)?!Object(s["j"])(this._innerColor)&&Object(c["g"])(e,this._innerColor)||(this._innerColor=Object(c["c"])(Object(l["b"])(),e),this._updateMaterial()):Object(s["k"])(this._innerColor)&&(this._innerColor=null,this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=Object(s["k"])(e)!==Object(s["k"])(this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){(Object(s["j"])(e)||Object(s["j"])(this._stippleOffColor)||!Object(c["g"])(e,this._stippleOffColor))&&(this._stippleOffColor=Object(s["k"])(e)?Object(l["a"])(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){this._stipplePreferContinuous!==e&&(this._stipplePreferContinuous=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}createExternalResources(){this._material=new h["a"](this.materialParameters)}destroyExternalResources(){this._material=null}createGeometries(e){const t=this._createLineGeometries();if(0!==t.length)for(let i=0;i{const i=e.length,s=new Float64Array(3*i);e.forEach((e,t)=>{s[3*t+0]=e[0],s[3*t+1]=e[1],s[3*t+2]=e[2]});const n={overlayInfo:null,attributeData:{position:s},removeDuplicateStartEnd:u["a"].KEEP};t.push(n)}),t}}const O=Object(o["d"])()},d92e:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return de}));var s=i("a4ee"),n=i("fc29"),o=i("2c4f"),r=i("ce6d"),a=i("9096"),c=i("b2b2"),l=i("59b2"),b=i("b50f"),u=(i("c120"),i("cea0"),i("d386")),d=i("0b2d"),h=i("1bd2"),p=i("9ef0");let O=class extends n["a"]{constructor(e){super(e),this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new p["a"]([3,252,111,1]),this.visibleOuterColor=new p["a"]([3,252,111,.15]),this.occludedInnerColor=new p["a"]([252,3,69,1]),this.occludedOuterColor=new p["a"]([252,3,69,.1]),this.undefinedInnerColor=new p["a"]([255,255,255,1]),this.undefinedOuterColor=new p["a"]([127,127,127,.2])}};Object(s["a"])([Object(l["b"])({type:Number})],O.prototype,"innerWidth",void 0),Object(s["a"])([Object(l["b"])({type:Number})],O.prototype,"outerWidth",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"visibleInnerColor",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"visibleOuterColor",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"occludedInnerColor",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"occludedOuterColor",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"undefinedInnerColor",void 0),Object(s["a"])([Object(l["b"])({type:p["a"]})],O.prototype,"undefinedOuterColor",void 0),O=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightConfiguration")],O);i("e06a");var j=i("af40"),g=i("c649"),y=i("e92d"),_=i("f4cc"),v=i("477c"),f=i("e431"),m=i("8188"),C=i("9180"),w=i("d18f");let R=class extends n["a"]{constructor(e){super(e),this.target=null,this.intersectedGraphic=null,this.intersectedLocation=null,this.elevationAlignedTargetLocation=null}};Object(s["a"])([Object(l["b"])()],R.prototype,"target",void 0),Object(s["a"])([Object(l["b"])()],R.prototype,"intersectedGraphic",void 0),Object(s["a"])([Object(l["b"])()],R.prototype,"intersectedLocation",void 0),Object(s["a"])([Object(l["b"])()],R.prototype,"elevationAlignedTargetLocation",void 0),Object(s["a"])([Object(l["b"])()],R.prototype,"visible",void 0),R=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSightAnalysisResult")],R);let T=class extends n["a"]{constructor(e){super(e),this.elevationAlignedTargetLocation=null,this.inputPoints={isValid:!1,observer:Object(d["f"])(),observerSurfaceNormal:null,target:Object(d["f"])(),targetSurfaceNormal:null,observerAdjusted:Object(d["f"])(),targetAdjusted:Object(d["f"])()},this.computationResult={start:Object(d["f"])(),end:Object(d["f"])(),intersection:Object(d["f"])(),isValid:!1,isTargetVisible:!1},this.result=null}notifyResultChanged(){this.notifyChange("computationResult")}notifyInputPointsChanged(){this.notifyChange("inputPoints")}};Object(s["a"])([Object(l["b"])()],T.prototype,"target",void 0),Object(s["a"])([Object(l["b"])()],T.prototype,"elevationAlignedTargetLocation",void 0),Object(s["a"])([Object(l["b"])()],T.prototype,"inputPoints",void 0),Object(s["a"])([Object(l["b"])()],T.prototype,"computationResult",void 0),Object(s["a"])([Object(l["b"])()],T.prototype,"result",void 0),T=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightComputation")],T);var P,E=i("a915"),I=i("7361"),V=i("1a54"),L=i("7ffa");let S=P=class extends n["a"]{constructor(e){super(e)}clone(){return new P({type:this.type,id:Object(L["a"])(this.id),point:Object(L["a"])(this.point),normal:Object(L["a"])(this.normal),ray:Object(L["a"])(this.ray)})}equals(e){return this.type===e.type&&this.id===e.id&&Object(c["f"])(this.point,e.point)&&Object(b["e"])(this.normal,e.normal)&&Object(w["e"])(this.ray,e.ray)}};Object(s["a"])([Object(l["b"])()],S.prototype,"type",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],S.prototype,"id",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],S.prototype,"point",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],S.prototype,"normal",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],S.prototype,"ray",void 0),S=P=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightIntersectionResult")],S);var A=i("6be6"),k=i("9990"),D=i("7a91"),H=i("a03d"),x=i("9250"),z=i("1942"),G=i("5c33");let M=class extends n["a"]{constructor(e){super(e)}initialize(){this.intersector=Object(x["b"])(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=z["c"].MIN}getScreenPointIntersection(e){const t=Object(E["i"])(e,I["c"].get()),i=Object(k["c"])(this.view.state.camera,t,U);return this._getRayIntersection(i)}_getRayIntersection(e){if(Object(c["j"])(e))return null;this.view.sceneIntersectionHelper.intersectToolIntersectorRay(e,this.intersector);const t=this.intersector.results.min;if(!t.getIntersectionPoint(F))return null;const i=this.view.renderCoordsHelper.fromRenderCoords(F,this.view.spatialReference),s=Object(d["g"])(t.normal),n=Object(f["j"])(s,e.direction)>0?-1:1;if(Object(f["g"])(s,s,n),Object(A["a"])(t))return new S({type:z["b"].OBJECT,id:`${t.target.layerUid}/${t.target.nodeIndex}/${t.target.componentIndex}`,point:i,normal:s,ray:Object(w["b"])(e)});if(Object(D["b"])(t))return new S({type:z["b"].TERRAIN,id:t.target.lij.slice(),point:i,normal:s,ray:Object(w["b"])(e)});const o=Object(G["a"])(t,this.view);if(Object(c["k"])(o)){const t=o.layer,n=o.sourceLayer;let r;return r=n&&"scene"===n.type?Object(V["g"])(o,n.objectIdField):o.uid,new S({type:z["b"].OBJECT,id:`${t.uid}/${r}`,point:i,normal:s,ray:Object(w["b"])(e)})}return null}_canUpdateFromIntersectionResult(e,t){if(Object(c["j"])(e)||!t||e.type!==t.type)return!1;switch(e.type){case z["b"].TERRAIN:{const i=e.id,s=t.id;return i[0]===s[0]&&i[1]===s[1]&&i[2]===s[2]||Object(H["i"])(i,s)}case z["b"].OBJECT:case z["b"].I3S:return e.id===t.id}}updateFromIntersectionResult(e){let t;if(e.type===z["b"].TERRAIN&&Object(c["k"])(e.point)){const i=F,s=N,n=B;this.view.renderCoordsHelper.toRenderCoords(e.point,s),this.view.renderCoordsHelper.worldUpAtPosition(s,n);const o=this.view.basemapTerrain.elevationBounds,r=this.view.renderCoordsHelper.getAltitude(s),a=o?Math.abs(o.max-o.min)/Math.abs(r):100,c=r>0?1:-1;Object(f["t"])(n,n),Object(f["g"])(n,n,c*a),Object(f["h"])(i,s,n),Object(w["f"])(i,s,U),t=this._getRayIntersection(U)}else t=this._getRayIntersection(e.ray);return this._canUpdateFromIntersectionResult(t,e)?t.point:null}};Object(s["a"])([Object(l["b"])()],M.prototype,"view",void 0),Object(s["a"])([Object(l["b"])()],M.prototype,"intersector",void 0),M=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],M);const F=Object(d["f"])(),N=Object(d["f"])(),B=Object(d["f"])(),U=Object(w["c"])();var W=i("29a2"),$=i("9305"),J=i("d347"),q=i("4ae5");const K=y["a"].getLogger("esri.views.3d.analysis.LineOfSight.LineOfSightController");let Y=class extends(r["a"].EventedMixin(n["a"])){constructor(e){super(e),this.updateOnCameraChange=!0,this._updatingHandles=new J["a"],this._frameTask=$["a"],this._handles=new j["a"],this._computationHandles=new j["a"],this._externalObserverUpdate=!0}initialize(){var e;const t=null==(e=this.view.resourceController)?void 0:e.scheduler;this._frameTask=t?t.registerTask($["c"].LINE_OF_SIGHT_TOOL):$["a"],this._intersector=new M({view:this.view}),this._handles.add([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._handles.destroy(),this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(e){this._frameTask.priority=e}get _computations(){return this.analysisViewData.computations}get _observerEngineLocation(){return this.analysisViewData.observerEngineLocation}set _observerEngineLocation(e){this.analysisViewData.observerEngineLocation=e}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._observerEngineLocation)}getLineOfSightComputationDependencies(e){const{inputPoints:t}=e;return{inputPoints:t}}_computeResult(e){const t=e.computation,{inputPoints:i,computationResult:s}=t,{observerAdjusted:n,targetAdjusted:o}=i,{start:r,end:a}=s;Object(f["m"])(r,n),Object(f["m"])(a,o),this._canCompute(t)?this._computeIntersection(e):this._interpolateIntersection(e),t.notifyResultChanged(),this.emit("result-changed",{target:e.computation.target,result:t.result})}_adjustStartEndPositions(e){const t=this._screenPixelSize,i=this.view,{inputPoints:s}=e,{observer:n,observerSurfaceNormal:o,target:r,targetSurfaceNormal:a,observerAdjusted:l,targetAdjusted:b}=s,u=X;Object(c["k"])(o)?Object(f["m"])(u,o):Object(f["l"])(u,r,n);const d=t;Object(f["t"])(u,u),Object(f["g"])(u,u,Math.min(d,1)),Object(f["h"])(l,n,u),Object(c["k"])(a)?Object(f["m"])(u,a):Object(f["l"])(u,n,r);const h=i.state.camera.computeScreenPixelSizeAt(r);Object(f["t"])(u,u),Object(f["g"])(u,u,Math.min(h,1)),Object(f["h"])(b,r,u)}_computeIntersection({computation:e,interpolationInfo:t}){const{view:i}=this,{sceneIntersectionHelper:s,renderCoordsHelper:n}=i;if(Object(c["j"])(s))return;const o=this._intersector.intersector,{computationResult:r,inputPoints:a}=e,{observer:l,target:b}=a,{start:u,end:d}=r,h=Object(w["f"])(u,d,ee);s.intersectToolIntersectorRay(h,o);const p=r.intersection,O=X;let j=!0;if(o.results.min.getIntersectionPoint(p)){Object(f["m"])(t.originalIntersection,p),Object(f["m"])(t.originalObserver,u),Object(f["m"])(t.originalTarget,d),n.fromRenderCoords(p,O,i.spatialReference);const e=1-Object(f["p"])(d,b)/Object(f["p"])(u,b);j=Object(f["p"])(l,p)>=e*Object(f["p"])(l,b)}const g=new q["a"](O,i.spatialReference);{const{result:t,target:s}=e;Object(c["k"])(t)?(t.target=s,t.intersectedGraphic=j?null:Object(G["a"])(o.results.min,i),t.intersectedLocation=j?null:g,t.visible=j):e.result=new R({target:s,elevationAlignedTargetLocation:e.elevationAlignedTargetLocation,intersectedGraphic:j?null:Object(G["a"])(o.results.min,i),intersectedLocation:j?null:g,visible:j})}r.isValid=a.isValid=!0,r.isTargetVisible=j}_interpolateIntersection({computation:e,interpolationInfo:t}){const{computationResult:i,inputPoints:s}=e,{start:n,end:o,intersection:r}=i,{originalIntersection:a,originalObserver:c,originalTarget:l}=t;if(Object(f["m"])(r,a),s.isValid){const e=X,t=Object(f["p"])(c,a)/Object(f["p"])(c,l);Object(f["B"])(e,n,c),Object(f["g"])(e,e,1-t),Object(f["h"])(r,r,e),Object(f["B"])(e,o,l),Object(f["g"])(e,e,t),Object(f["h"])(r,r,e),i.isValid=!0}else e.result=null,i.isValid=!1,i.isTargetVisible=!1}_canCompute(e){const t=this.analysisViewData.elevationAlignedObserver,i=this.view.frustum;if(Object(c["j"])(t)||Object(c["j"])(e.elevationAlignedTargetLocation)||Object(c["j"])(i))return!1;const{observerAdjusted:s,targetAdjusted:n}=e.inputPoints,o=i.intersectsPoint(s),r=i.intersectsPoint(n);return o&&r}_onObserverPositionChange(e,t,i){if(this._externalObserverUpdate=i,Object(c["j"])(e))return void(this.analysisViewData.elevationAlignedObserver=null);const s=this._applyProjectionAndElevationAlignment(e,t);if(Object(c["j"])(s))return Object(W["b"])(this.analysis,e.spatialReference,K),void(this.analysisViewData.elevationAlignedObserver=null);const n=Object(d["f"])();this.analysisViewData.elevationAlignedObserver=s,this.view.renderCoordsHelper.toRenderCoords(this.analysisViewData.elevationAlignedObserver,n),this._observerEngineLocation=n,this.priority=$["c"].LINE_OF_SIGHT_TOOL_INTERACTIVE}_applyProjectionAndElevationAlignment(e,t){const i=Object(c["k"])(t)&&t.type!==z["b"].OBJECT;return Object(W["a"])(e,this.view.spatialReference,this.view.elevationProvider,i)}_onObserverRenderSpacePositionChangeForComputation(e,t,i){const{inputPoints:s}=e;if(Object(f["m"])(s.observer,t),Object(c["k"])(i)){const e=this._intersector.updateFromIntersectionResult(i);Object(c["k"])(e)&&this.view.renderCoordsHelper.toRenderCoords(e,s.observer),s.observerSurfaceNormal=Object(d["d"])(i.normal)}else s.observerSurfaceNormal=null;this._adjustStartEndPositions(e),e.notifyInputPointsChanged(),this.priority=$["c"].LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(e,t,i,s=!0){const n=e.inputPoints;if(s&&(n.isValid=!1),e.elevationAlignedTargetLocation=this._applyProjectionAndElevationAlignment(t,i),Object(c["j"])(e.elevationAlignedTargetLocation))Object(W["b"])(this.analysis,t.spatialReference,K);else{if(this.view.renderCoordsHelper.toRenderCoords(e.elevationAlignedTargetLocation,n.target),Object(c["k"])(i)){const e=this._intersector.updateFromIntersectionResult(i);Object(c["k"])(e)&&this.view.renderCoordsHelper.toRenderCoords(e,n.target),n.targetSurfaceNormal=Object(d["d"])(i.normal)}else n.targetSurfaceNormal=null;this._adjustStartEndPositions(e)}e.notifyInputPointsChanged(),this.priority=$["c"].LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(e){return Object(g["a"])([Object(v["e"])(()=>e.target.position,t=>{Z(t,e.target.intersection)||(e.target.intersection=null)},v["a"]),Object(v["e"])(()=>({computation:e,targetPosition:e.target.position,targetIntersection:e.target.intersection}),({computation:e,targetPosition:t,targetIntersection:i})=>{Object(c["k"])(t)&&this._onTargetPositionChange(e,t,i)},v["d"])])}_connectComputationToObserver(e){return Object(v["e"])(()=>({computation:e,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},v["d"])}_connectComputationToRenderSpaceObserver(e){return Object(v["e"])(()=>({computation:e,observer:this._observerEngineLocation,observerIntersection:Object(c["k"])(this.analysis.observer)?this.analysis.observer.intersection:null}),({computation:e,observer:t,observerIntersection:i})=>{this._onObserverRenderSpacePositionChangeForComputation(e,t,i)},v["d"])}_connectComputationToCamera(e){return Object(v["e"])(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:t})=>{!this.updateOnCameraChange||e.inputPoints.isValid&&!t||e.notifyInputPointsChanged()},v["c"])}_connectComputationToSlicePlane(e){return Object(v["e"])(()=>this.view.slicePlane,()=>e.notifyInputPointsChanged())}_connectComputationToElevation(e){return this.view.elevationProvider.on("elevation-change",t=>{const i=this.analysis.observer,s=e.target;let n=null,o=null,r=null,a=null;const l=Object(c["k"])(i)&&Object(c["k"])(i.position)?i.position.spatialReference:Object(c["k"])(s.position)?s.position.spatialReference:t.spatialReference;Object(c["k"])(i)&&Object(c["k"])(i.position)&&(n=ie,o=i.intersection,Object(m["s"])(i.position,n,l)),Object(c["k"])(s.position)&&(r=se,a=s.intersection,Object(m["s"])(s.position,r,l)),Object(c["j"])(n)&&Object(c["j"])(r)||(Object(m["n"])(t.extent,t.spatialReference,te,l),Object(c["k"])(n)&&Object(C["i"])(te,n)&&this._onObserverPositionChange(n,o,!1),Object(c["k"])(r)&&Object(C["i"])(te,r)&&this._onTargetPositionChange(e,r,a,!1),Object(c["k"])(n)&&Object(c["k"])(r)&&Object(C["x"])(te,n,r)&&e.notifyInputPointsChanged())})}_connectComputationToTask(e){let t=c["p"];const i={computation:e,interpolationInfo:{originalIntersection:Object(d["f"])(),originalObserver:Object(d["f"])(),originalTarget:Object(d["f"])()}};return Object(g["a"])([Object(v["e"])(()=>this.getLineOfSightComputationDependencies(e),()=>{t=Object(c["a"])(t),t=Object(_["h"])(async e=>{await Object(_["l"])(this._frameTask.schedule(()=>this._computeResult(i),e))})},v["d"]),Object(g["b"])(()=>t=Object(c["a"])(t))])}_connectComputation(e){const t=this._computationHandles;t.has(e)||t.add([this._connectComputationToTarget(e),this._connectComputationToObserver(e),this._connectComputationToRenderSpaceObserver(e),this._connectComputationToCamera(e),this._connectComputationToSlicePlane(e),this._connectComputationToElevation(e),this._connectComputationToTask(e)],e)}_disconnectAnalysis(e){this._computationHandles.remove(e)}_onComputationCollectionChange(e){e.added.forEach(e=>this._connectComputation(e)),e.removed.forEach(e=>this._disconnectAnalysis(e))}_onTargetsChange(){return this._computations.removeAll(),this.analysis.targets.forEach(e=>this._addTarget(e)),this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,e=>this._onTargetCollectionChange(e))}_onTargetCollectionChange(e){e.added.forEach(e=>this._addTarget(e)),e.removed.forEach(e=>this._removeTarget(e))}_onCursorTargetChange(e,t){Object(c["k"])(t)&&this._removeTarget(t),Object(c["k"])(e)&&this._addTarget(e)}_addTarget(e){this._computations.some(t=>t.target===e)||this._computations.add(new T({target:e}))}_removeTarget(e){const t=this._computations.find(t=>t.target===e);this._computations.remove(t)}_connectObserver(){return Object(g["a"])([Object(v["e"])(()=>({observer:this.analysis.observer,observerPosition:Object(c["k"])(this.analysis.observer)?this.analysis.observer.position:null,observerIntersection:Object(c["k"])(this.analysis.observer)?this.analysis.observer.intersection:null}),({observer:e,observerPosition:t,observerIntersection:i})=>{Object(c["k"])(e)&&!Z(t,i)&&(e.intersection=null)},v["a"]),Object(v["e"])(()=>({observerPosition:Object(c["k"])(this.analysis.observer)?this.analysis.observer.position:null,observerIntersection:Object(c["k"])(this.analysis.observer)?this.analysis.observer.intersection:null}),({observerPosition:e,observerIntersection:t})=>this._onObserverPositionChange(e,t,!0),v["d"])])}_connectComputations(){let e=null;return Object(g["a"])([Object(v["e"])(()=>this._computations,()=>{Object(c["s"])(e),e=this._updatingHandles.addOnCollectionChange(()=>this._computations,e=>this._onComputationCollectionChange(e)),this._computations.forEach(e=>this._connectComputation(e))},v["d"]),Object(g["b"])(()=>e=Object(c["s"])(e))])}_connectTargets(){let e=null;return Object(g["a"])([Object(v["e"])(()=>this.analysis.targets,()=>{e=Object(c["s"])(e),e=this._onTargetsChange()},v["d"]),Object(v["e"])(()=>this.analysisViewData.cursorTarget,(e,t)=>{this._onCursorTargetChange(e,t)}),Object(g["b"])(()=>{e=Object(c["s"])(e)})])}get _isCameraDirty(){const e=this.analysisViewData.elevationAlignedObserver,{view:t}=this,{renderCoordsHelper:i}=t;if(Object(c["j"])(e)||Object(c["j"])(i))return!1;const s=X;i.toRenderCoords(e,s);const n=t.state.camera.computeScreenPixelSizeAt(s);return Math.abs((n-this._screenPixelSize)/this._screenPixelSize)>Q}};function Z(e,t){return Object(c["j"])(t)||Object(c["k"])(e)&&e.equals(t.point)}Object(s["a"])([Object(l["b"])({constructOnly:!0})],Y.prototype,"analysis",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],Y.prototype,"analysisViewData",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],Y.prototype,"view",void 0),Object(s["a"])([Object(l["b"])()],Y.prototype,"updating",null),Object(s["a"])([Object(l["b"])()],Y.prototype,"priority",null),Object(s["a"])([Object(l["b"])()],Y.prototype,"updateOnCameraChange",void 0),Object(s["a"])([Object(l["b"])()],Y.prototype,"_computations",null),Object(s["a"])([Object(l["b"])()],Y.prototype,"_observerEngineLocation",null),Object(s["a"])([Object(l["b"])()],Y.prototype,"_screenPixelSize",null),Object(s["a"])([Object(l["b"])({readOnly:!0})],Y.prototype,"_updatingHandles",void 0),Object(s["a"])([Object(l["b"])()],Y.prototype,"_frameTask",void 0),Object(s["a"])([Object(l["b"])()],Y.prototype,"_isCameraDirty",null),Y=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightController")],Y);const Q=.1,X=Object(d["f"])(),ee=Object(w["c"])(),te=Object(C["n"])(),ie=new q["a"],se=new q["a"];var ne=i("afe1"),oe=i("94e6");let re=class extends n["a"]{constructor(e){super(e),this._lineOfSightVisualizations=[],this._handle=null,this._computationHandles=new j["a"]}initialize(){this._handle=this._connectAnalysis()}destroy(){this._handle=Object(c["s"])(this._handle),this._computationHandles=Object(c["d"])(this._computationHandles)}get visible(){return this.analysisViewData.visible}get testInfo(){return{visualizations:this._lineOfSightVisualizations}}get _configuration(){return this.analysisViewData.configuration}createLineOfSightVisualization(){const e=this._configuration,t={view:this.view,attached:!0,width:e.outerWidth,innerWidth:e.innerWidth},i=p["a"].toUnitRGBA(e.visibleOuterColor),s=p["a"].toUnitRGBA(e.visibleInnerColor),n=p["a"].toUnitRGBA(e.occludedOuterColor),o=p["a"].toUnitRGBA(e.occludedInnerColor),r=p["a"].toUnitRGBA(e.undefinedOuterColor),a=p["a"].toUnitRGBA(e.undefinedInnerColor),c={visibleLineVisualElement:new oe["a"]({...t,color:i,innerColor:s}),occludedLineVisualElement:new oe["a"]({...t,color:n,innerColor:o}),undefinedLineVisualElement:new oe["a"]({...t,color:r,innerColor:a})};return this._lineOfSightVisualizations.push(c),c}destroyLineOfSightVisualization(e){e.visibleLineVisualElement=Object(c["d"])(e.visibleLineVisualElement),e.occludedLineVisualElement=Object(c["d"])(e.occludedLineVisualElement),e.undefinedLineVisualElement=Object(c["d"])(e.undefinedLineVisualElement),this._lineOfSightVisualizations.splice(this._lineOfSightVisualizations.indexOf(e),1)}updateLineOfSightVisualization(e,t){const i=this._configuration,{computationResult:s,inputPoints:n}=e,{start:o,end:r,intersection:a,isValid:l,isTargetVisible:b}=s,{observer:u}=n,h=be;h[12]=u[0],h[13]=u[1],h[14]=u[2];const O=Object(f["l"])(ae,o,u),j=Object(f["l"])(ce,r,u),g=Object(f["l"])(le,a,u),{visibleLineVisualElement:y,occludedLineVisualElement:_,undefinedLineVisualElement:v}=t,m=Object(c["j"])(this.analysisViewData.elevationAlignedObserver)||Object(c["j"])(e.elevationAlignedTargetLocation),C=this.visible&&!m;y.visible=C,_.visible=C,v.visible=C,C&&(y.geometry=null,_.geometry=null,v.geometry=null,l?b?(y.geometry=[[Object(d["g"])(O),Object(d["g"])(j)]],y.transform=h,y.color=p["a"].toUnitRGBA(i.visibleOuterColor)):(y.geometry=[[Object(d["g"])(O),Object(d["g"])(g)]],y.transform=h,y.color=p["a"].toUnitRGBA(i.occludedOuterColor),_.geometry=[[Object(d["g"])(g),Object(d["g"])(j)]],_.transform=h):(v.geometry=[[Object(d["g"])(O),Object(d["g"])(j)]],v.transform=h))}getLineOfSightVisualizationDependencies(e){const{computationResult:t}=e,{occludedOuterColor:i,visibleOuterColor:s}=this._configuration;return{computationResult:t,occludedOuterColor:i,visibleOuterColor:s,visible:this.visible}}_connectComputation(e){const t=this._computationHandles;if(t.has(e))return;const i=this.createLineOfSightVisualization();t.add([Object(v["e"])(()=>this.getLineOfSightVisualizationDependencies(e),()=>this.updateLineOfSightVisualization(e,i),v["d"]),Object(g["b"])(()=>this.destroyLineOfSightVisualization(i))],e)}_disconnectComputation(e){this._computationHandles.remove(e)}_connectAnalysis(){let e=null;return Object(g["a"])([Object(v["e"])(()=>this.analysisViewData.computations,t=>{e=Object(c["s"])(e),e=t.on("change",e=>this._onComputationsCollectionChange(e)),this._onComputationsCollectionChange({target:t,added:t.items,removed:[],moved:[]})},v["d"]),Object(g["b"])(()=>e=Object(c["s"])(e))])}_onComputationsCollectionChange(e){e.added.forEach(e=>this._connectComputation(e)),e.removed.forEach(e=>this._disconnectComputation(e))}};Object(s["a"])([Object(l["b"])({constructOnly:!0})],re.prototype,"analysis",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],re.prototype,"analysisViewData",void 0),Object(s["a"])([Object(l["b"])({constructOnly:!0})],re.prototype,"view",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],re.prototype,"visible",null),Object(s["a"])([Object(l["b"])()],re.prototype,"testInfo",null),Object(s["a"])([Object(l["b"])()],re.prototype,"_configuration",null),re=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSight.LineOfSightVisualization")],re);const ae=Object(d["f"])(),ce=Object(d["f"])(),le=Object(d["f"])(),be=Object(ne["d"])();let ue=class extends(Object(h["a"])(Object(a["b"])(r["a"].EventedMixin(n["a"])))){constructor(e){super(e),this.type="line-of-sight-view-3d",this.computations=new o["a"],this.elevationAlignedObserver=null,this.configuration=new O,this.observerEngineLocation=Object(d["f"])(),this.cursorTarget=null}initialize(){const e=this.view,t=this.analysis;this._analysisController=new Y({analysis:t,analysisViewData:this,view:e}),this._analysisVisualization=new re({analysis:t,analysisViewData:this,view:e}),this.handles.add([this._analysisController.on("result-changed",e=>{e.target!==this.cursorTarget&&this.emit("result-changed",e)})])}destroy(){this._analysisController=Object(c["d"])(this._analysisController),this._analysisVisualization=Object(c["d"])(this._analysisVisualization)}get results(){return this.computations.map(e=>e.result)}get priority(){return this._analysisController.priority}set priority(e){this._analysisController.priority=e}get updating(){return Object(c["k"])(this._analysisController)&&this._analysisController.updating}getResultForTarget(e){const t=this.computations.find(t=>t.target===e);return Object(c["b"])(t,e=>e.result)}get testInfo(){return{visualization:this._analysisVisualization,controller:this._analysisController}}};Object(s["a"])([Object(l["b"])()],ue.prototype,"type",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"analysis",void 0),Object(s["a"])([Object(l["b"])({readOnly:!0})],ue.prototype,"results",null),Object(s["a"])([Object(l["b"])()],ue.prototype,"priority",null),Object(s["a"])([Object(l["b"])()],ue.prototype,"computations",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"elevationAlignedObserver",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"configuration",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"observerEngineLocation",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"cursorTarget",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"updating",null),Object(s["a"])([Object(l["b"])()],ue.prototype,"_analysisController",void 0),Object(s["a"])([Object(l["b"])()],ue.prototype,"_analysisVisualization",void 0),ue=Object(s["a"])([Object(u["a"])("esri.views.3d.analysis.LineOfSightAnalysisView3D")],ue);const de=ue},f53a:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));class s{constructor(e){this._attached=!1,this._resourcesCreated=!1,this._visible=!0,this.view=e,this.view.watch("ready",e=>{this._resourcesCreated&&(e?this._createResources():this._destroyResources())})}applyProps(e){let t=!1;for(const i in e)i in this?"attached"===i?t=e[i]:this[i]=e[i]:console.error("Cannot set unknown property",i);this.attached=t}destroy(){this.attached=!1}get attached(){return this._attached}set attached(e){e!==this._attached&&this.view._stage&&(this._attached=e,this._attached&&!this._resourcesCreated?this._createResources():!this._attached&&this._resourcesCreated&&this._destroyResources())}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.attached&&this.updateVisibility(e))}_createResources(){this.createResources(),this._resourcesCreated=!0,this.visible||this.updateVisibility(!1)}_destroyResources(){this.destroyResources(),this._resourcesCreated=!1}}}}]); //# sourceMappingURL=chunk-743c160e.f9c36b21.js.map