@arcgis/core 4.32.0-next.20250101 → 4.32.0-next.20250103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Color.js +1 -1
- package/PopupTemplate.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/geometry/extendedUnitData.js +5 -0
- package/arcade/geometry/functions.js +5 -0
- package/arcade/geometry/operators.js +5 -0
- package/arcade/geometry/unitConversion.js +5 -0
- package/arcade/geometry/wkt.js +5 -0
- package/arcade/languageUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js → 005727711cca0614c2ab.js} +2 -2
- package/assets/esri/core/workers/chunks/{e371f4f0eb3c22f222df.js.LICENSE.txt → 005727711cca0614c2ab.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{2d908c115ea18e813b95.js → 00c0fbe19c12691cf2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/08e28328385066c519c2.js +1 -0
- package/assets/esri/core/workers/chunks/{0e735d01296d340b393e.js → 0b95ec12218f3c04df18.js} +1 -1
- package/assets/esri/core/workers/chunks/{59bf879b4802a5ba431e.js → 0ee669947c23f469e357.js} +1 -1
- package/assets/esri/core/workers/chunks/116103ecec27cce47a2f.js +1 -0
- package/assets/esri/core/workers/chunks/11f00218905f0db447ff.js +1 -0
- package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +1 -0
- package/assets/esri/core/workers/chunks/16d7c07e1c11b88dae84.js +1 -0
- package/assets/esri/core/workers/chunks/1d04fe800cb98e4d6bc4.js +1 -0
- package/assets/esri/core/workers/chunks/{71f6e5742cf0c482066b.js → 1dc6b5b177022b80c473.js} +1 -1
- package/assets/esri/core/workers/chunks/{59455e2dd44b4c01cc76.js → 2586741c359057b3f626.js} +1 -1
- package/assets/esri/core/workers/chunks/{250a810dd4e1ff293564.js → 318a39b56851e707edad.js} +1 -1
- package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js → 370b230fd2d7703d0698.js} +2 -2
- package/assets/esri/core/workers/chunks/{b1e4813f0c73fc2a483c.js.LICENSE.txt → 370b230fd2d7703d0698.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/38d03fe352057fb375b5.js +1 -0
- package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js → 42aa697b4718b75b8cb2.js} +2 -2
- package/assets/esri/core/workers/chunks/{ebf9caf2dc8af89afec2.js.LICENSE.txt → 42aa697b4718b75b8cb2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{801dbea20966806db1c9.js → 53cd990b2c988518de6d.js} +1 -1
- package/assets/esri/core/workers/chunks/5a1eb0d1e25ff5574c43.js +1 -0
- package/assets/esri/core/workers/chunks/6157c49e7431f5868c77.js +1 -0
- package/assets/esri/core/workers/chunks/{eef2d94a73064f9bc085.js → 61d64f163840563017d5.js} +1 -1
- package/assets/esri/core/workers/chunks/6d218fb5e0f0a04d72c5.js +2 -0
- package/assets/esri/core/workers/chunks/{d82b3e2905cab511ff3a.js.LICENSE.txt → 6d218fb5e0f0a04d72c5.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/6ed57d01be6bc054c7cd.js +1 -0
- package/assets/esri/core/workers/chunks/7254956381e823219db0.js +1 -0
- package/assets/esri/core/workers/chunks/740e6bdb3b76f2ea6d61.js +1 -0
- package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{56fc353421252f2d0a99.js → 75e8ba7e02647b7216ae.js} +1 -1
- package/assets/esri/core/workers/chunks/89d7eec47e5b29935d92.js +1 -0
- package/assets/esri/core/workers/chunks/8cd2c9ec1e541836b81c.js +1 -0
- package/assets/esri/core/workers/chunks/{0b3e1e903120da297641.js → 932375de79e3d33bc4d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{263adfd1c2641ef5c0f5.js → 95f23bd17ce9e07fc8ef.js} +1 -1
- package/assets/esri/core/workers/chunks/{7de9c01849c4aa1940e7.js → 986889cea53c4a470347.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc6160e8ab3cea4040c2.js → 9e9b2fd958e816b1b5f6.js} +1 -1
- package/assets/esri/core/workers/chunks/a57cead317eb2fc9afd8.js +1 -0
- package/assets/esri/core/workers/chunks/acec58a7f23b2cc938ee.js +1 -0
- package/assets/esri/core/workers/chunks/b0f4254d8a32dd713009.js +1 -0
- package/assets/esri/core/workers/chunks/b277b8c2f556918e4f9a.js +1 -0
- package/assets/esri/core/workers/chunks/{deffd56e39ce725ce377.js → b30046a40bcfbec8abe4.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c11e2e65b97565e5003.js → b7db64b07edb0b37ece1.js} +1 -1
- package/assets/esri/core/workers/chunks/bd1fb82e8bac439d05ea.js +1 -0
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/c44ce0302dc82fb66ada.js +1 -0
- package/assets/esri/core/workers/chunks/c52872a50a5989121388.js +1 -0
- package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +2 -0
- package/assets/esri/core/workers/chunks/{a100fb789d72410f8d4f.js.LICENSE.txt → c8cd6ba5600d8ff8db0b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{57c1370b310768c0790a.js → ca1e186f136abb23ae4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d14e4fc82ad772899336.js → ca4a37bdc0f7fb705146.js} +1 -1
- package/assets/esri/core/workers/chunks/cb94fc9b0f613ad50b3f.js +1 -0
- package/assets/esri/core/workers/chunks/d20764cc99fcabcb7cbf.js +1 -0
- package/assets/esri/core/workers/chunks/df18a72e3625cbe31935.js +1 -0
- package/assets/esri/core/workers/chunks/eff8fcb6393cd1193cbc.js +1 -0
- package/assets/esri/core/workers/chunks/f19d3c855f6e93544918.js +1 -0
- package/assets/esri/core/workers/chunks/{60b40b2319d1651dd150.js → f7e50a8284d12da21355.js} +1 -1
- package/assets/esri/core/workers/chunks/f9c0d571f62e611ffe2b.js +1 -0
- package/assets/esri/core/workers/chunks/fdfe8e0d942b78f08191.js +1 -0
- package/assets/esri/core/workers/chunks/ff21207f46a354786eed.js +1 -0
- package/chunks/Bufferer-BiY2mtjI.js +1 -1
- package/chunks/Centroid-DZi-eb9F.js +1 -1
- package/chunks/Clipper-a9xfvRaw.js +1 -1
- package/chunks/CrackAndCluster-CfzXpEle.js +1 -1
- package/chunks/Distance2DCalculator-eS0piaux.js +1 -1
- package/chunks/GeodeticDistanceCalculator-bNilDneE.js +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/GeometryCleaner-DVgW95-D.js +1 -1
- package/chunks/Intersector-K1VmdfQW.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorDensify.js +1 -1
- package/chunks/OperatorDifference.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersection.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProject.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingDensify.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorSimplify.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorUnion.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SideCalculator2D-Bf4QCxCR.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/areaOperator.js +5 -0
- package/chunks/array.js +1 -1
- package/chunks/bufferOperator.js +5 -0
- package/chunks/centroidOperator.js +5 -0
- package/chunks/chartUtilsAm5.js +1 -1
- package/chunks/clipOperator.js +5 -0
- package/chunks/containsOperator.js +5 -0
- package/chunks/convexHullOperator.js +5 -0
- package/chunks/crossesOperator.js +5 -0
- package/chunks/cutOperator.js +5 -0
- package/chunks/densifyOperator.js +5 -0
- package/chunks/differenceOperator.js +5 -0
- package/chunks/disjointOperator.js +5 -0
- package/chunks/distanceOperator.js +5 -0
- package/chunks/equalsOperator.js +5 -0
- package/chunks/generalizeOperator.js +5 -0
- package/chunks/geodesicBufferOperator.js +5 -0
- package/chunks/geodeticAreaOperator.js +5 -0
- package/chunks/geodeticDensifyOperator.js +5 -0
- package/chunks/geodeticLengthOperator.js +5 -0
- package/chunks/i3s.js +1 -1
- package/chunks/intersectionOperator.js +5 -0
- package/chunks/intersectsOperator.js +5 -0
- package/chunks/languageUtils.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/lengthOperator.js +5 -0
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/offsetOperator.js +5 -0
- package/chunks/overlapsOperator.js +5 -0
- package/chunks/pe-wasm.js +1 -1
- package/chunks/proximityOperator.js +5 -0
- package/chunks/relateOperator.js +5 -0
- package/chunks/simplifyOperator.js +5 -0
- package/chunks/symmetricDifferenceOperator.js +5 -0
- package/chunks/touchesOperator.js +5 -0
- package/chunks/unionOperator.js +5 -0
- package/chunks/vxlLayer.js +1 -1
- package/chunks/withinOperator.js +5 -0
- package/copyright.txt +2 -2
- package/core/Evented.js +1 -1
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/gx/operatorAffineTransform.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.js +1 -1
- package/geometry/support/contains.js +1 -1
- package/kernel.js +1 -1
- package/layers/KMLLayer.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/package.json +3 -3
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/symbology/support/Theme.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/support/DisplayQualityProfile.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/Legend/support/heatmapRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/assets/esri/core/workers/chunks/015285436ca965f94e17.js +0 -1
- package/assets/esri/core/workers/chunks/048d296efa26ccd79056.js +0 -1
- package/assets/esri/core/workers/chunks/0e0b978459d70b15acb5.js +0 -1
- package/assets/esri/core/workers/chunks/10fa211987b16fd71a1a.js +0 -1
- package/assets/esri/core/workers/chunks/200a5f1864c2c2f7536c.js +0 -1
- package/assets/esri/core/workers/chunks/23a697d48f6e45cc033e.js +0 -1
- package/assets/esri/core/workers/chunks/29b610ff44708e044cbd.js +0 -1
- package/assets/esri/core/workers/chunks/3600125c58d5d04c515a.js +0 -1
- package/assets/esri/core/workers/chunks/457d4abc938d14f28e31.js +0 -1
- package/assets/esri/core/workers/chunks/4b5dbdcad438cb2dd4bf.js +0 -1
- package/assets/esri/core/workers/chunks/69efc716991a407c3d23.js +0 -1
- package/assets/esri/core/workers/chunks/6e254e846e284223ef63.js +0 -1
- package/assets/esri/core/workers/chunks/785610aa615198fd3815.js +0 -1
- package/assets/esri/core/workers/chunks/7bf7aace72f81f5de4e4.js +0 -1
- package/assets/esri/core/workers/chunks/7ea3d652536e1d79dfc6.js +0 -1
- package/assets/esri/core/workers/chunks/816c9c81352cd0ca8ce8.js +0 -1
- package/assets/esri/core/workers/chunks/9291508232b23f030178.js +0 -1
- package/assets/esri/core/workers/chunks/9fc49968dea8e2b64f3e.js +0 -1
- package/assets/esri/core/workers/chunks/a0b3d70a1b0360084593.js +0 -1
- package/assets/esri/core/workers/chunks/a100fb789d72410f8d4f.js +0 -2
- package/assets/esri/core/workers/chunks/b4d76d46661aba356ea3.js +0 -1
- package/assets/esri/core/workers/chunks/cb3af81e1fe6405c4885.js +0 -1
- package/assets/esri/core/workers/chunks/cbf57abb537e86c1dd7f.js +0 -1
- package/assets/esri/core/workers/chunks/cebdf2f88c4d2ad8baab.js +0 -1
- package/assets/esri/core/workers/chunks/d56d77125798beb7e493.js +0 -1
- package/assets/esri/core/workers/chunks/d82b3e2905cab511ff3a.js +0 -2
- package/assets/esri/core/workers/chunks/e2f91098793b8742fae6.js +0 -1
- package/assets/esri/core/workers/chunks/f25c04cf1a4bc1d2636a.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6064],{97937:(t,e,n)=>{n.d(e,{a:()=>N,c:()=>m,e:()=>A,f:()=>R,g:()=>E,i:()=>v,o:()=>x,s:()=>j,w:()=>p}),n(44208),n(53966);var o=n(34727),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(34304),l=n(88582),h=n(71351);function d(t,e){const n=(0,i.l)(t),r=(0,o.YN)(t[2]/n),s=Math.atan2(t[1]/n,t[0]/n);return(0,i.i)(e,n,r,s),e}var f=n(44280),T=n(32114);const _=m();function m(){return(0,a.vt)()}const O=c.e,g=c.e;function A(t,e){return(0,c.c)(e,t)}function p(t){return t}function E(t){return t[3]}function N(t){return t}function R(t,e,n,o){return(0,a.fA)(t,e,n,o)}function I(t,e,n){if(null==e)return!1;if(!M(t,e,S))return!1;let{t0:o,t1:r}=S;if((o<0||r<o&&r>0)&&(o=r),o<0)return!1;if(n){const{origin:t,direction:r}=e;n[0]=t[0]+r[0]*o,n[1]=t[1]+r[1]*o,n[2]=t[2]+r[2]*o}return!0}const S={t0:0,t1:0};function M(t,e,n){const{origin:o,direction:r}=e,i=b;i[0]=o[0]-t[0],i[1]=o[1]-t[1],i[2]=o[2]-t[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const c=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),a=c*c-4*s*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-t[3]*t[3]);if(a<0)return!1;const u=Math.sqrt(a);return n.t0=(-c-u)/(2*s),n.t1=(-c+u)/(2*s),!0}const b=(0,s.vt)();function v(t,e){return I(t,e,null)}function F(t,e,n){const o=T.rq.get(),s=T.Rc.get();(0,i.e)(o,e.origin,e.direction);const c=E(t);(0,i.e)(n,o,e.origin),(0,i.h)(n,n,1/(0,i.l)(n)*c);const a=L(t,e.origin),u=(0,f.g7)(e.origin,n);return(0,r.$0)(s,u+a,o),(0,i.t)(n,n,s),n}function P(t,e,n){const o=(0,i.d)(T.rq.get(),e,t),r=(0,i.h)(T.rq.get(),o,t[3]/(0,i.l)(o));return(0,i.g)(n,r,t)}function L(t,e){const n=(0,i.d)(T.rq.get(),e,t),r=(0,i.l)(n),s=E(t),c=s+Math.abs(s-r);return(0,o.XM)(s/c)}const C=(0,s.vt)();function B(t,e,n,o){const r=(0,i.d)(C,e,t);switch(n){case l._.X:{const t=d(r,C)[2];return(0,i.i)(o,-Math.sin(t),Math.cos(t),0)}case l._.Y:{const t=d(r,C),e=t[1],n=t[2],s=Math.sin(e);return(0,i.i)(o,-s*Math.cos(n),-s*Math.sin(n),Math.cos(e))}case l._.Z:return(0,i.n)(o,r);default:return}}function w(t,e){const n=(0,i.d)(y,e,t);return(0,i.l)(n)-t[3]}function x(t,e){const n=(0,i.s)(t,e),o=E(t);return n<=o*o}const y=(0,s.vt)(),D=m(),j=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:_,altitudeAt:w,angleToSilhouette:L,axisAt:B,cameraFrustumCoverage:function(t,e,n,o){const r=E(t),i=r*r,s=e+.5*Math.PI,c=n*n+i-2*Math.cos(s)*n*r,a=Math.sqrt(c),u=c-i;if(u<=0)return.5;const l=Math.sqrt(u),h=Math.acos(l/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(h+.5*o)/o)},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return I(t,e,n)?n:((0,h.oC)(e,t,n),P(t,n,n))},closestPointOnSilhouette:F,containsPoint:x,copy:A,create:m,distanceToSilhouette:function(t,e){const n=(0,i.d)(T.rq.get(),e,t),o=(0,i.k)(n),r=t[3]*t[3];return Math.sqrt(Math.abs(o-r))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:g,exactEquals:O,fromCenterAndRadius:function(t,e){return(0,a.fA)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:R,getCenter:N,getExtent:function(t,e){return e},getRadius:E,intersectLine:function(t,e,n){const o=(0,h.Cr)(e,n);if(!M(t,o,S))return[];const{origin:r,direction:c}=o,{t0:a,t1:l}=S,d=e=>{const n=(0,s.vt)();return(0,i.b)(n,r,c,e),P(t,n,n)};return Math.abs(a-l)<(0,u.FD)()?[d(a)]:[d(a),d(l)]},intersectRay:I,intersectRayClosestSilhouette:function(t,e,n){if(I(t,e,n))return n;const o=F(t,e,T.rq.get());return(0,i.g)(n,e.origin,(0,i.h)(T.rq.get(),e.direction,(0,i.j)(e.origin,o)/(0,i.l)(e.direction))),n},intersectsRay:v,projectPoint:P,setAltitudeAt:function(t,e,n,o){const r=w(t,e),s=B(t,e,l._.Z,y),c=(0,i.h)(y,s,n-r);return(0,i.g)(o,e,c)},setExtent:function(t,e,n){return t!==n&&A(t,n),n},tmpSphere:D,union:function(t,e,n=(0,a.vt)()){const o=(0,i.j)(t,e),r=t[3],s=e[3];return o+s<r?((0,c.c)(n,t),n):o+r<s?((0,c.c)(n,e),n):((0,i.m)(n,t,e,(o+s-r)/(2*o)),n[3]=(o+r+s)/2,n)},wrap:p},Symbol.toStringTag,{value:"Module"}))},4341:(t,e,n)=>{n.d(e,{I:()=>r});var o=n(26390);class r{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.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*i);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,i));t++)this._items.push(this._allocator())}}const i=1024},91829:(t,e,n)=>{function o(){return[0,0,0,0]}function r(t,e,n,o){return[t,e,n,o]}function i(t,e,n,o){return[t,e,n,o]}function s(t,e=[0,0,0,0]){const n=Math.min(4,t.length);for(let o=0;o<n;++o)e[o]=t[o];return e}function c(){return r(1,1,1,1)}function a(){return r(1,0,0,0)}function u(){return r(0,1,0,0)}function l(){return r(0,0,1,0)}function h(){return r(0,0,0,1)}n.d(e,{CN:()=>i,Un:()=>f,ci:()=>s,fA:()=>r,uY:()=>d,vt:()=>o});const d=[0,0,0,0],f=c(),T=a(),_=u(),m=l(),O=h();Object.freeze(Object.defineProperty({__proto__:null,ONES:f,UNIT_W:O,UNIT_X:T,UNIT_Y:_,UNIT_Z:m,ZEROS:d,clone:function(t){return[t[0],t[1],t[2],t[3]]},create:o,createView:function(t,e){return new Float64Array(t,e,4)},freeze:i,fromArray:s,fromValues:r,ones:c,unitW:h,unitX:a,unitY:u,unitZ:l,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))},34727:(t,e,n)=>{n.d(e,{$8:()=>A,Cc:()=>s,Io:()=>g,KJ:()=>u,Sp:()=>d,XM:()=>l,YN:()=>h,cU:()=>r,hs:()=>c,kU:()=>a,or:()=>E,pF:()=>R,pq:()=>N,qE:()=>i});const o=new Float32Array(1);function r(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function i(t,e,n){return Math.min(Math.max(t,e),n)}function s(t,e,n){return t+(e-t)*n}function c(t,e,n,o,r){return s(o,r,(t-e)/(n-e))}function a(t){return t*Math.PI/180}function u(t){return 180*t/Math.PI}function l(t){return Math.acos(i(t,-1,1))}function h(t){return Math.asin(i(t,-1,1))}function d(t,e,n=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=n}const f=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function T(t){return f.setFloat64(0,t),f.getBigInt64(0)}const _=BigInt("1000000"),m=O(1);function O(t){const e=T(t=Math.abs(t)),n=function(t){return f.setBigInt64(0,t),f.getFloat64(0)}(e<=_?_:e-_);return Math.abs(t-n)}function g(t,e,n=m){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=n&&O(Math.min(Math.abs(t),Math.abs(e)))<n)return Math.abs(t-e)<=n;const o=T(t),r=T(e);return o<0==r<0&&!((o<r?r-o:o-r)>_)}function A(t){return p(Math.max(-N,Math.min(t,N)))}function p(t){return o[0]=t,o[0]}function E(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],o=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(d(e,1)&&d(n,1)&&d(o,1))}const N=p(34028234663852886e22);function R(t,e,n){if(void 0===n||0==+n)return Math[t](e);if(e=+e,n=+n,isNaN(e)||"number"!=typeof n||n%1!=0)return NaN;let o=e.toString().split("e");return o=(e=Math[t](+(o[0]+"e"+(o[1]?+o[1]-n:-n)))).toString().split("e"),+(o[0]+"e"+(o[1]?+o[1]+n:n))}},88582:(t,e,n)=>{var o;n.d(e,{_:()=>o}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(o||(o={}))},82919:(t,e,n)=>{n.d(e,{C:()=>O,vt:()=>m,ui:()=>g,m7:()=>A});var o=n(4341),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(71351);function l(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 o.I((()=>l()));var h,d,f,T=n(27921),_=n(32114);function m(t){return t?[(0,T.vt)(t[0]),(0,T.vt)(t[1]),(0,T.vt)(t[2]),(0,T.vt)(t[3]),(0,T.vt)(t[4]),(0,T.vt)(t[5])]:[(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)()]}function O(t,e){for(let n=0;n<p;n++)(0,T.C)(t[n],e[n]);return t}function g(t,e,n,o=R){const s=(0,r.lw)(_.Rc.get(),e,t);(0,r.B8)(s,s);for(let t=0;t<E;++t){const e=(0,c.t)(_.Km.get(),N[t],s);(0,i.i)(o[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}!function(t,e){(0,T.Cr)(e[d.FAR_BOTTOM_LEFT],e[d.NEAR_BOTTOM_LEFT],e[d.NEAR_TOP_LEFT],t[h.LEFT]),(0,T.Cr)(e[d.NEAR_BOTTOM_RIGHT],e[d.FAR_BOTTOM_RIGHT],e[d.FAR_TOP_RIGHT],t[h.RIGHT]),(0,T.Cr)(e[d.FAR_BOTTOM_LEFT],e[d.FAR_BOTTOM_RIGHT],e[d.NEAR_BOTTOM_RIGHT],t[h.BOTTOM]),(0,T.Cr)(e[d.NEAR_TOP_LEFT],e[d.NEAR_TOP_RIGHT],e[d.FAR_TOP_RIGHT],t[h.TOP]),(0,T.Cr)(e[d.NEAR_BOTTOM_LEFT],e[d.NEAR_BOTTOM_RIGHT],e[d.NEAR_TOP_RIGHT],t[h.NEAR]),(0,T.Cr)(e[d.FAR_BOTTOM_RIGHT],e[d.FAR_BOTTOM_LEFT],e[d.FAR_TOP_LEFT],t[h.FAR])}(n,o)}function A(t,e){for(let n=0;n<p;n++){const o=t[n];if(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]+o[3]>=e[3])return!1}return!0}(f=h||(h={}))[f.LEFT=0]="LEFT",f[f.RIGHT=1]="RIGHT",f[f.BOTTOM=2]="BOTTOM",f[f.TOP=3]="TOP",f[f.NEAR=4]="NEAR",f[f.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(d||(d={})),d.FAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_LEFT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_BOTTOM_RIGHT,d.NEAR_TOP_RIGHT,d.NEAR_TOP_LEFT,d.FAR_BOTTOM_RIGHT,d.FAR_BOTTOM_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_RIGHT,d.NEAR_BOTTOM_RIGHT,d.FAR_BOTTOM_RIGHT,d.FAR_TOP_RIGHT,d.NEAR_TOP_RIGHT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_TOP_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_LEFT,d.NEAR_TOP_LEFT,d.NEAR_TOP_RIGHT,d.FAR_TOP_RIGHT;const p=6,E=8,N=[(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)],R=(new o.I(l),[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()])},11964:(t,e,n)=>{n.d(e,{Cr:()=>u,H6:()=>d,_I:()=>h,kb:()=>l,vt:()=>a});var o=n(34727),r=n(4341),i=n(38954),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,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.vector,e,t),n}function l(t,e){const n=(0,i.d)(c.rq.get(),e,t.origin),r=(0,i.f)(t.vector,n),s=(0,i.f)(t.vector,t.vector),a=(0,o.qE)(r/s,0,1),u=(0,i.d)(c.rq.get(),(0,i.h)(c.rq.get(),t.vector,a),n);return(0,i.f)(u,u)}function h(t,e,n){return d(t,e,0,1,n)}function d(t,e,n,r,s){const{vector:a,origin:u}=t,l=(0,i.d)(c.rq.get(),e,u),h=(0,i.f)(a,l)/(0,i.k)(a);return(0,i.h)(s,a,(0,o.qE)(h,n,r)),(0,i.g)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)(),new r.I((()=>a()))},9318:(t,e,n)=>{n.d(e,{b:()=>i});var o=n(34727),r=n(97146);function i(t,e,n){const i=Array.isArray(t),l=i?t.length/e:t.byteLength/(4*e),h=i?t:new Uint32Array(t,0,l*e),d=n?.minReduction??0,f=n?.originalIndices||null,T=f?f.length:0,_=n?.componentOffsets||null;let m=0;if(_)for(let t=0;t<_.length-1;t++){const e=_[t+1]-_[t];e>m&&(m=e)}else m=l;const O=Math.floor(1.1*m)+1;(null==u||u.length<2*O)&&(u=new Uint32Array((0,o.cU)(2*O)));for(let t=0;t<2*O;t++)u[t]=0;let g=0;const A=!!_&&!!f,p=A?T:l;let E=(0,r.my)(l);const N=new Uint32Array(T),R=1.96;let I=0!==d?Math.ceil(4*R*R/(d*d)*d*(1-d)):p,S=1,M=_?_[1]:p;for(let t=0;t<p;t++){if(t===I){const e=1-g/t;if(e+R*Math.sqrt(e*(1-e)/t)<d)return null;I*=2}if(t===M){for(let t=0;t<2*O;t++)u[t]=0;if(f)for(let t=_[S-1];t<_[S];t++)N[t]=E[f[t]];M=_[++S]}const n=A?f[t]:t,o=n*e,r=a(h,o,e);let i=r%O,c=g;for(;0!==u[2*i+1];){if(u[2*i]===r){const t=u[2*i+1]-1;if(s(h,o,t*e,e)){c=E[t];break}}i++,i>=O&&(i-=O)}c===g&&(u[2*i]=r,u[2*i+1]=n+1,g++),E[n]=c}if(0!==d&&1-g/l<d)return null;if(A){for(let t=_[S-1];t<N.length;t++)N[t]=E[f[t]];E=(0,r.Dg)(N)}const b=i?new Array(g):new Uint32Array(g*e);g=0;for(let t=0;t<p;t++)E[t]===g&&(c(h,(A?f[t]:t)*e,b,g*e,e),g++);if(f&&!A){const t=new Uint32Array(T);for(let e=0;e<t.length;e++)t[e]=E[f[e]];E=(0,r.Dg)(t)}return{buffer:Array.isArray(b)?b:b.buffer,indices:E,uniqueCount:g}}function s(t,e,n,o){for(let r=0;r<o;r++)if(t[e+r]!==t[n+r])return!1;return!0}function c(t,e,n,o,r){for(let i=0;i<r;i++)n[o+i]=t[e+i]}function a(t,e,n){let o=0;for(let r=0;r<n;r++)o=t[e+r]+o|0,o=o+(o<<11)+(o>>>2)|0;return o>>>0}let u=null},71351:(t,e,n)=>{n.d(e,{C:()=>h,Cr:()=>d,LV:()=>l,kb:()=>f,oC:()=>T,vt:()=>a}),n(4576);var o=n(4341),r=(n(77690),n(29242)),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?u((0,s.o8)(t.origin),(0,s.o8)(t.direction)):u((0,s.vt)(),(0,s.vt)())}function u(t,e){return{origin:t,direction:e}}function l(t,e){const n=_.get();return n.origin=t,n.direction=e,n}function h(t,e=a()){return function(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.c)(n.direction,e),n}(t.origin,t.direction,e)}function d(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.direction,e,t),n}function f(t,e){const n=(0,i.e)(c.rq.get(),(0,i.n)(c.rq.get(),t.direction),(0,i.d)(c.rq.get(),e,t.origin));return(0,i.f)(n,n)}function T(t,e,n){const o=(0,i.f)(t.direction,(0,i.d)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.h)(n,t.direction,o)),n}const _=new o.I((()=>a()));(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,r.vt)()},4431:(t,e,n)=>{n.d(e,{U:()=>i});var o=n(63907),r=n(74038);function i(t,e=0){const n=t.stride;return Array.from(t.fields.keys()).map((o=>{const i=t.fields.get(o),c=i.constructor.ElementCount,a=s(i.constructor.ElementType),u=i.offset,l=i.optional?.glNormalized??!1;return new r._(o,c,a,u,n,l,e)}))}function s(t){const e=c[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const c={u8:o.pe.UNSIGNED_BYTE,u16:o.pe.UNSIGNED_SHORT,u32:o.pe.UNSIGNED_INT,i8:o.pe.BYTE,i16:o.pe.SHORT,i32:o.pe.INT,f32:o.pe.FLOAT}},78230:(t,e,n)=>{n.d(e,{A:()=>G});var o,r,i=n(93687),s=n(3694),c=n(38954),a=n(51850),u=n(82919),l=n(71351),h=n(97937),d=n(620);class f{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 T,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),T.clearPool(),P[0]=null,x.prune(),H.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=T.acquire();for(let o=0;o<e;o++){const e=t[o];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}T.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=T.acquire();for(const o of t){const t=e??(0,h.e)(this.objectToBoundingSphere(o),y);M(t[3])?(n.init(this._root),O(o,t,n)):this._degenerateObjects.delete(o)}T.release(n),this._shrink()}update(t,e){if(!M(e[3])&&this._isDegenerate(t))return;const n=function(t){return P[0]=t,P}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=(0,l.LV)(t,e);_(this._root,(t=>{if(!function(t,e){return N((0,h.a)(e.bounds),2*-e.halfSize,B),N((0,h.a)(e.bounds),2*e.halfSize,w),(0,d.O_)(t.origin,t.direction,B,w)}(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const r=(0,l.LV)(t,e);_(this._root,(t=>{if(!function(t,e,n){return N((0,h.a)(e.bounds),2*-e.halfSize,B),N((0,h.a)(e.bounds),2*e.halfSize,w),n.applyToMinMax(B,w),(0,d.O_)(t.origin,t.direction,B,w)}(r,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),!0}))}forEach(t){_(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,o=()=>!0,r=1/0){let i=1/0,s=1/0,a=null;const l=I(t,e),d=c=>{if(--r,!o(c))return;const l=this.objectToBoundingSphere(c);if(!(0,u.m7)(n,l))return;const d=S(t,e,(0,h.a)(l)),f=d-l[3],T=d+l[3];f<i&&(i=f,s=T,a=c)};return m(this._root,(o=>{if(r<=0||!(0,u.m7)(n,o.bounds))return!1;if((0,c.h)(C,l,o.halfSize),(0,c.g)(C,C,(0,h.a)(o.bounds)),S(t,e,C)>s)return!1;const i=o.node;return i.terminals.forAll((t=>d(t))),null!==i.residents&&i.residents.forAll((t=>d(t))),!0}),t,e),a}forEachInDepthRange(t,e,n,o,r,i,s){let a=-1/0,l=1/0;const d={setRange:t=>{n===f.DepthOrder.FRONT_TO_BACK?(a=Math.max(a,t.near),l=Math.min(l,t.far)):(a=Math.max(a,-t.far),l=Math.min(l,-t.near))}};d.setRange(o);const T=S(e,n,t),_=I(e,n),O=I(e,-n),g=t=>{if(!s(t))return;const o=this.objectToBoundingSphere(t),c=(0,h.a)(o),f=S(e,n,c)-T,_=f-o[3],m=f+o[3];_>l||m<a||!(0,u.m7)(i,o)||r(t,d)};m(this._root,(t=>{if(!(0,u.m7)(i,t.bounds))return!1;if((0,c.h)(C,_,t.halfSize),(0,c.g)(C,C,(0,h.a)(t.bounds)),S(e,n,C)-T>l)return!1;if((0,c.h)(C,O,t.halfSize),(0,c.g)(C,C,(0,h.a)(t.bounds)),S(e,n,C)-T<a)return!1;const o=t.node;return o.terminals.forAll((t=>g(t))),null!==o.residents&&o.residents.forAll((t=>g(t))),!0}),e,n)}forEachNode(t){_(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=(0,h.g)(e),o=(0,h.a)(e),r=e=>{const r=this.objectToBoundingSphere(e),i=(0,h.g)(r),s=n+i;return!((0,c.s)((0,h.a)(r),o)-s*s<=0)||t(e)};let i=!0;const s=t=>{i&&(i=r(t))};_(this._root,(t=>{const e=(0,h.g)(t.bounds),r=n+e;if((0,c.s)((0,h.a)(t.bounds),o)-r*r>0)return!1;const a=t.node;return a.terminals.forAll(s),i&&null!==a.residents&&a.residents.forAll(s),i})),i&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||(0,h.i)(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||(0,h.i)(n.applyToBoundingSphere(o),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 o=T.acquire().init(t);this._add(e.at(n),o),T.release(o)}}_grow(t,e){if(0!==e&&(R(t,e,(t=>this.objectToBoundingSphere(t)),D),M(D[3])&&!this._fitsInsideTree(D)))if(A(this._root.node))(0,h.e)(D,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(D);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(D,t):this._growRootAsSubNode(t),T.release(t)}}_rebuildTree(t,e){(0,c.c)((0,h.a)(j),(0,h.a)(e.bounds)),j[3]=e.halfSize,R([t,j],2,(t=>t),U);const n=T.acquire().init(this._root);this._root.initFrom(null,U,U[3]),this._root.increaseHalfSize(1.25),_(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),T.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return _(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const r=this._root.bounds,i=this._root.halfSize;for(let t=0;t<3;t++){const s=r[t]-i-(n[t]-e),c=n[t]+e-(r[t]+i),a=Math.max(0,Math.ceil(s/(2*i))),u=Math.max(0,Math.ceil(c/(2*i)))+1,l=2**Math.ceil(Math.log(a+u)*Math.LOG2E);o=Math.max(o,l),z[t].min=a,z[t].max=u}for(let t=0;t<3;t++){let e=z[t].min,n=z[t].max;const s=(o-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=r[t]-i-e*i*2;L[t]=c+(n+e)*i}const s=o*i;return L[3]=s*F,T.acquire().initFrom(null,L,s,0)}_growRootAsSubNode(t){const e=this._root.node;(0,c.c)((0,h.a)(D),(0,h.a)(this._root.bounds)),D[3]=this._root.halfSize,this._root.init(t),t.advanceTo(D,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,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!M(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=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:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new f((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 T{constructor(){this.bounds=(0,h.c)(),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,o=this.depth){return this.node=null!=t?t:T.createEmptyNode(),e&&(0,h.e)(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*F}advance(t){let e=this.node.children[t];e||(e=T.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=b[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new s.A({shrink:!0}),residents:new s.A({shrink:!0})}}static acquire(){return T._pool.acquire()}static release(t){T._pool.release(t)}static clearPool(){T._pool.prune()}}function _(t,e){let n=T.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&o.push(T.acquire().init(n).advance(t));T.release(n)}}function m(t,e,n,o=f.DepthOrder.FRONT_TO_BACK){let r=T.acquire().init(t);const i=[r];for(function(t,e,n){if(!H.length)for(let t=0;t<8;++t)H.push({index:0,distance:0});for(let n=0;n<8;++n){const o=b[n];H.data[n].index=n,H.data[n].distance=S(t,e,o)}H.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=H.data[t].index}(n,o,V);0!==i.length;){if(r=i.pop(),e(r)&&!r.isLeaf())for(let t=7;t>=0;--t){const e=V[t];r.node.children[e]&&i.push(T.acquire().init(r).advance(e))}T.release(r)}}function O(t,e,n){x.clear();const o=n.advanceTo(e,((t,e)=>{x.push(t.node),x.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let t=x.length-2;t>=0&&g(x.data[t],x.data[t+1]);t-=2);}function g(t,e){return e>=0&&(t.children[e]=null),!!A(t)&&(null===t.residents&&(t.residents=new s.A({shrink:!0})),!0)}function A(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 p(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function E(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function N(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function R(t,e,n,o){if(1===e){const e=n(t[0]);(0,h.e)(e,o)}else{B[0]=1/0,B[1]=1/0,B[2]=1/0,w[0]=-1/0,w[1]=-1/0,w[2]=-1/0;for(let o=0;o<e;o++){const e=n(t[o]);M(e[3])&&(p(B,e),E(w,e))}(0,c.m)((0,h.a)(o),B,w,.5),o[3]=Math.max(w[0]-B[0],w[1]-B[1],w[2]-B[2])/2}}function I(t,e){let n,o=1/0;for(let r=0;r<8;++r){const i=S(t,e,v[r]);i<o&&(o=i,n=v[r])}return n}function S(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function M(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}T._pool=new i.A(T),o=f||(f={}),(r=o.DepthOrder||(o.DepthOrder={}))[r.FRONT_TO_BACK=1]="FRONT_TO_BACK",r[r.BACK_TO_FRONT=-1]="BACK_TO_FRONT";const b=[(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)],v=[(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)],F=Math.sqrt(3),P=[null],L=(0,h.c)(),C=(0,a.vt)(),B=(0,a.vt)(),w=(0,a.vt)(),x=new s.A,y=(0,h.c)(),D=(0,h.c)(),j=(0,h.c)(),U=(0,h.c)(),z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H=new s.A,V=[0,0,0,0,0,0,0,0],G=f},46540:(t,e,n)=>{var o;n.d(e,{r:()=>o}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.ROTATION="rotation",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.PREVPOSITION="prevPosition",t.NEXTPOSITION="nextPosition",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.START_UP="startUp",t.END_UP="endUp",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(o||(o={}))},3055:(t,e,n)=>{n.d(e,{I$:()=>s,In:()=>u,gr:()=>a});var o=n(4431),r=n(1843),i=n(46540);const s=(0,r.BP)().vec3f(i.r.POSITION).u16(i.r.COMPONENTINDEX).freeze(),c=(0,r.BP)().vec2u8(i.r.SIDENESS).freeze(),a=((0,o.U)(c),(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze()),u=(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).vec2i16(i.r.NORMAL2COMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze();new Map([[i.r.POSITION0,0],[i.r.POSITION1,1],[i.r.COMPONENTINDEX,2],[i.r.VARIANTOFFSET,3],[i.r.VARIANTSTROKE,4],[i.r.VARIANTEXTENSION,5],[i.r.NORMALCOMPRESSED,6],[i.r.NORMAL2COMPRESSED,7],[i.r.SIDENESS,8]])},93406:(t,e,n)=>{n.d(e,{K:()=>a});var o=n(34727),r=n(3694),i=n(38954),s=n(51850);const c=-1;function a(t,e,n){const o=t.vertices.position,r=t.vertices.componentIndex,s=_.position0,a=_.position1,h=_.faceNormal0,f=_.faceNormal1,{edges:T,normals:m}=l(t),O=T.length/4,g=e.allocate(O);let A=0;const p=O,R=n?.allocate(p);let S=0,M=0,b=0;d.length=0;for(let t=0;t<O;++t){const e=4*t;o.getVec(T.data[e],s),o.getVec(T.data[e+1],a);const n=d.pushNew();n.index=4*t,n.length=(0,i.j)(s,a)}d.sort(((t,e)=>e.length-t.length));const v=new Array,F=new Array;d.forAll((({length:t,index:l})=>{const d=T.data[l],O=T.data[l+1],p=T.data[l+2],P=T.data[l+3],L=P===c;if(o.getVec(d,s),o.getVec(O,a),L){const t=3*p;(0,i.i)(h,m.data[t],m.data[t+1],m.data[t+2]),(0,i.c)(f,h),_.componentIndex=r.get(d),_.cosAngle=(0,i.f)(h,f)}else{let t=3*p;if((0,i.i)(h,m.data[t],m.data[t+1],m.data[t+2]),t=3*P,(0,i.i)(f,m.data[t],m.data[t+1],m.data[t+2]),_.componentIndex=r.get(d),_.cosAngle=(0,i.f)(h,f),function(t,e){return t.cosAngle>e}(_,N))return;_.cosAngle<-.9999&&(0,i.c)(f,h)}M+=t,b++,L||function(t,e){return t.cosAngle<e}(_,I)?(e.write(g,A++,_),v.push(t)):u(_,E)&&(R&&n&&n.write(R,S++,_),F.push(t))}));const P=new Float32Array(v.reverse()),L=new Float32Array(F.reverse()),C=R&&n?{instancesData:R.slice(0,S),lodInfo:{lengths:L}}:void 0;return{regular:{instancesData:g.slice(0,A),lodInfo:{lengths:P}},silhouette:C,averageEdgeLength:M/b}}function u(t,e){const n=(0,o.XM)(t.cosAngle);return(0,i.o)(O,t.position1,t.position0),n*((0,i.f)((0,i.e)(m,t.faceNormal0,t.faceNormal1),O)>0?-1:1)>e}function l(t){const e=t.faces.length/3,n=t.faces,o=t.neighbors,r=t.vertices.position;f.length=T.length=0;for(let t=0;t<e;t++){const e=3*t,s=o[e],a=o[e+1],u=o[e+2],l=n[e],h=n[e+1],d=n[e+2];r.getVec(l,g),r.getVec(h,A),r.getVec(d,p),(0,i.d)(A,A,g),(0,i.d)(p,p,g),(0,i.e)(g,A,p),(0,i.n)(g,g),T.pushArray(g),(s===c||l<h)&&(f.push(l),f.push(h),f.push(t),f.push(s)),(a===c||h<d)&&(f.push(h),f.push(d),f.push(t),f.push(a)),(u===c||d<l)&&(f.push(d),f.push(l),f.push(t),f.push(u))}return{edges:f,normals:T}}class h{constructor(){this.index=0,this.length=0}}const d=new r.A({allocator:t=>t||new h,deallocator:null}),f=new r.A({deallocator:null}),T=new r.A({deallocator:null}),_=new class{constructor(){this.position0=(0,s.vt)(),this.position1=(0,s.vt)(),this.faceNormal0=(0,s.vt)(),this.faceNormal1=(0,s.vt)(),this.componentIndex=0,this.cosAngle=0}},m=(0,s.vt)(),O=(0,s.vt)(),g=(0,s.vt)(),A=(0,s.vt)(),p=(0,s.vt)(),E=(0,o.kU)(4),N=Math.cos(E),R=(0,o.kU)(35),I=Math.cos(R)},53099:(t,e,n)=>{n.d(e,{o6:()=>v,HY:()=>w,hx:()=>F,Jb:()=>B});var o=n(9318);function r(t,e,n){const o=e/3,r=new Uint32Array(n+1),i=new Uint32Array(n+1),s=(t,e)=>{t<e?r[t+1]++:i[e+1]++};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];s(n,o),s(o,r),s(r,n)}let c=0,a=0;for(let t=0;t<n;t++){const e=r[t+1],n=i[t+1];r[t+1]=c,i[t+1]=a,c+=e,a+=n}const u=new Uint32Array(6*o),l=r[n],h=(t,e,n)=>{if(t<e){const o=r[t+1]++;u[2*o]=e,u[2*o+1]=n}else{const o=i[e+1]++;u[2*l+2*o]=t,u[2*l+2*o+1]=n}};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];h(n,o,e),h(o,r,e),h(r,n,e)}const d=(t,e)=>{const n=2*t,o=e-t;for(let t=1;t<o;t++){const e=u[n+2*t],o=u[n+2*t+1];let r=t-1;for(;r>=0&&u[n+2*r]>e;r--)u[n+2*r+2]=u[n+2*r],u[n+2*r+3]=u[n+2*r+1];u[n+2*r+2]=e,u[n+2*r+3]=o}};for(let t=0;t<n;t++)d(r[t],r[t+1]),d(l+i[t],l+i[t+1]);const f=new Int32Array(3*o),T=(e,n)=>e===t[3*n]?0:e===t[3*n+1]?1:e===t[3*n+2]?2:-1,_=(t,e)=>{const n=T(t,e);f[3*e+n]=-1},m=(t,e,n,o)=>{const r=T(t,e);f[3*e+r]=o;const i=T(n,o);f[3*o+i]=e};for(let t=0;t<n;t++){let e=r[t];const n=r[t+1];let o=i[t];const s=i[t+1];for(;e<n&&o<s;){const n=u[2*e],r=u[2*l+2*o];n===r?(m(t,u[2*e+1],r,u[2*l+2*o+1]),e++,o++):n<r?(_(t,u[2*e+1]),e++):(_(r,u[2*l+2*o+1]),o++)}for(;e<n;)_(t,u[2*e+1]),e++;for(;o<s;)_(u[2*l+2*o],u[2*l+2*o+1]),o++}return f}var i=n(1843),s=n(46540),c=n(3055),a=n(87811),u=n(38954),l=n(51850),h=n(4431),d=n(34727);function f(t,e,n,o,r,i=2){const s=1/(Math.abs(n)+Math.abs(o)+Math.abs(r)),c=n*s,a=o*s,u=r<=0?(c>=0?1:-1)*(1-Math.abs(a)):c,l=r<=0?(a>=0?1:-1)*(1-Math.abs(c)):a,h=e*i;t[h]=T(u),t[h+1]=T(l)}function T(t){return(0,d.qE)(Math.round(32767*t),-32767,32767)}n(11868);class _{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?p:A}write(t,e,n){M.seed=this._edgeHashFunction(n);const o=M.getIntRange(0,255),r=M.getIntRange(0,this.settings.variants-1),i=M.getFloat(),s=255*(.5*function(t){return Math.abs(t)**1.2*Math.sign(t)}(-(1-Math.min(i/.7,1))+Math.max(0,i-.7)/(1-.7))+.5);t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex),t.variantOffset.set(e,o),t.variantStroke.set(e,r),t.variantExtension.set(e,s)}}const m=new Float32Array(6),O=new Uint32Array(m.buffer),g=new Uint32Array(1);function A(t){return m[0]=t.position0[0],m[1]=t.position0[1],m[2]=t.position0[2],m[3]=t.position1[0],m[4]=t.position1[1],m[5]=t.position1[2],g[0]=31*(31*(31*(31*(31*(166811+O[0])+O[1])+O[2])+O[3])+O[4])+O[5],g[0]}function p(t){const e=m;e[0]=N(t.position0[0]),e[1]=N(t.position0[1]),e[2]=N(t.position0[2]),e[3]=N(t.position1[0]),e[4]=N(t.position1[1]),e[5]=N(t.position1[2]),g[0]=5381;for(let t=0;t<O.length;t++)g[0]=31*g[0]+O[t];return g[0]}const E=1e4;function N(t){return Math.round(t*E)/E}class R{constructor(){this._commonWriter=new _}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.gr.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),(0,u.g)(S,n.faceNormal0,n.faceNormal1),(0,u.n)(S,S);const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,S[0],S[1],S[2],r)}}R.Layout=c.gr,R.glLayout=(0,h.U)(c.gr,1);class I{constructor(){this._commonWriter=new _}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.In.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n);{const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,n.faceNormal0[0],n.faceNormal0[1],n.faceNormal0[2],r)}{const{typedBuffer:o,typedBufferStride:r}=t.normal2Compressed;f(o,e,n.faceNormal1[0],n.faceNormal1[1],n.faceNormal1[2],r)}}}I.Layout=c.In,I.glLayout=(0,h.U)(c.In,1);const S=(0,l.vt)(),M=new a.A;var b=n(93406);function v(t){const e=F(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return L.updateSettings(t.writerSettings),C.updateSettings(t.writerSettings),(0,b.K)(e,L,C)}function F(t,e,n,i){if(e){const e=r(n,i,t.count);return new P(n,i,e,t)}const s=(0,o.b)(t.buffer,t.stride/4,{originalIndices:n,originalIndicesLength:i}),a=r(s.indices,i,s.uniqueCount);return{faces:s.indices,facesLength:s.indices.length,neighbors:a,vertices:c.I$.createView(s.buffer)}}class P{constructor(t,e,n,o){this.faces=t,this.facesLength=e,this.neighbors=n,this.vertices=o}}const L=new R,C=new I,B=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1),w=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1).u16(s.r.COMPONENTINDEX)},46064:(t,e,n)=>{n.r(e),n.d(e,{default:()=>T});var o=n(90237),r=n(74887),i=(n(53966),n(44208),n(87811),n(49186),n(40608)),s=n(38954),c=n(51850),a=n(11964),u=n(97937),l=n(78230),h=n(53099);function d(t,e,n){const o=(0,u.c)(),r=(0,u.a)(o);return(0,s.b)(r,r,t,.5),(0,s.b)(r,r,e,.5),o[3]=(0,s.j)(r,t),(0,s.g)(r,r,n),o}let f=class{constructor(){this._idToComponent=new Map,this._components=new l.A((t=>t.bounds)),this._edges=new l.A((t=>t.bounds)),this._tmpLineSegment=(0,a.vt)(),this._tmpP1=(0,c.vt)(),this._tmpP2=(0,c.vt)(),this._tmpP3=(0,c.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,r.Te)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>(this._addCandidates(t,e,n),n.length<1e3)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if(null==t.info){const{id:e,uid:o}=t;n.push({id:e,uid:o})}return!0}),t.bounds),!n.length)return;const o={components:n},r=await this.remoteClient.invoke("fetchAllEdgeLocations",o,e??{});for(const t of r.components)this._setFetchEdgeLocations(t)}async add(t){const e=new m(t.id,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),o=new Array(n.count),r=(0,c.vt)(),i=(0,c.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,r),n.position1.getVec(s,i);const c=d(r,i,t.origin),a=new O(e,s,c);o[s]=a}this._edges.add(o);const{objectIds:s,origin:a}=t;e.info={locations:n,objectIds:s,origin:a}}_addCandidates(t,e,n){const{info:o}=e.component,{origin:r,objectIds:i}=o,c=o.locations,a=c.position0.getVec(e.index,this._tmpP1),u=c.position1.getVec(e.index,this._tmpP2);(0,s.g)(a,a,r),(0,s.g)(u,u,r);const l=i[c.componentIndex.get(e.index)];this._addEdgeCandidate(t,l,a,u,n),_(t,l,a,n),_(t,l,u,n)}_addEdgeCandidate(t,e,n,o,r){if(!t.returnEdge)return;const i=(0,u.a)(t.bounds),l=(0,a.Cr)(n,o,this._tmpLineSegment),h=(0,a._I)(l,i,this._tmpP3);(0,u.o)(t.bounds,h)&&r.push({type:"edge",objectId:e,target:(0,c.o8)(h),distance:(0,s.j)(i,h),start:(0,c.o8)(n),end:(0,c.o8)(o)})}};f=(0,o._)([(0,i.$)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],f);const T=f;function _(t,e,n,o){if(!t.returnVertex||!(0,u.o)(t.bounds,n))return;const r=(0,u.a)(t.bounds);o.push({type:"vertex",objectId:e,target:(0,c.o8)(n),distance:(0,s.j)(r,n)})}class m{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++m.uid}}m.uid=0;class O{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},74038:(t,e,n)=>{n.d(e,{_:()=>o});class o{constructor(t,e,n,o,r,i=!1,s=0){this.name=t,this.count=e,this.type=n,this.offset=o,this.stride=r,this.normalized=i,this.divisor=s}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6064],{97937:(t,e,n)=>{n.d(e,{a:()=>N,c:()=>m,e:()=>A,f:()=>R,g:()=>E,i:()=>v,o:()=>x,s:()=>j,w:()=>p}),n(44208),n(53966);var o=n(34727),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(34304),l=n(88582),h=n(71351);function d(t,e){const n=(0,i.l)(t),r=(0,o.YN)(t[2]/n),s=Math.atan2(t[1]/n,t[0]/n);return(0,i.i)(e,n,r,s),e}var f=n(44280),T=n(32114);const _=m();function m(){return(0,a.vt)()}const O=c.e,g=c.e;function A(t,e){return(0,c.c)(e,t)}function p(t){return t}function E(t){return t[3]}function N(t){return t}function R(t,e,n,o){return(0,a.fA)(t,e,n,o)}function I(t,e,n){if(null==e)return!1;if(!M(t,e,S))return!1;let{t0:o,t1:r}=S;if((o<0||r<o&&r>0)&&(o=r),o<0)return!1;if(n){const{origin:t,direction:r}=e;n[0]=t[0]+r[0]*o,n[1]=t[1]+r[1]*o,n[2]=t[2]+r[2]*o}return!0}const S={t0:0,t1:0};function M(t,e,n){const{origin:o,direction:r}=e,i=b;i[0]=o[0]-t[0],i[1]=o[1]-t[1],i[2]=o[2]-t[2];const s=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(0===s)return!1;const c=2*(r[0]*i[0]+r[1]*i[1]+r[2]*i[2]),a=c*c-4*s*(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]-t[3]*t[3]);if(a<0)return!1;const u=Math.sqrt(a);return n.t0=(-c-u)/(2*s),n.t1=(-c+u)/(2*s),!0}const b=(0,s.vt)();function v(t,e){return I(t,e,null)}function F(t,e,n){const o=T.rq.get(),s=T.Rc.get();(0,i.e)(o,e.origin,e.direction);const c=E(t);(0,i.e)(n,o,e.origin),(0,i.h)(n,n,1/(0,i.l)(n)*c);const a=L(t,e.origin),u=(0,f.g7)(e.origin,n);return(0,r.$0)(s,u+a,o),(0,i.t)(n,n,s),n}function P(t,e,n){const o=(0,i.d)(T.rq.get(),e,t),r=(0,i.h)(T.rq.get(),o,t[3]/(0,i.l)(o));return(0,i.g)(n,r,t)}function L(t,e){const n=(0,i.d)(T.rq.get(),e,t),r=(0,i.l)(n),s=E(t),c=s+Math.abs(s-r);return(0,o.XM)(s/c)}const C=(0,s.vt)();function B(t,e,n,o){const r=(0,i.d)(C,e,t);switch(n){case l._.X:{const t=d(r,C)[2];return(0,i.i)(o,-Math.sin(t),Math.cos(t),0)}case l._.Y:{const t=d(r,C),e=t[1],n=t[2],s=Math.sin(e);return(0,i.i)(o,-s*Math.cos(n),-s*Math.sin(n),Math.cos(e))}case l._.Z:return(0,i.n)(o,r);default:return}}function w(t,e){const n=(0,i.d)(y,e,t);return(0,i.l)(n)-t[3]}function x(t,e){const n=(0,i.s)(t,e),o=E(t);return n<=o*o}const y=(0,s.vt)(),D=m(),j=Object.freeze(Object.defineProperty({__proto__:null,NullSphere:_,altitudeAt:w,angleToSilhouette:L,axisAt:B,cameraFrustumCoverage:function(t,e,n,o){const r=E(t),i=r*r,s=e+.5*Math.PI,c=n*n+i-2*Math.cos(s)*n*r,a=Math.sqrt(c),u=c-i;if(u<=0)return.5;const l=Math.sqrt(u),h=Math.acos(l/a)-Math.asin(r/(a/Math.sin(s)));return Math.min(1,(h+.5*o)/o)},clear:function(t){t[0]=t[1]=t[2]=t[3]=0},closestPoint:function(t,e,n){return I(t,e,n)?n:((0,h.oC)(e,t,n),P(t,n,n))},closestPointOnSilhouette:F,containsPoint:x,copy:A,create:m,distanceToSilhouette:function(t,e){const n=(0,i.d)(T.rq.get(),e,t),o=(0,i.k)(n),r=t[3]*t[3];return Math.sqrt(Math.abs(o-r))},elevate:function(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n},equals:g,exactEquals:O,fromCenterAndRadius:function(t,e){return(0,a.fA)(t[0],t[1],t[2],e)},fromRadius:function(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t},fromValues:R,getCenter:N,getExtent:function(t,e){return e},getRadius:E,intersectLine:function(t,e,n){const o=(0,h.Cr)(e,n);if(!M(t,o,S))return[];const{origin:r,direction:c}=o,{t0:a,t1:l}=S,d=e=>{const n=(0,s.vt)();return(0,i.b)(n,r,c,e),P(t,n,n)};return Math.abs(a-l)<(0,u.FD)()?[d(a)]:[d(a),d(l)]},intersectRay:I,intersectRayClosestSilhouette:function(t,e,n){if(I(t,e,n))return n;const o=F(t,e,T.rq.get());return(0,i.g)(n,e.origin,(0,i.h)(T.rq.get(),e.direction,(0,i.j)(e.origin,o)/(0,i.l)(e.direction))),n},intersectsRay:v,projectPoint:P,setAltitudeAt:function(t,e,n,o){const r=w(t,e),s=B(t,e,l._.Z,y),c=(0,i.h)(y,s,n-r);return(0,i.g)(o,e,c)},setExtent:function(t,e,n){return t!==n&&A(t,n),n},tmpSphere:D,union:function(t,e,n=(0,a.vt)()){const o=(0,i.j)(t,e),r=t[3],s=e[3];return o+s<r?((0,c.c)(n,t),n):o+r<s?((0,c.c)(n,e),n):((0,i.m)(n,t,e,(o+s-r)/(2*o)),n[3]=(o+r+s)/2,n)},wrap:p},Symbol.toStringTag,{value:"Module"}))},4341:(t,e,n)=>{n.d(e,{I:()=>r});var o=n(26390);class r{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,o.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*i);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,i));t++)this._items.push(this._allocator())}}const i=1024},91829:(t,e,n)=>{function o(){return[0,0,0,0]}function r(t,e,n,o){return[t,e,n,o]}function i(t,e,n,o){return[t,e,n,o]}function s(t,e=[0,0,0,0]){const n=Math.min(4,t.length);for(let o=0;o<n;++o)e[o]=t[o];return e}function c(){return r(1,1,1,1)}function a(){return r(1,0,0,0)}function u(){return r(0,1,0,0)}function l(){return r(0,0,1,0)}function h(){return r(0,0,0,1)}n.d(e,{CN:()=>i,Un:()=>f,ci:()=>s,fA:()=>r,uY:()=>d,vt:()=>o});const d=[0,0,0,0],f=c(),T=a(),_=u(),m=l(),O=h();Object.freeze(Object.defineProperty({__proto__:null,ONES:f,UNIT_W:O,UNIT_X:T,UNIT_Y:_,UNIT_Z:m,ZEROS:d,clone:function(t){return[t[0],t[1],t[2],t[3]]},create:o,createView:function(t,e){return new Float64Array(t,e,4)},freeze:i,fromArray:s,fromValues:r,ones:c,unitW:h,unitX:a,unitY:u,unitZ:l,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))},34727:(t,e,n)=>{n.d(e,{$8:()=>A,Cc:()=>s,Io:()=>g,KJ:()=>u,Sp:()=>d,XM:()=>l,YN:()=>h,cU:()=>r,hs:()=>c,kU:()=>a,or:()=>E,pF:()=>R,pq:()=>N,qE:()=>i});const o=new Float32Array(1);function r(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function i(t,e,n){return Math.min(Math.max(t,e),n)}function s(t,e,n){return t+(e-t)*n}function c(t,e,n,o,r){return s(o,r,(t-e)/(n-e))}function a(t){return t*Math.PI/180}function u(t){return 180*t/Math.PI}function l(t){return Math.acos(i(t,-1,1))}function h(t){return Math.asin(i(t,-1,1))}function d(t,e,n=1e-6){return t===e||!(!Number.isFinite(t)||!Number.isFinite(e))&&(t>e?t-e:e-t)<=n}const f=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function T(t){return f.setFloat64(0,t),f.getBigInt64(0)}const _=BigInt("1000000"),m=O(1);function O(t){const e=T(t=Math.abs(t)),n=function(t){return f.setBigInt64(0,t),f.getFloat64(0)}(e<=_?_:e-_);return Math.abs(t-n)}function g(t,e,n=m){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(null!=n&&O(Math.min(Math.abs(t),Math.abs(e)))<n)return Math.abs(t-e)<=n;const o=T(t),r=T(e);return o<0==r<0&&!((o<r?r-o:o-r)>_)}function A(t){return p(Math.max(-N,Math.min(t,N)))}function p(t){return o[0]=t,o[0]}function E(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],o=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(d(e,1)&&d(n,1)&&d(o,1))}const N=p(34028234663852886e22);function R(t,e,n){if(void 0===n||0==+n)return Math[t](e);if(e=+e,n=+n,isNaN(e)||"number"!=typeof n||n%1!=0)return NaN;let o=e.toString().split("e");return o=(e=Math[t](+(o[0]+"e"+(o[1]?+o[1]-n:-n)))).toString().split("e"),+(o[0]+"e"+(o[1]?+o[1]+n:n))}},88582:(t,e,n)=>{var o;n.d(e,{_:()=>o}),function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"}(o||(o={}))},82919:(t,e,n)=>{n.d(e,{C:()=>O,vt:()=>m,ui:()=>g,m7:()=>A});var o=n(4341),r=n(58083),i=n(38954),s=n(51850),c=n(87317),a=n(91829),u=n(71351);function l(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 o.I((()=>l()));var h,d,f,T=n(27921),_=n(32114);function m(t){return t?[(0,T.vt)(t[0]),(0,T.vt)(t[1]),(0,T.vt)(t[2]),(0,T.vt)(t[3]),(0,T.vt)(t[4]),(0,T.vt)(t[5])]:[(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),(0,T.vt)()]}function O(t,e){for(let n=0;n<p;n++)(0,T.C)(t[n],e[n]);return t}function g(t,e,n,o=R){const s=(0,r.lw)(_.Rc.get(),e,t);(0,r.B8)(s,s);for(let t=0;t<E;++t){const e=(0,c.t)(_.Km.get(),N[t],s);(0,i.i)(o[t],e[0]/e[3],e[1]/e[3],e[2]/e[3])}!function(t,e){(0,T.Cr)(e[d.FAR_BOTTOM_LEFT],e[d.NEAR_BOTTOM_LEFT],e[d.NEAR_TOP_LEFT],t[h.LEFT]),(0,T.Cr)(e[d.NEAR_BOTTOM_RIGHT],e[d.FAR_BOTTOM_RIGHT],e[d.FAR_TOP_RIGHT],t[h.RIGHT]),(0,T.Cr)(e[d.FAR_BOTTOM_LEFT],e[d.FAR_BOTTOM_RIGHT],e[d.NEAR_BOTTOM_RIGHT],t[h.BOTTOM]),(0,T.Cr)(e[d.NEAR_TOP_LEFT],e[d.NEAR_TOP_RIGHT],e[d.FAR_TOP_RIGHT],t[h.TOP]),(0,T.Cr)(e[d.NEAR_BOTTOM_LEFT],e[d.NEAR_BOTTOM_RIGHT],e[d.NEAR_TOP_RIGHT],t[h.NEAR]),(0,T.Cr)(e[d.FAR_BOTTOM_RIGHT],e[d.FAR_BOTTOM_LEFT],e[d.FAR_TOP_LEFT],t[h.FAR])}(n,o)}function A(t,e){for(let n=0;n<p;n++){const o=t[n];if(o[0]*e[0]+o[1]*e[1]+o[2]*e[2]+o[3]>=e[3])return!1}return!0}(f=h||(h={}))[f.LEFT=0]="LEFT",f[f.RIGHT=1]="RIGHT",f[f.BOTTOM=2]="BOTTOM",f[f.TOP=3]="TOP",f[f.NEAR=4]="NEAR",f[f.FAR=5]="FAR",function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(d||(d={})),d.FAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_LEFT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_BOTTOM_RIGHT,d.NEAR_TOP_RIGHT,d.NEAR_TOP_LEFT,d.FAR_BOTTOM_RIGHT,d.FAR_BOTTOM_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_RIGHT,d.NEAR_BOTTOM_RIGHT,d.FAR_BOTTOM_RIGHT,d.FAR_TOP_RIGHT,d.NEAR_TOP_RIGHT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_TOP_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_LEFT,d.NEAR_TOP_LEFT,d.NEAR_TOP_RIGHT,d.FAR_TOP_RIGHT;const p=6,E=8,N=[(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)],R=(new o.I(l),[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()])},11964:(t,e,n)=>{n.d(e,{Cr:()=>u,H6:()=>d,_I:()=>h,kb:()=>l,vt:()=>a});var o=n(34727),r=n(4341),i=n(38954),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,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.vector,e,t),n}function l(t,e){const n=(0,i.d)(c.rq.get(),e,t.origin),r=(0,i.f)(t.vector,n),s=(0,i.f)(t.vector,t.vector),a=(0,o.qE)(r/s,0,1),u=(0,i.d)(c.rq.get(),(0,i.h)(c.rq.get(),t.vector,a),n);return(0,i.f)(u,u)}function h(t,e,n){return d(t,e,0,1,n)}function d(t,e,n,r,s){const{vector:a,origin:u}=t,l=(0,i.d)(c.rq.get(),e,u),h=(0,i.f)(a,l)/(0,i.k)(a);return(0,i.h)(s,a,(0,o.qE)(h,n,r)),(0,i.g)(s,s,t.origin)}(0,s.vt)(),(0,s.vt)(),new r.I((()=>a()))},9318:(t,e,n)=>{n.d(e,{b:()=>i});var o=n(34727),r=n(97146);function i(t,e,n){const i=Array.isArray(t),l=i?t.length/e:t.byteLength/(4*e),h=i?t:new Uint32Array(t,0,l*e),d=n?.minReduction??0,f=n?.originalIndices||null,T=f?f.length:0,_=n?.componentOffsets||null;let m=0;if(_)for(let t=0;t<_.length-1;t++){const e=_[t+1]-_[t];e>m&&(m=e)}else m=l;const O=Math.floor(1.1*m)+1;(null==u||u.length<2*O)&&(u=new Uint32Array((0,o.cU)(2*O)));for(let t=0;t<2*O;t++)u[t]=0;let g=0;const A=!!_&&!!f,p=A?T:l;let E=(0,r.my)(l);const N=new Uint32Array(T),R=1.96;let I=0!==d?Math.ceil(4*R*R/(d*d)*d*(1-d)):p,S=1,M=_?_[1]:p;for(let t=0;t<p;t++){if(t===I){const e=1-g/t;if(e+R*Math.sqrt(e*(1-e)/t)<d)return null;I*=2}if(t===M){for(let t=0;t<2*O;t++)u[t]=0;if(f)for(let t=_[S-1];t<_[S];t++)N[t]=E[f[t]];M=_[++S]}const n=A?f[t]:t,o=n*e,r=a(h,o,e);let i=r%O,c=g;for(;0!==u[2*i+1];){if(u[2*i]===r){const t=u[2*i+1]-1;if(s(h,o,t*e,e)){c=E[t];break}}i++,i>=O&&(i-=O)}c===g&&(u[2*i]=r,u[2*i+1]=n+1,g++),E[n]=c}if(0!==d&&1-g/l<d)return null;if(A){for(let t=_[S-1];t<N.length;t++)N[t]=E[f[t]];E=(0,r.Dg)(N)}const b=i?new Array(g):new Uint32Array(g*e);g=0;for(let t=0;t<p;t++)E[t]===g&&(c(h,(A?f[t]:t)*e,b,g*e,e),g++);if(f&&!A){const t=new Uint32Array(T);for(let e=0;e<t.length;e++)t[e]=E[f[e]];E=(0,r.Dg)(t)}return{buffer:Array.isArray(b)?b:b.buffer,indices:E,uniqueCount:g}}function s(t,e,n,o){for(let r=0;r<o;r++)if(t[e+r]!==t[n+r])return!1;return!0}function c(t,e,n,o,r){for(let i=0;i<r;i++)n[o+i]=t[e+i]}function a(t,e,n){let o=0;for(let r=0;r<n;r++)o=t[e+r]+o|0,o=o+(o<<11)+(o>>>2)|0;return o>>>0}let u=null},71351:(t,e,n)=>{n.d(e,{C:()=>h,Cr:()=>d,LV:()=>l,kb:()=>f,oC:()=>T,vt:()=>a}),n(4576);var o=n(4341),r=(n(77690),n(29242)),i=n(38954),s=n(51850),c=n(32114);function a(t){return t?u((0,s.o8)(t.origin),(0,s.o8)(t.direction)):u((0,s.vt)(),(0,s.vt)())}function u(t,e){return{origin:t,direction:e}}function l(t,e){const n=_.get();return n.origin=t,n.direction=e,n}function h(t,e=a()){return function(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.c)(n.direction,e),n}(t.origin,t.direction,e)}function d(t,e,n=a()){return(0,i.c)(n.origin,t),(0,i.d)(n.direction,e,t),n}function f(t,e){const n=(0,i.e)(c.rq.get(),(0,i.n)(c.rq.get(),t.direction),(0,i.d)(c.rq.get(),e,t.origin));return(0,i.f)(n,n)}function T(t,e,n){const o=(0,i.f)(t.direction,(0,i.d)(n,e,t.origin));return(0,i.g)(n,t.origin,(0,i.h)(n,t.direction,o)),n}const _=new o.I((()=>a()));(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,r.vt)()},4431:(t,e,n)=>{n.d(e,{U:()=>i});var o=n(63907),r=n(74038);function i(t,e=0){const n=t.stride;return Array.from(t.fields.keys()).map((o=>{const i=t.fields.get(o),c=i.constructor.ElementCount,a=s(i.constructor.ElementType),u=i.offset,l=i.optional?.glNormalized??!1;return new r._(o,c,a,u,n,l,e)}))}function s(t){const e=c[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const c={u8:o.pe.UNSIGNED_BYTE,u16:o.pe.UNSIGNED_SHORT,u32:o.pe.UNSIGNED_INT,i8:o.pe.BYTE,i16:o.pe.SHORT,i32:o.pe.INT,f32:o.pe.FLOAT}},78230:(t,e,n)=>{n.d(e,{A:()=>f});var o,r,i=n(93687),s=n(3694),c=n(38954),a=n(51850),u=n(82919),l=n(71351),h=n(97937),d=n(620);class f{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 T,this._objectCount=0,e&&(void 0!==e.maximumObjectsPerNode&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),void 0!==e.maximumDepth&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),T.clearPool(),P[0]=null,x.prune(),H.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=T.acquire();for(let o=0;o<e;o++){const e=t[o];this._isDegenerate(e)?this._degenerateObjects.add(e):(n.init(this._root),this._add(e,n))}T.release(n)}remove(t,e=null){this._objectCount-=t.length;const n=T.acquire();for(const o of t){const t=e??(0,h.e)(this.objectToBoundingSphere(o),y);M(t[3])?(n.init(this._root),O(o,t,n)):this._degenerateObjects.delete(o)}T.release(n),this._shrink()}update(t,e){if(!M(e[3])&&this._isDegenerate(t))return;const n=function(t){return P[0]=t,P}(t);this.remove(n,e),this.add(n)}forEachAlongRay(t,e,n){const o=(0,l.LV)(t,e);_(this._root,(t=>{if(!function(t,e){return N((0,h.a)(e.bounds),2*-e.halfSize,B),N((0,h.a)(e.bounds),2*e.halfSize,w),(0,d.O_)(t.origin,t.direction,B,w)}(o,t))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObject(o,t)&&n(t)})),!0}))}forEachAlongRayWithVerticalOffset(t,e,n,o){const r=(0,l.LV)(t,e);_(this._root,(t=>{if(!function(t,e,n){return N((0,h.a)(e.bounds),2*-e.halfSize,B),N((0,h.a)(e.bounds),2*e.halfSize,w),n.applyToMinMax(B,w),(0,d.O_)(t.origin,t.direction,B,w)}(r,t,o))return!1;const e=t.node;return e.terminals.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),null!==e.residents&&e.residents.forAll((t=>{this._intersectsObjectWithOffset(r,t,o)&&n(t)})),!0}))}forEach(t){_(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,o=()=>!0,r=1/0){let i=1/0,s=1/0,a=null;const l=I(t,e),d=c=>{if(--r,!o(c))return;const l=this.objectToBoundingSphere(c);if(!(0,u.m7)(n,l))return;const d=S(t,e,(0,h.a)(l)),f=d-l[3],T=d+l[3];f<i&&(i=f,s=T,a=c)};return m(this._root,(o=>{if(r<=0||!(0,u.m7)(n,o.bounds))return!1;if((0,c.h)(C,l,o.halfSize),(0,c.g)(C,C,(0,h.a)(o.bounds)),S(t,e,C)>s)return!1;const i=o.node;return i.terminals.forAll((t=>d(t))),null!==i.residents&&i.residents.forAll((t=>d(t))),!0}),t,e),a}forEachInDepthRange(t,e,n,o,r,i,s){let a=-1/0,l=1/0;const d={setRange:t=>{n===f.DepthOrder.FRONT_TO_BACK?(a=Math.max(a,t.near),l=Math.min(l,t.far)):(a=Math.max(a,-t.far),l=Math.min(l,-t.near))}};d.setRange(o);const T=S(e,n,t),_=I(e,n),O=I(e,-n),g=t=>{if(!s(t))return;const o=this.objectToBoundingSphere(t),c=(0,h.a)(o),f=S(e,n,c)-T,_=f-o[3],m=f+o[3];_>l||m<a||!(0,u.m7)(i,o)||r(t,d)};m(this._root,(t=>{if(!(0,u.m7)(i,t.bounds))return!1;if((0,c.h)(C,_,t.halfSize),(0,c.g)(C,C,(0,h.a)(t.bounds)),S(e,n,C)-T>l)return!1;if((0,c.h)(C,O,t.halfSize),(0,c.g)(C,C,(0,h.a)(t.bounds)),S(e,n,C)-T<a)return!1;const o=t.node;return o.terminals.forAll((t=>g(t))),null!==o.residents&&o.residents.forAll((t=>g(t))),!0}),e,n)}forEachNode(t){_(this._root,(e=>t(e.node,e.bounds,e.halfSize,e.depth)))}forEachNeighbor(t,e){const n=(0,h.g)(e),o=(0,h.a)(e),r=e=>{const r=this.objectToBoundingSphere(e),i=(0,h.g)(r),s=n+i;return!((0,c.s)((0,h.a)(r),o)-s*s<=0)||t(e)};let i=!0;const s=t=>{i&&(i=r(t))};_(this._root,(t=>{const e=(0,h.g)(t.bounds),r=n+e;if((0,c.s)((0,h.a)(t.bounds),o)-r*r>0)return!1;const a=t.node;return a.terminals.forAll(s),i&&null!==a.residents&&a.residents.forAll(s),i})),i&&this.forEachDegenerateObject(s)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||(0,h.i)(n,t)}_intersectsObjectWithOffset(t,e,n){const o=this.objectToBoundingSphere(e);return!(o[3]>0)||(0,h.i)(n.applyToBoundingSphere(o),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 o=T.acquire().init(t);this._add(e.at(n),o),T.release(o)}}_grow(t,e){if(0!==e&&(R(t,e,(t=>this.objectToBoundingSphere(t)),D),M(D[3])&&!this._fitsInsideTree(D)))if(A(this._root.node))(0,h.e)(D,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const t=this._rootBoundsForRootAsSubNode(D);this._placingRootViolatesMaxDepth(t)?this._rebuildTree(D,t):this._growRootAsSubNode(t),T.release(t)}}_rebuildTree(t,e){(0,c.c)((0,h.a)(j),(0,h.a)(e.bounds)),j[3]=e.halfSize,R([t,j],2,(t=>t),U);const n=T.acquire().init(this._root);this._root.initFrom(null,U,U[3]),this._root.increaseHalfSize(1.25),_(n,(t=>(this.add(t.node.terminals.data,t.node.terminals.length),null!==t.node.residents&&this.add(t.node.residents.data,t.node.residents.length),!0))),T.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return _(this._root,(t=>(n=Math.max(n,t.depth),n+e<=this._maximumDepth))),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let o=-1/0;const r=this._root.bounds,i=this._root.halfSize;for(let t=0;t<3;t++){const s=r[t]-i-(n[t]-e),c=n[t]+e-(r[t]+i),a=Math.max(0,Math.ceil(s/(2*i))),u=Math.max(0,Math.ceil(c/(2*i)))+1,l=2**Math.ceil(Math.log(a+u)*Math.LOG2E);o=Math.max(o,l),z[t].min=a,z[t].max=u}for(let t=0;t<3;t++){let e=z[t].min,n=z[t].max;const s=(o-(e+n))/2;e+=Math.ceil(s),n+=Math.floor(s);const c=r[t]-i-e*i*2;L[t]=c+(n+e)*i}const s=o*i;return L[3]=s*F,T.acquire().initFrom(null,L,s,0)}_growRootAsSubNode(t){const e=this._root.node;(0,c.c)((0,h.a)(D),(0,h.a)(this._root.bounds)),D[3]=this._root.halfSize,this._root.init(t),t.advanceTo(D,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,o=0;for(;o<e.length&&null==t;)n=o++,t=e[n];for(;o<e.length;)if(e[o++])return-1;return n}_isDegenerate(t){return!M(this.objectToBoundingSphere(t)[3])}_fitsInsideTree(t){const e=this._root.bounds,n=this._root.halfSize;return t[3]<=n&&t[0]>=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,o=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:o}}}_nodeToJSON(t){const e=t.children.map((t=>t?this._nodeToJSON(t):null)),n=t.residents?.map((t=>this.objectToBoundingSphere(t))),o=t.terminals?.map((t=>this.objectToBoundingSphere(t)));return{children:e,residents:n,terminals:o}}static fromJSON(t){const e=new f((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 T{constructor(){this.bounds=(0,h.c)(),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,o=this.depth){return this.node=null!=t?t:T.createEmptyNode(),e&&(0,h.e)(e,this.bounds),this.halfSize=n,this.depth=o,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*F}advance(t){let e=this.node.children[t];e||(e=T.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=b[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const o=this._childIndex(t);e&&e(this,o),this.advance(o)}}isLeaf(){return null!=this.node.residents}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]<t[0]?1:0)+(e[1]<t[1]?2:0)+(e[2]<t[2]?4:0)}static createEmptyNode(){return{children:[null,null,null,null,null,null,null,null],terminals:new s.A({shrink:!0}),residents:new s.A({shrink:!0})}}static acquire(){return T._pool.acquire()}static release(t){T._pool.release(t)}static clearPool(){T._pool.prune()}}function _(t,e){let n=T.acquire().init(t);const o=[n];for(;0!==o.length;){if(n=o.pop(),e(n)&&!n.isLeaf())for(let t=0;t<n.node.children.length;t++)n.node.children[t]&&o.push(T.acquire().init(n).advance(t));T.release(n)}}function m(t,e,n,o=f.DepthOrder.FRONT_TO_BACK){let r=T.acquire().init(t);const i=[r];for(function(t,e,n){if(!H.length)for(let t=0;t<8;++t)H.push({index:0,distance:0});for(let n=0;n<8;++n){const o=b[n];H.data[n].index=n,H.data[n].distance=S(t,e,o)}H.sort(((t,e)=>t.distance-e.distance));for(let t=0;t<8;++t)n[t]=H.data[t].index}(n,o,V);0!==i.length;){if(r=i.pop(),e(r)&&!r.isLeaf())for(let t=7;t>=0;--t){const e=V[t];r.node.children[e]&&i.push(T.acquire().init(r).advance(e))}T.release(r)}}function O(t,e,n){x.clear();const o=n.advanceTo(e,((t,e)=>{x.push(t.node),x.push(e)}))?n.node.terminals:n.node.residents;if(o.removeUnordered(t),0===o.length)for(let t=x.length-2;t>=0&&g(x.data[t],x.data[t+1]);t-=2);}function g(t,e){return e>=0&&(t.children[e]=null),!!A(t)&&(null===t.residents&&(t.residents=new s.A({shrink:!0})),!0)}function A(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 p(t,e){t[0]=Math.min(t[0],e[0]-e[3]),t[1]=Math.min(t[1],e[1]-e[3]),t[2]=Math.min(t[2],e[2]-e[3])}function E(t,e){t[0]=Math.max(t[0],e[0]+e[3]),t[1]=Math.max(t[1],e[1]+e[3]),t[2]=Math.max(t[2],e[2]+e[3])}function N(t,e,n){n[0]=t[0]+e,n[1]=t[1]+e,n[2]=t[2]+e}function R(t,e,n,o){if(1===e){const e=n(t[0]);(0,h.e)(e,o)}else{B[0]=1/0,B[1]=1/0,B[2]=1/0,w[0]=-1/0,w[1]=-1/0,w[2]=-1/0;for(let o=0;o<e;o++){const e=n(t[o]);M(e[3])&&(p(B,e),E(w,e))}(0,c.m)((0,h.a)(o),B,w,.5),o[3]=Math.max(w[0]-B[0],w[1]-B[1],w[2]-B[2])/2}}function I(t,e){let n,o=1/0;for(let r=0;r<8;++r){const i=S(t,e,v[r]);i<o&&(o=i,n=v[r])}return n}function S(t,e,n){return e*(t[0]*n[0]+t[1]*n[1]+t[2]*n[2])}function M(t){return!isNaN(t)&&t!==-1/0&&t!==1/0&&t>0}T._pool=new i.A(T),(r=(o=f).DepthOrder||(o.DepthOrder={}))[r.FRONT_TO_BACK=1]="FRONT_TO_BACK",r[r.BACK_TO_FRONT=-1]="BACK_TO_FRONT";const b=[(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)],v=[(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)],F=Math.sqrt(3),P=[null],L=(0,h.c)(),C=(0,a.vt)(),B=(0,a.vt)(),w=(0,a.vt)(),x=new s.A,y=(0,h.c)(),D=(0,h.c)(),j=(0,h.c)(),U=(0,h.c)(),z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],H=new s.A,V=[0,0,0,0,0,0,0,0]},46540:(t,e,n)=>{var o;n.d(e,{r:()=>o}),function(t){t.POSITION="position",t.NORMAL="normal",t.NORMALCOMPRESSED="normalCompressed",t.UV0="uv0",t.COLOR="color",t.SYMBOLCOLOR="symbolColor",t.SIZE="size",t.ROTATION="rotation",t.TANGENT="tangent",t.OFFSET="offset",t.PERSPECTIVEDIVIDE="perspectiveDivide",t.CENTEROFFSETANDDISTANCE="centerOffsetAndDistance",t.LENGTH="length",t.PREVPOSITION="prevPosition",t.NEXTPOSITION="nextPosition",t.SUBDIVISIONFACTOR="subdivisionFactor",t.COLORFEATUREATTRIBUTE="colorFeatureAttribute",t.SIZEFEATUREATTRIBUTE="sizeFeatureAttribute",t.OPACITYFEATUREATTRIBUTE="opacityFeatureAttribute",t.DISTANCETOSTART="distanceToStart",t.UVMAPSPACE="uvMapSpace",t.BOUNDINGRECT="boundingRect",t.UVREGION="uvRegion",t.PROFILERIGHT="profileRight",t.PROFILEUP="profileUp",t.PROFILEVERTEXANDNORMAL="profileVertexAndNormal",t.FEATUREVALUE="featureValue",t.INSTANCEMODELORIGINHI="instanceModelOriginHi",t.INSTANCEMODELORIGINLO="instanceModelOriginLo",t.INSTANCEMODEL="instanceModel",t.INSTANCEMODELNORMAL="instanceModelNormal",t.INSTANCECOLOR="instanceColor",t.INSTANCEFEATUREATTRIBUTE="instanceFeatureAttribute",t.LOCALTRANSFORM="localTransform",t.GLOBALTRANSFORM="globalTransform",t.BOUNDINGSPHERE="boundingSphere",t.MODELORIGIN="modelOrigin",t.MODELSCALEFACTORS="modelScaleFactors",t.FEATUREATTRIBUTE="featureAttribute",t.STATE="state",t.LODLEVEL="lodLevel",t.POSITION0="position0",t.POSITION1="position1",t.NORMAL2COMPRESSED="normal2Compressed",t.COMPONENTINDEX="componentIndex",t.VARIANTOFFSET="variantOffset",t.VARIANTSTROKE="variantStroke",t.VARIANTEXTENSION="variantExtension",t.SIDENESS="sideness",t.START="start",t.END="end",t.UP="up",t.START_UP="startUp",t.END_UP="endUp",t.EXTRUDE="extrude",t.OBJECTANDLAYERIDCOLOR="objectAndLayerIdColor",t.INSTANCEOBJECTANDLAYERIDCOLOR="instanceObjectAndLayerIdColor"}(o||(o={}))},3055:(t,e,n)=>{n.d(e,{I$:()=>s,In:()=>u,gr:()=>a});var o=n(4431),r=n(1843),i=n(46540);const s=(0,r.BP)().vec3f(i.r.POSITION).u16(i.r.COMPONENTINDEX).freeze(),c=(0,r.BP)().vec2u8(i.r.SIDENESS).freeze(),a=((0,o.U)(c),(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze()),u=(0,r.BP)().vec3f(i.r.POSITION0).vec3f(i.r.POSITION1).vec2i16(i.r.NORMALCOMPRESSED).vec2i16(i.r.NORMAL2COMPRESSED).u16(i.r.COMPONENTINDEX).u8(i.r.VARIANTOFFSET,{glNormalized:!0}).u8(i.r.VARIANTSTROKE).u8(i.r.VARIANTEXTENSION,{glNormalized:!0}).freeze();new Map([[i.r.POSITION0,0],[i.r.POSITION1,1],[i.r.COMPONENTINDEX,2],[i.r.VARIANTOFFSET,3],[i.r.VARIANTSTROKE,4],[i.r.VARIANTEXTENSION,5],[i.r.NORMALCOMPRESSED,6],[i.r.NORMAL2COMPRESSED,7],[i.r.SIDENESS,8]])},93406:(t,e,n)=>{n.d(e,{K:()=>a});var o=n(34727),r=n(3694),i=n(38954),s=n(51850);const c=-1;function a(t,e,n){const o=t.vertices.position,r=t.vertices.componentIndex,s=_.position0,a=_.position1,h=_.faceNormal0,f=_.faceNormal1,{edges:T,normals:m}=l(t),O=T.length/4,g=e.allocate(O);let A=0;const p=O,R=n?.allocate(p);let S=0,M=0,b=0;d.length=0;for(let t=0;t<O;++t){const e=4*t;o.getVec(T.data[e],s),o.getVec(T.data[e+1],a);const n=d.pushNew();n.index=4*t,n.length=(0,i.j)(s,a)}d.sort(((t,e)=>e.length-t.length));const v=new Array,F=new Array;d.forAll((({length:t,index:l})=>{const d=T.data[l],O=T.data[l+1],p=T.data[l+2],P=T.data[l+3],L=P===c;if(o.getVec(d,s),o.getVec(O,a),L){const t=3*p;(0,i.i)(h,m.data[t],m.data[t+1],m.data[t+2]),(0,i.c)(f,h),_.componentIndex=r.get(d),_.cosAngle=(0,i.f)(h,f)}else{let t=3*p;if((0,i.i)(h,m.data[t],m.data[t+1],m.data[t+2]),t=3*P,(0,i.i)(f,m.data[t],m.data[t+1],m.data[t+2]),_.componentIndex=r.get(d),_.cosAngle=(0,i.f)(h,f),function(t,e){return t.cosAngle>e}(_,N))return;_.cosAngle<-.9999&&(0,i.c)(f,h)}M+=t,b++,L||function(t,e){return t.cosAngle<e}(_,I)?(e.write(g,A++,_),v.push(t)):u(_,E)&&(R&&n&&n.write(R,S++,_),F.push(t))}));const P=new Float32Array(v.reverse()),L=new Float32Array(F.reverse()),C=R&&n?{instancesData:R.slice(0,S),lodInfo:{lengths:L}}:void 0;return{regular:{instancesData:g.slice(0,A),lodInfo:{lengths:P}},silhouette:C,averageEdgeLength:M/b}}function u(t,e){const n=(0,o.XM)(t.cosAngle);return(0,i.o)(O,t.position1,t.position0),n*((0,i.f)((0,i.e)(m,t.faceNormal0,t.faceNormal1),O)>0?-1:1)>e}function l(t){const e=t.faces.length/3,n=t.faces,o=t.neighbors,r=t.vertices.position;f.length=T.length=0;for(let t=0;t<e;t++){const e=3*t,s=o[e],a=o[e+1],u=o[e+2],l=n[e],h=n[e+1],d=n[e+2];r.getVec(l,g),r.getVec(h,A),r.getVec(d,p),(0,i.d)(A,A,g),(0,i.d)(p,p,g),(0,i.e)(g,A,p),(0,i.n)(g,g),T.pushArray(g),(s===c||l<h)&&(f.push(l),f.push(h),f.push(t),f.push(s)),(a===c||h<d)&&(f.push(h),f.push(d),f.push(t),f.push(a)),(u===c||d<l)&&(f.push(d),f.push(l),f.push(t),f.push(u))}return{edges:f,normals:T}}class h{constructor(){this.index=0,this.length=0}}const d=new r.A({allocator:t=>t||new h,deallocator:null}),f=new r.A({deallocator:null}),T=new r.A({deallocator:null}),_=new class{constructor(){this.position0=(0,s.vt)(),this.position1=(0,s.vt)(),this.faceNormal0=(0,s.vt)(),this.faceNormal1=(0,s.vt)(),this.componentIndex=0,this.cosAngle=0}},m=(0,s.vt)(),O=(0,s.vt)(),g=(0,s.vt)(),A=(0,s.vt)(),p=(0,s.vt)(),E=(0,o.kU)(4),N=Math.cos(E),R=(0,o.kU)(35),I=Math.cos(R)},53099:(t,e,n)=>{n.d(e,{o6:()=>v,HY:()=>w,hx:()=>F,Jb:()=>B});var o=n(9318);function r(t,e,n){const o=e/3,r=new Uint32Array(n+1),i=new Uint32Array(n+1),s=(t,e)=>{t<e?r[t+1]++:i[e+1]++};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];s(n,o),s(o,r),s(r,n)}let c=0,a=0;for(let t=0;t<n;t++){const e=r[t+1],n=i[t+1];r[t+1]=c,i[t+1]=a,c+=e,a+=n}const u=new Uint32Array(6*o),l=r[n],h=(t,e,n)=>{if(t<e){const o=r[t+1]++;u[2*o]=e,u[2*o+1]=n}else{const o=i[e+1]++;u[2*l+2*o]=t,u[2*l+2*o+1]=n}};for(let e=0;e<o;e++){const n=t[3*e],o=t[3*e+1],r=t[3*e+2];h(n,o,e),h(o,r,e),h(r,n,e)}const d=(t,e)=>{const n=2*t,o=e-t;for(let t=1;t<o;t++){const e=u[n+2*t],o=u[n+2*t+1];let r=t-1;for(;r>=0&&u[n+2*r]>e;r--)u[n+2*r+2]=u[n+2*r],u[n+2*r+3]=u[n+2*r+1];u[n+2*r+2]=e,u[n+2*r+3]=o}};for(let t=0;t<n;t++)d(r[t],r[t+1]),d(l+i[t],l+i[t+1]);const f=new Int32Array(3*o),T=(e,n)=>e===t[3*n]?0:e===t[3*n+1]?1:e===t[3*n+2]?2:-1,_=(t,e)=>{const n=T(t,e);f[3*e+n]=-1},m=(t,e,n,o)=>{const r=T(t,e);f[3*e+r]=o;const i=T(n,o);f[3*o+i]=e};for(let t=0;t<n;t++){let e=r[t];const n=r[t+1];let o=i[t];const s=i[t+1];for(;e<n&&o<s;){const n=u[2*e],r=u[2*l+2*o];n===r?(m(t,u[2*e+1],r,u[2*l+2*o+1]),e++,o++):n<r?(_(t,u[2*e+1]),e++):(_(r,u[2*l+2*o+1]),o++)}for(;e<n;)_(t,u[2*e+1]),e++;for(;o<s;)_(u[2*l+2*o],u[2*l+2*o+1]),o++}return f}var i=n(1843),s=n(46540),c=n(3055),a=n(87811),u=n(38954),l=n(51850),h=n(4431),d=n(34727);function f(t,e,n,o,r,i=2){const s=1/(Math.abs(n)+Math.abs(o)+Math.abs(r)),c=n*s,a=o*s,u=r<=0?(c>=0?1:-1)*(1-Math.abs(a)):c,l=r<=0?(a>=0?1:-1)*(1-Math.abs(c)):a,h=e*i;t[h]=T(u),t[h+1]=T(l)}function T(t){return(0,d.qE)(Math.round(32767*t),-32767,32767)}n(11868);class _{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?p:A}write(t,e,n){M.seed=this._edgeHashFunction(n);const o=M.getIntRange(0,255),r=M.getIntRange(0,this.settings.variants-1),i=M.getFloat(),s=255*(.5*function(t){return Math.abs(t)**1.2*Math.sign(t)}(-(1-Math.min(i/.7,1))+Math.max(0,i-.7)/(1-.7))+.5);t.position0.setVec(e,n.position0),t.position1.setVec(e,n.position1),t.componentIndex.set(e,n.componentIndex),t.variantOffset.set(e,o),t.variantStroke.set(e,r),t.variantExtension.set(e,s)}}const m=new Float32Array(6),O=new Uint32Array(m.buffer),g=new Uint32Array(1);function A(t){return m[0]=t.position0[0],m[1]=t.position0[1],m[2]=t.position0[2],m[3]=t.position1[0],m[4]=t.position1[1],m[5]=t.position1[2],g[0]=31*(31*(31*(31*(31*(166811+O[0])+O[1])+O[2])+O[3])+O[4])+O[5],g[0]}function p(t){const e=m;e[0]=N(t.position0[0]),e[1]=N(t.position0[1]),e[2]=N(t.position0[2]),e[3]=N(t.position1[0]),e[4]=N(t.position1[1]),e[5]=N(t.position1[2]),g[0]=5381;for(let t=0;t<O.length;t++)g[0]=31*g[0]+O[t];return g[0]}const E=1e4;function N(t){return Math.round(t*E)/E}class R{constructor(){this._commonWriter=new _}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.gr.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n),(0,u.g)(S,n.faceNormal0,n.faceNormal1),(0,u.n)(S,S);const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,S[0],S[1],S[2],r)}}R.Layout=c.gr,R.glLayout=(0,h.U)(c.gr,1);class I{constructor(){this._commonWriter=new _}updateSettings(t){this._commonWriter.updateSettings(t)}allocate(t){return c.In.createBuffer(t)}write(t,e,n){this._commonWriter.write(t,e,n);{const{typedBuffer:o,typedBufferStride:r}=t.normalCompressed;f(o,e,n.faceNormal0[0],n.faceNormal0[1],n.faceNormal0[2],r)}{const{typedBuffer:o,typedBufferStride:r}=t.normal2Compressed;f(o,e,n.faceNormal1[0],n.faceNormal1[1],n.faceNormal1[2],r)}}}I.Layout=c.In,I.glLayout=(0,h.U)(c.In,1);const S=(0,l.vt)(),M=new a.A;var b=n(93406);function v(t){const e=F(t.data,t.skipDeduplicate,t.indices,t.indicesLength);return L.updateSettings(t.writerSettings),C.updateSettings(t.writerSettings),(0,b.K)(e,L,C)}function F(t,e,n,i){if(e){const e=r(n,i,t.count);return new P(n,i,e,t)}const s=(0,o.b)(t.buffer,t.stride/4,{originalIndices:n,originalIndicesLength:i}),a=r(s.indices,i,s.uniqueCount);return{faces:s.indices,facesLength:s.indices.length,neighbors:a,vertices:c.I$.createView(s.buffer)}}class P{constructor(t,e,n,o){this.faces=t,this.facesLength=e,this.neighbors=n,this.vertices=o}}const L=new R,C=new I,B=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1),w=(0,i.BP)().vec3f(s.r.POSITION0).vec3f(s.r.POSITION1).u16(s.r.COMPONENTINDEX)},46064:(t,e,n)=>{n.r(e),n.d(e,{default:()=>T});var o=n(90237),r=n(74887),i=(n(53966),n(44208),n(87811),n(49186),n(40608)),s=n(38954),c=n(51850),a=n(11964),u=n(97937),l=n(78230),h=n(53099);function d(t,e,n){const o=(0,u.c)(),r=(0,u.a)(o);return(0,s.b)(r,r,t,.5),(0,s.b)(r,r,e,.5),o[3]=(0,s.j)(r,t),(0,s.g)(r,r,n),o}let f=class{constructor(){this._idToComponent=new Map,this._components=new l.A((t=>t.bounds)),this._edges=new l.A((t=>t.bounds)),this._tmpLineSegment=(0,a.vt)(),this._tmpP1=(0,c.vt)(),this._tmpP2=(0,c.vt)(),this._tmpP3=(0,c.vt)(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),(0,r.Te)(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor((e=>(this._addCandidates(t,e,n),n.length<1e3)),t.bounds),{result:{candidates:n}}}async _ensureEdgeLocations(t,e){const n=[];if(this._components.forEachNeighbor((t=>{if(null==t.info){const{id:e,uid:o}=t;n.push({id:e,uid:o})}return!0}),t.bounds),!n.length)return;const o={components:n},r=await this.remoteClient.invoke("fetchAllEdgeLocations",o,e??{});for(const t of r.components)this._setFetchEdgeLocations(t)}async add(t){const e=new m(t.id,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),o=new Array(n.count),r=(0,c.vt)(),i=(0,c.vt)();for(let s=0;s<n.count;s++){n.position0.getVec(s,r),n.position1.getVec(s,i);const c=d(r,i,t.origin),a=new O(e,s,c);o[s]=a}this._edges.add(o);const{objectIds:s,origin:a}=t;e.info={locations:n,objectIds:s,origin:a}}_addCandidates(t,e,n){const{info:o}=e.component,{origin:r,objectIds:i}=o,c=o.locations,a=c.position0.getVec(e.index,this._tmpP1),u=c.position1.getVec(e.index,this._tmpP2);(0,s.g)(a,a,r),(0,s.g)(u,u,r);const l=i[c.componentIndex.get(e.index)];this._addEdgeCandidate(t,l,a,u,n),_(t,l,a,n),_(t,l,u,n)}_addEdgeCandidate(t,e,n,o,r){if(!t.returnEdge)return;const i=(0,u.a)(t.bounds),l=(0,a.Cr)(n,o,this._tmpLineSegment),h=(0,a._I)(l,i,this._tmpP3);(0,u.o)(t.bounds,h)&&r.push({type:"edge",objectId:e,target:(0,c.o8)(h),distance:(0,s.j)(i,h),start:(0,c.o8)(n),end:(0,c.o8)(o)})}};f=(0,o._)([(0,i.$)("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],f);const T=f;function _(t,e,n,o){if(!t.returnVertex||!(0,u.o)(t.bounds,n))return;const r=(0,u.a)(t.bounds);o.push({type:"vertex",objectId:e,target:(0,c.o8)(n),distance:(0,s.j)(r,n)})}class m{constructor(t,e){this.id=t,this.bounds=e,this.info=null,this.uid=++m.uid}}m.uid=0;class O{constructor(t,e,n){this.component=t,this.index=e,this.bounds=n}}},74038:(t,e,n)=>{n.d(e,{_:()=>o});class o{constructor(t,e,n,o,r,i=!1,s=0){this.name=t,this.count=e,this.type=n,this.offset=o,this.stride=r,this.normalized=i,this.divisor=s}}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1598],{76061:(e,t,s)=>{s.d(t,{G:()=>o,S:()=>r});class o{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class r extends o{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},7978:(e,t,s)=>{s.r(t),s.d(t,{execute:()=>n});var o=s(
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1598],{76061:(e,t,s)=>{s.d(t,{G:()=>o,S:()=>r});class o{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class r extends o{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},7978:(e,t,s)=>{s.r(t),s.d(t,{execute:()=>n});var o=s(9192),r=s(83299);const m=new o.a;function n(e,t){const s=(0,r.fromGeometry)(e);return m.execute(s.getGeometry(),(0,r.fromGeometryToGXGeometry)(t),s.getSpatialReference())}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7339],{11006:(e,t,i)=>{function s(e,t,i,s,n){r(e,t,i||0,s||e.length-1,n||a)}function r(e,t,i,s,a){for(;s>i;){if(s-i>600){var o=s-i+1,l=t-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);r(e,t,Math.max(i,Math.floor(t-l*c/o+h)),Math.min(s,Math.floor(t+(o-l)*c/o+h)),a)}var d=e[t],p=i,m=s;for(n(e,i,t),a(e[s],d)>0&&n(e,i,s);p<m;){for(n(e,p,m),p++,m--;a(e[p],d)<0;)p++;for(;a(e[m],d)>0;)m--}0===a(e[i],d)?n(e,i,m):n(e,++m,s),m<=t&&(i=m+1),t<=m&&(s=m-1)}}function n(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function a(e,t){return e<t?-1:e>t?1:0}i.d(t,{q:()=>s})},44794:(e,t,i)=>{i.d(t,{v:()=>o});var s=i(4718),r=i(62788),n=i(95488);class a{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=s.gh){return new a(e,t)}},7320:(e,t,i)=>{i.d(t,{g:()=>s});const s={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const s=new r(e.getPointX(t),e.getPointY(t),i),n=e.hasZ(t),a=e.hasM(t);return n&&(s.z=e.getPointZ(t)),a&&(s.m=e.getPointM(t)),s},exportPolygon:function(e,t,i){return new n(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new a(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new o(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const s=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(s){const i=e.getZExtent(t);n.zmin=i.vmin,n.zmax=i.vmax}if(r){const i=e.getMExtent(t);n.mmin=i.vmin,n.mmax=i.vmax}return n}};class r{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class n{constructor(e,t,i,s){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class a{constructor(e,t,i,s){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class o{constructor(e,t,i,s){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class l{constructor(e,t,i,s,r){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=s,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},19730:(e,t,i)=>{i.d(t,{do:()=>N,ux:()=>C});var s=i(4576),r=i(49186),n=(i(44208),i(25482)),a=i(4718),o=i(97768),l=i(74887),u=i(83047),c=i(57251),h=i(70328),d=i(19419),p=i(537),m=i(65864),f=i(21325),y=i(90708),g=i(95538),_=i(51441),x=i(31464);class T{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,s]of this._storage){if(!(s.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new E(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let I=0;class E{constructor(e){this.items=e,this.time=performance.now(),this.id=I++}}var S=i(99352),R=i(8384),F=i(58727),v=i(62798),w=i(62660),A=i(86420),b=i(95466),M=i(63076);class N{constructor(e){this._changeHandle=null,this.capabilities={query:S.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new T,this.timeInfo=e.timeInfo,this._changeHandle=this.featureStore.events.on("changed",(()=>this._clearCache())),this.fieldsIndex=n.A.isSerializable(e.fieldsIndex)?e.fieldsIndex:b.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const i=(0,l.Mq)(t);try{const t=await this._executeQuery(e,{},i);return await t.createQueryResponse()}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(e){if(e!==F.v8)throw e;return 0}}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t),s=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),r=t.size;return r?{count:r,extent:await this._getBounds(t.items,t.spatialReference,s||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===F.v8)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=t.items,r=new Set;return await this.reschedule((()=>{for(const e of s)r.add(t.featureAdapter.getObjectId(e))}),i),r}catch(e){if(e===F.v8)return new Set;throw e}}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},i);return await this.reschedule((()=>this._filterLatest(t)),i),await t.createQueryResponse()}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this).createQueryResponse()}}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);let s;e=(0,a.o8)(e);try{e=await this.schedule((()=>(0,F.iJ)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.FQ)(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i);const t=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i);s=await this.reschedule((()=>this._executeGeometryQuery(e,t,i)),i),await this.reschedule((()=>this._executeAggregateIdsQuery(s)),i),await this.reschedule((()=>this.executeObjectIdsQuery(s)),i),await this.reschedule((()=>this.executeTimeQuery(s)),i),await this.reschedule((()=>this.executeAttributesQuery(s)),i)}catch(t){if(t!==F.v8)throw t;s=new R.G([],e,this)}return s.createQueryBinsResponse(e)}async executeQueryForSummaryStatistics(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const s=(0,l.Mq)(i),{field:r,field2:n,field3:a,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:n,field3:a,valueExpression:o},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,A.W)(this.timeInfo,this.featureStore);const[i,s]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:s}}async _getBounds(e,t,i){const s=(0,h.hZ)((0,h.vt)(),h.qv);await this.featureStore.forEachBounds(e,(e=>(0,h.RF)(s,e)));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:(0,_.ag)(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5],r.hasZ=!0);const n=(0,x.Cv)(r,t,i);if(n.spatialReference=(0,_.ag)(i),n.xmax-n.xmin==0){const e=(0,u.GA)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,u.GA)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,u.GA)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(M.Bb)}async reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(M.Bb)}async _getAllFeaturesQueryEngineResult(e){return new R.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach((t=>e.push(t))))().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?(0,a.zI)(t.slice()):this._getAllFeatures()}async _executeQuery(e,t,i){e=(0,a.o8)(e),e=await this.schedule((()=>(0,F.GC)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.B4)(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i),e={...e,...t};const s=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this.reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this.reschedule((()=>this.executeObjectIdsQuery(r)),i),await this.reschedule((()=>this.executeTimeQuery(r)),i),await this.reschedule((()=>this.executeAttributesQuery(r)),i),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,f.aI)(n,a.spatialReference)?a:(0,x.Cv)(a,n);if(!o)return null;const l=s||r,u=(0,f.fn)(i)&&!(0,f.aI)(this.spatialReference,i)&&l?async e=>this._project(e,i):e=>e,c=this.featureAdapter,h=await this.reschedule((()=>this.searchFeatures(C(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const i=new Set;for(const e of h)i.add(c.getObjectId(e));const s=await this.reschedule((()=>this._getAllFeatures()),t),r=await this.reschedule((async()=>{const r=await(0,w.xt)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this.runSpatialFilter(s,(e=>!i.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new R.G(n,e,this)}),t);return u(r)}if(!h.length)return new R.G([],e,this);if(this._canExecuteSinglePass(o,e))return u(new R.G(h,e,this));const d=await(0,w.xt)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),p=await this.runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new R.G(p,e,this))}async _executeGeometryQuery(e,t,i){if(null!=t&&0===t.items.length)return t;const{geometry:r,outSR:n,returnGeometry:a,returnCentroid:o}=e,l=t?null:this._getCacheKey(e),u=l?this._cache.get(l):null;if(u)return new R.G(u,e,this);const c=(0,f.fn)(n)&&!(0,f.aI)(this.spatialReference,n),h=a||o,d=async e=>(c&&h&&await this._project(e,n),l&&this._cache.put(l,e.items),e),p=this.featureStore.featureSpatialReference,m=!r||null==p||(0,f.aI)(p,r.spatialReference)?r:(0,x.Cv)(r,p);if(!m)return d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const y=this.featureAdapter;let g=await this.reschedule((()=>this.searchFeatures(C(r))),i);const _=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===_){if(!g.length)return d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const s=new Set;for(const e of g)s.add(y.getObjectId(e));const r=null!=t?t.items:await this.reschedule((()=>this._getAllFeatures()),i),n=await this.reschedule((async()=>{const t=await(0,w.xt)(_,m,this.geometryType,this.hasZ,this.hasM),n=await this.runSpatialFilter(r,(e=>!s.has(y.getObjectId(e))||t(y.getGeometry(e))),i);return new R.G(n,e,this)}),i);return d(n)}if(null!=t){const e=new s.vW;g=g.filter((i=>(0,s.qh)(t.items,i,t.items.length,e)>=0))}if(!g.length){const t=new R.G([],e,this);return l&&this._cache.put(l,t.items),t}if(this._canExecuteSinglePass(m,e))return d(new R.G(g,e,this));const T=await(0,w.xt)(_,m,this.geometryType,this.hasZ,this.hasM),I=await this.runSpatialFilter(g,(e=>T(y.getGeometry(e))),i);return d(new R.G(I,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach((e=>t.add(e)));const i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}executeTimeQuery(e){if(0===e.items.length)return;const t=(0,A.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,g.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async runSpatialFilter(e,t,i){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let s=0;const r=new Array,n=async a=>{for(;s<e.length;){const o=e[s++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this.reschedule((e=>n(e)),i)}};return this.reschedule((e=>n(e)),i).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,n=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),s=a(i,r),o=n.get(e);(!o||s>a(o,r))&&n.set(e,i)}e.items=Array.from(n.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:s,returnCentroid:r,outSR:n,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=s||r;return(0,f.fn)(n)&&!(0,f.aI)(this.spatialReference,n)&&l?JSON.stringify([t,i,n]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,w.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,f.aI)(this.spatialReference,t))return e;const i=this.featureAdapter;let s;try{const e=await this._getFullExtent();s=(0,c.getTransformation)(this.spatialReference,t,e)}catch{}const r=await(0,x.lK)(e.items.map((e=>(0,_.pL)(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t,s);return e.items=(0,a.zI)(r.map(((t,s)=>i.cloneWithGeometry(e.items[s],(0,y.Ux)(t,this.hasZ,this.hasM))))),e}async searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const i=Array.from(t.values());return t.clear(),i}async _executeQueryForStatistics(e,t,i){e=(0,a.o8)(e);try{e=await this.schedule((()=>(0,F.GC)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.mO)(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i);const s=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this.reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this.reschedule((()=>this.executeObjectIdsQuery(r)),i),await this.reschedule((()=>this.executeTimeQuery(r)),i),await this.reschedule((()=>this.executeAttributesQuery(r)),i),r}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this)}}get test(){}}function C(e){if((0,w.tC)(e)){if((0,m.ZC)(e))return[(0,d.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,m.Bi)(e))return e.rings.map((e=>(0,d.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,p.Rg)((0,d.vt)(),e)]}},99352:(e,t,i)=>{i.d(t,{F:()=>s});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1}},8384:(e,t,i)=>{i.d(t,{G:()=>R});var s=i(4718),r=i(88930),n=i(12359),a=i(90634),o=i(62577),l=i(21325),u=i(95538),c=i(51441),h=i(30524),d=i(50201),p=i(1873),m=i(71386);class f{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const s=e.outFields;if(s&&!s.includes("*")){this.outFields=s;let e=0;for(const t of s){const s=(0,u.Wq)(t),r=this.fieldsIndex.get(s),n=r?null:(0,u.j4)(s,i),a=r?r.name:(0,u.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){const s=i?i.name:t;let r=null;return this._fieldDataCache.has(s)?r=this._fieldDataCache.get(s)?.clause:i||(r=(0,u.j4)(t,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:r})),i?this.featureAdapter.getAttribute(e,s):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const s=t.normalizationType,r=t.normalizationTotal,n=this.fieldsIndex.get(t.field),a=(0,h.zD)(n)||(0,h.Ah)(n),o=(0,h.OH)(n);return e.map((e=>{let n=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(n=`${(0,p.gJ)(n)}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(n=`${n}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof n&&i&&(a?n=n?new Date(n).getTime():null:o&&(n=n?(0,d.rb)(n):null)),s&&Number.isFinite(n)){const i="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;n=(0,p.zS)(n,s,i,r)}return n}))}async getExpressionValues(e,t,i,s,r){const{arcadeUtils:n}=await(0,m.lw)(),a=n.hasGeometryOperations(t);a&&await n.enableGeometryOperations();const o=n.createFunction(t),l=n.getViewInfo(i),u={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:u,geometry:a?{...(0,c.pL)(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(e)),spatialReference:i?.spatialReference}:null},h=n.createExecContext(t,l,r);return n.executeFunction(o,h)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,u.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,u.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const s of t){const{alias:t,clause:r}=this._fieldDataCache.get(s);i[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const s of t){const{alias:t}=this._fieldDataCache.get(s);i.push(e[t])}else for(const t in e)i.push(e[t]);const s=`${(t||["*"]).join(",")}=${i.join(",")}`;let r=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++r),r>1?null:e}}var y=i(31464),g=i(58727);function _(e,t,i){return{objectId:e,target:t,distance:i,type:"vertex"}}function x(e,t,i,s,r,n=!1){return{objectId:e,target:t,distance:i,type:"edge",start:s,end:r,draped:n}}var T=i(5834),I=i(59977),E=i(11440),S=i(60909);class R{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new f(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of s){const{statisticType:s}=r,l="exceedslimit"!==s?r.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,n);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:s,items:r}=u[t],n=s.join(",");i&&!e.validateItems(r,i)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,l.fn)(this.query.outSR)&&!(0,l.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,c.ag)({spatialReference:this.query.outSR,...(0,y.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,c.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=v(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c="esriGeometryPolyline"===this.geometryType,h=this._getPointCreator(n,this.spatialReference,t),d=new w(null,0),p=new w(null,0),m={x:0,y:0,z:0};for(const t of this.items){const n=i.getGeometry(t);if(null==n)continue;const{coords:f}=n,y=n.isPoint?A:n.lengths;if(d.coords=f,p.coords=f,e.returnEdge){let e=0;for(let n=0;n<y.length;n++){const c=y[n],f=e;for(let n=0;n<c;n++,e+=s){if(!u&&n===c-1)continue;const y=d;y.coordsIndex=e;const g=p;g.coordsIndex=n===c-1?f:e+s;const _=m;if(!F(m,r,y,g))continue;const T=(r.x-_.x)/a,I=(r.y-_.y)/o,E=T*T+I*I;E<=1&&l.candidates.push(x(i.getObjectId(t),h(_),Math.sqrt(E),h(y),h(g)))}}}if("all"===e.vertexMode){let e=0;for(let n=0;n<y.length;n++){const c=y[n],m=e,f=p;f.coordsIndex=m;for(let n=0;n<c;n++,e+=s){const s=d;if(s.coordsIndex=e,u&&n===c-1&&s.x===f.x&&s.y===f.y)continue;const p=(r.x-s.x)/a,m=(r.y-s.y)/o,y=p*p+m*m;y<=1&&l.candidates.push(_(i.getObjectId(t),h(s),Math.sqrt(y)))}}}else if(c&&"ends"===e.vertexMode){let e=0;const n=[];for(let t=0;t<y.length;t++){n.push(e);const i=y[t];e+=i*s,!u&&i>1&&n.push(e-s)}for(const e of n){const s=d;s.coordsIndex=e;const n=(r.x-s.x)/a,u=(r.y-s.y)/o,c=n*n+u*u;c<=1&&l.candidates.push(_(i.getObjectId(t),h(s),Math.sqrt(c)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,i){const s=null==i||(0,l.aI)(t,i)?e=>e:e=>(0,y.Cv)(e,t,i),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:0}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,d=this.fieldsIndex.get(t),m=(0,h.vE)(d)||(0,h.zD)(d)||(0,h.Ah)(d),f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:l,timeZone:u},this.items),y=(0,p.Vb)({normalizationType:r,normalizationField:s,minValue:a,maxValue:o}),g={value:.5,fieldType:d?.type},_=(0,h.yM)(d)?(0,p.z9)({values:f,supportsNullCount:y,percentileParams:g,outStatisticTypes:c}):(0,p.G_)({values:f,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:y,percentileParams:g,outStatisticTypes:c});return(0,p.oZ)(_,c,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:r,scale:n,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:n,timeZone:a},this.items,!1),l=(0,p.b3)(o);return(0,p.lv)(l,s,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d},this.items),f=(0,p.Rw)(m,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,p.jM)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d},this.items);return(0,p.$y)(m,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,p.FM)(n?.type,a);e.sort(((e,t)=>{const s=i(e,r,n),a=i(t,r,n);return o(s,a)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:l,outSR:u,quantizationParameters:h,resultRecordCount:d,resultOffset:p,returnZ:m,returnM:f}=e,y=null!=d&&t.length>(p||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:r&&m,objectIdFieldName:n,spatialReference:(0,c.ag)(u||a),transform:h&&(0,o.VV)(h)||null}}_createFeatures(e,t){const i=new f(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:l,returnCentroid:u,maxAllowableOffset:h,resultOffset:d,resultRecordCount:p,returnZ:m=!1,returnM:y=!1}=e,g=r&&m,_=s&&y;let x=[],T=0;const I=[...t];if(this._sortFeatures(I,n,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||u)){const e=(0,o.VV)(a)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const s of I){const r=this.featureAdapter.getGeometry(s),n={attributes:i.getAttributes(s),geometry:(0,c.pL)(this.geometryType,this.hasZ,this.hasM,r,h,e,g,_)};t&&r&&!n.geometry&&(n.centroid=(0,c.LQ)(this,this.featureAdapter.getCentroid(s,this),e)),x[T++]=n}else if(!l&&u)for(const t of I)x[T++]={attributes:i.getAttributes(t),centroid:(0,c.LQ)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of I)x[T++]={attributes:i.getAttributes(t),centroid:(0,c.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,c.pL)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,g,_)}}else for(const e of I){const t=i.getAttributes(e);t&&(x[T++]={attributes:t})}const E=d||0;if(null!=p){const e=E+p;x=x.slice(E,Math.min(x.length,e))}return x}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=v(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],r=new Map,n=new Map,a=new Map,o=new Map,l=new f(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:p,resultRecordCount:m}=e,y=c?.length,g=!!y,_=g?c[0]:null,x=g&&!this.fieldsIndex.get(_);for(const e of u??[]){const{outStatisticFieldName:u,statisticType:p}=e,m=e,f="exceedslimit"!==p?e.onStatisticField:void 0,T="percentile_disc"===p||"percentile_cont"===p,I="EnvelopeAggregate"===p||"CentroidAggregate"===p||"ConvexHullAggregate"===p,E=g&&1===y&&(f===_||x)&&"count"===p;if(g){if(!a.has(f)){const e=[];for(const i of c){const s=this._getAttributeValues(l,i,t,r);e.push(s)}a.set(f,this._calculateUniqueValues(e,t,!I&&l.returnDistinctValues))}const e=a.get(f);if(!e)continue;const i=Object.keys(e);for(const s of i){const{count:i,data:n,items:a,itemPositions:h}=e[s],p=n.join(",");if(!d||l.validateItems(a,d)){const e=o.get(p)||{attributes:{}};if(I){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:i}=await this._getAggregateGeometry(m,a);e.aggregateGeometries[i]=t}else{let s=null;if(E)s=i;else{const e=this._getAttributeValues(l,f,t,r),i=h.map((t=>e[t]));s=T&&"statisticParameters"in m?this._getPercentileValue(m,i):this._getStatisticValue(m,i,null,l.returnDistinctValues)}e.attributes[u]=s}let s=0;c.forEach(((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++s]=n[i])),o.set(p,e)}}}else if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,t);i.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(l,f,t,r);i.attributes[u]=T&&"statisticParameters"in m?this._getPercentileValue(m,e):this._getStatisticValue(m,e,n,l.returnDistinctValues)}const S="min"!==p&&"max"!==p||!(0,h.yM)(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:u,alias:u,type:S||"esriFieldTypeDouble"})}const T=g?Array.from(o.values()):[i];return this._sortFeatures(T,p,((e,t)=>e.attributes[t])),m&&(T.length=Math.min(m,T.length)),{fields:s,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,h.vE)(t)||(0,h.zD)(t)||(0,h.Ah)(t)||(0,h.OH)(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:r}=await Promise.all([i.e(9930),i.e(3656)]).then(i.bind(i,47559)),{statisticType:o,outStatisticFieldName:l}=e,{featureAdapter:u,spatialReference:h,geometryType:d,hasZ:p,hasM:m}=this,f=t.map((e=>(0,c.pL)(d,p,m,u.getGeometry(e)))),y=s(h,f,!0)[0],g={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===o){const e=y?(0,a.v)(y):(0,a.HA)(r(h,f));g.aggregateGeometries={...e,spatialReference:h},g.outStatisticFieldName=l||"extent"}else if("CentroidAggregate"===o){const e=y?(0,n.l8)(y):(0,n.Z4)((0,a.HA)(r(h,f)));g.aggregateGeometries={x:e[0],y:e[1],spatialReference:h},g.outStatisticFieldName=l||"centroid"}else"ConvexHullAggregate"===o&&(g.aggregateGeometries=y,g.outStatisticFieldName=l||"convexHull");return g}_getStatisticValue(e,t,i,s){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=i?.has(r)?i.get(r):(0,h.yM)(this.fieldsIndex.get(r))||this._isAnyDateField(r)?(0,p.z9)({values:t,returnDistinct:s}):(0,p.G_)({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:r}=e,{value:n,orderBy:a}=s,o=this.fieldsIndex.get(i);return(0,p.qg)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const r=this.fieldsIndex.get(t),n=i.map((i=>e.getFieldValue(i,t,r)));return s.set(t,n),n}_calculateUniqueValues(e,t,i){const s={},r=t.length;for(let n=0;n<r;n++){const r=t[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(i||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e,t,i=!0){const r=new f(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:a,timeZone:o}=e;return n?r.getExpressionValues(t,n,{viewingMode:"map",scale:a,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):r.getDataValues(t,(0,s.o8)(e),i)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,r=t.min??0,n=t.max??0,a=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=r&&o<=n){const e=(0,p.Ak)(s,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin;switch(t.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(T.A.fromJSON(t),e);case"dateBin":return this._createDateBinsResponse(I.A.fromJSON(t),e);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(E.A.fromJSON(t),e);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.A.fromJSON(t),e)}}async _createAutoIntervalBinsResponse(e,t){const{field:i,normalizationField:s,numBins:r,normalizationType:n,normalizationTotal:a,start:o,end:l}=e,u=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),c=(0,p.sU)(u,{field:i,normalizationField:s,normalizationType:n,normalizationTotal:a,numBins:r,minValue:(0,g.dO)(o,!1),maxValue:(0,g.dO)(l,!1)}),h=await this._calculateHistogramBins(u,c,this.items);return this._createFeaturesFromHistogramBins(h,t)}async _createDateBinsResponse(e,t){const{field:i,interval:s,start:n,end:a}=e,o=s.unit,l="quarters"===o?3*r.vf.months:r.vf[o],u=s.value*l/r.vf.milliseconds,c=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},this.items),d=(0,h.OH)(this.fieldsIndex.get(i)),m=(0,p.sU)(c,{field:i,classificationMethod:"defined-interval",definedInterval:u,minValue:(0,g.dO)(n,d),maxValue:(0,g.dO)(a,d)},!0),f=await this._calculateHistogramBins(c,m,this.items);return this._createFeaturesFromHistogramBins(f,t)}async _createFixedBoundariesBinsResponse(e,t){const{field:i}=e,s=await this._getDataValues({field:i,timeZone:t.outTimeReference?.ianaTimeZone},this.items),r=(0,h.OH)(this.fieldsIndex.get(i)),n=e.boundaries.map((e=>(0,g.dO)(e,r))).sort(((e,t)=>e-t)),a=[];for(let e=0;e<n.length-1;e++)a.push([n[e],n[e+1]]);const o={intervals:a,min:n.at(0),max:n.at(-1)},l=await this._calculateHistogramBins(s,o,this.items);return this._createFeaturesFromHistogramBins(l,t)}async _createFixedIntervalBinsResponse(e,t){const{field:i,interval:s,start:r,end:n}=e,a=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),o=(0,h.OH)(this.fieldsIndex.get(i)),l=(0,p.sU)(a,{field:i,classificationMethod:"defined-interval",definedInterval:s,minValue:(0,g.dO)(r,o),maxValue:(0,g.dO)(n,o)},!0),u=await this._calculateHistogramBins(a,l,this.items);return this._createFeaturesFromHistogramBins(u,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,r=s||"lowerBoundary",n=i||"upperBoundary",a=[],o=[];for(const i of e){const{minValue:e,maxValue:s,items:l}=i,u={attributes:{}};u.attributes[r]=e,u.attributes[n]=s;const c=await this._createStatisticsQueryResponse(t,l,u);a.push(u),c.fields&&o.push(...c.fields)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function F(e,t,i,s){const r=s.x-i.x,n=s.y-i.y,a=t.x-i.x,o=t.y-i.y,l=r*r+n*n;if(0===l)return!1;const u=a*r+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+r*c,e.y=i.y+n*c,!0}function v(e,t){return e?t?4:3:t?3:2}class w{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const A=[1]},95538:(e,t,i)=>{i.d(t,{VW:()=>h,SY:()=>_,Wq:()=>g,j4:()=>y,vl:()=>c,MG:()=>x,eD:()=>f,SN:()=>m});var s=i(49186),r=i(66344),n=i(88368),a=i(98453);const o=new class{constructor(e,t){this._cache=new r.q(e),this._invalidCache=new r.q(t)}get(e,t){const i=`${t.uid}:${e}`,s=this._cache.get(i);if(s)return s;if(null!=this._invalidCache.get(i))return null;try{const s=n.default.create(e,{fieldsIndex:t});return this._cache.put(i,s),s}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t.uid}:${e}`;return this._invalidCache.get(i)??null}}(50,500),l="unsupported-query",u=" as ",c=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),h=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...c,...h]);function p(e,t,i={}){const r=y(t,e);if(!r){const i=o.getError(t,e);throw new s.A(l,"invalid SQL expression",{expression:t,error:i})}const n=i.expressionName||"expression";if(i.validateStandardized&&!r.isStandardized)throw new s.A(l,`${n} is not standard`,{expression:t});if(i.validateAggregate&&!r.isAggregate)throw new s.A(l,`${n} does not contain a valid aggregate function`,{expression:t});return r.fieldNames}function m(e,t,i,s){if(!i)return!0;const r="where clause";return x(e,t,p(e,i,{validateStandardized:!0,expressionName:r}),{expressionName:r,query:s}),!0}function f(e,t,i,r,n){if(!i)return!0;const a="having clause",o=p(e,i,{validateAggregate:!0,expressionName:a});x(e,t,o,{expressionName:a,query:n});const u=y(i,e),c=u?.getExpressions().every((t=>{const{aggregateType:i,field:s}=t,n=e.get(s)?.name;return r.some((t=>{const{onStatisticField:s,statisticType:r}=t,a=e.get(s)?.name;return a===n&&r.toLowerCase().trim()===i}))}));if(!c)throw new s.A(l,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function y(e,t){return e?o.get(e,t):null}function g(e){return/\((.*?)\)/.test(e)?e:e.split(u)[0]}function _(e){return e.split(u)[1]}function x(e,t,i,r={}){const n=new Map;if(function(e,t,i,s,r){const n=r.includes("*")?[...i,...r.filter((e=>"*"!==e))]:r;for(const r of n)if(t.get(r))T(e,t,i,s,r);else try{const n=p(t,g(r),{validateStandardized:!0});for(const r of n)T(e,t,i,s,r)}catch(t){e.set(r,{type:"expression-error",expression:r,error:t})}}(n,e,t,r.allowedFieldTypes??d,i),n.size){const e=r.expressionName??"expression";throw new s.A(l,`${e} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query})}}function T(e,t,i,s,r){const n=t.get(r);n?i.has(n.name)?"all"!==s&&!1===s?.has(n.type)&&e.set(r,{type:"invalid-type",fieldName:n.name,fieldType:a.m.fromJSON(n.type),allowedFieldTypes:Array.from(s,(e=>a.m.fromJSON(e)))}):e.set(r,{type:"missing-field",fieldName:n.name}):e.set(r,{type:"invalid-field",fieldName:r})}},51441:(e,t,i)=>{i.d(t,{LQ:()=>u,ag:()=>h,pL:()=>c});var s=i(90708),r=i(92722);const n=new r.A,a=new r.A,o=new r.A,l={esriGeometryPoint:s.DF,esriGeometryPolyline:s.BW,esriGeometryPolygon:s.z5,esriGeometryMultipoint:s.qK};function u(e,t,i,r=e.hasZ,n=e.hasM){if(null==t)return null;const a=e.hasZ&&r,l=e.hasM&&n;if(i){const u=(0,s.Nl)(o,t,e.hasZ,e.hasM,"esriGeometryPoint",i,r,n);return(0,s.DF)(u,a,l)}return(0,s.DF)(t,a,l)}function c(e,t,i,r,u,c,h=t,d=i){const p=t&&h,m=i&&d,f=null!=r?"coords"in r?r:r.geometry:null;if(null==f)return null;if(u){let r=(0,s.kz)(a,f,t,i,e,u,h,d);return c&&(r=(0,s.Nl)(o,r,p,m,e,c)),l[e]?.(r,p,m)??null}if(c){const r=(0,s.Nl)(o,f,t,i,e,c,h,d);return l[e]?.(r,p,m)??null}return(0,s.Q4)(n,f,t,i,h,d),l[e]?.(n,p,m)??null}function h(e){return e&&d in e?JSON.parse(JSON.stringify(e,p)):e}const d="_geVersion",p=(e,t)=>e===d?void 0:t},31464:(e,t,i)=>{i.d(t,{Cv:()=>y,Nk:()=>p,lK:()=>_});var s=i(4576),r=i(74887),n=i(57251),a=i(7320),o=i(21325),l=i(28735);const u=[0,0];function c(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,u),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,u),[i.xmax,i.ymax]=e(t.xmax,t.ymax,u),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:h(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:h(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function h(e,t){const i=[];for(const s of e)i.push(d(s,t));return i}function d(e,t){const i=[];for(const s of e){const e=t(s[0],s[1],[0,0]);i.push(e),s.length>2&&e.push(s[2]),s.length>3&&e.push(s[3])}return i}async function p(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(s.Ru):[e];await(0,n.initializeProjection)(i.map((e=>({source:e,dest:t}))))}const m=c.bind(null,l.je),f=c.bind(null,l.tD);function y(e,t,i,s){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(i)||(0,o.aI)(t,i))return e;if((0,l.y7)(t,i)){const t=(0,o.K8)(i)?m(e):f(e);return t.spatialReference=i,t}return(0,n.projectMany)(a.g,[e],t,i,null,s)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,s){if(!e?.length||!t||!i||(0,o.aI)(t,i))return e;const n={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:s,resolve:(0,r.Tw)()};return this._jobs.push(n),this._timer??=setTimeout(this._process,10),n.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:s,resolve:r,geographicTransformation:u}=e;(0,l.y7)(i,s)?(0,o.K8)(s)?r(t.map(m)):r(t.map(f)):r((0,n.projectMany)(a.g,t,i,s,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,i,s){return g.push(e,t,i,s)}},58727:(e,t,i)=>{i.d(t,{GC:()=>m,T2:()=>f,VY:()=>h,dO:()=>g,iJ:()=>p,v8:()=>d});var s=i(66552),r=i(83047),n=i(57251),a=i(90634),o=i(65864),l=i(17136),u=i(21325),c=i(31464);const h=new s.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),d=Object.freeze({});async function p(e,t,i){const s=e.bin,{onField:r,expression:n,splitBy:a,splitByField:o,splitByAlias:l,stackBy:u,stackByField:c,stackByAlias:h}=s;return r&&(s.onField=r.trim()),n&&(s.expression=n.trim()),a&&(s.splitBy=a.trim()),o&&(s.splitByField=o.trim()),l&&(s.splitByAlias=l.trim()),u&&(s.stackBy=u.trim()),c&&(s.stackByField=c.trim()),h&&(s.stackByAlias=h.trim()),"normalizationField"in s.parameters&&s.parameters.normalizationField&&(s.parameters.normalizationField=s.parameters.normalizationField.trim()),m(e,t,i)}async function m(e,t,i){const{outFields:s,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),f(e,t,i)}async function f(e,t,s){if(!e)return null;let{where:n}=e;if(e.where=n=n?.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let p=await async function(e){const{distance:t,units:s}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=s?h.fromJSON(s):(0,r.Ij)(a),l=a&&((0,u.EA)(a)||(0,u.K8)(a))?n:await(0,c.Nk)(a,u.KK).then((()=>(0,c.Cv)(n,u.KK))),d=await i.e(6165).then(i.bind(i,86165));return await d.load(),d.execute(l,t,{unit:o})??void 0}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;p=(0,a.HA)(p),p.spatialReference=t}if(p){await(0,c.Nk)(p.spatialReference,s),p=function(e,t){const i=e.spatialReference;return y(e,t)&&(0,o.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(p,s);const t=(await(0,l.el)((0,o.rS)(p)))[0];if(null==t)throw d;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=i&&y(p,s)?{densificationStep:8*i}:void 0,n=t.toJSON(),a=(0,c.Cv)(n,n.spatialReference,s,r);if(!a)throw d;a.spatialReference=s,e.geometry=a}return e}function y(e,t){if(!e)return!1;const i=e.spatialReference;return((0,o.ZC)(e)||(0,o.Bi)(e)||(0,o.Rg)(e))&&!(0,u.aI)(i,t)&&!(0,n.canProjectWithoutEngine)(i,t)}function g(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},62798:(e,t,i)=>{i.d(t,{B4:()=>c,FQ:()=>u,mO:()=>p});var s=i(49186),r=i(95538),n=i(31464),a=i(62660),o=i(71386);const l="unsupported-query";async function u(e,t){const i=e.bin;if(!i.onField&&!i.expression||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new s.A(l,"Unsupported query options",{query:e});return c(e,t)}async function c(e,{fieldsIndex:t,geometryType:i,spatialReference:o,availableFields:u}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new s.A(l,"Unsupported query options",{query:e});return h(t,u,e),function(e,t,i){const{outStatistics:n,groupByFieldsForStatistics:a,having:o}=i,u=a?.length,c=n?.length;if(o){if(!u||!c)throw new s.A(l,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,r.eD)(e,t,o,n,i)}if(c){if(null==(h=n)||!h.every((e=>"exceedslimit"!==e.statisticType)))return;const o=n.map((e=>e.onStatisticField)).filter(Boolean);(0,r.MG)(e,t,o,{expressionName:"onStatisticFields",query:i}),u&&(0,r.MG)(e,t,a,{expressionName:"groupByFieldsForStatistics",query:i});for(const a of n){const{onStatisticField:n,statisticType:o}=a;if("percentile_disc"!==o&&"percentile_cont"!==o||!("statisticParameters"in a))e.get(n)&&"count"!==o&&"min"!==o&&"max"!==o&&(0,r.MG)(e,t,[n],{expressionName:`outStatistics with '${o}' statistic type`,allowedFieldTypes:d,query:i});else{const{statisticParameters:e}=a;if(!e)throw new s.A(l,"statisticParameters should be set for percentile type",{definition:a,query:i})}}}var h}(t,u,e),Promise.all([(0,a.c0)(e,i,o),(0,n.Nk)(o,e.outSR)]).then((()=>e))}function h(e,t,i){const{outFields:n,orderByFields:a,returnDistinctValues:o,outStatistics:u}=i,c=u?u.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(a&&a.length>0){const s=" asc",n=" desc",o=a.map((e=>{const t=e.toLowerCase();return t.includes(s)?t.split(s)[0]:t.includes(n)?t.split(n)[0]:e})).filter((e=>!c.includes(e)));(0,r.MG)(e,t,o,{expressionName:"orderByFields",query:i})}if(n&&n.length>0)(0,r.MG)(e,t,n,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(o)throw new s.A(l,"outFields should be specified for returnDistinctValues",{query:i});(0,r.SN)(e,t,i.where,i)}const d=new Set([...r.vl,...r.VW]);async function p(e,t,{fieldsIndex:i,geometryType:r,spatialReference:o,availableFields:u}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new s.A(l,"Unsupported query options",{query:e});return h(i,u,e),Promise.all([m(i,u,t,e),(0,a.c0)(e,r,o),(0,n.Nk)(o,e.outSR)]).then((()=>e))}async function m(e,t,i,n){let a=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,o.lw)();a=e.extractFieldNames(i.valueExpression)}if(i.field&&a.push(i.field),i.field2&&a.push(i.field2),i.field3&&a.push(i.field3),i.normalizationField&&a.push(i.normalizationField),!a.length&&!i.valueExpression)throw new s.A(l,"field or valueExpression is required",{params:i});(0,r.MG)(e,t,a,{expressionName:"statistics",query:n})}},62660:(e,t,i)=>{i.d(t,{tC:()=>I,c0:()=>T,xt:()=>x});var s=i(49186),r=i(94078),n=i(12176),a=i(65864),o=i(21325);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,i,s,r,n){const a=l(r,n),{coords:o,lengths:u}=s;if(!u)return!1;for(let s=0,r=0;s<u.length;s++,r+=a)if(!c(e,t,i,o[r],o[r+1]))return!1;return!0}function c(e,t,i,s,r){if(!e)return!1;const n=l(t,i),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,s,r),c+=e*n;return u}function h(e,t,i,s,r,n,a){let o=e,l=s;for(let e=s,u=s+r*i;e<u;e+=i){l=e+i,l===u&&(l=s);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=i(90708),p=i(92722),m=i(51441),f=i(31464);const y="unsupported-query",g={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}},_={esriSpatialRelIntersects:()=>Promise.all([i.e(6986),i.e(830),i.e(6950)]).then(i.bind(i,44050)),esriSpatialRelContains:()=>Promise.all([i.e(6986),i.e(830),i.e(1867)]).then(i.bind(i,29127)),esriSpatialRelCrosses:()=>Promise.all([i.e(6986),i.e(830),i.e(8682)]).then(i.bind(i,65398)),esriSpatialRelDisjoint:()=>Promise.all([i.e(6986),i.e(830),i.e(1598)]).then(i.bind(i,7978)),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(6986),i.e(830),i.e(367)]).then(i.bind(i,74067)),esriSpatialRelTouches:()=>Promise.all([i.e(6986),i.e(830),i.e(5664)]).then(i.bind(i,3188)),esriSpatialRelWithin:()=>Promise.all([i.e(6986),i.e(830),i.e(9728)]).then(i.bind(i,97828)),esriSpatialRelRelation:null};async function x(e,t,i,s,o){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Ye)(new p.A,t,!1,!1);return t=>function(e,t,i,s){return c(e,!1,!1,s.coords[0],s.coords[1])}(e,0,0,t)}if("esriGeometryMultipoint"===i){const i=(0,d.Ye)(new p.A,t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,!1,!1,e,s,o)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,r.qz)(t,(0,m.pL)(i,s,o,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,r.rL)(t,(0,m.pL)(i,s,o,e));if("esriSpatialRelIntersects"===e){const e="mesh"===(l=i)?n.xB:(0,n.xK)(l);return r=>e(t,(0,m.pL)(i,s,o,r))}}var l;"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const h=await function(e){const t=_[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>h.execute(t,(0,m.pL)(i,s,o,e))}async function T(e,t,i){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===g.spatialRelationship[e]}(r))throw new s.A(y,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(n.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===g.queryGeometry[(0,a.$B)(e)]}(n))throw new s.A(y,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===g.layerGeometry[e]}(t))throw new s.A(y,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,f.Nk)(e.geometry?.spatialReference,e.outSR)}}}function I(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},86420:(e,t,i)=>{i.d(t,{I:()=>n,W:()=>r});var s=i(4718);async function r(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:r,endTimeField:n}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await t.forEach((e=>{const t=i.getAttribute((0,s.zI)(e),r),l=i.getAttribute((0,s.zI)(e),n);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))}));else{const e=r||n;await t.forEach((t=>{const r=i.getAttribute((0,s.zI)(t),e);null==r||isNaN(r)||(a=Math.min(a,r),o=Math.max(o,r))}))}return{start:a,end:o}}function n(e,t,i){if(!t||!e)return null;const{startTimeField:s,endTimeField:r}=e;if(!s&&!r)return null;const{start:n,end:a}=t;if(null===n&&null===a)return null;if(void 0===n&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return s&&r?function(e,t,i,s,r){return null!=s&&null!=r?n=>{const a=e(n,t),o=e(n,i);return(null==a||a<=r)&&(null==o||o>=s)}:null!=s?t=>{const r=e(t,i);return null==r||r>=s}:null!=r?i=>{const s=e(i,t);return null==s||s<=r}:void 0}(o,s,r,n,a):function(e,t,i,s){return null!=i&&null!=s&&i===s?s=>e(s,t)===i:null!=i&&null!=s?r=>{const n=e(r,t);return null!=n&&n>=i&&n<=s}:null!=i?s=>{const r=e(s,t);return null!=r&&r>=i}:null!=s?i=>{const r=e(i,t);return null!=r&&r<=s}:void 0}(o,s||r,n,a)}},5834:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(41366);function h(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,c.K)(u.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],d.prototype,"numBins",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.end",write:{writer:h}}})],d.prototype,"end",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.start",write:{writer:h}}})],d.prototype,"start",void 0),(0,s._)([(0,o.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,s._)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],d);const p=d;d.from=(0,a.dp)(d)},53275:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),r=i(69540),n=i(66552),a=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),u=i(40608),c=i(56507);let h=class extends(r.A.ClonableMixin(a.A)){constructor(e){super(e),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"alias",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"expression",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"field",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"responseType",void 0),h=(0,s._)([(0,u.$)("esri.rest.support.BinParametersAttributes")],h);const d=h;h.from=(0,c.dp)(h);const p=new n.J({naturalLog:"natural-log",squareRoot:"square-root"});let m=class extends(r.A.ClonableMixin(a.A)){constructor(e){super(e),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"expression",void 0),(0,s._)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],m.prototype,"field",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"firstDayOfWeek",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"hideUpperBound",void 0),(0,s._)([(0,o.MZ)({type:d,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(e,t)=>{null!=e.field&&(t.splitByField=e.field),null!=e.expression&&(t.splitBy=e.expression),null!=e.alias&&(t.splitByAlias=e.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(e,t)=>new d({field:t.splitByField,expression:t.splitBy,alias:t.splitByAlias})}}})],m.prototype,"splitByAttributes",void 0),(0,s._)([(0,o.MZ)({type:d,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(e,t)=>{null!=e.field&&(t.stackByField=e.field),null!=e.expression&&(t.stackBy=e.expression),null!=e.alias&&(t.stackByAlias=e.alias),null!=e.responseType&&(t.jsonStyle=e.responseType)},overridePolicy(){return{enabled:null!=this.stackByAttributes?.field||null!=this.stackByAttributes?.expression}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(e,t)=>new d({field:t.stackByField,expression:t.stackBy,alias:t.stackByAlias,responseType:t.jsonStyle})}}})],m.prototype,"stackByAttributes",void 0),(0,s._)([(0,l.e)(p)],m.prototype,"transformation",void 0),m=(0,s._)([(0,u.$)("esri.rest.support.BinParametersBase")],m);const f=m},59977:(e,t,i)=>{i.d(t,{A:()=>x});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(69540),h=i(66552),d=i(25482);const p=(0,h.O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends(c.A.ClonableMixin(d.A)){constructor(e){super(e),this.value=null,this.unit=null}};(0,s._)([(0,n.MZ)({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),(0,s._)([(0,o.e)(p)],m.prototype,"unit",void 0),m=(0,s._)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],m);const f=m;function y(e,t,i){(0,r.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function g(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}m.from=(0,a.dp)(m);let _=class extends u.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};(0,s._)([(0,n.MZ)({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>g(t,"end")},write:{writer:y}}})],_.prototype,"end",void 0),(0,s._)([(0,n.MZ)({type:f,json:{name:"parameters",write:!0}})],_.prototype,"interval",void 0),(0,s._)([(0,n.MZ)({type:f,json:{name:"parameters.offset",write:!0}})],_.prototype,"offset",void 0),(0,s._)([(0,n.MZ)({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>g(t,"start")},write:{writer:y}}})],_.prototype,"start",void 0),(0,s._)([(0,o.e)({dateBin:"date"},{readOnly:!0})],_.prototype,"type",void 0),_=(0,s._)([(0,l.$)("esri.rest.support.DateBinParameters")],_);const x=_;_.from=(0,a.dp)(_)},11440:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275);let c=class extends u.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,s._)([(0,n.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,r.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map((e=>e.getTime())):e,t)}}}})],c.prototype,"boundaries",void 0),(0,s._)([(0,o.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,s._)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],c);const h=c;c.from=(0,a.dp)(c)},60909:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(41366);function h(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,c.K)(u.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,s._)([(0,n.MZ)({json:{name:"parameters.end",write:{writer:h}}})],d.prototype,"end",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],d.prototype,"interval",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.start",write:{writer:h}}})],d.prototype,"start",void 0),(0,s._)([(0,o.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,s._)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],d);const p=d;d.from=(0,a.dp)(d)},41366:(e,t,i)=>{i.d(t,{K:()=>d});var s=i(90237),r=i(66552),n=i(53966),a=i(10107),o=(i(44208),i(87811),i(93223)),l=i(40608);const u=(0,r.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",h="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&h||i&&c||null,t&&i&&n.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==h&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,s._)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,s._)([(0,o.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,s._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},63076:(e,t,i)=>{i.d(t,{W6:()=>E,Bb:()=>P});var s=i(71511),r=(i(44208),i(53966)),n=i(97768),a=i(61604),o=i(3694),l=i(74887),u=i(36708),c=i(44794),h=i(78659);const d=Symbol("Yield");class p{constructor(){this._tasks=new Array,this._runningTasks=(0,c.v)(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(0===this.length)return d;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,i){return++this._runningTasks.value,new Promise(((s,r)=>this._tasks.push(new m(s,r,e,t,i)))).finally((()=>--this._runningTasks.value))}unshift(e,t,i){return++this._runningTasks.value,new Promise(((s,r)=>this._tasks.unshift(new m(s,r,e,t,i)))).finally((()=>--this._runningTasks.value))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const i=(0,l.G4)(t.signal);if(i&&!t.abortCallback)t.reject((0,l.NK)());else{const s=i?t.abortCallback?.((0,l.NK)()):t.callback(e);(0,l.$X)(s)?s.then(t.resolve,t.reject):t.resolve(s)}}catch(e){t.reject(e)}return!0}cancelAll(){const e=(0,l.NK)();for(const t of this._tasks)if(t.abortCallback){const i=t.abortCallback(e);t.resolve(i)}else t.reject(e);this._tasks.length=0}}class m{constructor(e,t,i,s=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=i,this.signal=s,this.abortCallback=r}}var f=i(90237),y=i(69622),g=i(10107),_=(i(87811),i(40608));let x=class extends y.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,f._)([(0,g.MZ)()],x.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,f._)([(0,g.MZ)()],x.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),x=(0,f._)([(0,_.$)("esri.views.support.debugFlags")],x);const T=new x;var I,E,S;(S=I||(I={}))[S.ANIMATING=0]="ANIMATING",S[S.INTERACTING=1]="INTERACTING",S[S.IDLE=2]="IDLE",function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e.MAPVIEW_FETCH_QUEUE="mapview fetch queue",e.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",e.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(E||(E={}));const R=new Map([[E.RESOURCE_CONTROLLER_IMMEDIATE,0],[E.RESOURCE_CONTROLLER,4],[E.SLIDE,0],[E.STREAM_DATA_LOADER,0],[E.ELEVATION_QUERY,0],[E.TERRAIN_SURFACE,1],[E.SURFACE_GEOMETRY_UPDATES,1],[E.LOD_RENDERER,2],[E.GRAPHICS_CORE,2],[E.I3S_CONTROLLER,2],[E.POINT_CLOUD_LAYER,2],[E.FEATURE_TILE_FETCHER,2],[E.CLOUDS_GENERATOR,2],[E.OVERLAY,4],[E.STAGE,4],[E.GRAPHICS_DECONFLICTOR,4],[E.FILTER_VISIBILITY,4],[E.SCALE_VISIBILITY,4],[E.FRUSTUM_VISIBILITY,4],[E.POINT_OF_INTEREST_FREQUENT,6],[E.POINT_OF_INTEREST_INFREQUENT,30],[E.LABELER,8],[E.FEATURE_QUERY_ENGINE,8],[E.FEATURE_TILE_TREE,16],[E.FEATURE_TILE_TREE_ACTIVE,0],[E.ELEVATION_ALIGNMENT,12],[E.ELEVATION_ALIGNMENT_SCENE,14],[E.TEXT_TEXTURE_ATLAS,12],[E.TEXTURE_UNLOAD,12],[E.LINE_OF_SIGHT_TOOL,16],[E.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[E.SNAPPING,0],[E.SHADOW_ACCUMULATOR,30],[E.MAPVIEW_FETCH_QUEUE,0],[E.MAPVIEW_LAYERVIEW_UPDATE,2],[E.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]);function F(e){return R.has(e)?R.get(e):"number"==typeof e?e:1}const v=(0,h.l5)(6.5),w=(0,h.l5)(1),A=(0,h.l5)(30),b=(0,h.l5)(1e3/30),M=(0,h.l5)(100);var N,C;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=(0,c.v)(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new a.A("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new i,this._state=I.INTERACTING,this._tasks=new o.A,this._runQueue=new o.A,this._load=0,this._idleStateCallbacks=new o.A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,u.wB)((()=>T.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),u.Vh);for(const e of Object.keys(E))this.performanceInfo.tasks.set(E[e],new a.A(E[e]))}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,n.xt)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())})))}registerTask(e,i){const s=new t(this,e,i);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new a.A(e)),s}registerIdleStateCallbacks(e,t){const i={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(i),this.state===I.IDLE&&this._idleUpdatesStartFired&&i.idleBegin();const s=this;return{remove:()=>this._removeIdleStateCallbacks(i),set idleBegin(e){s._idleUpdatesStartFired&&(i.idleEnd(),s._state===I.IDLE&&e()),i.idleBegin=e},set idleEnd(e){i.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==I.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}frame(e){this._startFrameTaskTimes();const t=this._updateBudget(e);if(t){const e=this._budget.now();this._runFrame(),this._recordFrameTaskTimes(this._budget.now()-e)}else this._recordFrameTaskTimes(0);return t}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=v,i=e.frameDuration,s=w;switch(this.state){case I.IDLE:t=(0,h.l5)(0),i=(0,h.l5)(Math.max(M,e.frameDuration)),s=A;break;case I.INTERACTING:i=(0,h.l5)(Math.max(b,e.frameDuration));case I.ANIMATING:}return i=(0,h.l5)(i-e.elapsedFrameTime-t),this.state!==I.IDLE&&i<w&&!this._forceTask?(this._forceTask=!0,!1):(i=(0,h.l5)(Math.max(i,s)),this._budget.reset(i,this.state),this._updateLoad(),this._schedule())}_runFrame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case I.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case I.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset((0,h.l5)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return C.SCHEDULED;let t=C.IDLE;return this._tasks.forAll((i=>{i.name===e&&i.needsUpdate&&(i.schedulePriority<=1?t=C.READY:t!==C.READY&&(t=C.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((i=>{i.name===e&&(t+=i.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,i)=>{t+=e>1?` ${e}x ${i}`:` ${i}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((i=>{i.needsUpdate&&0!==i.schedulePriority&&0!==i.basePriority&&i.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,i.basePriority),1===i.schedulePriority?(i.schedulePriority=0,this._runQueue.push(i)):--i.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const e=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===d&&(t.blockFrame=this._frameNumber)}catch(e){r.A.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,e),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,E.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const i=this._budget.now()-e;if(t.runtime+=i,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+i),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(E))this._frameTaskTimes.set(E[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).push(e))),this.performanceInfo.total.push(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,i){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new p,this._handles=new s.A,this._basePriority=F(t),this.schedulePriority=this._basePriority,this._task=(0,c.v)(null!=i?i:this._queue),this._handles.add((0,u.z7)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=F(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,i){return this._queue.push(e,t,i)}reschedule(e,t,i){return this._queue.unshift(e,t,i)}processQueue(e){return this._queue.runTask(e)}}class i{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=I.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=i}(N||(N={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(C||(C={}));const P=(()=>{const e=new N.Budget;return e.enabled=!1,e})(),O=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,l.G4)(t)){const e=(0,l.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,l.z7)(e(P))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7339],{11006:(e,t,i)=>{function s(e,t,i,s,n){r(e,t,i||0,s||e.length-1,n||a)}function r(e,t,i,s,a){for(;s>i;){if(s-i>600){var o=s-i+1,l=t-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);r(e,t,Math.max(i,Math.floor(t-l*c/o+h)),Math.min(s,Math.floor(t+(o-l)*c/o+h)),a)}var d=e[t],p=i,m=s;for(n(e,i,t),a(e[s],d)>0&&n(e,i,s);p<m;){for(n(e,p,m),p++,m--;a(e[p],d)<0;)p++;for(;a(e[m],d)>0;)m--}0===a(e[i],d)?n(e,i,m):n(e,++m,s),m<=t&&(i=m+1),t<=m&&(s=m-1)}}function n(e,t,i){var s=e[t];e[t]=e[i],e[i]=s}function a(e,t){return e<t?-1:e>t?1:0}i.d(t,{q:()=>s})},44794:(e,t,i)=>{i.d(t,{v:()=>o});var s=i(4718),r=i(62788),n=i(95488);class a{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,r.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=s.gh){return new a(e,t)}},7320:(e,t,i)=>{i.d(t,{g:()=>s});const s={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const s=new r(e.getPointX(t),e.getPointY(t),i),n=e.hasZ(t),a=e.hasM(t);return n&&(s.z=e.getPointZ(t)),a&&(s.m=e.getPointM(t)),s},exportPolygon:function(e,t,i){return new n(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new a(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new o(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const s=e.hasZ(t),r=e.hasM(t),n=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(s){const i=e.getZExtent(t);n.zmin=i.vmin,n.zmax=i.vmax}if(r){const i=e.getMExtent(t);n.mmin=i.vmin,n.mmax=i.vmax}return n}};class r{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class n{constructor(e,t,i,s){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class a{constructor(e,t,i,s){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class o{constructor(e,t,i,s){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),s&&(this.hasM=s)}}class l{constructor(e,t,i,s,r){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=s,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},19730:(e,t,i)=>{i.d(t,{do:()=>N,ux:()=>C});var s=i(4576),r=i(49186),n=(i(44208),i(25482)),a=i(4718),o=i(97768),l=i(74887),u=i(83047),c=i(57251),h=i(70328),d=i(19419),p=i(537),m=i(65864),f=i(21325),y=i(90708),g=i(95538),_=i(51441),x=i(31464);class T{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,s]of this._storage){if(!(s.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new E(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let I=0;class E{constructor(e){this.items=e,this.time=performance.now(),this.id=I++}}var S=i(99352),R=i(8384),F=i(58727),v=i(62798),w=i(62660),A=i(86420),b=i(95466),M=i(63076);class N{constructor(e){this._changeHandle=null,this.capabilities={query:S.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new T,this.timeInfo=e.timeInfo,this._changeHandle=this.featureStore.events.on("changed",(()=>this._clearCache())),this.fieldsIndex=n.A.isSerializable(e.fieldsIndex)?e.fieldsIndex:b.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map((e=>e.name))):this.availableFields=new Set(e.availableFields.map((e=>this.fieldsIndex.get(e)?.name)).filter((e=>null!=e))),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const i=(0,l.Mq)(t);try{const t=await this._executeQuery(e,{},i);return await t.createQueryResponse()}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(e){if(e!==F.v8)throw e;return 0}}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t),s=e.outSR;try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),r=t.size;return r?{count:r,extent:await this._getBounds(t.items,t.spatialReference,s||this.spatialReference)}:{count:0,extent:null}}catch(e){if(e===F.v8)return{count:0,extent:null};throw e}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);try{const t=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=t.items,r=new Set;return await this.reschedule((()=>{for(const e of s)r.add(t.featureAdapter.getObjectId(e))}),i),r}catch(e){if(e===F.v8)return new Set;throw e}}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const t=await this._executeQuery(e,{},i);return await this.reschedule((()=>this._filterLatest(t)),i),await t.createQueryResponse()}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this).createQueryResponse()}}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);let s;e=(0,a.o8)(e);try{e=await this.schedule((()=>(0,F.iJ)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.FQ)(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i);const t=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i);s=await this.reschedule((()=>this._executeGeometryQuery(e,t,i)),i),await this.reschedule((()=>this._executeAggregateIdsQuery(s)),i),await this.reschedule((()=>this.executeObjectIdsQuery(s)),i),await this.reschedule((()=>this.executeTimeQuery(s)),i),await this.reschedule((()=>this.executeAttributesQuery(s)),i)}catch(t){if(t!==F.v8)throw t;s=new R.G([],e,this)}return s.createQueryBinsResponse(e)}async executeQueryForSummaryStatistics(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const s=(0,l.Mq)(i),{field:r,field2:n,field3:a,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:r,field2:n,field3:a,valueExpression:o},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const s=(0,l.Mq)(i),{field:r,normalizationField:n,valueExpression:a}=t;return(await this._executeQueryForStatistics(e,{field:r,normalizationField:n,valueExpression:a},s)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,A.W)(this.timeInfo,this.featureStore);const[i,s]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:s}}async _getBounds(e,t,i){const s=(0,h.hZ)((0,h.vt)(),h.qv);await this.featureStore.forEachBounds(e,(e=>(0,h.RF)(s,e)));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:(0,_.ag)(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5],r.hasZ=!0);const n=(0,x.Cv)(r,t,i);if(n.spatialReference=(0,_.ag)(i),n.xmax-n.xmin==0){const e=(0,u.GA)(n.spatialReference);n.xmin-=e,n.xmax+=e}if(n.ymax-n.ymin==0){const e=(0,u.GA)(n.spatialReference);n.ymin-=e,n.ymax+=e}if(this.hasZ&&null!=n.zmin&&null!=n.zmax&&n.zmax-n.zmin==0){const e=(0,u.GA)(n.spatialReference);n.zmin-=e,n.zmax+=e}return n}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then((e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async schedule(e,t){return null!=this._frameTask?this._frameTask.schedule(e,t):e(M.Bb)}async reschedule(e,t){return null!=this._frameTask?this._frameTask.reschedule(e,t):e(M.Bb)}async _getAllFeaturesQueryEngineResult(e){return new R.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach((t=>e.push(t))))().then((()=>e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?(0,a.zI)(t.slice()):this._getAllFeatures()}async _executeQuery(e,t,i){e=(0,a.o8)(e),e=await this.schedule((()=>(0,F.GC)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.B4)(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i),e={...e,...t};const s=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this.reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this.reschedule((()=>this.executeObjectIdsQuery(r)),i),await this.reschedule((()=>this.executeTimeQuery(r)),i),await this.reschedule((()=>this.executeAttributesQuery(r)),i),r}async _executeSceneFilterQuery(e,t){if(null==e.sceneFilter)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,o=null==n||(0,f.aI)(n,a.spatialReference)?a:(0,x.Cv)(a,n);if(!o)return null;const l=s||r,u=(0,f.fn)(i)&&!(0,f.aI)(this.spatialReference,i)&&l?async e=>this._project(e,i):e=>e,c=this.featureAdapter,h=await this.reschedule((()=>this.searchFeatures(C(o))),t);if("disjoint"===e.sceneFilter.spatialRelationship){if(!h.length)return null;const i=new Set;for(const e of h)i.add(c.getObjectId(e));const s=await this.reschedule((()=>this._getAllFeatures()),t),r=await this.reschedule((async()=>{const r=await(0,w.xt)("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),n=await this.runSpatialFilter(s,(e=>!i.has(c.getObjectId(e))||r(c.getGeometry(e))),t);return new R.G(n,e,this)}),t);return u(r)}if(!h.length)return new R.G([],e,this);if(this._canExecuteSinglePass(o,e))return u(new R.G(h,e,this));const d=await(0,w.xt)("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),p=await this.runSpatialFilter(h,(e=>d(c.getGeometry(e))),t);return u(new R.G(p,e,this))}async _executeGeometryQuery(e,t,i){if(null!=t&&0===t.items.length)return t;const{geometry:r,outSR:n,returnGeometry:a,returnCentroid:o}=e,l=t?null:this._getCacheKey(e),u=l?this._cache.get(l):null;if(u)return new R.G(u,e,this);const c=(0,f.fn)(n)&&!(0,f.aI)(this.spatialReference,n),h=a||o,d=async e=>(c&&h&&await this._project(e,n),l&&this._cache.put(l,e.items),e),p=this.featureStore.featureSpatialReference,m=!r||null==p||(0,f.aI)(p,r.spatialReference)?r:(0,x.Cv)(r,p);if(!m)return d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const y=this.featureAdapter;let g=await this.reschedule((()=>this.searchFeatures(C(r))),i);const _=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===_){if(!g.length)return d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const s=new Set;for(const e of g)s.add(y.getObjectId(e));const r=null!=t?t.items:await this.reschedule((()=>this._getAllFeatures()),i),n=await this.reschedule((async()=>{const t=await(0,w.xt)(_,m,this.geometryType,this.hasZ,this.hasM),n=await this.runSpatialFilter(r,(e=>!s.has(y.getObjectId(e))||t(y.getGeometry(e))),i);return new R.G(n,e,this)}),i);return d(n)}if(null!=t){const e=new s.vW;g=g.filter((i=>(0,s.qh)(t.items,i,t.items.length,e)>=0))}if(!g.length){const t=new R.G([],e,this);return l&&this._cache.put(l,t.items),t}if(this._canExecuteSinglePass(m,e))return d(new R.G(g,e,this));const T=await(0,w.xt)(_,m,this.geometryType,this.hasZ,this.hasM),I=await this.runSpatialFilter(g,(e=>T(y.getGeometry(e))),i);return d(new R.G(I,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach((e=>t.add(e)));const i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter((e=>t.has(i(e))))}executeTimeQuery(e){if(0===e.items.length)return;const t=(0,A.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,g.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter((e=>t.testFeature(e,this.featureAdapter)))}}async runSpatialFilter(e,t,i){if(!t)return e;if(null==this._frameTask)return e.filter((e=>t(e)));let s=0;const r=new Array,n=async a=>{for(;s<e.length;){const o=e[s++];t(o)&&(r.push(o),a.madeProgress()),a.done&&await this.reschedule((e=>n(e)),i)}};return this.reschedule((e=>n(e)),i).then((()=>r))}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,n=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),s=a(i,r),o=n.get(e);(!o||s>a(o,r))&&n.set(e,i)}e.items=Array.from(n.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:s,returnCentroid:r,outSR:n,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=s||r;return(0,f.fn)(n)&&!(0,f.aI)(this.spatialReference,n)&&l?JSON.stringify([t,i,n]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,w.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,f.aI)(this.spatialReference,t))return e;const i=this.featureAdapter;let s;try{const e=await this._getFullExtent();s=(0,c.getTransformation)(this.spatialReference,t,e)}catch{}const r=await(0,x.lK)(e.items.map((e=>(0,_.pL)(this.geometryType,this.hasZ,this.hasM,i.getGeometry(e)))),this.spatialReference,t,s);return e.items=(0,a.zI)(r.map(((t,s)=>i.cloneWithGeometry(e.items[s],(0,y.Ux)(t,this.hasZ,this.hasM))))),e}async searchFeatures(e){const t=new Set;await Promise.all(e.map((e=>this.featureStore.forEachInBounds(e,(e=>t.add(e))))));const i=Array.from(t.values());return t.clear(),i}async _executeQueryForStatistics(e,t,i){e=(0,a.o8)(e);try{e=await this.schedule((()=>(0,F.GC)(e,this.definitionExpression,this.spatialReference)),i),e=await this.reschedule((()=>(0,v.mO)(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference})),i);const s=await this.reschedule((()=>this._executeSceneFilterQuery(e,i)),i),r=await this.reschedule((()=>this._executeGeometryQuery(e,s,i)),i);return await this.reschedule((()=>this._executeAggregateIdsQuery(r)),i),await this.reschedule((()=>this.executeObjectIdsQuery(r)),i),await this.reschedule((()=>this.executeTimeQuery(r)),i),await this.reschedule((()=>this.executeAttributesQuery(r)),i),r}catch(t){if(t!==F.v8)throw t;return new R.G([],e,this)}}get test(){}}function C(e){if((0,w.tC)(e)){if((0,m.ZC)(e))return[(0,d.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,m.Bi)(e))return e.rings.map((e=>(0,d.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,p.Rg)((0,d.vt)(),e)]}},99352:(e,t,i)=>{i.d(t,{F:()=>s});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1}},8384:(e,t,i)=>{i.d(t,{G:()=>R});var s=i(4718),r=i(88930),n=i(12359),a=i(90634),o=i(62577),l=i(21325),u=i(95538),c=i(51441),h=i(30524),d=i(50201),p=i(1873),m=i(71386);class f{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const s=e.outFields;if(s&&!s.includes("*")){this.outFields=s;let e=0;for(const t of s){const s=(0,u.Wq)(t),r=this.fieldsIndex.get(s),n=r?null:(0,u.j4)(s,i),a=r?r.name:(0,u.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:n})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach((e=>this.getAttributes(e))),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){const s=i?i.name:t;let r=null;return this._fieldDataCache.has(s)?r=this._fieldDataCache.get(s)?.clause:i||(r=(0,u.j4)(t,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:r})),i?this.featureAdapter.getAttribute(e,s):r?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const s=t.normalizationType,r=t.normalizationTotal,n=this.fieldsIndex.get(t.field),a=(0,h.zD)(n)||(0,h.Ah)(n),o=(0,h.OH)(n);return e.map((e=>{let n=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(n=`${(0,p.gJ)(n)}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(n=`${n}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof n&&i&&(a?n=n?new Date(n).getTime():null:o&&(n=n?(0,d.rb)(n):null)),s&&Number.isFinite(n)){const i="field"===s&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;n=(0,p.zS)(n,s,i,r)}return n}))}async getExpressionValues(e,t,i,s,r){const{arcadeUtils:n}=await(0,m.lw)(),a=n.hasGeometryOperations(t);a&&await n.enableGeometryOperations();const o=n.createFunction(t),l=n.getViewInfo(i),u={fields:this.fieldsIndex.fields};return e.map((e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:u,geometry:a?{...(0,c.pL)(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(e)),spatialReference:i?.spatialReference}:null},h=n.createExecContext(t,l,r);return n.executeFunction(o,h)}))}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,u.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,u.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const s of t){const{alias:t,clause:r}=this._fieldDataCache.get(s);i[t]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const s of t){const{alias:t}=this._fieldDataCache.get(s);i.push(e[t])}else for(const t in e)i.push(e[t]);const s=`${(t||["*"]).join(",")}=${i.join(",")}`;let r=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++r),r>1?null:e}}var y=i(31464),g=i(58727);function _(e,t,i){return{objectId:e,target:t,distance:i,type:"vertex"}}function x(e,t,i,s,r,n=!1){return{objectId:e,target:t,distance:i,type:"edge",start:s,end:r,draped:n}}var T=i(5834),I=i(59977),E=i(11440),S=i(60909);class R{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new f(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,r=t?.length;if(!r)return 1;const n=new Map,a=new Map,o=new Set;for(const r of s){const{statisticType:s}=r,l="exceedslimit"!==s?r.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,n);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:s,items:r}=u[t],n=s.join(",");i&&!e.validateItems(r,i)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,l.fn)(this.query.outSR)&&!(0,l.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,c.ag)({spatialReference:this.query.outSR,...(0,y.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,c.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=v(this.hasZ,this.hasM),{point:r,mode:n}=e,a="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c="esriGeometryPolyline"===this.geometryType,h=this._getPointCreator(n,this.spatialReference,t),d=new w(null,0),p=new w(null,0),m={x:0,y:0,z:0};for(const t of this.items){const n=i.getGeometry(t);if(null==n)continue;const{coords:f}=n,y=n.isPoint?A:n.lengths;if(d.coords=f,p.coords=f,e.returnEdge){let e=0;for(let n=0;n<y.length;n++){const c=y[n],f=e;for(let n=0;n<c;n++,e+=s){if(!u&&n===c-1)continue;const y=d;y.coordsIndex=e;const g=p;g.coordsIndex=n===c-1?f:e+s;const _=m;if(!F(m,r,y,g))continue;const T=(r.x-_.x)/a,I=(r.y-_.y)/o,E=T*T+I*I;E<=1&&l.candidates.push(x(i.getObjectId(t),h(_),Math.sqrt(E),h(y),h(g)))}}}if("all"===e.vertexMode){let e=0;for(let n=0;n<y.length;n++){const c=y[n],m=e,f=p;f.coordsIndex=m;for(let n=0;n<c;n++,e+=s){const s=d;if(s.coordsIndex=e,u&&n===c-1&&s.x===f.x&&s.y===f.y)continue;const p=(r.x-s.x)/a,m=(r.y-s.y)/o,y=p*p+m*m;y<=1&&l.candidates.push(_(i.getObjectId(t),h(s),Math.sqrt(y)))}}}else if(c&&"ends"===e.vertexMode){let e=0;const n=[];for(let t=0;t<y.length;t++){n.push(e);const i=y[t];e+=i*s,!u&&i>1&&n.push(e-s)}for(const e of n){const s=d;s.coordsIndex=e;const n=(r.x-s.x)/a,u=(r.y-s.y)/o,c=n*n+u*u;c<=1&&l.candidates.push(_(i.getObjectId(t),h(s),Math.sqrt(c)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,i){const s=null==i||(0,l.aI)(t,i)?e=>e:e=>(0,y.Cv)(e,t,i),{hasZ:r}=this;return"3d"===e?r?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:0}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,d=this.fieldsIndex.get(t),m=(0,h.vE)(d)||(0,h.zD)(d)||(0,h.Ah)(d),f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:l,timeZone:u},this.items),y=(0,p.Vb)({normalizationType:r,normalizationField:s,minValue:a,maxValue:o}),g={value:.5,fieldType:d?.type},_=(0,h.yM)(d)?(0,p.z9)({values:f,supportsNullCount:y,percentileParams:g,outStatisticTypes:c}):(0,p.G_)({values:f,minValue:a,maxValue:o,useSampleStdDev:!r,supportsNullCount:y,percentileParams:g,outStatisticTypes:c});return(0,p.oZ)(_,c,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:r,scale:n,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:n,timeZone:a},this.items,!1),l=(0,p.b3)(o);return(0,p.lv)(l,s,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d},this.items),f=(0,p.Rw)(m,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,p.jM)(f,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:h,timeZone:d}=e,m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:h,timeZone:d},this.items);return(0,p.$y)(m,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),r=t[0],n=this.fieldsIndex.get(r),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,p.FM)(n?.type,a);e.sort(((e,t)=>{const s=i(e,r,n),a=i(t,r,n);return o(s,a)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:r,objectIdField:n,spatialReference:a}=this,{outFields:l,outSR:u,quantizationParameters:h,resultRecordCount:d,resultOffset:p,returnZ:m,returnM:f}=e,y=null!=d&&t.length>(p||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:r&&m,objectIdFieldName:n,spatialReference:(0,c.ag)(u||a),transform:h&&(0,o.VV)(h)||null}}_createFeatures(e,t){const i=new f(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:r}=this,{orderByFields:n,quantizationParameters:a,returnGeometry:l,returnCentroid:u,maxAllowableOffset:h,resultOffset:d,resultRecordCount:p,returnZ:m=!1,returnM:y=!1}=e,g=r&&m,_=s&&y;let x=[],T=0;const I=[...t];if(this._sortFeatures(I,n,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||u)){const e=(0,o.VV)(a)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const s of I){const r=this.featureAdapter.getGeometry(s),n={attributes:i.getAttributes(s),geometry:(0,c.pL)(this.geometryType,this.hasZ,this.hasM,r,h,e,g,_)};t&&r&&!n.geometry&&(n.centroid=(0,c.LQ)(this,this.featureAdapter.getCentroid(s,this),e)),x[T++]=n}else if(!l&&u)for(const t of I)x[T++]={attributes:i.getAttributes(t),centroid:(0,c.LQ)(this,this.featureAdapter.getCentroid(t,this),e)};else for(const t of I)x[T++]={attributes:i.getAttributes(t),centroid:(0,c.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,c.pL)(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(t),h,e,g,_)}}else for(const e of I){const t=i.getAttributes(e);t&&(x[T++]={attributes:t})}const E=d||0;if(null!=p){const e=E+p;x=x.slice(E,Math.min(x.length,e))}return x}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=v(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],r=new Map,n=new Map,a=new Map,o=new Map,l=new f(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:d,orderByFields:p,resultRecordCount:m}=e,y=c?.length,g=!!y,_=g?c[0]:null,x=g&&!this.fieldsIndex.get(_);for(const e of u??[]){const{outStatisticFieldName:u,statisticType:p}=e,m=e,f="exceedslimit"!==p?e.onStatisticField:void 0,T="percentile_disc"===p||"percentile_cont"===p,I="EnvelopeAggregate"===p||"CentroidAggregate"===p||"ConvexHullAggregate"===p,E=g&&1===y&&(f===_||x)&&"count"===p;if(g){if(!a.has(f)){const e=[];for(const i of c){const s=this._getAttributeValues(l,i,t,r);e.push(s)}a.set(f,this._calculateUniqueValues(e,t,!I&&l.returnDistinctValues))}const e=a.get(f);if(!e)continue;const i=Object.keys(e);for(const s of i){const{count:i,data:n,items:a,itemPositions:h}=e[s],p=n.join(",");if(!d||l.validateItems(a,d)){const e=o.get(p)||{attributes:{}};if(I){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:i}=await this._getAggregateGeometry(m,a);e.aggregateGeometries[i]=t}else{let s=null;if(E)s=i;else{const e=this._getAttributeValues(l,f,t,r),i=h.map((t=>e[t]));s=T&&"statisticParameters"in m?this._getPercentileValue(m,i):this._getStatisticValue(m,i,null,l.returnDistinctValues)}e.attributes[u]=s}let s=0;c.forEach(((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++s]=n[i])),o.set(p,e)}}}else if(I){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(m,t);i.aggregateGeometries[s]=e}else{const e=this._getAttributeValues(l,f,t,r);i.attributes[u]=T&&"statisticParameters"in m?this._getPercentileValue(m,e):this._getStatisticValue(m,e,n,l.returnDistinctValues)}const S="min"!==p&&"max"!==p||!(0,h.yM)(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:u,alias:u,type:S||"esriFieldTypeDouble"})}const T=g?Array.from(o.values()):[i];return this._sortFeatures(T,p,((e,t)=>e.attributes[t])),m&&(T.length=Math.min(m,T.length)),{fields:s,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,h.vE)(t)||(0,h.zD)(t)||(0,h.Ah)(t)||(0,h.OH)(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:r}=await Promise.all([i.e(9930),i.e(3656)]).then(i.bind(i,47559)),{statisticType:o,outStatisticFieldName:l}=e,{featureAdapter:u,spatialReference:h,geometryType:d,hasZ:p,hasM:m}=this,f=t.map((e=>(0,c.pL)(d,p,m,u.getGeometry(e)))),y=s(h,f,!0)[0],g={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===o){const e=y?(0,a.v)(y):(0,a.HA)(r(h,f));g.aggregateGeometries={...e,spatialReference:h},g.outStatisticFieldName=l||"extent"}else if("CentroidAggregate"===o){const e=y?(0,n.l8)(y):(0,n.Z4)((0,a.HA)(r(h,f)));g.aggregateGeometries={x:e[0],y:e[1],spatialReference:h},g.outStatisticFieldName=l||"centroid"}else"ConvexHullAggregate"===o&&(g.aggregateGeometries=y,g.outStatisticFieldName=l||"convexHull");return g}_getStatisticValue(e,t,i,s){const{onStatisticField:r,statisticType:n}=e;let a=null;return a=i?.has(r)?i.get(r):(0,h.yM)(this.fieldsIndex.get(r))||this._isAnyDateField(r)?(0,p.z9)({values:t,returnDistinct:s}):(0,p.G_)({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(r,a),a["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:r}=e,{value:n,orderBy:a}=s,o=this.fieldsIndex.get(i);return(0,p.qg)(t,{value:n,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===r})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const r=this.fieldsIndex.get(t),n=i.map((i=>e.getFieldValue(i,t,r)));return s.set(t,n),n}_calculateUniqueValues(e,t,i){const s={},r=t.length;for(let n=0;n<r;n++){const r=t[n],a=[];for(const t of e)a.push(t[n]);const o=a.join(",");null==s[o]?s[o]={count:1,data:a,items:[r],itemPositions:[n]}:(i||s[o].count++,s[o].items.push(r),s[o].itemPositions.push(n))}return s}async _getDataValues(e,t,i=!0){const r=new f(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:a,timeZone:o}=e;return n?r.getExpressionValues(t,n,{viewingMode:"map",scale:a,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):r.getDataValues(t,(0,s.o8)(e),i)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,r=t.min??0,n=t.max??0,a=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=r&&o<=n){const e=(0,p.Ak)(s,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin;switch(t.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(T.A.fromJSON(t),e);case"dateBin":return this._createDateBinsResponse(I.A.fromJSON(t),e);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(E.A.fromJSON(t),e);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.A.fromJSON(t),e)}}async _createAutoIntervalBinsResponse(e,t){const{field:i,normalizationField:s,numBins:r,normalizationType:n,normalizationTotal:a,start:o,end:l}=e,u=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),c=(0,p.sU)(u,{field:i,normalizationField:s,normalizationType:n,normalizationTotal:a,numBins:r,minValue:(0,g.dO)(o,!1),maxValue:(0,g.dO)(l,!1)}),h=await this._calculateHistogramBins(u,c,this.items);return this._createFeaturesFromHistogramBins(h,t)}async _createDateBinsResponse(e,t){const{field:i,interval:s,start:n,end:a}=e,o=s.unit,l="quarters"===o?3*r.vf.months:r.vf[o],u=s.value*l/r.vf.milliseconds,c=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},this.items),d=(0,h.OH)(this.fieldsIndex.get(i)),m=(0,p.sU)(c,{field:i,classificationMethod:"defined-interval",definedInterval:u,minValue:(0,g.dO)(n,d),maxValue:(0,g.dO)(a,d)},!0),f=await this._calculateHistogramBins(c,m,this.items);return this._createFeaturesFromHistogramBins(f,t)}async _createFixedBoundariesBinsResponse(e,t){const{field:i}=e,s=await this._getDataValues({field:i,timeZone:t.outTimeReference?.ianaTimeZone},this.items),r=(0,h.OH)(this.fieldsIndex.get(i)),n=e.boundaries.map((e=>(0,g.dO)(e,r))).sort(((e,t)=>e-t)),a=[];for(let e=0;e<n.length-1;e++)a.push([n[e],n[e+1]]);const o={intervals:a,min:n.at(0),max:n.at(-1)},l=await this._calculateHistogramBins(s,o,this.items);return this._createFeaturesFromHistogramBins(l,t)}async _createFixedIntervalBinsResponse(e,t){const{field:i,interval:s,start:r,end:n}=e,a=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),o=(0,h.OH)(this.fieldsIndex.get(i)),l=(0,p.sU)(a,{field:i,classificationMethod:"defined-interval",definedInterval:s,minValue:(0,g.dO)(r,o),maxValue:(0,g.dO)(n,o)},!0),u=await this._calculateHistogramBins(a,l,this.items);return this._createFeaturesFromHistogramBins(u,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,r=s||"lowerBoundary",n=i||"upperBoundary",a=[],o=[];for(const i of e){const{minValue:e,maxValue:s,items:l}=i,u={attributes:{}};u.attributes[r]=e,u.attributes[n]=s;const c=await this._createStatisticsQueryResponse(t,l,u);a.push(u),c.fields&&o.push(...c.fields)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function F(e,t,i,s){const r=s.x-i.x,n=s.y-i.y,a=t.x-i.x,o=t.y-i.y,l=r*r+n*n;if(0===l)return!1;const u=a*r+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+r*c,e.y=i.y+n*c,!0}function v(e,t){return e?t?4:3:t?3:2}class w{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const A=[1]},95538:(e,t,i)=>{i.d(t,{VW:()=>h,SY:()=>_,Wq:()=>g,j4:()=>y,vl:()=>c,MG:()=>x,eD:()=>f,SN:()=>m});var s=i(49186),r=i(66344),n=i(88368),a=i(98453);const o=new class{constructor(e,t){this._cache=new r.q(e),this._invalidCache=new r.q(t)}get(e,t){const i=`${t.uid}:${e}`,s=this._cache.get(i);if(s)return s;if(null!=this._invalidCache.get(i))return null;try{const s=n.default.create(e,{fieldsIndex:t});return this._cache.put(i,s),s}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t.uid}:${e}`;return this._invalidCache.get(i)??null}}(50,500),l="unsupported-query",u=" as ",c=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),h=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...c,...h]);function p(e,t,i={}){const r=y(t,e);if(!r){const i=o.getError(t,e);throw new s.A(l,"invalid SQL expression",{expression:t,error:i})}const n=i.expressionName||"expression";if(i.validateStandardized&&!r.isStandardized)throw new s.A(l,`${n} is not standard`,{expression:t});if(i.validateAggregate&&!r.isAggregate)throw new s.A(l,`${n} does not contain a valid aggregate function`,{expression:t});return r.fieldNames}function m(e,t,i,s){if(!i)return!0;const r="where clause";return x(e,t,p(e,i,{validateStandardized:!0,expressionName:r}),{expressionName:r,query:s}),!0}function f(e,t,i,r,n){if(!i)return!0;const a="having clause",o=p(e,i,{validateAggregate:!0,expressionName:a});x(e,t,o,{expressionName:a,query:n});const u=y(i,e),c=u?.getExpressions().every((t=>{const{aggregateType:i,field:s}=t,n=e.get(s)?.name;return r.some((t=>{const{onStatisticField:s,statisticType:r}=t,a=e.get(s)?.name;return a===n&&r.toLowerCase().trim()===i}))}));if(!c)throw new s.A(l,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function y(e,t){return e?o.get(e,t):null}function g(e){return/\((.*?)\)/.test(e)?e:e.split(u)[0]}function _(e){return e.split(u)[1]}function x(e,t,i,r={}){const n=new Map;if(function(e,t,i,s,r){const n=r.includes("*")?[...i,...r.filter((e=>"*"!==e))]:r;for(const r of n)if(t.get(r))T(e,t,i,s,r);else try{const n=p(t,g(r),{validateStandardized:!0});for(const r of n)T(e,t,i,s,r)}catch(t){e.set(r,{type:"expression-error",expression:r,error:t})}}(n,e,t,r.allowedFieldTypes??d,i),n.size){const e=r.expressionName??"expression";throw new s.A(l,`${e} contains invalid or missing fields`,{errors:Array.from(n.values()),query:r.query})}}function T(e,t,i,s,r){const n=t.get(r);n?i.has(n.name)?"all"!==s&&!1===s?.has(n.type)&&e.set(r,{type:"invalid-type",fieldName:n.name,fieldType:a.m.fromJSON(n.type),allowedFieldTypes:Array.from(s,(e=>a.m.fromJSON(e)))}):e.set(r,{type:"missing-field",fieldName:n.name}):e.set(r,{type:"invalid-field",fieldName:r})}},51441:(e,t,i)=>{i.d(t,{LQ:()=>u,ag:()=>h,pL:()=>c});var s=i(90708),r=i(92722);const n=new r.A,a=new r.A,o=new r.A,l={esriGeometryPoint:s.DF,esriGeometryPolyline:s.BW,esriGeometryPolygon:s.z5,esriGeometryMultipoint:s.qK};function u(e,t,i,r=e.hasZ,n=e.hasM){if(null==t)return null;const a=e.hasZ&&r,l=e.hasM&&n;if(i){const u=(0,s.Nl)(o,t,e.hasZ,e.hasM,"esriGeometryPoint",i,r,n);return(0,s.DF)(u,a,l)}return(0,s.DF)(t,a,l)}function c(e,t,i,r,u,c,h=t,d=i){const p=t&&h,m=i&&d,f=null!=r?"coords"in r?r:r.geometry:null;if(null==f)return null;if(u){let r=(0,s.kz)(a,f,t,i,e,u,h,d);return c&&(r=(0,s.Nl)(o,r,p,m,e,c)),l[e]?.(r,p,m)??null}if(c){const r=(0,s.Nl)(o,f,t,i,e,c,h,d);return l[e]?.(r,p,m)??null}return(0,s.Q4)(n,f,t,i,h,d),l[e]?.(n,p,m)??null}function h(e){return e&&d in e?JSON.parse(JSON.stringify(e,p)):e}const d="_geVersion",p=(e,t)=>e===d?void 0:t},31464:(e,t,i)=>{i.d(t,{Cv:()=>y,Nk:()=>p,lK:()=>_});var s=i(4576),r=i(74887),n=i(57251),a=i(7320),o=i(21325),l=i(28735);const u=[0,0];function c(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,u),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,u),[i.xmax,i.ymax]=e(t.xmax,t.ymax,u),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:h(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:h(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function h(e,t){const i=[];for(const s of e)i.push(d(s,t));return i}function d(e,t){const i=[];for(const s of e){const e=t(s[0],s[1],[0,0]);i.push(e),s.length>2&&e.push(s[2]),s.length>3&&e.push(s[3])}return i}async function p(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map((e=>null!=e.geometry?e.geometry.spatialReference:null)).filter(s.Ru):[e];await(0,n.initializeProjection)(i.map((e=>({source:e,dest:t}))))}const m=c.bind(null,l.je),f=c.bind(null,l.tD);function y(e,t,i,s){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,o.fn)(t)||!(0,o.fn)(i)||(0,o.aI)(t,i))return e;if((0,l.y7)(t,i)){const t=(0,o.K8)(i)?m(e):f(e);return t.spatialReference=i,t}return(0,n.projectMany)(a.g,[e],t,i,null,s)[0]}const g=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,s){if(!e?.length||!t||!i||(0,o.aI)(t,i))return e;const n={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:s,resolve:(0,r.Tw)()};return this._jobs.push(n),this._timer??=setTimeout(this._process,10),n.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:s,resolve:r,geographicTransformation:u}=e;(0,l.y7)(i,s)?(0,o.K8)(s)?r(t.map(m)):r(t.map(f)):r((0,n.projectMany)(a.g,t,i,s,u,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function _(e,t,i,s){return g.push(e,t,i,s)}},58727:(e,t,i)=>{i.d(t,{GC:()=>m,T2:()=>f,VY:()=>h,dO:()=>g,iJ:()=>p,v8:()=>d});var s=i(66552),r=i(83047),n=i(57251),a=i(90634),o=i(65864),l=i(17136),u=i(21325),c=i(31464);const h=new s.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),d=Object.freeze({});async function p(e,t,i){const s=e.bin,{onField:r,expression:n,splitBy:a,splitByField:o,splitByAlias:l,stackBy:u,stackByField:c,stackByAlias:h}=s;return r&&(s.onField=r.trim()),n&&(s.expression=n.trim()),a&&(s.splitBy=a.trim()),o&&(s.splitByField=o.trim()),l&&(s.splitByAlias=l.trim()),u&&(s.stackBy=u.trim()),c&&(s.stackByField=c.trim()),h&&(s.stackByAlias=h.trim()),"normalizationField"in s.parameters&&s.parameters.normalizationField&&(s.parameters.normalizationField=s.parameters.normalizationField.trim()),m(e,t,i)}async function m(e,t,i){const{outFields:s,orderByFields:r,groupByFieldsForStatistics:n,outStatistics:a}=e;if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),f(e,t,i)}async function f(e,t,s){if(!e)return null;let{where:n}=e;if(e.where=n=n?.trim(),(!n||/^1 *= *1$/.test(n)||t&&t===n)&&(e.where=null),!e.geometry)return e;let p=await async function(e){const{distance:t,units:s}=e,n=e.geometry;if(null==t||"vertexAttributes"in n)return n;const a=n.spatialReference,o=s?h.fromJSON(s):(0,r.Ij)(a),l=a&&((0,u.EA)(a)||(0,u.K8)(a))?n:await(0,c.Nk)(a,u.KK).then((()=>(0,c.Cv)(n,u.KK))),d=await i.e(9159).then(i.bind(i,49159));return await d.load(),d.execute(l,t,{unit:o})??void 0}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;p=(0,a.HA)(p),p.spatialReference=t}if(p){await(0,c.Nk)(p.spatialReference,s),p=function(e,t){const i=e.spatialReference;return y(e,t)&&(0,o.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(p,s);const t=(await(0,l.el)((0,o.rS)(p)))[0];if(null==t)throw d;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,r=i&&y(p,s)?{densificationStep:8*i}:void 0,n=t.toJSON(),a=(0,c.Cv)(n,n.spatialReference,s,r);if(!a)throw d;a.spatialReference=s,e.geometry=a}return e}function y(e,t){if(!e)return!1;const i=e.spatialReference;return((0,o.ZC)(e)||(0,o.Bi)(e)||(0,o.Rg)(e))&&!(0,u.aI)(i,t)&&!(0,n.canProjectWithoutEngine)(i,t)}function g(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},62798:(e,t,i)=>{i.d(t,{B4:()=>c,FQ:()=>u,mO:()=>p});var s=i(49186),r=i(95538),n=i(31464),a=i(62660),o=i(71386);const l="unsupported-query";async function u(e,t){const i=e.bin;if(!i.onField&&!i.expression||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new s.A(l,"Unsupported query options",{query:e});return c(e,t)}async function c(e,{fieldsIndex:t,geometryType:i,spatialReference:o,availableFields:u}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new s.A(l,"Unsupported query options",{query:e});return h(t,u,e),function(e,t,i){const{outStatistics:n,groupByFieldsForStatistics:a,having:o}=i,u=a?.length,c=n?.length;if(o){if(!u||!c)throw new s.A(l,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,r.eD)(e,t,o,n,i)}if(c){if(null==(h=n)||!h.every((e=>"exceedslimit"!==e.statisticType)))return;const o=n.map((e=>e.onStatisticField)).filter(Boolean);(0,r.MG)(e,t,o,{expressionName:"onStatisticFields",query:i}),u&&(0,r.MG)(e,t,a,{expressionName:"groupByFieldsForStatistics",query:i});for(const a of n){const{onStatisticField:n,statisticType:o}=a;if("percentile_disc"!==o&&"percentile_cont"!==o||!("statisticParameters"in a))e.get(n)&&"count"!==o&&"min"!==o&&"max"!==o&&(0,r.MG)(e,t,[n],{expressionName:`outStatistics with '${o}' statistic type`,allowedFieldTypes:d,query:i});else{const{statisticParameters:e}=a;if(!e)throw new s.A(l,"statisticParameters should be set for percentile type",{definition:a,query:i})}}}var h}(t,u,e),Promise.all([(0,a.c0)(e,i,o),(0,n.Nk)(o,e.outSR)]).then((()=>e))}function h(e,t,i){const{outFields:n,orderByFields:a,returnDistinctValues:o,outStatistics:u}=i,c=u?u.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(a&&a.length>0){const s=" asc",n=" desc",o=a.map((e=>{const t=e.toLowerCase();return t.includes(s)?t.split(s)[0]:t.includes(n)?t.split(n)[0]:e})).filter((e=>!c.includes(e)));(0,r.MG)(e,t,o,{expressionName:"orderByFields",query:i})}if(n&&n.length>0)(0,r.MG)(e,t,n,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(o)throw new s.A(l,"outFields should be specified for returnDistinctValues",{query:i});(0,r.SN)(e,t,i.where,i)}const d=new Set([...r.vl,...r.VW]);async function p(e,t,{fieldsIndex:i,geometryType:r,spatialReference:o,availableFields:u}){if((e.distance??0)<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new s.A(l,"Unsupported query options",{query:e});return h(i,u,e),Promise.all([m(i,u,t,e),(0,a.c0)(e,r,o),(0,n.Nk)(o,e.outSR)]).then((()=>e))}async function m(e,t,i,n){let a=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,o.lw)();a=e.extractFieldNames(i.valueExpression)}if(i.field&&a.push(i.field),i.field2&&a.push(i.field2),i.field3&&a.push(i.field3),i.normalizationField&&a.push(i.normalizationField),!a.length&&!i.valueExpression)throw new s.A(l,"field or valueExpression is required",{params:i});(0,r.MG)(e,t,a,{expressionName:"statistics",query:n})}},62660:(e,t,i)=>{i.d(t,{tC:()=>I,c0:()=>T,xt:()=>x});var s=i(49186),r=i(94078),n=i(12176),a=i(65864),o=i(21325);function l(e,t){return e?t?4:3:t?3:2}function u(e,t,i,s,r,n){const a=l(r,n),{coords:o,lengths:u}=s;if(!u)return!1;for(let s=0,r=0;s<u.length;s++,r+=a)if(!c(e,t,i,o[r],o[r+1]))return!1;return!0}function c(e,t,i,s,r){if(!e)return!1;const n=l(t,i),{coords:a,lengths:o}=e;let u=!1,c=0;for(const e of o)u=h(u,a,n,c,e,s,r),c+=e*n;return u}function h(e,t,i,s,r,n,a){let o=e,l=s;for(let e=s,u=s+r*i;e<u;e+=i){l=e+i,l===u&&(l=s);const r=t[e],c=t[e+1],h=t[l],d=t[l+1];(c<a&&d>=a||d<a&&c>=a)&&r+(a-c)/(d-c)*(h-r)<n&&(o=!o)}return o}var d=i(90708),p=i(92722),m=i(51441),f=i(31464);const y="unsupported-query",g={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}},_={esriSpatialRelIntersects:()=>Promise.all([i.e(9192),i.e(3299),i.e(7360)]).then(i.bind(i,55284)),esriSpatialRelContains:()=>Promise.all([i.e(9192),i.e(3299),i.e(1867)]).then(i.bind(i,29127)),esriSpatialRelCrosses:()=>Promise.all([i.e(9192),i.e(3299),i.e(9700)]).then(i.bind(i,85672)),esriSpatialRelDisjoint:()=>Promise.all([i.e(9192),i.e(3299),i.e(1598)]).then(i.bind(i,7978)),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(9192),i.e(3299),i.e(1414)]).then(i.bind(i,46178)),esriSpatialRelTouches:()=>Promise.all([i.e(9192),i.e(3299),i.e(2503)]).then(i.bind(i,83547)),esriSpatialRelWithin:()=>Promise.all([i.e(9192),i.e(3299),i.e(9265)]).then(i.bind(i,85445)),esriSpatialRelRelation:null};async function x(e,t,i,s,o){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Ye)(new p.A,t,!1,!1);return t=>function(e,t,i,s){return c(e,!1,!1,s.coords[0],s.coords[1])}(e,0,0,t)}if("esriGeometryMultipoint"===i){const i=(0,d.Ye)(new p.A,t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,!1,!1,e,s,o)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,r.qz)(t,(0,m.pL)(i,s,o,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,r.rL)(t,(0,m.pL)(i,s,o,e));if("esriSpatialRelIntersects"===e){const e="mesh"===(l=i)?n.xB:(0,n.xK)(l);return r=>e(t,(0,m.pL)(i,s,o,r))}}var l;"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const h=await function(e){const t=_[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>h.execute(t,(0,m.pL)(i,s,o,e))}async function T(e,t,i){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return null!=e&&!0===g.spatialRelationship[e]}(r))throw new s.A(y,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(n.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===g.queryGeometry[(0,a.$B)(e)]}(n))throw new s.A(y,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===g.layerGeometry[e]}(t))throw new s.A(y,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,f.Nk)(e.geometry?.spatialReference,e.outSR)}}}function I(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},86420:(e,t,i)=>{i.d(t,{I:()=>n,W:()=>r});var s=i(4718);async function r(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:r,endTimeField:n}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&n)await t.forEach((e=>{const t=i.getAttribute((0,s.zI)(e),r),l=i.getAttribute((0,s.zI)(e),n);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))}));else{const e=r||n;await t.forEach((t=>{const r=i.getAttribute((0,s.zI)(t),e);null==r||isNaN(r)||(a=Math.min(a,r),o=Math.max(o,r))}))}return{start:a,end:o}}function n(e,t,i){if(!t||!e)return null;const{startTimeField:s,endTimeField:r}=e;if(!s&&!r)return null;const{start:n,end:a}=t;if(null===n&&null===a)return null;if(void 0===n&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return s&&r?function(e,t,i,s,r){return null!=s&&null!=r?n=>{const a=e(n,t),o=e(n,i);return(null==a||a<=r)&&(null==o||o>=s)}:null!=s?t=>{const r=e(t,i);return null==r||r>=s}:null!=r?i=>{const s=e(i,t);return null==s||s<=r}:void 0}(o,s,r,n,a):function(e,t,i,s){return null!=i&&null!=s&&i===s?s=>e(s,t)===i:null!=i&&null!=s?r=>{const n=e(r,t);return null!=n&&n>=i&&n<=s}:null!=i?s=>{const r=e(s,t);return null!=r&&r>=i}:null!=s?i=>{const r=e(i,t);return null!=r&&r<=s}:void 0}(o,s||r,n,a)}},5834:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(41366);function h(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,c.K)(u.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],d.prototype,"numBins",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.end",write:{writer:h}}})],d.prototype,"end",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.start",write:{writer:h}}})],d.prototype,"start",void 0),(0,s._)([(0,o.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,s._)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],d);const p=d;d.from=(0,a.dp)(d)},53275:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),r=i(69540),n=i(66552),a=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),u=i(40608),c=i(56507);let h=class extends(r.A.ClonableMixin(a.A)){constructor(e){super(e),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"alias",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"expression",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"field",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],h.prototype,"responseType",void 0),h=(0,s._)([(0,u.$)("esri.rest.support.BinParametersAttributes")],h);const d=h;h.from=(0,c.dp)(h);const p=new n.J({naturalLog:"natural-log",squareRoot:"square-root"});let m=class extends(r.A.ClonableMixin(a.A)){constructor(e){super(e),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"expression",void 0),(0,s._)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],m.prototype,"field",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"firstDayOfWeek",void 0),(0,s._)([(0,o.MZ)({type:String,json:{write:!0}})],m.prototype,"hideUpperBound",void 0),(0,s._)([(0,o.MZ)({type:d,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(e,t)=>{null!=e.field&&(t.splitByField=e.field),null!=e.expression&&(t.splitBy=e.expression),null!=e.alias&&(t.splitByAlias=e.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(e,t)=>new d({field:t.splitByField,expression:t.splitBy,alias:t.splitByAlias})}}})],m.prototype,"splitByAttributes",void 0),(0,s._)([(0,o.MZ)({type:d,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(e,t)=>{null!=e.field&&(t.stackByField=e.field),null!=e.expression&&(t.stackBy=e.expression),null!=e.alias&&(t.stackByAlias=e.alias),null!=e.responseType&&(t.jsonStyle=e.responseType)},overridePolicy(){return{enabled:null!=this.stackByAttributes?.field||null!=this.stackByAttributes?.expression}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(e,t)=>new d({field:t.stackByField,expression:t.stackBy,alias:t.stackByAlias,responseType:t.jsonStyle})}}})],m.prototype,"stackByAttributes",void 0),(0,s._)([(0,l.e)(p)],m.prototype,"transformation",void 0),m=(0,s._)([(0,u.$)("esri.rest.support.BinParametersBase")],m);const f=m},59977:(e,t,i)=>{i.d(t,{A:()=>x});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(69540),h=i(66552),d=i(25482);const p=(0,h.O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends(c.A.ClonableMixin(d.A)){constructor(e){super(e),this.value=null,this.unit=null}};(0,s._)([(0,n.MZ)({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),(0,s._)([(0,o.e)(p)],m.prototype,"unit",void 0),m=(0,s._)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],m);const f=m;function y(e,t,i){(0,r.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function g(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}m.from=(0,a.dp)(m);let _=class extends u.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};(0,s._)([(0,n.MZ)({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>g(t,"end")},write:{writer:y}}})],_.prototype,"end",void 0),(0,s._)([(0,n.MZ)({type:f,json:{name:"parameters",write:!0}})],_.prototype,"interval",void 0),(0,s._)([(0,n.MZ)({type:f,json:{name:"parameters.offset",write:!0}})],_.prototype,"offset",void 0),(0,s._)([(0,n.MZ)({cast:e=>e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>g(t,"start")},write:{writer:y}}})],_.prototype,"start",void 0),(0,s._)([(0,o.e)({dateBin:"date"},{readOnly:!0})],_.prototype,"type",void 0),_=(0,s._)([(0,l.$)("esri.rest.support.DateBinParameters")],_);const x=_;_.from=(0,a.dp)(_)},11440:(e,t,i)=>{i.d(t,{A:()=>h});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275);let c=class extends u.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,s._)([(0,n.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,r.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map((e=>e.getTime())):e,t)}}}})],c.prototype,"boundaries",void 0),(0,s._)([(0,o.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,s._)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],c);const h=c;c.from=(0,a.dp)(c)},60909:(e,t,i)=>{i.d(t,{A:()=>p});var s=i(90237),r=i(93637),n=i(10107),a=i(56507),o=(i(87811),i(44208),i(93223)),l=i(40608),u=i(53275),c=i(41366);function h(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let d=class extends((0,c.K)(u.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,s._)([(0,n.MZ)({json:{name:"parameters.end",write:{writer:h}}})],d.prototype,"end",void 0),(0,s._)([(0,n.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],d.prototype,"interval",void 0),(0,s._)([(0,n.MZ)({json:{name:"parameters.start",write:{writer:h}}})],d.prototype,"start",void 0),(0,s._)([(0,o.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],d.prototype,"type",void 0),d=(0,s._)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],d);const p=d;d.from=(0,a.dp)(d)},41366:(e,t,i)=>{i.d(t,{K:()=>d});var s=i(90237),r=i(66552),n=i(53966),a=i(10107),o=(i(44208),i(87811),i(93223)),l=i(40608);const u=(0,r.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",h="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&h||i&&c||null,t&&i&&n.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==h&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,s._)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,s._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,s._)([(0,o.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,s._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},63076:(e,t,i)=>{i.d(t,{W6:()=>E,Bb:()=>P});var s=i(71511),r=(i(44208),i(53966)),n=i(97768),a=i(61604),o=i(3694),l=i(74887),u=i(36708),c=i(44794),h=i(78659);const d=Symbol("Yield");class p{constructor(){this._tasks=new Array,this._runningTasks=(0,c.v)(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(0===this.length)return d;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,i){return++this._runningTasks.value,new Promise(((s,r)=>this._tasks.push(new m(s,r,e,t,i)))).finally((()=>--this._runningTasks.value))}unshift(e,t,i){return++this._runningTasks.value,new Promise(((s,r)=>this._tasks.unshift(new m(s,r,e,t,i)))).finally((()=>--this._runningTasks.value))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const i=(0,l.G4)(t.signal);if(i&&!t.abortCallback)t.reject((0,l.NK)());else{const s=i?t.abortCallback?.((0,l.NK)()):t.callback(e);(0,l.$X)(s)?s.then(t.resolve,t.reject):t.resolve(s)}}catch(e){t.reject(e)}return!0}cancelAll(){const e=(0,l.NK)();for(const t of this._tasks)if(t.abortCallback){const i=t.abortCallback(e);t.resolve(i)}else t.reject(e);this._tasks.length=0}}class m{constructor(e,t,i,s=void 0,r=void 0){this.resolve=e,this.reject=t,this.callback=i,this.signal=s,this.abortCallback=r}}var f=i(90237),y=i(69622),g=i(10107),_=(i(87811),i(40608));let x=class extends y.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,f._)([(0,g.MZ)()],x.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,f._)([(0,g.MZ)()],x.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),x=(0,f._)([(0,_.$)("esri.views.support.debugFlags")],x);const T=new x;var I,E,S;(S=I||(I={}))[S.ANIMATING=0]="ANIMATING",S[S.INTERACTING=1]="INTERACTING",S[S.IDLE=2]="IDLE",function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e.MAPVIEW_FETCH_QUEUE="mapview fetch queue",e.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",e.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(E||(E={}));const R=new Map([[E.RESOURCE_CONTROLLER_IMMEDIATE,0],[E.RESOURCE_CONTROLLER,4],[E.SLIDE,0],[E.STREAM_DATA_LOADER,0],[E.ELEVATION_QUERY,0],[E.TERRAIN_SURFACE,1],[E.SURFACE_GEOMETRY_UPDATES,1],[E.LOD_RENDERER,2],[E.GRAPHICS_CORE,2],[E.I3S_CONTROLLER,2],[E.POINT_CLOUD_LAYER,2],[E.FEATURE_TILE_FETCHER,2],[E.CLOUDS_GENERATOR,2],[E.OVERLAY,4],[E.STAGE,4],[E.GRAPHICS_DECONFLICTOR,4],[E.FILTER_VISIBILITY,4],[E.SCALE_VISIBILITY,4],[E.FRUSTUM_VISIBILITY,4],[E.POINT_OF_INTEREST_FREQUENT,6],[E.POINT_OF_INTEREST_INFREQUENT,30],[E.LABELER,8],[E.FEATURE_QUERY_ENGINE,8],[E.FEATURE_TILE_TREE,16],[E.FEATURE_TILE_TREE_ACTIVE,0],[E.ELEVATION_ALIGNMENT,12],[E.ELEVATION_ALIGNMENT_SCENE,14],[E.TEXT_TEXTURE_ATLAS,12],[E.TEXTURE_UNLOAD,12],[E.LINE_OF_SIGHT_TOOL,16],[E.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[E.SNAPPING,0],[E.SHADOW_ACCUMULATOR,30],[E.MAPVIEW_FETCH_QUEUE,0],[E.MAPVIEW_LAYERVIEW_UPDATE,2],[E.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,0]]);function F(e){return R.has(e)?R.get(e):"number"==typeof e?e:1}const v=(0,h.l5)(6.5),w=(0,h.l5)(1),A=(0,h.l5)(30),b=(0,h.l5)(1e3/30),M=(0,h.l5)(100);var N,C;!function(e){e.Scheduler=class{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some((e=>e.needsUpdate))}constructor(){this._updating=(0,c.v)(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new a.A("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new i,this._state=I.INTERACTING,this._tasks=new o.A,this._runQueue=new o.A,this._load=0,this._idleStateCallbacks=new o.A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,u.wB)((()=>T.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),u.Vh);for(const e of Object.keys(E))this.performanceInfo.tasks.set(E[e],new a.A(E[e]))}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,n.xt)(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())})))}registerTask(e,i){const s=new t(this,e,i);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new a.A(e)),s}registerIdleStateCallbacks(e,t){const i={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(i),this.state===I.IDLE&&this._idleUpdatesStartFired&&i.idleBegin();const s=this;return{remove:()=>this._removeIdleStateCallbacks(i),set idleBegin(e){s._idleUpdatesStartFired&&(i.idleEnd(),s._state===I.IDLE&&e()),i.idleBegin=e},set idleEnd(e){i.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==I.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return this._state}frame(e){this._startFrameTaskTimes();const t=this._updateBudget(e);if(t){const e=this._budget.now();this._runFrame(),this._recordFrameTaskTimes(this._budget.now()-e)}else this._recordFrameTaskTimes(0);return t}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=v,i=e.frameDuration,s=w;switch(this.state){case I.IDLE:t=(0,h.l5)(0),i=(0,h.l5)(Math.max(M,e.frameDuration)),s=A;break;case I.INTERACTING:i=(0,h.l5)(Math.max(b,e.frameDuration));case I.ANIMATING:}return i=(0,h.l5)(i-e.elapsedFrameTime-t),this.state!==I.IDLE&&i<w&&!this._forceTask?(this._forceTask=!0,!1):(i=(0,h.l5)(Math.max(i,s)),this._budget.reset(i,this.state),this._updateLoad(),this._schedule())}_runFrame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case I.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case I.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset((0,h.l5)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return C.SCHEDULED;let t=C.IDLE;return this._tasks.forAll((i=>{i.name===e&&i.needsUpdate&&(i.schedulePriority<=1?t=C.READY:t!==C.READY&&(t=C.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((i=>{i.name===e&&(t+=i.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,i)=>{t+=e>1?` ${e}x ${i}`:` ${i}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((i=>{i.needsUpdate&&0!==i.schedulePriority&&0!==i.basePriority&&i.blockFrame!==this._frameNumber&&(e=!0,t=Math.max(t,i.basePriority),1===i.schedulePriority?(i.schedulePriority=0,this._runQueue.push(i)):--i.schedulePriority)})),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const e=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===d&&(t.blockFrame=this._frameNumber)}catch(e){r.A.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,e),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,E.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const i=this._budget.now()-e;if(t.runtime+=i,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+i),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(E))this._frameTaskTimes.set(E[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).push(e))),this.performanceInfo.total.push(e)}get test(){return this._test}};class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,t,i){this._scheduler=e,this.name=t,this.blockFrame=0,this.runtime=0,this._queue=new p,this._handles=new s.A,this._basePriority=F(t),this.schedulePriority=this._basePriority,this._task=(0,c.v)(null!=i?i:this._queue),this._handles.add((0,u.z7)((()=>this.task.running),(t=>e.taskRunningChanged(t))))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=F(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,i){return this._queue.push(e,t,i)}reschedule(e,t,i){return this._queue.unshift(e,t,i)}processQueue(e){return this._queue.runTask(e)}}class i{constructor(){this._begin="undefined"!=typeof performance?performance.now():0,this._budget=0,this._state=I.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}e.Budget=i}(N||(N={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(C||(C={}));const P=(()=>{const e=new N.Budget;return e.enabled=!1,e})(),O=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,l.G4)(t)){const e=(0,l.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,l.z7)(e(P))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}}}}]);
|