/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.25/esri/copyright.txt for details. */ import t from"../../geometry/Point.js";import{segmentIntersects as n}from"../../geometry/support/intersectsBase.js";function e(t,n,e){return Math.sqrt((t[0]-n[0])**2+(t[1]-n[1])**2+(void 0!==t[2]&&void 0!==n[2]?(t[2]*e-n[2]*e)**2:0))}const r=[];for(const v of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=v[0];for(let n=1;n0?(r.x/=o,r.y/=o,n&&(r.z/=o),e&&(r.m/=o)):(r.x=t[0][0],r.y=t[0][1],n&&(r.z=t[0][2]),e&&n?r.m=t[0][3]:e&&(r.m=t[0][2])),r}function i(t,n,e,r){const o={x:(t[0]+n[0])/2,y:(t[1]+n[1])/2};return e&&(o.z=(t[2]+n[2])/2),e&&r?o.m=(t[3]+n[3])/2:r&&(o.m=(t[2]+n[2])/2),o}function a(t,n){if(t.length<=1)return 0;let e=0;for(let r=1;r0?(r.x/=s,r.y/=s,!0===n.hasZ&&(r.z/=s),!0===n.hasM&&(r.m/=s),new t(r)):o>0?(e.x/=o,e.y/=o,!0===n.hasZ&&(r.z/=o),!0===n.hasM&&(e.m/=o),new t(e)):null}function u(n){if(0===n.points.length)return null;let e=0,r=0,o=0,s=0;for(let t=0;t=r;)t-=n;return t}function g(t,n){return Math.atan2(n.y-t.y,n.x-t.x)}function p(t,n){return m(g(t,n),2*Math.PI)*(180/Math.PI)}function M(t,n){return m(Math.PI/2-g(t,n),2*Math.PI)*(180/Math.PI)}function z(t,n,e){const r={x:t.x-n.x,y:t.y-n.y},o={x:e.x-n.x,y:e.y-n.y};return Math.atan2(x(r,o),y(r,o))}function P(t,n,e){return m(z(t,n,e),2*Math.PI)*(180/Math.PI)}function d(t,n,e){return m(-1*z(t,n,e),2*Math.PI)*(180/Math.PI)}o[9002]=.3048,o[9003]=.3048006096012192,o[9095]=.3048007491;const I=[0,0];function Z(t){for(let e=0;e