PageSourceSearch

https://www.aep.com/static-content/7a41ff4a15f8a3445f554b858e5cf45…/static/chunks/31716.4c017110d75e92fc.js

js aep.com collected 2026-10-09 16:49:27 UTC 285,095 bytes, 230 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31716],{3539:function(e,t,i){i.d(t,{C:function(){return p},a:function(){return g},b:function(){return _}});var n=i(34874),a=i(63670),r=i(93370),s=i(69661),o=i(99484),l=i(28616),c=i(66346),h=i(47896),d=i(19647),u=i(60747);class p extends d.K{constructor(){super(...arguments),this.opacity=1}}function _(e){let t=new u.kG;t.include(n.k),t.fragment.uniforms.add(new c.A("tex",e=>e.texture)),e.hasOpacityFactor&&t.fragment.uniforms.add(new o.p("opacity",e=>e.opacity));let i=e.blitMode===h.J.Depth;return i&&(t.fragment.uniforms.add(new s.$("nearFar",e=>e.camera.nearFar)),t.fragment.include(a.K),t.fragment.include(r.n)),t.fragment.main.add((0,l.H)`
2    ${i?(0,l.H)`
3          float normalizedLinearDepth = (-linearDepthFromTexture(tex, uv) - nearFar[0]) / (nearFar[1] - nearFar[0]);
4          fragColor = float2rgba(normalizedLinearDepth);`:(0,l.H)`
5          fragColor = texture(tex, uv) ${e.hasOpacityFactor?"* opacity":""};`}`),t}let g=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:p,build:_},Symbol.toStringTag,{value:"Module"}))},98844:function(e,t,i){i.d(t,{I:function(){return b},a:function(){return m},b:function(){return v}});var n=i(48940),a=i(89995),r=i(24e3),s=i(21927),o=i(99778),l=i(95363),c=i(1209),h=i(99484),d=i(28616),u=i(66346),p=i(25818),_=i(67121),g=i(19647),f=i(60747);class m extends g.K{}function v(e){let t=new f.kG,{vertex:i,fragment:g,varyings:m}=t,{output:v,perspectiveInterpolation:b}=e;return(0,c.Sv)(i,e),t.include(r.w,e),t.include(o.H,e),t.fragment.include(a.f5,e),t.include(s.R,e),t.include(_.j,e),t.attributes.add(p.T.POSITION,"vec3"),t.attributes.add(p.T.UV0,"vec2"),b&&t.attributes.add(p.T.PERSPECTIVEDIVIDE,"float"),i.main.add((0,d.H)`
6    vpos = position;
7    forwardViewPosDepth((view * vec4(vpos, 1.0)).xyz);
8    vTexCoord = uv0;
9    gl_Position = transformPosition(proj, view, vpos);
10    ${(0,d.If)(b,"gl_Position *= perspectiveDivide;")}`),m.add("vpos","vec3",{invariant:!0}),m.add("vTexCoord","vec2"),g.include(l.Y),g.uniforms.add(new h.p("opacity",e=>e.opacity),new u.A("tex",e=>e.glTexture)).main.add((0,d.H)`
11    discardBySlice(vpos);
12    discardByTerrainDepth();
13    ${(0,d.If)(v===n.H_.ObjectAndLayerIdColor,"fragColor = vec4(0, 0, 0, 1); return;")}
14    vec4 finalColor = texture(tex, vTexCoord) * opacity;
15    outputColorHighlightOID(finalColor, vpos, finalColor.rgb);`),t}let b=Object.freeze(Object.defineProperty({__proto__:null,ImageMaterialPassParameters:m,build:v},Symbol.toStringTag,{value:"Module"}))},61563:function(e,t,i){i.d(t,{L:function(){return b},b:function(){return f}});var n=i(73526),a=i(51013),r=i(68948),s=i(89423),o=i(85712),l=i(69661),c=i(57973),h=i(99484),d=i(28616),u=i(75486),p=i(72607),_=i(25818),g=i(60747);function f(e){let t=new g.kG;t.include(o.j,e);let{vertex:i,fragment:a}=t;i.uniforms.add(new p.g("modelView",(e,{camera:t})=>(0,n.Iu)(v,t.viewMatrix,e.origin)),new u.C("proj",({camera:e})=>e.projectionMatrix),new h.p("glowWidth",(e,{camera:t})=>e.glowWidth*t.pixelRatio),new l.$("pixelToNDC",({camera:e})=>(0,r.t8)(m,2/e.fullViewport[2],2/e.fullViewport[3]))),t.attributes.add(_.T.START,"vec3"),t.attributes.add(_.T.END,"vec3"),e.spherical&&(t.attributes.add(_.T.START_UP,"vec3"),t.attributes.add(_.T.END_UP,"vec3")),t.attributes.add(_.T.EXTRUDE,"vec2"),t.varyings.add("uv","vec2"),t.varyings.add("vViewStart","vec3"),t.varyings.add("vViewEnd","vec3"),t.varyings.add("vViewSegmentNormal","vec3"),t.varyings.add("vViewStartNormal","vec3"),t.varyings.add("vViewEndNormal","vec3");let s=!e.spherical;return i.main.add((0,d.H)`
16    vec3 pos = mix(start, end, extrude.x);
17
18    vec4 viewPos = modelView * vec4(pos, 1);
19    vec4 projPos = proj * viewPos;
20    vec2 ndcPos = projPos.xy / projPos.w;
21
22    // in planar we hardcode the up vectors to be Z-up */
23    ${(0,d.If)(s,(0,d.H)`vec3 startUp = vec3(0, 0, 1);`)}
24    ${(0,d.If)(s,(0,d.H)`vec3 endUp = vec3(0, 0, 1);`)}
25
26    // up vector corresponding to the location of the vertex, selecting either startUp or endUp */
27    vec3 up = extrude.y * mix(startUp, endUp, extrude.x);
28    vec3 viewUp = (modelView * vec4(up, 0)).xyz;
29
30    vec4 projPosUp = proj * vec4(viewPos.xyz + viewUp, 1);
31    vec2 projUp = normalize(projPosUp.xy / projPosUp.w - ndcPos);
32
33    // extrude ndcPos along projUp to the edge of the screen
34    vec2 lxy = abs(sign(projUp) - ndcPos);
35    ndcPos += length(lxy) * projUp;
36
37    vViewStart = (modelView * vec4(start, 1)).xyz;
38    vViewEnd = (modelView * vec4(end, 1)).xyz;
39
40    vec3 viewStartEndDir = vViewEnd - vViewStart;
41
42    vec3 viewStartUp = (modelView * vec4(startUp, 0)).xyz;
43
44    // the normal of the plane that aligns with the segment and the up vector
45    vViewSegmentNormal = normalize(cross(viewStartUp, viewStartEndDir));
46
47    // the normal orthogonal to the segment normal and the start up vector
48    vViewStartNormal = -normalize(cross(vViewSegmentNormal, viewStartUp));
49
50    // the normal orthogonal to the segment normal and the end up vector
51    vec3 viewEndUp = (modelView * vec4(endUp, 0)).xyz;
52    vViewEndNormal = normalize(cross(vViewSegmentNormal, viewEndUp));
53
54    // Add enough padding in the X screen space direction for "glow"
55    float xPaddingPixels = sign(dot(vViewSegmentNormal, viewPos.xyz)) * (extrude.x * 2.0 - 1.0) * glowWidth;
56    ndcPos.x += xPaddingPixels * pixelToNDC.x;
57
58    // uv is used to read back depth to reconstruct the position at the fragment
59    uv = ndcPos * 0.5 + 0.5;
60
61    gl_Position = vec4(ndcPos, 0, 1);
62  `),a.uniforms.add(new c.z("perScreenPixelRatio",e=>e.camera.perScreenPixelRatio)),a.code.add((0,d.H)`float planeDistance(vec3 planeNormal, vec3 planeOrigin, vec3 pos) {
63return dot(planeNormal, pos - planeOrigin);
64}
65float segmentDistancePixels(vec3 segmentNormal, vec3 startNormal, vec3 endNormal, vec3 pos, vec3 start, vec3 end) {
66float distSegmentPlane = planeDistance(segmentNormal, start, pos);
67float distStartPlane = planeDistance(startNormal, start, pos);
68float distEndPlane = planeDistance(endNormal, end, pos);
69float dist = max(max(distStartPlane, distEndPlane), abs(distSegmentPlane));
70float width = fwidth(distSegmentPlane);
71float maxPixelDistance = length(pos) * perScreenPixelRatio * 2.0;
72float pixelDist = dist / min(width, maxPixelDistance);
73return abs(pixelDist);
74}`),a.main.add((0,d.H)`fragColor = vec4(0.0);
75vec3 dEndStart = vViewEnd - vViewStart;
76if (dot(dEndStart, dEndStart) < 1e-5) {
77return;
78}
79vec3 pos;
80vec3 normal;
81float angleCutoffAdjust;
82float depthDiscontinuityAlpha;
83if (!laserlineReconstructFromDepth(pos, normal, angleCutoffAdjust, depthDiscontinuityAlpha)) {
84return;
85}
86float distance = segmentDistancePixels(
87vViewSegmentNormal,
88vViewStartNormal,
89vViewEndNormal,
90pos,
91vViewStart,
92vViewEnd
93);
94vec4 color = laserlineProfile(distance);
95float alpha = (1.0 - smoothstep(0.995 - angleCutoffAdjust, 0.999 - angleCutoffAdjust, abs(dot(normal, vViewSegmentNormal))));
96fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha);`),t}let m=(0,s.Ue)(),v=(0,a.Ue)(),b=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},26235:function(e,t,i){i.d(t,{L:function(){return L},b:function(){return x},d:function(){return S}});var n=i(67210),a=i(68948),r=i(89423),s=i(1941),o=i(88815),l=i(79364),c=i(67377),h=i(38209),d=i(58485),u=i(13398),p=i(85712),_=i(34874),g=i(68724),f=i(11545),m=i(45661),v=i(62281),b=i(57973),y=i(99484),M=i(28616),w=i(60747);let S=(0,n.Vl)(6);function x(e){let t=new w.kG;t.include(_.k),t.include(p.j,e);let i=t.fragment;if(e.lineVerticalPlaneEnabled||e.heightManifoldEnabled){if(i.uniforms.add(new y.p("maxPixelDistance",(t,i)=>e.heightManifoldEnabled?2*i.camera.computeScreenPixelSizeAt(t.heightManifoldTarget):2*i.camera.computeScreenPixelSizeAt(t.lineVerticalPlaneSegment.origin))),i.code.add((0,M.H)`float planeDistancePixels(vec4 plane, vec3 pos) {
97float dist = dot(plane.xyz, pos) + plane.w;
98float width = fwidth(dist);
99dist /= min(width, maxPixelDistance);
100return abs(dist);
101}`),e.spherical){let e=(e,t,i)=>(0,s.t)(e,t.heightManifoldTarget,i.camera.viewMatrix),t=(e,t)=>(0,s.t)(e,[0,0,0],t.camera.viewMatrix);i.uniforms.add(new v.N("heightManifoldOrigin",(i,n)=>(e(T,i,n),t(P,n),(0,s.d)(P,P,T),(0,s.n)(A,P),A[3]=(0,s.l)(P),A)),new f.d("globalOrigin",e=>t(T,e)),new y.p("cosSphericalAngleThreshold",(e,t)=>1-Math.max(2,(0,s.j)(t.camera.eye,e.heightManifoldTarget)*t.camera.perRenderPixelRatio)/(0,s.l)(e.heightManifoldTarget))),i.code.add((0,M.H)`float globeDistancePixels(float posInGlobalOriginLength) {
102float dist = abs(posInGlobalOriginLength - heightManifoldOrigin.w);
103float width = fwidth(dist);
104dist /= min(width, maxPixelDistance);
105return abs(dist);
106}
107float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) {
108vec3 posInGlobalOriginNorm = normalize(globalOrigin - pos);
109float cosAngle = dot(posInGlobalOriginNorm, heightManifoldOrigin.xyz);
110vec3 posInGlobalOrigin = globalOrigin - pos;
111float posInGlobalOriginLength = length(posInGlobalOrigin);
112float sphericalDistance = globeDistancePixels(posInGlobalOriginLength);
113float planarDistance = planeDistancePixels(heightPlane, pos);
114return cosAngle < cosSphericalAngleThreshold ? sphericalDistance : planarDistance;
115}`)}else i.code.add((0,M.H)`float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) {
116return planeDistancePixels(heightPlane, pos);
117}`)}if(e.pointDistanceEnabled&&(i.uniforms.add(new y.p("maxPixelDistance",(e,t)=>2*t.camera.computeScreenPixelSizeAt(e.pointDistanceTarget))),i.code.add((0,M.H)`float sphereDistancePixels(vec4 sphere, vec3 pos) {
118float dist = distance(sphere.xyz, pos) - sphere.w;
119float width = fwidth(dist);
120dist /= min(width, maxPixelDistance);
121return abs(dist);
122}`)),e.intersectsLineEnabled&&i.uniforms.add(new b.z("perScreenPixelRatio",e=>e.camera.perScreenPixelRatio)).code.add((0,M.H)`float lineDistancePixels(vec3 start, vec3 dir, float radius, vec3 pos) {
123float dist = length(cross(dir, pos - start)) / (length(pos) * perScreenPixelRatio);
124return abs(dist) - radius;
125}`),(e.lineVerticalPlaneEnabled||e.intersectsLineEnabled)&&i.code.add((0,M.H)`bool pointIsWithinLine(vec3 pos, vec3 start, vec3 end) {
126vec3 dir = end - start;
127float t2 = dot(dir, pos - start);
128float l2 = dot(dir, dir);
129return t2 >= 0.0 && t2 <= l2;
130}`),i.main.add((0,M.H)`vec3 pos;
131vec3 normal;
132float angleCutoffAdjust;
133float depthDiscontinuityAlpha;
134if (!laserlineReconstructFromDepth(pos, normal, angleCutoffAdjust, depthDiscontinuityAlpha)) {
135fragColor = vec4(0.0);
136return;
137}
138vec4 color = vec4(0.0);`),e.heightManifoldEnabled){i.uniforms.add(new g.A("angleCutoff",e=>O(e)),new v.N("heightPlane",(e,t)=>E(e.heightManifoldTarget,e.renderCoordsHelper.worldUpAtPosition(e.heightManifoldTarget,T),t.camera.viewMatrix)));let t=e.spherical?(0,M.H)`normalize(globalOrigin - pos)`:(0,M.H)`heightPlane.xyz`;i.main.add((0,M.H)`
139      vec2 angleCutoffAdjusted = angleCutoff - angleCutoffAdjust;
140      // Fade out laserlines on flat surfaces
141      float heightManifoldAlpha = 1.0 - smoothstep(angleCutoffAdjusted.x, angleCutoffAdjusted.y, abs(dot(normal, ${t})));
142      vec4 heightManifoldColor = laserlineProfile(heightManifoldDistancePixels(heightPlane, pos));
143      color = max(color, heightManifoldColor * heightManifoldAlpha);`)}return e.pointDistanceEnabled&&(i.uniforms.add(new g.A("angleCutoff",e=>O(e)),new v.N("pointDistanceSphere",(e,t)=>((0,s.t)((0,u.a)(j),e.pointDistanceOrigin,t.camera.viewMatrix),j[3]=(0,s.j)(e.pointDistanceOrigin,e.pointDistanceTarget),j))),i.main.add((0,M.H)`float pointDistanceSphereDistance = sphereDistancePixels(pointDistanceSphere, pos);
144vec4 pointDistanceSphereColor = laserlineProfile(pointDistanceSphereDistance);
145float pointDistanceSphereAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, normalize(pos - pointDistanceSphere.xyz))));
146color = max(color, pointDistanceSphereColor * pointDistanceSphereAlpha);`)),e.lineVerticalPlaneEnabled&&(i.uniforms.add(new g.A("angleCutoff",e=>O(e)),new v.N("lineVerticalPlane",(e,t)=>(function(e,t){let i=(0,h.KU)(e.lineVerticalPlaneSegment,.5,T),n=e.renderCoordsHelper.worldUpAtPosition(i,C),a=(0,s.n)(P,e.lineVerticalPlaneSegment.vector),r=(0,s.h)(T,n,a);return(0,s.n)(r,r),E(e.lineVerticalPlaneSegment.origin,r,t.camera.viewMatrix)})(e,t)),new m.J("lineVerticalStart",(e,t)=>(function(e,t){let i=(0,s.c)(T,e.lineVerticalPlaneSegment.origin);return e.renderCoordsHelper.setAltitude(i,0),(0,s.t)(i,i,t.camera.viewMatrix)})(e,t)),new m.J("lineVerticalEnd",(e,t)=>(function(e,t){let i=(0,s.f)(T,e.lineVerticalPlaneSegment.origin,e.lineVerticalPlaneSegment.vector);return e.renderCoordsHelper.setAltitude(i,0),(0,s.t)(i,i,t.camera.viewMatrix)})(e,t))),i.main.add((0,M.H)`if (pointIsWithinLine(pos, lineVerticalStart, lineVerticalEnd)) {
147float lineVerticalDistance = planeDistancePixels(lineVerticalPlane, pos);
148vec4 lineVerticalColor = laserlineProfile(lineVerticalDistance);
149float lineVerticalAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, lineVerticalPlane.xyz)));
150color = max(color, lineVerticalColor * lineVerticalAlpha);
151}`)),e.intersectsLineEnabled&&(i.uniforms.add(new g.A("angleCutoff",e=>O(e)),new m.J("intersectsLineStart",(e,t)=>(0,s.t)(T,e.lineStartWorld,t.camera.viewMatrix)),new m.J("intersectsLineEnd",(e,t)=>(0,s.t)(T,e.lineEndWorld,t.camera.viewMatrix)),new m.J("intersectsLineDirection",(e,t)=>((0,s.c)(A,e.intersectsLineSegment.vector),A[3]=0,(0,s.n)(T,(0,l.t)(A,A,t.camera.viewMatrix)))),new y.p("intersectsLineRadius",e=>e.intersectsLineRadius)),i.main.add((0,M.H)`if (pointIsWithinLine(pos, intersectsLineStart, intersectsLineEnd)) {
152float intersectsLineDistance = lineDistancePixels(intersectsLineStart, intersectsLineDirection, intersectsLineRadius, pos);
153vec4 intersectsLineColor = laserlineProfile(intersectsLineDistance);
154float intersectsLineAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, 1.0 - abs(dot(normal, intersectsLineDirection)));
155color = max(color, intersectsLineColor * intersectsLineAlpha);
156}`)),i.main.add((0,M.H)`fragColor = laserlineOutput(color * depthDiscontinuityAlpha);`),t}function O(e){return(0,a.t8)(D,Math.cos(e.angleCutoff),Math.cos(Math.max(0,e.angleCutoff-(0,n.Vl)(2))))}function E(e,t,i){return(0,s.t)(R,e,i),(0,s.c)(A,t),A[3]=0,(0,l.t)(A,A,i),(0,d.Yq)(R,A,I)}let D=(0,r.Ue)(),T=(0,o.Ue)(),A=(0,c.Ue)(),C=(0,o.Ue)(),P=(0,o.Ue)(),R=(0,o.Ue)(),I=(0,d.Ue)(),j=(0,u.c)(),L=Object.freeze(Object.defineProperty({__proto__:null,build:x,defaultAngleCutoff:S},Symbol.toStringTag,{value:"Module"}))},12018:function(e,t,i){i.d(t,{S:function(){return v},b:function(){return f}});var n=i(67377),a=i(5481),r=i(89995),s=i(24e3),o=i(99778),l=i(95363),c=i(1209),h=i(45661),d=i(62281),u=i(28616),p=i(25818),_=i(67121),g=i(60747);function f(e){let t=new g.kG;t.include(s.w,e),t.include(a.A,e),t.fragment.include(r.f5,e),t.include(_.j,e),t.include(o.H,e);let{vertex:i,fragment:n}=t;return n.include(l.Y),(0,c.Sv)(i,e),n.uniforms.add(new d.N("uColor",e=>e.color)),t.attributes.add(p.T.POSITION,"vec3"),t.varyings.add("vWorldPosition","vec3"),e.screenSizeEnabled&&t.attributes.add(p.T.OFFSET,"vec3"),e.shadingEnabled&&((0,c._8)(i),t.attributes.add(p.T.NORMAL,"vec3"),t.varyings.add("vViewNormal","vec3"),n.uniforms.add(new h.J("shadingDirection",e=>e.shadingDirection)),n.uniforms.add(new d.N("shadedColor",e=>(function(e,t){let i=1-e[3],n=e[3]+t[3]*i;return 0===n?m[3]=n:(m[0]=(e[0]*e[3]+t[0]*t[3]*i)/n,m[1]=(e[1]*e[3]+t[1]*t[3]*i)/n,m[2]=(e[2]*e[3]+t[2]*t[3]*i)/n,m[3]=t[3]),m})(e.shadingTint,e.color)))),i.main.add((0,u.H)`
157      vWorldPosition = ${e.screenSizeEnabled?(0,u.H)`screenSizeScaling(offset, position)`:(0,u.H)`position`};
158      ${e.shadingEnabled?(0,u.H)`vec3 worldNormal = normal;
159                 vViewNormal = (viewNormal * vec4(worldNormal, 1)).xyz;`:""}
160      forwardViewPosDepth((view * vec4(vWorldPosition, 1.0)).xyz);
161      gl_Position = transformPosition(proj, view, vWorldPosition);
162  `),n.main.add((0,u.H)`
163      discardBySlice(vWorldPosition);
164      discardByTerrainDepth();
165      ${e.shadingEnabled?(0,u.H)`vec3 viewNormalNorm = normalize(vViewNormal);
166             float shadingFactor = 1.0 - clamp(-dot(viewNormalNorm, shadingDirection), 0.0, 1.0);
167             vec4 finalColor = mix(uColor, shadedColor, shadingFactor);`:(0,u.H)`vec4 finalColor = uColor;`}
168      outputColorHighlightOID(finalColor, vWorldPosition, finalColor.rgb);`),t}let m=(0,n.Ue)(),v=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},64955:function(e,t,i){i.d(t,{S:function(){return h},b:function(){return c}});var n=i(1209),a=i(62281),r=i(99484),s=i(28616),o=i(25818),l=i(60747);function c(e){let t=new l.kG,{vertex:i,fragment:c,attributes:h,varyings:d}=t;return(0,n.Sv)(i,e),h.add(o.T.POSITION,"vec3"),h.add(o.T.UV0,"vec2"),d.add("vUV","vec2"),i.main.add((0,s.H)`vUV = uv0;
169gl_Position = proj * view * vec4(position, 1.0);`),c.uniforms.add(new a.N("backgroundColor",e=>e.backgroundColor),new a.N("gridColor",e=>e.gridColor),new r.p("gridWidth",e=>e.gridWidth)).main.add((0,s.H)`const float LINE_WIDTH = 1.0;
170vec2 uvScaled = vUV * gridWidth;
171vec2 gridUV = (fract(uvScaled + 0.5) - 0.5) / (LINE_WIDTH * fwidth(uvScaled));
172vec2 grid = (1.0 - step(0.5, gridUV)) * step(-0.5, gridUV);
173grid.x *= step(0.5, uvScaled.x) * step(uvScaled.x, gridWidth - 0.5);
174grid.y *= step(0.5, uvScaled.y) * step(uvScaled.y, gridWidth - 0.5);
175float gridFade = max(grid.x, grid.y);
176float gridAlpha = gridColor.a * gridFade;
177fragColor =
178vec4(backgroundColor.rgb * backgroundColor.a, backgroundColor.a) * (1.0 - gridAlpha) +
179vec4(gridColor.rgb, 1.0) * gridAlpha;`),t}let h=Object.freeze(Object.defineProperty({__proto__:null,build:c},Symbol.toStringTag,{value:"Module"}))},73343:function(e,t,i){i.d(t,{d:function(){return r}});var n=i(67210),a=i(44187);function r(e,t,i){let r=Array.isArray(e),o=r?e.length/t:e.byteLength/(4*t),l=r?e:new Uint32Array(e,0,o*t),c=i?.minReduction??0,h=i?.originalIndices||null,d=h?h.length:0,u=i?.componentOffsets||null,p=0;if(u)for(let e=0;e<u.length-1;e++){let t=u[e+1]-u[e];t>p&&(p=t)}else p=o;let _=Math.floor(1.1*p)+1;(null==s||s.length<2*_)&&(s=new Uint32Array((0,n.Sf)(2*_)));for(let e=0;e<2*_;e++)s[e]=0;let g=0,f=!!u&&!!h,m=f?d:o,v=(0,a.$z)(o),b=new Uint32Array(d),y=0!==c?Math.ceil(15.366399999999999/(c*c)*c*(1-c)):m,M=1,w=u?u[1]:m;for(let e=0;e<m;e++){if(e===y){let t=1-g/e;if(t+1.96*Math.sqrt(t*(1-t)/e)<c)return null;y*=2}if(e===w){for(let e=0;e<2*_;e++)s[e]=0;if(h)for(let e=u[M-1];e<u[M];e++)b[e]=v[h[e]];w=u[++M]}let i=f?h[e]:e,n=i*t,a=function(e,t,i){let n=0;for(let a=0;a<i;a++)n=(n=e[t+a]+n|0)+(n<<11)+(n>>>2)|0;return n>>>0}(l,n,t),r=a%_,o=g;for(;0!==s[2*r+1];){if(s[2*r]===a){let e=s[2*r+1]-1;if(function(e,t,i,n){for(let a=0;a<n;a++)if(e[t+a]!==e[i+a])return!1;return!0}(l,n,e*t,t)){o=v[e];break}}++r>=_&&(r-=_)}o===g&&(s[2*r]=a,s[2*r+1]=i+1,g++),v[i]=o}if(0!==c&&1-g/o<c)return null;if(f){for(let e=u[M-1];e<b.length;e++)b[e]=v[h[e]];v=(0,a.UB)(b)}let S=r?Array(g):new Uint32Array(g*t);g=0;for(let e=0;e<m;e++)v[e]===g&&(function(e,t,i,n,a){for(let r=0;r<a;r++)i[n+r]=e[t+r]}(l,(f?h[e]:e)*t,S,g*t,t),g++);if(h&&!f){let e=new Uint32Array(d);for(let t=0;t<e.length;t++)e[t]=v[h[t]];v=(0,a.UB)(e)}return{buffer:Array.isArray(S)?S:S.buffer,indices:v,uniqueCount:g}}let s=null},24145:function(e,t,i){i.d(t,{i:function(){return l}});var n=i(67210),a=i(96805),r=i(1941),s=i(30018),o=i(58485);function l(e,t,i){let l=!function(e,t,i,n){let s=Array.isArray(t[0])?(e,i)=>t[e][i]:(e,i)=>t[3*e+i],l=n?(0,a.c9)(n)/(0,a._R)(n):1;return(0,o.zu)(e,(e,t)=>(0,r.i)(e,s(t,0)*l,s(t,1)*l,s(t,2)),i)}(c,e,t,i)?[0,0,1]:(0,o.st)(c);return Math.abs(l[2])>Math.cos((0,n.Vl)(80))?s.R.Z:Math.abs(l[1])>Math.abs(l[0])?s.R.Y:s.R.X}let c=(0,o.Ue)()},19603:function(e,t,i){i.d(t,{Ni:function(){return p},ZI:function(){return a},bT:function(){return u}});var n,a,r=i(97059),s=i(30018),o=i(5990),l=i(36430),c=i(44187),h=i(24145),d=i(73343);function u(e){let t=p(e.rings,e.hasZ,a.CCW_IS_HOLE,e.spatialReference),i=[],n=0,s=0;for(let e of t.polygons){let a=e.count,o=e.index,h=(0,l.Rq)(t.position,3*o,3*a),d=e.holeIndices.map(e=>e-o),u=(0,c.UB)((0,r.e)(h,d,3));i.push({position:h,faces:u}),n+=h.length,s+=u.length}let o=function(e,t,i){if(1===e.length)return e[0];let n=(0,l.bg)(t),a=Array(i),r=0,s=0,o=0;for(let t of e){for(let e=0;e<t.position.length;e++)n[r++]=t.position[e];for(let e of t.faces)a[s++]=e+o;o=r/3}return{position:n,faces:(0,c.UB)(a)}}(i,n,s),h=Array.isArray(o.position)?(0,d.d)(o.position,3,{originalIndices:o.faces}):(0,d.d)(o.position.buffer,6,{originalIndices:o.faces});return o.position=(0,l.QZ)(new Float64Array(h.buffer)),o.faces=h.indices,o}function p(e,t,i,n){let r=e.length,c=Array(r),d=Array(r),u=Array(r),p=0;for(let t=0;t<r;++t)p+=e[t].length;let g=0,f=0,m=0,v=(0,l.bg)(3*p),b=0;for(let l=r-1;l>=0;l--){let p=e[l],y=i===a.CCW_IS_HOLE&&function(e,t,i){if(!t)return!(0,o.bu)(e);let n=e.length-1;switch((0,h.i)(e,n,i)){case s.R.X:return!(0,o.bu)(e,s.R.Y,s.R.Z);case s.R.Y:return!(0,o.bu)(e,s.R.X,s.R.Z);case s.R.Z:return!(0,o.bu)(e,s.R.X,s.R.Y)}}(p,t,n);if(y&&1!==r)c[g++]=p;else{let e=p.length;for(let t=0;t<g;++t)e+=c[t].length;let i={index:b,pathLengths:Array(g+1),count:e,holeIndices:Array(g)};i.pathLengths[0]=p.length,p.length>
1790&&(u[m++]={index:b,count:p.length}),b=y?_(p,p.length-1,-1,v,b,p.length,t):_(p,0,1,v,b,p.length,t);for(let e=0;e<g;++e){let n=c[e];i.holeIndices[e]=b,i.pathLengths[e+1]=n.length,n.length>0&&(u[m++]={index:b,count:n.length}),b=_(n,0,1,v,b,n.length,t)}g=0,i.count>0&&(d[f++]=i)}}for(let e=0;e<g;++e){let i=c[e];i.length>0&&(u[m++]={index:b,count:i.length}),b=_(i,0,1,v,b,i.length,t)}return d.length=f,u.length=m,{position:v,polygons:d,outlines:u}}function _(e,t,i,n,a,r,s){a*=3;for(let o=0;o<r;++o){let r=e[t];n[a++]=r[0],n[a++]=r[1],n[a++]=s&&r[2]?r[2]:0,t+=i}return a/3}(n=a||(a={}))[n.NONE=0]="NONE",n[n.CCW_IS_HOLE=1]="CCW_IS_HOLE"},51597:function(e,t,i){i.r(t),i.d(t,{DrawGraphicTool3D:function(){return i8},ExtentTransformTool:function(){return sb},ManipulatedObject3DGraphic:function(){return sx},MoveTool3D:function(){return aQ},ReshapeTool3D:function(){return rm},TransformTool3D:function(){return rI}});var n,a,r,s,o,l,c,h,d,u,p,_,g,f,m,v,b,y,M,w,S,x,O,E,D,T,A,C,P=i(73322),R=i(30130),I=i(43163),j=i(4509),L=i(57682),U=i(86652),V=i(95263);i(58583),i(42082);var z=i(18301),H=i(1941),G=i(88815),N=i(29644),F=i(33628),k=i(83748);i(21670);var Z=i(53141),W=i(74260);i(9902);var Y=i(81738),B=i(41728),X=i(67210),q=i(4887),Q=i(96805),J=i(68948),$=i(89423),K=i(5990),ee=i(57927),et=i(99386),ei=i(29557);i(91083);let en=e=>({vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}),ea=(e,t,i)=>{for(let n=0,a=t.length;n<a;n++){let a=t[n];Array.isArray(a)?ea(e,a,i):null!=a&&!1!==a&&("string"==typeof a&&(a=en(a)),i.push(a))}};i(35219);let er={bottom:"esri-text-overlay-item-anchor-bottom","bottom-right":"esri-text-overlay-item-anchor-bottom-right","bottom-left":"esri-text-overlay-item-anchor-bottom-left",top:"esri-text-overlay-item-anchor-top","top-right":"esri-text-overlay-item-anchor-top-right","top-left":"esri-text-overlay-item-anchor-top-left",center:"esri-text-overlay-item-anchor-center",right:"esri-text-overlay-item-anchor-right",left:"esri-text-overlay-item-anchor-left"},es=class extends Y.Z{get position(){return[this.x,this.y]}set position(e){this._set("x",e[0]),this._set("y",e[1])}get _textShadowColor(){let{textColor:e,backgroundColor:t}=this,i=t.clone();return i.a*=e.a,i}get _textShadow(){let e=this._textShadowColor.toCss(!0);return`0 0 ${this._textShadowSize}px ${e}`}get padding(){return .5*this.fontSize}get borderRadius(){return this.padding}set borderRadius(e){this._overrideIfSome("borderRadius",e)}constructor(e){super(e),this.x=0,this.y=0,this.text="-",this.fontSize=14,this.anchor="center",this.visible=!0,this.isDecoration=!0,this.backgroundColor=new W.Z([0,0,0,.6]),this.textColor=new W.Z([255,255,255]),this._textShadowSize=1}render(){return function(e,t,i){let n,a;if(Array.isArray(t))i=t,t=void 0;else if(t&&("string"==typeof t||t.hasOwnProperty("vnodeSelector"))||i&&("string"==typeof i||i.hasOwnProperty("vnodeSelector")))throw Error("h called with invalid arguments");return i&&1===i.length&&"string"==typeof i[0]?n=i[0]:i&&(ea("div",i,a=[]),0===a.length&&(a=void 0)),{vnodeSelector:"div",properties:t,children:a,text:""===n?void 0:n,domNode:null}}
179(0,{classes:this._cssClasses(),styles:{left:Math.floor(this.x)+"px",top:Math.floor(this.y)+"px",visibility:this.visible?"visible":"hidden",fontSize:this.fontSize+"px",lineHeight:this.fontSize+"px",backgroundColor:this.backgroundColor.toCss(!0),color:this.textColor.toCss(!0),padding:this.padding+"px",borderRadius:this.borderRadius+"px",textShadow:this._textShadow}},[this.text])}renderCanvas(e){if(!this.visible)return;let t=e.font.replace(/^(.*?)px/,"");e.font=`${this.fontSize}px ${t}`;let{padding:i,borderRadius:n}=this,a=e.measureText(this.text).width,r=""!==this.text?this.fontSize:0,s=eo[this.anchor];e.textAlign="center",e.textBaseline="middle";let o=a+2*i,l=r+2*i,c=this.x+s.x*o,h=this.y+s.y*l;this._roundedRect(e,c,h,o,l,n),e.fillStyle=this.backgroundColor.toCss(!0),e.fill();let d=this.x+(s.x+.5)*o,u=this.y+(s.y+.5)*l;this._renderTextShadow(e,this.text,d,u),e.fillStyle=this.textColor.toCss(!0),e.fillText(this.text,d,u)}_renderTextShadow(e,t,i,n){e.lineJoin="miter",e.fillStyle=`rgba(${this._textShadowColor.r}, ${this._textShadowColor.g}, ${this._textShadowColor.b}, ${1/el.length})`;let a=this._textShadowSize;for(let[r,s]of el)e.fillText(t,i+a*r,n+a*s)}_roundedRect(e,t,i,n,a,r){r=Math.min(r,a/2,n/2),e.beginPath(),e.moveTo(t,i+r),e.arcTo(t,i,t+r,i,r),e.lineTo(t+n-r,i),e.arcTo(t+n,i,t+n,i+r,r),e.lineTo(t+n,i+a-r),e.arcTo(t+n,i+a,t+n-r,i+a,r),e.lineTo(t+r,i+a),e.arcTo(t,i+a,t,i+a-r,r),e.closePath()}_cssClasses(){let e;let t={"esri-text-overlay-item":!0};for(e in er)t[er[e]]=this.anchor===e;return t}};(0,P._)([(0,U.Cb)()],es.prototype,"x",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"y",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"position",null),(0,P._)([(0,U.Cb)()],es.prototype,"text",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"fontSize",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"anchor",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"visible",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"isDecoration",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"backgroundColor",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"textColor",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"_textShadowSize",void 0),(0,P._)([(0,U.Cb)()],es.prototype,"_textShadowColor",null),(0,P._)([(0,U.Cb)()],es.prototype,"_textShadow",null),(0,P._)([(0,U.Cb)()],es.prototype,"padding",null),(0,P._)([(0,U.Cb)()],es.prototype,"borderRadius",null),es=(0,P._)([(0,z.j)("esri.views.overlay.TextOverlayItem")],es);let eo={bottom:{x:-.5,y:-1,textAlign:"center",textBaseline:"bottom"},"bottom-left":{x:0,y:-1,textAlign:"left",textBaseline:"bottom"},"bottom-right":{x:-1,y:-1,textAlign:"right",textBaseline:"bottom"},center:{x:-.5,y:-.5,textAlign:"center",textBaseline:"middle"},left:{x:0,y:-.5,textAlign:"left",textBaseline:"middle"},right:{x:-1,y:-.5,textAlign:"right",textBaseline:"middle"},top:{x:-.5,y:0,textAlign:"center",textBaseline:"top"},"top-left":{x:0,y:0,textAlign:"left",textBaseline:"top"},"top-right":{x:-1,y:0,textAlign:"right",textBaseline:"top"}},el=[];for(let e=0;e<360;e+=22.5)el.push([Math.cos(Math.PI*e/180),Math.sin(Math.PI*e/180)]);var ec=i(94171);let eh={default:15,far:25},ed=class extends Y.Z{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messageUnitsTask=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){this.addHandles([(0,L.YP)(()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(e=>(0,L.on)(()=>this.context?.editGeometryOperations,e,()=>this._update())),(0,L.YP)(()=>this._colors,e=>this._updateStyle(e)),(0,ec.qe)(()=>this._refreshMessages()),(0,I.kB)(()=>this._messageUnitsTask?.abort())]),this._refreshMessages()}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){}get _messagesUnits(){return this._messageUnitsTask?.value}get _edgeDistancePixels(){return eh[this.edgeDistance]}get _colors(){let e=this.context?.view.effectiveTheme.textColor??W.Z.fromArray([255,255,255]);return{textColor:e,backgroundColor:(0,R.G)((0,R.mj)(e,R.K6.Low),.6)}}
179_update(){if(this.destroyed)return;this._nextLabelIndex=0;let{context:e,stagedVertex:t}=this;if(!e)return this._destroyUnusedLabels();let{editGeometryOperations:i}=e,{components:n,geometry:a,coordinateHelper:r}=i.data;if(!a)return this._destroyUnusedLabels();let s=n.length;for(let n=0;n<s;++n){let o=function(e,t,i,n,a){let r=[];if(t.data.components[a].iterateVertices(e=>{r.push(n.toXYZ(e.pos,ee.WM.get()))}),0===a&&null!=i&&r.push(n.toXYZ(i,ee.WM.get())),r.length<2)return r;let s=r[0],o=r[r.length-1];return"polygon"===e.type&&r.length>2&&!(0,H.G)(s,o)&&r.push(s),r}(a,i,t,r,n);if(o.length<2||!function(e,t,i,n){if("2d"===t.type)return!0;let a=(0,Q.Z7)(n)??1,r=(0,Q._R)(n),s=e=>(0,N.zx)(t,e,n,i,N.jG)??0;for(let t=1;t<e.length;++t){let i=e[t-1],n=e[t],o=(n[0]-i[0])*a,l=(n[1]-i[1])*a;if(Math.abs((s(n)-s(i))*r)/Math.sqrt(o*o+l*l)>eu)return!1}return!0}(o,e.view,e.elevationInfo,r.spatialReference))continue;let l=1===s&&!(0,K.bu)(o),c=eg,h=ef;this.toScreenPointArray(e,o[0],c);for(let t=1;t<o.length;++t){let i=o[t-1],n=o[t];this.toScreenPointArray(e,n,h),this._addLabel(e,i,c,n,h,l),[c,h]=[h,c]}}this._destroyUnusedLabels()}_updateStyle({textColor:e,backgroundColor:t}){let i=this._nextLabelIndex,n=this._labelInfos;for(let a=0;a<i;++a){let{label:i}=n[a];i.textColor=e,i.backgroundColor=t}}_addLabel(e,t,i,n,a,r){let{label:s}=this._getOrCreateLabel(e);if(!this.visible||3025>(0,J.bI)(i,a))return void(s.visible=!1);let{spatialReference:o}=e.editGeometryOperations.data,l=e.automaticLengthMeasurementUtils.autoDistance2D(t,n,o),c=this._messagesUnits,h=(0,ei.R)(e.view);s.text=null!=c&&null!=l?(0,q.N9)(c,l,h):"",s.visible=!0;let d=a[0]-i[0],u=a[1]-i[1];r?(0,J.t8)(ep,-u,d):(0,J.t8)(ep,u,-d),(0,J.Fv)(ep,ep),(0,J.bA)(ep,ep,this._edgeDistancePixels),(0,J.t7)(e_,i,a,.5),(0,J.IH)(e_,e_,ep),s.position=[e_[0],e_[1]],Math.abs(ep[0])>Math.abs(ep[1])?s.anchor=ep[0]>0?"left":"right":s.anchor=0>-ep[1]?"top":"bottom"}_getOrCreateLabel(e){let t=this._labelInfos.length>this._nextLabelIndex,{textColor:i,backgroundColor:n}=this._colors;if(t){let e=this._labelInfos[this._nextLabelIndex++],{label:t}=e;return t.textColor=i,t.backgroundColor=n,e}let a=new es({anchor:"center",fontSize:8,textColor:i,backgroundColor:n});e.view.overlay?.items.add(a);let r={label:a};return this._labelInfos.push(r),this._nextLabelIndex=this._labelInfos.length,r}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){this.context?.view.overlay?.items.remove(e),e.destroy()}_refreshMessages(){this._messageUnitsTask?.abort(),this._messageUnitsTask=(0,B.vr)(()=>(0,et.ME)("esri/core/t9n/Units"))}};(0,P._)([(0,U.Cb)()],ed.prototype,"context",void 0),(0,P._)([(0,U.Cb)()],ed.prototype,"stagedVertex",void 0),(0,P._)([(0,U.Cb)()],ed.prototype,"visible",void 0),(0,P._)([(0,U.Cb)()],ed.prototype,"edgeDistance",void 0),(0,P._)([(0,U.Cb)()],ed.prototype,"updating",null),(0,P._)([(0,U.Cb)()],ed.prototype,"_messageUnitsTask",void 0),(0,P._)([(0,U.Cb)()],ed.prototype,"_messagesUnits",null),(0,P._)([(0,U.Cb)()],ed.prototype,"_edgeDistancePixels",null),(0,P._)([(0,U.Cb)()],ed.prototype,"_colors",null),ed=(0,P._)([(0,z.j)("esri.views.interactive.SegmentLabels")],ed);let eu=(0,X.Vl)(5),ep=(0,$.Ue)(),e_=(0,$.Ue)(),eg=(0,k.s1)(),ef=(0,k.s1)(),em=class extends ed{getCameraOrExtent({view:e}){return e.state.camera}toScreenPointArray({view:e,elevationInfo:t,editGeometryOperations:i},n,a=(0,k.s1)()){let{spatialReference:r}=i.data.coordinateHelper;return(0,Z.R)(n,r,t,e,ev),e.state.camera.projectToScreen(ev,a),a}};em=(0,P._)([(0,z.j)("esri.views.3d.interactive.SegmentLabels3D")],em);let ev=(0,G.Ue)();var eb=i(65097),ey=i(79364),eM=i(67377),ew=i(71527),eS=i(69745),ex=i(38209),eO=i(84853),eE=i(4047),eD=i(34380),eT=i(10166),eA=i(79899);class eC{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1,this._renderGroup=eD.eZ.Outline}destroy(){this._destroyResources()}get resources(){return this._resources?.external}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncGeometriesToRenderer())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}get renderGroup(){return this._renderGroup}set renderGroup(e){this._renderGroup=e;let t=this._resources?.layerView;t&&(t.renderGroup=e)}recreate(){this.attached&&this._createResources()}recreateGeometry(){this._resourceFactory.recreateGeometry?null!=this._resources&&(this._ensureRenderGeometriesRemoved(),this._resourceFactory.recreateGeometry(this._resources.external),this._syncGeometriesToRenderer()):this.recreate()}forEachMaterial(e){this._resources&&this._resourceFactory.forEac
179hMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?null==this._resources&&this._createResources():this._destroyResources()}_createResources(){this._destroyResources();let e=this._resourceFactory.createResources(),t=new eP({view:this._resourceFactory.view,renderGroup:this._renderGroup}),i=this._resourceFactory.view.basemapTerrain?.overlayManager;this._resources={layerView:t,external:e,geometriesAdded:!1},i&&(this._resources.drapeSourceRenderer=i.registerGeometryDrapeSource(t)),this._syncGeometriesToRenderer()}_destroyResources(){if(null==this._resources)return;this._ensureRenderGeometriesRemoved();let e=this._resourceFactory.view.basemapTerrain?.overlayManager;e&&e.unregisterDrapeSource(this._resources.layerView),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncGeometriesToRenderer(){this._visible?this._ensureRenderGeometriesAdded():this._ensureRenderGeometriesRemoved()}_ensureRenderGeometriesRemoved(){null!=this._resources?.drapeSourceRenderer&&this._resources.geometriesAdded&&(this._resources.drapeSourceRenderer.removeGeometries(this._resources.external.geometries,eT.T.UPDATE),this._resources.geometriesAdded=!1)}_ensureRenderGeometriesAdded(){null!=this._resources?.drapeSourceRenderer&&(this._resources.geometriesAdded||(this._resources.drapeSourceRenderer.addGeometries(this._resources.external.geometries,eT.T.UPDATE),this._resources.geometriesAdded=!0))}}let eP=class extends eE.Z.IdentifiableMixin(Y.Z){constructor(e){super(e),this.drapeSourceType=eD.Lw.Features,this.updatePolicy=eA.j.SYNC,this.renderGroup=eD.eZ.Outline}};(0,P._)([(0,U.Cb)({constructOnly:!0})],eP.prototype,"view",void 0),(0,P._)([(0,U.Cb)({readOnly:!0})],eP.prototype,"drapeSourceType",void 0),(0,P._)([(0,U.Cb)()],eP.prototype,"renderGroup",void 0),eP=(0,P._)([(0,z.j)("esri.views.3d.interactive.visualElements.DrapedVisualElementResources")],eP);class eR{get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this.forEachMaterial(t=>t?.setParameters({isDecoration:e}))}constructor(e){this._isDecoration=!1,this._attached=!1,this._resourcesCreated=!1,this._visible=!0,this.view=e.view,this._handle=(0,L.YP)(()=>e.view.ready,e=>{this._resourcesCreated&&(e?this._createResources():this._destroyResources())})}applyProperties(e){let t=!1;for(let i in e)i in this&&("attached"===i?t=!!e[i]:this[i]=e[i]);this.attached=t}destroy(){this.attached=!1,this._handle.remove()}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(),this.onAttachedChange(e))}onAttachedChange(e){}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.updateVisibility(this.visible)}_destroyResources(){this.destroyResources(),this._resourcesCreated=!1}}var eI=i(40944),ej=i(95449);class eL{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return null!=this._resources?this._resources.object:null}get resources(){return null!=this._resources?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();let e=this._resourceFactory.view.stage;if(null==this._resources||!e)return;let t=this._resources.object;t.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,t,this._resources.layer)}forEachMaterial(e){this._resources&&this._resourceFactory.forEac
179hMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();let e=this._resourceFactory,t=e.view,i=t.stage;if(!i)return;let n=new ej.F(i,{pickable:!1,updatePolicy:eA.j.SYNC}),a=new eI.T({castShadow:!1}),r=e.createResources(a,n);n.add(a);let s=e.cameraChanged,o=s?(0,L.YP)(()=>t.state.camera,e=>s(e),L.nn):null;this._resources={layer:n,object:a,external:r,cameraHandle:o},this._syncVisible()}_destroyResources(){null!=this._resources&&(this._resources.layer.destroy(),this._resources.object.dispose(),this._resources.cameraHandle?.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null)}_syncVisible(){null!=this._resources&&(this._resources.object.visible=this._visible)}}class eU extends eR{constructor(e){super(e),this._isDraped=!1,this.object3dResources=new eL(this.createObject3DResourceFactory(e.view)),this.drapedResources=new eC(this.createDrapedResourceFactory(e.view)),this.isDraped=e.isDraped??!1}get isDraped(){return this._isDraped}set isDraped(e){e!==this._isDraped&&(this._isDraped=e,this.object3dResources.attached=this.attached&&!e,this.drapedResources.attached=this.attached&&e)}get renderGroup(){return this.drapedResources.renderGroup}set renderGroup(e){this.drapedResources.renderGroup=e}createResources(){this.object3dResources.attached=!this._isDraped,this.drapedResources.attached=this._isDraped}destroyResources(){this.object3dResources.attached=!1,this.drapedResources.attached=!1}recreate(){this.object3dResources.recreate(),this.drapedResources.recreate()}recreateGeometry(){this.object3dResources.recreateGeometry(),this.drapedResources.recreateGeometry()}destroy(){this.object3dResources.destroy(),this.drapedResources.destroy(),super.destroy()}updateVisibility(e){this.object3dResources.visible=e,this.drapedResources.visible=e}forEachMaterial(e){this.object3dResources?.forEachMaterial(e),this.drapedResources?.forEachMaterial(e)}}var eV=i(26711),ez=i(98181),eH=i(26679),eG=i(3539),eN=i(18473),eF=i(32708),ek=i(92355),eZ=i(47896),eW=i(13968);class eY extends ek.A{constructor(e,t){super(e,t,new eF.J(eG.a,()=>i.e(51721).then(i.bind(i,51721))))}initializePipeline(e){switch(e.blitMode){case eZ.J.None:case eZ.J.Depth:return(0,eW.sm)({colorWrite:eW.gf});case eZ.J.Alpha:return(0,eW.sm)({blending:eW.vf,colorWrite:eW.gf});default:(0,eN.Bg)(e.blitMode);case eZ.J.PremultipliedAlpha:case eZ.J.COUNT:return(0,eW.sm)({blending:eW.Zo,colorWrite:eW.gf})}}}var eB=i(58046);class eX{constructor(e,t=eZ.J.None){this._techniques=e,this._parameters=new eG.C,this._configuration=new eZ.Z,this._configuration.blitMode=t,e.precompile(eY,this._configuration)}blit(e,t,i,n){e.bindFramebuffer(i.fbo),e.setClearColor(0,0,0,1),e.clear(eB.Hf.COLOR),this._parameters.texture=t.getTexture();let a=this._techniques.get(eY,this._configuration);e.bindTechnique(a,n,this._parameters),e.screen.draw()}blend(e,t,i,n,a=1){this._configuration.hasOpacityFactor=a<1;let r=this._techniques.get(eY,this._configuration);return!!r.compiled&&(e.bindFramebuffer(i.fbo),this._parameters.texture=t.getTexture(),this._parameters.opacity=a,e.bindTechnique(r,n,this._parameters),e.screen.draw(),!0)}}var eq=i(36430),eQ=i(7775),eJ=i(4699),e$=i(26235),eK=i(19647);class e0 extends eK.K{constructor(){super(...arguments),this.innerColor=(0,G.al)(1,1,1),this.innerWidth=1,this.glowColor=(0,G.al)(1,.5,0),this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=.75,this.globalAlphaContrastBoost=2,this.angleCutoff=(0,X.Vl)(6),this.pointDistanceOrigin=(0,G.Ue)(),this.pointDistanceTarget=(0,G.Ue)(),this.lineVerticalPlaneSegment=(0,ex.Ue)(),this.intersectsLineSegment=(0,ex.Ue)(),this.intersectsLineRadius=3,this.heightManifoldTarget=(0,G.Ue)(),this.lineStartWorld=(0,G.Ue)(),this.lineEndWorld=(0,G.Ue)()}}class e1 extends ek.A{constructor(e,t){super(e,t,new eF.J(e$.L,()=>i.e(26028).then(i.bind(i,26028))))}}var e2=i(25818),e3=i(61563);class e4 extends e0{constructor(){super(...arguments),this.origin=(0,G.Ue)()}}class e5 extends ek.A{constructor(e,t){super(e,t,new eF.J(e3.L,(
179)=>i.e(59840).then(i.bind(i,59840))),e9)}}let e9=new Map([[e2.T.START,0],[e2.T.END,1],[e2.T.EXTRUDE,2],[e2.T.START_UP,3],[e2.T.END_UP,4]]);var e8=i(24974),e6=i(59384);class e7{constructor(e){this._renderCoordsHelper=e,this._buffers=null,this._origin=(0,G.Ue)(),this._dirty=!1,this._count=0,this._vao=null}set vertices(e){let t=(0,eq.bg)(3*e.length),i=0;for(let n of e)t[i++]=n[0],t[i++]=n[1],t[i++]=n[2];this.buffers=[t]}set buffers(e){if(this._buffers=e,this._buffers.length>0){let e=this._buffers[0],t=3*Math.floor(e.length/3/2);(0,H.i)(this._origin,e[t],e[t+1],e[t+2])}else(0,H.i)(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(e){let t=this._ensureVAO(e);null!=t&&(e.bindVAO(t),e.drawArrays(eB.MX.TRIANGLES,0,this._count))}dispose(){null!=this._vao&&this._vao.dispose()}get _layout(){return this._renderCoordsHelper.viewingMode===eV.JY.Global?tn:ta}_ensureVAO(e){return null==this._buffers?null:(this._vao??=this._createVAO(e,this._buffers),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(e,t){let i=this._createDataBuffer(t);return this._dirty=!1,new e8.U(e,e9,new Map([["data",(0,eQ.K)(this._layout)]]),new Map([["data",e6.f.createVertex(e,eB.l1.STATIC_DRAW,i)]]))}_ensureVertexData(e,t){if(!this._dirty)return;let i=this._createDataBuffer(t);e.vertexBuffers.get("data")?.setData(i),this._dirty=!1}_createDataBuffer(e){let t=e.reduce((e,t)=>e+te(t),0);this._count=t;let i=this._layout.createBuffer(t),n=this._origin,a=0,r=0,s="startUp"in i?this._setUpVectors.bind(this,i):void 0;for(let t of e){for(let e=0;e<t.length;e+=3){let o=(0,H.i)(ti,t[e],t[e+1],t[e+2]);0===e?r=this._renderCoordsHelper.getAltitude(o):this._renderCoordsHelper.setAltitude(o,r);let l=a+2*e;s?.(e,l,t,o);let c=(0,H.d)(ti,o,n);if(e<t.length-3){for(let e=0;e<6;e++)i.start.setVec(l+e,c);i.extrude.setValues(l,0,-1),i.extrude.setValues(l+1,1,-1),i.extrude.setValues(l+2,1,1),i.extrude.setValues(l+3,0,-1),i.extrude.setValues(l+4,1,1),i.extrude.setValues(l+5,0,1)}if(e>0)for(let e=-6;e<0;e++)i.end.setVec(l+e,c)}a+=te(t)}return i.buffer}_setUpVectors(e,t,i,n,a){let r=this._renderCoordsHelper.worldUpAtPosition(a,tt);if(t<n.length-3)for(let t=0;t<6;t++)e.startUp.setVec(i+t,r);if(t>0)for(let t=-6;t<0;t++)e.endUp.setVec(i+t,r)}}function te(e){return 2*(e.length/3-1)*3}let tt=(0,G.Ue)(),ti=(0,G.Ue)(),tn=(0,eJ.U$)().vec3f(e2.T.START).vec3f(e2.T.END).vec2f(e2.T.EXTRUDE).vec3f(e2.T.START_UP).vec3f(e2.T.END_UP),ta=(0,eJ.U$)().vec3f(e2.T.START).vec3f(e2.T.END).vec2f(e2.T.EXTRUDE);var tr=i(33233);class ts extends tr.m{constructor(){super(...arguments),this.contrastControlEnabled=!1,this.spherical=!1}}(0,P._)([(0,tr.o)()],ts.prototype,"contrastControlEnabled",void 0),(0,P._)([(0,tr.o)()],ts.prototype,"spherical",void 0);class to extends ts{constructor(){super(...arguments),this.heightManifoldEnabled=!1,this.pointDistanceEnabled=!1,this.lineVerticalPlaneEnabled=!1,this.intersectsLineEnabled=!1}}(0,P._)([(0,tr.o)()],to.prototype,"heightManifoldEnabled",void 0),(0,P._)([(0,tr.o)()],to.prototype,"pointDistanceEnabled",void 0),(0,P._)([(0,tr.o)()],to.prototype,"lineVerticalPlaneEnabled",void 0),(0,P._)([(0,tr.o)()],to.prototype,"intersectsLineEnabled",void 0);var tl=i(15392),tc=i(42509);let th=class extends eH.Z{constructor(e){super(e),this.isDecoration=!0,this.produces=ez.CM.LASERLINES,this.consumes={required:[ez.CM.LASERLINES,"normals"]},this.requireGeometryDepth=!0,this._configuration=new to,this._pathTechniqueConfiguration=new ts,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._pathVerticalPlaneEnabled=!1,this._passParameters=new e4;let t=e.view.stage.renderView.techniques,i=new ts;i.contrastControlEnabled=e.contrastControlEnabled,t.precompile(e5,i)}initialize(){this._passParameters.renderCoordsHelper=this.view.renderCoordsHelper,this._pathTechniqueConfiguration.spherical=this.view.state.viewingMode===eV.JY.Global,this._pathTechniqueConfiguration.contrastControlEnabled=this.contrastControlEnabled,this._techniques.precompile(e5,this._pathTechniqueConfiguration),this._blit=new eX(this._techniques,eZ.J.PremultipliedAlpha)}destroy(){this._pathVerticalPlaneData=(0,j.M2)(this._pathVerticalPlaneData),this._blit=null}get _techniques(){return this.view.stage.renderView.techniques}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this.requestRender(tl.Xx.UPDATE))}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){(0,H.c)(this._passParameters.heightManifoldTarget,e),this.requestRender(tl.Xx.UPDATE)}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this.requestRender(tl.Xx.UPDATE))}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){(0,H.c)(this._passParameters.pointDistanceTarget,e),this.requestRender(tl.Xx.UPDATE)}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){(0,H.c)(this._passParameters.pointDistanceOrigin,e),this.requestRender(tl.Xx.UPDATE)}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this.requestRender(tl.Xx.UPDATE))}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){(0,ex.JG)(e,this._passParameters.lineVerticalPlaneSegment),this.requestRender(tl.Xx.UPDATE)}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this.requestRender(tl.Xx.UPDATE))}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){(0,ex.JG)(e,this._passParameters.intersectsLineSegment),this.requestRender(tl.Xx.UPDATE)}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this.requestRender(tl.Xx.UPDATE))}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,null!=this._pathVerticalPlaneData&&this.requestRender(tl.Xx.UPDATE))}set pathVerticalPlaneVertices(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new e7(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this.requestRender(tl.Xx.UPDATE)}set pathVerticalPlaneBuffers(e){null==this._pathVerticalPlaneData&&(this._pathVerticalPlaneData=new e7(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this.requestRender(tl.Xx.UPDATE)}setParameters(e){(0,tc.LO)(this._passParameters,e)&&this.requestRender(tl.Xx.UPDATE)}precompile(){this._acquireTechnique()}render(e){let t=e.find(({name:e})=>e===this.produces);if(this.isDecoration&&!this.bindParameters.decorations||null==this._blit)return t;let i=this.renderingContext,n=e.find(({name:e})=>"normals"===e);this._passParameters.normals=n?.getTexture();let a=()=>{(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(),this.pathVerticalPlaneEnabled&&this._renderPath()};if(!this.contrastControlEnabled)return i.bindFramebuffer(t.fbo),a(),t;this._passParameters.colors=t.getTexture();let r=this.fboCache.acquire(t.fbo.width,t.fbo.height,"laser lines");return i.bindFramebuffer(r.fbo),i.setClearColor(0,0,0,0),i.clear(eB.Hf.COLOR|eB.Hf.DEPTH),a(),i.unbindTexture(t.getTexture()),this._blit.blend(i,r,t,this.bindParameters)||this.requestRender(tl.Xx.UPDATE),r.release(),t}_acquireTechnique(){return this._configuration.heightManifoldEnabled=this.heightManifoldEnabled,this._configuration.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._configuration.pointDistanceEnabled=this.pointDistanceEnabled,this._configuration.intersectsLineEnabled=this.intersectsLineEnabled,this._configuration.contrastControlEnabled=this.contrastControlEnabled,this._configuration.spherical=this.view.state.viewingMode===eV.JY.Global,this._techniques.get(e1,this._configuration)}_renderUnified(){if(!this._updatePassParameters())return;let e=this._acquireTechnique();if(e.compiled){let t=this.renderingContext;t.bindTechnique(e,this.bindParameters,this._passParameters),t.screen.draw()}else this.requestRender(tl.Xx.UPDATE)}_renderPath(){if(null==this._pathVerticalPlaneData)return;let e=this._techniques.get(e5,this._pathTechniqueConfiguration);if(e.compiled){let t=this.renderingContext;this._passParameters.origin=this._pathVerticalPlaneData.origin,t.bindTechnique(e,this.bindParameters,this._passParameters),this._pathVerticalPlaneData.draw(t)}else this.requestRender(tl.Xx.UPDATE)}_updatePassParameters(){if(!this._intersectsLineEnabled)return!0;let e=this.bindParameters.camera,t=this._passParameters;
179if(this._intersectsLineInfinite){if((0,ew.iL)((0,eO.re)(t.intersectsLineSegment.origin,t.intersectsLineSegment.vector),td),td.c0=-Number.MAX_VALUE,!(0,eS.zq)(e.frustum,td))return!1;(0,ew.Ws)(td,t.lineStartWorld),(0,ew.S$)(td,t.lineEndWorld)}else(0,H.c)(t.lineStartWorld,t.intersectsLineSegment.origin),(0,H.f)(t.lineEndWorld,t.intersectsLineSegment.origin,t.intersectsLineSegment.vector);return!0}get test(){}};(0,P._)([(0,U.Cb)({constructOnly:!0})],th.prototype,"contrastControlEnabled",void 0),(0,P._)([(0,U.Cb)()],th.prototype,"isDecoration",void 0),(0,P._)([(0,U.Cb)()],th.prototype,"produces",void 0),(0,P._)([(0,U.Cb)()],th.prototype,"consumes",void 0),th=(0,P._)([(0,z.j)("esri.views.3d.webgl-engine.effects.laserlines.LaserLineRenderer")],th);let td=(0,ew.Ue)();class tu extends eR{constructor(e){super(e),this._angleCutoff=e$.d,this._style={},this._heightManifoldTarget=(0,G.Ue)(),this._heightManifoldEnabled=!1,this._intersectsLine=(0,ex.Ue)(),this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._lineVerticalPlaneSegment=null,this._pathVerticalPlaneBuffers=null,this._pointDistanceLine=null,this.applyProperties(e)}get testData(){}createResources(){this._ensureRenderer()}destroyResources(){this._disposeRenderer()}updateVisibility(){this._syncRenderer(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance()}get angleCutoff(){return this._angleCutoff}set angleCutoff(e){this._angleCutoff!==e&&(this._angleCutoff=e,this._syncAngleCutoff())}get style(){return this._style}set style(e){this._style=e,this._syncStyle()}get heightManifoldTarget(){return this._heightManifoldEnabled?this._heightManifoldTarget:null}set heightManifoldTarget(e){null!=e?((0,H.c)(this._heightManifoldTarget,e),this._heightManifoldEnabled=!0):this._heightManifoldEnabled=!1,this._syncRenderer(),this._syncHeightManifold()}set intersectsWorldUpAtLocation(e){if(null==e)return void(this.intersectsLine=null);let t=this.view.renderCoordsHelper.worldUpAtPosition(e,tp);this.intersectsLine=(0,ex.al)(e,t),this.intersectsLineInfinite=!0}get intersectsLine(){return this._intersectsLineEnabled?this._intersectsLine:null}set intersectsLine(e){null!=e?((0,ex.JG)(e,this._intersectsLine),this._intersectsLineEnabled=!0):this._intersectsLineEnabled=!1,this._syncIntersectsLine(),this._syncRenderer()}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){this._intersectsLineInfinite=e,this._syncIntersectsLineInfinite()}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){this._lineVerticalPlaneSegment=null!=e?(0,ex.JG)(e):null,this._syncLineVerticalPlane(),this._syncRenderer()}get pathVerticalPlane(){return this._pathVerticalPlaneBuffers}set pathVerticalPlane(e){this._pathVerticalPlaneBuffers=e,this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncRenderer()}get pointDistanceLine(){return this._pointDistanceLine}set pointDistanceLine(e){this._pointDistanceLine=null!=e?{origin:(0,G.d9)(e.origin),target:e.target?(0,G.d9)(e.target):null}:null,this._syncPointDistance(),this._syncRenderer()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._renderer&&(this._renderer.isDecoration=e)}_syncRenderer(){this.attached&&this.visible&&(this._intersectsLineEnabled||this._heightManifoldEnabled||null!=this._pointDistanceLine||null!=this._pathVerticalPlaneBuffers)?this._ensureRenderer():this._disposeRenderer()}_ensureRenderer(){null==this._renderer&&(this._renderer=new th({view:this.view,contrastControlEnabled:!0,isDecoration:this.isDecoration}),this._syncStyle(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncIntersectsLineInfinite(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncAngleCutoff())}_syncStyle(){null!=this._renderer&&this._renderer.setParameters(this._style)}_syncAngleCutoff(){this._renderer?.setParameters({angleCutoff:this._angleCutoff})}_syncHeightManifold(){null!=this._renderer&&(this._renderer.heightManifoldEnabled=this._heightManifoldEnabled&&this.visible,this._heightManifoldEnabled&&(this._renderer.heightManifoldTarget=this._heightManifoldTarget))}_syncIntersectsLine(){null!=this._renderer&&(this._renderer.intersectsLineEnabled=this._intersectsLineEnabled&&this.visible,this._intersectsLineEnabled&&(this._renderer.intersectsLineSegment=this._intersectsLine))}_syncIntersectsLineInfinite(){null!=this._renderer&&(this._renderer.intersectsLineInfinite=this._intersectsLineInfinite)}_syncPathVerticalPlane(){null!=this._renderer&&(this._renderer.pathVerticalPlaneEnabled=null!=this._pathVerticalPlaneBuffers&&this.visible,null!=this._pathVerticalPlaneBuffers&&(this._renderer.pathVerticalPlaneBuffers=this._pathVerticalPlaneBuffers))}_syncLineVerticalPlane(){null!=this._renderer&&(this._renderer.lineVerticalPlaneEnabled=null!=this._lineVerticalPlaneSegment&&this.visible,null!=this._lineVerticalPlaneSegment&&(this._renderer.lineVerticalPlaneSegment=this._lineVerticalPlaneSegment))}_syncPointDistance(){if(null==this._renderer)return;let e=this._pointDistanceLine,t=null!=e;this._renderer.pointDistanceEnabled=t&&null!=e.target&&this.visible,t&&(this._renderer.pointDistanceOrigin=e.origin,null!=e.target&&(this._renderer.pointDistanceTarget=e.target))}
179_disposeRenderer(){null!=this._renderer&&this.view.stage&&(this._renderer.destroy(),this._renderer=null)}forEachMaterial(){}}let tp=(0,G.Ue)();var t_=i(23566),tg=i(86448),tf=i(95688),tm=i(76502),tv=i(43327);class tb extends eU{constructor(e){super(e),this._ray=(0,eO.Ue)(),this._isWorldDown=!1,this._start=(0,G.Ue)(),this._end=(0,G.al)(1,0,0),this._width=1,this._color=(0,eM.al)(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=(0,eM.al)(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=m.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=tf.yD.OccludeAndTransparent,this._fadedExtensions=tO,this._laserline=new tu({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:ty,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:ty,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,(0,H.c)(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),(0,H.d)(this._end,e,this._end),(0,eO.zk)(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,(0,H.q)(this._start,e)||((0,H.c)(this._start,e),(0,eO.zk)(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,(0,H.q)(this._end,e)||((0,H.c)(this._end,e),(0,eO.zk)(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){(0,ey.a)(e,this._color)||((0,ey.c)(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=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){(0,ey.a)(e,this._innerColor)||((0,ey.c)(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){null!=e&&null!=this._stippleOffColor&&(0,ey.a)(e,this._stippleOffColor)||(this._stippleOffColor=null!=e?(0,eM.d9)(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&null!=this._laserlineStyle&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===tf.yD.OccludeAndTransparentStencil?tf.yD.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??tO,this.recreateGeometry()}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){let t=new tv.U(this.materialParameters),i=[];return this._createObject3DGeometry(t,e,i),{material:t,geometries:i}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,i){let n=this._createGeometry(e);i.push(n),t.addGeometry(n),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new tv.U(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){let t=this._createGeometry(e);return this._updateVerticesDraped(t),new tm.z(t)}_createGeometry(e){let t=this.extensionType===m.FADED,i=t?[(0,G.Ue)(),(0,G.Ue)(),(0,G.Ue)(),(0,G.Ue)()]:[(0,G.Ue)(),(0,G.Ue)()];return(0,tg.rh)(e,i,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===m.FADED?this._updateLineSegmentFinite(tx):this._updateLineSegmentInfinite(this._extensionType,tx)}_updateLineSegmentFinite(e){return(0,ex.zk)(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){let i=this.view.state.camera;switch((0,ew.iL)(this._ray,tM),e){case m.LINE:tM.c0=-Number.MAX_VALUE;break;case m.RAY:case m.GROUND_RAY:{let e=this._ray.origin,t=this.view.elevationProvider.getElevation(e[0],e[1],e[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,i=this.view.renderCoordsHelper.getAltitude(e);this._isWorldDown&&i<t&&(0,H.u)(tM.ray.direction,tM.ray.direction),this._extensionType===m.GROUND_RAY&&null!=t&&(tM.c1=Math.abs(i-t))}}if(!(0,eS.zq)(i.frustum,tM))return this._updateLineSegmentFinite(t);let n=(0,ew.Ws)(tM,tw),a=(0,ew.S$)(tM,tS);return(0,ex.zk)(n,a,t)}_updateVertexAttributesObject3D(e,t){let i=e.geometries[0].getMutableAttribute(e2.T.POSITION)?.data;if(!i)return;let n=0;for(let e of this._lineVertices(t))i[n++]=e[0],i[n++]=e[1],i[n++]=e[2];e.geometryVertexAttributeUpdated(e.geometries[0],e2.T.POSITION)}_updateVertexAttributesDraped(e,t){let i=e.getMutableAttribute(e2.T.POSITION)?.data;if(!i)return;let n=0;for(let e of this._lineVertices(t))i[n++]=e[0],i[n++]=e[1],i[n++]=t_.gi;
179e.invalidateBoundingInfo()}*_lineVertices(e){this.extensionType===m.FADED?(yield(0,ex.KU)(e,-this.fadedExtensions.start,tw),yield(0,ex.KU)(e,0,tw),yield(0,ex.KU)(e,1,tw),yield(0,ex.KU)(e,1+this.fadedExtensions.end,tw)):(yield(0,ex.KU)(e,0,tw),yield(0,ex.KU)(e,1,tw))}}function ty(e){e.geometries=[]}let tM=(0,ew.Ue)(),tw=(0,G.Ue)(),tS=(0,G.Ue)(),tx=(0,ex.Ue)();(n=m||(m={}))[n.LINE=0]="LINE",n[n.RAY=1]="RAY",n[n.GROUND_RAY=2]="GROUND_RAY",n[n.FADED=3]="FADED";let tO={start:1/3,end:1/3};var tE=i(30730);class tD extends eU{constructor(e){super(e),this._location=(0,G.Ue)(),this._direction=(0,G.al)(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=(0,eM.al)(1,0,1,1),this._renderOccluded=tf.yD.OccludeAndTransparent,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:tC,recreateGeometry:(e,t)=>this._recreateObject3DGeometry(e,t),cameraChanged:()=>this._updateGeometry(),forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:tP,recreateGeometry:e=>this._recreateDrapedGeometry(e),forEachMaterial:(e,t)=>t(e.material)}}get location(){return this._location}set location(e){(0,H.q)(this._location,e)||((0,H.c)(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){(0,H.q)(this._direction,e)||((0,H.c)(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){(0,H.n)(this._direction,(0,H.d)(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){(0,ey.a)(e,this._color)||((0,ey.c)(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}_createObject3DResources(e){let t=new tv.U(this.materialParameters),i=[];return this._createObject3DGeometry(t,e,i),{material:t,geometries:i}}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,i){let[n,a]=tT(e);t.addGeometry(n),t.addGeometry(a),i.push(n),i.push(a),this._updateVerticesObject3D(t)}_createDrapedResources(){let e=new tv.U(this.materialParameters),t=(0,L.YP)(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry());return{material:e,geometries:this._createDrapedGeometry(e),pixelRatioHandle:t}}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){let t=tT(e);return this._updateVerticesDraped(t),t.map(e=>new tm.z(e))}_updateMaterial(){let{materialParameters:e}=this;this.object3dResources.resources?.material.setParameters(e),this.drapedResources.resources?.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{let e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){let t=this.view.state.camera;t.projectToScreen(this.location,tU),(0,H.f)(tR,this.location,this.direction),t.projectToScreen(tR,tV),(0,J.Fv)(tV,(0,J.$X)(tV,tV,tU)),this._updateVertexAttributesObject3D(t,e,0,tU,tV,1),this._updateVertexAttributesObject3D(t,e,1,tU,tV,-1)}_updateVertexAttributesObject3D(e,t,i,n,a,r){let s=t.geometries[i],o=s.getMutableAttribute(e2.T.POSITION)?.data;if(!o)return;let{start:l,end:c}=tA(a,n,r,this.offset,this.width,this.length);e.unprojectFromScreen((0,k.c$)(l),tR),o[0]=tR[0],o[1]=tR[1],o[2]=tR[2],e.unprojectFromScreen((0,k.c$)(c),tR),o[3]=tR[0],o[4]=tR[1],o[5]=tR[2],t.geometryVertexAttributeUpdated(s,e2.T.POSITION)}_updateVerticesDraped(e){let{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:i}}}=this,{location:n,width:a,length:r,offset:s}=this;tz.spatialReference=t.renderer.spatialReference,tz.x=n[0],tz.y=n[1];let o=this.view.overlayPixelSizeInMapUnits(tz)*i,l=a*o,c=r*o,h=s*o;this._updateVertexAttributesDraped(e[0],l,c,h,-1),this._updateVertexAttributesDraped(e[1],l,c,h,1)}_updateVertexAttributesDraped(e,t,i,n,a){let r=e.getMutableAttribute(e2.T.POSITION)?.data;if(!r)return;let{location:s,direction:o}=this,{start:l,end:c}=tA(o,s,a,n,t,i);r[0]=l[0],r[1]=l[1],r[2]=t_.gi,r[3]=c[0],r[4]=c[1],r[5]=t_.gi,e.invali
179dateBoundingInfo()}}function tT(e){return[(0,tg.rh)(e,[(0,G.Ue)(),(0,G.Ue)()]),(0,tg.rh)(e,[(0,G.Ue)(),(0,G.Ue)()])]}function tA(e,t,i,n,a,r){let s=(0,J.bA)(tI,(0,J.t8)(tI,e[1]*i,-(e[0]*i)),n+a/2),o=(0,J.IH)(tj,(0,J.IH)(tj,(0,J.IH)(tj,t,(0,J.bA)(tj,e,r/2)),s),s);return{start:o,end:(0,J.IH)(tL,o,(0,J.bA)(tL,e,-r))}}function tC(e){e.geometries.length=0}function tP(e){e.pixelRatioHandle.remove(),e.geometries=[]}let tR=(0,G.Ue)(),tI=(0,$.Ue)(),tj=(0,$.Ue)(),tL=(0,$.Ue)(),tU=(0,k.s1)(),tV=(0,k.s1)(),tz=(0,tE.T)(0,0,void 0,null);var tH=i(11271),tG=i(73526),tN=i(51013);class tF extends eR{constructor(e){super(e),this._resources=null,this._transform=(0,tN.Ue)()}get object(){return null!=this._resources?this._resources.object:null}get transform(){return this._transform}set transform(e){(0,tG.JG)(this._transform,e),null!=this._resources&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(null==this._resources)return;let e=this._resources.object;e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible}createResources(){this.destroyResources();let e=this.view.stage;if(!e)return;let t=new ej.F(e,{pickable:!1,updatePolicy:eA.j.SYNC}),i=new eI.T({castShadow:!1});i.transformation=this._transform,this.createExternalResources(),this.createGeometries(i),t.add(i),i.visible=this.visible,this._resources={layer:t,object:i}}destroyResources(){let e=this.view.stage;null!=this._resources&&e&&(this._resources.layer.destroy(),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){null!=this._resources&&(this._resources.object.visible=e)}}var tk=i(94906),tZ=i(32282),tW=i(49527),tY=i(64329);class tB extends tF{constructor(e){super(e),this._material=null,this._texture=null,this._geometry=null,this._size=3,this._color=(0,eM.al)(1,0,1,1),this._pixelSnappingEnabled=!0,this._primitive="square",this._outlineSize=1,this._outlineColor=(0,eM.al)(1,1,1,1),this._elevationInfo=null,this.applyProperties(e)}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){if(e!==this._size){let t=this._preferredTextureSize;this._size=e,t<this._preferredTextureSize?this.recreate():this._updateSizeAttribute()}}get color(){return this._color}set color(e){(0,ey.a)(e,this._color)||((0,ey.c)(this._color,e),this._updateMaterial())}get pixelSnappingEnabled(){return this._pixelSnappingEnabled}set pixelSnappingEnabled(e){this._pixelSnappingEnabled!==e&&(this._pixelSnappingEnabled=e,this._updateMaterial())}get primitive(){return this._primitive}set primitive(e){this._primitive!==e&&(this._primitive=e,this.recreate())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){(0,ey.a)(e,this._outlineColor)||((0,ey.c)(this._outlineColor,e),this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}_updateMaterial(){this._material?.setParameters(this._materialParameters)}_updateSizeAttribute(){let e=this.object;if(null==e)return;let t=e.geometries[0];if(null==t)return;let i=t.getMutableAttribute(e2.T.SIZE).data,n=this._geometrySize;i[0]=n,i[1]=n,e.geometryVertexAttributeUpdated(e.geometries[0],e2.T.SIZE)}get _materialParameters(){return{color:this._color,textureIsSignedDistanceField:!0,sampleSignedDistanceFieldTexelCenter:(0,tW.Rg)(this._primitive),distanceFieldBoundingBox:tW.ER,occlusionTest:!1,outlineColor:this._outlineColor,outlineSize:this._outlineSize,textureId:this._texture?.id,polygonOffset:!1,shaderPolygonOffset:0,drawAsLabel:!0,depthEnabled:!1,pixelSnappingEnabled:this.pixelSnappingEnabled,isDecoration:this.isDecoration}}get _geometrySize(){return this._size/tW.hy}createExternalResources(){this._texture=(0,tW.cU)(this._primitive,this._preferredTextureSize),this._material=new tY.A(this._materialParameters,this.view.state.viewingMode===eV.JY.Global);let e=this.view.stage;this._texture.load(e.renderView.renderingContext),e.addTexture(this._texture)}destroyExternalResources(){this._texture&&(this.view.stage.removeTexture(this._texture),this._texture.dispose(),this._texture=null),this._material=null}createGeometries(e){let t=this._createRenderGeometry();null!=t&&e.addGeometry(t)}forEachMaterial(e){e(this._material)}get _preferredTextureSize(){return(0,X.uZ)(2*this._geometrySize,16,128)}
179calculateMapBounds(e){let t=this.object?.geometries[0];if(!t)return!1;let i=t.attributes.get(e2.T.POSITION).data;return(0,eb.S)(i,this.view.renderCoordsHelper.spatialReference,tX,this.view.spatialReference),(0,tH.G1)(e,tX),!0}_createRenderGeometry(){let{geometry:e,_material:t}=this;if(null==e||null==t)return null;let{renderCoordsHelper:i,elevationProvider:n}=this.view,a=(0,tk.w7)(e,n,tZ.o.fromElevationInfo(this.elevationInfo),i),r=(0,H.i)(ee.WM.get(),e.x,e.y,a),s=ee.WM.get();(0,eb.S)(r,e.spatialReference,s,i.spatialReference);let o=this._geometrySize;return(0,tg.dV)(t,{position:s,size:[o,o],centerOffsetAndDistance:[0,0,0,1]})}}let tX=(0,G.Ue)();var tq=i(75703),tQ=i(48662),tJ=i(23430);class t$ extends eU{constructor(e){super(e),this._maxSize=0,this._position=(0,G.Ue)(),this._up=(0,G.Ue)(),this._right=(0,G.Ue)(),this._renderOccluded=tf.yD.OccludeAndTransparent,this._color=(0,eM.al)(1,0,0,1),this._outlineColor=(0,eM.al)(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=tf.yD.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D(),forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:tK,forEachMaterial:(e,t)=>{t(e.outlineMaterial),t(e.quadMaterial)}}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateOutlineMaterial(),this._updateQuadMaterial()}get color(){return this._color}set color(e){(0,ey.c)(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){(0,ey.c)(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){let t=0===this._outlineSize!=(0===e);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:i}){this._maxSize=Math.min((0,H.j)(t,e),(0,H.j)(t,i))/3,(0,H.n)(this._up,(0,H.d)(this._up,e,t)),(0,H.n)(this._right,(0,H.d)(this._right,i,t)),(0,H.c)(this._position,t),this.recreateGeometry()}_createObject3DResources(e){let t=new tJ.E(this._quadMaterialParameters),i=0===this._outlineSize?void 0:new tv.U(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,i),{quadMaterial:t,outlineMaterial:i}}_createObject3DGeometries(e,t,i){if(!((0,H.q)(this._up,G.AG)&&(0,H.q)(this._right,G.AG))){for(let n of this._createGeometries(t,i))e.addGeometry(n);this._updateTransformObject3D(e)}}_createDrapedResources(){let e=new tJ.E(this._quadMaterialParameters),t=0===this._outlineSize?void 0:new tv.U(this._outlineMaterialParameters),i=this._createGeometries(e,t).map(e=>new tm.z(e));return this._setTransformDraped(i),{quadMaterial:e,outlineMaterial:t,geometries:i,pixelRatioHandle:(0,L.YP)(()=>this.view.state.contentPixelRatio,()=>this.drapedResources.recreateGeometry())}}_createGeometries(e,t){let{up:i,right:n,corner:a}=this._getVertices(),r=new tQ.Z(e,[[e2.T.POSITION,new tq.a([0,0,0,...n,...i,...a],[0,1,2,1,2,3],3,!0)]]);return t?[r,(0,tg.rh)(t,[i,a,n])]:[r]}_getVertices(){let e=this._up,t=this._right,i=(0,H.f)(ee.WM.get(),e,t);return this.isDraped&&(e=(0,H.c)(ee.WM.get(),e),t=(0,H.c)(ee.WM.get(),t),e[2]=0,t[2]=0,i[2]=0),{up:e,right:t,corner:i}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;let t=this.view.state.camera,i=this._size*t.computeScreenPixelSizeAt(this._position),n=Math.min(this._maxSize,i);(0,tG.vc)(t0,this._position),(0,tG.bA)(t0,t0,[n,n,n]),e.transformation=t0}_setTransformDraped(e){if(0===e.length)return;let{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:i}}}=this,{_position:n,_size:a}=this,r=(0,H.c)(ee.WM.get(),n);r[2]=t_.gi,t1.spatialReference=t.renderer.spatialReference,t1.x=r[0],t1.y=r[1];let s=this.view.overlayPixelSizeInMapUnits(t1)*i*a,o=Math.min(this._maxSize,s);for(let t of((0,tG.vc)(t0,r),(0,tG.bA)(t0,t0,[o,o,1]),e))t.transformation=t0}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){this.object3dResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters),this.drapedResources.resources?.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){this.object3dResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters),this.drapedResources.resources?.outlineMaterial?.setParameters(this._outlineMaterialParameters)}}function tK(e){e.pixelRatioHandle.remove(),e.geometries=[]}let t0=(0,tN.Ue)(),t1=(0,tE.T)(0,0,void 0,null);var t2=i(80242),t3=i(35519),t4=i(57734),t5=i(94554),t9=i(64719),t8=i(82169);class t6 extends t9.a{sortUniqueHints(e){return e.sort((e,t)=>
179(t instanceof t8.w?t.length:0)-(e instanceof t8.w?e.length:0))}visualizeIntersectionPoint(e,t){let{spatialReference:i,view:n}=t,a=t7(t);return(0,I.ed)(new tB({view:n,primitive:"circle",geometry:(0,t2.Ju)(e.intersectionPoint,i),elevationInfo:e.isDraped?N.tR:N.jG,size:20,outlineSize:2,color:a.intersectionPointColor,outlineColor:a.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,t){let{view:i,spatialReference:n}=t,a=t7(t),r=ie(e.point,e.domain,t);return(0,I.ed)(new tB({view:i,primitive:"circle",geometry:(0,t2.Ju)(r,n),elevationInfo:it(e),size:20,outlineSize:2,color:a.pointColor,outlineColor:a.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,t){let{view:i,spatialReference:n}=t,a=t7(t),r=ie(e.lineStart,e.domain,t),s=ie(e.lineEnd,e.domain,t);return(0,I.ed)(function(e,t,i,n,a,r,s,o=!1,l=!0,c=!0){let h=ii(t,n,a,r,o),d=ii(i,n,a,r,o),u=new tb({view:r,extensionType:m.FADED,start:h,end:d,isDraped:o,color:s.lineColor,renderOccluded:o?tf.yD.OccludeAndTransparent:tf.yD.Opaque,renderGroup:eD.eZ.SnappingHint,isDecoration:!0});switch(e){case t5.ze.TARGET:u.width=t3.c.lineHintWidthTarget,u.fadedExtensions={start:0,end:t3.c.lineHintFadedExtensions};break;case t5.ze.REFERENCE_EXTENSION:u.width=t3.c.lineHintWidthReference,u.fadedExtensions={start:0,end:0};break;case t5.ze.REFERENCE:u.width=t3.c.lineHintWidthReference,u.fadedExtensions={start:l?t3.c.lineHintFadedExtensions:0,end:c?t3.c.lineHintFadedExtensions:0}}return u.attached=!0,u}(e.type,r,s,n,it(e),i,a,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,t){let{view:i,spatialReference:n}=t,a=t7(t),{isDraped:r}=e,s=it(e),o=ie(e.lineStart,e.domain,t),l=ie(e.lineEnd,e.domain,t),c=ii(o,n,s,i,r),h=ii(l,n,s,i,r),d=(0,H.m)(h,c,h,.5),u=new tD({view:i,attached:!1,offset:t3.c.parallelLineHintOffset,length:t3.c.parallelLineHintLength,width:t3.c.parallelLineHintWidth,color:a.parallelSignColor,location:d,renderOccluded:r?tf.yD.OccludeAndTransparent:tf.yD.Opaque,isDraped:r,renderGroup:eD.eZ.SnappingHint,isDecoration:!0});return u.setDirectionFromPoints(c,d),u.attached=!0,(0,I.ed)(u)}visualizeRightAngleQuad(e,t){let{view:i,spatialReference:n}=t,a=t7(t),r=it(e),{isDraped:s}=e,o=ie(e.previousVertex,e.domain,t),l=ie(e.centerVertex,e.domain,t),c=ie(e.nextVertex,e.domain,t),h=ii(o,n,r,i,s),d=ii(l,n,r,i,s),u=ii(c,n,r,i,s);return(0,I.ed)(new t$({view:i,attached:!0,color:s?a.rightAngleColorDraped:a.rightAngleColor,renderOccluded:s?tf.yD.OccludeAndTransparent:tf.yD.Transparent,outlineRenderOccluded:s?tf.yD.OccludeAndTransparent:tf.yD.Opaque,outlineColor:a.rightAngleOutlineColor,outlineSize:t3.c.rightAngleHintOutlineSize,size:t3.c.rightAngleHintSize,isDraped:s,geometry:{previous:h,center:d,next:u},renderGroup:eD.eZ.SnappingHint,isDecoration:!0}))}}function t7(e){let{effectiveTheme:t}=e.view,i=W.Z.toUnitRGBA(t.accentColor),n=[0,0,0,0];return{intersectionPointColor:n,intersectionPointOutlineColor:i,pointColor:n,pointOutlineColor:i,lineColor:i,lineOutlineColor:void 0,parallelSignColor:i,rightAngleColor:i,rightAngleColorDraped:W.Z.toUnitRGBA((0,R.G)(t.accentColor,.5)),rightAngleOutlineColor:i}}function ie(e,t,{selfSnappingZ:i,view:n,spatialReference:a}){return 0!=(t&t4.B.SELF)&&(0,t2.hx)(e)&&null!=i?(0,t2.Vx)(e,i,n,a):e}function it(e){return e.isDraped?N.tR:N.jG}function ii(e,t,i,n,a){let r=(0,G.Ue)();if(a){let i=n.basemapTerrain.overlayManager.renderer.spatialReference;(0,eb.S)(e,t,r,i)}else(0,Z.R)(e,t,i,n,r);return r}var ia=i(14273);function ir(e){let t=e.graphic;return t?[(0,L.YP)(()=>"visible"in e?e.visible:e.displaying,e=>{e&&t.notifyMeshTransformChanged({action:ia.u.EnableFastUpdates})},{...L.tX}),(0,I.kB)(()=>t.notifyMeshTransformChanged({action:ia.u.DisableFastUpdates}))]:[]}var is=i(71379);function io(e,t){t&&Object.assign(e,t)}class il{constructor(e){this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=tf.yD.Opaque,this.color=e.accent}}class ic{constructor({colors:e,...t}){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=e.accent,this.outlineColor=e.outline,this.renderOccluded=tf.yD.Opaque,this.hoverOutlineColor=e.selectedOutline,io(this,t)}
179applyColor(e){this._apply(this.color,e)}applyOutline(e){this._apply(this.outlineColor,e)}applyHoverOutline(e){this._apply(this.hoverOutlineColor,e)}_apply(e,t){t.setParameters({color:(0,R.O)(e),renderOccluded:this.renderOccluded})}}class ih{constructor({colors:e,...t}){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.renderOccluded=tf.yD.Transparent,this.minSquaredEdgeLength=900,this.color=(0,R.G)(e.accent,.5),this.hoverColor=e.accent,io(this,t)}applyColor(e){this._apply(this.color,e)}applyHover(e){this._apply(this.hoverColor,e)}_apply(e,t){t.setParameters({color:(0,R.O)(e),renderOccluded:this.renderOccluded})}}class id{constructor(e){this.vertex=new ic({colors:e,color:e.accent,outlineColor:e.outline}),this.edge=new ic({colors:e,color:(0,R.vG)((0,R.G)(e.accent,2/3),.5),outlineColor:(0,R.G)(e.outline,.5),size:8,collisionPadding:8}),this.selected=new ic({colors:e,color:e.selected,outlineColor:e.outline}),this.edgeOffset=new ih({colors:e})}}class iu{constructor({colors:e,...t}){this.width=1.5,this.stipplePattern=(0,is.z5)(3.3),this.falloff=0,this.innerWidth=1.5,this.renderOccluded=tf.yD.OccludeAndTransparent,this.color=e.selected,this.stippleOffColor=e.outline,this.innerColor=e.selected,io(this,t)}
179apply(e){e.color=(0,R.O)(this.color),e.width=this.width,e.stipplePattern=this.stipplePattern,e.stippleOffColor=(0,R.O)(this.stippleOffColor),e.falloff=this.falloff,e.innerWidth=this.innerWidth,e.innerColor=(0,R.O)(this.innerColor),e.renderOccluded=this.renderOccluded}}class ip{constructor({colors:e,...t}){this.size=4,this.outlineSize=1,this.shape="square",this.color=e.selected,this.outlineColor=e.outline,io(this,t)}apply(e){e.color=(0,R.O)(this.color),e.size=this.size,e.outlineSize=this.outlineSize,e.outlineColor=(0,R.O)(this.outlineColor),e.primitive=this.shape}}class i_{constructor({colors:e,...t}){this.innerWidth=1,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=.3,this.globalAlphaContrastBoost=1.5,this.radius=3,this.innerColor=e.selected,this.glowColor=e.accent,this.heightFillColor=e.accent,io(this,t)}apply(e,t=1){let i={glowColor:W.Z.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:W.Z.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*t*this.glowColor.a,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=i:e.laserlineStyle=i}}class ig{constructor(e){this.outline=new iu({colors:e,color:e.stippleOff,renderOccluded:tf.yD.OccludeAndTransparentStencil,stippleOffColor:e.stippleOn,innerWidth:0}),this.staged=new iu({colors:e,color:e.stippleOn,renderOccluded:tf.yD.OccludeAndTransparentStencil,innerColor:e.stagedSolid,stippleOffColor:e.stippleOff}),this.shadowStyle=new i_({colors:e,globalAlpha:.3,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:1})}}class im{constructor(e){this.outline=new ip({colors:e,color:e.selected,outlineColor:e.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new i_({colors:e,globalAlpha:.3,glowColor:e.accent,glowFalloff:1.5,glowWidth:6,innerColor:e.selected,innerWidth:1,radius:2})}}class iv extends iu{constructor({colors:e,...t}){super({colors:e}),this.extensionType=m.GROUND_RAY,io(this,t)}}class ib{constructor(e){this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,this.lineObjects=new ig(e),this.pointObjects=new im(e),this.heightPlane=new i_({colors:e,globalAlpha:.3,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:1}),this.heightBox=new i_({colors:e,globalAlpha:.3,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:0,heightFillColor:e.accent}),this.zVerticalLine=new iv({colors:e,color:(0,R.G)(e.accent,.5),falloff:2,innerColor:(0,R.G)(e.selected,0),renderOccluded:tf.yD.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:m.GROUND_RAY})}}let iy=class extends Y.Z{constructor(e){super(e)}get colors(){let e=this.getTheme().accentColor,t=e.a;return{accent:e,contrast:(0,R.mj)(e),selected:W.Z.fromArray([255,255,255,t]),selectedOutline:W.Z.fromArray([255,255,255,t]),staged:W.Z.fromArray([12,207,255,t]),stagedSolid:W.Z.fromArray([12,207,255,1]),outline:W.Z.fromArray([0,0,0,.5*t]),stippleOn:W.Z.fromArray([255,255,255,1]),stippleOff:W.Z.fromArray([0,0,0,.5])}}get visualElements(){return new ib(this.colors)}get manipulators(){return new id(this.colors)}get zManipulator(){return new il(this.colors)}};(0,P._)([(0,U.Cb)()],iy.prototype,"colors",null),(0,P._)([(0,U.Cb)()],iy.prototype,"visualElements",null),(0,P._)([(0,U.Cb)()],iy.prototype,"manipulators",null),(0,P._)([(0,U.Cb)()],iy.prototype,"zManipulator",null),(0,P._)([(0,U.Cb)()],iy.prototype,"getTheme",void 0),iy=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.settings")],iy);var iM=i(83126),iw=i(49956),iS=i(6144),ix=i(28461);class iO extends eU{constructor(e){super(e),this._attachmentOrigin=(0,tE.T)(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new iM.Z,this._geometry=null,this._width=1,this._color=(0,eM.al)(1,0,1,1),this._innerWidth=0,this._innerColor=(0,eM.al)(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=tf.yD.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=e.view.spatialReference,this._laserline=new tu({view:e.view,isDecoration:e.isDecoration}),this.applyProperties(e),this.attached=e.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:e=>this._createObject3DResources(e),destroyResources:iE,recreateGeometry:(e,t)=>{e.geometries.length=0,this._recreateGeometry(t,e.material,e.geometries)}
179,forEachMaterial:(e,t)=>t(e.material)}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:iE,recreateGeometry:e=>{e.geometries=this._createRenderGeometriesDraped(e.material),this._attachmentOriginChanged()},forEachMaterial:(e,t)=>t(e.material)}}get _laserlineAttached(){return this.attached&&this.visible&&null!=this._laserlineStyle&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get isDecoration(){return this._isDecoration}set isDecoration(e){this._isDecoration=e,this._updateMaterial()}get geometry(){return this._geometry}set geometry(e){let t=this._isClosed;this._geometry=e,this.recreateGeometry(),t!==this._isClosed&&this._updateMaterial()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){(0,ey.a)(e,this._color)||((0,ey.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){(0,ey.a)(e,this._innerColor)||((0,ey.c)(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){let t=null!=e!=(null!=this._stipplePattern);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&(0,ey.a)(e,this._stippleOffColor)||(this._stippleOffColor=e?(0,eM.d9)(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,null!=e&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){if(!this._attachmentOriginDirty)return this._attachmentOrigin;let e=this.object3dResources.resources?.geometries;if(!e||0===e.length)return null;(0,H.i)(iT,0,0,0);let t=0;for(let i of e)i.computeAttachmentOrigin(iD)&&((0,H.f)(iT,iT,iD),t++);return 0===t?null:((0,H.g)(iT,iT,1/t),this.view.renderCoordsHelper.fromRenderCoords(iT,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources?.material.setParameters(this._materialParameters),this.drapedResources.resources?.material.setParameters(this._materialParameters)}get _isClosed(){return null!=this.geometry&&"polygon"===this.geometry.type}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===tf.yD.OccludeAndTransparentStencil?tf.yD.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,i){for(let n of(this._createRenderGeometries(t,i),i))e.addGeometry(n);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_createObject3DResources(e){let t=new tv.U(this._materialParameters),i=[];return this._recreateGeometry(e,t,i),{material:t,geometries:i}}_createDrapedResources(){let e=new tv.U(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){let{geometry:t,view:i}=this,n=i.basemapTerrain.spatialReference;return null==t||null==n?[]:(0,ix.r)(t,n).lines.map(({position:t})=>{let a={overlayInfo:{spatialReference:n,renderCoordsHelper:i.renderCoordsHelper},attributeData:{position:t},removeDuplicateStartEnd:this._isClosed};return new tm.z((0,iS.Y)(e,a))})}
179calculateMapBounds(e){if(null==this.object3dResources.resources)return!1;let t=this.view.renderCoordsHelper;for(let i of this.object3dResources.resources.geometries){let n=i.attributes.get(e2.T.POSITION),a=(0,eq.bg)(n.data.length);(0,iw.projectBuffer)(n.data,t.spatialReference,0,a,this.view.spatialReference,0),(0,tH.G1)(e,a)}return!0}_createRenderGeometries(e,t){let i=this.geometry;if(null==i)return;let n=(0,ix.V)(i,this.view.elevationProvider,this.view.renderCoordsHelper,tZ.o.fromElevationInfo(this.elevationInfo??new F.Z({mode:(0,N.VW)(i,null)}))),a=[];for(let{position:i,mapPositions:r}of n.lines){let n={mapPositions:r,attributeData:{position:i},removeDuplicateStartEnd:this._isClosed};t.push((0,iS.Y)(e,n)),a.push(i)}this._laserline.pathVerticalPlane=a}}function iE(e){e.geometries=[]}let iD=(0,G.Ue)(),iT=(0,G.Ue)();var iA=i(41500),iC=i(48940),iP=i(73748),iR=i(1861),iI=i(68375),ij=i(81637),iL=i(98987),iU=i(40482),iV=i(95789),iz=i(12018);class iH extends ek.A{constructor(e,t){super(e,t,new eF.J(iz.S,()=>i.e(78424).then(i.bind(i,78424))),iG)}initializePipeline(e){let{oitPass:t,output:i,transparent:n,cullFace:a,shadingEnabled:r}=e,s=t===iU.M.NONE,o=t===iU.M.FrontFace;return(0,eW.sm)({blending:(0,iC.c1)(i)&&n?(0,iV.Wo)(t):null,culling:(0,eW.zp)(a),depthTest:{func:o?eB.wb.LESS:r?eB.wb.LEQUAL:eB.wb.LESS},depthWrite:(0,iV.W$)(e),drawBuffers:(0,iV.u_)(t,i),colorWrite:eW.gf,polygonOffset:s||o?null:iV.E0})}}let iG=new Map([[e2.T.POSITION,0],[e2.T.NORMAL,1],[e2.T.OFFSET,2]]);var iN=i(50488),iF=i(93448),ik=i(28165);class iZ extends ik.W{constructor(){super(...arguments),this.cullFace=tl.Vr.None,this.transparent=!1,this.writeDepth=!0,this.screenSizeEnabled=!0,this.shadingEnabled=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.textureCoordinateType=iN.I.None,this.emissionSource=iF.jo.None,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1,this.draped=!1,this.overlayEnabled=!1,this.snowCover=!1}get discardInvisibleFragments(){return this.transparent}}(0,P._)([(0,tr.o)({count:tl.Vr.COUNT})],iZ.prototype,"cullFace",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"transparent",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"writeDepth",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"screenSizeEnabled",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"shadingEnabled",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"terrainDepthTest",void 0),(0,P._)([(0,tr.o)()],iZ.prototype,"cullAboveTerrain",void 0);var iW=i(81430);class iY extends tf.F5{constructor(e){super(e,iX),this._configuration=new iZ,this.vertexAttributeLocations=iG,this.supportsEdges=!0,this._pp0=(0,G.al)(0,0,1),this._pp1=(0,G.al)(0,0,0),this.produces=new Map([[iI.r.OPAQUE_MATERIAL,e=>e===iC.H_.Highlight||(0,iC.CQ)(e)&&!this.parameters.transparent],[iI.r.TRANSPARENT_MATERIAL,e=>(0,iC.CQ)(e)&&this.parameters.transparent&&this.parameters.writeDepth],[iI.r.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>(0,iC.CQ)(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.oitPass=t.oitPass,this._configuration.terrainDepthTest=t.terrainDepthTest&&(0,iC.c1)(e),this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration}get visible(){return this.parameters.color[3]>=iW.e}intersect(e,t,i,n,a,r){this._intersect(e,i,n,a,r)}intersectDraped(e,t,i,n){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(e,t,this._pp0,this._pp1,n)}_intersect(e,t,i,n,a){if(this.parameters.screenSizeEnabled){let r=e.attributes.get(e2.T.OFFSET);(0,iR.Bw)(e,t,i,n,{applyToVertex:(e,i,n,a)=>{let s=(0,H.i)(iQ,r.data[3*a],r.data[3*a+1],r.data[3*a+2]),o=(0,H.i)(iJ,e,i,n);return(0,H.g)(s,s,this.parameters.screenSizeScale*(t.camera?.computeScreenPixelSizeAt(s)??1)),(0,H.f)(o,o,s),[o[0],o[1],o[2]]},applyToAabb:e=>{let i=(0,tH.be)(e,iQ);return(0,tH.bA)(e,this.parameters.screenSizeScale*(t.camera?.computeScreenPixelSizeAt(i)??1))}},a)}else(0,iR.Bw)(e,t,i,n,void 0,a)}createGLMaterial(e){return new iB(e)}createBufferWriter(){return new iq(this.parameters.screenSizeEnabled)}}class iB extends iP.Z{beginSlot(e){return this.getTechnique(iH,e)}}class iX extends tf.Mt{constructor(){super(...arguments),this.color=(0,eM.al)(1,1,1,1),this.shadingTint=(0,eM.al)(0,0,0,.25),this.shadingDirection=(0,H.n)((0,G.Ue)(),[.5,-.5,-.5
179]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=tl.Vr.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class iq{constructor(e){this.screenSizeEnabled=e;let t=(0,eJ.U$)().vec3f(e2.T.POSITION).vec3f(e2.T.NORMAL);this.screenSizeEnabled&&t.vec3f(e2.T.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.get(e2.T.POSITION).indices.length}write(e,t,i,n,a,r){let s=(0,iL.NK)(i,n,this.vertexBufferLayout,e,t,a,r);if(this.screenSizeEnabled){if(!i.has(e2.T.OFFSET))throw Error(`${e2.T.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{let e=i.get(e2.T.OFFSET);(0,ij.hu)(3===e.size);let n=a.getField(e2.T.OFFSET,iA.ct);if(!n)throw Error("unable to acquire view for "+e2.T.OFFSET);(0,iL.ho)(e,t,n,r)}}return s}}let iQ=(0,G.Ue)(),iJ=(0,G.Ue)();class i$ extends tF{constructor(e){super(e),this.view=null,this._renderOccluded=tf.yD.OccludeAndTransparent,this._vertices=null,this._spatialReference=null,this._color=(0,eM.nI)([1,127/255,0,1]),this._size=11,this._outlineColor=(0,eM.nI)([0,0,0,.5]),this._outlineSize=1,this._elevationInfo=null,this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial(),this._updateOutlineMaterial())}get vertices(){return this._vertices}set vertices(e){this._vertices=e,this.recreateGeometry()}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.recreateGeometry()}get color(){return this._color}set color(e){(0,ey.a)(e,this._color)||((0,ey.c)(this._color,e),this._updateMaterial())}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){(0,ey.a)(e,this._outlineColor)||((0,ey.c)(this._outlineColor,e),this._updateOutlineMaterial())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateOutlineMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get _vertexMaterialParameters(){return{color:this._color,screenSizeScale:this.size,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}get _vertexOutlineMaterialParameters(){return{color:this._outlineColor,screenSizeScale:this.size+2*this.outlineSize,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateMaterial(){this.attached&&this._vertexMaterial.setParameters(this._vertexMaterialParameters)}_updateOutlineMaterial(){this.attached&&this._vertexOutlineMaterial.setParameters(this._vertexOutlineMaterialParameters)}_createRenderGeometries(){let e=this.vertices;if(null==e||0===e.length)return[];let t=function(e,t,i,n,a){let r=(0,eq.bg)(3*e.length),s=(0,eq.bg)(r.length);e.forEach((e,t)=>{r[3*t]=e[0],r[3*t+1]=e[1],r[3*t+2]=e.length>2?e[2]:0});let o=(0,tk.rR)(r,t,0,s,0,r,0,r.length/3,i,n,a);return{numVertices:e.length,position:r,mapPositions:s,projectionSuccess:null!=o,sampledElevation:o}}(e,this.spatialReference,this.view.elevationProvider,this.view.renderCoordsHelper,tZ.o.fromElevationInfo(this.elevationInfo)),i=[],n=t.numVertices,a=t.position;for(let e=0;e<n;++e){let t=(0,H.i)(iK,a[3*e],a[3*e+1],a[3*e+2]),n=i0(this._vertexMaterial,.5,t),r=i0(this._vertexOutlineMaterial,.5,t);i.push({vertexGeometry:n,vertexOutlineGeometry:r})}return i}createGeometries(e){for(let{vertexGeometry:t,vertexOutlineGeometry:i}of this._createRenderGeometries())e.addGeometry(t),e.addGeometry(i)}createExternalResources(){this._vertexMaterial=new iY({...this._vertexMaterialParameters,writeDepth:!0,cullFace:tl.Vr.Back,screenSizeEnabled:!0}),this._vertexOutlineMaterial=new iY({...this._vertexOutlineMaterialParameters,forceTransparentMode:!0,writeDepth:!0,cullFace:tl.Vr.Front,screenSizeEnabled:!0,shadingEnabled:!1})}destroyExternalResources(){this._vertexMaterial=null,this._vertexOutlineMaterial=null}forEachMaterial(e){e(this._vertexMaterial),e(this._vertexOutlineMaterial)}}let iK=(0,G.Ue)();function i0(e,t,i){return(0,tg.PI)(e,t,16,16,{offset:i})}var i1=i(48234),i2=i(69291),i3=i(21951),i4=i(13724),i5=i(84434),i9=i(42313);let i8=class extends i2.T{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new iy({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){let{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new F.Z({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){let t=e.hasZ??!0;return{...e,elevationInfo:(0,N.mF)(t)}}return e}initializeGraphic(e){let{view:t}=this,i=this._createGraphicState=new i1.F({graphic:e});return(0,I.AL)([t.maskOccludee(e),t.trackGraphicState(i),(0,L.YP)(()=>({element:this._outlineVisualElement,isDraped:i.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},L.tX),(0,i9.EH)(()=>{(0,i5.Jo)(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(i),...ir(i)])}makeDrawOperation(){let{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new i3.wW({view:this.view,manipulators:this.manipulators,geometryType:(0,i2.I)(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new i4.iW(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new i4.aL(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new t6,segmentLabels:t?new em:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===(0,N.Zz)(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){let{view:t}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),(0,I.kB)();let i=this._settings,n=i.manipulators.vertex,a=new i$({view:t,spatialReference:t.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:n.size,outlineSize:n.outlineSize,renderOccluded:n.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=a;let r=new tb({view:t,extensionType:i.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=r;let s=(0,I.AL)([(0,L.YP)(()=>i.visualElements.zVerticalLine,e=>e.apply(r),L.nn),(0,L.YP)(()=>({selectedColor:(0,R.O)(i.colors.selected),outlineColor:(0,R.O)(i.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{a.color=e,a.outlineColor=t},L.nn),(0,I.kB)(()=>{this._activeVertexVisualElement=(0,j.SC)(this._activeVertexVisualElement),this._verticalLineVisualElement=(0,j.SC)(this._verticalLineVisualElement)})]);return a.attached=!0,this._updateVerticalLineVisualElement(e),s}_updateVerticalLineVisualElement(e){let t=this._verticalLineVisualElement;if(!t)return;let{renderCoordsHelper:i,elevationProvider:n}=this.view;(0,H.i)(i7,e[0],e[1],e[2]),i6.setFromElevationInfo(this.elevationInfo),i7[2]=(0,tk.w7)(i7,n,i6,i),i.toRenderCoords(i7,this.view.spatialReference,i7)?(t.setStartEndFromWorldDownAtLocation(i7),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,(0,I.kB)();let t=this.internalGraphicsLayer.elevationInfo,{view:i}=this,n=this._settings,a=new iO({view:i,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===(0,N.Zz)(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=a;let r=(0,I.AL)([(0,L.YP)(()=>n.visualElements.lineObjects.outline,e=>e.apply(a),L.nn),(0,L.YP)(()=>n.visualElements.lineObjects.shadowStyle,e=>e.apply(a),L.nn),(0,I.kB)(()=>{this._outlineVisualElement=(0,j.SC)(this._outlineVisualElement)})]);return a.attached=!0,a.laserlineEnabled=!0,r}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,(0,I.kB)();let{view:t}=this,i=this._settings,n=i.manipulators.vertex,a=new i$({view:t,spatialReference:t.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:n.size,outlineSize:n.outlineSize,renderOccluded:n.renderOccluded,attached:!1,isDecoration:!0}),r=(0,I.AL)([(0,L.YP)(()=>({color:(0,R.O)(i.manipulators.vertex.color),outlineColor:(0,R.O)(i.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{a.color=e,a.outlineColor=t},L.nn),(0,I.kB)(()=>{this._verticesVisualElement=(0,j.SC)(this._verticesVisualElement)})]);return a.attached=!0,this._verticesVisualElement=a,r}updateGraphicGeometry(e){if("mesh"!==this.geometryType||"point"!==e?.type)super.updateGraphicGeometry(e);else{let t=this.geometryToPlace;t?.centerAt(e),(0,i5.Jo)(this.tooltipInfos.mesh,t);let i=this._graphic;t&&i.geometry===t||(i.geometry=t)}}_setupLoadingIndicator(e){let t;let{drawOperation:i}=this;if(!this.geometryToPlace)return i.loading=!1,null;i.loading=!0;let n=(0,I.kB)(()=>{i.loading=!1}),a=()=>t&&cancelAnimationFrame(t);return(0,I.AL)([(0,L.gx)(()=>
179e.displaying,()=>{a(),t=requestAnimationFrame(()=>n.remove())},{...L.tX,once:!0}),(0,I.kB)(a),n])}};(0,P._)([(0,U.Cb)({constructOnly:!0})],i8.prototype,"elevationInfo",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],i8.prototype,"geometryType",void 0),(0,P._)([(0,U.Cb)()],i8.prototype,"type",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],i8.prototype,"view",void 0),i8=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],i8);let i6=new tZ.o,i7=(0,G.Ue)();var ne=i(78177),nt=i(50037),ni=i(49091),nn=i(58413),na=i(8727),nr=i(79482),ns=i(59597);function no(e){if(null==e||"polyline"!==e.type&&"polygon"!==e.type)return 0;let t="polyline"===e.type?e.paths:e.rings,i=(0,ns.bn)();for(let e of t)for(let t=0;t<e.length-1;t++){let n=e[t],a=e[t+1],r=n[0]-a[0],s=n[1]-a[1];if(r*r+s*s>i)return Math.atan2(a[1]-n[1],a[0]-n[0])}return 0}var nl=i(3792);function nc(e){return e?.operations?.data.geometry}function nh(e,t){return!!e?.data.coordinateHelper.hasZ()&&"on-the-ground"!==t.mode&&!(0,N.fl)(t)}var nd=i(6788),nu=i(84399);function np(e,t,i){function n(){let e=i(),t=e.sketchOptions.tooltips.effectiveEnabled?e.activeTooltipInfo:null;return{...e,activeTooltipInfo:t}}let a=!1;function r(e){a||(a=!0,e(),a=!1)}function s({activeTooltipInfo:i,sketchOptions:n,scaleRotateTransform:a}){r(()=>{i&&(i.sketchOptions=n,nf(i,t),function(e,t){if("transform-point"!==e?.type)return;if(!t)return e.orientation.actual=void 0,e.size.actual=void 0,e.orientation.visible=!1,void(e.size.visible=!1);let i=t.mode,{size:n,orientationClockwise:a}=t.adapter,{visualVariables:r}=e.sketchOptions.tooltips,s=r?.rotation,o=null!=a&&(null==i||"rotate"===i);e.orientation.actual=o?(0,ni.GJ)(a,"radians","geographic"):void 0,e.orientation.precision=nv(s?.valueType),e.orientation.visible=o;let l=r?.size,c=null!=n&&(null==i||"scale"===i);e.size.actual=c?(0,ni.yG)(n,l?.unit??"meters"):void 0,e.size.precision=nv(l?.valueType),e.size.visible=c}(i,a)),e.info=i})}return(0,I.AL)([(0,L.YP)(n,s,L.tX),(0,L.YP)(()=>{let e=n(),{activeTooltipInfo:i}=e;if(i)return{context:e,activeTooltipInfo:i,key:i.key,geometry:nc(t)}},(e,i)=>{e&&i&&i.key!==e.key&&r(()=>n_(t,e.context))},L.Z_),t.on("committed",()=>{queueMicrotask(()=>s(n()))}),(0,i5.OE)(e,{onBeforePaste:()=>{a=!0},onAfterPaste:()=>{n_(t,n()),a=!1}})])}function n_(e,{activeTooltipInfo:t,callbacks:i}){if(!t)return;i.onBeforeUpdate();let n=nc(e);switch(n?.type){case"mesh":ng(t,n.origin,e,i),"orientation"in t&&"scale"in t&&(0,i5.Jo)(t,n,i);break;case"point":ng(t,n,e,i)}}function ng(e,t,i,n){let{dx:a,dy:r,dz:s}=(0,i5.$4)(e,t);0===a&&0===r&&0===s||(n.onMoveStart(),i.operations?.move(a,r,s,nd.b.NEW_STEP),n.onMove(a,r,s),n.onMoveStop())}function nf(e,t){let i=nc(t),n=i?.type;if(!e||!i||"mesh"!==n&&"point"!==n)return;let a="mesh"===n,r=a?i.origin:i;e.setLocationFromPoint(r),nm(e,r,t),"transform-mesh"===e.type&&a&&(0,i5.kJ)(e,i),e.clearInputValues()}function nm(e,t,i){e.elevation.actual=(0,nu.un)(t),e.elevation.visible=!!i.operations?.data.coordinateHelper.hasZ(),e.elevation.readOnly=!1,e.elevation.showAsZ=!0}function nv(e){switch(e){case"integer":case"long":return 0;default:return null}}var nb=i(55812),ny=i(52669),nM=i(9418),nw=i(84804),nS=i(22736),nx=i(35325),nO=i(34515),nE=i(88860),nD=i(58485),nT=i(13671),nA=i(84728);function nC(e,t,i=(0,eO.Ue)()){return nP(e,(0,k.md)(t),i),(0,H.n)(i.direction,i.direction),i}function nP(e,t,i){return function(e,t,i){let n=(0,k.Wv)((0,J.JG)(ee.WM.get(),t));if(n[2]=0,!e.unprojectFromRenderScreen(n,i.origin))return null;let a=(0,k.Wv)((0,J.JG)(ee.WM.get(),t));a[2]=1;let r=e.unprojectFromRenderScreen(a,ee.WM.get());return null==r?null:((0,H.d)(i.direction,r,i.origin),i)}(e,e.screenToRender(t,(0,k.Wv)(ee.WM.get())),i)}var nR=i(4717),nI=i(67864);class nj{constructor(e){this.metadata=void 0,this._camera=new nR.Z,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=[],this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=(0,tN.Ue)(),this._worldFrame=null,this._renderLocation=(0,G.Ue)(),this._renderLocationDirty=!0,this._location=new nr.Z({x:0,y:0,z:0}),this._elevationAlignedLocation=new nr.Z,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=nI.jg.None,this._focused=!1,this.events=new iM.Z.EventEmitter,this._screenLocation={screenPointArray:(0,k.s1)(),renderScreenPointArray:(0,k.J$)(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);let t=this.view.state?.camera;t&&this._camera.copyFrom(t)}destroy(){this._applyObjectTransform=nQ,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),(0,I.kB)(()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){nL(e)&&(this._screenLocationDirty=!0),(0,tG.JG)(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=(0,tN.Ue)()),function(e,t,i){switch(e.viewingMode){case"local":return(0,tG.yR)(i),!0;case"global":{let n=(0,nw.Iu)(e.renderCoordsHelper.spatialReference);
179return(0,nO.PR)(t,0,nk,0,n.radius),(0,nx.q)((0,X.Vl)(nk[0]),(0,X.Vl)(nk[1]),i),!0}}}(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){(0,nT.WG)(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty&&(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation()),this._elevationAlignedLocation}set elevationAlignedLocation(e){(0,nT.WG)(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){let e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=(0,nT.D)(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){let e;if(this._screenLocationDirty){if(this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1,nL(this._modelTransform)){let t=this._calculateModelTransformOffset(nX);e=(0,H.f)(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;let i=(0,k.md)(e,nU),n=this._getCollisionRadius(t),a=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if((0,J.bI)(this.screenLocation.screenPointArray,i)<n*n)return this.screenLocation.renderScreenPointArray[2]+a;break;case"line":{let e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),r=this._calculateObjectTransform(t,nN),s=n*this.screenLocation.pixelSize,o=nP(this._camera,i,nz);if(null==o)return null;for(let t of e){if(0===t.length)continue;let e=(0,H.t)(nk,t[0],r);for(let i=1;i<t.length;i++){let n=(0,H.t)(nZ,t[i],r),l=(0,ex.Gr)((0,ex.zk)(e,n,nV),o);if(null!=l&&l<s*s){let t=(0,H.f)(ee.WM.get(),e,n);(0,H.g)(t,t,.5);let i=(0,k.So)(ee.WM.get());return this._camera.projectToRenderScreen(t,i),i[2]+a}(0,H.c)(e,n)}}break}case"disc":{let e=this.collisionType.direction,t=this.collisionType.offset??G.AG,r=this._getWorldToScreenObjectScale(),s=this._calculateObjectTransform(r,nN),o=n*this.screenLocation.pixelSize,l=nP(this._camera,i,nz);if(null==l)return null;
179let c=(0,ny.xO)(nH,s),h=(0,H.o)(nY,e,c),d=(0,H.t)(nB,t,s);if((0,nD.Yq)(d,h,nF),(0,nD.BR)(nF,l,nW)&&(0,H.s)(nW,d)<o*o)return this.screenLocation.renderScreenPointArray[2]+a;break}case"ribbon":{let{paths:e,direction:t}=this.collisionType,r=this._getWorldToScreenObjectScale(),s=this._calculateObjectTransform(r,nN),o=n*this._camera.computeScreenPixelSizeAt(this.renderLocation),l=nP(this._camera,i,nz);if(null==l)return null;let c=(0,ny.xO)(nH,s),h=(0,H.o)(nY,t,c),d=this._calculateModelTransformPosition(nB);if((0,nD.Yq)(d,h,nF),!(0,nD.BR)(nF,l,nW))break;for(let t of e){if(0===t.length)continue;let e=(0,H.t)(nk,t[0],s);for(let i=1;i<t.length;i++){let n=(0,H.t)(nZ,t[i],s),r=(0,ex.Jk)((0,ex.zk)(e,n,nV),nW);if(null!=r&&r<o*o){let t=(0,H.f)(ee.WM.get(),e,n);(0,H.g)(t,t,.5);let i=(0,k.So)(ee.WM.get());return this._camera.projectToRenderScreen(t,i),i[2]+a}(0,H.c)(e,n)}}break}default:(0,eN.Bg)(this.collisionType)}return null}attach(e={manipulator3D:{}}){let t=this._stage;if(!t)return;let i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new ej.F(t,{pickable:!1,updatePolicy:eA.j.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),(0,nS.canProjectWithoutEngine)(this._location.spatialReference,this.view.spatialReference)||(this.location=new nr.Z({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){let t=e.manipulator3D;t.engineLayerReferences--;let i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,(0,j.SC)(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){(0,nS.projectPoint)(this.location,nq,e.spatialReference)&&(0,nE.Qn)(e.extent,nq)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0,i=(0,N.ap)(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=(0,nA.KO)(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=((0,nA.KO)(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=((0,nA.KO)(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();let e=this._getWorldToScreenObjectScale();if(!0===this.autoScaleRenderObjects){let t=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(t,nN)}else this._calculateObjectTransform(e,nN);let{objectsByState:t}=this._ensureEngineResources(),i=(this.focused?nI.Q9.Focused:nI.Q9.Unfocused)|(this.selected?nI.Q9.Selected:nI.Q9.Unselected),n=this._noDisplayCount>0;for(let{stateMask:e,objects:a}of t){if(n){for(let e of a)e.visible=!1;continue}let t=(e&nI.Q9.All)!==nI.Q9.None,r=(e&nI.jg.All)!==nI.jg.None,s=!t||(i&e)==(e&nI.Q9.All),o=!r||(this.state&e)==(e&nI.jg.All);if(s&&o)for(let e of a)e.visible=!0,e.transformation=nN;else for(let e of a)e.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){let e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach(({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))});let n=new Map;this._renderObjects.forEach(e=>{let t=new eI.T({castShadow:!1,geometries:[e.geometry]}),i=n.get(e.stateMask)||[];i.push(t),n.set(e.stateMask,i)});let a=[];n.forEach((e,t)=>a.push({stateMask:t,objects:e})),this._engineResources={objectsByState:a,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){let e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;let{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.addMany(e)),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){let e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;let{objectsByState:t,layer:i}=this._engineResources;t.forEach(({objects:e})=>i.removeMany(e)),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){let t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,nG);return(0,H.i)(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){let t=this._calculateModelTransformPosition(e);return(0,H.d)(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return(0,tG.t8)(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&(0,tG.Jp)(t,t,this._worldFrame),(0,tG.Jp)(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function nL(e){return 0!==e[12]||0!==e[13]||0!==e[14]}let nU=(0,k.s1)(),nV=(0,ex.Ue)(),nz=(0,eO.Ue)(),nH=(0,nM.Ue)(),nG=(0,tN.Ue)(),nN=(0,tN.Ue)(),nF=(0,nD.Ue)(),nk=(0,G.Ue)(),nZ=(0,G.Ue)(),nW=(0,G.Ue)(),nY=(0,G.Ue)(),nB=(0,G.Ue)(),nX=(0,G.Ue)(),nq=new nr.Z({x:0,y:0,z:0,spatialReference:null}),nQ=()=>{};(a=v||(v={}))[a.NONE=0]="NONE",a[a.ANY=1]="ANY",a[a.Z=2]="Z",a[a.XY=4]="XY",(r=b||(b={}))[r.TRANSLATE_Z=0]="TRANSLATE_Z",r[r.TRANSLATE_XY=1]="TRANSLATE_XY",r[r.SCALE=2]="SCALE",r[r.ROTATE=3]="ROTATE",r[r.SCALE_ROTATE=4]="SCALE_ROTATE";class nJ{constructor(){this.grabbingState=v.NONE,this.zManipulator=null,this.firstSelected=null,this.numSelected=0,this.firstGrabbedXY=null}update(e){this.grabbingState=v.NONE,this.zManipulator=null,this.numSelected=0,this.firstSelected=null,this.firstGrabbedXY=null,e.forEachManipulator((e,t)=>{if(t===b.TRANSLATE_Z&&(this.zManipulator=e),e instanceof nj&&(e.selected&&(0===this.numSelected&&(this.firstSelected=e),this.numSelected++),null==this.firstGrabbedXY&&e.grabbing&&t===b.TRANSLATE_XY&&(this.firstGrabbedXY=e)),e.grabbing)switch(this.grabbingState|=v.ANY,t){case b.TRANSLATE_Z:this.grabbingState|=v.Z;break;case b.TRANSLATE_XY:this.grabbingState|=v.XY}})}}function n$(e){return null!=e&&("polygon"===e.type||"polyline"===e.type)}let nK=(0,G.Ue)();var n0=i(327);function n1(e){return null==e?null:"point"===e.type?e:"mesh"===e.type?e.origin.clone():null}let n2=(0,G.Ue)(),n3=(0,tH.Ue)();function n4(e){switch(nc(e.object)?.type){case"point":case"mesh":return function(e){let t=[],i=function(e,t){let{view:i,object:n}=e,a=new tB({view:i,geometry:n1(nc(n)),elevationInfo:n.elevationInfo,isDecoration:!0});return function(e,t,i){let{view:n,object:a}=e,r=new iy({getTheme:()=>n.effectiveTheme});(function(e,t,i){let{view:n,object:a}=e,r=null,s=e=>{null!=r&&(r.remove(),r=null),a.isDraped&&null!=e&&(r=function(e,t,i){let n=e.elevationProvider.spatialReference;(0,n0.K)(t,n2,n);let a=n2[0],r=n2[1];return e.elevationProvider.on("elevation-change",e=>{(0,nE.jE)(e.extent,a,r)&&i()})}(n,e,()=>{t.geometry=e}))},o=()=>{let e=n1(nc(a));null!=e&&(0,N.AA)(a.elevationInfo)&&(e.z=0),s(e),t.geometry=e};
179i.push(a.on("committed",o),(0,I.iU)(()=>r)),o()})(e,t,i),r.visualElements.pointObjects.outline.apply(t),i.push((0,L.YP)(()=>a.visible,()=>{t.attached=a.visible},L.nn))}(e,a,t),t.push((0,I.ed)(a)),a}(e,t);return function(e,t,i){let{view:n,object:a}=e,r=new iy({getTheme:()=>n.effectiveTheme}),s=new tb({view:n,extensionType:r.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0});t.push((0,L.YP)(()=>r.visualElements.zVerticalLine,e=>e.apply(s),L.nn));let o=new tu({view:n,intersectsLineInfinite:!0,attached:!1,isDecoration:!0}),l=new tu({view:n,attached:!1,angleCutoff:(0,X.Vl)(r.visualElements.heightPlaneAngleCutoff),isDecoration:!0}),c=a.elevationInfo,h=tZ.o.fromElevationInfo(c),d="on-the-ground"===c.mode||!c.offset&&"absolute-height"!==c.mode,u=new nJ,p=(0,nb.t)(1);t.push((0,L.YP)(()=>({heightPlane:r.visualElements.heightPlane,alpha:p.value}),({heightPlane:e,alpha:t})=>e.apply(l,t),L.nn));let _=(0,nb.t)(1);t.push((0,L.YP)(()=>({shadowStyle:r.visualElements.pointObjects.shadowStyle,alpha:_.value}),({shadowStyle:e,alpha:t})=>e.apply(o,t),L.nn));let g=()=>{u.update(e);let t=n1(nc(a)),c=d&&(a.isDraped||null==t||!t.hasZ),g=!0;if(c||null==t)g=!1;else{(0,N.AA)(a.elevationInfo)&&((t=t.clone()).z=0);let e=(0,tk.w7)(t,n.elevationProvider,h,n.renderCoordsHelper);(0,H.i)(n2,t.x,t.y,e),(0,eb.S)(n2,t.spatialReference,n2,n.renderCoordsHelper.spatialReference),s.setStartEndFromWorldDownAtLocation(n2),o.intersectsWorldUpAtLocation=n2}let f=u.grabbingState&v.Z?r.visualElements.laserlineAlphaMultiplier:1;p.value=f;let m=(0,tH.cS)(n3);!c&&a.visible&&i.calculateMapBounds(m)&&(0,eb.S)((0,tH.KE)(m,n2),n.spatialReference,n2,n.renderCoordsHelper.spatialReference)?(l.heightManifoldTarget=n2,l.attached=!0):l.attached=!1;let b=u.grabbingState&v.XY?r.visualElements.laserlineAlphaMultiplier:1;_.value=b;let y=g&&a.visible&&!c;o.attached=y,s.attached=y};t.push((0,L.YP)(()=>[a.visible,a.isDraped],g),a.on("committed",g)),e.forEachManipulator(e=>{t.push(e.events.on("grab-changed",g))}),t.push((0,I.ed)(o)),t.push((0,I.ed)(s)),t.push((0,I.ed)(l)),g()}(e,t,i),{visualElement:i,remove:()=>(0,I.R5)(t)}}(e);case"polygon":case"polyline":return function(e){let{object:t}=e,i=function(e){let{view:t,object:i}=e,n=nc(i),a=new iO({view:t,geometry:n$(n)?n:null,elevationInfo:i.elevationInfo,attached:!1,isDecoration:!0}),r=new iy({getTheme:()=>t.effectiveTheme}),s=()=>{a.attached=i.visible},o=(0,I.AL)([(0,L.YP)(()=>r.visualElements.lineObjects.outline,e=>e.apply(a),L.nn),(0,L.YP)(()=>r.visualElements.lineObjects.shadowStyle,e=>e.apply(a),L.nn),(0,L.YP)(()=>i.visible,s),(0,L.YP)(()=>i.isDraped,e=>{a.isDraped=e},L.nn),i.on("committed",()=>{let e=nc(i);a.geometry=n$(e)?e:null}),(0,I.ed)(a)]);return s(),{visualElement:a,remove:()=>o.remove()}}(e),n=[i,function(e,t){let{object:i,view:n}=e,a=[],r=i.elevationInfo,s="on-the-ground"===r.mode||!r.offset&&"absolute-height"!==r.mode,o=new nJ,l=new iy({getTheme:()=>n.effectiveTheme}),c=l.visualElements,h=new tb({view:n,extensionType:c.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0}),d=new tu({view:n,attached:!1,angleCutoff:(0,X.Vl)(c.heightPlaneAngleCutoff),isDecoration:!0}),u=(0,nb.t)(1);a.push((0,L.YP)(()=>({lineShadowStyle:l.visualElements.lineObjects.shadowStyle,pointShadowStyle:l.visualElements.pointObjects.shadowStyle,alpha:u.value}),({lineShadowStyle:e,pointShadowStyle:i,alpha:n})=>{e.apply(t,n),i.apply(h,n)},L.nn));let p=(0,nb.t)(1);a.push((0,L.YP)(()=>({heightPlane:l.visualElements.heightPlane,alpha:p.value}),({heightPlane:e,alpha:t})=>e.apply(d,t),L.nn));let _=()=>{o.update(e);let n=nc(i);if(!i.visible||s&&(i.isDraped||!n$(n)||!n.hasZ))return t.laserlineEnabled=!1,h.attached=!1,void(d.attached=!1);t.laserlineEnabled=!0;let a=o.grabbingState&v.XY?c.laserlineAlphaMultiplier:1;u.value=a;let r=o.grabbingState&v.Z?c.laserlineAlphaMultiplier:1;p.value=r,function(e,t){let i=1===t.numSelected?t.firstSelected:t.numSelected>1&&null!=t.firstGrabbedXY?t.firstGrabbedXY:null;null!=i?(e.setStartEndFromWorldDownAtLocation(i.renderLocation),e.attached=!0):e.attached=!1}(h,o),function(e,t,i,n){if(n.numSelected>0){(0,H.i)(nK,0,0,0);let t=0;e.forEachManipulator((e,i)=>{i===b.TRANSLATE_XY&&e.selected&&e instanceof nj&&((0,H.f)(nK,nK,e.renderLocation),t++)}),t>0?(i.heightManifoldTarget=(0,H.g)(nK,nK,1/t),i.attached=!0):i.attached=!1}else{let n=t.attachmentOrigin;null!=n&&e.view.renderCoordsHelper.toRenderCoords(n,nK)?(i.heightManifoldTarget=nK,i.attached=!0):i.attached=!1}}(e,t,d,o)};a.push((0,L.YP)(()=>l.visualElements.zVerticalLine,e=>e.apply(h),L.nn)),a.push(i.on("committed",_),(0,L.YP)(()=>i.visible,_),t.events.on("attachment-origin-changed",_),(0,I.ed)(h),(0,I.ed)(d));let g=[],f=()=>{(0,I.R5)(g),g.length=0,e.forEachManipulator(e=>g.push(e.events.on("grab-changed",_))),e.forEachManipulator(e=>g.push(e.events.on("select-changed",_))),_()};return f(),a.push(e.onManipulatorsChanged(f),(0,I.iU)(()=>(0,I.AL)(g))),(0,I.AL)(a)}(e,i.visualElement)];
179return t.maskOccludee&&n.push(t.maskOccludee()),{visualElement:i.visualElement,remove:()=>(0,I.R5)(n)}}(e);default:return null}}let n5=Math.ceil(70/3*2),n9=5*Math.PI/12,n8=1*Math.PI/3;var n6=i(20506);class n7{constructor(){this._available=!0}set location(e){this._forEachManipulator3D(t=>t.location=e)}set elevationAlignedLocation(e){this._forEachManipulator3D(t=>t.elevationAlignedLocation=e)}set elevationInfo(e){this._forEachManipulator3D(t=>t.elevationInfo=e)}get renderLocation(){let e;return this._forEachManipulator3D(t=>{e||(e=t.renderLocation)}),e}set renderLocation(e){this._forEachManipulator3D(t=>t.renderLocation=e)}get available(){return this._available}set available(e){this._available=e,this._forEachManipulator3D(t=>t.available=e)}get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}get selected(){return this.someManipulator(e=>e.selected)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}_forEachManipulator3D(e){this.forEachManipulator((t,i)=>{t instanceof nj&&e(t,i)})}}class ae extends n7{constructor(){super(...arguments),this._interactive=!0}get interactive(){return this._interactive}set interactive(e){this._interactive!==e&&(this._interactive=e),this._updateManipulatorInteractivity()}_updateManipulatorInteractivity(){let e=!this.grabbing&&this._interactive;this.forEachManipulator(t=>{t.interactive=e||t.grabbing})}}class at{constructor(e,t=nI.Q9.None){this.geometry=e,this.stateMask=t}}var ai=i(80434);i(58180),i(52280),i(82292),i(6357);var an=i(65653);function aa(e,t){return ar(e,()=>t)}function ar(e,t){let i=(0,G.Ue)(),n=(0,G.Ue)(),a=!1;return r=>{let s=t(r);if("start"===r.action){let t=(0,k.md)(r.screenStart,(0,k.c$)(ee.qW.get())),n=nP(e.state.camera,t,ad);null!=n&&(a=(0,nD.BR)(s,n,i))}if(!a)return null;let o=(0,k.md)(r.screenEnd,(0,k.c$)(ee.qW.get())),l=nP(e.state.camera,o,ad);return null==l?null:(0,nD.BR)(s,l,n)?{...r,renderStart:i,renderEnd:n,plane:s,ray:l}:null}}function as(e,t,i,n=null,a=null){return function(e,t,i=0,n=null,a=null){let r=null;return s=>{if("start"===s.action&&null!=(r=e.sceneIntersectionHelper.intersectElevationFromScreen((0,k.s1)(s.screenStart.x,s.screenStart.y),t,i,a))&&null!=n&&!(0,nS.projectPoint)(r,r,n)||null==r)return null;let o=e.sceneIntersectionHelper.intersectElevationFromScreen((0,k.s1)(s.screenEnd.x,s.screenEnd.y),t,i,a);return null!=o&&(null==n||(0,nS.projectPoint)(o,o,n))?{...s,mapStart:r,mapEnd:o}:null}}(e,i,(0,N.Ou)(t,e,i),n,a)}function ao(e,t,i){let n=null,a=new an.hM;return a.next(aa(e,function(e,t){let i=(0,nD.Ue)();e.renderCoordsHelper.worldUpAtPosition(t,ac);let n=(0,H.h)((0,nD.st)(i),ac,(0,H.d)(ah,t,e.state.camera.eye));return(0,H.h)(n,n,ac),(0,nD.Yq)(t,n,i)}(e,t))).next(function(e,t){let i=(0,G.Ue)(),n=(0,H.l)(t);e.renderCoordsHelper.worldUpAtPosition(t,i);let a=(0,G.Ue)(),r=(0,G.Ue)(),s=a=>((0,H.d)(a,a,t),(0,ai.nF)(i,a,a),"global"===e.viewingMode&&(0,H.l)(a)*Math.sign((0,H.e)(i,a))<.001-n&&(0,H.d)(a,(0,H.g)(a,i,.001),t),(0,H.f)(a,a,t),a);return e=>(e.renderStart=s((0,H.c)(a,e.renderStart)),e.renderEnd=s((0,H.c)(r,e.renderEnd)),e)}(e,t)).next(al(e,i)).next(e=>{e.mapEnd.x=e.mapStart.x,e.mapEnd.y=e.mapStart.y,n=e}),e=>(n=null,a.execute(e),n)}function al(e,t){let i=e.renderCoordsHelper;return e=>{let n=i.fromRenderCoords(e.renderStart,new nr.Z({spatialReference:t})),a=i.fromRenderCoords(e.renderEnd,new nr.Z({spatialReference:t}));return null!=n&&null!=a?{...e,mapStart:n,mapEnd:a}:null}}(s=y||(y={}))[s.GROUND=0]="GROUND",s[s.OTHER=1]="OTHER",(0,$.Ue)();let ac=(0,G.Ue)(),ah=(0,G.Ue)(),ad=(0,eO.Ue)();function au(e,t,i){let n=(i,n)=>{t({action:i,object:e,dxScreen:n.screenDeltaX,dyScreen:n.screenDeltaY})};return i((t,i,a)=>(i.next(e=>("start"===e.action&&n("start",e),e)).next((0,an.$Q)(e)).next(e=>{switch(e.action){case"start":case"update":(e.translationX||e.translationY||e.translationZ)&&n("update",e);break;case"end":n("end",e)}return e}),{steps:i,cancel:a=a.next((0,an.uI)(e)).next(e=>(n("end",{screenDeltaX:0,screenDeltaY:0}),e))}))}function ap(e){if(null==e?.axis)return 1;let{mapStart:t,mapEnd:i,axis:n}=e,a=[i.x-t.x,i.y-t.y];return a[0]*n[0]+a[1]*n[1]>0?1:-1}class a_ extends n7{constructor(e){super(),this._handles=new n6.Z,this._arrowManipulatorInfos=[],this._angle=0,this._scale=1,this._radius=70,this._updateAfterDrag=!1,this.events=new iM.Z,this._tool=e.tool,this._view=e.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),null!=e.radius&&(this._radius=e.radius),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}set orthogonalAvailable(e){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=e,this._arrowManipulatorInfos[3].manipulator.available=e)}destroy(){this._handles=(0,j.SC)(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(e){for(let{manipulator:t}of this._arrowManipulatorInfos)e(t,b.TRANSLATE_XY)}createManipulatedObjectDragPipeline(e,t,i){if(!t.operations)return(0,I.kB)();let n=t.operations.data.spatialReference,a=t.graphic;return au(t,i,i=>
179this.createDragPipeline((t,n,a,r,s)=>({steps:n,cancel:a}=e(t,n,a,r,s),i(t,n,a)),t.elevationInfo,n,a))}createDragPipeline(e,t,i,n){return(0,I.AL)(this._arrowManipulatorInfos.map(({manipulator:a},r)=>(0,an.Xd)(a,(a,s,o,l,c)=>{let h=s.next(e=>({...e,manipulatorType:b.TRANSLATE_XY})).next((0,an.kY)(this._view,a.elevationAlignedLocation)).next(as(this._view,a.elevationAlignedLocation,t,i,n)).next((0,an.M2)(a.location,this.angle+(r+1)*Math.PI*.5)).next((0,an.zh)());e(a,h,o,l,c)})))}get angle(){return this._angle}set angle(e){this._angle=e,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(e){this._radius!==e&&(this._radius=e,this._updateManipulators())}_updateManipulators(){for(let e=0;e<this._arrowManipulatorInfos.length;e++)this._updateArrowManipulator(this._arrowManipulatorInfos[e],e);this._updateManipulatorTransform()}_updateArrowManipulator({manipulator:e,transform:t},i){let n=this._radius/70,a=54*n,r=a*Math.sqrt(3)/2,s=(0,tg.DA)(this._opaqueMaterial,r,a/2,a/2,.02);(0,tg.mx)(s,(0,tG.vc)(ee.MP.get(),(0,H.i)(ee.WM.get(),0,-r/3,0))),e.renderObjects=[new at(s,nI.Q9.Focused),new at(s.instantiate({material:this._transparentMaterial}),nI.Q9.Unfocused)],e.radius=r/3*2.4;let o=(0,tG.QO)(ee.MP.get(),i*Math.PI/2),l=(0,tG.vc)(ee.MP.get(),(0,H.i)(ee.WM.get(),0,100*n,0));(0,tG.Jp)(t,o,l)}_createManipulators(){for(let e=0;e<4;e++){let t=this._createArrowManipulator(e);this._arrowManipulatorInfos.push(t)}this._updateManipulatorTransform()}_updateManipulatorTransform(){let e=this.angle,t=(0,tG.Us)(ee.MP.get(),e,(0,G.al)(0,0,1));if(null==t)return;let i=(0,tG.xJ)(ee.MP.get(),(0,H.i)(ee.WM.get(),this.displayScale,this.displayScale,this.displayScale)),n=(0,tG.Jp)(ee.MP.get(),i,t);for(let e of this._arrowManipulatorInfos){let t=(0,tG.Jp)(ee.MP.get(),n,e.transform);e.manipulator.modelTransform=t}}_createArrowManipulator(e){let t=new nj({view:this._view,autoScaleRenderObjects:!1,worldOriented:!0,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:(0,G.al)(0,0,1)}}),i={manipulator:t,transform:(0,tN.Ue)()};return this._updateArrowManipulator(i,e),this._handles.add(t.events.on("drag",e=>{this._updateAfterDrag&&"end"===e.action&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),i}_createMaterial(e=1){let t=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Transparent,isDecoration:!0});return this._handles.add((0,L.YP)(()=>W.Z.toUnitRGBA(this._view.effectiveTheme.accentColor),i=>{i[3]*=e,t.setParameters({color:i})},L.nn)),t}get test(){}}class ag{constructor(){this._view=null,this._elevationInfo=null,this._lastDragEvent=null,this._next=null,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&null!=this._lastDragEvent&&null!=this._next){let t=this._lastDragEvent.mapEnd,i=this._snap(this._lastDragEvent.screenEnd);if(null!=i){let n={action:"update",mapStart:this._lastDragEvent.mapStart,mapEnd:!0===e?i:t,screenStart:this._lastDragEvent.screenEnd,screenEnd:this._lastDragEvent.screenEnd};this._next.execute(n)}}this._enabled=e}_snap(e){let t=null!=this._view?this._view.toMap(e,{exclude:[]}):null;return null!=t&&null!=this._view&&(t.z=(0,N.Ou)(t,this._view,this._elevationInfo)),t}createDragEventPipelineStep(e,t){this._view=e,this._elevationInfo=t,this._lastDragEvent=null;let i=new an.hM;return this._next=i,[e=>{if(this._lastDragEvent="end"!==e.action?{...e}:null,this._enabled){let t=this._snap(e.screenEnd);return null!=t?{action:e.action,mapStart:e.mapStart,mapEnd:t,screenStart:e.screenStart,screenEnd:e.screenEnd}:null}return{action:e.action,mapStart:e.mapStart,mapEnd:e.mapEnd,screenStart:e.screenStart,screenEnd:e.screenEnd}},i]}}class af extends n7{constructor(e){super(),this._handles=new n6.Z,this._snapToScene=new ag,this._scale=1,this._radius=70,this._view=e.view,this._tool=e.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),null!=e.snapToScene&&(this.snapToScene=e.snapToScene),null!=e.radius&&(this._radius=e.radius),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=(0,j.SC)(this._handles),this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(e){e(this._manipulator,b.TRANSLATE_XY)}get displayScale(){return this._scale}set displayScale(e){this._scale=e,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(e){this._snapToScene.enabled=e}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}get discManipulator(){return this._manipulator}createManipulatedObjectDragPipeline(e,t,i){if(!t.operations)return(0,I.kB)();let n=t.graphic,a=t.elevationInfo,r=t.operations.data.spatialReference;return au(t,i,t=>this.createDragPipeline((i,n,a,r,s)=>({steps:n,cancel:a}=e(i,n,a,r,s),t(i,n,a)),a,r,n))}createDragPipeline(e,t,i,n){let a=this._view;return(0,an.Xd)(this._manipulator,(r,s,o,l,c)=>{let h=s.next((0,an.kY)(a,r.elevationAlignedLocation)).next(as(a,r.elevationAlignedLocation,t,i,n)).next(...this._snapToScene.createDragEventPipelineStep(a,t)).next(e=>({...e,manipulatorType:b.TRANSLATE_XY})).next((0,an.zh)());e(r,h,o,l,c)})}_updateManipulatorTransform(){let e=(0,tG.xJ)(ee.MP.get(),(0,H.i)(ee.WM.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=e}_createManipulator(){let e=this._view;this._manipulator=new nj({view:e,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:(0,G.al)(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){let e=(0,tg.nb)(this._discMaterial,.02,1,128,(0,G.al)(0,0,1),(0,G.al)(0,0,0));e.transformation=(0,tG.xJ)((0,tN.Ue)(),(0,G.al)(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new at(e,nI.Q9.Focused),new at(e.instantiate({material:this._discMaterialTransparent}),nI.Q9.Unfocused)],this._manipulator.radius=this._radius/70*80}_createMaterial(e=1){let t=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Transparent,isDecoration:!0});return this._handles.add((0,L.YP)(()=>W.Z.toUnitRGBA(this._view.effectiveTheme.accentColor),i=>{i[3]*=e,t.setParameters({color:i})},L.nn)),t}get test(){}}var am=i(20148);function av(e,t=tf.yD.OccludeAndTransparent,i=!0){let n=(0,R.gp)(e),a=!(e[3]<1);return i?new iY({color:n,writeDepth:a,cullFace:tl.Vr.Back,renderOccluded:t,isDecoration:!0}):new tJ.E({color:n,writeDepth:a,cullFace:tl.Vr.Back,renderOccluded:t,isDecoration:!0})}function ab(e,t=tf.yD.OccludeAndTransparent){let i=(0,R.gp)(e);return new tJ.E({color:i,writeDepth:!0,cullFace:tl.Vr.Front,renderOccluded:t,isDecoration:!0})}let ay=Object.freeze({calloutLength:40,calloutWidth:1,discRadius:27,focusMultiplier:1.1}),aM=Object.freeze({autoScaleRenderObjects:!1,worldSized:!0});function aw(e,t,i,n){let a=(0,H.d)(ee.WM.get(),e,i),r=aS(a,(0,H.h)(ee.WM.get(),n,a),i,ee.MP.get());(0,tG.U_)(r,r);let s=(0,H.t)(ee.WM.get(),t,r);return Math.atan2(s[1],s[0])}function aS(e,t,i,n){let a=(0,H.n)(ee.WM.get(),e),r=(0,H.n)(ee.WM.get(),t),s=(0,H.h)(ee.WM.get(),a,r);return n[0]=a[0],n[1]=a[1],n[2]=a[2],n[3]=0,n[4]=r[0],n[5]=r[1],n[6]=r[2],n[7]=0,n[8]=s[0],n[9]=s[1],n[10]=s[2],n[11]=0,n[12]=i[0],n[13]=i[1],n[14]=i[2],n[15]=1,n}function ax(e,t){let i=t.origin;null==i?function(e,t){if(null==t)return;let i="mesh"===t.type?t.origin:(0,am.zE)(t);null!=i&&(e.location=(0,nT.kB)(i))}(e,nc(t)):e.elevationAlignedLocation=i}class aO extends n7{constructor(e){super(),this._radius=70,this.events=new iM.Z,this._tool=e.tool,this._view=e.view;let t=new iy({getTheme:()=>this._view.effectiveTheme});this._settings=t,null!=e.radius&&(this._radius=e.radius);let i=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:av(aE(i,1,.25),tf.yD.Occlude),materialFocused:av(aE(i,1,0),tf.yD.Occlude),materialOccludedUnfocused:av(aE(i,.7,0),t.zManipulator.renderOccluded),materialOccludedFocused:av(aE(i,.85,0),t.zManipulator.renderOccluded)},this._themeHandle=(0,L.YP)(()=>this._view.effectiveTheme.accentColor,e=>{let t=aE(e,1,.25),i=aE(e,1,0),n=aE(e,.7,0),a=aE(e,.85,0),{materialUnfocused:r,materialFocused:s,materialOccludedUnfocused:o,materialOccludedFocused:l}=this._materials;r.setParameters({color:t}),s.setParameters({color:i}),o.setParameters({color:n}),l.setParameters({color:a})}),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._themeHandle=(0,j.hw)(this._themeHandle),this._manipulator.applyObjectTransform=aC,this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){e(this._manipulator,b.TRANSLATE_Z)}createManipulatedObjectDragPipeline(e,t,i){if(!t.operations)return(0,I.kB)();let n=t.operations.data.spatialReference;return au(t,i,t=>this.createDragPipeline((i,n,a,r,s)=>({steps:n,cancel:a}=e(i,n,a,r,s),t(i,n,a)),n))}createDragPipeline(e,t){let i=this._view;return(0,an.Xd)(this._manipulator,(n,a,r,s,o)=>{let l=a.next(e=>({...e,manipulatorType:b.TRANSLATE_Z})).next(ao(i,n.renderLocation,t)).next((0,an.zh)());e(n,l,r,s,o)})}get radius(){return this._radius}set radius(e){e!==this._radius&&(this._radius=e,this._updateManipulator())}_updateManipulator(){let e=this._settings,t=this._radius/70,i=e.zManipulator.height*t,n=e.zManipulator.coneHeight*t,a=e.zManipulator.coneWidth*t,r=e.zManipulator.width*t,s=[(0,G.al)(0,0,0),(0,G.al)(0,0,i)],o=[(0,G.al)(0,0,0),(0,G.al)(0,0,i+n)],l=(()=>{let e=(0,tN.Ue)();return(0,tG.Iu)(e,e,[0,0,i]),(0,tG.lM)(e,e,Math.PI/2),e})(),{materialUnfocused:c,materialFocused:h,materialOccludedUnfocused:d,materialOccludedFocused:u}=this._materials,p=(0,tg.PD)(c,s,r/2,16,!1),_=(0,tg.QL)(c,n,a/2,16,!1);_.transformation=l,this._manipulator.renderObjects=[new at(_,nI.Q9.Unfocused),new at(p,nI.Q9.Unfocused),new at(_.instantiate({material:h}),nI.Q9.Focused),new at(p.instantiate({material:h}),nI.Q9.Focused),new at(_.instantiate({material:d}),nI.Q9.Unfocused),new at(p.instantiate({material:d}),nI.Q9.Unfocused),new at(_.instantiate({material:u}),nI.Q9.Focused),new at(p.instantiate({material:u}),nI.Q9.Focused)],this._manipulator.radius=r/2+2,this._manipulator.collisionType={type:"line",paths:[o]}}_createManipulator(){let e=this._view,t=new nj({view:e,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,
179cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});t.applyObjectTransform=t=>{let i=e.state.camera;e.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,aD);let n=(0,H.F)(i.eye,aD),a=i.computeRenderPixelSizeAtDist(n),r=(0,H.d)(aT,aD,i.eye);(0,H.n)(r,r),e.renderCoordsHelper.worldUpAtPosition(aD,aA);let s=Math.abs((0,H.e)(r,aA)),o=(0,H.h)(aT,r,aA),l=(0,H.h)(aT,o,aA),c=(0,X.uZ)(s,.01,1),h=1-Math.sqrt(1-c*c)/c/i.fullWidth,d=this._settings,u=this._radius/70,p=d.zManipulator.width*u;(0,H.g)(l,(0,H.n)(l,l),(1/h-1)*n+a*p),t[12]-=aT[0],t[13]-=aT[1],t[14]-=aT[2]},this._manipulator=t,this._updateManipulator()}get test(){}}function aE(e,t,i){let n=(0,R._j)(e,i);return n.a*=t,W.Z.toUnitRGBA(n)}let aD=(0,G.Ue)(),aT=(0,G.Ue)(),aA=(0,G.Ue)(),aC=()=>{};class aP extends ae{constructor(e){super(),this._handles=new n6.Z;let{tool:t,view:i,snapToScene:n,radius:a}=e;this._view=i,this.xyManipulation=new af({tool:t,view:i,snapToScene:n,radius:a}),this.xyAxisManipulation=new a_({tool:t,view:i,radius:a}),this.zManipulation=new aO({tool:t,view:i,radius:a}),this.xyManipulation.available=e.xyAvailable,this.xyAxisManipulation.available=e.xyAxisAvailable,this.zManipulation.available=e.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(e=>this._handles.add(e.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createManipulatedObjectDragPipeline(e,t,i){return(0,I.AL)([this.xyManipulation.createManipulatedObjectDragPipeline((t,i,n,a,r)=>e(M.XY,t,i,n,a,r),t,i),this.xyAxisManipulation.createManipulatedObjectDragPipeline((t,i,n,a,r)=>e(M.XY_AXIS,t,i,n,a,r),t,i),this.zManipulation.createManipulatedObjectDragPipeline((t,i,n,a,r)=>e(M.Z,t,i,n,a,r),t,i)])}createDragPipeline(e,t,i,n){return(0,I.AL)([this.xyManipulation.createDragPipeline((t,i,n,a,r)=>e(M.XY,t,i,n,a,r),t,i,n),this.xyAxisManipulation.createDragPipeline((t,i,n,a,r)=>e(M.XY_AXIS,t,i,n,a,r),t,i,n),this.zManipulation.createDragPipeline((t,i,n,a,r)=>e(M.Z,t,i,n,a,r),i)])}set snapToScene(e){this.xyManipulation.snapToScene=e}set angle(e){this.xyAxisManipulation.angle=e}set radius(e){this.xyAxisManipulation.radius=e,this.xyManipulation.radius=e,this.zManipulation.radius=e}set displayScale(e){this.xyManipulation.displayScale=e,this.xyAxisManipulation.displayScale=e}forEachManipulator(e){this.xyManipulation.forEachManipulator(t=>e(t,b.TRANSLATE_XY)),this.xyAxisManipulation.forEachManipulator(t=>e(t,b.TRANSLATE_XY)),this.zManipulation.forEachManipulator(t=>e(t,b.TRANSLATE_Z))}get _xyAxisVisible(){let e=this.xyManipulation.someManipulator(e=>e.focused)||this.xyAxisManipulation.someManipulator(e=>e.focused);return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerType||e}_autoHideXYAxis(){let e=this.xyAxisManipulation,t=this.xyManipulation;if((0,V.Z)("esri-mobile"))return;let i=[];t.forEachManipulator(e=>i.push(e)),e.forEachManipulator(e=>i.push(e));let n=()=>{let t=[];this._xyAxisVisible||e.forEachManipulator(e=>t.push(e.disableDisplay())),this._handles.remove(aR),this._handles.add(t,aR)};for(let e of i)this._handles.add(e.events.on("focus-changed",n));this._view.inputManager&&this._handles.add((0,L.gx)(()=>this._view.inputManager?.latestPointerType,n)),n()}static radiusForSymbol(e){let t=null!=e&&"point-3d"===e.type&&e.symbolLayers;return t&&t.some(e=>"icon"===e.type)?n5:70}}let aR="disable-xy-axis-display";(o=M||(M={}))[o.XY=0]="XY",o[o.XY_AXIS=1]="XY_AXIS",o[o.Z=2]="Z";class aI extends n7{constructor(e){super(),this._view=e.view,this._tool=e.tool,this._object=e.object,this._manipulator=this._object.createManipulator?.({selectable:!0,cursor:"move"}),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(e){this._manipulator&&e(this._manipulator,b.TRANSLATE_XY)}createManipulatedObjectDragPipeline(e){return au(this._object,e,e=>this.createDragPipeline(e))}createDragPipeline(e){if(!this._manipulator)return(0,I.kB)();let t=this._view;return(0,an.Xd)(this._manipulator,(i,n,a,r,s)=>{let o=this._object.operations?.data.spatialReference;e(i,n.next(e=>o?e:null).next(function(e,t,i,n){let a=i.toMap(e.screenStart);return null!=a?as(t,a,i.elevationInfo,n):null}(s,t,this._object,o)).next((0,an.AN)()).next((0,an.zh)()),a,r,s)})}}var aj=i(77873),aL=i(61574),aU=i(44805),aV=i(89084),az=i(54408),aH=i(97670),aG=i(39538),aN=i(50053),aF=i(80407);let ak=class extends aF.h{constructor(e){super(e),this.type="translate-xy",this.distance=ni.yP}};(0,P._)([(0,U.Cb)()],ak.prototype,"type",void 0),(0,P._)([(0,U.Cb)()],ak.prototype,"distance",void 0),ak=(0,P._)([(0,z.j)("esri.views.interactive.tooltip.infos.TranslateXYTooltipInfo")],ak);let aZ=class extends aF.h{constructor(e){super(e),this.type="translate-z",this.distance=ni.yP}clear(){this.distance=ni.yP}};(0,P._)([(0,U.Cb)()],aZ.prototype,"type",void 0),(0,P._)([(0,U.Cb)()],aZ.prototype,"distance",void 0),aZ=(0,P._)([(0,z.j)("esri.views.interactive.tooltip.infos.TranslateZTooltipInfo")],aZ);class aW{constructor(e){this.objects=e,this.type="move-start"}}class aY{constructor(e,t,i){this.dx=e,this.dy=t,this.objects=i,this.type="move"}}class aB{constructor(e){this.objects=e,this.type="move-stop"}}let aX=Symbol("manipulators"),aq=Symbol("tooltips"),aQ=class extends aL.m{constructor(e){super(e),this._infos=new Map,this.events=new iM.Z,this.objects=new nt.Z,this.enableZ=!0,this.sketchOptions=new aV.Z,this.type="move-3d",this._latestTooltipInfo=null,this._translateTooltipInfo=null,this._translateXYTooltipInfo=null,this._translateZTooltipInfo=null,this._updatingHandles=new na.R,this._moveManipulation=null}initialize(){let{view:e}=this;this.tooltip=(0,i5.vG)(()=>({view:e,options:this.sketchOptions.tooltips})),this.addHandles([this.objects.on("change",e=>
179{e.removed.forEach(e=>this.removeHandles(e)),this._updateObjectInfos(e),this._setupFastTransformUpdates(e.added),this._refreshManipulators()}),this.objects.on("change",()=>this._connectTooltips())]);let t=this.objects.toArray();this._updateObjectInfos({added:t,removed:[]}),this._setupFastTransformUpdates(t),this._refreshManipulators(),this._connectTooltips(),this.finishToolCreation()}destroy(){this.tooltip=(0,j.SC)(this.tooltip),this._moveManipulation=(0,j.SC)(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}onInputEvent(e){if(!this.destroyed&&!(0,i5._i)(e,this.tooltip))return super.onInputEvent(e)}get updating(){return this._updatingHandles.updating}get _shouldShowMovePointTooltip(){let{objects:e}=this;if(1!==e.length)return!1;let t=nc(e.at(0))?.type;return"point"===t||"mesh"===t}get activeTooltipInfo(){return this._shouldShowMovePointTooltip?this._movePointTooltipInfo:this._latestTooltipInfo}reset(){}_updateObjectInfos({added:e,removed:t}){for(let t of e){if((0,aj.Y)(t)!==nl.h.SUPPORTED)continue;let e=new a$(t);this._infos.set(t,e)}for(let e of t)this._infos.delete(e)}_setupFastTransformUpdates(e){for(let t of e){let e=this._infos.get(t);this.addHandles(ir(e.object),t)}}_refreshManipulators(){if(this.removeHandles(aX),this._moveManipulation=(0,j.SC)(this._moveManipulation),this.manipulators.removeAll(),0===this._infos.size)return;let e=Array.from(this._infos.values());this._createManipulators(e),this._createVisualElements(e),this._updateMoveManipulation(e)}_createManipulators(e){for(let t of e){let i=t.object;t.manipulationXY=new aI({tool:this,view:this.view,object:i}),t.manipulationXY.forEachManipulator(e=>{this.addHandles([e.events.on("immediate-click",e=>{this.events.emit("immediate-click",{...e,object:i}),e.stopPropagation()}),e.events.on("grab-changed",({action:e})=>{"start"===e?this._showTooltip(M.XY):this._hideTooltip()})],aX)}),this.addHandles(t.manipulationXY.createDragPipeline((t,i,n,a)=>this._buildDragEventPipeline(e,M.XY,t,i,n,a)),aX)}this._createMoveManipulation(e)}_createMoveManipulation(e){let t=new aP({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===e.length?aP.radiusForSymbol(e[0].object.graphic?.symbol):70});this._moveManipulation=t,t.elevationInfo={mode:"absolute-height",offset:0},t.forEachManipulator(e=>{this.addHandles(e.events.on("immediate-click",i=>{let n=this.objects.at(0);!t.zManipulation.hasManipulator(e)&&1===this.objects.length&&n&&this.events.emit("immediate-click",{...i,object:n}),i.stopPropagation()}),aX)});let i=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._showTooltip(e):this._hideTooltip()}),t.events.on("grab-changed",()=>{this._latestTooltipInfo&&(this._latestTooltipInfo.distance=ni.yP)})],aX)};this._moveManipulation.xyManipulation.forEachManipulator(i(M.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(i(M.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(i(M.Z));let n=()=>this._updateMoveManipulation(e);for(let t of e)this.addHandles([t.object.on("committed",n),(0,L.YP)(()=>t.object.visible,n)],aX);let a=e[e.length-1];this.addHandles(a.object.on("committed",()=>this._updateMoveManipulationAngle(a)),aX);let{object:r}=a,{operations:s}=r;if(s){let i=r.graphic;this.addHandles(t.createDragPipeline((t,i,n,a,r)=>this._buildDragEventPipeline(e,t,i,n,a,r),r.elevationInfo,s.data.spatialReference,i),aX)}this._updateMoveManipulationAngle(a)}_createVisualElements(e){for(let t of e){let i=t.object,n=n4({view:this.view,object:i,forEachManipulator:e=>{t.manipulationXY?.forEachManipulator(e),this._moveManipulation?.forEachManipulator(e)},onManipulatorsChanged:()=>(0,I.kB)()});null!=n&&(t.geometryRepresentation=n.visualElement,t.geometryRepresentation instanceof iO&&this.addHandles([t.geometryRepresentation.events.on("attachment-origin-changed",()=>{t.object.isDraped||this._updateMoveManipulation(e)}),(0,L.YP)(()=>t.object.isDraped,()=>this._updateMoveManipulation(e))],aX),this.addHandles(n,aX))}}_updateMoveManipulationAngle(e){this._moveManipulation&&(this._moveManipulation.angle=no(nc(e.object)))}_updateMoveManipulation(e){let t=(0,tE.T)(0,0,0,this.view.spatialReference),i=0,n=!1,a=this._moveManipulation;if(a){for(let a of e){if(!a.object.visible)continue;this.enableZ&&nh(a.object.operations,a.object.elevationInfo)&&(n=!0);let e=a.geometryRepresentation instanceof iO&&!a.object.isDraped?a.geometryRepresentation.attachmentOrigin:a.object.origin;if(null!=e){let{x:n,y:a,z:r}=e;t.x+=n,t.y+=a,r&&(t.z??=0,t.z+=r),i++}}i>0?(t.x/=i,t.y/=i,t.z??=0,t.z/=i,a.location=t,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=n):a.available=!1}}_buildDragEventPipeline(e,t,i,n,a,r){let s=[],o=[],l=null,c=null,h=()=>{for(let e of s)e.dragging=!1;s.length=0,o.length=0,l=null,c=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(1===e.length&&t===M.XY){let t=e[0].object;({steps:n,cancel:a}=this._buildSnappingPipelineSteps(t,t.elevationInfo,n,a,r))}return a=a.next(e=>c?.(e)).next(()=>
179(o.length&&this.events.emit("move-stop",new aB(o)),this.destroyed||h(),null)),{steps:n=n.next(t=>{if("start"===t.action){for(let t of(s.length=0,o.length=0,e))t.dragging||!t.manipulationXY?.hasManipulator(i)&&t.manipulationXY?.grabbing||(s.push(t),o.push(t.object),t.dragging=!0);if(0!==o.length&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),l=(0,an.fW)(o),c=(0,an.dJ)(o),this._emitRecordUndo(),this.events.emit("move-start",new aW(o)),this.destroyed))return null}return 0!==o.length?t:null}).next(e=>l?.(e)).next(e=>(this._updateMoveTooltip(t,e),e)).next(e=>{switch(e.action){case"start":case"update":if(e.translationX||e.translationY||e.translationZ){let t=this.view.toScreen(e.mapStart),i=this.view.toScreen(e.mapEnd);if(!t||!i)return null;let n=i.x-t.x,a=i.y-t.y;this.events.emit("move",new aY(n,a,o)),this.destroyed}break;case"end":if(this.events.emit("move-stop",new aB(o)),this.destroyed)break;h()}return null}),cancel:a}}_connectTooltips(){let e;if(this.removeHandles(aq),this._shouldShowMovePointTooltip){let t=this.objects.at(0),{events:i}=this;this._movePointTooltipInfo??=new aG.o({viewType:this.view.type,sketchOptions:this.sketchOptions});let n={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),i.emit("move-start",new aW([t]))},onMove:()=>i.emit("move",new aY(0,0,[t])),onMoveStop:()=>i.emit("move-stop",new aB([t])),onRotateStart:()=>{},onRotate:()=>{},onRotateStop:()=>{},onScaleStart:()=>{},onScale:()=>{},onScaleStop:()=>{}};e=np(this.tooltip,t,()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this._movePointTooltipInfo,callbacks:n}))}else e=(0,L.YP)(()=>this.sketchOptions.tooltips.effectiveEnabled?this._latestTooltipInfo:null,e=>{this.tooltip.info=e},L.tX);this.addHandles(e,aq)}_showTooltip(e){this._shouldShowMovePointTooltip||this._updateMoveTooltip(e)}_hideTooltip(){this._shouldShowMovePointTooltip||(this.tooltip?.clear(),this._latestTooltipInfo=null)}_updateMoveTooltip(e,t){if(this._shouldShowMovePointTooltip)return;let{sketchOptions:i,autoLengthMeasurementUtils:n}=this;switch(e){case M.XY:this._latestTooltipInfo=this._translateTooltipInfo??=new aN.E({sketchOptions:i}),aK(this._latestTooltipInfo,t,(e,t)=>n.autoDistanceBetweenPoints2D(aJ(e),aJ(t)));break;case M.XY_AXIS:this._latestTooltipInfo=this._translateXYTooltipInfo??=new ak({sketchOptions:i}),aK(this._latestTooltipInfo,t,(e,i)=>(0,ni.bA)(n.autoDistanceBetweenPoints2D(aJ(e),aJ(i)),ap(t)));break;case M.Z:this._latestTooltipInfo=this._translateZTooltipInfo??=new aZ({sketchOptions:i}),aK(this._latestTooltipInfo,t,nu._e)}this._latestTooltipInfo.sketchOptions=i}_emitRecordUndo(){let e=this.objects.toArray().map(e=>e.createUndoRecord?.()).filter(ne.pC);e.length>0&&this.events.emit("record-undo",{updates:e})}_buildSnappingPipelineSteps(e,t,i,n,a){let r=nc(e);if(null==r||"point"!==r.type&&"mesh"!==r.type)return{steps:i,cancel:n};let s=("point"===r.type?r:r.origin).clone(),o=new az.N({elevationInfo:t,pointer:a,editGeometryOperations:aU.c.fromGeometry(s,this.view.state.viewingMode),visualizer:new t6,excludeFeature:e.graphic}),l=this.snappingManager,{snappingStep:c,cancelSnapping:h}=(0,aH.W)({snappingContext:o,snappingManager:l,updatingHandles:this._updatingHandles});return n=n.next(h),{steps:i=i.next(t=>(s.z=(0,N.vQ)(this.view,s,e.elevationInfo,{mode:"absolute-height",offset:0}),{...t,snapOrigin:o.coordinateHelper.pointToVector(s)})).next(...c),cancel:n}}};(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],aQ.prototype,"view",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],aQ.prototype,"autoLengthMeasurementUtils",void 0),(0,P._)([(0,U.Cb)()],aQ.prototype,"objects",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],aQ.prototype,"enableZ",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,type:aV.Z})],aQ.prototype,"sketchOptions",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],aQ.prototype,"snappingManager",void 0),(0,P._)([(0,U.Cb)()],aQ.prototype,"type",void 0),(0,P._)([(0,U.Cb)()],aQ.prototype,"updating",null),(0,P._)([(0,U.Cb)()],aQ.prototype,"_latestTooltipInfo",void 0),(0,P._)([(0,U.Cb)()],aQ.prototype,"_shouldShowMovePointTooltip",null),(0,P._)([(0,U.Cb)()],aQ.prototype,"activeTooltipInfo",
179null),aQ=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.move.MoveTool3D")],aQ);let aJ=(0,nn.se)(nr.Z);class a${constructor(e){this.object=e,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1}}function aK(e,t,i){if(null==t||"end"===t.action)return void(e.distance=ni.yP);let{mapStart:n,mapEnd:a}=t,r=i(n,a);e.distance=null!=r?r:ni.yP}var a0=i(14448),a1=i(93271),a2=i(71656),a3=i(88801),a4=i(71232);function a5(e,t,i){let n="on-the-ground"===i.mode?a4.v.XY:a4.v.XYZ;return new a4.A(e,n,t,0)}function a9(e,t,i){let n=(0,G.Ue)();if(!e.renderCoordsHelper.toRenderCoords(t,n))return null;let a=a8(e,t,(0,nD.st)(i.plane)),r=a8(e,t,i.edgeDirection);if(null==a||null==r)return null;let s=(0,H.h)((0,G.Ue)(),a,r);return(0,nD.Yq)(n,s,(0,nD.Ue)())}function a8(e,t,i){let n=(0,tE.T)(t.x+i[0],t.y+i[1],t.z+i[2],t.spatialReference),a=(0,G.Ue)(),r=(0,G.Ue)();return e.renderCoordsHelper.toRenderCoords(t,a)&&e.renderCoordsHelper.toRenderCoords(n,r)?(0,H.E)(r,a,r):null}function a6(e,t,i,n){let{elevationInfo:a,operations:r}=i;if(!r||!e)return null;let s=n.manipulator.elevationAlignedLocation,o=(0,N.Ou)(s,t,a),l=t.sceneIntersectionHelper.intersectElevationFromScreen((0,k.s1)(e.x,e.y),a,o);return l&&(0,nS.projectPoint)(l,l,r.data.spatialReference)?l:null}var a7=i(52610);let re=class extends aF.h{constructor(e){super(e),this.type="reshape-edge-offset",this.distance=(0,a7.r9)({lockable:!1}),this.area=(0,a7.UR)({visible:!1}),this.totalLength=(0,a7.i4)({visible:!1})}get allFields(){return[this.distance,this.area,this.totalLength]}};(0,P._)([(0,U.Cb)()],re.prototype,"type",void 0),(0,P._)([(0,U.Cb)()],re.prototype,"distance",void 0),(0,P._)([(0,U.Cb)()],re.prototype,"area",void 0),(0,P._)([(0,U.Cb)()],re.prototype,"totalLength",void 0),(0,P._)([(0,U.Cb)()],re.prototype,"allFields",null),re=(0,P._)([(0,z.j)("esri.views.interactive.tooltip.infos.ReshapeEdgeOffsetTooltipInfo")],re);var rt=i(33113);function ri(e,{activeTooltipInfo:t,selectedVertexManipulatorInfo:i,callbacks:n}){if(!t)return;n.onBeforeReshape();let a=nc(e);switch(a?.type){case"mesh":"move-point"===t.type&&ng(t,a.origin,e,n);break;case"point":"move-point"===t.type&&ng(t,a,e,n);break;case"polyline":case"polygon":"selected-vertex"===t.type&&function(e,t,i,n){if(!t)return;let{dx:a,dy:r,dz:s}=(0,i5.$4)(e,t.manipulator.location);0===a&&0===r&&0===s||(n.onReshapeStart(),i.operations?.moveVertices([t.handle],a,r,s,nd.b.NEW_STEP),n.onReshape(),n.onReshapeStop())}(t,i,e,n)}}let rn=(0,nn.se)(nr.Z);function ra(e,t,i){if(null!=t&&"end"!==t.action){let{mapStart:n,mapEnd:a}=t,r=i(n,a);e.distance=null!=r?r:ni.yP}else e.distance=ni.yP}function rr({operations:e},t,{sketchOptions:i,tooltipInfos:n,automaticAreaMeasurementUtils:a,automaticLengthMeasurementUtils:r}){let s=n.edgeOffset;if(s.distance.committed=null,null!=t&&null!=t.signedDistance&&"end"!==t.action&&null!=e){let i=e.data.coordinateHelper,{start:n,end:a}=t.operation.clampedStartAndEnd(t.mapEnd),o=r.autoDistance2D(n,a,i.spatialReference),l=Math.sign(t.signedDistance*t.operation.selectedArrow);s.distance.actual=null!=o?(0,ni.bA)(o,l):null}else s.distance.actual=ni.yP;let o=e?.data.geometry;switch(s.area.actual=null,s.area.visible=!1,s.totalLength.actual=null,s.totalLength.visible=!1,o?.type){case"polygon":s.area.actual=a.autoArea2D(o),s.area.visible=!0;break;case"polyline":s.totalLength.actual=r.autoLength2D(o),s.totalLength.visible=!0}return s.sketchOptions=i,s}var rs=i(39277),ro=i(85171);let rl=Symbol(),rc=class extends Y.Z{get _operations(){return this.object.operations}constructor(e){super(e),this._selectedIndex=0,this._manipulatorHandles=new n6.Z,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=S.NONE,this._pendingEdgeOffsetInfo=null,this._updatingHandles=new na.R,this._recreatingManipulators=!1,this._settings=new iy({getTheme:()=>this.view.effectiveTheme}),this.events=new iM.Z,this.activeTooltipInfo=null,this._vertexLaserLineVisualElement=null,this._tooltipCallbacks={onBeforeReshape:()=>this.tool.endDrag(),onReshapeStart:()=>this._updateEventState(S.RESHAPING),onReshape:()=>this.events.emit("reshape",{type:"reshape",object:this.object}),onReshapeStop:()=>this._updateEventState(S.NONE,{forceEnd:!0}),onMoveStart:()=>this._updateEventState(S.MOVING),onMove:()=>this.events.emit("move",{type:"move",object:this.object,dx:0,dy:0}),onMoveStop:()=>this._updateEventState(S.NONE,{forceEnd:!0})}}initialize(){let{view:e}=this,t=this._settings.manipulators,i=t.vertex;this.tooltipInfos=function(e,t){let i=t?.type;return{edgeOffset:new re({sketchOptions:e,viewType:i}),movePoint:new aG.o({sketchOptions:e,viewType:i}),selectedVertex:new rt.K({sketchOptions:e,viewType:i}),translate:new aN.E({sketchOptions:e,viewType:i}),translateXY:new ak({sketchOptions:e,viewType:i}),translateZ:new aZ({sketchOptions:e,viewType:i})}}(this._sketchOptions,e),this._vertexManipulatorMaterial=av((0,R.O)(i.color),i.renderOccluded),this._vertexManipulatorOutlineMaterial=ab((0,R.O)(i.outlineColor),i.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=ab((0,R.O)(i.hoverOutlineColor),i.renderOccluded);let n=t.edge;this._edgeManipulatorMaterial=av((0,R.O)(n.color),n.renderOccluded),this._edgeManipulatorOutlineMaterial=ab((0,R.O)(n.outlineColor),n.renderOccluded);let a=t.edgeOffset;this._edgeOffsetManipulatorMaterial=av((0,R.O)(a.color),a.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=av((0,R.O)(a.hoverColor),a.renderOccluded,!1);let r=t.selected;this._selectedManipulatorMaterial=av((0,R.O)(r.color),r.renderOccluded),this._selectedManipulatorOutlineMaterial=ab((0,R.O)(r.outlineColor),r.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=ab((0,R.O)(r.hoverOutlineColor),r.renderOccluded),this.tooltip=(0,i5.vG)(()=>({view:e,options:this._sketchOptions.tooltips})),this.addHandles([(0,L.YP)(()=>{let e=this._settings.manipulators;return{vertexSettings:e.vertex,edgeSettings:e.edge,edgeOffsetSettings:e.edgeOffset,selectedSettings:e.selected}},({vertexSettings:e,edgeSettings:t,edgeOffsetSettings:i,selectedSettings:n})=>{e.applyColor(this._vertexManipulatorMaterial),e.applyOutline(this._vertexManipulatorOutlineMaterial),e.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),t.applyColor(this._edgeManipulatorMaterial),t.applyOutline(this._edgeManipulatorOutlineMaterial),i.applyColor(this._edgeOffsetManipulatorMaterial),i.applyHover(this._edgeOffsetManipulatorHoverMaterial),n.applyColor(this._selectedManipulatorMaterial),n.applyOutline(this._selectedManipulatorOutlineMaterial),n.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)}),(0,L.YP)(()=>this.object.visible,e=>{for(let t of this._manipulatorInfos)t.manipulator.available=e,rp(t)&&(t.edgeManipulator.available=e)}),(0,L.YP)(()=>this._numGrabbing+this._numDragging===0,e=>this._toggleAutoHideManipulators(e)),(0,L.YP)(()=>({labels:this._segmentLabels,enabled:this._sketchOptions.labels.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:e,enabled:t,edgeOffsetEnabled:i})=>{null!=e&&(e.visible=t,e.edgeDistance=i?"far":"default")},L.nn),function(e,t,i){function n(){let e=i(),t=e.sketchOptions.tooltips.effectiveEnabled?e.activeTooltipInfo:null;return{...e,activeTooltipInfo:t}}let a=!1;
179function r(e){a||(a=!0,e(),a=!1)}function s(i){r(()=>{(function(e,t){let{activeTooltipInfo:i,selectedVertexManipulatorInfo:n,sketchOptions:a}=t;if(i)switch(i.sketchOptions=a,i?.type){case"move-point":nf(i,e);break;case"selected-vertex":(function(e,t,i,{automaticAreaMeasurementUtils:n,automaticLengthMeasurementUtils:a}){if(!e||"selected-vertex"!==e.type)return;let r=t?.manipulator.location;e.setLocationFromPoint(r),nm(e,r,i);let s=i.operations?.data.geometry;switch(s?.type){case"polygon":e.geometryType="polygon",e.totalLength.visible=!1,e.area.actual=n.autoArea2D(s);break;case"polyline":e.geometryType="polyline",e.totalLength.actual=a.autoLength2D(s),e.area.visible=!1}})(i,n,e,t)}})(t,i),e.info=i.activeTooltipInfo})}return(0,I.AL)([(0,L.YP)(n,s,L.tX),(0,L.YP)(()=>{let e=n(),{activeTooltipInfo:i}=e;if(i&&"key"in i)return{context:e,activeTooltipInfo:i,key:i.key,geometry:nc(t)}},(e,i)=>{e&&i&&i.key!==e.key&&r(()=>ri(t,e.context))},L.Z_),t.on("committed",()=>s(n())),(0,i5.OE)(e,{onBeforePaste:()=>{a=!0},onAfterPaste:()=>{ri(t,n()),a=!1}})])}(this.tooltip,this.object,()=>this._tooltipsContext),(0,L.YP)(()=>this.tooltip.mode,(e,t)=>{"input"===t&&"input"!==e&&this._resetTooltip()}),(0,L.on)(()=>this._operations,"vertex-update",e=>this._updateManipulatorPositions(e.vertices),{onListenerAdd:()=>this._recreateManipulators()}),(0,L.on)(()=>this._operations?.data,"change",e=>{"undo"!==e.operation&&"redo"!==e.operation||this._recreateManipulators()})])}destroy(){this._removeManipulators(),this._updatingHandles.destroy(),this._segmentLabels=(0,j.SC)(this._segmentLabels),this.tooltip=(0,j.SC)(this.tooltip)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get automaticAreaMeasurementUtils(){return this.tool.automaticAreaMeasurementUtils}get automaticLengthMeasurementUtils(){return this.tool.automaticLengthMeasurementUtils}get object(){return this.tool.object}get enableZShape(){return this.tool.enableZShape}get enableDeleteVertices(){return this.tool.enableDeleteVertices}get enableZVertex(){return this.tool.enableZVertex}get autoHideManipulators(){return this.tool.autoHideManipulators}get enableMoveObject(){return this.tool.enableMoveObject}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _sketchOptions(){return this.tool.sketchOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}enterInputModeIfAvailable(e){return"key-down"===e.type&&e.key===ro.T6.enterInputMode&&("reshape-edge-offset"===this.activeTooltipInfo?.type?this._enterInputModeDuringEdgeOffset(e):!!(0,i5._i)(e,this.tooltip)&&(this.tool.endDrag(),!0))}removeSelectedVertices(){let e=this._manipulatorInfos.filter(e=>e.manipulator.selected&&"vertex"===e.type);return this._removeVertices(e),e.length}onManipulatorSelectionChanged(){this.events.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=(0,j.SC)(this._moveManipulation),this._objectMoveManipulation=(0,j.SC)(this._objectMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(e){if(null==this._operations)return;let t=this.object.elevationInfo;for(let i of this._operations.data.components){let n=e?.byComponentIndex.get(i.index);for(let e of i.vertices){let i=n?.has(e.index);this._createVertexOrEdgeManipulator(e,t,i)}for(let e of i.edges)this._createVertexOrEdgeManipulator(e,t)}this._createObjectMoveManipulation(),this._createMoveManipulation(t),this._createVisualElements()}get canRedo(){return null!=this._operations&&this._operations.canRedo}get canUndo(){return null!=this._operations&&this._operations.canUndo}redo(){return this._operations?.redo()}undo(){return this.events.emit("undo"),this._operations?.undo()}_recreateManipulators(){if(!this._recreatingManipulators){if(this._recreatingManipulators=!0,this._removeManipulators(),this._resetTooltip(),this._operations&&this._segmentLabels?.context?.editGeometryOperations===this._operations||(this._segmentLabels=(0,j.SC)(this._segmentLabels)
179),this._createManipulators(),!this._segmentLabels&&this._operations){let e=this._sketchOptions.labels;this._segmentLabels=new em({context:{view:this.view,editGeometryOperations:this._operations,elevationInfo:this.object.elevationInfo,labelOptions:e,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils},visible:e.enabled})}this._recreatingManipulators=!1}}_perObjectManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0,n=[],a=this._manipulatorInfos.some(e=>"vertex"===e.type&&e.manipulator.selected),r=e===x.SELECTED_OR_ALL&&a;for(let e of this._manipulatorInfos)"vertex"===e.type&&(e.manipulator.grabbing||r&&!e.manipulator.selected||n.push(e),i++);if(this._moveVertices(n,t),n.length===i){if(this._updateEventState(S.MOVING),this.destroyed)return t;this.events.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,object:this.object})}else{if(this._updateEventState(S.RESHAPING),this.destroyed)return t;this.events.emit("reshape",{type:"reshape",object:this.object})}return t}_toggleAutoHideManipulators(e){this.autoHideManipulators&&(e?this.removeHandles(rl):this.tool.manipulators.forEach(({manipulator:e})=>{let t=e.disableDisplay?.();t&&this.addHandles(t,rl)}))}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((e,t)=>"vertex"===t.type&&t.manipulator.selected?e+1:e,0)>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(S.RESHAPING),this.destroyed)return;let{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:n}=e;if(!t&&!i&&!n)return;let a=[];for(let t of this._manipulatorInfos)"vertex"===t.type&&(t.manipulator.selected&&!t.manipulator.grabbing||t===e.info)&&a.push(t);this._moveVertices(a,e,nd.b.ACCUMULATE_STEPS),this.events.emit("reshape",{type:"reshape",object:this.object})}_updateEventState(e,t={}){if(e===this._reshapeEventState)return!1;switch(e){case S.NONE:if(!t.forceEnd&&(0!==this._numGrabbing||0!==this._numDragging))return!1;switch(this._reshapeEventState){case S.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object});break;case S.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object})}break;case S.MOVING:switch(this._reshapeEventState){case S.NONE:this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object});break;case S.RESHAPING:this.events.emit("reshape",{type:"reshape-stop",object:this.object}),this.destroyed||this.events.emit("move",{type:"move-start",dx:0,dy:0,object:this.object})}break;case S.RESHAPING:switch(this._reshapeEventState){case S.NONE:this.events.emit("reshape",{type:"reshape-start",object:this.object});break;case S.MOVING:this.events.emit("move",{type:"move-stop",dx:0,dy:0,object:this.object}),this.destroyed||this.events.emit("reshape",{type:"reshape-start",object:this.object})}}if(this.destroyed)return!1;let i=this._reshapeEventState!==e;return this._reshapeEventState=e,i}_createObjectMoveManipulation(){let{tool:e,view:t,object:i,_operations:n}=this;if(n){if(this._objectMoveManipulation=new aI({tool:e,view:t,object:i}),this.enableMoveObject){let e=null;this._manipulatorHandles.add(this._objectMoveManipulation.createDragPipeline((t,i,a)=>{i.next(e=>this._trackNumDragging(e)).next(t=>("start"===t.action&&(e=n.createUndoGroup()),t)).next(e=>this._perObjectManipulatorDragAction(x.ALL,e)).next(e=>(this._updateTranslateObjectTooltip(M.XY,e),e)).next(t=>{"end"===t.action&&(this._resetTooltip(),e=(0,j.hw)(e))}),a.next(()=>this._onDragCancel(!0,()=>e=(0,j.hw)(e)))})),this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(e,!1)))}else this._objectMoveManipulation.forEachManipulator(e=>{e.grabbable=!1,e.cursor=null});this._objectMoveManipulation.forEachManipulator(e=>this._manipulatorHandles.add(e.events.on("immediate-click",e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()})))}}_createMoveManipulation(e){let{object:t,tool:i,view:n,_operations:a}=this;if(!a)return;this._moveManipulation=new aP({tool:i,view:n,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&nh(t.operations,t.elevationInfo),snapToScene:!1,radius:aP.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(e=>this.addHandles([e.events.on("immediate-click",t=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some(e=>e.manipulator.selected)||this.events.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()}),this._watchAndUpdateGrabState(e,!1)]));let r=e=>t=>{this.addHandles([t.events.on("focus-changed",({action:t})=>{"focus"===t?this._updateTranslateTooltip(e):this._resetTooltip()})])};this._moveManipulation.xyManipulation.forEachManipulator(r(M.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(r(M.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(r(M.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};let s=a.data.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((n,r,s,o,l)=>{let{snappingStep:c,cancelSnapping:h}=(0,aH.W)({predicate:e=>!!e.info,snappingManager:i.snappingManager,snappingContext:new az.N({editGeometryOperations:a,elevationInfo:e,pointer:l,excludeFeature:t.graphic,visualizer:new t6}),updatingHandles:this._updatingHandles,useZ:!1});return o=o.next(e=>(this._onDragCancel(),e)).next(h),{steps:s=s.next(e=>this._trackNumDragging(e)).next(e=>{let t=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return e.manipulatorType===b.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:e}).next((0,an.BS)(this.view,e,t.graphic??void 0)).next(...c).next((0,an.AN)()).next(e=>this._perObjectManipulatorDragAction(x.SELECTED_OR_ALL,e)).next(e=>(this._updateTranslateTooltip(n,e),e)),cancel:o}},e,s,t.graphic),(0,L.YP)(()=>t.visible,()=>this._updateMoveManipulationPosition(),L.nn),t.on("committed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),(0,L.YP)(()=>t.isDraped,e=>{this._updateMoveManipulationPosition();let t="align-move-manipulation";e?this.addHandles(this.view.elevationProvider.on("elevation-change",()=>this._updateMoveManipulationPosition()),t):this.removeHandles(t)},L.nn)])}_createVisualElements(){let{object:e,view:t}=this,i=n4({view:t,object:e,forEachManipulator:e=>{if(!this.destroyed&&!this._recreatingManipulators)for(let t of(this._objectMoveManipulation.forEachManipulator(e),this._moveManipulation.forEachManipulator(e),this._manipulatorInfos))e(t.manipulator,b.TRANSLATE_XY)},onManipulatorsChanged:e=>this.events.on("manipulators-changed",e)});null!=i&&(this._outlineVisualElement=i.visualElement instanceof iO?i.visualElement:null);let n=this._outlineVisualElement;if(null!=n){let t=()=>{e.isDraped||this._updateMoveManipulationPosition()};this._manipulatorHandles.add((0,L.on)(()=>n.events,"attachment-origin-changed",t,{onListenerAdd:t}))}this._manipulatorHandles.add(i)}_createEdgeOffsetManipulator(e,t=this.object.elevationInfo){let i=this.view,n=this._operations;if(e.component.vertices.length<=2||!n)return null;let a=n.data.spatialReference,r=this._settings.manipulators.edgeOffset,s=r.size/2,o=s+r.collisionPadding,l=s/o,c=l/2,h=l*Math.sqrt(3)/2,{height:d,offset:u}=r,p=this._edgeOffsetManipulatorMaterial;if(!this._edgeOffsetManipulatorGeometryInside){let e=(0,tg.DA)(p,h,c,c,d,u);this._edgeOffsetManipulatorGeometryInside=e}if(!this._edgeOffsetManipulatorGeometryOutside){let e=(0,tg.DA)(p,-h,c,c,d,-u);this._edgeOffsetManipulatorGeometryOutside=e}let _=new nj({view:i,renderObjects:[new at(this._edgeOffsetManipulatorGeometryInside.instantiate(),nI.Q9.Unfocused),new at(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),nI.Q9.Focused),new at(this._edgeOffsetManipulatorGeometryOutside.instantiate(),nI.Q9.Unfocused),new at(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),nI.Q9.Focused)],elevationInfo:"on-the-ground"!==t.mode||(0,a2.YW)(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:o,available:this.object.visible,collisionType:{type:"disc",direction:(0,G.al)(0,0,1)},collisionPriority:1,metadata:{deleting:!1},location:ru(a)}),g=new nj({view:i,worldSized:!0,worldOriented:!1,available:this.object.visible,collisionPriority:-10,cursor:this.enableMoveObject?"move":"default",metadata:{deleting:!1},location:ru(a)}),f={manipulator:_,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:g,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(f,r.minSquaredEdgeLength);let m=()=>this._updateEdgeOffsetManipulator(f);m(),f.locationUpdateHandle=(0,I.AL)([e.leftVertex,e.rightVertex].map(e=>{let t=this._getManipulatorInfoFromHandle(e);return t?.manipulator.events.on("location-update",m)}));let v=e=>{this._manipulatorInfos.some(e=>e.manipulator.selected)?this._clearSelection():this.events.emit("immediate-click",{...e,object:this.object}),e.stopPropagation()};return this._manipulatorHandles.add([f.locationUpdateHandle,this._watchAndUpdateGrabState(_,!0),this._watchAndUpdateGrabState(g,!0),(0,an.Xd)(_,this._createEdgeOffsetPipeline(f,t,n)),(0,an.Xd)(g,this._createEdgePipeline(f,t,n)),g.events.on("immediate-click",v),_.events.on("immediate-click",v),_.events.on("focus-changed",()=>this._resetTooltip()),_.events.on("grab-changed",({screenPoint:e,action:t})=>{f.grabMapPoint="start"===t?a6(e,this.view,this.object,f):null})],_),this._manipulatorInfos.push(f),this.manipulators.addMany([_,g]),this.events.emit("mani
179pulators-changed"),f}_autoHideEdgeOffsetManipulator(e,t){let i=e.manipulator,n=e.edgeManipulator,a=()=>{e.visibilityHandle=(0,j.hw)(e.visibilityHandle);let a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex),s=null!=a&&null!=r&&function(e,t,i){let n=i.projectToRenderScreen(e,(0,k.J$)()),a=i.projectToRenderScreen(t,(0,k.J$)());return null!=n&&null!=a?(0,H.k)((0,H.d)(n,n,a)):0}(a.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera)<t;(i.focused||n.focused)&&!s||(i.grabbable=!s,n.grabbable=!s,e.visibilityHandle=(0,I.AL)([i.disableDisplay(),(0,I.kB)(()=>{i.grabbable=!0,n.grabbable=this.enableMoveObject})]))};this._manipulatorHandles.add([i.events.on("focus-changed",a),n.events.on("focus-changed",a),(0,I.kB)(()=>{(0,j.hw)(e.visibilityHandle),n.metadata.deleting=!0,this.manipulators.remove(n)})],i),a()}_updateEdgeOffsetManipulator(e){if(!this._operations)return;this._updateManipulatorPosition(e);let{coordinateHelper:t}=this._operations.data,i=a9(this.view,e.manipulator.elevationAlignedLocation,a5(t,e.handle,e.manipulator.elevationInfo)),n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==n||null==a)return;let r=n.manipulator.renderLocation,s=a.manipulator.renderLocation,o=null!=i?function(e,t,i){let n=(0,nD.st)(e),a=(0,H.E)((0,G.Ue)(),t,i),r=(0,H.h)((0,G.Ue)(),a,n),s=(0,H.h)((0,G.Ue)(),a,r);return(0,tN.al)(a[0],a[1],a[2],0,r[0],r[1],r[2],0,s[0],s[1],s[2],0,0,0,0,1)}(i,r,s):tN.Wd;e.manipulator.modelTransform=o,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=o;let l=(0,H.l)((0,H.d)(rg,r,s))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-l,0,0],[l,0,0]]]}}_createEdgePipeline(e,t,i){return(n,a,r,s)=>{if("touch"===s)this._createEdgeOffsetPipeline(e,t,i)(n,a,r);else if(this.enableMoveObject){let e=this.object.graphic,s=i.data.spatialReference,{elevationAlignedLocation:o}=n;a.next(e=>this._trackNumDragging(e)).next((0,an.kY)(this.view,o)).next(as(this.view,o,t,s,e)).next((0,an.zh)()).next((0,an.AN)()).next(e=>this._perObjectManipulatorDragAction(x.ALL,e)).next(e=>(this._updateTranslateObjectTooltip(M.XY,e),e)).next(e=>{"end"===e.action&&this._resetTooltip()}),r.next(()=>this._onDragCancel(!n.metadata.deleting))}}}_createEdgeOffsetPipeline(e,t,i){return(n,a,r)=>{let s=this._pendingEdgeOffsetInfo;if(s?.manipulatorInfo===e&&"drag"!==s.mode)return void r.execute({action:"cancel"});this._clearSelection();let{initializeStep:o,cleanup:l}=this._initializeEdgeOffset(e,t,i,r),c=this._applyEdgeOffsetStep(e);a.next(e=>this._trackNumDragging(e)).next((0,an.kY)(this.view,n.elevationAlignedLocation)).next(o).next(ar(this.view,e=>e.plane)).next(al(this.view,i.data.spatialReference)).next((0,an.AN)()).next(e=>{let{operation:t,mapEnd:i}=e;return null==t||null==i?e:{...e,signedDistance:t.signedDistanceToPoint(i)}}).next(e=>this._pendingEdgeOffsetInfo?e:c(e)).next(e=>{"end"!==e.action||this._pendingEdgeOffsetInfo||l()}),r.next(()=>{this._exitEdgeOffsetInputMode(),n.metadata.deleting||(l(),this._onDragCancel())})}}_initializeEdgeOffset(e,t,i,n){let a;let{view:r,object:s}=this,o=a5(i.data.coordinateHelper,e.handle,t),l=i.createUndoGroup(),c=a9(r,e.manipulator.elevationAlignedLocation,o);this._splitEdgesBeforeEdgeOffset(e,o),this._selectEdgeOffsetArrow(e,o);let h=()=>{this._cleanEdgeOffsetCollapsedEdges(e,i),a=(0,j.hw)(a)},d=this.events.on("undo",h);return a=(0,I.AL)([this._initializeEdgeOffsetVisualElement(e,s,t,i),l,d,this._connectEdgeOffsetTooltip(e,o,i,()=>{n.execute({action:"cancel"})})]),{initializeStep:e=>null==o||null==c?(h(),null):{...e,operation:o,plane:c},cleanup:h}}_initializeEdgeOffsetVisualElement(e,t,i,n){let a=()=>new a0.Z({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:n.data.spatialReference}),r=new iO({view:this.view,isDraped:t.isDraped,geometry:a(),elevationInfo:i,width:this._settings.visualElements.lineObjects.outline.width,attached:!1,isDecoration:!0}),s=(0,I.AL)([(0,L.YP)(()=>({color:this._accentColor,draped:t.isDraped}),({color:e,draped:t})=>{r.color=(0,R.O)(e),r.isDraped=t},L.tX),t.on("committed",()=>{r.geometry=a()}),(0,I.ed)(r)]);return r.attached=!0,s}_applyEdgeOffsetStep(e){return t=>(this.destroyed||null==t.operation||!this._operations||(this._updateEventState(S.RESHAPING),null==t.signedDistance?this._resetTooltip():((t.mapDeltaX||t.mapDeltaY||t.mapDeltaZ)&&(this._offsetE
179dge(e,t.operation,t.signedDistance),this.events.emit("reshape",{type:"reshape",object:this.object})),this._updateEdgeOffsetTooltip(t))),t)}_cleanEdgeOffsetCollapsedEdges(e,t){let i=e.handle.leftVertex.leftEdge?.leftVertex,n=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,r=e.handle.rightVertex,s=t.data.coordinateHelper,o=this.view.pixelSizeAt(s.vectorToDehydratedPoint(n.pos),s.spatialReference),l=[];if(i&&s.distance(i.pos,n.pos)<rf){let e=this._getManipulatorInfoFromHandle(n);null!=e&&l.push(e)}if(s.distance(n.pos,r.pos)<o||a&&s.distance(a.pos,r.pos)<rf){let e=this._getManipulatorInfoFromHandle(r);null!=e&&l.push(e)}l.length&&this._removeVertices(l)}_enterInputModeDuringEdgeOffset(e){let t=this._findActiveEdgeOffsetManipulatorInfo();return!!t&&!!(0,i5._i)(e,this.tooltip)&&(t.manipulator.dragging?this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"drag"}:(this._clearSelection(),this._pendingEdgeOffsetInfo={manipulatorInfo:t,mode:"hover"},this._connectEdgeOffsetTooltipOnHover(t)),!0)}_exitEdgeOffsetInputMode(){this.tooltip&&(this._pendingEdgeOffsetInfo=null,this._resetTooltip(),this.tooltip.exitInputMode())}_findActiveEdgeOffsetManipulatorInfo(){return this._manipulatorInfos.filter(rp).find(({manipulator:e})=>e.hovering||e.grabbing||e.dragging)}_connectEdgeOffsetTooltipOnHover(e){let{_operations:t,object:i}=this;if(!t)return;let{elevationInfo:n}=i,a=a5(t.data.coordinateHelper,e.handle,n);this._selectEdgeOffsetArrow(e,a),this.addHandles([this._initializeEdgeOffsetVisualElement(e,i,n,t),this._connectEdgeOffsetTooltip(e,a,t,()=>{this.removeHandles(a),this._exitEdgeOffsetInputMode()})],a)}_splitEdgesBeforeEdgeOffset(e,t){if(t.requiresSplitEdgeLeft){let t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);null!=t&&this._splitEdgeManipulator(t,1)}if(t.requiresSplitEdgeRight){let t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);null!=t&&this._splitEdgeManipulator(t,0)}}_selectEdgeOffsetArrow(e,t){let i=e.grabMapPoint??a6(this.view.inputManager?.latestPointerLocation,this.view,this.object,e);i&&t.selectArrowFromStartPoint(i)}_connectEdgeOffsetTooltip(e,t,i,n){let a=()=>this.tooltipInfos.edgeOffset.distance.actual,r=a=>{n(),queueMicrotask(()=>{this.view.focus();let n=i.createUndoGroup();this._tooltipCallbacks.onReshapeStart?.(),this._splitEdgesBeforeEdgeOffset(e,t),this._offsetEdge(e,t,function(e,t,i,{data:{coordinateHelper:n,spatialReference:a}}){let r=(0,ni.mE)(e,"meters"),s=(0,Q.c9)(a),o=Math.sign(r*i.selectedArrow),l=(0,a3.Lc)(a),c=(0,nD.st)(i.plane),h=n.pointToXYZ(t),d=(0,G.Ue)();(0,H.b)(d,h,c,10/s*o);let u=r*i.selectedArrow/s;if(!l||!(0,eb.S)(h,a,h,l)||!(0,eb.S)(d,a,d,l))return u;let p=new a3._q;if((0,a3.cA)(p,h,d,l),(0,a3.TB)(d,h,p.azimuth,r,l),!(0,eb.S)(d,l,d,a))return u;let _=d[0]-t.x,g=d[1]-t.y,[f,m]=c,v=Math.sqrt(f*f+m*m);return 0===v?0:Math.sqrt(_*_+g*g)*o/v}(a,e.manipulator.location,t,i)),this._tooltipCallbacks.onReshape?.(),this._tooltipCallbacks.onReshapeStop?.(),this._cleanEdgeOffsetCollapsedEdges(e,i),n.remove()})},s=()=>{let e=a();null!=e?r(e):n()};return(0,I.AL)([(0,L.gx)(()=>this.tooltip&&!this.tooltip.focused,()=>s(),L.Z_),this.tooltip.on("discard",n),this.tooltip.on("commit",e=>{"commit-and-exit"===e.type&&s()})])}_createVertexOrEdgeManipulator(e,t=this.object.elevationInfo,i=!1){let n=this.view,a=this._operations,r=this._settings;if(!a)return null;let s=a.data.type,o=a.data.spatialReference;if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(null==this._vertexManipulatorGeometry||null==this._vertexManipulatorOutlineGeometry){let{size:e,outlineSize:t}=rh(r.manipulators.vertex);this._vertexManipulatorGeometry=(0,tg.PI)(this._vertexManipulatorMaterial,e,16,16),this._vertexManipulatorOutlineGeometry=(0,tg.PI)(this._vertexManipulatorOutlineMaterial,t,16,16)}if(null==this._edgeManipulatorGeometry||null==this._edgeManipulatorOutlineGeometry){let{size:e,outlineSize:t}=rh(r.manipulators.edge);this._edgeManipulatorGeometry=(0,tg.PI)(this._edgeManipulatorMaterial,e,16,16),this._edgeManipulatorOutlineGeometry=(0,tg.PI)(this._edgeManipulatorOutlineMaterial,t,16,16)}let l="point"===s||"mesh"===s?[]:[new at(this._vertexManipulatorGeometry.instantiate(),w.Vertex|nI.Q9.Unselected),new at(this._vertexManipulatorOutlineGeometry.instantiate(),w.Vertex|nI.Q9.Unfocused|nI.Q9.Unselected),new at(this._vertexManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),w.Vertex|nI.Q9.Focused|nI.Q9.Unselected),new at(this._vertexManipulatorGeometry.instantiate({material:this._selectedManipulatorMaterial}),nI.Q9.Selected),new at(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorOutlineMaterial}
179),nI.Q9.Selected|nI.Q9.Unfocused),new at(this._vertexManipulatorOutlineGeometry.instantiate({material:this._selectedManipulatorHoverOutlineMaterial}),nI.Q9.Selected|nI.Q9.Focused)];this.enableMidpoints&&l.push(new at(this._edgeManipulatorGeometry.instantiate({material:this._vertexManipulatorMaterial}),w.Edge|nI.Q9.Focused|nI.Q9.Unselected),new at(this._edgeManipulatorOutlineGeometry.instantiate({material:this._vertexManipulatorHoverOutlineMaterial}),w.Edge|nI.Q9.Focused|nI.Q9.Unselected),new at(this._edgeManipulatorGeometry.instantiate(),w.Edge|nI.Q9.Unfocused|nI.Q9.Unselected),new at(this._edgeManipulatorOutlineGeometry.instantiate(),w.Edge|nI.Q9.Unfocused|nI.Q9.Unselected));let c=new nj({view:n,renderObjects:l,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:this.object.visible,metadata:{deleting:!1},location:ru(o)});c.selected=i,this._setTypeSpecificManipulatorSettings(c,e,t);let h="edge"===e.type?{manipulator:c,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:c,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(h),this.manipulators.add(c),this._updateManipulatorPosition(h),"edge"===h.type){let e=[];for(let t of[h.handle.leftVertex,h.handle.rightVertex]){let i=this._getManipulatorInfoFromHandle(t);null!=i&&e.push(i.manipulator.events.on("location-update",()=>this._updateManipulatorPosition(h)))}h.locationUpdateHandle=(0,I.AL)(e),this._manipulatorHandles.add(h.locationUpdateHandle,c)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(c,!0),c);let d=(0,an.Xd)(c,(e,i,r,s)=>{let l=null,{snappingStep:c,cancelSnapping:d}=(0,aH.W)({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new az.N({editGeometryOperations:a,elevationInfo:t,pointer:s,excludeFeature:this.object.graphic,visualizer:new t6}),updatingHandles:this._updatingHandles,useZ:!1});r=r.next(t=>(this._onDragCancel(!e.metadata.deleting,()=>l=(0,j.hw)(l)),t)).next(d);let{elevationAlignedLocation:u}=e,p=this.object.graphic??void 0;i.next(e=>this._trackNumDragging(e)).next(e=>{if("start"===e.action&&a&&(l=a.createUndoGroup()),"edge"===h.type){let t=this._splitEdgeManipulator(h);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:h,snapOrigin:h.handle.pos}}).next((0,an.kY)(n,u)).next(as(n,u,t,o,p)).next((0,an.BS)(n,t,p)).next(...c).next((0,an.AN)()).next(e=>{this._perVertexManipulatorDragAction(e),"end"===e.action&&(l=(0,j.hw)(l)),this._resetTooltip()})});return this._manipulatorHandles.add([d,c.events.on("immediate-click",e=>this._manipulatorClickCallback(e,h)),c.events.on("select-changed",()=>{h.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition(),this._resetTooltip()}),c.events.on("focus-changed",()=>{this._resetTooltip()})],c),this.events.emit("manipulators-changed"),h}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_onDragCancel(e=!0,t){switch(this._numDragging--,e&&this.undo(),this.tool.snappingManager?.doneSnapping(),this._resetTooltip(),this._reshapeEventState){case S.NONE:break;case S.MOVING:this.events.emit("move",{type:"move",dx:0,dy:0,object:this.object});break;case S.RESHAPING:this.events.emit("reshape",{type:"reshape",object:this.object})}t?.(),this.destroyed||this._updateEventState(S.NONE)}_setTypeSpecificManipulatorSettings(e,t,i){let n=this._settings;switch(t.type){case"vertex":{e.state=w.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2;let{size:t,collisionPadding:a}=n.manipulators.vertex;e.radius=t/2+a,e.elevationInfo=i;let r=this._operations?.data.type;e.interactive=null!=r&&"point"!==r&&"mesh"!==r;break}case"edge":{e.state=w.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1;let{size:t,collisionPadding:a}=n.manipulators.edge;e.radius=t/2+a,e.elevationInfo="on-the-ground"!==i.mode||(0,a2.YW)(this.object.graphic?.symbol)?{mode:"absolute-height",offset:0}:i}}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",i=>{this._onGrabStateChanged(e,t,i.action,i.pointerType)})}_onGrabStateChanged(e,t,i,n="mouse"){if(!this._recreatingManipulators){if
179("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(S.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==n||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(e=>{let{manipulator:t}=e,i=this._operations?.data.type;t.interactive=t.grabbing||!this._numGrabbing&&null!=i&&"point"!==i&&"mesh"!==i,rp(e)&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)}),this._objectMoveManipulation.forEachManipulator(e=>{e.interactive=e.grabbing||!this._numGrabbing}))}}_clearSelection(){for(let e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1);this._pendingEdgeOffsetInfo=null}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.events.emit("manipulators-changed"))}_removeManipulator(e){null!=e&&(e.manipulator.metadata.deleting=!0,this.manipulators.remove(e.manipulator),this._manipulatorHandles.remove(e.manipulator),(0,ne.e$)(this._manipulatorInfos,e),this.events.emit("manipulators-changed"),this._resetTooltip())}_getManipulatorInfoFromHandle(e){if(e){for(let t of this._manipulatorInfos)if(e===t.handle)return t}return null}_updateManipulatorPositions(e){for(let t of e)this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t))}_updateManipulatorPosition(e){let t=this._operations;if(null!=e&&t){if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,r_),e.manipulator.grabbing&&null!=this._vertexLaserLineVisualElement&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){let i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),n=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(null==i||null==n)return;let a=i.manipulator,r=n.manipulator;if("on-the-ground"===e.manipulator.elevationInfo?.mode){let i=a.location,n=r.location,s=i.x+.5*(n.x-i.x),o=i.y+.5*(n.y-i.y),l=i.hasZ&&n.hasZ?0:void 0;e.manipulator.location=(0,tE.T)(s,o,l,t.data.spatialReference)}else(0,H.m)(rg,a.renderLocation,r.renderLocation,.5),e.manipulator.renderLocation=rg}}}_splitEdgeManipulator(e,t=.5){let i;let n=this._operations,a=n.splitEdge(e.handle,t).createdVertex;e.locationUpdateHandle=(0,j.hw)(e.locationUpdateHandle);let r=this.object.elevationInfo;this.enableEdgeOffset?(this._removeManipulator(e),i=this._createVertexOrEdgeManipulator(a)):((i=e).handle=a,i.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,r)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this._updateManipulatorPosition(i),this.enableEdgeOffset||this._resetTooltip(),this._updateSelection(e.manipulator);let s=this._updateEventState(S.RESHAPING),o=n.data.coordinateHelper.vectorToArray(i.handle.pos),l=n.data.components.indexOf(a.component);return this.events.emit("vertex-add",{type:"vertex-add",object:this.object,vertices:[{coordinates:o,componentIndex:l,vertexIndex:a.index}],added:o}),s&&this._updateEventState(S.NONE),i}_updateMoveManipulationPosition(){let e=(0,H.i)(rg,0,0,0),t=0,i=!1,n=null,a=null;for(let r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.selected?(t++,(0,H.f)(e,e,r.manipulator.renderLocation),null==n||r.selectedIndex>n.selectedIndex?(a=n,n=r):(null==a||r.selectedIndex>a.selectedIndex)&&(a=r)):i=!0);let r=this.object,s=this._operations?.data.geometry;if(0===t){let e=r.visible&&this.enableMoveObject;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&nh(this._operations,r.elevationInfo),this._moveManipulation.angle=no(s),this._moveManipulation.radius=aP.radiusForSymbol(r.graphic?.symbol)}else{let e=r.visible;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&nh(this._operations,this.object.elevationInfo),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t;let i=0;if(null!=n){let e=n.handle.pos,t=null!=a?a.handle.pos:n.handle.leftEdge?.leftVertex?n.handle.leftEdge.leftVertex.pos:null,r=null==a&&n.handle.rightEdge?.rightVertex?n.handle.rightEdge.rightVertex.pos:null;t&&r?this._moveManipulation.xyAxisManipulation.available=!1:t?i=rd(t,e):r&&(i=rd(e,r))}this._moveManipulation.angle=i,this._moveManipulation.radius=n5}0!==t&&i?((0,H.g)(e,e,1/t),r_.spatialReference=this._operations.data.spatialReference,r_.hasZ=!0,this.view.renderCoordsHelper.fromRe
179nderCoords(e,r_),this._moveManipulation.elevationAlignedLocation=r_):null==this._outlineVisualElement||this.object.isDraped||null==this._outlineVisualElement.attachmentOrigin?ax(this._moveManipulation,this.object):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(e){let t=[],i=this._operations;if(i){for(let n of e){let e=n.handle.component;if("vertex"===n.type&&i.canRemoveVertex(e)){t.push(n.handle),this._removeManipulator(n),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(n.handle.rightEdge));let a=i.removeVertices([n.handle]),r=a.removedVertices?.[0].createdEdge;r?this._createVertexOrEdgeManipulator(r):this.enableEdgeOffset&&e.vertices.length<=2&&this._removeManipulator(this._getManipulatorInfoFromHandle(e.edges[0]))}}if(t.length>0){let e=t.map(e=>{let t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:e.index}}),n=this._updateEventState(S.RESHAPING);if(this.destroyed||(this.events.emit("vertex-remove",{type:"vertex-remove",object:this.object,removed:e.map(e=>e.coordinates),vertices:e}),this.destroyed)||n&&(this._updateEventState(S.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}}_moveVertices(e,t,i="start"===t.action?nd.b.NEW_STEP:nd.b.ACCUMULATE_STEPS){let n=this._operations;if(n)for(let a of(e.length>0&&n.moveVertices(e.map(e=>e.handle),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),e))this._updateManipulatorPosition(a)}_offsetEdge(e,t,i){if(!this._operations)return;let n=t.clone();n.distance=i,this._operations.updateVertices([e.handle.leftVertex,e.handle.rightVertex],n),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,this.enableDeleteVertices&&e.button===rs.t.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===rs.t.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){null!=this._defaultTooltipInfo?this._resetTooltip():this._updateTranslateObjectTooltip(e,t)}_updateTranslateObjectTooltip(e,t){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=function(e,t,{sketchOptions:i,tooltipInfos:n,automaticLengthMeasurementUtils:a}){let r=null;switch(e){case M.XY:ra(r=n.translate,t,(e,t)=>a.autoDistanceBetweenPoints2D(rn(e),rn(t)));break;case M.XY_AXIS:ra(r=n.translateXY,t,(e,i)=>(0,ni.bA)(a.autoDistanceBetweenPoints2D(rn(e),rn(i)),ap(t)));break;case M.Z:ra(r=n.translateZ,t,nu._e)}return r.sketchOptions=i,r}(e,t,this._tooltipsContext))}_updateEdgeOffsetTooltip(e){this._pendingEdgeOffsetInfo||(this.activeTooltipInfo=rr(this.object,e,this._tooltipsContext))}_resetTooltip(){let e=this.activeTooltipInfo;if(this._pendingEdgeOffsetInfo&&"reshape-edge-offset"===e?.type)return;let t=null;(t=this._pendingEdgeOffsetInfo||null!=this._findActiveEdgeOffsetManipulatorInfo()?rr(this.object,null,this._tooltipsContext):this._defaultTooltipInfo)!==e&&(null!=e&&null!=t&&"input"===this.tooltip.mode||(this.activeTooltipInfo=t))}get _defaultTooltipInfo(){switch(this._operations?.data.type){case"polyline":case"polygon":return this._selectedVertexManipulatorInfo?this.tooltipInfos.selectedVertex:null;case"point":case"mesh":return this.tooltipInfos.movePoint;default:return null}}get _selectedVertexManipulatorInfo(){let e=this._manipulatorInfos.filter(e=>"vertex"===e.type&&e.manipulator.selected);return 1===e.length?e[0]:null}get _tooltipsContext(){let{tooltipInfos:e,activeTooltipInfo:t,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}=this;return{sketchOptions:this._sketchOptions,tooltipInfos:e,activeTooltipInfo:t,selectedVertexManipulatorInfo:this._selectedVertexManipulatorInfo,callbacks:this._tooltipCallbacks,automaticAreaMeasurementUtils:i,automaticLengthMeasurementUtils:n}}get test(){}};function rh(e){let t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}function rd(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function ru(e){return new nr.Z({x:0,y:0,z:0,spatialReference:e})}function rp(e){return"edge"===e.type&&"edgeManipulator"in e}(0,P._)([(0,U.Cb)()],rc.prototype,"_numGrabbing",void 0),(0,P._)([(0,U.Cb)()],rc.prototype,"_numDragging",void 0),(0,P._)([(0,U.Cb)()],rc.prototype,"_pendingEdgeOffsetInfo",void 0),(0,P._)([(0,U.Cb)()],rc.prototype,"_operations",null),(0,P._)([(0,U.Cb)()],rc.prototype,"_segmentLabels",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rc.prototype,"tool",void 0),(0,P._)([(0,U.Cb)()],rc.prototype,"tooltip",void 0),(0,P._)([(0,U.Cb)()],rc.prototype,"activeTooltipInfo",void 0),(0,P._)([(0,U.Cb)({readOnly:!0})],rc.prototype,"updating",null),(0,P._)([(0,U.Cb)()],rc.prototype,"manipulators",null),(0,P._)([(0,U.Cb)()],rc.prototype,"view",null),(0,P._)([(0,U.Cb)()],rc.prototype,"automaticAreaMeasurementUtils",null),(0,P._)([(0,U.Cb)()],rc.prototype,"automaticLengthMeasurementUtils",null),(0,P._)([(0,U.Cb)()],rc.prototype,"object",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableZShape",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableDeleteVertices",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableZVertex",null),(0,P._)([(0,U.Cb)()],rc.prototype,"autoHideManipulators",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableMoveObject",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableMidpoints",null),(0,P._)([(0,U.Cb)()],rc.prototype,"enableEdgeOffset",null),(0,P._)([(0,U.Cb)()],rc.prototype,"_sketchOptions",null),(0,P._)([(0,U.Cb)()],rc.prototype,"_accentColor",null),(0,P._)([(0,U.Cb)()],rc.prototype,"_tooltipsContext",null),rc=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.reshape.ReshapeOperation")],rc);let r_=(0,tE.T)(0,0,void 0,a1.Z.WGS84),rg=(0,G.Ue)(),rf=1e-6;(l=w||(w={})).Vertex=nI.jg.Custom1,l.Edge=nI.jg.Custom2,(c=S||(S={}))[c.NONE=0]="NONE",c[c.MOVING=1]="MOVING",c[c.RESHAPING=2]="RESHAPING",(h=x||(x={}))[h.ALL=0]="ALL",h[h.SELECTED_OR_ALL=1]="SELECTED_OR_ALL";let rm=class extends aL.m{constructor(e){super(e),this._reshapeOperation=null,this.events=new iM.Z,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.sketchOptions=new aV.Z,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){let e=this._reshapeOperation=new rc({tool:this});this.addHandles([e.events.on("reshape",e=>this.events.emit("reshape",e)),e.events.on("move",e=>this.events.emit("move",e)),e.events.on("vertex-add",e=>this.events.emit("vertex-add",e)),e.events.on("vertex-remove",e=>this.events.emit("vertex-remove",e)),e.events.on("immediate-click",e=>this.events.emit("immediate-click",{...e,object:this.object})),this.view.on("pointer-down",["Shift"],e=>e.stopPropagation())]),this.finishToolCreation()}destroy(){this._reshapeOperation=(0,j.SC)(this._reshapeOperation)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating||this.snappingManager?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation?.onManipulatorSelectionChanged()}get canUndo(){return this._reshapeOperation?.canUndo??!1}undo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.undo()}get canRedo(){return this._reshapeOperation?.canRedo??!1}redo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.redo()}onInputEvent(e){let t=this._reshapeOperation;t&&!t.enterInputModeIfAvailable(e)&&this.enableDeleteVertices&&"key-down"===e.type&&ro.Sn.delete.includes(e.ke
179y)&&t.removeSelectedVertices()>0&&e.stopPropagation()}reset(){}};(0,P._)([(0,U.Cb)()],rm.prototype,"_reshapeOperation",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rm.prototype,"view",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rm.prototype,"automaticAreaMeasurementUtils",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rm.prototype,"automaticLengthMeasurementUtils",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rm.prototype,"object",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableZShape",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableZVertex",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableMoveObject",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableDeleteVertices",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"autoHideManipulators",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableMidpoints",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"enableEdgeOffset",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"type",void 0),(0,P._)([(0,U.Cb)({type:aV.Z})],rm.prototype,"sketchOptions",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"snappingManager",void 0),(0,P._)([(0,U.Cb)()],rm.prototype,"updating",null),(0,P._)([(0,U.Cb)()],rm.prototype,"activeTooltipInfo",null),(0,P._)([(0,U.Cb)()],rm.prototype,"tooltip",null),(0,P._)([(0,U.Cb)()],rm.prototype,"automaticManipulatorSelection",void 0),rm=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],rm);var rv=i(33337);let rb=class extends Y.Z{constructor(e){super(e),this._interactionState=null}initialize(){this.addHandles([(0,L.gx)(()=>{let e=this._interactionState;return e&&e.angle!==e.previousAngle?{interactionState:e,angle:e.state.angle}:null},({interactionState:e})=>{this._updateMeshRotation(e)},L.Z_),(0,L.gx)(()=>{let e=this._interactionState;return e&&e.scale!==e.previousScale?{interactionState:e,scale:e.state.scale}:null},({interactionState:e})=>{this._updateMeshSize(e)},L.Z_)])}get geometry(){let e=nc(this.object);return"mesh"===e?.type?e:null}get initialAngle(){return this._interactionState?.initialAngle??0}get angle(){let e=this.geometry?.transform;if(null==e)return this._interactionState?.angle??0;let t=(0,rv.ZZ)(e.rotation)[2];return Math.abs(t)>.999999?(0,X.Vl)((0,rv.EU)(e.rotation))*Math.sign(t):0}get angleClockwise(){return-this.angle}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){return this._interactionState?.scale??1}startInteraction(){let e=new ry({angle:this.angle});this._interactionState=e;let t=()=>{this._interactionState=null};return{state:e,done:t,cancel:()=>{e.cancel(),t()}}}createUndoRecord(){return this.object.createUndoRecord()}_updateMeshRotation(e){let{geometry:t}=this;if(null==t)return;let{angle:i,previousAngle:n}=e;e.previousAngle=i;let a=(0,X.BV)(i-n);t.rotate(0,0,a)}_updateMeshSize(e){let{geometry:t}=this;if(null==t)return;let{scale:i,previousScale:n}=e;e.previousScale=i,t.scale(i/n)}};(0,P._)([(0,U.Cb)({constructOnly:!0})],rb.prototype,"object",void 0),(0,P._)([(0,U.Cb)()],rb.prototype,"geometry",null),(0,P._)([(0,U.Cb)({constructOnly:!0})],rb.prototype,"viewingMode",void 0),(0,P._)([(0,U.Cb)()],rb.prototype,"initialAngle",null),(0,P._)([(0,U.Cb)()],rb.prototype,"angle",null),(0,P._)([(0,U.Cb)()],rb.prototype,"angleClockwise",null),(0,P._)([(0,U.Cb)()],rb.prototype,"relativeAngle",null),(0,P._)([(0,U.Cb)()],rb.prototype,"relativeAngleClockwise",null),(0,P._)([(0,U.Cb)()],rb.prototype,"scale",null),(0,P._)([(0,U.Cb)()],rb.prototype,"_interactionState",void 0),rb=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter")],rb);let ry=class extends Y.Z{get state(){let{angle:e,scale:t}=this;return{angle:e,scale:t}}constructor(e){super(e),this.angle=0,this.initialAngle=0,this.previousAngle=0,this.previousScale=1,this.scale=1,this.initialAngle=e.angle,this.previousAngle=e.angle}cancel(){this.angle=this.initialAngle,this.scale=1}};(0,P._)([(0,U.Cb)()],ry.prototype,"angle",void 0),(0,P._)([(0,U.Cb)()],ry.prototype,"initialAngle",void 0),(0,P._)([(0,U.Cb)()],ry.prototype,"previousAngle",void 0),(0,P._)([(0,U.Cb)()],ry.prototype,"previousScale",void 0),(0,P._)([(0,U.Cb)()],ry.prototype,"scale",void 0),(0,P._)([(0,U.Cb)()],ry.prototype,"state",null),ry=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ScaleRotateMeshAdapter.InteractionState")],ry);let rM=class extends Y.Z{constructor(e){super(e),this.sizeAxis=null,this._interactionState=null}initialize(){this.addHandles((0,L.gx)(()=>null!=this._interactionState?this._interactionState.state:null,e=>{this._updateSymbol(e)},L.Z_))}get initialAngle(){return this._interactionState?.initialAngle??0}get angle(){var e;return null!=this._interactionState?this._interactionState.angle:null!=this._orientationReferenceSymbolLayer?(e=this._orientationReferenceSymbolLayer.heading??0,-(0,X.Vl)(e)):0}get angleClockwise(){return-this.angle}get orientation(){return this.angle}get orientationClockwise(){return this.angleClockwise}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){return this._interactionState?.scale??1}get size(){let e=this._sizeReferenceSymbolLayer;if(null==e)return null;let t=this.findLayerView(),i=this._graphicSymbol;if(null==t||null==i||"point-3d"!==i.type)return null;let n=t.getSymbolLayerSize(i,e);if("size"in n&&null!=n.size)return n.size;let a=this.sizeAxis;return"width"in n&&null!=n.width&&(null==a||"width"===a||"all"===a||"width-and-depth"===a)?n.width:"depth"in n&&null!=e.depth&&(null==a||"depth"===a||"all"===a||"width-and-depth"===a)?n.depth:"height"in n&&null!=e.height&&(null==a||"height"===a||"all"===a)?n.height:null}get _sizeReferenceSymbolLayer(){let e=this._graphicSymbol;return null==e||0===e.symbolLayers.length?null:e.symbolLayers.find(e=>"object"===e.type)}get _orientationReferenceSymbolLayer(){let e=this._graphicSymbol;return null==e||0===e.symbolLayers.length?null:e.symbolLayers.find(e=>"object"===e.type&&null!=e.heading)}get _graphicSymbol(){return null!=this.graphic?.symbol&&"point-3d"===this.graphic.symbol.type?this.graphic.symbol:null}set _graphicSymbol(e){this.graphic.symbol=e}startInteraction(){let e=this._graphicSymbol,t=this.findLayerView();if(null!=this._interactionState||null==e||null==t)return rw;let i=e.symbolLayers.map(i=>"object"===i.type?t.getSymbolLayerSize(e,i):null).toArray(),n=e.clone(),a=this.angle,r=new rS({originalSymbol:n,angle:a,initialSizes:i});this._interactionState=r;let s=()=>{this._interactionState=null};return{state:r,done:s,cancel:()=>
179{this._graphicSymbol=n,s()}}}createUndoRecord(){let e=this.graphic.symbol,t=null;return{undo:i=>{t=i.symbol,i.symbol=e},redo:i=>{e=i.symbol,i.symbol=t}}}_updateSymbol({scale:e,angle:t,originalSymbol:i,initialSizes:n}){let a=this._graphicSymbol;if(null==a||"point-3d"!==a.type)return;let r=a.clone(),s=-(0,X.BV)(t-this.initialAngle),o=!1;this._forEachObjectSymbolLayerPair(i,r,(t,i,a)=>{let r=(t.heading??0)+s;i.heading!==r&&(i.heading=r,o=!0);let l=n[a];if(null!=l&&"width"in l){l.width=this.sizeFilter(l.width),l.height=this.sizeFilter(l.height),l.depth=this.sizeFilter(l.depth);let t=l.width*e;i.width!==t&&(i.width=t,o=!0);let n=l.depth*e;i.depth!==n&&(i.depth=n,o=!0);let a=l.height*e;i.height!==a&&(i.height=a,o=!0)}}),o&&(this._graphicSymbol=r)}_forEachObjectSymbolLayerPair(e,t,i){e.symbolLayers.forEach((e,n)=>{let a=t.symbolLayers.at(n);"object"===e.type&&"object"===a.type&&i(e,a,n)})}};(0,P._)([(0,U.Cb)()],rM.prototype,"initialAngle",null),(0,P._)([(0,U.Cb)()],rM.prototype,"angle",null),(0,P._)([(0,U.Cb)()],rM.prototype,"angleClockwise",null),(0,P._)([(0,U.Cb)()],rM.prototype,"orientation",null),(0,P._)([(0,U.Cb)()],rM.prototype,"orientationClockwise",null),(0,P._)([(0,U.Cb)()],rM.prototype,"relativeAngle",null),(0,P._)([(0,U.Cb)()],rM.prototype,"relativeAngleClockwise",null),(0,P._)([(0,U.Cb)()],rM.prototype,"scale",null),(0,P._)([(0,U.Cb)()],rM.prototype,"size",null),(0,P._)([(0,U.Cb)()],rM.prototype,"sizeAxis",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rM.prototype,"graphic",void 0),(0,P._)([(0,U.Cb)()],rM.prototype,"_interactionState",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rM.prototype,"findLayerView",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rM.prototype,"sizeFilter",void 0),(0,P._)([(0,U.Cb)()],rM.prototype,"_sizeReferenceSymbolLayer",null),(0,P._)([(0,U.Cb)()],rM.prototype,"_orientationReferenceSymbolLayer",null),(0,P._)([(0,U.Cb)()],rM.prototype,"_graphicSymbol",null),rM=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ScaleRotateObjectSymbol3DAdapter")],rM);let rw={state:{angle:0,scale:0},done:()=>{},cancel:()=>{}},rS=class extends Y.Z{get state(){let{originalSymbol:e,angle:t,initialAngle:i,scale:n,initialSizes:a}=this;return{originalSymbol:e,angle:t,initialAngle:i,scale:n,initialSizes:a}}constructor(e){super(e),this.angle=0,this.initialAngle=0,this.scale=1,this.initialAngle=e.angle}};(0,P._)([(0,U.Cb)()],rS.prototype,"originalSymbol",void 0),(0,P._)([(0,U.Cb)()],rS.prototype,"angle",void 0),(0,P._)([(0,U.Cb)()],rS.prototype,"initialAngle",void 0),(0,P._)([(0,U.Cb)()],rS.prototype,"initialSizes",void 0),(0,P._)([(0,U.Cb)()],rS.prototype,"scale",void 0),(0,P._)([(0,U.Cb)()],rS.prototype,"state",null),rS=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ScaleRotateObjectSymbol3DAdapter.InteractionState")],rS);var rx=i(66764),rO=i(44795);(d=O||(O={})).ScaleIn=nI.jg.Custom2,d.ScaleOut=nI.jg.Custom3,d.RotateLeft=nI.jg.Custom4,d.RotateRight=nI.jg.Custom5,d.Unlocked=nI.jg.Custom7,d.DelayedFocused=nI.jg.Custom8,d.TouchInput=nI.jg.Custom12;let rE=class extends Y.Z{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(e){this._ringManipulator.location=e}set elevationAlignedLocation(e){this._ringManipulator.elevationAlignedLocation=e}get grabbing(){return this._ringManipulator.grabbing}set interactive(e){this._ringManipulator.interactive=e}get updating(){return!!this._activeAnimation}constructor(e){super(e),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=200,this.events=new iM.Z,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>"scale"===this._scaleRotateDragData?.mode?this.adapter.scale:1}initialize(){this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([(0,L.YP)(()=>{let{adapter:e}=this;return[e.angle,e.scale]},()=>this._updateManipulatorTransform())])}destroy(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null}startAnimation(e){this.cancelActiveAnimation(),e.start();let t=(0,rO.A)({update:({deltaTime:t})=>{e.update(t)&&this.cancelActiveAnimation()}});this._activeAnimation={...e,frameTask:t}}cancelActiveAnimation(){this._activeAnimation?.frameTask.remove(),this._activeAnimation=(0,j.SC)(this._activeAnimation)}forEachManipulator(e){e(this._ringManipulator,b.SCALE_ROTATE)}_createManipulator(){let e=this._createRingManipulator();this._ringManipulator=e,this.tool.manipulators.add(e);let t=this.tool.object,i=(0,an.Xd)(e,(e,i,n)=>{this._scaleRotateDragData=null;let a=this.adapter.startInteraction(),r={mode:"none",origin:(0,G.d9)(e.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=r,this._updateDragState();let s=ee.WM.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(e.renderLocation,s),i.next(aa(this.tool.view,(0,nD.Yq)(e.renderLocation,s,(0,nD.Ue)()))).next(e=>{let i=(0,nD.st)(e.plane),n=aw(e.renderStart,e.renderEnd,r.origin,i),s=rx.Q4.shortestSignedDiff(r.angle,n);r.angleDir=(0,X.uZ)(r.angleDir+s,-.3,.3),r.angle=n;let o=function(e,t){let i=(0,H.d)(ee.WM.get(),t.renderStart,e.origin),n=(0,H.d)(ee.WM.get(),t.renderEnd,e.origin),a=(0,H.l)(i),r=(0,H.l)(n);return 0===a?0:r/a}(r,e),l=o-this.adapter.scale;if(r.scaleDir=(0,X.uZ)(r.scaleDir+l,-.2,.2),this._onScaleChanged(),"none"===r.mode){let i=this.mode||function(e,t,i,n){let{renderStart:a,renderEnd:r}=e,s=rD(a,n,ee.WM.get()),o=rD(r,n,ee.WM.get());if(100>(0,H.s)(s,o))return null;let l=(0,H.d)(ee.WM.get(),a,i),c=(0,H.h)(ee.WM.get(),l,(0,nD.st)(t)),h=(0,H.f)(ee.WM.get(),a,c),d=rD(i,n,ee.WM.get()),u=rD(h,n,ee.WM.get()),p=(0,H.d)(ee.WM.get(),u,s),_=(0,H.d)(ee.WM.get(),s,d),g=(0,eO.re)(s,p),f=(0,eO.re)(d,_);return(0,eO.Jk)(g,o)<(0,eO.Jk)(f,o)?"rotate":"scale"}(e,e.plane,r.origin,this.tool.view.state.camera);if(null!=i){switch(i){case"rotate":this.tool.events.emit("rotate-start",{object:t,angle:0}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]});break;case"scale":this.tool.events.emit("scale-start",{object:t,xScale:1,yScale:1}),this.tool.events.emit("record-undo",{updates:[this.adapter.createUndoRecord()]})}r.mode=i}}switch(r.mode){case"rotate":a.state.angle=r.initialAngle+n;break;case"scale":a.state.scale=o,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),e.action){case"start":case"update":switch(r.mode){case"rotate":this.tool.events.emit("rotate",{object:t,angle:(0,X.BV)(r.angle)});break;case"scale":this.tool.events.emit("scale",{object:t,xScale:o,yScale:o})}break;case"end":switch(r.mode){case"rotate":this.tool.events.emit("rotate-stop",{object:t,angle:(0,X.BV)(r.angle)});break;case"scale":this.tool.events.emit("scale-stop",{object:t,xScale:o,yScale:o})}}return"end"===e.action&&(this.startAnimation(rT(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),a.done()),e}),n.next(()=>{if(a.cancel(),null!=this._scaleRotateDragData){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.events.emit("rotate-stop",{object:t,angle:0});break;case"scale":this.tool.events.emit("scale-stop",{object:t,xScale:1,yScale:1})}this.startAnimation(rT(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}})});this.addHandles([i,e.events.on("focus-changed",e=>{"focus"===e.action?this.startAnimation(function(e,t,i){let n=0,a=null,r=()=>!1;return{start:()=>{a=e.getFocused,e.getFocused=r,n=0,t()},update:e=>(n+=e,!a?.()||n>=i.delayMs?E.STOP:E.CONTINUE),destroy:()=>{a&&(e.getFocused=a),t()}}}(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),e.events.on("immediate-click",e=>{e.stopPropagation()}),(0,L.YP)(()=>this.tool.object.visible,e=>this._ringManipulator.available=e,L.nn)])}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(O.DelayedFocused,this.getFocused())}_updateDragState(){if(this._ringManipulator.updateStateEnabled(O.Unlocked,!(null!=this._scaleRotateDragData&&"none"!==this._scaleRotateDragData?.mode)),null!=this._scaleRotateDragData)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(O.ScaleIn|O.ScaleOut,!1),this._ringManipulator.updateStateEnabled(O.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(O.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(O.RotateLeft|O.RotateRight,!1),this._ringManipulator.updateStateEnabled(O.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(O.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(O.ScaleIn|O.ScaleOut|O.RotateLeft|O.RotateRight,!1)}_updateManipulatorTransform(){let e=(0,tG.Us)(ee.MP.get(),this.adapter.angle,(0,G.al)(0,0,1));if(null==e)return;let t=this.getScale(),i=(0,tG.xJ)(ee.MP.get(),(0,H.i)(ee.WM.get(),t,t,t));this._ringManipulator.modelTransform=(0,tG.Jp)(ee.MP.get(),i,e)}_createRingManipulator(){let e=(e,t,i)=>{let n=[],a=Math.ceil(128*(t-e)/(2*Math.PI));for(let r=0;r<a+1;r++){let s=e+r*(t-e)/a;n.push((0,G.al)(i*Math.cos(s),i*Math.sin(s),0))}return n},t=t=>e(0,2*Math.PI,t),i=e=>[[-e/2,0],[e/2,0],[e/2,.25],[-e/2,.25]],n=this._createMaterial(1),a=(e,t,a=n)=>
179(0,tg.x2)(a,i(t),e,[],[],!1),r=t(160),s=a(r,24),o={left:[],right:[]},l=[];for(let t=0;t<2;t++){let i=t*Math.PI-Math.PI/4,r=Math.PI/2-n9,s=i+r,c=i+Math.PI/2-r,h=e(s,c,190),d=a(h,9);l.push(h),l.push(e(s,c,201)),o.left.push(d),o.right.push(d.instantiate());for(let e=0;e<2;e++){let t=0===e,i=(0,tN.Ue)();if(t){(0,tG.bA)(i,i,[1,-1,1]),(0,tG.U1)(i,i,-s,[0,0,1]);let e=Math.round(.2*(h.length-1));i[12]=h[e][0],i[13]=h[e][1],i[14]=h[e][2]}else{(0,tG.U1)(i,i,c,[0,0,1]);let e=Math.round(.8*(h.length-1));i[12]=h[e][0],i[13]=h[e][1],i[14]=h[e][2]}let a=(0,tg.DA)(n,60,0,23,.5);(0,tg.mx)(a,i),(t?o.left:o.right).push(a)}}let c=[];for(let t=0;t<2;t++){let i=t*Math.PI-Math.PI/4,n=Math.PI/2-n8,r=e(i+n,i+Math.PI/2-n,213);c.push(a(r,9))}let h=this._createMaterial(.66),d=this._createMaterial(.5),u=this._createMaterial(.33),p=t(190),_=t(213),g=a(p,9,h),f=a(_,9,u),m=t(130),v=t(107),b=a(m,9,h),y=a(v,9,u),M=[new at(s,O.DelayedFocused),new at(s.instantiate({material:d}),nI.Q9.None)];this.mode&&"scale"!==this.mode||(M=M.concat([...c.map(e=>new at(e,O.DelayedFocused|O.Unlocked)),new at(g,O.DelayedFocused|O.ScaleIn),new at(f,O.DelayedFocused|O.ScaleIn),new at(b,O.DelayedFocused|O.ScaleOut),new at(y,O.DelayedFocused|O.ScaleOut)])),this.mode&&"rotate"!==this.mode||(M=M.concat([...o.right.map(e=>new at(e.instantiate(),O.DelayedFocused|O.Unlocked)),...o.left.map(e=>new at(e,O.DelayedFocused|O.RotateLeft)),...o.right.map(e=>new at(e,O.DelayedFocused|O.RotateRight))]));let w=[r,...l];return new nj({view:this.tool.view,renderObjects:M,autoScaleRenderObjects:!1,worldOriented:!0,radius:24,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:this.tool.object.elevationInfo,collisionType:{type:"ribbon",paths:w,direction:(0,G.al)(0,0,1)}})}_createMaterial(e){let t=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Transparent,isDecoration:!0});return this.addHandles((0,L.YP)(()=>(0,R.Ch)(this.tool.view.effectiveTheme.accentColor,e),e=>t.setParameters({color:e}),L.nn)),t}get test(){}};function rD(e,t,i){return t.projectToScreen(e,rA),(0,H.i)(i,rA[0],rA[1],0)}function rT(e,t){let i=null,n=1,a=()=>n;return{start:()=>{n=e.getScale(),i=e.getScale,e.getScale=a,t()},update:e=>(n+=((n+1)/2-n)*Math.min(3*e,1),t(),.01>Math.abs(n-1)?E.STOP:E.CONTINUE),destroy:()=>{i&&(e.getScale=i),t()}}}(0,P._)([(0,U.Cb)({constructOnly:!0})],rE.prototype,"tool",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rE.prototype,"adapter",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],rE.prototype,"sketchOptions",void 0),(0,P._)([(0,U.Cb)()],rE.prototype,"mode",void 0),(0,P._)([(0,U.Cb)()],rE.prototype,"_activeAnimation",void 0),(0,P._)([(0,U.Cb)()],rE.prototype,"updating",null),rE=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ScaleRotateTransform")],rE),(u=E||(E={}))[u.CONTINUE=0]="CONTINUE",u[u.STOP=1]="STOP";let rA=(0,k.s1)();var rC=i(10972);let rP=class extends(0,rC.A)(aF.h){constructor(e){super(e),this.type="transform-mesh",this.orientation=(0,a7.Zq)(),this.scale=(0,a7.Se)(),this.allFields.forEach(e=>{e.lockable=!1,e.setActual(null)})}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic,orientation:this.orientation.actual,scale:this.scale.actual}}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};(0,P._)([(0,U.Cb)()],rP.prototype,"key",null),(0,P._)([(0,U.Cb)()],rP.prototype,"allFields",null),rP=(0,P._)([(0,z.j)("esri.views.interactive.tooltip.infos.TransformMeshTooltipInfo")],rP);let rR=class extends(0,rC.A)(aF.h){constructor(e){super(e),this.type="transform-point",this.orientation=(0,a7.Zq)({readOnly:!0}),this.size=(0,a7.tv)({readOnly:!0}),this.allFields.forEach(e=>{e.lockable=!1,e.setActual(null)})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.size]}};(0,P._)([(0,U.Cb)()],rR.prototype,"allFields",null),rR=(0,P._)([(0,z.j)("esri.views.interactive.tooltip.infos.TransformPointTooltipInfo")],rR);let rI=class extends aL.m{constructor(e){super(e),this.events=new iM.Z,this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.sketchOptions=new aV.Z,this.type="transform-3d",this._updatingHandles=new na.R,this._scaleRotate=null}initialize(){let{events:e,object:t,view:i}=this;this.tooltip=(0,i5.vG)(()=>({view:i,options:this.sketchOptions.tooltips})),this._moveManipulation=new aP({tool:this,view:i,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&nh(t.operations,t.elevationInfo),radius:aP.radiusForSymbol(t.graphic?.symbol)}),this._moveManipulation.forEachManipulator(t=>this.addHandles(t.events.on("immediate-click",t=>{e.emit("immediate-click",{...t,object:this.object}),t.stopPropagation()})));let n=t.elevationInfo;if(this._moveManipulation.elevationInfo=n,this.addHandles(ir(t)),this._moveManipulation.createManipulatedObjectDragPipeline((e,a,r,s,o)=>
179{if(e===M.XY){let{snappingStep:e,cancelSnapping:a}=(0,aH.W)({snappingContext:new az.N({elevationInfo:n,pointer:o,editGeometryOperations:aU.c.fromGeometry(new nr.Z({spatialReference:t.operations?.data.spatialReference}),i.state.viewingMode),visualizer:new t6,excludeFeature:t.graphic}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});s=s.next(a),r=r.next((0,an.Mz)(this.view,n)).next(...e)}return{steps:r,cancel:s}},t,t=>{let{action:i,object:n,dxScreen:a,dyScreen:r}=t,s={object:n,dxScreen:a,dyScreen:r};switch(i){case"start":this._emitRecordUndo(),e.emit("translate-start",s);break;case"update":e.emit("translate",s);break;case"end":e.emit("translate-stop",s)}}),this._moveManipulation.angle=null!=this._scaleRotate?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles((0,L.YP)(()=>this._scaleRotateAdapter.angle,()=>this._updateMoveAngle())),this.enableScaling||this.enableRotation){let e=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new rE({tool:this,mode:e,adapter:this._scaleRotateAdapter,sketchOptions:this.sketchOptions}),this.addHandles(this._scaleRotate.events.on("scale-changed",()=>this._onScaleChanged()))}this.addHandles([n4({view:this.view,object:t,forEachManipulator:e=>this._forEachManipulator(e),onManipulatorsChanged:()=>(0,I.kB)()}),t.on("committed",()=>this._onGeometryChanged()),this._hideManipulatorsForObjectState(),(0,L.YP)(()=>i.scale,()=>this._updateMoveAngle())].filter(ne.pC)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator(e=>{e instanceof nj&&this.addHandles(e.events.on("grab-changed",()=>this._updateManipulatorsInteractive()))});let a=i?.type,{sketchOptions:r}=this;this._meshTooltipInfo=new rP({viewType:a,sketchOptions:r}),this._pointTooltipInfo=new rR({viewType:a,sketchOptions:r});let s={object:t,dxScreen:0,dyScreen:0},o={onBeforeUpdate:()=>this.endDrag(),onMoveStart:()=>{this._emitRecordUndo(),e.emit("translate-start",{...s})},onMove:()=>e.emit("translate",{...s}),onMoveStop:()=>e.emit("translate-stop",{...s}),onRotateStart:i=>{this._emitRecordUndo(),e.emit("rotate-start",{object:t,angle:i})},onRotate:i=>e.emit("rotate",{object:t,angle:i}),onRotateStop:i=>e.emit("rotate-stop",{object:t,angle:i}),onScaleStart:(i,n)=>{this._emitRecordUndo(),e.emit("scale-start",{object:t,xScale:i,yScale:n})},onScale:(i,n)=>e.emit("scale",{object:t,xScale:i,yScale:n}),onScaleStop:(i,n)=>e.emit("scale-stop",{object:t,xScale:i,yScale:n})};this.addHandles(np(this.tooltip,this.object,()=>({sketchOptions:this.sketchOptions,activeTooltipInfo:this.activeTooltipInfo,callbacks:o,scaleRotateTransform:this._scaleRotate}))),this.finishToolCreation()}destroy(){this.tooltip.destroy(),this._moveManipulation.destroy(),this._scaleRotate=(0,j.SC)(this._scaleRotate),this._scaleRotateAdapter=(0,j.SC)(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set("view",null),this._set("object",null)}onInputEvent(e){if(!this.destroyed&&!(0,i5._i)(e,this.tooltip))return super.onInputEvent(e)}_updateManipulatorsInteractive(){null!=this._scaleRotate&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){let e=nc(this.object);return"mesh"===e?.type?new rb({object:this.object,viewingMode:this.view.state.viewingMode}):new rM({graphic:this.object.graphic,sizeFilter:e=>this._enforceNonZeroSize(e),findLayerView:()=>this.view.allLayerViews.find(e=>e.layer===this.object.graphic?.layer),sizeAxis:this.sketchOptions?.tooltips?.visualVariables?.size?.axis??null})}_forEachManipulator(e){this._moveManipulation?.forEachManipulator(e),this._scaleRotate?.forEachManipulator(e)}_hideManipulatorsForObjectState(){return(0,L.YP)(()=>this.object.visible,e=>{this._forEachManipulator(t=>t.available=e),this._moveManipulation.zManipulation.available=e&&this.enableZ&&nh(this.object.operations,this.object.elevationInfo)})}_emitRecordUndo(){this.events.emit("record-undo",{updates:[this.object.createUndoRecord()]})}set snapToScene(e){this._moveManipulation&&(this._moveManipulation.snapToScene=e),this._set("snapToScene",e)}get updating(){return this._updatingHandles.updating||!!this._scaleRotate?.updating}get activeTooltipInfo(){return"mesh"===nc(this.object)?.type?this._meshTooltipInfo:this._pointTooltipInfo}set location(e){this._moveManipulation.location=e,this._scaleRotate&&(this._scaleRotate.location=e)}set elevationAlignedLocation(e){this._moveManipulation.elevationAlignedLocation=e,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=e)}reset(){}onHide(){this._scaleRotate?.cancelActiveAnimation()}_onScaleChanged(){null!=this._scaleRotate&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){let{view:e}=this,t=e.state.viewingMode===eV.JY.Local||e.scale<1e6;this._moveManipulation.angle=t?this._scaleRotateAdapter.angle:0}_onGeometryChanged(){ax(this,this.object)}_enforceNonZeroSize(e){return e||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){}};(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],rI.prototype,"view",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],rI.prototype,"object",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],rI.prototype,"enableZ",void 0),(0,P._)([(0,U.Cb)()],rI.prototype,"enableRotation",void 0),(0,P._)([(0,U.Cb)()],rI.prototype,"enableScaling",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,t
179ype:aV.Z})],rI.prototype,"sketchOptions",void 0),(0,P._)([(0,U.Cb)({value:!1})],rI.prototype,"snapToScene",null),(0,P._)([(0,U.Cb)({constructOnly:!0})],rI.prototype,"snappingManager",void 0),(0,P._)([(0,U.Cb)({readOnly:!0})],rI.prototype,"type",void 0),(0,P._)([(0,U.Cb)({readOnly:!0})],rI.prototype,"updating",null),(0,P._)([(0,U.Cb)()],rI.prototype,"activeTooltipInfo",null),rI=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.TransformTool3D")],rI);var rj=i(57864),rL=i(94931),rU=i(31569);let rV=class extends rj.Z.ClonableMixin(rL.Z){constructor(e){super(e),this.type="plane",this.position=null,this.heading=0,this.tilt=0,this.width=10,this.height=10}equals(e){return this.heading===e.heading&&this.tilt===e.tilt&&this.width===e.width&&this.height===e.height&&(0,j._W)(this.position,e.position)}};(0,P._)([(0,U.Cb)({type:["plane"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],rV.prototype,"type",void 0),(0,P._)([(0,U.Cb)({type:nr.Z,json:{write:{isRequired:!0}}})],rV.prototype,"position",void 0),(0,P._)([(0,U.Cb)({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}}),(0,rU.p)(e=>rx.BV.normalize((0,nn.q9)(e),0,!0))],rV.prototype,"heading",void 0),(0,P._)([(0,U.Cb)({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}}),(0,rU.p)(e=>rx.BV.normalize((0,nn.q9)(e),0,!0))],rV.prototype,"tilt",void 0),(0,P._)([(0,U.Cb)({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],rV.prototype,"width",void 0),(0,P._)([(0,U.Cb)({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],rV.prototype,"height",void 0),rV=(0,P._)([(0,z.j)("esri.analysis.SlicePlane")],rV),i(47259),i(30018);var rz=i(25462);(0,eM.al)(0,0,0,.04),(0,V.Z)("mac"),(0,X.Vl)(45),(0,X.Vl)(5),(0,tN.Ue)(),i(53977);var rH=i(34299),rG=i(59770),rN=i(68792);function rF(e){return .3*Math.min((0,H.l)(e.basis1),(0,H.l)(e.basis2))}function rk(e){return 0!==e.direction[0]&&0!==e.direction[1]}i(64955),i(11236),(p=D||(D={}))[p.POSITIVE_X=0]="POSITIVE_X",p[p.POSITIVE_Y=1]="POSITIVE_Y",p[p.NEGATIVE_X=2]="NEGATIVE_X",p[p.NEGATIVE_Y=3]="NEGATIVE_Y";let rZ=nI.jg.Custom1;(_=T||(T={}))[_.HEADING=1]="HEADING",_[_.TILT=2]="TILT",(g=A||(A={}))[g.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",g[g.HORIZONTAL=1]="HORIZONTAL",g[g.VERTICAL=2]="VERTICAL",g[g.TILTED=3]="TILTED";let rW=nI.jg.Custom2,rY=((0,eO.Ue)(),Math.PI/2),rB=nI.jg.Custom1,rX=nI.jg.Custom2;var rq=i(48872);(f=C||(C={}))[f.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",f[f.CENTER_ON_ARROW=1]="CENTER_ON_ARROW";class rQ extends nj{constructor(e,t){let i=new tv.U({width:1,renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0}),n=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Opaque,isDecoration:!0}),a=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Opaque,isDecoration:!0}),r=new tJ.E({cullFace:tl.Vr.Back,renderOccluded:tf.yD.Opaque,isDecoration:!0}),s=new tJ.E({writeDepth:!1,cullFace:tl.Vr.Front,renderOccluded:tf.yD.Transparent,isDecoration:!0});super({view:e,...function({offsetMode:e,tubeMaterial:t,tipMaterial:i,capMaterial:n,outlineMaterial:a,calloutMaterial:r}){let s=e===C.CENTER_ON_CALLOUT?40:0,o=[(0,G.al)(s,0,-24),(0,G.al)(s,0,24)],l=function(e,t){let i=(0,H.d)((0,G.Ue)(),e[e.length-1],e[e.length-2]);(0,H.n)(i,i),(0,H.g)(i,i,22.5),(0,H.f)(i,i,e[e.length-1]);{let t=(0,H.d)((0,G.Ue)(),e[0],e[1]);return(0,H.n)(t,t),(0,H.g)(t,t,22.5),(0,H.f)(t,t,e[0]),[t,...e,i]}}(o),c=rJ({vertices:o,padding:0,materials:{tube:t,tip:i,cap:n}}),h=rJ({vertices:o,padding:2.25,materials:{tube:a,tip:a,cap:a}}),d=(0,tg.rh)(r,[[s,0,0],[s-40,0,0]]),u=(0,tg.rh)(r,[[s,0,0],[s-40,0,0]]);return{renderObjects:[...c.normal.map(e=>new at(e,nI.Q9.Unfocused|rZ)),...h.normal.map(e=>new at(e,nI.Q9.Unfocused|rZ)),new at(d,nI.Q9.Unfocused|rZ|rW),...c.focused.map(e=>new at(e,nI.Q9.Focused|rZ)),...h.focused.map(e=>new at(e,nI.Q9.Focused|rZ)),new at(u,nI.Q9.Focused|rZ|rW)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[l]},collisionPriority:1,radius:11,state:rZ}}({offsetMode:t,tubeMaterial:n,tipMaterial:a,capMaterial:r,outlineMaterial:s,calloutMaterial:i}
179)}),this._themeHandle=(0,L.YP)(()=>e.effectiveTheme.accentColor,e=>{let t=(0,R.mj)(e),o=W.Z.toUnitRGBA(e),l=W.Z.toUnitRGBA(t),c=W.Z.toUnitRGBA(W.Z.blendColors(t,e,.4)),h=W.Z.toUnitRGBA(W.Z.blendColors(t,e,.14));i.setParameters({color:o}),n.setParameters({color:h}),a.setParameters({color:l}),r.setParameters({color:c}),s.setParameters({color:o})},L.nn)}destroy(){this._themeHandle.remove(),super.destroy()}}function rJ({vertices:e,padding:t,materials:i}){let n=n=>{let a=e.slice(),r=(0,H.d)(ee.WM.get(),a[0],a[1]);(0,H.n)(r,r);let s=(0,H.d)(ee.WM.get(),a[a.length-1],a[a.length-2]);if((0,H.n)(s,s),t>0){let e=(0,H.g)((0,G.Ue)(),s,-t);a[a.length-1]=(0,H.f)(e,e,a[a.length-1]);let i=(0,H.g)((0,G.Ue)(),r,-t);a[0]=(0,H.f)(i,i,a[0])}let o=n?1.15:1,l=22.5*o,c=11*o,h=(0,tG.yR)(ee.MP.get());if(t>0){let e=l/4,i=(0,H.i)(ee.WM.get(),0,e,0),n=1+t/e;(0,tG.Iu)(h,h,i),(0,tG.bA)(h,h,(0,H.i)(ee.WM.get(),n,n,n)),(0,tG.Iu)(h,h,(0,H.g)(i,i,-1/n))}let d=(0,tG.yR)((0,tN.Ue)()),u=(0,G.al)(0,1,0),p=(0,tG.en)((0,tN.Ue)(),(0,rq.b0)(ee.vD.get(),u,s));p[12]=a[a.length-1][0],p[13]=a[a.length-1][1],p[14]=a[a.length-1][2],(0,tG.Jp)(p,p,h);let _=function(e,t,i){let n=[];for(let t=0;t<12;t++){let i=t/12*2*Math.PI;n.push([Math.cos(i)*e,Math.sin(i)*e])}return(0,tg.x2)(i,n,t,[],[],!1)}(3*(n?1.15:1)+t,a,i.tube);_.transformation=d;let g=[_],f=i.tip,m=(0,tg.QL)(f,l,c,24,!1,!1,!0);m.transformation=p,g.push(m);let v=i.cap,b=(0,tg.QL)(v,l,c,24,!1,!0,!1);b.transformation=p,g.push(b);let y=(0,tG.en)((0,tN.Ue)(),(0,rq.b0)(ee.vD.get(),u,r));return y[12]=a[0][0],y[13]=a[0][1],y[14]=a[0][2],(0,tG.Jp)(y,y,h),g.push(m.instantiate({transformation:y})),g.push(b.instantiate({transformation:y})),g};return{normal:n(!1),focused:n(!0)}}class r${get _object(){return this._tool.object}get _operations(){return this._object.operations}constructor(e,t,i){this._tool=e,this._bounds=t,this._automaticLengthMeasurementUtils=i,this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null;let n=this._tool,a=n.view;this.moveXYObjectManipulation=new aI({view:a,tool:n,object:this._object}),n.addHandles(this._createMoveXYObjectDragPipeline()),this.moveZManipulator=new rQ(a,C.CENTER_ON_CALLOUT),this.moveZManipulator.state|=rW,n.manipulators.add(this.moveZManipulator),n.addHandles(this._createMoveZDragPipeline()),n.addHandles(n.events.on("translate-stop",()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null}))}destroy(){this.moveXYObjectManipulation.destroy(),this._tool.manipulators.remove(this.moveZManipulator),this.moveZManipulator.destroy()}forEachManipulator(e){this.moveXYObjectManipulation.forEachManipulator(e),e(this.moveZManipulator,b.TRANSLATE_Z)}updateManipulators(e,t){let i=this.moveZManipulator,n=(0,tG.jI)(ee.MP.get(),e,Math.PI);n[12]=0,n[13]=0,n[14]=0,i.modelTransform=n,i.renderLocation=(0,H.d)(ee.WM.get(),t.origin,t.basis1)}getUpdatedTooltipInfo(){return this.moveXYObjectManipulation.grabbing||this.moveXYObjectManipulation.dragging?this._computeMoveXYTooltipInfo():this.moveZManipulator.focused?this._computeMoveZTooltipInfo():null}_computeMoveXYTooltipInfo(){let e=this._tool,t=this._moveXYTooltipInfo??=new aN.E({sketchOptions:e.sketchOptions});if(this.moveXYObjectManipulation.dragging){let i=this._bounds,n=i.mapBoundsStart.origin,a=i.mapBounds.origin,{renderSpatialReference:r}=e.view;if(!r)return null;let s=this._automaticLengthMeasurementUtils.autoDistance2D(n,a,r);if(null==s)return null;t.distance=s}else t.distance=ni.yP;return t}_computeMoveZTooltipInfo(){let e=this._tool,t=this._moveZTooltipInfo??=new aZ({sketchOptions:e.sketchOptions});if(this.moveZManipulator.dragging){let i=this._bounds,n=i.mapBoundsStart.origin,a=i.mapBounds.origin,{renderSpatialReference:r}=e.view;if(!r)return null;let s=(0,nu.Cr)(n,a,r);if(null==s)return null;t.distance=s}else t.distance=ni.yP;return t}_createMoveXYObjectDragPipeline(){return this.moveXYObjectManipulation.createDragPipeline((e,t,i)=>this._buildMoveDragPipeline(t,i))}_createMoveZDragPipeline(){if(!this._operations)return(0,I.kB)();let e=this._operations.data.spatialReference;return(0,an.Xd)(this.moveZManipulator,(t,i,n)=>{let a=(0,G.d9)(t.renderLocation),r=i.next(ao(this._tool.view,a,e)).next((0,an.zh)());this._buildMoveDragPipeline(r,n)})}_buildMoveDragPipeline(e,t){let{_tool:i,_object:n}=this;e.next(e=>("start"===e.action&&(i.inputState={type:"move"},this._bounds.backupMapBounds(),i.events.emit("translate-start",{object:n,dxScreen:e.screenDeltaX,dyScreen:e.screenDeltaY})),e)).next((0,an.AN)()).next(this._updateGeometry()).next(e=>{let t={object:n,dxScreen:e.screenDeltaX,dyScreen:e.screenDeltaY};switch(e.action){case"start":case"update":(e.mapEnd.x-e.mapStart.x||e.mapEnd.y-e.mapStart.y||(e.mapEnd.z??0)-(e.mapStart.z??0))&&i.events.emit("translate",t);break;case"end":i.inputState=null,i.events.emit("translate-stop",t)}return e}),t.next(()=>{null!=i.inputState&&i.events.emit("translate-stop",{object:n,dxScreen:0,dyScreen:0}),i.cancelDrag()})}_updateGeometry(){let e=this._tool;return t=>{if(null==e.inputState||"move"!==e.inputState.type)return t;let i="start"===t.action?nd.b.NEW_STEP:nd.b.ACCUMULATE_STEPS;if(this._operations){let e=this._operations.move(t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);this._bounds.updateMapBoundsFromOperation(e)}return t}}}var rK=i(38744),r0=i(75147),r1=i(98844);class r2 extends ek.A{constructor(e,t){super(e,t,new eF.J(r1.I,()=>i.e(53521).then(i.bind(i,53521))),r3)}_getPipelineState(e,t){let{oitPass:i,output:n,hasOccludees:a,cullFace:r}=e,s=i===iU.M.NONE;return(0,eW.sm)({blending:(0,iC.c1)(n)?s?eW.Zo:(0,iV.j7)(i):null,culling:(0,eW.zp)(r),depthTest:{func:(0,iV.Bh)(i)},depthWrite:(0,iV.W$)(e),drawBuffers:(0,iV.u_)(i,n),colorWrite:eW.gf,stencilWrite:a?r0.s3:null,stencilTest:a?t?r0.eD:r0.RY:null,polygonOffset:(0,iV.eZ)(e)})}initializePipeline(e){return this._occludeePipeline=this._getPipelineState(e,!0),this._getPipelineState(e,!1)}getPipeline(e){return e?this._occludeePipeline:super.getPipeline()}}let r3=new Map([[e2.T.POSITION,0],[e2.T.UV0,2],[e2.T.PERSPECTIVEDIVIDE,3]]);
179class r4 extends ik.W{constructor(e){super(),this.draped=e,this.cullFace=tl.Vr.None,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.perspectiveInterpolation=!0,this.textureCoordinateType=iN.I.None,this.emissionSource=iF.jo.None,this.discardInvisibleFragments=!0,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1,this.snowCover=!1}}(0,P._)([(0,tr.o)({count:tl.Vr.COUNT})],r4.prototype,"cullFace",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"enableOffset",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"writeDepth",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"hasOccludees",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"terrainDepthTest",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"cullAboveTerrain",void 0),(0,P._)([(0,tr.o)()],r4.prototype,"perspectiveInterpolation",void 0);class r5 extends rN.c{constructor(e){super(e,r6),this.vertexAttributeLocations=r3,this.supportsEdges=!0,this.produces=new Map([[iI.r.OPAQUE_MATERIAL,e=>(0,iC.Gy)(e)],[iI.r.TRANSPARENT_MATERIAL,e=>(0,iC.D5)(e)&&this.parameters.writeDepth],[iI.r.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,e=>(0,iC.D5)(e)&&!this.parameters.writeDepth],[iI.r.DRAPED_MATERIAL,e=>(0,iC.D5)(e)||(0,iC.Gy)(e)]]),this._configuration=new r4(e.draped)}dispose(){this.setParameters({texture:void 0})}getConfiguration(e,t){return super.getConfiguration(e,t,this._configuration),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=t.hasOccludees,this._configuration.oitPass=t.oitPass,this._configuration.enableOffset=t.camera.relativeElevation<iV.ve,this._configuration.terrainDepthTest=t.terrainDepthTest,this._configuration.cullAboveTerrain=t.cullAboveTerrain,this._configuration.perspectiveInterpolation=this.parameters.perspectiveInterpolation,this._configuration}get visible(){return!0}createGLMaterial(e){return new r9(e)}createBufferWriter(){let e=rG.qj;return this.parameters.perspectiveInterpolation&&(e=e.clone().f32(e2.T.PERSPECTIVEDIVIDE)),new r8(e)}}class r9 extends iP.Z{constructor(e){super({...e,...e.material.parameters}),this.parameters=e;let t=this._material.parameters.texture;t.update&&e.textures.updater.add(t)}dispose(){this.parameters.textures.updater.remove(this._material.parameters.texture)}beginSlot(e){return this.getTechnique(r2,e)}}class r8 extends rH.G{write(e,t,i,n,a,r){for(let n of this.vertexBufferLayout.fields.keys()){let s=i.get(n);if(s){if(n===e2.T.PERSPECTIVEDIVIDE){(0,ij.hu)(1===s.size);let e=a.getField(n,iA.ly);e&&(0,iL.XW)(s,e,r)}else(0,iL.i9)(n,s,e,t,a,r)}}return null}}class r6 extends tf.Mt{constructor(e,t){super(),this.texture=e,this.draped=t,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=tl.Vr.None,this.opacity=1,this.perspectiveInterpolation=!1}get glTexture(){return this.texture.glTexture}}class r7 extends nj{constructor(e,t){let i=t((0,R.G)(e.effectiveTheme.accentColor,.5),(0,R.mj)(e.effectiveTheme.accentColor)),n=new r5({draped:!1,texture:i.texture,writeDepth:!1,renderOccluded:tf.yD.Opaque,isDecoration:!0}),a=ay.calloutWidth,r=new tv.U({width:a,renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0});super({view:e,...function({imageMaterial:e,calloutMaterial:t}){let{focusMultiplier:i,calloutLength:n,discRadius:a}=ay,r=a*i,s=(e,t)=>{let i=[0,1,2,2,3,0];return new tQ.Z(t,[[e2.T.POSITION,new tq.a([n-e,-e,0,n+e,-e,0,n+e,e,0,n-e,e,0],i,3,!0)],[e2.T.UV0,new tq.a([0,0,1,0,1,1,0,1],i,2,!0)]])},o=(0,tg.rh)(t,[[0,0,0],[n-a,0,0]]),l=(0,tg.rh)(t,[[0,0,0],[n-r,0,0]]);return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[n,0,0]},focusMultiplier:i,radius:a,renderObjects:[new at(s(a,e),nI.Q9.Unfocused|rZ),new at(o,nI.Q9.Unfocused|rZ),new at(s(r,e),nI.Q9.Focused|rZ),new at(l,nI.Q9.Focused|rZ)],state:rZ}}({imageMaterial:n,calloutMaterial:r})}),this._material=n,this._textureHandle=i,this._themeHandle=(0,L.YP)(()=>e.effectiveTheme.accentColor,e=>{let i=(0,R.G)(e,.5),a=(0,R.mj)(e),s=this._textureHandle;this._textureHandle=t(i,a),n.setParameters({texture:this._textureHandle.texture}),s?.release(),r.setParameters({color:W.Z.toUnitRGBA(e)})},L.nn)}destroy(){this._textureHandle=(0,j.RY)(this._textureHandle),this._themeHandle.remove(),this._material.dispose(),super.destroy()}}var se=i(75370),st=i(63006);class si{get _object(){return this._tool.object}get _operations(){return this._object.operations}constructor(e,t,i){this._tool=e,this._bounds=t,this._snapRotation=i,this._rotateTooltipInfo=null,this._startAngle=0,this._endAngle=0;let n=this._tool,a=n.view,r=!a.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this.rotateManipulator=new r7(a,(e,t)=>(function(e,t){let{accentColor:i,contrastColor:n,preMultiplyAlpha:a}=t;return e.fromData(`heading-rotate:[accent:${i},contrast:${n},size:64]`,()=>{var e,t;return new rK.x((e="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxwYXRoIGQ9Ik0yOCAwYTI4IDI4IDAgMSAxIDAgNTYgMjggMjggMCAwIDEgMC01NiIgY2x
179hc3M9ImFjY2VudC1maWxsIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSI0Ljk5IiBkPSJNMjAuMDUgNDAuODZhMTUuMDUgMTUuMDUgMCAwIDAgMTcuMTQtMS41IDE1LjA1IDE1LjA1IDAgMCAwIDQuNDctMTYuNjUgMTUuMDUgMTUuMDUgMCAwIDAtMjIuNzItNy4xNSAxNS4wNSAxNS4wNSAwIDAgMC01LjUgNy4xNSIgY2xhc3M9ImNvbnRyYXN0LXN0cm9rZSIvPjxwYXRoIGQ9Im0xMC45NyAzNS41NyA1LjM4IDEyLjA3IDcuNzktMTMuNDd6IiBjbGFzcz0iY29udHJhc3QtZmlsbCIvPjwvc3ZnPg==",t={accentColor:i,contrastColor:n,size:64},function(e,t){let i=new Image(t,t);return i.src=e,i}(function(e){let t=(new XMLSerializer).serializeToString(e);return`data:image/svg+xml;base64,${btoa(t)}`}(function(e,{accentColor:t,contrastColor:i}){let n=t.toHex(),a=t.a,r=i.toHex(),s=i.a,o=e.getElementsByTagNameNS("http://www.w3.org/2000/svg","style").namedItem("theme-style");return o&&(o.innerHTML=`
180      .contrast-fill { fill: ${r}; fill-opacity: ${s}; }
181      .contrast-stroke { stroke: ${r}; stroke-opacity: ${s};  }
182      .accent-fill { fill: ${n}; fill-opacity: ${a}; }
183      .accent-stroke { stroke: ${n}; stroke-opacity:  ${a}; }`),e}(function(e){let t=atob(e.split(",")[1]);return(new DOMParser).parseFromString(t,"image/svg+xml")}(e),t)),t.size)),{mipmap:!0,reloadable:!0,preMultiplyAlpha:a})})})(a.stage.textures,{accentColor:e,contrastColor:t,preMultiplyAlpha:r})),n.addHandles([this.rotateManipulator.events.on("grab-changed",e=>this._onGrabChanged(e)),this._createRotateDragPipeline(this.rotateManipulator)]),n.manipulators.add(this.rotateManipulator),n.addHandles([n.events.on("rotate-start",e=>this._startAngle=e.angle),n.events.on("rotate",e=>this._endAngle=e.angle),n.events.on("rotate-stop",()=>{this._startAngle=0,this._endAngle=0})])}destroy(){this._tool.manipulators.remove(this.rotateManipulator),this.rotateManipulator.destroy()}forEachManipulator(e){e(this.rotateManipulator,b.ROTATE)}updateManipulators(e,t){let i=this._bounds.mapBounds.plane[2]<0?Math.PI:0,n=(0,tG.lM)(ee.MP.get(),e,i);n[12]=0,n[13]=0,n[14]=0,this.rotateManipulator.modelTransform=n,this.rotateManipulator.renderLocation=(0,H.f)(ee.WM.get(),t.origin,t.basis1)}getUpdatedTooltipInfo(){return this.rotateManipulator.focused?this._computeRotateTooltipInfo():null}_computeRotateTooltipInfo(){let e=this._rotateTooltipInfo??=new st.c({sketchOptions:this._tool.sketchOptions});return e.angle=this._startAngle-this._endAngle,e}_onGrabChanged({action:e,screenPoint:t}){let i=this._tool,n=this._bounds;if("start"!==e||!t)return;let a=function(e,t,i,n){let a=t.worldUpAtPosition(e.origin,ee.WM.get()),r=ee.WM.get();switch(i){case T.HEADING:(0,H.c)(r,a);break;case T.TILT:(0,H.c)(r,e.basis1)}return(0,nD.Yq)(e.origin,r,n)}(n.displayBounds,i.view.renderCoordsHelper,T.HEADING,(0,nD.Ue)()),r=nC(i.view.state.camera,t);(0,nD.BR)(a,r,ee.WM.get())&&(n.backupMapBounds(),i.inputState={type:"rotate",rotatePlane:a})}_createRotateDragPipeline(e){let{_tool:t,_object:i}=this;return(0,an.Xd)(e,(e,n,a)=>{let r=t.inputState;null!=r&&(n.next(e=>("start"===e.action&&t.events.emit("rotate-start",{object:i,angle:0}),e)).next(aa(t.view,r.rotatePlane)).next(this._renderPlaneToAngle()).next(...this._snapRotation()).next(this._updateGeometry()).next(e=>{let n={object:i,angle:(0,X.BV)(e.rotateAngle)};switch(e.action){case"start":case"update":t.events.emit("rotate",n);break;case"end":t.inputState=null,t.events.emit("rotate-stop",n)}return e}),a.next(()=>{null!=t.inputState&&t.events.emit("rotate-stop",{object:i,angle:0}),t.cancelDrag()}))})}_renderPlaneToAngle(){return e=>{let t=aw(e.renderStart,e.renderEnd,this._bounds.displayBounds.origin,(0,nD.st)(e.plane));return{...e,rotateAngle:t}}}_updateGeometry(){let e=this._bounds;return t=>{let i=(0,H.c)((0,G.Ue)(),e.mapBoundsStart.origin),n="start"===t.action?nd.b.NEW_STEP:nd.b.ACCUMULATE_STEPS;if(this._operations){let a=this._operations.rotate(i,t.rotateAngle,n,se.w.REPLACE);(0,rz.a)(e.mapBoundsStart,e.mapBounds),e.updateMapBoundsFromOperation(a)}return t}}}class sn extends nj{constructor(e,t){let i=rk(t),n=i?4:1,a={renderOccluded:tf.yD.OccludeAndTransparent,isDecoration:!0},r=new tv.U({...a,width:n}),s=new tv.U({...a,width:2*n}),o=new tv.U({...a,width:1});super({view:e,...aM,...function({isCorner:e,unfocusedMaterial:t,focusedMaterial:i,outlineMaterial:n}){let a=e?[(0,G.al)(1,0,0),(0,G.al)(0,0,0),(0,G.al)(0,1,0)]:[(0,G.al)(1,0,0),(0,G.al)(-1,0,0)];return{renderObjects:[new at((0,tg.rh)(t,a),nI.Q9.Unfocused|rB),new at((0,tg.rh)(i,a),nI.Q9.Focused|rB),new at((0,tg.rh)(n,a),rX)],collisionType:{type:"line",paths:[a]},radius:e?6:4,state:rB}}({isCorner:i,unfocusedMaterial:r,focusedMaterial:s,outlineMaterial:o})}),this._themeHandle=(0,L.YP)(()=>e.effectiveTheme.accentColor,e=>{let t=W.Z.toUnitRGBA(e);r.setParameters({color:t}),s.setParameters({color:t}),o.setParameters({color:t})},L.nn)}destroy(){this._themeHandle.remove(),super.destroy()}}var sa=i(60256),sr=i(76798);class ss{constructor(e,t){this._tool=e,this.mapBounds=(0,rz.d)(),this.mapBoundsStart=(0,rz.d)(),this.displayBounds=(0,rz.d)(),e.addHandles((0,L.on)(()=>e.object,"modified-externally",()=>this._resetMapBounds(),{onListenerAdd:()=>this._resetMapBounds()})),this._onDisplayBoundsChanged=t}get displayBoundsMargin(){let{view:e,object:t}=this._tool,i=nc(t),n=e.pointsOfInterest?.centerOnSurfaceFrequent.location??i?.extent?.center;return n?so*e.pixelSizeAt(n):0}backupMapBounds(){(0,rz.a)(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged?.()}updateMapBoundsFromOperation(e){(0,sa.nn)(e,this.mapBounds),this.updateDisplayBounds()}updateMapBoundsFromOperationInverse(e){(0,sa.ui)(e,this.mapBounds),this.updateDisplayBounds()}
183_resetMapBounds(){this._calculateMapBounds(),this.updateDisplayBounds()}_calculateMapBounds(){let{view:e,attachmentOrigin:t,object:i}=this._tool,n=i.operations?.data;if(!n)return;let a=n.geometry;this.spatialReference=a.spatialReference;let r=function(e){let t=no(e);return(0,$.al)(Math.cos(t),Math.sin(t))}(a);(0,J.bA)(r,r,-1);let s=t?e.pixelSizeAt(t,a.spatialReference):0,o=n.coordinateHelper.hasZ()&&"on-the-ground"!==i.elevationInfo.mode;(0,sa.lv)(r,n,sl*s,this.mapBounds,o)}_calculateDisplayBounds(){let{view:e,attachmentOrigin:t}=this._tool,i=t?.z??(0,tk.w7)(this.mapBounds.origin,e.elevationProvider,tZ.o.fromElevationInfo(this._tool.object.elevationInfo),e.renderCoordsHelper);!function(e,t,i,n,a=0,r){r||(r=(0,rz.d)());let s=ee.WM.get();(0,H.f)(s,e.origin,e.basis1),(0,H.f)(s,s,e.basis2),i.toRenderCoords(s,n,s);let o=ee.WM.get();(0,H.f)(o,e.origin,e.basis1),(0,H.d)(o,o,e.basis2),i.toRenderCoords(o,n,o);let l=ee.WM.get();(0,H.d)(l,e.origin,e.basis1),(0,H.d)(l,l,e.basis2),i.toRenderCoords(l,n,l);let c=ee.WM.get();(0,H.d)(c,e.origin,e.basis1),(0,H.f)(c,c,e.basis2),i.toRenderCoords(c,n,c),(0,H.f)(r.origin,s,o),(0,H.f)(r.origin,r.origin,l),(0,H.f)(r.origin,r.origin,c),(0,H.g)(r.origin,r.origin,.25),(0,H.d)(s,s,r.origin),(0,H.d)(o,o,r.origin),(0,H.d)(l,l,r.origin),(0,H.d)(c,c,r.origin);let h=(0,H.m)(ee.WM.get(),s,o,.5),d=(0,H.m)(ee.WM.get(),l,c,.5);(0,H.g)(d,d,-1),(0,H.m)(r.basis1,h,d,.5);let u=(0,H.m)(ee.WM.get(),s,c,.5),p=(0,H.m)(ee.WM.get(),o,l,.5);(0,H.g)(p,p,-1),(0,H.m)(r.basis2,u,p,.5);let _=(0,H.h)(ee.WM.get(),r.basis1,r.basis2);(0,H.h)(r.basis2,_,r.basis1),(0,H.n)(r.basis1,r.basis1);let g=Math.max(Math.abs((0,H.e)(r.basis1,s)),Math.abs((0,H.e)(r.basis1,o)),Math.abs((0,H.e)(r.basis1,l)),Math.abs((0,H.e)(r.basis1,c)));(0,H.n)(r.basis2,r.basis2);let f=Math.max(Math.abs((0,H.e)(r.basis2,s)),Math.abs((0,H.e)(r.basis2,o)),Math.abs((0,H.e)(r.basis2,l)),Math.abs((0,H.e)(r.basis2,c)));(0,H.g)(r.basis1,r.basis1,g+a),(0,H.g)(r.basis2,r.basis2,f+a);let m=(0,H.c)(ee.WM.get(),e.origin);m[2]=t,i.toRenderCoords(m,n,m),(0,nD.Yq)(m,_,r.plane),(0,nD.nF)(r.plane,r.origin,r.origin),(0,rz.u)(r)}(this.mapBounds,i??0,e.renderCoordsHelper,this.spatialReference,this.displayBoundsMargin,this.displayBounds)}}let so=10,sl=80,sc=(0,G.Ue)(),sh=(0,G.Ue)(),sd=(0,G.Ue)(),su=(0,G.Ue)();var sp=i(12446);class s_{get _object(){return this._tool.object}get _operations(){return this._object.operations}get zMax(){if(!this._zMaxDirty||!this._operations)return this._zMax;let e=this._operations.data;if(e.geometry.hasZ){let t=e.coordinateHelper;for(let i of(this._zMax=Number.NEGATIVE_INFINITY,e.components))for(let e of i.vertices){let i=t.getZ(e.pos)??0;this._zMax=Math.max(i,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(e,t,i){this._tool=e,this._bounds=t,this._preserveAspectRatioStep=i,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._displayBoundsStart=(0,rz.d)(),this._displayBoundsMarginStart=0,this._zMax=0,this._zMaxDirty=!0;let n=this._tool,a=n.view;this.resizeManipulators=this._resizeHandles.map(e=>{let t=new sn(a,e);return n.addHandles([t.events.on("grab-changed",e=>this._onGrabChanged(e)),this._createResizeDragPipeline(t,e)]),t}),n.manipulators.addMany(this.resizeManipulators),this._operations&&n.addHandles(this._operations.data.on("change",()=>{"resize"!==n.inputState?.type&&(this._zMaxDirty=!0)}))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()})}forEachManipulator(e){this.resizeManipulators.forEach(t=>e(t,b.SCALE))}updateManipulators(e,t){this.resizeManipulators.forEach((i,n)=>{!function(e,t,i,n){let a=(0,H.l)(n.basis1),r=(0,H.l)(n.basis2),s=rF(n),o=rF(n),l=(0,H.i)(ee.WM.get(),0,0,0);(0,H.f)(l,(0,H.g)(ee.WM.get(),n.basis1,t.direction[0]),(0,H.g)(ee.WM.get(),n.basis2,t.direction[1])),(0,H.f)(l,n.origin,l);let c=0,h=1;if(rk(t))1===t.direction[0]&&-1===t.direction[1]?c=rY:1===t.direction[0]&&1===t.direction[1]?c=Math.PI:-1===t.direction[0]&&1===t.direction[1]&&(c=3*Math.PI/2),h=o;else{let e=0!==t.direction[0]?1:2;c=1===e?rY:0,h=(1===e?r:a)-s}let d=(0,tG.QO)(ee.MP.get(),c);(0,tG.bA)(d,d,(0,H.i)(ee.WM.get(),h,h,h)),(0,tG.Jp)(d,i,d),d[12]=0,d[13]=0,d[14]=0,e.modelTransform=d,e.renderLocation=l}(i,this._resizeHandles[n],e,t)})}getUpdatedTooltipInfo(){var e,t,i,n;if(!this.resizeManipulators.some(e=>
183e.focused))return null;let a=this._tooltipInfo??=new sp.p({sketchOptions:this._tool.sketchOptions}),r=(e=this._bounds.mapBounds,t=this.zMax,i=this._bounds.spatialReference,n=this._tool.automaticLengthMeasurementUtils,(0,H.d)(su,(0,H.d)(su,e.origin,e.basis1),e.basis2),(0,H.b)(sd,su,e.basis1,2),(0,H.b)(sh,sd,e.basis2,2),(0,H.b)(sc,su,e.basis2,2),su[2]=sd[2]=sh[2]=sc[2]=t,(0,sr.D)({topLeft:sc,topRight:sh,bottomRight:sd,bottomLeft:su,spatialReference:i,automaticLengthMeasurementUtils:n}));return r&&(a.xSize=r.xSize,a.ySize=r.ySize),this.resizeManipulators.some(e=>e.dragging)||(a.xScale=1,a.yScale=1),a}_onGrabChanged({action:e,screenPoint:t}){let i=this._tool,n=this._bounds;if("start"!==e||!t)return;let a=nC(i.view.state.camera,t);(0,nD.BR)(n.displayBounds.plane,a,ee.WM.get())&&(n.backupMapBounds(),(0,rz.a)(n.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=n.displayBoundsMargin,i.inputState={type:"resize"})}_createResizeDragPipeline(e,t){let{_tool:i,_object:n}=this;return(0,an.Xd)(e,(e,a,r)=>{null!=i.inputState&&(a.next(e=>("start"===e.action&&i.events.emit("scale-start",{object:n,xScale:1,yScale:1}),{...e,handle:t})).next(aa(i.view,this._displayBoundsStart.plane)).next(this._renderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._updateGeometry()).next(e=>{let t=this._tooltipInfo;t&&(t.xScale=e.factor1,t.yScale=e.factor2);let a={object:n,xScale:e.factor1,yScale:e.factor2};switch(e.action){case"start":case"update":i.events.emit("scale",a);break;case"end":i.inputState=null,i.events.emit("scale-stop",a)}return e}),r.next(()=>{null!=i.inputState&&i.events.emit("scale-stop",{object:n,xScale:1,yScale:1}),i.cancelDrag()}))})}_renderPlaneToFactors(){let e=this._bounds;return t=>{let i=this._displayBoundsStart,n=t.handle.direction,a=e.displayBoundsMargin,r=this._displayBoundsMarginStart,s=(0,H.c)(ee.WM.get(),i.origin);(0,H.b)(s,s,i.basis1,-n[0]),(0,H.b)(s,s,i.basis2,-n[1]);let o=(0,H.d)(ee.WM.get(),t.renderEnd,s),l=(0,H.d)(ee.WM.get(),t.renderStart,s),c=rk(t.handle),h=rF(i),d=rF(e.displayBounds)/h,u=(e,t)=>{if(0===e)return 1;let i=(0,H.l)(t),n=.5*e*(0,H.e)(t,o)/i,s=n<0?-1:1;c&&(n+=(i-.5*e*(0,H.e)(t,l)/i)*s*d);let h=i<1.5*r?1:sg;return i=Math.max(i-r,sg),s>0&&(n-=a),s*Math.max(n/i*s,h)};return{...t,factor1:u(n[0],i.basis1),factor2:u(n[1],i.basis2)}}}_updateGeometry(){let e=this._bounds;return t=>{let i=(0,H.c)((0,G.Ue)(),e.mapBoundsStart.origin);
183(0,H.b)(i,i,e.mapBoundsStart.basis1,-t.handle.direction[0]),(0,H.b)(i,i,e.mapBoundsStart.basis2,-t.handle.direction[1]);let n=(0,J.t8)((0,$.Ue)(),e.mapBoundsStart.basis1[0],e.mapBoundsStart.basis1[1]);(0,J.Fv)(n,n);let a="start"===t.action?nd.b.NEW_STEP:nd.b.ACCUMULATE_STEPS;if(this._operations){let r=this._operations.scale(i,n,t.factor1,t.factor2,a,se.w.REPLACE);(0,rz.a)(e.mapBoundsStart,e.mapBounds),e.updateMapBoundsFromOperation(r)}return t}}}let sg=1e-6;class sf{constructor(){this._lastDragEvent=null,this._next=null,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&null!=this._lastDragEvent&&null!=this._next){let t={...this._lastDragEvent,action:"update"};e&&sm(t),this._next.execute(t)}this._enabled=e}createDragEventPipelineStep(){this._lastDragEvent=null;let e=new an.hM;return this._next=e,[e=>(this._lastDragEvent="end"!==e.action?{...e}:null,this._enabled&&sm(e),e),e]}get test(){}}function sm(e){let t=rk(e.handle)?Math.max(Math.abs(e.factor1),Math.abs(e.factor2)):0===e.handle.direction[0]?Math.abs(e.factor2):Math.abs(e.factor1);e.factor1=e.factor1<0?-t:t,e.factor2=e.factor2<0?-t:t}class sv{constructor(){this._lastDragEvent=null,this._next=null,this.incrementRadians=(0,X.Vl)(5),this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&null!=this._lastDragEvent&&null!=this._next){let t={...this._lastDragEvent,action:"update"};e&&this._adjustRotation(t),this._next.execute(t)}this._enabled=e}createDragEventPipelineStep(){this._lastDragEvent=null;let e=new an.hM;return this._next=e,[e=>(this._lastDragEvent="end"!==e.action?{...e}:null,this._enabled&&this._adjustRotation(e),e),e]}_adjustRotation(e){e.rotateAngle=Math.round(e.rotateAngle/this.incrementRadians)*this.incrementRadians}}let sb=class extends aL.m{get updating(){return!!this.object.updating}constructor(e){super(e),this.events=new iM.Z,this.enableZ=!0,this.enableScaling=!0,this.enableRotation=!0,this.sketchOptions=new aV.Z,this._preserveAspectRatio=new sf,this._snapRotation=new sv,this.grabbing=!1,this.inputState=null,this._attachmentOrigin=null,this.type="transform-3d",this._outlineVisualElement=null}initialize(){let{view:e,object:t}=this,i=this._bounds=new ss(this,()=>this._updateManipulators());this._extentMove=new r$(this,i,this.automaticLengthMeasurementUtils),this._extentScale=new s_(this,i,()=>this._preserveAspectRatio.createDragEventPipelineStep()),this._extentRotate=new si(this,i,()=>this._snapRotation.createDragEventPipelineStep()),this.addHandles([(0,L.YP)(()=>this.enableZ,()=>this._updateManipulatorAvailability(this._extentMove.moveZManipulator,b.TRANSLATE_Z)),(0,L.YP)(()=>this.enableScaling,()=>this._extentScale.forEachManipulator(e=>this._updateManipulatorAvailability(e,b.SCALE))),(0,L.YP)(()=>this.enableRotation,()=>this._updateManipulatorAvailability(this._extentRotate.rotateManipulator,b.ROTATE))]),this._updateManipulators(),this._updateAllManipulatorAvailability();let n=n4({view:e,object:t,forEachManipulator:e=>this._forEachManipulator(e),onManipulatorsChanged:()=>(0,I.kB)()});if(null!=n){let{visualElement:e}=n;e instanceof iO&&(this._outlineVisualElement=e,this.addHandles(e.events.on("attachment-origin-changed",()=>this._bounds.updateDisplayBounds()))),this.addHandles(n)}this.addHandles([t.on("committed",()=>this._onGeometryChanged()),(0,L.YP)(()=>this.object.visible,()=>this._updateAllManipulatorAvailability()),(0,L.YP)(()=>this.object.isDraped,()=>this._graphicDrapedChanged(),L.nn),(0,L.YP)(()=>e.pointsOfInterest?.centerOnSurfaceFrequent.location,()=>i.updateDisplayBounds())]),this._forEachManipulator(e=>{this.addHandles(e.events.on("grab-changed",()=>{this.grabbing=e.grabbing,this._updateAllManipulatorAvailability()}))}),this._forEachManipulator((e,i)=>{this.addHandles(e.events.on("immediate-click",e=>{i===b.TRANSLATE_XY&&this.events.emit("immediate-click",{...e,object:t}),e.stopPropagation()}))}),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._extentMove.destroy(),this._extentScale.destroy(),this._extentRotate.destroy(),this.tooltip.destroy(),this._set("view",null),this._set("object",null)}_initializeTooltip(){let{view:e}=this;this.tooltip=(0,i5.vG)(()=>({view:e,options:this.sketchOptions.tooltips}));let t=()=>
183{this.tooltip.info=this._getUpdatedTooltipInfo()};this.addHandles([(0,L.YP)(()=>this.sketchOptions.tooltips.effectiveEnabled,t),(0,L.YP)(()=>this.preserveAspectRatio,t)]),this._forEachManipulator(e=>{this.addHandles([e.events.on(["focus-changed","grab-changed"],t),e.events.on("drag",e=>{"cancel"===e.action?this.tooltip.clear():t()})])})}_getUpdatedTooltipInfo(){return this.sketchOptions.tooltips.effectiveEnabled?this._extentMove.getUpdatedTooltipInfo()??this._extentScale.getUpdatedTooltipInfo()??this._extentRotate.getUpdatedTooltipInfo():null}_onGeometryChanged(){this._bounds.updateDisplayBounds()}_graphicDrapedChanged(){this.removeHandles(sy),this._bounds.updateDisplayBounds(),this.object.isDraped&&this.addHandles(this.view.elevationProvider.on("elevation-change",e=>{null!=this._attachmentOrigin&&(0,nE.jE)(e.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._bounds.updateDisplayBounds()}),sy)}_updateManipulators(){var e;if(!this.visible)return;let t=this._bounds.displayBounds,i=(e=ee.MP.get(),aS(t.basis1,t.basis2,t.origin,e));this._extentMove.updateManipulators(i,t),this._extentScale.updateManipulators(i,t),this._extentRotate.updateManipulators(i,t)}_updateAllManipulatorAvailability(){this._forEachManipulator((e,t)=>this._updateManipulatorAvailability(e,t))}_updateManipulatorAvailability(e,t){let i=this.grabbing&&!e.grabbing;if(e.interactive=!i,e instanceof nj){let n=this.object.visible,a=this.enableZ&&nh(this.object.operations,this.object.elevationInfo);switch(t){case b.ROTATE:e.available=n&&this.enableRotation;break;case b.SCALE:e.available=n&&(this.enableScaling||this.enableRotation||a),e.interactive=!i&&this.enableScaling,e.state=this.enableScaling?rB:rX;break;case b.TRANSLATE_Z:e.available=n&&a;break;default:e.available=n}}}_forEachManipulator(e){this._extentMove.forEachManipulator(e),this._extentScale.forEachManipulator(e),this._extentRotate.forEachManipulator(e)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(e){this._preserveAspectRatio.enabled=e,this._set("preserveAspectRatio",e)}get snapRotation(){return this._snapRotation.enabled}set snapRotation(e){this._snapRotation.enabled=e,this._set("snapRotation",e)}get attachmentOrigin(){let e=this.object.isDraped?null:this._outlineVisualElement?.attachmentOrigin;return this._attachmentOrigin=e??this.object.origin??nc(this.object)?.extent?.center,this._attachmentOrigin}reset(){}cancelDrag(){if(this.canUndo){let e=this.object.operations?.undo();e&&this._bounds.updateMapBoundsFromOperationInverse(e)}this.inputState=null}get canUndo(){return!!this.object.operations?.canUndo}undo(){if(null!=this.inputState)this.view.activeTool=null;else if(this.canUndo){let e=this.object.operations?.undo();e&&this._bounds.updateMapBoundsFromOperationInverse(e)}}get canRedo(){return!!this.object.operations?.canRedo}redo(){if(this.canRedo){let e=this.object.operations?.redo();e&&this._bounds.updateMapBoundsFromOperation(e)}}get test(){}};(0,P._)([(0,U.Cb)()],sb.prototype,"updating",null),(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],sb.prototype,"view",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],sb.prototype,"automaticLengthMeasurementUtils",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,nonNullable:!0})],sb.prototype,"object",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"enableZ",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"enableScaling",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"enableRotation",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0,type:aV.Z})],sb.prototype,"sketchOptions",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"preserveAspectRatio",null),(0,P._)([(0,U.Cb)()],sb.prototype,"snapRotation",null),(0,P._)([(0,U.Cb)()],sb.prototype,"grabbing",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"inputState",void 0),(0,P._)([(0,U.Cb)({readOnly:!0})],sb.prototype,"type",void 0),(0,P._)([(0,U.Cb)()],sb.prototype,"tooltip",void 0),sb=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.transform.ExtentTransformTool")],sb);let sy="draped-elevation-changes";var sM=i(31832),sw=i(24706);let sS=Symbol(),sx=class extends iM.Z.EventedAccessor{get operations(){return this._operations}get updating(){return this._updatingHandles.updating}get elevationInfo(){return(0,N.RL)(this.graphic)}get visible(){return this._graphicState.displaying}get isDraped(){return this._graphicState.isDraped}get origin(){return function(e,t){let i=e.getViewForGraphic(t);return null!=i&&"computeAttachmentOrigin"in i?i.computeAttachmentOrigin(t,e.spatialReference):null}(this.view,this.graphic)}constructor(e){super(e),this._updatingHandles=new na.R}destroy(){this._operations=(0,j.SC)(this._operations),this._updatingHandles.destroy()}initialize(){this._graphicState=new i1.F({graphic:this.graphic}),this._graphicState.on("changed",()=>
183this.emit("committed")),this.addHandles(this.view.trackGraphicState(this._graphicState)),this.addHandles(this._updatingHandles.add(()=>this.graphic.geometry,e=>{if(e!==this._operations?.data.geometry){if(!e||"multipoint"===e?.type||"extent"===e?.type)return(0,j.SC)(this._operations),this.removeHandles(sS),void(this._operations=null);if(this._operations?.trySetGeometry(e))this.emit("modified-externally");else{(0,j.SC)(this._operations),this.removeHandles(sS);let t=aU.c.fromGeometry(e,this.view.state.viewingMode);this._operations=t,this.addHandles(t.data.on("change",()=>this.graphic.geometry=t.data.geometry),sS)}}},L.tX))}createManipulator(e){return new sw.L({view:this.view,graphic:this.graphic,...e})}maskOccludee(){return this.view.maskOccludee(this.graphic)}endInteraction(){let e=this.graphic.geometry;"mesh"===e?.type&&this.graphic.notifyMeshTransformChanged({action:ia.u.UpdateFastLocalOrigin})}toMap(e){return this.view.toMap(e,{include:[this.graphic]})}createUndoRecord(){var e,t;let i,n,a,r,s,o,l,c;let{graphic:{geometry:h}}=this;return null!=h&&"mesh"===h.type?(0,sM.zZ)(h.vertexSpace)?(e=h.transform,t=h.vertexSpace,i=e?.clone(),n=(0,G.d9)(t.origin),a=null,r=null,{undo:()=>{a=h.transform?.clone(),r=(0,G.d9)(t.origin),h.transform=i,h.vertexSpace.origin=n},redo:()=>{i=h.transform?.clone(),n=(0,G.d9)(t.origin),h.transform=a,h.vertexSpace.origin=r}}):(o=h.vertexAttributes.clonePositional(),{undo:()=>{s=h.vertexAttributes.clonePositional(),h.vertexAttributes=o},redo:()=>{o=h.vertexAttributes.clonePositional(),h.vertexAttributes=s}}):(l=h,c=null,{undo(e){c=e.geometry,e.geometry=l},redo(e){l=e.geometry,e.geometry=c}})}};(0,P._)([(0,U.Cb)({constructOnly:!0})],sx.prototype,"view",void 0),(0,P._)([(0,U.Cb)({constructOnly:!0})],sx.prototype,"graphic",void 0),(0,P._)([(0,U.Cb)()],sx.prototype,"_operations",void 0),(0,P._)([(0,U.Cb)()],sx.prototype,"operations",null),(0,P._)([(0,U.Cb)()],sx.prototype,"updating",null),sx=(0,P._)([(0,z.j)("esri.views.3d.interactive.editingTools.ManipulatedObject3DGraphic")],sx)},48234:function(e,t,i){i.d(t,{F:function(){return o}});var n=i(73322),a=i(83126),r=i(86652);i(95263),i(58583),i(42082);var s=i(18301);let o=class extends a.Z.EventedAccessor{constructor(e){super(e),this.tracking=!1,this.displaying=!1,this.error=null,this.isDraped=!1}};(0,n._)([(0,r.Cb)({constructOnly:!0})],o.prototype,"graphic",void 0),(0,n._)([(0,r.Cb)()],o.prototype,"tracking",void 0),(0,n._)([(0,r.Cb)()],o.prototype,"displaying",void 0),(0,n._)([(0,r.Cb)()],o.prototype,"error",void 0),(0,n._)([(0,r.Cb)()],o.prototype,"isDraped",void 0),o=(0,n._)([(0,s.j)("esri.views.3d.layers.graphics.GraphicState")],o)},11236:function(e,t,i){i.d(t,{Z:function(){return E}});var n=i(67210),a=i(96805),r=i(73526),s=i(1941),o=i(84804),l=i(29666),c=i(327),h=i(89322),d=i(65097),u=i(88860),p=i(30018),_=i(88815);i(93271);var g=i(25462),f=i(13398);function m(e,t,i=function(e){return{operations:e,value:e.create()}}(e)){return i.operations=e,e.copy(t,i.value),i}function v(e,t,i,n){return e.operations.setAltitudeAt(e.value,t,i,n)}function b(e,t,i){return e.operations.elevate(e.value,t,i.value)}let y=(0,_.Ue)();(0,_.Ue)();var M=i(58485),w=i(80434),S=i(57927),x=i(29912),O=i(26711);class E{constructor(e,t,i,n){this.viewingMode=e,this.spatialReference=t,this.unitInMeters=i,this._coordinateSystem=n,this._tmpCoordinateSystem=function(e){let{value:t,operations:i}=e;return{operations:i,value:i.create(t)}}(n),this.referenceEllipsoid=(0,o.Iu)(t),this.sphericalPCPF=(0,l.rS)(t)}set extent(e){var t,i;e&&(t=this._coordinateSystem,i=this._coordinateSystem,t.operations.setExtent(t.value,e,i.value))}get extent(){var e,t;return e=this._coordinateSystem,t=(0,u.Ue)(),e.operations.getExtent(e.value,t),t}getAltitude(e){var t;return(t=this._coordinateSystem).operations.altitudeAt(t.value,e)}setAltitude(e,t,i=e){return v(this._coordinateSystem,i,t,e)}setAltitudeOfTransformation(e,t){var i;i=this._coordinateSystem,t!=t&&(0,r.JG)(t,t),(0,s.i)(y,t[12],t[13],t[14]),v(i,y,e,y),t[12]=y[0],t[13]=y[1],t[14]=y[2]}worldUpAtPosition(e,t){var i;return(i=this._coordinateSystem).operations.axisAt(i.value,e,p.R.Z,t)}worldBasisAtPosition(e,t,i){var n;return(n=this._coordinateSystem).operations.axisAt(n.value,e,t,i)}basisMatrixAtPosition(e,t){let i=this.worldBasisAtPosition(e,p.R.X,S.WM.get()),n=this.worldBasisAtPosition(e,p.R.Y,S.WM.get()),a=this.worldBasisAtPosition(e,p.R.Z,S.WM.get());return(0,r.t8)(t,i[0],i[1],i[2],0,n[0],n[1],n[2],0,a[0],a[1],a[2],0,0,0,0,1),t}headingAtPosition(e,t){let i=this.worldUpAtPosition(e,S.WM.get()),a=this.worldBasisAtPosition(e,p.R.Y,S.WM.get()),r=(0,w.cp)(t,a,i);return(0,n.BV)(r)}intersectManifoldClosestSilhouette(e,t,i){var n;return b(this._coordinateSystem,t,this._tmpCoordinateSystem),(n=this._tmpCoordinateSystem).operations.intersectRayClosestSilhouette(n.value,e,i),i}intersectManifold(e,t,i){var n;b(this._coordinateSystem,t,this._tmpCoordinateSystem);let a=S.WM.get();return(n=this._tmpCoordinateSystem).operations.intersectRay(n.value,e,a)?(0,s.c)(i,a):null}intersectInfiniteManifold(e,t,i){if(this.viewingMode===O.JY.Global)return this.intersectManifold(e,t,i);b(this._coordinateSystem,t,this._tmpCoordinateSystem);let n=this._tmpCoordinateSystem.value,a=S.WM.get();return(0,M.BR)(n.plane,e,a)?(0,s.c)(i,a):null}toRenderCoords(e,t,i){return(0,x.f)(e)?(0,c.K)(e,t,this.spatialReference):(0,d.S)(e,t,i,this.spatialReference)}fromRenderCoords(e,t,i=null){return(0,x.f)(t)?(null!=i&&(t.spatialReference=i),(0,h.f)(e,this.spatialReference,t)?t:null):(0,d.S)(e,this.spatialReference,t,i)?t:null}static create(e,t){switch(e){case O.JY.Local:return new E(O.JY.Local,t,(0,a.c9)(t),m(g.b,(0,g.f)([0,0,0],[0x4000000000000,
1830,0],[0,0x4000000000000,0])));case O.JY.Global:return new E(O.JY.Global,t,1,m(f.s,(0,f.f)(0,0,0,(0,o.Iu)(t).radius)))}}static renderUnitScaleFactor(e,t){return(0,a.r6)(e)/(0,a.r6)(t)}}},85712:function(e,t,i){i.d(t,{j:function(){return d}});var n=i(63670);function a(e){e.code.add("\n  vec4 blendColorsPremultiplied(vec4 source, vec4 dest) {\n    float oneMinusSourceAlpha = 1.0 - source.a;\n    return source + dest * oneMinusSourceAlpha;\n  }\n  ")}var r=i(94666),s=i(45661),o=i(99484),l=i(28616),c=i(76087),h=i(66346);function d(e,t){let i=e.fragment;i.include(n.K),e.include(r.GZ),i.include(a),i.uniforms.add(new o.p("globalAlpha",e=>e.globalAlpha),new s.J("glowColor",e=>e.glowColor),new o.p("glowWidth",(e,t)=>e.glowWidth*t.camera.pixelRatio),new o.p("glowFalloff",e=>e.glowFalloff),new s.J("innerColor",e=>e.innerColor),new o.p("innerWidth",(e,t)=>e.innerWidth*t.camera.pixelRatio),new c.e("depthMap",e=>e.depth?.attachment),new h.A("normalMap",e=>e.normals)),i.code.add((0,l.H)`vec4 premultipliedColor(vec3 rgb, float alpha) {
184return vec4(rgb * alpha, alpha);
185}`),i.code.add((0,l.H)`vec4 laserlineProfile(float dist) {
186if (dist > glowWidth) {
187return vec4(0.0);
188}
189float innerAlpha = (1.0 - smoothstep(0.0, innerWidth, dist));
190float glowAlpha = pow(max(0.0, 1.0 - dist / glowWidth), glowFalloff);
191return blendColorsPremultiplied(
192premultipliedColor(innerColor, innerAlpha),
193premultipliedColor(glowColor, glowAlpha)
194);
195}`),i.code.add((0,l.H)`bool laserlineReconstructFromDepth(out vec3 pos, out vec3 normal, out float angleCutoffAdjust, out float depthDiscontinuityAlpha) {
196float depth = depthFromTexture(depthMap, uv);
197if (depth == 1.0) {
198return false;
199}
200float linearDepth = linearizeDepth(depth);
201pos = reconstructPosition(gl_FragCoord.xy, linearDepth);
202float minStep = 6e-8;
203float depthStep = clamp(depth + minStep, 0.0, 1.0);
204float linearDepthStep = linearizeDepth(depthStep);
205float depthError = abs(linearDepthStep - linearDepth);
206vec3 normalReconstructed = normalize(cross(dFdx(pos), dFdy(pos)));
207vec3 normalFromTexture = normalize(texture(normalMap, uv).xyz * 2.0 - 1.0);
208float blendFactor = smoothstep(0.15, 0.2, depthError);
209normal = normalize(mix(normalReconstructed, normalFromTexture, blendFactor));
210angleCutoffAdjust = mix(0.0, 0.004, blendFactor);
211float ddepth = fwidth(linearDepth);
212depthDiscontinuityAlpha = 1.0 - smoothstep(0.0, 0.01, -ddepth / linearDepth);
213return true;
214}`),t.contrastControlEnabled?i.uniforms.add(new h.A("frameColor",(e,t)=>e.colors),new o.p("globalAlphaContrastBoost",e=>e.globalAlphaContrastBoost)).code.add((0,l.H)`float rgbToLuminance(vec3 color) {
215return dot(vec3(0.2126, 0.7152, 0.0722), color);
216}
217vec4 laserlineOutput(vec4 color) {
218float backgroundLuminance = rgbToLuminance(texture(frameColor, uv).rgb);
219float alpha = clamp(globalAlpha * max(backgroundLuminance * globalAlphaContrastBoost, 1.0), 0.0, 1.0);
220return color * alpha;
221}`):i.code.add((0,l.H)`vec4 laserlineOutput(vec4 color) {
222return color * globalAlpha;
223}`)}},5481:function(e,t,i){i.d(t,{A:function(){return o}});var n=i(1209),a=i(57973),r=i(99484),s=i(28616);function o(e,t){if(!t.screenSizeEnabled)return;let i=e.vertex;(0,n.hY)(i,t),i.uniforms.add(new a.z("perScreenPixelRatio",e=>e.camera.perScreenPixelRatio),new r.p("screenSizeScale",e=>e.screenSizeScale)).code.add((0,s.H)`float computeRenderPixelSizeAt( vec3 pWorld ){
224vec3 viewForward = - vec3(view[0][2], view[1][2], view[2][2]);
225float viewDirectionDistance = abs(dot(viewForward, pWorld - cameraPosition));
226return viewDirectionDistance * perScreenPixelRatio;
227}
228vec3 screenSizeScaling(vec3 position, vec3 anchor){
229return position * screenSizeScale * computeRenderPixelSizeAt(anchor) + anchor;
230}`)}},47896:function(e,t,i){i.d(t,{J:function(){return a},Z:function(){return o}});var n,a,r=i(73322),s=i(33233);(n=a||(a={}))[n.None=0]="None",n[n.Alpha=1]="Alpha",n[n.PremultipliedAlpha=2]="PremultipliedAlpha",n[n.Depth=3]="Depth",n[n.COUNT=4]="COUNT";class o extends s.m{constructor(){super(...arguments),this.blitMode=a.None,this.hasOpacityFactor=!1}}(0,r._)([(0,s.o)({count:a.COUNT})],o.prototype,"blitMode",void 0),(0,r._)([(0,s.o)()],o.prototype,"hasOpacityFactor",void 0)},63006:function(e,t,i){i.d(t,{c:function(){return o}});var n=i(73322),a=i(86652);i(95263),i(58583),i(42082);var r=i(18301),s=i(80407);let o=class extends s.h{constructor(e){super(e),this.type="extent-rotate",this.angle=0}};(0,n._)([(0,a.Cb)()],o.prototype,"type",void 0),(0,n._)([(0,a.Cb)()],o.prototype,"angle",void 0),o=(0,n._)([(0,r.j)("esri.views.interactive.tooltip.infos.ExtentRotateTooltipInfo")],o)},12446:function(e,t,i){i.d(t,{p:function(){return l}});var n=i(73322),a=i(49091),r=i(86652);i(95263),i(58583),i(42082);var s=i(18301),o=i(80407);let l=class extends o.h{constructor(e){super(e),this.type="extent-scale",this.xScale=0,this.yScale=0,this.xSize=a.yP,this.ySize=a.yP}};(0,n._)([(0,r.Cb)()],l.prototype,"type",void 0),(0,n._)([(0,r.Cb)()],l.prototype,"xScale",void 0),(0,n._)([(0,r.Cb)()],l.prototype,"yScale",void 0),(0,n._)([(0,r.Cb)()],l.prototype,"xSize",void 0),(0,n._)([(0,r.Cb)()],l.prototype,"ySize",void 0),l=(0,n._)([(0,s.j)("esri.views.interactive.tooltip.infos.ExtentScaleTooltipInfo")],l)},39538:function(e,t,i){i.d(t,{o:function(){return l}});var n=i(73322),a=i(86652);i(95263),i(58583),i(42082);var r=i(18301),s=i(80407),o=i(10972);let l=class extends(0,o.A)(s.h){constructor(e){super(e),this.type="move-point",this.allFields.forEach(e
230=>{e.lockable=!1,e.setActual(null)})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};(0,n._)([(0,a.Cb)()],l.prototype,"allFields",null),l=(0,n._)([(0,r.j)("esri.views.interactive.tooltip.infos.MovePointTooltipInfo")],l)},33113:function(e,t,i){i.d(t,{K:function(){return c}});var n=i(73322),a=i(86652);i(95263),i(58583),i(42082);var r=i(18301),s=i(52610),o=i(80407),l=i(10972);let c=class extends(0,l.A)(o.h){constructor(e){super(e),this.type="selected-vertex",this.area=(0,s.UR)(),this.totalLength=(0,s.i4)(),this.geometryType="polyline",this.allFields.forEach(e=>{e.lockable=!1,e.setActual(null)})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,"polygon"===this.geometryType?this.area:this.totalLength]}};(0,n._)([(0,a.Cb)()],c.prototype,"geometryType",void 0),(0,n._)([(0,a.Cb)()],c.prototype,"allFields",null),c=(0,n._)([(0,r.j)("esri.views.interactive.tooltip.infos.SelectedVertexTooltipInfo")],c)},50053:function(e,t,i){i.d(t,{E:function(){return l}});var n=i(73322),a=i(49091),r=i(86652);i(95263),i(58583),i(42082);var s=i(18301),o=i(80407);let l=class extends o.h{constructor(e){super(e),this.type="translate",this.distance=a.yP}clear(){this.distance=a.yP}};(0,n._)([(0,r.Cb)()],l.prototype,"type",void 0),(0,n._)([(0,r.Cb)()],l.prototype,"distance",void 0),l=(0,n._)([(0,s.j)("esri.views.interactive.tooltip.infos.TranslateTooltipInfo")],l)},76798:function(e,t,i){i.d(t,{D:function(){return a}});var n=i(49091);function a({topLeft:e,topRight:t,bottomRight:i,bottomLeft:a,spatialReference:r,automaticLengthMeasurementUtils:{autoDistance2D:s}}){let o=(0,n.Fp)(s(a,i,r),s(e,t,r));if(null==o)return null;let l=(0,n.Fp)(s(i,t,r),s(a,e,r));return null==l?null:{xSize:o,ySize:l}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.