UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines • 34.4 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9535],{4341(t,e,n){n.d(e,{I:()=>i});var r=n(26390);class i{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;t<Math.max(8,Math.min(this._items.length,o));t++)this._items.push(this._allocator())}}const o=1024},5482(t,e,n){function r(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function i(t,e,n){if(null!=e){if("object"!=typeof e&&"function"!=typeof e)throw new TypeError("Object expected.");var r,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],n&&(i=r)}if("function"!=typeof r)throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(t){return Promise.reject(t)}}),t.stack.push({value:e,dispose:r,async:n})}else n&&t.stack.push({async:!0});return e}n.d(e,{Cg:()=>r,hk:()=>s,mS:()=>i}),Object.create,Object.create;var o="function"==typeof SuppressedError?SuppressedError:function(t,e,n){var r=new Error(n);return r.name="SuppressedError",r.error=t,r.suppressed=e,r};function s(t){function e(e){t.error=t.hasError?new o(e,t.error,"An error was suppressed during disposal."):e,t.hasError=!0}var n,r=0;return function i(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(i);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(o).then(i,function(t){return e(t),i()})}else r|=1}catch(t){e(t)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}},9093(t,e,n){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}n.d(e,{o8:()=>i,vt:()=>r,zK:()=>o});const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,fromValues:function(t,e,n,r,i,o,s,c,a,u,h,d,l,f,m,_){return[t,e,n,r,i,o,s,c,a,u,h,d,l,f,m,_]}},Symbol.toStringTag,{value:"Module"}))},11964(t,e,n){n.d(e,{Cr:()=>h,LV:()=>u,_I:()=>d,vt:()=>a});var r=n(34727),i=n(4341),o=n(35522),s=n(51850),c=n(32114);function a(t){return t?{origin:(0,s.o8)(t.origin),vector:(0,s.o8)(t.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function u(t,e){const n=l.get();return n.origin=t,n.vector=e,n}function h(t,e,n=a()){return(0,o.C)(n.origin,t),(0,o.Re)(n.vector,e,t),n}function d(t,e,n){return function(t,e,n,i,s){const{vector:a,origin:u}=t,h=(0,o.Re)(c.rq.get(),e,u),d=(0,o.Om)(a,h)/(0,o.m3)(a);return(0,o.hs)(s,a,(0,r.qE)(d,0,1)),(0,o.WQ)(s,s,t.origin)}(t,e,0,0,n)}(0,s.vt)(),(0,s.vt)();const l=new i.I(()=>a())},27921(t,e,n){n.d(e,{$Q:()=>M,C:()=>c,Cr:()=>h,O_:()=>u,Qj:()=>a,T7:()=>b,Tj:()=>v,lU:()=>d,mN:()=>S,vE:()=>y,vt:()=>s});var r=n(34727),i=n(35522),o=n(51850);function s(t=w){return[t[0],t[1],t[2],t[3]]}function c(t,e){return function(t,e,n,r,i=s()){return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}(e[0],e[1],e[2],e[3],t)}function a(t){return t}function u(t,e,n){const r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=Math.abs(r-1)>1e-5&&r>1e-12?1/Math.sqrt(r):1;return n[0]=e[0]*i,n[1]=e[1]*i,n[2]=e[2]*i,n[3]=-(n[0]*t[0]+n[1]*t[1]+n[2]*t[2]),n}function h(t,e,n,r=s()){const i=n[0]-e[0],o=n[1]-e[1],c=n[2]-e[2],a=t[0]-e[0],u=t[1]-e[1],h=t[2]-e[2],d=o*h-c*u,l=c*a-i*h,f=i*u-o*a,m=d*d+l*l+f*f,_=Math.abs(m-1)>1e-5&&m>1e-12?1/Math.sqrt(m):1;return r[0]=d*_,r[1]=l*_,r[2]=f*_,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function d(t,e,n,r=0,o=Math.floor(n*(1/3)),s=Math.floor(n*(2/3))){if(n<3)return!1;e(f,r);let c=o,a=!1;for(;c<n-1&&!a;)e(m,c),c++,a=!(0,i.t2)(f,m);if(!a)return!1;for(c=Math.max(c,s),a=!1;c<n&&!a;)e(_,c),c++,(0,i.Re)(p,f,m),(0,i.S8)(p,p),(0,i.Re)(g,m,_),(0,i.S8)(g,g),a=!(0,i.t2)(f,_)&&!(0,i.t2)(m,_)&&Math.abs((0,i.Om)(p,g))<l;return a?(h(f,m,_,t),!0):(0!==r||1!==o||2!==s)&&d(t,e,n,0,1,2)}n(78955),n(44280),n(32114),n(32728);const l=.99619469809,f=(0,o.vt)(),m=(0,o.vt)(),_=(0,o.vt)(),p=(0,o.vt)(),g=(0,o.vt)();function b(t,e,n){return function(t){return 0===t||1===t}(y(t,e.origin,e.vector,0,n))}function v(t,e){return S(t,e)>=0}function M(t,e){const n=(0,i.Om)(t,e.ray.direction),r=-S(t,e.ray.origin);if(r<0&&n>=0)return!1;if(n>-1e-6&&n<1e-6)return r>0;if((r<0||n<0)&&!(r<0&&n<0))return!0;const o=r/n;return n>0?o<e.c1&&(e.c1=o):o>e.c0&&(e.c0=o),e.c0<=e.c1}function S(t,e){return(0,i.Om)(t,e)+t[3]}function y(t,e,n,o,s){const c=(0,i.Om)(t,n),a=S(t,e);if(0===c)return a>=0?2:3;let u=-a/c;return 1&o&&(u=(0,r.qE)(u,0,1)),!(4&o)&&u<0||!(8&o)&&u>1?a>=0?2:3:((0,i.WQ)(s,e,(0,i.hs)(s,n,u)),a>=0?0:1)}const w=[0,0,1,0]},29242(t,e,n){function r(){return[1,0,0,0,1,0,0,0,1]}function i(t,e,n,r,i,o,s,c,a){return[t,e,n,r,i,o,s,c,a]}n.d(e,{fA:()=>i,vt:()=>r,zK:()=>o});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:r,fromValues:i},Symbol.toStringTag,{value:"Module"}))},32114(t,e,n){n.d(e,{Rc:()=>f,J8:()=>m,rq:()=>d,Km:()=>l}),n(44208);var r=n(26390),i=n(29242),o=n(9093),s=n(82534),c=n(48163),a=n(51850),u=n(91829);class h{constructor(t){this._create=t,this._items=new Array,this._itemsPtr=0}get(){return 0===this._itemsPtr&&(0,r.d)(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const t=2*this._itemsPtr;this._items.length>t&&(this._items.length=t),this._itemsPtr=0}static createVec2f64(){return new h(c.vt)}static createVec3f64(){return new h(a.vt)}static createVec4f64(){return new h(u.vt)}static createMat3f64(){return new h(i.vt)}static createMat4f64(){return new h(o.vt)}static createQuatf64(){return new h(s.vt)}get test(){}}h.createVec2f64();const d=h.createVec3f64(),l=h.createVec4f64(),f=(h.createMat3f64(),h.createMat4f64()),m=h.createQuatf64()},32728(t,e,n){n.d(e,{YH:()=>s,nu:()=>c,wp:()=>o}),n(34727);var r=n(35522),i=n(51850);function o(t,e){const n=Math.sqrt(e[0]*e[0]+e[4]*e[4]+e[8]*e[8]),i=Math.sqrt(e[1]*e[1]+e[5]*e[5]+e[9]*e[9]),o=Math.sqrt(e[2]*e[2]+e[6]*e[6]+e[10]*e[10]);return(0,r.hZ)(t,n,i,o),t}function s(t,e,n){n=n||t;const i=(0,r.Om)(t,e);(0,r.hZ)(n,t[0]-i*e[0],t[1]-i*e[1],t[2]-i*e[2]),(0,r.S8)(n,n)}function c(t,e,n,o=(0,i.vt)()){const s=(0,r.Bw)(t),c=(0,r.Bw)(e),h=(0,r.Om)(t,e)/(s*c);if(h<.9999999999999999){const i=Math.acos(h),d=((1-n)*s+n*c)/Math.sin(i),l=d/s*Math.sin((1-n)*i),f=d/c*Math.sin(n*i);return(0,r.hs)(a,t,l),(0,r.hs)(u,e,f),(0,r.WQ)(o,a,u)}return(0,r.Cc)(o,t,e,n)}(0,i.vt)(),(0,i.vt)(),(0,i.vt)();const a=(0,i.vt)(),u=(0,i.vt)()},44280(t,e,n){n.d(e,{g7:()=>c,gr:()=>s});var r=n(34727),i=n(35522),o=n(51850);function s(t,e){return(0,i.Om)(t,e)/(0,i.Bw)(t)}function c(t,e){const n=(0,i.Om)(t,e)/((0,i.Bw)(t)*(0,i.Bw)(e));return-(0,r.XM)(n)}(0,o.vt)(),(0,o.vt)()},70491(t,e,n){n.r(e),n.d(e,{default:()=>U});var r=n(5482),i=n(74887),o=n(24326),s=n(91429),c=n(35522),a=n(51850),u=n(11964),h=n(94008),d=n(93687),l=n(15142),f=n(82919),m=n(71351),_=n(620);class p{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new g,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),g.clearPool(),N[0]=null,D.prune(),Q.prune()}add(t){const e=Array.from(t);this._grow(e);const n=g.acquire();for(const t of e)++this._objectCount,this._isDegenerate(t)?this._degenerateObjects.add(t):(n.init(this._root),this._add(t,n));g.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=g.acquire();for(const r of t){const t=e??this.objectToBoundingSphere(r);T(t.radius)?(n.init(this._root),M(r,t,n)):this._degenerateObjects.delete(r)}g.release(n),this._shrink()}update(t,e){if(!T(e.radius)&&this._isDegenerate(t))return;const n=function(t){return N[0]=t,N}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const r=(0,m.LV)(t,e);b(this._root,t=>{if(!function(t,e){return x(e.bounds.center,2*-e.halfSize,I),x(e.bounds.center,2*e.halfSize,q),(0,_.O_)(t.origin,t.direction,I,q)}(r,t))return!1;const e=t.node;return e.terminals.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObject(r,t)&&n(t)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,r){const i=(0,m.LV)(t,e);b(this._root,t=>{if(!function(t,e,n){return x(e.bounds.center,2*-e.halfSize,I),x(e.bounds.center,2*e.halfSize,q),n.applyToMinMax(I,q),(0,_.O_)(t.origin,t.direction,I,q)}(i,t,r))return!1;const e=t.node;return e.terminals.forAll(t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)}),null!==e.residents&&e.residents.forAll(t=>{this._intersectsObjectWithOffset(i,t,r)&&n(t)}),!0})}forEach(t){b(this._root,e=>{const n=e.node;return n.terminals.forAll(t),null!==n.residents&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,r=()=>!0,i=1/0){let o=1/0,s=1/0,a=null;const u=O(t,e),h=c=>{if(--i,!r(c))return;const u=this.objectToBoundingSphere(c);if(!(0,f.m7)(n,u))return;const h=C(t,e,u.center),d=h-u.radius,l=h+u.radius;d<o&&(o=d,s=l,a=c)};return v(this._root,r=>{if(i<=0||!(0,f.m7)(n,r.bounds))return!1;if((0,c.hs)(B,u,r.halfSize),(0,c.WQ)(B,B,r.bounds.center),C(t,e,B)>s)return!1;const o=r.node;return o.terminals.forAll(t=>h(t)),null!==o.residents&&o.residents.forAll(t=>h(t)),!0},t,e),a}forEachInDepthRange(t,e,n,r,i,o,s){let a=-1/0,u=1/0;const h={setRange:t=>{1===n?(a=Math.max(a,t.near),u=Math.min(u,t.far)):(a=Math.max(a,-t.far),u=Math.min(u,-t.near))}};h.setRange(r);const d=C(e,n,t),l=O(e,n),m=O(e,-n),_=t=>{if(!s(t))return;const r=this.objectToBoundingSphere(t),c=C(e,n,r.center)-d,l=c-r.radius,m=c+r.radius;l>u||m<a||!(0,f.m7)(o,r)||i(t,h)};v(this._root,t=>{if(!(0,f.m7)(o,t.bounds))return!1;if((0,c.hs)(B,l,t.halfSize),(0,c.WQ)(B,B,t.bounds.center),C(e,n,B)-d>u)return!1;if((0,c.hs)(B,m,t.halfSize),(0,c.WQ)(B,B,t.bounds.center),C(e,n,B)-d<a)return!1;const r=t.node;return r.terminals.forAll(t=>_(t)),null!==r.residents&&r.residents.forAll(t=>_(t)),!0},e,n)}forEachNode(t){b(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=e.radius,r=e.center,i=e=>{const i=this.objectToBoundingSphere(e),o=i.radius,s=n+o;return!((0,c.hG)(i.center,r)-s*s<=0)||t(e)};let o=!0;const s=t=>{o&&(o=i(t))};b(this._root,t=>{const e=t.bounds.radius,i=n+e;if((0,c.hG)(t.bounds.center,r)-i*i>0)return!1;const a=t.node;return a.terminals.forAll(s),o&&null!==a.residents&&a.residents.forAll(s),o}),o&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n.radius>0)||n.intersectRay(t)}_intersectsObjectWithOffset(t,e,n){const r=this.objectToBoundingSphere(e);return!(r.radius>0)||n.applyToBoundingSphere(r).intersectRay(t)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depth<this._maximumDepth&&this._split(e))}_split(t){const e=t.node.residents;t.node.residents=null;for(let n=0;n<e.length;n++){const r=g.acquire().init(t);this._add(e.at(n),r),g.release(r)}}_grow(t){if(A(t,t=>this.objectToBoundingSphere(t),V),T(V.radius)&&!this._fitsInsideTree(V))if(y(this._root.node))this._root.bounds.copyFrom(V),this._root.halfSize=1.25*this._root.bounds.radius,this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(V);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(V,t):this._growRootAsSubNode(t),g.release(t)}}_rebuildTree(t,e){F.center=e.bounds.center,F.radius=e.halfSize,A([t,F],t=>t,L);const n=g.acquire().init(this._root);this._root.initFrom(null,L,L.radius),this._root.increaseHalfSize(1.25),b(n,t=>(this.add(t.node.terminals.data),null!==t.node.residents&&this.add(t.node.residents.data),!0)),g.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return b(this._root,t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t.radius,n=t.center;let r=-1/0;const i=this._root.bounds.center,o=this._root.halfSize;for(let t=0;t<3;t++){const s=i[t]-o-(n[t]-e),c=n[t]+e-(i[t]+o),a=Math.max(0,Math.ceil(s/(2*o))),u=Math.max(0,Math.ceil(c/(2*o)))+1,h=2**Math.ceil(Math.log(a+u)*Math.LOG2E);r=Math.max(r,h),k[t].min=a,k[t].max=u}for(let t=0;t<3;t++){let e=k[t].min,n=k[t].max;const s=(r-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=i[t]-o-e*o*2;R.center[t]=c+(n+e)*o}const s=r*o;return R.radius=s*z,g.acquire().initFrom(null,R,s,0)}_growRootAsSubNode(t){const e=this._root.node;V.center=this._root.bounds.center,V.radius=this._root.halfSize,this._root.init(t),t.advanceTo(V,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(-1===t)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(0!==this._root.node.terminals.length||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,r=0;for(;r<e.length&&null==t;)n=r++,t=e[n];for(;r<e.length;)if(e[r++])return-1;return n}_isDegenerate(t){return!T(this.objectToBoundingSphere(t).radius)}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t.radius<=n&&t.center[0]>=e.center[0]-n&&t.center[0]<=e.center[0]+n&&t.center[1]>=e.center[1]-n&&t.center[1]<=e.center[1]+n&&t.center[2]>=e.center[2]-n&&t.center[2]<=e.center[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,r=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:r}}}_nodeToJSON(t){const e=t.children.map(t=>t?this._nodeToJSON(t):null),n=t.residents?.map(t=>this.objectToBoundingSphere(t)),r=t.terminals?.map(t=>this.objectToBoundingSphere(t));return{children:e,residents:n,terminals:r}}static fromJSON(t){const e=new p(t=>t,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class g{constructor(){this.bounds=new h.iy,this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,r=this.depth){return this.node=null!=t?t:g.createEmptyNode(),e&&this.bounds.copyFrom(e),this.halfSize=n,this.depth=r,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds.radius=this.halfSize*z}advance(t){let e=this.node.children[t];e||(e=g.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=E[t];return this.bounds.center[0]+=n[0]*this.halfSize,this.bounds.center[1]+=n[1]*this.halfSize,this.bounds.center[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e?.(this,-1),!0;if(this.isLeaf()){if(!n)return e?.(this,-1),!1;this.node.residents=null}const r=this._childIndex(t);e?.(this,r),this.advance(r)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t.radius>this.halfSize/2}_childIndex(t){const e=this.bounds.center;return(e[0]<t.center[0]?1:0)+(e[1]<t.center[1]?2:0)+(e[2]<t.center[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new l.A({shrink:!0}),residents:new l.A({shrink:!0})}}static{this._pool=new d.A(()=>new g)}static acquire(){return g._pool.acquire()}static release(t){g._pool.release(t)}static clearPool(){g._pool.prune()}}function b(t,e){let n=g.acquire().init(t);const r=[n];for(;0!==r.length;){if(n=r.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&r.push(g.acquire().init(n).advance(t));g.release(n)}}function v(t,e,n,r=1){let i=g.acquire().init(t);const o=[i];for(function(t,e,n){if(!Q.length)for(let t=0;t<8;++t)Q.push({index:0,distance:0});for(let n=0;n<8;++n){const r=E[n];Q.data[n].index=n,Q.data[n].distance=C(t,e,r)}Q.sort((t,e)=>t.distance-e.distance);for(let t=0;t<8;++t)n[t]=Q.data[t].index}(n,r,W);0!==o.length;){if(i=o.pop(),e(i)&&!i.isLeaf())for(let t=7;t>=0;--t){const e=W[t];i.node.children[e]&&o.push(g.acquire().init(i).advance(e))}g.release(i)}}function M(t,e,n){D.clear();const r=n.advanceTo(e,(t,e)=>{D.push(t.node),D.push(e)})?n.node.terminals:n.node.residents;if(r.removeUnordered(t),0===r.length)for(let t=D.length-2;t>=0&&S(D.data[t],D.data[t+1]);t-=2);}function S(t,e){return e>=0&&(t.children[e]=null),!!y(t)&&(null===t.residents&&(t.residents=new l.A({shrink:!0})),!0)}function y(t){if(0!==t.terminals.length)return!1;if(null!==t.residents)return 0===t.residents.length;for(let e=0;e<t.children.length;e++)if(t.children[e])return!1;return!0}function w(t,e){t[0]=Math.min(t[0],e.center[0]-e.radius),t[1]=Math.min(t[1],e.center[1]-e.radius),t[2]=Math.min(t[2],e.center[2]-e.radius)}function j(t,e){t[0]=Math.max(t[0],e.center[0]+e.radius),t[1]=Math.max(t[1],e.center[1]+e.radius),t[2]=Math.max(t[2],e.center[2]+e.radius)}function x(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function A(t,e,n){I[0]=1/0,I[1]=1/0,I[2]=1/0,q[0]=-1/0,q[1]=-1/0,q[2]=-1/0;for(const n of t){const t=e(n);T(t.radius)&&(w(I,t),j(q,t))}(0,c.Cc)(n.center,I,q,.5),n.radius=Math.max(q[0]-I[0],q[1]-I[1],q[2]-I[2])/2}function O(t,e){let n,r=1/0;for(let i=0;i<8;++i){const o=C(t,e,P[i]);o<r&&(r=o,n=P[i])}return n}function C(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function T(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}const E=[(0,a.fA)(-1,-1,-1),(0,a.fA)(1,-1,-1),(0,a.fA)(-1,1,-1),(0,a.fA)(1,1,-1),(0,a.fA)(-1,-1,1),(0,a.fA)(1,-1,1),(0,a.fA)(-1,1,1),(0,a.fA)(1,1,1)],P=[(0,a.fA)(-1,-1,-1),(0,a.fA)(-1,-1,1),(0,a.fA)(-1,1,-1),(0,a.fA)(-1,1,1),(0,a.fA)(1,-1,-1),(0,a.fA)(1,-1,1),(0,a.fA)(1,1,-1),(0,a.fA)(1,1,1)],z=Math.sqrt(3),N=[null],R=new h.iy,B=(0,a.vt)(),I=(0,a.vt)(),q=(0,a.vt)(),D=new l.A,V=new h.iy,F=new h.iy,L=new h.iy,k=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],Q=new l.A,W=[0,0,0,0,0,0,0,0];var H=n(53099);function J(t,e,n){const r=new h.iy;return(0,c.hs)(r.center,t,.5),(0,c.Ln)(r.center,r.center,e,.5),r.radius=(0,c.Io)(r.center,t),(0,c.WQ)(r.center,r.center,n),r}class K{constructor(t,e,n){this.objectId=t,this.target=e,this.distance=n}}class Z extends K{constructor(t,e,n){super(t,e,n),this.type="vertex"}}class G extends K{constructor(t,e,n,r,i){super(t,e,n),this.start=r,this.end=i,this.type="edge"}}let $=class{constructor(){this._idToComponent=new Map,this._components=new p(t=>t.bounds),this._edges=new p(t=>t.bounds),this._tmpLineSegment=(0,u.vt)(),this._tmpP1=(0,a.vt)(),this._tmpP2=(0,a.vt)(),this._tmpP3=(0,a.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,i.Te)(e);const n=t;n.mbs=new h.iy(t.mbsJSON),await this._ensureEdgeLocations(n,e);const r=[];return this._edges.forEachNeighbor(t=>(this._addCandidates(n,t,r),r.length<1e3),n.mbs),{result:{candidates:r}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor(t=>{if(null==t.info){const{id:e,uid:r}=t;n.push({id:e,uid:r})}return!0},t.mbs),!n.length)return;const r={components:n},i=await this.remoteClient.invoke("fetchAllEdgeLocations",r,e??{});for(const t of i.components)this._setFetchEdgeLocations(t)}async add(t){const e=new X(t.id,new h.iy(t.bounds));return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const t=[];this._edges.forEachNeighbor(n=>(n.component===e&&t.push(n),!0),e.bounds),this._edges.remove(t),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(null==e||t.uid!==e.uid)return;const n=H.HY.createView(t.locations),r=new Array(n.count),i=(0,a.vt)(),o=(0,a.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,i),n.position1.getVec(s,o);const c=J(i,o,t.origin),a=new tt(e,s,c);r[s]=a}this._edges.add(r);const{objectIds:s,origin:c}=t;e.info={locations:n,objectIds:s,origin:c}}_addCandidates(t,e,n){const{info:r}=e.component,{origin:i,objectIds:o}=r,s=r.locations,a=s.position0.getVec(e.index,this._tmpP1),u=s.position1.getVec(e.index,this._tmpP2);(0,c.WQ)(a,a,i),(0,c.WQ)(u,u,i);const h=o[s.componentIndex.get(e.index)];this._addEdgeCandidate(t,h,a,u,n),Y(t,h,a,n),Y(t,h,u,n)}_addEdgeCandidate(t,e,n,r,i){if(!t.returnEdge)return;const o=t.mbs.center,s=(0,u.Cr)(n,r,this._tmpLineSegment),h=(0,u._I)(s,o,this._tmpP3);t.mbs.contains(h)&&i.push(new G(e,(0,a.o8)(h),(0,c.Io)(o,h),(0,a.o8)(n),(0,a.o8)(r)))}};$=(0,r.Cg)([(0,s.$K)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],$);const U=$;function Y(t,e,n,r){t.returnVertex&&t.mbs.contains(n)&&r.push(new Z(e,(0,a.o8)(n),(0,c.Io)(t.mbs.center,n)))}class X{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=(0,o.c)()}}class tt{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},71351(t,e,n){n.d(e,{C:()=>h,Cr:()=>d,LV:()=>u,fA:()=>l,oC:()=>f,vt:()=>c}),n(4576);var r=n(4341),i=(n(77690),n(29242)),o=n(35522),s=n(51850);function c(t){return t?a((0,s.o8)(t.origin),(0,s.o8)(t.direction)):a((0,s.vt)(),(0,s.vt)())}function a(t,e){return{origin:t,direction:e}}function u(t,e){const n=m.get();return n.origin=t,n.direction=e,n}function h(t,e=c()){return l(t.origin,t.direction,e)}function d(t,e,n=c()){return(0,o.C)(n.origin,t),(0,o.Re)(n.direction,e,t),n}function l(t,e,n=c()){return(0,o.C)(n.origin,t),(0,o.C)(n.direction,e),n}function f(t,e,n){const r=(0,o.Om)(t.direction,(0,o.Re)(n,e,t.origin));return(0,o.WQ)(n,t.origin,(0,o.hs)(n,t.direction,r)),n}n(32114);const m=new r.I(()=>c());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,i.vt)()},77690(t,e,n){n.d(e,{B8:()=>c,Ge:()=>f,I0:()=>l,KC:()=>a,a4:()=>u,hZ:()=>o,hs:()=>d,lw:()=>h,mg:()=>s,z0:()=>i});var r=n(34304);function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function o(t,e,n,r,i,o,s,c,a,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c,t[7]=a,t[8]=u,t}function s(t,e){if(t===e){const n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function c(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],a=e[6],u=e[7],h=e[8],d=h*s-c*u,l=-h*o+c*a,f=u*o-s*a;let m=n*d+r*l+i*f;return m?(m=1/m,t[0]=d*m,t[1]=(-h*r+i*u)*m,t[2]=(c*r-i*s)*m,t[3]=l*m,t[4]=(h*n-i*a)*m,t[5]=(-c*n+i*o)*m,t[6]=f*m,t[7]=(-u*n+r*a)*m,t[8]=(s*n-r*o)*m,t):null}function a(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],a=e[6],u=e[7],h=e[8];return t[0]=s*h-c*u,t[1]=i*u-r*h,t[2]=r*c-i*s,t[3]=c*a-o*h,t[4]=n*h-i*a,t[5]=i*o-n*c,t[6]=o*u-s*a,t[7]=r*a-n*u,t[8]=n*s-r*o,t}function u(t){const e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],s=t[5],c=t[6],a=t[7],u=t[8];return e*(u*o-s*a)+n*(-u*i+s*c)+r*(a*i-o*c)}function h(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],c=e[4],a=e[5],u=e[6],h=e[7],d=e[8],l=n[0],f=n[1],m=n[2],_=n[3],p=n[4],g=n[5],b=n[6],v=n[7],M=n[8];return t[0]=l*r+f*s+m*u,t[1]=l*i+f*c+m*h,t[2]=l*o+f*a+m*d,t[3]=_*r+p*s+g*u,t[4]=_*i+p*c+g*h,t[5]=_*o+p*a+g*d,t[6]=b*r+v*s+M*u,t[7]=b*i+v*c+M*h,t[8]=b*o+v*a+M*d,t}function d(t,e,n){const r=n[0],i=n[1],o=n[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=o*e[6],t[7]=o*e[7],t[8]=o*e[8],t}function l(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=n+n,c=r+r,a=i+i,u=n*s,h=r*s,d=r*c,l=i*s,f=i*c,m=i*a,_=o*s,p=o*c,g=o*a;return t[0]=1-d-m,t[3]=h-g,t[6]=l+p,t[1]=h+g,t[4]=1-u-m,t[7]=f-_,t[2]=l-p,t[5]=f+_,t[8]=1-u-d,t}function f(t,e){const n=e[0],r=e[1],i=e[2],o=e[3],s=e[4],c=e[5],a=e[6],u=e[7],h=e[8],d=e[9],l=e[10],f=e[11],m=e[12],_=e[13],p=e[14],g=e[15],b=n*c-r*s,v=n*a-i*s,M=n*u-o*s,S=r*a-i*c,y=r*u-o*c,w=i*u-o*a,j=h*_-d*m,x=h*p-l*m,A=h*g-f*m,O=d*p-l*_,C=d*g-f*_,T=l*g-f*p;let E=b*T-v*C+M*O+S*A-y*x+w*j;return E?(E=1/E,t[0]=(c*T-a*C+u*O)*E,t[1]=(a*A-s*T-u*x)*E,t[2]=(s*C-c*A+u*j)*E,t[3]=(i*C-r*T-o*O)*E,t[4]=(n*T-i*A+o*x)*E,t[5]=(r*A-n*C-o*j)*E,t[6]=(_*w-p*y+g*S)*E,t[7]=(p*M-m*w-g*v)*E,t[8]=(m*y-_*M+g*b)*E,t):null}function m(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}const _=h,p=m;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:a,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:u,equals:function(t,e){const n=t[0],i=t[1],o=t[2],s=t[3],c=t[4],a=t[5],u=t[6],h=t[7],d=t[8],l=e[0],f=e[1],m=e[2],_=e[3],p=e[4],g=e[5],b=e[6],v=e[7],M=e[8],S=(0,r.FD)();return Math.abs(n-l)<=S*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=S*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-m)<=S*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-_)<=S*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(c-p)<=S*Math.max(1,Math.abs(c),Math.abs(p))&&Math.abs(a-g)<=S*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(u-b)<=S*Math.max(1,Math.abs(u),Math.abs(b))&&Math.abs(h-v)<=S*Math.max(1,Math.abs(h),Math.abs(v))&&Math.abs(d-M)<=S*Math.max(1,Math.abs(d),Math.abs(M))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:i,fromQuat:l,fromRotation:function(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:c,isOrthoNormal:function(t){const e=(0,r.FD)(),n=t[0],i=t[1],o=t[2],s=t[3],c=t[4],a=t[5],u=t[6],h=t[7],d=t[8];return Math.abs(1-(n*n+s*s+u*u))<=e&&Math.abs(1-(i*i+c*c+h*h))<=e&&Math.abs(1-(o*o+a*a+d*d))<=e},mul:_,multiply:h,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t},normalFromMat4:f,normalFromMat4Legacy:function(t,e){const n=e[0],r=e[1],i=e[2],o=e[4],s=e[5],c=e[6],a=e[8],u=e[9],h=e[10],d=h*s-c*u,l=-h*o+c*a,f=u*o-s*a,m=n*d+r*l+i*f;if(!m)return null;const _=1/m;return t[0]=d*_,t[1]=(-h*r+i*u)*_,t[2]=(c*r-i*s)*_,t[3]=l*_,t[4]=(h*n-i*a)*_,t[5]=(-c*n+i*o)*_,t[6]=f*_,t[7]=(-u*n+r*a)*_,t[8]=(s*n-r*o)*_,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],c=e[4],a=e[5],u=e[6],h=e[7],d=e[8],l=Math.sin(n),f=Math.cos(n);return t[0]=f*r+l*s,t[1]=f*i+l*c,t[2]=f*o+l*a,t[3]=f*s-l*r,t[4]=f*c-l*i,t[5]=f*a-l*o,t[6]=u,t[7]=h,t[8]=d,t},scale:d,scaleByVec2:function(t,e,n){const r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t},set:o,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:p,subtract:m,translate:function(t,e,n){const r=e[0],i=e[1],o=e[2],s=e[3],c=e[4],a=e[5],u=e[6],h=e[7],d=e[8],l=n[0],f=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=s,t[4]=c,t[5]=a,t[6]=l*r+f*s+u,t[7]=l*i+f*c+h,t[8]=l*o+f*a+d,t},transpose:s},Symbol.toStringTag,{value:"Module"}))},82534(t,e,n){function r(){return[0,0,0,1]}function i(t){return[t[0],t[1],t[2],t[3]]}n.d(e,{o8:()=>i,vt:()=>r,zK:()=>o});const o=[0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:i,create:r,fromValues:function(t,e,n,r){return[t,e,n,r]}},Symbol.toStringTag,{value:"Module"}))},82919(t,e,n){n.d(e,{DV:()=>g,C:()=>_,vt:()=>f,Qy:()=>m,ui:()=>p,ST:()=>M,bU:()=>S,pw:()=>v,m7:()=>b,c8:()=>w});var r=n(4341),i=n(58083),o=n(35522),s=n(51850),c=n(78955),a=n(91829),u=n(71351);function h(t){return t?{ray:(0,u.vt)(t.ray),c0:t.c0,c1:t.c1}:{ray:(0,u.vt)(),c0:0,c1:Number.MAX_VALUE}}new r.I(()=>h());var d=n(27921),l=n(32114);function f(t){return t?[(0,d.vt)(t[0]),(0,d.vt)(t[1]),(0,d.vt)(t[2]),(0,d.vt)(t[3]),(0,d.vt)(t[4]),(0,d.vt)(t[5])]:[(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)(),(0,d.vt)()]}function m(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function _(t,e){for(let n=0;n<j;n++)(0,d.C)(t[n],e[n]);return t}function p(t,e,n,r=C){const s=(0,i.lw)(l.Rc.get(),e,t);(0,i.B8)(s,s);for(let t=0;t<x;++t){const e=(0,c.Z0)(l.Km.get(),A[t],s);(0,o.hZ)(r[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}g(n,r)}function g(t,e){(0,d.Cr)(e[4],e[0],e[3],t[0]),(0,d.Cr)(e[1],e[5],e[6],t[1]),(0,d.Cr)(e[4],e[5],e[1],t[2]),(0,d.Cr)(e[3],e[2],e[6],t[3]),(0,d.Cr)(e[0],e[1],e[2],t[4]),(0,d.Cr)(e[5],e[4],e[7],t[5])}function b(t,e){for(let n=0;n<j;n++){const r=t[n];if(r[0]*e.center[0]+r[1]*e.center[1]+r[2]*e.center[2]+r[3]>=e.radius)return!1}return!0}function v(t,e){return y(t,function(t,e=h()){return(0,u.C)(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}(e,O.get()))}function M(t,e,n){return y(t,function(t,e,n=h()){const r=(0,o.Bw)(t.vector);return(0,u.fA)(t.origin,e,n.ray),n.c0=0,n.c1=r,n}(e,n,O.get()))}function S(t,e){for(let n=0;n<j;n++)if((0,d.mN)(t[n],e)>0)return!1;return!0}function y(t,e){for(let n=0;n<j;n++)if(!(0,d.$Q)(t[n],e))return!1;return!0}const w={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},j=6,x=8,A=[(0,a.fA)(-1,-1,-1,1),(0,a.fA)(1,-1,-1,1),(0,a.fA)(1,1,-1,1),(0,a.fA)(-1,1,-1,1),(0,a.fA)(-1,-1,1,1),(0,a.fA)(1,-1,1,1),(0,a.fA)(1,1,1,1),(0,a.fA)(-1,1,1,1)],O=new r.I(h),C=m()},91869(t,e,n){function r(t,e){for(const n of t.values())if(e(n))return!0;return!1}function i(t,e,n){const r=t.get(e);if(void 0!==r)return r;const i=n();return t.set(e,i),i}function o(t){const e=new Map;return n=>(e.has(n)||e.set(n,t(n)),e.get(n))}n.d(e,{Bj:()=>o,Bs:()=>r,tE:()=>i})},94008(t,e,n){n.d(e,{iy:()=>f}),n(44208),n(53966);var r=n(34727),i=n(34304),o=n(58083),s=n(35522),c=n(51850),a=n(91829),u=n(34275);var h=n(71351),d=n(44280),l=n(32114);class f{constructor(t=0,e=0,n=0,r=0){this.radius=r,"number"==typeof t?this._center=(0,c.fA)(t,e,n):function(t){return e=t,(0,u.vZ)(e)&&e.length>=3||function(t){return((0,u.aI)(t)||Array.isArray(t))&&t.length>=3}(t);var e}(t)||function(t){return(e=t)instanceof Float32Array&&e.length>=4||function(t){return Array.isArray(t)&&t.length>=4}(t);var e}(t)?(this._center=(0,c.ci)(t),this.radius=4===t.length?t[3]:e):(this._center=(0,c.o8)(t.center),this.radius=t.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(t){(0,s.C)(this.center,t)}exactEquals(t){return(0,s.aI)(this._center,t.center)&&this.radius===t.radius}copyFrom(t){return t!==this&&((0,s.C)(this._center,t.center),this.radius=t.radius),this}clone(){return new f(this.center,this.radius)}toVec4(){return(0,a.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(t){return(0,s.hG)(this.center,t)<=this.radius**2}intersectRay(t,e){if(null==t)return!1;if(!this._intersect(t,m))return!1;let{t0:n,t1:r}=m;if((n<0||r<n&&r>0)&&(n=r),n<0)return!1;if(e){const{origin:r,direction:i}=t;e[0]=r[0]+i[0]*n,e[1]=r[1]+i[1]*n,e[2]=r[2]+i[2]*n}return!0}intersectLine(t,e){const n=(0,h.Cr)(t,e);if(!this._intersect(n,m))return[];const{origin:r,direction:o}=n,{t0:a,t1:u}=m,d=t=>{const e=(0,c.vt)();return(0,s.Ln)(e,r,o,t),this.projectPoint(e,e)};return Math.abs(a-u)<(0,i.FD)()?[d(a)]:[d(a),d(u)]}_intersect(t,e){const{origin:n,direction:r}=t,i=_;i[0]=n[0]-this.center[0],i[1]=n[1]-this.center[1],i[2]=n[2]-this.center[2];const o=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===o)return!1;const s=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),c=s*s-4*o*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-this.radius**2);if(c<0)return!1;const a=Math.sqrt(c);return e.t0=(-s-a)/(2*o),e.t1=(-s+a)/(2*o),!0}projectPoint(t,e){const n=(0,s.Re)(l.rq.get(),t,this.center),r=(0,s.hs)(l.rq.get(),n,this.radius/(0,s.Bw)(n));return(0,s.WQ)(e,r,this.center)}closestPointOnSilhouette(t,e){const n=l.rq.get(),r=l.Rc.get();(0,s.$A)(n,t.origin,t.direction),(0,s.$A)(e,n,t.origin),(0,s.hs)(e,e,1/(0,s.Bw)(e)*this.radius);const i=this._angleToSilhouette(t.origin),c=(0,d.g7)(t.origin,e);return(0,o.$0)(r,c+i,n),(0,s.Z0)(e,e,r),e}frustumCoverage(t,e,n){const r=this.radius,i=r*r,o=t+.5*Math.PI,s=e*e+i-2*Math.cos(o)*e*r,c=Math.sqrt(s),a=s-i;if(a<=0)return.5;const u=Math.sqrt(a),h=Math.acos(u/c)-Math.asin(r/(c/Math.sin(o)));return Math.min(1,(h+.5*n)/n)}_angleToSilhouette(t){const e=(0,s.Re)(l.rq.get(),t,this.center),n=(0,s.Bw)(e),i=this.radius,o=i+Math.abs(i-n);return(0,r.XM)(i/o)}union(t){const e=(0,s.Io)(this._center,t.center),n=this.radius,r=t.radius;return e+r<n?this:e+n<r?(this.copyFrom(t),this):((0,s.Cc)(this._center,this._center,t.center,(e+r-n)/(2*e)),this.radius=(e+n+r)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}new f;const m={t0:0,t1:0},_=(0,c.vt)();(0,c.vt)(),(0,c.vt)()}}]);