@arcgis/core 5.2.0-next.81 → 5.2.0-next.82
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{88d6a7ebded4d359deb0.js → 027af54888befb209aaa.js} +1 -1
- package/assets/esri/core/workers/chunks/{694216224d5fd3a8956d.js → 04f5ff688785a4bd3b03.js} +1 -1
- package/assets/esri/core/workers/chunks/{578904043e873424904c.js → 0d982abff7c9496f7890.js} +1 -1
- package/assets/esri/core/workers/chunks/{3adba34224cba869a39c.js → 10ac92dcd3738ec23dfb.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a537054c99cbc492715.js → 11d911f70bf0ca252c19.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f3525df00fb265661fc.js → 1352b5c6767e5421bc02.js} +1 -1
- package/assets/esri/core/workers/chunks/1354b8442c2c501238f1.js +1 -0
- package/assets/esri/core/workers/chunks/{8cfe817299eb16cb2664.js → 1438f571f738e83b4d1c.js} +1 -1
- package/assets/esri/core/workers/chunks/{efd176c5ac35f313e7a2.js → 14469f664fd5ede469fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfd532e33800755b1f48.js → 14511c92cbbc26d80c86.js} +1 -1
- package/assets/esri/core/workers/chunks/{fbb0b2f4ec0ba458ddeb.js → 19dac19122eeeb5e36b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f71a3fe5f30aa782193a.js → 20db27d9828397d0b37a.js} +1 -1
- package/assets/esri/core/workers/chunks/{b3081c0b037abc49d09b.js → 26c12804a0d801df29bf.js} +1 -1
- package/assets/esri/core/workers/chunks/{8006ffa263fb8016afdb.js → 26c8ed0aef59ed6d5267.js} +1 -1
- package/assets/esri/core/workers/chunks/2d1c0d80a9843567df8d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b79b376b0d60d2f0d5c.js → 2d6e1bf7c1981bed4357.js} +1 -1
- package/assets/esri/core/workers/chunks/{7028671ffdaafe2725bc.js → 33aaa5a49e396a0aca47.js} +1 -1
- package/assets/esri/core/workers/chunks/{d1baf17f3219f70106f7.js → 34f6093d2c00e3584037.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfac0f47e81055585002.js → 3f0625c31dd46b563160.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a5894e8ebdf0e97b98f.js → 43122c435497228a7583.js} +1 -1
- package/assets/esri/core/workers/chunks/{8fff4a41a54d39db470a.js → 44d13f65465646e5f6e9.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c17bfbfc347ac289b6e.js → 463b7952a4825541eb13.js} +1 -1
- package/assets/esri/core/workers/chunks/{540a3685e614bb006744.js → 469e72ab6cd44272f474.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ed6a8bb415999c4e8a6.js → 4cf2c33494cb75942511.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c372d85b5783dd2a793.js → 52042fd36f4a572938f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8b38c196b06e801c4e6.js → 563a4d6788ad66b676e4.js} +1 -1
- package/assets/esri/core/workers/chunks/598221c7054415b84904.js +1 -0
- package/assets/esri/core/workers/chunks/{89df303abcbc0167e4d2.js → 5a006ff759fad9fc25cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{40ebe69b08ea54e0e780.js → 5b60fc95757b2a53558a.js} +1 -1
- package/assets/esri/core/workers/chunks/{c336f300fe6100e36592.js → 5c634b3e6dc76299b1df.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a67bd724aa7fcdebe16.js → 5d30accf1dcda0c70f95.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d16d53643dd8d489c25.js → 605da92d28e067f4a4c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{5c9a398e659ecd427fb5.js → 657528eb6a3d3b3cb631.js} +1 -1
- package/assets/esri/core/workers/chunks/{d845f2115848b56c0369.js → 66292e98b4111ea3658d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f57e5e7d0748d9a370f7.js → 680496660b2aaa710099.js} +1 -1
- package/assets/esri/core/workers/chunks/6c389e9646a48c26da20.js +2 -0
- package/assets/esri/core/workers/chunks/{fbcc346fa603d6edac98.js → 6db4a4f9a9ce7cc738d0.js} +1 -1
- package/assets/esri/core/workers/chunks/{a9e944f28bd573c8230d.js → 6eb28086dc28f6d144ec.js} +1 -1
- package/assets/esri/core/workers/chunks/7bd8ebb321ecf1f06496.js +1 -0
- package/assets/esri/core/workers/chunks/{d0aaa4ad7f76f577f117.js → 7d5877eede2f552dea9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf5831a7c12b1e42c669.js → 83a77d3f45c8c21cec45.js} +1 -1
- package/assets/esri/core/workers/chunks/{dcec7fc66385c12ecdf0.js → 865f9adc591056458b6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d62a5a33a24418a3e283.js → 88771a75adcbd54c4fac.js} +1 -1
- package/assets/esri/core/workers/chunks/{37fb38db03cb39e3c342.js → 8c6a60d96c73982febd2.js} +1 -1
- package/assets/esri/core/workers/chunks/{6065caa7981cef255277.js → 911f3a1b8dd4bc5c9782.js} +1 -1
- package/assets/esri/core/workers/chunks/{70c371c9f133ab9f7925.js → 918577ea025f67ebe372.js} +1 -1
- package/assets/esri/core/workers/chunks/99966339b061eb9945b8.js +1 -0
- package/assets/esri/core/workers/chunks/{9bd4cda90daf90189bfc.js → a2fd945659ce052f99d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{74cd17aca5f7e0caac90.js → a9a1061cdf82b372835f.js} +1 -1
- package/assets/esri/core/workers/chunks/ab10388dcc17a665ac3b.js +2 -0
- package/assets/esri/core/workers/chunks/ac9a3dfd02160e43fc8a.js +2 -0
- package/assets/esri/core/workers/chunks/{82da6d98bd4980a3d454.js → af88f8dd1a53e4740aa6.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2448e26e19005ef9ab2.js → b09e9ac5fd928e69b053.js} +1 -1
- package/assets/esri/core/workers/chunks/{61190c833791f0833a39.js → b7bcc2d0b0fa8e703c83.js} +1 -1
- package/assets/esri/core/workers/chunks/{37a121316d114999ac70.js → ba67aaa08e4f11e1140a.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d50a030bf9f4e94f69d.js → bbeb61d9302323bae9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{dbca32f0e0c2c2e2ccf3.js → bd1c870694edd25bf8aa.js} +1 -1
- package/assets/esri/core/workers/chunks/c1f125594e684c1b4ffc.js +1 -0
- package/assets/esri/core/workers/chunks/{d4b78d11a5ce4320a29a.js → c456abf5ee2a1ad5cc5b.js} +1 -1
- package/assets/esri/core/workers/chunks/{61312d3b5477ed9d87d9.js → c61e94806b37ca3dd549.js} +2 -2
- package/assets/esri/core/workers/chunks/{e72fa08b0bd324514a0e.js → c8d83f71326222b98608.js} +1 -1
- package/assets/esri/core/workers/chunks/{09f0805b32e6cab980e6.js → cc1a00694cc9f7c606d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{e8a9a686a3c23afc9d1f.js → cdd4aeaa3f30bc4ea93a.js} +1 -1
- package/assets/esri/core/workers/chunks/{eca0736953a20cfc64ad.js → d0c8630177d3a4e316f1.js} +2 -2
- package/assets/esri/core/workers/chunks/{bc30c0de6dcb106b24a1.js → da233362b06b6db375f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce81f29134ab3971bd54.js → dd91824692bec809909c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f9e9e79f78be32e5d475.js → e706c37b44e98fbcb5f7.js} +1 -1
- package/assets/esri/core/workers/chunks/{856dba96332509fb1d7a.js → ead4143d811aab610e00.js} +2 -2
- package/assets/esri/core/workers/chunks/ef269dd559c1c79957e5.js +1 -0
- package/assets/esri/core/workers/chunks/{4a6158994a8cc8b8664f.js → f0692e10af5983f6ad93.js} +1 -1
- package/assets/esri/core/workers/chunks/{fae32c9ce811934b6a64.js → f248131df4eaa5291623.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c15551e33a3c6cda61d.js → f762f0f6c83748d8e328.js} +1 -1
- package/assets/esri/core/workers/chunks/{4eaa93859ceec1b38530.js → fa29b5064d6626cfc019.js} +1 -1
- package/assets/esri/core/workers/chunks/{a3cbd3e983e21f40b253.js → faf14281a74a06fa1f30.js} +1 -1
- package/assets/esri/core/workers/chunks/fcf7299e2ee904ab9882.js +1 -0
- package/assets/esri/core/workers/chunks/{388b71211a0ad5cbd6b9.js → fe06cc2f90b2d551e4c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{86035e46777ed896c658.js → ffad5fd9c5e98f4fe2c3.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/chunks/Bufferer-CclWhXVb.js +1 -1
- package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
- package/chunks/EmissionComposite.glsl.js +7 -1
- package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
- package/chunks/GeodeticUtils.js +1 -1
- package/chunks/GeographicTransformation.js +2 -0
- package/chunks/Geometry.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorCrosses.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorGraphicBuffer.js +1 -1
- package/chunks/OperatorIntegrate.js +1 -1
- package/chunks/OperatorIntersects.js +1 -1
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +1 -1
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/OperatorSimplifyOGC.js +1 -1
- package/chunks/OperatorTouches.js +1 -1
- package/chunks/OperatorWithin.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/SideCalculator2D-DX0718xq.js +1 -1
- package/chunks/UnitFactory.js +1 -1
- package/chunks/containsOperator.js +1 -1
- package/chunks/disjointOperator.js +1 -1
- package/chunks/equalsOperator.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/relateOperator.js +1 -1
- package/config.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/json/containsOperator.js +1 -1
- package/geometry/operators/json/disjointOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/support/GeographicTransformation.d.ts +7 -0
- package/geometry/operators/support/GeographicTransformation.js +1 -1
- package/geometry/operators/support/GeographicTransformationStep.d.ts +7 -1
- package/geometry/operators/support/GeographicTransformationStep.js +1 -1
- package/geometry/operators/support/geographicTransformationUtils.d.ts +13 -2
- package/geometry/operators/support/geographicTransformationUtils.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/operators/support/projectionTransformation.js +1 -1
- package/kernel.js +1 -1
- package/layers/raster/types.d.ts +1 -1
- package/layers/support/AggregateField.d.ts +9 -3
- package/layers/support/FeatureReductionCluster.d.ts +16 -6
- package/layers/support/I3SExtractChanges.js +2 -0
- package/package.json +3 -3
- package/renderers/support/AuthoringInfo.d.ts +8 -3
- package/support/revision.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
- package/views/MapView.d.ts +0 -60
- package/views/View2D.d.ts +59 -1
- package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/assets/esri/core/workers/chunks/453c69879f4b82ba13a1.js +0 -1
- package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +0 -1
- package/assets/esri/core/workers/chunks/95b9eaf7a49eeb17e62f.js +0 -1
- package/assets/esri/core/workers/chunks/973440553c9e058b0132.js +0 -1
- package/assets/esri/core/workers/chunks/c5853fbb975e169c44c5.js +0 -1
- package/assets/esri/core/workers/chunks/e2473de49189d93714d3.js +0 -1
- package/assets/esri/core/workers/chunks/e63f94c8097555b266ad.js +0 -2
- package/assets/esri/core/workers/chunks/f2d99f693a590f384315.js +0 -1
- package/assets/esri/core/workers/chunks/fc2234e0d202631f3abf.js +0 -2
- package/assets/esri/core/workers/chunks/fcb943c3b31b1bf62e65.js +0 -2
- /package/assets/esri/core/workers/chunks/{61312d3b5477ed9d87d9.js.LICENSE.txt → 6c389e9646a48c26da20.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{e63f94c8097555b266ad.js.LICENSE.txt → ab10388dcc17a665ac3b.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fc2234e0d202631f3abf.js.LICENSE.txt → ac9a3dfd02160e43fc8a.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{fcb943c3b31b1bf62e65.js.LICENSE.txt → c61e94806b37ca3dd549.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{eca0736953a20cfc64ad.js.LICENSE.txt → d0c8630177d3a4e316f1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{856dba96332509fb1d7a.js.LICENSE.txt → ead4143d811aab610e00.js.LICENSE.txt} +0 -0
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type Extent from "../../Extent.js";
|
|
14
14
|
import type SpatialReference from "../../SpatialReference.js";
|
|
15
15
|
import type GeographicTransformation from "./GeographicTransformation.js";
|
|
16
|
+
import type GeographicTransformationStep from "./GeographicTransformationStep.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Indicates if all dependencies of this module have been loaded.
|
|
@@ -48,6 +49,7 @@ export function load(): Promise<void>;
|
|
|
48
49
|
* @param outSpatialReference - The spatial reference to which you are converting the geometries.
|
|
49
50
|
* @param areaOfInterestExtent - An extent used to determine the suitability of the returned transformation.
|
|
50
51
|
* The extent's spatial reference should be the same as `inSpatialReference`.
|
|
52
|
+
* @param returnUnusable - todoc
|
|
51
53
|
* @returns Returns the default geographic transformation for the given parameters.
|
|
52
54
|
* If no transformation is required or there are no suitable transformations, then `null` is returned.
|
|
53
55
|
* @example
|
|
@@ -73,7 +75,7 @@ export function load(): Promise<void>;
|
|
|
73
75
|
*
|
|
74
76
|
* const geogtrans = projection.getTransformation(cs1, cs2, extent);
|
|
75
77
|
*/
|
|
76
|
-
export function getTransformation(inSpatialReference: SpatialReference, outSpatialReference: SpatialReference, areaOfInterestExtent?: Extent | null): GeographicTransformation | null | undefined;
|
|
78
|
+
export function getTransformation(inSpatialReference: SpatialReference, outSpatialReference: SpatialReference, areaOfInterestExtent?: Extent | null, returnUnusable?: boolean): GeographicTransformation | null | undefined;
|
|
77
79
|
|
|
78
80
|
/**
|
|
79
81
|
* Returns a list of all equation-based, geographic transformations suitable to convert geometries from the input spatial reference
|
|
@@ -92,6 +94,7 @@ export function getTransformation(inSpatialReference: SpatialReference, outSpati
|
|
|
92
94
|
* @param outSpatialReference - The spatial reference to which you are converting the geometries to.
|
|
93
95
|
* @param areaOfInterestExtent - An extent used to help pick the correct transform.
|
|
94
96
|
* The extent's spatial reference should be the same as `inSpatialReference`.
|
|
97
|
+
* @param returnUnusable - todoc
|
|
95
98
|
* @returns Returns an array containing the maximum number the suitable
|
|
96
99
|
* geographic transformations that can be used to convert geometries between input and output spatial references.
|
|
97
100
|
* The list will be empty if the provided extent lies out of the area of use for the input spatial reference, or if no transformation is required, or there are no suitable transformations.
|
|
@@ -123,4 +126,12 @@ export function getTransformation(inSpatialReference: SpatialReference, outSpati
|
|
|
123
126
|
* });
|
|
124
127
|
* });
|
|
125
128
|
*/
|
|
126
|
-
export function getTransformations(inSpatialReference: SpatialReference, outSpatialReference: SpatialReference, areaOfInterestExtent?: Extent | null): GeographicTransformation[];
|
|
129
|
+
export function getTransformations(inSpatialReference: SpatialReference, outSpatialReference: SpatialReference, areaOfInterestExtent?: Extent | null, returnUnusable?: boolean): GeographicTransformation[];
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* todoc
|
|
133
|
+
*
|
|
134
|
+
* @param transform - todoc
|
|
135
|
+
* @since 5.2
|
|
136
|
+
*/
|
|
137
|
+
export function isTransformationUsable(transform: GeographicTransformation | GeographicTransformationStep): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{l as
|
|
2
|
+
import{l as e,p as n,i as t}from"../../../chunks/pe.js";import r from"./GeographicTransformation.js";import s from"./GeographicTransformationStep.js";let o,i,a,c,u,l;function f(){return!!a&&t()}async function m(){if(!f()){const[t,r,s,f,m]=await Promise.all([import("../../../chunks/GeographicTransformation.js").then(({create:e,createFromWKT:n})=>({create:e,createFromWKT:n})),import("../../../chunks/Envelope2D.js"),import("../../../chunks/ProjectionTransformation.js").then(({queryTransformationList:e})=>e),import("../../../chunks/SpatialReference.js").then(({injectPe:e})=>e),import("./apiConverter.js"),e()]);o=t.create,i=t.createFromWKT,u=r.Envelope2D.construct,l=r.Envelope2D.constructEmpty(),a=s,f(n),c=m.fromSpatialReference}}function p(e,n,t=null,r=!1){const s=t?k(t):l,o=a(0,c(e),c(n),s,1,!r);return o.length>0?g(o[0]):null}function h(e,n,t=null,r=!1){const s=t?k(t):l;return a(0,c(e),c(n),s,0,!r).map(e=>g(e))}function j(e){if(null!=e.isUsable)return e.isUsable;let n=!0;const t=e instanceof r?e.steps:[e];for(const r of t){if(null==r.isUsable){const e=r.wkid?o(r.wkid,r.isInverse):i(r.wkt,r.isInverse);r.isUsable=!e.referencesMissingData()}n&&=r.isUsable}return n}function k(e){return u(e.xmin,e.ymin,e.xmax,e.ymax)}function g(e){const n=new r;for(let t=0;t<e.count();t++){const r=e.getStep(t);n.steps.push(new s({wkid:r.getID(),isInverse:r.isInverted(),isUsable:!r.referencesMissingData()}))}return n}export{p as getTransformation,h as getTransformations,f as isLoaded,j as isTransformationUsable,m as load};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{constructFromFlatGeometry as e}from"../../../chunks/FlatGeometry.js";import{d as t,a as n,g as r,r as i,q as s,G as a,t as o}from"../../../chunks/Geometry.js";import{aL as u,i as m,d as l,b as c,aM as d,P as _,m as h}from"../../../chunks/Point2D.js";import{q as f,b as p,p as k,aX as b,c as y,e as T,a as N,f as g,aY as v}from"../../../chunks/UnitFactory.js";import{a2 as x,a5 as A,P as S,E as w,a0 as C,a1 as D,a6 as F,a7 as j,X as O}from"../../../chunks/Envelope.js";import{P as z,a as I,S as E,M as P,J as B,a5 as V,a6 as R,a7 as M,a8 as U,a9 as W}from"../../../chunks/MultiPathImpl.js";import{convertGeometryxToFlat as X,convertFlatToGeometryJSON as G,convertGeometryToFlat as L}from"../../FlatGeometry.js";import Y from"../../SpatialReference.js";import"./initNoPeFactory.js";import{isPoint as q,isMultipoint as K,isPolyline as J,isPolygon as Q}from"../../support/jsonTypeUtils.js";function Z(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function H(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class ${m_iteratorStack;m_nextFlatToken;m_currentToken=0;m_currentValue;m_options;createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:Z}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:H}}constructor(e,t){this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=u()&&this.m_currentValue<=m()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;t("unrecognized json element type")}t("unrecognized json element type")}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentInt64Value(){return r(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&n("invalid token"),this.m_currentValue}isError(){return 0}}class ee{m_pendingKey=null;m_acceptedObject=null;m_currentObject=[];reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){r(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class te{m_buffer=null;m_view=null;m_sz=0;m_offset=0;m_bOwnsBuffer=!0;m_bLittleEndian=!0;m_element;m_elementBytes;m_elementView;m_elementDouble;m_elementFloat;m_elementInt64;m_elementInt32;m_elementInt16;constructor(e){return this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&i("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&i("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void t("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===te.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===te.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||s("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){r(e>=0&&e<=this.m_sz),this.m_sz=e}}function ne(e,t,i,s,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,T=!1,N=!1,g=!1,v=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,V=Number.NaN,R=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,G=Number.NaN,L=Number.NaN,Y=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Q=0,Z=0,H=!1,$=!1,ee=null,te=null,ne=null,re=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?re=ie(i):10!==i.currentToken()&&n("failed to parse spatial reference: object or null is expected");continue}}else if(s)if("hasZ"===u){if(!l){l=!0,H=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,$=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==a.enumUnknown&&e!==a.enumPolygon)){_=!0,({geometry:ce,as:ee,bs:te}=se(!0,!1,t,i));continue}}else if("curveRings"===u){if(!h&&(e===a.enumUnknown||e===a.enumPolygon)){h=!0,({geometry:ce,as:ee,bs:te}=se(!0,!0,t,i));continue}}else if("paths"===u){if(!(f||p||e!==a.enumUnknown&&e!==a.enumPolyline)){f=!0,({geometry:ce,as:ee,bs:te}=se(!1,!1,t,i));continue}}else if("curvePaths"===u){if(!p&&(e===a.enumUnknown||e===a.enumPolyline)){p=!0,({geometry:ce,as:ee,bs:te}=se(!1,!0,t,i));continue}}else if("points"===u){if(!k&&(e===a.enumUnknown||e===a.enumMultiPoint)){k=!0,({geometry:ce,as:ee,bs:te}=ae(t,i));continue}}else if("ids"===u){if(!d){d=!0,ne=oe(t,i);continue}}else if("x"===u){if(!b&&(e===a.enumUnknown||e===a.enumPoint)){b=!0,B=ue(i);continue}}else if("y"===u){if(!y&&(e===a.enumUnknown||e===a.enumPoint)){y=!0,V=ue(i);continue}}else if("z"===u){if(!T&&(e===a.enumUnknown||e===a.enumPoint)){T=!0,R=ue(i);continue}}else if("m"===u){if(!N&&(e===a.enumUnknown||e===a.enumPoint)){N=!0,M=ue(i);continue}}else if("id"===u){if(!g&&(e===a.enumUnknown||e===a.enumPoint)){g=!0,U=me(i);continue}}else if("xmin"===u){if(!v&&(e===a.enumUnknown||e===a.enumEnvelope)){v=!0,W=ue(i);continue}}else if("ymin"===u){if(!C&&(e===a.enumUnknown||e===a.enumEnvelope)){C=!0,X=ue(i);continue}}else if("mmin"===u){if(!z&&(e===a.enumUnknown||e===a.enumEnvelope)){z=!0,K=ue(i);continue}}else if("zmin"===u){if(!j&&(e===a.enumUnknown||e===a.enumEnvelope)){j=!0,Y=ue(i);continue}}else if("idmin"===u){if(!E&&(e===a.enumUnknown||e===a.enumEnvelope)){E=!0,Q=me(i);continue}}else if("xmax"===u){if(!D&&(e===a.enumUnknown||e===a.enumEnvelope)){D=!0,G=ue(i);continue}}else if("ymax"===u){if(!F&&(e===a.enumUnknown||e===a.enumEnvelope)){F=!0,L=ue(i);continue}}else if("mmax"===u){if(!I&&(e===a.enumUnknown||e===a.enumEnvelope)){I=!0,J=ue(i);continue}}else if("zmax"===u){if(!O&&(e===a.enumUnknown||e===a.enumEnvelope)){O=!0,q=ue(i);continue}}else if("idmax"===u){if(!P&&(e===a.enumUnknown||e===a.enumEnvelope)){P=!0,Z=me(i);continue}}else"materials"===u&&r(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;H&&(ce.addAttribute(1),e=ee,e||(e=x(n.getPointCount(),Number.NaN))),$&&(ce.addAttribute(2),t=H?te:ee),null!=ne&&ce.addAttribute(3),H&&null!=e&&n.setAttributeStreamRef(1,e),$&&null!=t&&n.setAttributeStreamRef(2,t),null!=ne&&le(n,ne)}else if(b||y||N||T||g){A(B,V)||n("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const e=new S({x:B,y:V});T&&e.setZ(R),N&&e.setM(M),g&&e.setID(U),ce=e}else if(v||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(G)||Number.isNaN(L))&&(W=Number.NaN);const e=new w({xmin:W,ymin:X,xmax:G,ymax:L});j&&O&&e.setInterval(1,0,Y,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,Q,Z),ce=e}return{...ce?{geom:ce}:{},...re?{sr:re}:{}}}function re(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function ie(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,V=0,R=0,M="",U="",W=null;for(;3!==e.nextToken();){const f=e.currentString();e.nextToken(),"wkid"===f?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===f?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===f?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===f?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===f?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===f?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===f?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===f?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===f?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===f?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===f?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===f?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===f?_||(_=!0,a=!0,R=e.currentDoubleValue()):"xyUnits"===f?h||(h=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===f?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===f?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===f?A||(A=!0,W=re(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,G=!0;if(0!==M.length&&(G=!1,f(M)&&(X=p(M))),X||0===U.length||(G=!1,f(U)&&(X=p(U))),!X&&w>0&&(G=!1,k(w)&&(D<=0||b())&&(X=y(w,D))),!X&&S>0&&(G=!1,k(S)&&(C<=0||b())&&(X=y(S,C))),G&&(X=T(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),h&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(V,I),x&&_&&e.setMParams(R,E),X=g(X,e)}return X}function se(e,t,r,i){2!==i.currentToken()&&n("failed to parse multipath: array of array of vertices is expected");const s=e?new z:new I,a=s,o=C(0),u=x(2,0),m=D(0);let h=null,f=null,p=null,k=null,b=null,y=0,T=0,N=0;const g=new E,v=_.getNAN();let A=0,S=0;const w=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&n("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=_.getNAN(),P=l(O,Number.NaN),B=l(O,Number.NaN);let V=!1;for(i.nextToken();4!==i.currentToken();){if(t&&1===i.currentToken())j&&n("failed to parse multipath: starting vertex array is expected"),p||(p=D(A-1,1),k=C(A-1,-1),b=x(0)),V=!0,r=1,({segFlag:N,toPointSz:z}=ke(g,P,v,i));else{for(V=!1,2!==i.currentToken()&&n("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&n("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ue(i);z<2&&n("failed to parse multipath: each vertex array has to have at least 2 elements"),F(P[0],P[1])||n("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(ce(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(de(A)),z>2?(h||(h=x(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(de(A)),z>3?(f||(f=x(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),m.add(w),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(V){const e=W(N),t=b.size();b.resize(t+e),p.add(N),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(N,1),T++}else p.add(1),k.add(-1);A++,s++,v.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),m.resize(S),A>0&&(o.add(A),m.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(m),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(T),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function ae(e,t){2!==t.currentToken()&&n("failed to parse multipoint: array of vertices is expected");let r=0;const i=new P,s=x(2,0);let a=0;const o=4,u=l(o,Number.NaN),m=new _;let c=null,d=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&n("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==t.nextToken();)a===o&&n("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ue(t);a<2&&n("failed to parse multipoint: each vertex array has to have at least 2 elements"),F(u[0],u[1])||n("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(ce(r)),s.writePoint2D(2*r,m.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(de(r)),a>2?(c||(c=x(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(de(r)),a>3?(d||(d=x(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function oe(e,t){2!==t.currentToken()&&n("failed to parse array of IDs: array of array of integers is expected");const r=j(2,0);let i=0,s=-1;for(;4!==t.nextToken();){const e=i;r.size()===i&&r.resize(de(i)),i++;let a=0;for(-1===s?s=2===t.currentToken()?1:0:1===s&&2!==t.currentToken()&&n("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(de(i)),r.write(i,me(t)),a++,i++);4!==t.nextToken();)r.size()===i&&r.resize(de(i)),r.write(i,me(t)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ue(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function me(e){return e.currentInt32Value()}function le(e,n){if(e.isEmpty())return;const r=j(2,0),i=e.getGeometryType();let s=0;i===P.type?s=1:i===I.type||i===z.type?s=e.getPathCount():t("not implemented"),r.resize(e.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===P.type?m=e.getPointCount():i===I.type||i===z.type?(m=e.getPathSize(o),l=e.getPathStart(o)):t("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}e.getImpl().setAttributeStreamRef(3,r)}function ce(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function de(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function _e(e,t,n,r,s){s>=r.size()&&i("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=_.getNAN();a.x=r.readDouble(s),a.y=r.readDouble(s+8);const o=r.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let l=!!(32&o);const c=!!(8&o),d=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,l=!0),l&&h&&(u=!0,l=!1,a.setCoords(0,0)),u||(m?l?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&c===e.isClockwise()&&e.reverse()):l?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):M(e,t,n,a,c,d)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,U(e,Number.NaN,c,d),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function he(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,U(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function fe(e,t,n,i,s){return r(s+32<=i.size()),e.m_cp=h(_,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function pe(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ke(e,t,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&n('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&n("failed to parse curve: vertex array cannot have more than 4 elements"),t[a.toPointSz++]=ue(i);a.toPointSz<2&&n("failed to parse curve: vertex array must have at least 2 elements");const l=_.construct(t[0],t[1]),c=_.getNAN();let d=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[_.getNAN(),_.getNAN(),_.getNAN()],T=_.getNAN();if("a"===m){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for center point"),c.setCoords(e,t),o=i.nextToken(),d=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ue(i),o=i.nextToken(),k=ue(i),o=i.nextToken(),b=ue(i),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[e].setCoords(t,r)}o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,t)}o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);y[1].setCoords(e,t),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[e].setCoords(t,r)}o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for interior point"),T.setCoords(e,t),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&n("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;be(e.get(),r,l,c,t,d,h)}else ye(e.get(),r,l,c,d,h,p,k,b);else if("b"===m)e.createCubicBezier(),Te(e.get(),r,l,y);else if("n"===m)e.createQuadraticRationalBezier(),Ne(e.get(),r,l,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],l);else{e.createEllipticArc();const t=!1;be(e.get(),r,l,T,t,-1,-1)}return a}function be(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new te({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,_e(e,t,n,m,0)}function ye(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new te({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,he(e,t,n,c,0)}function Te(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new te({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,fe(e,t,n,a,0)}function Ne(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new te({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,pe(e,t,n,m,0)}function ge(e,t,n,r,i){const s=e.getGeometryType();if(s===a.enumEllipticArc)return ve(e,t,n,r,i);if(s===a.enumBezier)return xe(e,t,n,r,i);if(s===a.enumRationalBezier2)return Ae(e,t,n,r,i);if(s===a.enumBezier2){const s=new B;return s.constructFromQuadraticSegment(e),xe(s,t,n,r,i)}o("")}function ve(e,t,n,i,s){r(!V(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!n;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return Se(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s),we(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;we(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s);const t=e;we(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function xe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),Se(a,o,s.x,s.y,u,m,r,i),we(e.m_cp[0].x,e.m_cp[0].y,r,i),we(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function Ae(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),Se(a,o,s.x,s.y,u,m,r,i),we(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function we(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ce{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){De(e,t,n,r)}exportSpatialReference(e,t,n,i){r(0)}exportProjectionTransformation(e,t,n,i){r(0)}exportDatumTransformation(e,t,n,i){r(0)}static geometryTypeToString(e){return r(0),""}}function De(e,n,i,s,o){if(n||i){if(s.startObject(),null!==n){switch(n.getGeometryType()){case a.enumPolygon:Fe(!0,e,n,s);break;case a.enumPolyline:Fe(!1,e,n,s);break;case a.enumMultiPoint:je(e,n,s);break;case a.enumPoint:Oe(e,n,s);break;case a.enumEnvelope:ze(e,n,s);break;case a.enumMultipatch:r(0);break;default:t("exportToJSON")}}null!==i&&(s.addFieldName("spatialReference"),Ee(e,i,s)),s.endObject()}}function Fe(e,t,n,i){const s=n.getImpl(),a=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!a,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const r=n.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const T=new E;let N=null,g=null,v=null;_&&(N=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=O(3,0));for(let t=0;t<r;t++){i.startArray(),d&&f.push(0);const r=n.getPathEnd(t);if(m===r){i.endArray();continue}const s=n.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Pe(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,V=0;for(let t=m+1,n=m,R=s?r+1:r;t<R;t++,n++){const s=null!==N?31&N.read(n):1;let m,R;if(t<r?(m=p.read(2*t),R=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(V=y.read(t))):(m=D,R=F,P=j,B=O,V=z),1!==s){I=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():o("JSON export.unsupported curve");const t=T.get(),r=g.read(n);t.setStartXYCoords(_,x),t.setEndXYCoords(m,R),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,r);ge(T.get(),a,u,e,i)&&E++}else Pe(l,c,m,R,P,B,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=R,A=P,S=B,w=V}I&&0===E||(C<2&&E<1&&(Pe(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Pe(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=r}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=f.length;t<n;++t){const n=f[t];r(0===n||null!==h&&e+n<=h.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function je(e,t,n){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(n.addFieldName("hasZ"),n.addBool(!0)),a&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Pe(s,a,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),r(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}function Oe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ze(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Ie(e,t,r){r.startObject();const i=t.getID();i<=0&&n("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ee(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Ie(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Be={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ve{m_jsonString;m_endToken;m_startToken;m_currentTokenType;m_bHasEscapes;m_functionStack=[];m_pushPositions=[];m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0});m_prepSubstr;m_getCurrentSubstr;m_stepOverChar;m_peekChar;m_get;m_increment;m_eof;constructor(e){void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?o("streaming json parsing not yet impl"):t("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){o("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){o("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return r(0),""}childrenAsString(){return r(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}n("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Be.s_backslash&&t.charCodeAt(r+1)===Be.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Be.s_backslash&&t.charCodeAt(r+1)===Be.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Be.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Be.s_doubleQuote:e+='"';break;case Be.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Be.s_backslash:e+="\\";break;case Be.s_forwardslash:e+="/";break;case Be.s_b:e+="\b";break;case Be.s_f:e+="\f";break;case Be.s_n:e+="\n";break;case Be.s_r:e+="\r";break;case Be.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&n("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&n("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&n("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&n("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&n("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&n("invalid token"),r}currentInt64Value(){return r(0),0n}currentBoolValue(){return r(0),!1}isError(){return 0}JSONString(){return r(0),""}pushPosition(){return r(0),!1}popPosition(){return r(0),!1}skipCStyleComments_(){r(0)}skipCppStyleComments_(){r(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e===Be.s_asterisk?this.skipCStyleComments_():e===Be.s_forwardslash?this.skipCppStyleComments_():n("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&n("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&n("invalid token"),t=this.m_peekChar();t===Be.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Be.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Be.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&n("invalid token");let e=this.m_peekChar();for(;e!==Be.s_doubleQuote;){const t=e===Be.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===Be.s_doubleQuote||e===Be.s_backslash||e===Be.s_forwardslash||e===Be.s_b||e===Be.s_f||e===Be.s_n||e===Be.s_r||e===Be.s_t)this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar();else if(e===Be.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e>=Be.s_zero&&e<=Be.s_nine||e>=Be.s_a&&e<=Be.s_f||e>=Be.s_A&&e<=Be.s_F||n("invalid token");else n("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Be.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Be.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):n("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Be.s_doubleQuote&&n("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():n("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():n("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Be.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar()}while(e>=Be.s_zero&&e<=Be.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e>=Be.s_zero&&e<=Be.s_nine||n("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e!==Be.s_plus&&e!==Be.s_minus||(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar()),e>=Be.s_zero&&e<=Be.s_nine||n("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===Be.s_minus?(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),t=this.m_peekChar(),e=!0,t>=Be.s_zero&&t<=Be.s_nine||n("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===Be.s_period)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==Be.s_e&&t!==Be.s_E||this.exp_();else if(t===Be.s_e||t===Be.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&n("invalid token"),"null"!==e&&n("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&n("invalid token"),"true"!==e&&n("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&n("invalid token"),"false"!==e&&n("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&n("invalid token"),"NaN"!==e&&n("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Be.s_beginObject?this.valueStartObject_():e===Be.s_beginArray?this.valueStartArray_():e===Be.s_doubleQuote?this.valueString_():e===Be.s_minus||e>=Be.s_zero&&e<=Be.s_zero+9?this.valueNumber_():e===Be.s_n?this.valueNull_():e===Be.s_t?this.valueTrue_():e===Be.s_f?this.valueFalse_():e===Be.s_N?this.valueNan_():n("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Be.s_beginObject&&e!==Be.s_beginArray&&n("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class Re{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,i,s,a,o){let u;"string"==typeof r?(u=new Ve({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&n("failed to import map geometry: start of object is expected");const m=ne(t,e,u,i,s);return new v(m)}importSpatialReference(e){const n=ie(e);return null===n&&t("failed to import spatial reference"),n}importProjectionTransformation(e,t){return r(0),{}}importDatumTransformation(e,t){return r(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||n("string_to_geometry_type"),e.endsWith("point")?a.enumPoint:e.endsWith("envelope")?a.enumEnvelope:e.endsWith("multipoint")?a.enumMultiPoint:e.endsWith("polyline")?a.enumPolyline:e.endsWith("polygon")?a.enumPolygon:void n("string_to_geometry_type")}}const Me=new ee,Ue=new Ce,We=new Re;function Xe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ge(t,n=!1){if(!n&&(q(t)||K(t)||J(t)||Q(t))){const n=new v;return n.setGeometry(e(L(t))),n}const r=new $(t,{strict:!1});return r.nextToken(),We.execute(0,a.enumUnknown,r,!0,!1)}function Le(e){let t=null;return[e.map(e=>{if(null==t){const n=Ye(e);return t=n.getSpatialReference(),n.getGeometry()}return qe(e)}),t]}function Ye(e){const t=Ge(e),n=Je(e.spatialReference);return n&&t.setSpatialReference(n),t}function qe(e){return Ge(e).getGeometry()}function Ke(e){return Ge(e,!0).getGeometry()}function Je(e){if(null==e)return null;let t=!1;if(e instanceof Y){const{wkt2:n}=e;e=e.toJSON(),e.wkt2??=n,t=!0}(e.latestVcsWkid||e.vcsWkid)&&(t||(e={...e}),delete e?.latestVcsWkid,delete e?.vcsWkid);const n=new $(e,{strict:!1});n.nextToken();const r=We.importSpatialReference(n);return 0===r.getCoordinateSystemType()?null:r}function Qe(e,t){if(e instanceof v&&(t=e.getSpatialReference(),e=e.getGeometry()),null==e||e.isEmpty())return null;let n;switch(e.getGeometryType()){case a.enumPoint:case a.enumMultiPoint:case a.enumPolyline:case a.enumPolygon:n=X(e)}if(n){const e=G(n);return e.spatialReference=Ze(t),null==e.spatialReference&&delete e.spatialReference,e}return Me.reset(),Ue.execute(0,e,t??null,Me),Me.getObject()}function Ze(e){return null==e||0===e.getCoordinateSystemType()?null:(Me.reset(),Ue.execute(0,null,e,Me),Me.getObject().spatialReference)}export{Le as fromGeometries,Ye as fromGeometry,qe as fromGeometryToGXGeometry,Ke as fromGeometryToGXGeometryUsingImportOperator,Je as fromSpatialReference,Xe as getSpatialReference,Qe as toGeometry,Ze as toSpatialReference};
|
|
2
|
+
import{constructFromFlatGeometry as e}from"../../../chunks/FlatGeometry.js";import{d as t,a as n,g as r,r as i,q as s,G as a,t as o}from"../../../chunks/Geometry.js";import{aL as u,i as m,d as l,b as c,aM as d,P as _,m as h}from"../../../chunks/Point2D.js";import{q as f,b as p,p as k,aZ as b,c as y,e as T,a as N,f as g,a_ as v}from"../../../chunks/UnitFactory.js";import{a2 as x,a5 as A,P as S,E as w,a0 as C,a1 as D,a6 as F,a7 as j,X as O}from"../../../chunks/Envelope.js";import{P as z,a as I,S as E,M as P,J as B,a5 as V,a6 as R,a7 as M,a8 as U,a9 as W}from"../../../chunks/MultiPathImpl.js";import{convertGeometryxToFlat as X,convertFlatToGeometryJSON as G,convertGeometryToFlat as L}from"../../FlatGeometry.js";import Y from"../../SpatialReference.js";import"./initNoPeFactory.js";import{isPoint as q,isMultipoint as K,isPolyline as J,isPolygon as Q}from"../../support/jsonTypeUtils.js";function Z(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:1,m_value:null},done:!1};if(this.m_i<this.m_keys.length){const e=this.m_bReturnKey,t=Math.trunc(this.m_i);return this.m_bReturnKey=!this.m_bReturnKey,this.m_i+=.5,e?{value:{m_token:5,m_value:this.m_keys[t]},done:!1}:{value:{m_token:6,m_value:this.m_o[this.m_keys[t]]},done:!1}}return{value:{m_token:3,m_value:null},done:!0}}function H(){if(-1===this.m_i)return this.m_i=0,{value:{m_token:2,m_value:null},done:!1};if(this.m_i<this.m_a.length){const e={value:{m_token:6,m_value:this.m_a[this.m_i++]},done:!1};return this.m_strict||void 0===e.value.m_value&&(e.value.m_value=Number.NaN),e}return{value:{m_token:4,m_value:null},done:!0}}class ${m_iteratorStack;m_nextFlatToken;m_currentToken=0;m_currentValue;m_options;createJSONObjectIterator(e){return{m_iteratorType:"object",m_o:e,m_keys:this.m_options.strict?Object.keys(e):Object.keys(e).filter(t=>void 0!==e[t]),m_i:-1,m_bReturnKey:!0,next:Z}}createJSONArrayIterator(e){return{m_iteratorType:"array",m_strict:this.m_options.strict,m_i:-1,m_a:e,next:H}}constructor(e,t){this.m_options=t?{...t}:{strict:!0};const n=e;this.m_iteratorStack=[n instanceof Array?this.createJSONArrayIterator(n):this.createJSONObjectIterator(n)],this.m_nextFlatToken={m_value:null,m_token:0}}nextToken(){if(0===this.m_iteratorStack.length)return this.m_currentToken=0;switch(this.m_nextFlatToken=this.m_iteratorStack.at(-1).next().value,this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_currentToken=1;case 3:return this.m_iteratorStack.pop(),this.m_currentToken=3;case 2:return this.m_currentToken=2;case 4:return this.m_iteratorStack.pop(),this.m_currentToken=4;case 5:return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=5;case 6:if(this.m_nextFlatToken.m_value instanceof Array)return this.m_iteratorStack.push(this.createJSONArrayIterator(this.m_nextFlatToken.m_value)),this.nextToken();if(this.m_nextFlatToken.m_value instanceof Object)return this.m_iteratorStack.push(this.createJSONObjectIterator(this.m_nextFlatToken.m_value)),this.nextToken();if("number"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,Number.isSafeInteger(this.m_currentValue)&&this.m_currentValue>=u()&&this.m_currentValue<=m()?this.m_currentToken=8:this.m_currentToken=7;if("string"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=6;if("boolean"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=this.m_nextFlatToken.m_value,this.m_currentToken=this.m_nextFlatToken.m_value?11:12;if("object"==typeof this.m_nextFlatToken.m_value)return this.m_currentValue=null,this.m_currentToken=10;t("unrecognized json element type")}t("unrecognized json element type")}currentToken(){return this.m_currentToken}skipChildren(){if(0!==this.m_iteratorStack.length)switch(this.m_currentValue=void 0,this.m_nextFlatToken.m_token){case 1:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=3,void(this.m_currentToken=3);case 2:return this.m_iteratorStack.pop(),this.m_nextFlatToken.m_token=4,void(this.m_currentToken=4)}}currentString(){return 6!==this.m_currentToken&&5!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentDoubleValue(){return 7!==this.m_currentToken&&8!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentInt32Value(){return 8!==this.m_currentToken&&n("invalid token"),this.m_currentValue}currentInt64Value(){return r(0),0n}currentBoolValue(){return 12!==this.m_currentToken&&11!==this.m_currentToken&&n("invalid token"),this.m_currentValue}isError(){return 0}}class ee{m_pendingKey=null;m_acceptedObject=null;m_currentObject=[];reset(){this.m_pendingKey=null,this.m_acceptedObject=null,this.m_currentObject.length=0}startObject(){const e={};this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}startArray(){const e=[];this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):Array.isArray(this.m_currentObject.at(-1))&&this.m_currentObject.at(-1).push(e),this.m_currentObject.push(e)}endObject(){this.m_acceptedObject=this.m_currentObject.at(-1),this.m_currentObject.pop()}endArray(){this.m_currentObject.pop()}addFieldName(e){this.m_pendingKey=e}addValue_(e){this.m_pendingKey?(this.m_currentObject.at(-1)[this.m_pendingKey]=e,this.m_pendingKey=null):this.m_currentObject.at(-1).push(e)}addString(e){this.addValue_(e)}addDouble(e,t){this.addValue_(e)}addInt64(e){r(0)}addInt32(e){this.addValue_(e)}addBool(e){this.addValue_(e)}addNull(){this.addValue_(null)}getObject(){return this.m_acceptedObject}}class te{m_buffer=null;m_view=null;m_sz=0;m_offset=0;m_bOwnsBuffer=!0;m_bLittleEndian=!0;m_element;m_elementBytes;m_elementView;m_elementDouble;m_elementFloat;m_elementInt64;m_elementInt32;m_elementInt16;constructor(e){return this.m_element=new ArrayBuffer(8),this.m_elementBytes=new Uint8Array(this.m_element),this.m_elementView=new DataView(this.m_element),this.m_elementDouble=new Float64Array(this.m_element),this.m_elementFloat=new Float32Array(this.m_element),this.m_elementInt64=new BigInt64Array(this.m_element),this.m_elementInt32=new Int32Array(this.m_element),this.m_elementInt16=new Int16Array(this.m_element),void 0!==e.sz?(this.m_sz=e.sz,e.buffer?(this.m_sz<0&&i("size out of range"),this.m_buffer=e.buffer,this.m_offset=void 0!==e.offset?e.offset:0,this.m_view=void 0!==e.offset?new DataView(e.buffer,e.offset,e.sz):new DataView(this.m_buffer),this.m_bOwnsBuffer=!1,void(this.m_bLittleEndian=!0)):(this.m_sz<0&&i("size out of range"),void(this.m_sz>0&&(this.m_buffer=new ArrayBuffer(this.m_sz),this.m_view=new DataView(this.m_buffer))))):e.move?(this.m_sz=e.move.m_sz,this.m_buffer=e.move.m_buffer,this.m_view=e.move.m_view,this.m_bOwnsBuffer=e.move.m_bOwnsBuffer,this.m_bLittleEndian=e.move.m_bLittleEndian,e.move.m_buffer=null,e.move.m_view=null,e.move.m_sz=0,void(e.move.m_bOwnsBuffer=!0)):void t("unrecognized constructor options")}swapBytesDouble(){this.doSwap()&&(this.m_elementDouble[0]=this.m_elementBytes[0]<<56|this.m_elementBytes[1]<<48|this.m_elementBytes[2]<<40|this.m_elementBytes[3]<<32|this.m_elementBytes[4]<<24|this.m_elementBytes[5]<<16|this.m_elementBytes[6]<<8|this.m_elementBytes[7])}swapBytesInt32(){this.doSwap()&&(this.m_elementInt32[0]=this.m_elementBytes[0]<<24|this.m_elementBytes[1]<<16|this.m_elementBytes[2]<<8|this.m_elementBytes[3])}getOffset(){return this.m_offset}assignMove(e){return this===e||(this.clear(),this.m_sz=e.m_sz,this.m_buffer=e.m_buffer,this.m_view=e.m_view,this.m_bOwnsBuffer=e.m_bOwnsBuffer,this.m_bLittleEndian=e.m_bLittleEndian,e.m_buffer=null,e.m_sz=0,e.m_bOwnsBuffer=!0),this}doSwap(){return this.m_bLittleEndian!==(1===te.getNativeByteOrder())}setNativeByteOrder(){this.m_bLittleEndian=1===te.getNativeByteOrder()}setOrder(e){this.m_bLittleEndian=1===e}getOrder(){return this.m_bLittleEndian?1:0}getView(){return this.m_view||s("buffer not defined"),this.m_view}static getNativeByteOrder(){return 1}clear(){this.m_buffer=null,this.m_sz=0,this.m_bOwnsBuffer=!0}size(){return this.m_sz}readDouble(e){return this.doSwap()?(this.m_elementDouble[0]=this.m_view.getFloat64(e,this.m_bLittleEndian),this.swapBytesDouble(),this.m_elementDouble[0]):this.m_view.getFloat64(e,this.m_bLittleEndian)}writeDouble(e,t){this.m_elementDouble[0]=t,this.swapBytesDouble(),this.m_view.setFloat64(e,this.m_elementDouble[0],this.m_bLittleEndian)}readInt32(e){return this.doSwap()?(this.m_elementInt32[0]=this.m_view.getInt32(e,this.m_bLittleEndian),this.swapBytesInt32(),this.m_elementInt32[0]):this.m_view.getInt32(e,this.m_bLittleEndian)}writeInt32(e,t){this.m_elementInt32[0]=t,this.swapBytesInt32(),this.m_view.setInt32(e,this.m_elementInt32[0],this.m_bLittleEndian)}getPtr(){return this.m_buffer}setSizeNoRealloc(e){r(e>=0&&e<=this.m_sz),this.m_sz=e}}function ne(e,t,i,s,o,u){let m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,f=!1,p=!1,k=!1,b=!1,y=!1,T=!1,N=!1,g=!1,v=!1,C=!1,D=!1,F=!1,j=!1,O=!1,z=!1,I=!1,E=!1,P=!1,B=Number.NaN,V=Number.NaN,R=Number.NaN,M=Number.NaN,U=0,W=Number.NaN,X=Number.NaN,G=Number.NaN,L=Number.NaN,Y=Number.NaN,q=Number.NaN,K=Number.NaN,J=Number.NaN,Q=0,Z=0,H=!1,$=!1,ee=null,te=null,ne=null,re=null,ce=null;for(;3!==i.nextToken();){const u=i.currentString();if(i.nextToken(),"spatialReference"===u){if(o&&!m){m=!0,1===i.currentToken()?re=ie(i):10!==i.currentToken()&&n("failed to parse spatial reference: object or null is expected");continue}}else if(s)if("hasZ"===u){if(!l){l=!0,H=11===i.currentToken();continue}}else if("hasM"===u){if(!c){c=!0,$=11===i.currentToken();continue}}else if("rings"===u){if(!(_||h||e!==a.enumUnknown&&e!==a.enumPolygon)){_=!0,({geometry:ce,as:ee,bs:te}=se(!0,!1,t,i));continue}}else if("curveRings"===u){if(!h&&(e===a.enumUnknown||e===a.enumPolygon)){h=!0,({geometry:ce,as:ee,bs:te}=se(!0,!0,t,i));continue}}else if("paths"===u){if(!(f||p||e!==a.enumUnknown&&e!==a.enumPolyline)){f=!0,({geometry:ce,as:ee,bs:te}=se(!1,!1,t,i));continue}}else if("curvePaths"===u){if(!p&&(e===a.enumUnknown||e===a.enumPolyline)){p=!0,({geometry:ce,as:ee,bs:te}=se(!1,!0,t,i));continue}}else if("points"===u){if(!k&&(e===a.enumUnknown||e===a.enumMultiPoint)){k=!0,({geometry:ce,as:ee,bs:te}=ae(t,i));continue}}else if("ids"===u){if(!d){d=!0,ne=oe(t,i);continue}}else if("x"===u){if(!b&&(e===a.enumUnknown||e===a.enumPoint)){b=!0,B=ue(i);continue}}else if("y"===u){if(!y&&(e===a.enumUnknown||e===a.enumPoint)){y=!0,V=ue(i);continue}}else if("z"===u){if(!T&&(e===a.enumUnknown||e===a.enumPoint)){T=!0,R=ue(i);continue}}else if("m"===u){if(!N&&(e===a.enumUnknown||e===a.enumPoint)){N=!0,M=ue(i);continue}}else if("id"===u){if(!g&&(e===a.enumUnknown||e===a.enumPoint)){g=!0,U=me(i);continue}}else if("xmin"===u){if(!v&&(e===a.enumUnknown||e===a.enumEnvelope)){v=!0,W=ue(i);continue}}else if("ymin"===u){if(!C&&(e===a.enumUnknown||e===a.enumEnvelope)){C=!0,X=ue(i);continue}}else if("mmin"===u){if(!z&&(e===a.enumUnknown||e===a.enumEnvelope)){z=!0,K=ue(i);continue}}else if("zmin"===u){if(!j&&(e===a.enumUnknown||e===a.enumEnvelope)){j=!0,Y=ue(i);continue}}else if("idmin"===u){if(!E&&(e===a.enumUnknown||e===a.enumEnvelope)){E=!0,Q=me(i);continue}}else if("xmax"===u){if(!D&&(e===a.enumUnknown||e===a.enumEnvelope)){D=!0,G=ue(i);continue}}else if("ymax"===u){if(!F&&(e===a.enumUnknown||e===a.enumEnvelope)){F=!0,L=ue(i);continue}}else if("mmax"===u){if(!I&&(e===a.enumUnknown||e===a.enumEnvelope)){I=!0,J=ue(i);continue}}else if("zmax"===u){if(!O&&(e===a.enumUnknown||e===a.enumEnvelope)){O=!0,q=ue(i);continue}}else if("idmax"===u){if(!P&&(e===a.enumUnknown||e===a.enumEnvelope)){P=!0,Z=me(i);continue}}else"materials"===u&&r(0);i.skipChildren()}if(_||h||f||p||k){let e=null,t=null;const n=ce;H&&(ce.addAttribute(1),e=ee,e||(e=x(n.getPointCount(),Number.NaN))),$&&(ce.addAttribute(2),t=H?te:ee),null!=ne&&ce.addAttribute(3),H&&null!=e&&n.setAttributeStreamRef(1,e),$&&null!=t&&n.setAttributeStreamRef(2,t),null!=ne&&le(n,ne)}else if(b||y||N||T||g){A(B,V)||n("failed to parse point: x and y must be finite or nan"),(Number.isNaN(V)||Number.isNaN(B))&&(B=Number.NaN,V=Number.NaN);const e=new S({x:B,y:V});T&&e.setZ(R),N&&e.setM(M),g&&e.setID(U),ce=e}else if(v||C||D||F||j||O||z||I||E||P){(Number.isNaN(X)||Number.isNaN(G)||Number.isNaN(L))&&(W=Number.NaN);const e=new w({xmin:W,ymin:X,xmax:G,ymax:L});j&&O&&e.setInterval(1,0,Y,q),z&&I&&e.setInterval(2,0,K,J),E&&P&&e.setInterval(3,0,Q,Z),ce=e}return{...ce?{geom:ce}:{},...re?{sr:re}:{}}}function re(e){let t=!1;for(;3!==e.nextToken();){const n=e.currentString();e.nextToken(),"uwkid"===n?t||(t=!0,8===e.currentToken()&&e.currentInt32Value()):e.skipChildren()}return null}function ie(e){let t=!1,n=!1,r=!1,i=!1,s=!1,a=!1,o=!1,u=!1,m=!1,l=!1,c=!1,d=!1,_=!1,h=!1,v=!1,x=!1,A=!1,S=-1,w=-1,C=-1,D=-1,F=0,j=0,O=0,z=0,I=0,E=0,P=0,B=0,V=0,R=0,M="",U="",W=null;for(;3!==e.nextToken();){const f=e.currentString();e.nextToken(),"wkid"===f?t||(t=!0,8===e.currentToken()&&(S=e.currentInt32Value())):"latestWkid"===f?n||(n=!0,8===e.currentToken()&&(w=e.currentInt32Value())):"wkt"===f?s||(s=!0,6===e.currentToken()&&(M=e.currentString())):"wkt2"===f?s||6===e.currentToken()&&(U=e.currentString()):"vcsWkid"===f?r||(r=!0,8===e.currentToken()&&(C=e.currentInt32Value())):"latestVcsWkid"===f?i||(i=!0,8===e.currentToken()&&(D=e.currentInt32Value())):"xyTolerance"===f?o||(o=!0,a=!0,F=e.currentDoubleValue()):"zTolerance"===f?u||(u=!0,a=!0,j=e.currentDoubleValue()):"mTolerance"===f?m||(m=!0,a=!0,O=e.currentDoubleValue()):"falseX"===f?l||(l=!0,a=!0,P=e.currentDoubleValue()):"falseY"===f?c||(c=!0,a=!0,B=e.currentDoubleValue()):"falseZ"===f?d||(d=!0,a=!0,V=e.currentDoubleValue()):"falseM"===f?_||(_=!0,a=!0,R=e.currentDoubleValue()):"xyUnits"===f?h||(h=!0,a=!0,z=e.currentDoubleValue()):"zUnits"===f?v||(v=!0,a=!0,I=e.currentDoubleValue()):"mUnits"===f?x||(x=!0,a=!0,E=e.currentDoubleValue()):"unit"===f?A||(A=!0,W=re(e)):e.skipChildren()}D<=0&&C>0&&(D=C),C<=0&&D>0&&(C=D);let X=null,G=!0;if(0!==M.length&&(G=!1,f(M)&&(X=p(M))),X||0===U.length||(G=!1,f(U)&&(X=p(U))),!X&&w>0&&(G=!1,k(w)&&(D<=0||b())&&(X=y(w,D))),!X&&S>0&&(G=!1,k(S)&&(C<=0||b())&&(X=y(S,C))),G&&(X=T(W)),a&&X){const e=new N;X.queryPrecisionDescriptorWithoutFalseXY(e),o&&e.setTolerance(0,F),u&&e.setTolerance(1,j),m&&e.setTolerance(2,O),h&&l&&c&&e.setGridParams(P,B,z),v&&d&&e.setZParams(V,I),x&&_&&e.setMParams(R,E),X=g(X,e)}return X}function se(e,t,r,i){2!==i.currentToken()&&n("failed to parse multipath: array of array of vertices is expected");const s=e?new z:new I,a=s,o=C(0),u=x(2,0),m=D(0);let h=null,f=null,p=null,k=null,b=null,y=0,T=0,N=0;const g=new E,v=_.getNAN();let A=0,S=0;const w=e?1:0;for(;4!==i.nextToken();){2!==i.currentToken()&&n("failed to parse multipath: ring/path array is expected");let r=2,s=0,j=!0;const O=4;let z=0,I=0;const E=_.getNAN(),P=l(O,Number.NaN),B=l(O,Number.NaN);let V=!1;for(i.nextToken();4!==i.currentToken();){if(t&&1===i.currentToken())j&&n("failed to parse multipath: starting vertex array is expected"),p||(p=D(A-1,1),k=C(A-1,-1),b=x(0)),V=!0,r=1,({segFlag:N,toPointSz:z}=ke(g,P,v,i));else{for(V=!1,2!==i.currentToken()&&n("failed to parse multipath: array is expected, rings/paths vertices consist of arrays of coordinates"),z=0;4!==i.nextToken();)z===O&&n("failed to parse multipath: each vertex array has to have at most 4 elements"),P[z++]=ue(i);z<2&&n("failed to parse multipath: each vertex array has to have at least 2 elements"),F(P[0],P[1])||n("failed to parse multipath: x and y must be finite")}i.nextToken();do{if(u.size()===2*A&&u.resize(ce(A)),u.writePoint2D(2*A,E.setCoords(P[0],P[1])),h&&h.size()===A&&h.resize(de(A)),z>2?(h||(h=x(A+1,Number.NaN)),h.write(A,P[2])):h&&h.write(A,Number.NaN),f&&f.size()===A&&f.resize(de(A)),z>3?(f||(f=x(A+1,Number.NaN)),f.write(A,P[3])):f&&f.write(A,Number.NaN),j)S++,o.add(A),m.add(w),j=!1,I=z,c(B,P,0,0,I);else if(null!==p)if(V){const e=W(N),t=b.size();b.resize(t+e),p.add(N),k.add(y),g.get().writeInBufferStream(b,y),y+=e,a.incCurveType(N,1),T++}else p.add(1),k.add(-1);A++,s++,v.setCoords(P[0],P[1])}while(s<r&&4===i.currentToken())}0!==s&&(e&&s>r&&z===I&&0===d(P,B,z)?(A--,s--):null!==p&&(p.add(1),k.add(-1)))}return A&&(o.resize(S),m.resize(S),A>0&&(o.add(A),m.add(0)),a.setAttributeStreamRef(0,u),a.setPathFlagsStreamRef(m),a.setPathStreamRef(o),null!==p&&(a.updateCurveCounter(T),a.setSegmentData(k,b,p,y)),a.notifyModifiedFlags(65535)),{geometry:s,as:h,bs:f}}function ae(e,t){2!==t.currentToken()&&n("failed to parse multipoint: array of vertices is expected");let r=0;const i=new P,s=x(2,0);let a=0;const o=4,u=l(o,Number.NaN),m=new _;let c=null,d=null;for(;4!==t.nextToken();){for(2!==t.currentToken()&&n("failed to parse multipoint: array is expected, multipoint vertices consist of arrays of cooridinates"),a=0;4!==t.nextToken();)a===o&&n("failed to parse multipoint: each vertex array has to have at most 4 elements"),u[a++]=ue(t);a<2&&n("failed to parse multipoint: each vertex array has to have at least 2 elements"),F(u[0],u[1])||n("failed to parse multipoint: x and y must be finite"),s.size()===2*r&&s.resize(ce(r)),s.writePoint2D(2*r,m.setCoords(u[0],u[1])),c&&c.size()===r&&c.resize(de(r)),a>2?(c||(c=x(r+1,Number.NaN)),c.write(r,u[2])):c&&c.write(r,Number.NaN),d&&d.size()===r&&d.resize(de(r)),a>3?(d||(d=x(r+1,Number.NaN)),d.write(r,u[3])):d&&d.write(r,Number.NaN),r++}if(r){const e=i.getImpl();e.setAttributeStreamRef(0,s),e.resizeNoInit(r),e.notifyModifiedFlags(65535)}return{geometry:i,as:c,bs:d}}function oe(e,t){2!==t.currentToken()&&n("failed to parse array of IDs: array of array of integers is expected");const r=j(2,0);let i=0,s=-1;for(;4!==t.nextToken();){const e=i;r.size()===i&&r.resize(de(i)),i++;let a=0;for(-1===s?s=2===t.currentToken()?1:0:1===s&&2!==t.currentToken()&&n("failed to parse array of IDs: array of array of integers is expected"),0===s&&(r.size()===i&&r.resize(de(i)),r.write(i,me(t)),a++,i++);4!==t.nextToken();)r.size()===i&&r.resize(de(i)),r.write(i,me(t)),a++,i++;if(r.write(e,a),0===s)break}return r.resize(i),r}function ue(e){const t=e.currentToken();if(10===t||6===t&&"NaN"===e.currentString())return Number.NaN;{const t=e.currentDoubleValue();return Number.isNaN(t)?Number.NaN:t}}function me(e){return e.currentInt32Value()}function le(e,n){if(e.isEmpty())return;const r=j(2,0),i=e.getGeometryType();let s=0;i===P.type?s=1:i===I.type||i===z.type?s=e.getPathCount():t("not implemented"),r.resize(e.getPointCount(),0);let a=0;for(let o=0;o<s;++o){const s=n.read(a);a++;const u=a+s;let m=0,l=0;i===P.type?m=e.getPointCount():i===I.type||i===z.type?(m=e.getPathSize(o),l=e.getPathStart(o)):t("not implemented");for(let e=0,t=Math.min(s,m);e<t;++e)r.write(l,n.read(a)),a++,l++;a=u}e.getImpl().setAttributeStreamRef(3,r)}function ce(e){let t=2*Math.trunc(3*(e+1)/2);return t<8?t=8:t<32&&(t=32),t}function de(e){let t=Math.trunc(3*(e+1)/2);return t<4?t=4:t<16&&(t=16),t}function _e(e,t,n,r,s){s>=r.size()&&i("Byte_buffer out of range access"),e.m_bits=0,e.m_rotation=0,e.m_cosr=1,e.m_sinr=0,e.setStartXY(t),e.setEndXY(n);const a=_.getNAN();a.x=r.readDouble(s),a.y=r.readDouble(s+8);const o=r.readInt32(s+16);if(!!(1&o))return e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),!1;let u=!!(64&o);const m=!!(128&o);let l=!!(32&o);const c=!!(8&o),d=!!(16&o),h=t.equals(n);return u&&!h&&(u=!1,l=!0),l&&h&&(u=!0,l=!1,a.setCoords(0,0)),u||(m?l?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_interior.assign(a),e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0):(e.constructCircularArcThreePoint(t,n,a),h&&c===e.isClockwise()&&e.reverse()):l?(e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):M(e,t,n,a,c,d)),u&&(e.m_center.assign(t),e.m_startAngle=a.x,e.m_sweepAngle=a.y,U(e,Number.NaN,c,d),e.m_semiMajorAxis=0,e.m_minorMajorRatio=1,e.m_interior.setCoordsPoint2D(t)),e.setProjectionBehavior(0),R(e),!0}function he(e,t,n,r,i){e.m_bits=0,e.m_center.x=r.readDouble(i),e.m_center.y=r.readDouble(i+8),e.m_rotation=r.readDouble(i+16),e.m_semiMajorAxis=r.readDouble(i+24),e.m_minorMajorRatio=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y;const s=r.readInt32(i+40);if(1&s)return!1;let a=!!(64&s),o=!!(128&s);const u=!!(2048&s),m=!!(4096&s);return!!!(512&s)&&!!!(1024&s)||o||(a=!0),o&&!t.equals(n)?(o=!1,a=!0):a&&t.equals(n)&&(o=!0,a=!1),o?(e.m_center.assign(t),e.m_startAngle=e.m_center.x,e.m_sweepAngle=e.m_center.y,U(e,Number.NaN,u,m),e.m_semiMajorAxis=0,e.m_interior.setCoordsPoint2D(t)):a?(e.m_center.setNAN(),e.m_semiMajorAxis=1,e.m_minorMajorRatio=0,e.m_center.setNAN(),e.m_sweepAngle=0,e.m_startAngle=0,R(e),e.queryCoord2D(.5,e.m_interior)):e.constructEllipticArcEndPointsCenter(t,n,e.m_semiMajorAxis,e.m_minorMajorRatio,e.m_rotation,!m,u,e.m_center),e.setProjectionBehavior(1),R(e),!0}function fe(e,t,n,i,s){return r(s+32<=i.size()),e.m_cp=h(_,2),e.m_cp[0].x=i.readDouble(s),e.m_cp[0].y=i.readDouble(s+8),e.m_cp[1].x=i.readDouble(s+16),e.m_cp[1].y=i.readDouble(s+24),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function pe(e,t,n,r,i){return e.m_cp.x=r.readDouble(i),e.m_cp.y=r.readDouble(i+8),e.m_weights[0]=r.readDouble(i+16),e.m_weights[1]=r.readDouble(i+24),e.m_weights[2]=r.readDouble(i+32),e.m_XStart=t.x,e.m_YStart=t.y,e.m_XEnd=n.x,e.m_YEnd=n.y,!0}function ke(e,t,r,i,s){const a={segFlag:0,toPointSz:0};let o=i.currentToken();o=i.nextToken();const u=i.currentString(),m=u[0];for((1!==u.length||"a"!==m&&"b"!==m&&"c"!==m&&"n"!==m&&"q"!==m)&&n('failed to parse curve: expecting "a", "b", "n", "q", or "c"'),o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for curve parameters"),o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for to point"),a.toPointSz=0;4!==i.nextToken();)4===a.toPointSz&&n("failed to parse curve: vertex array cannot have more than 4 elements"),t[a.toPointSz++]=ue(i);a.toPointSz<2&&n("failed to parse curve: vertex array must have at least 2 elements");const l=_.construct(t[0],t[1]),c=_.getNAN();let d=-1,h=-1,f=!1,p=Number.NaN,k=Number.NaN,b=Number.NaN;const y=[_.getNAN(),_.getNAN(),_.getNAN()],T=_.getNAN();if("a"===m){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for center point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for center point"),c.setCoords(e,t),o=i.nextToken(),d=i.currentInt32Value(),o=i.nextToken(),h=i.currentInt32Value(),o=i.nextToken(),4!==o?(f=!1,p=ue(i),o=i.nextToken(),k=ue(i),o=i.nextToken(),b=ue(i),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters")):f=!0,a.segFlag=4}else if("b"===m){for(let e=0;e<2;e++){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[e].setCoords(t,r)}o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=2}else if("n"===m){{o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[0].setCoords(e,t)}o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);y[1].setCoords(e,t),y[2].setCoords(r,r),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=8}else if("q"===m){for(let e=0;e<1;e++){o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for control point"),o=i.nextToken();const t=ue(i);o=i.nextToken();const r=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for control point"),y[e].setCoords(t,r)}o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=16}else{o=i.nextToken(),2!==o&&n("failed to parse curve: start array is expected for interior point"),o=i.nextToken();const e=ue(i);o=i.nextToken();const t=ue(i);o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for interior point"),T.setCoords(e,t),o=i.nextToken(),4!==o&&n("failed to parse curve: end array is expected for curve parameters"),a.segFlag=4}if(o=i.nextToken(),3!==o&&n("failed to parse curve: end object is expected for curve"),"a"===m)if(e.createEllipticArc(),f){const t=!0;be(e.get(),r,l,c,t,d,h)}else ye(e.get(),r,l,c,d,h,p,k,b);else if("b"===m)e.createCubicBezier(),Te(e.get(),r,l,y);else if("n"===m)e.createQuadraticRationalBezier(),Ne(e.get(),r,l,y[0],y[1].x,y[1].y,y[2].x);else if("q"===m)e.createQuadraticBezier(),e.get().construct(r,y[0],l);else{e.createEllipticArc();const t=!1;be(e.get(),r,l,T,t,-1,-1)}return a}function be(e,t,n,r,i,s,a){e.dropAllAttributes();const o=20,u=new ArrayBuffer(o),m=new te({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8;let c=0;i?(a||(c|=8),s&&(c|=16)):c|=128,m.writeInt32(l,c),l+=4,_e(e,t,n,m,0)}function ye(e,t,n,r,i,s,a,o,u){e.dropAllAttributes();const m=44,l=new ArrayBuffer(m),c=new te({sz:m,buffer:l});let d=0;c.writeDouble(d,r.x),d+=8,c.writeDouble(d,r.y),d+=8,c.writeDouble(d,a),d+=8,c.writeDouble(d,o),d+=8,c.writeDouble(d,u),d+=8;let _=0;s||(_|=2048),i&&(_|=4096),c.writeInt32(d,_),d+=4,he(e,t,n,c,0)}function Te(e,t,n,r){e.dropAllAttributes();const i=32,s=new ArrayBuffer(i),a=new te({sz:i,buffer:s});let o=0;a.writeDouble(o,r[0].x),o+=8,a.writeDouble(o,r[0].y),o+=8,a.writeDouble(o,r[1].x),o+=8,a.writeDouble(o,r[1].y),o+=8,fe(e,t,n,a,0)}function Ne(e,t,n,r,i,s,a){e.dropAllAttributes();const o=40,u=new ArrayBuffer(o),m=new te({sz:o,buffer:u});let l=0;m.writeDouble(l,r.x),l+=8,m.writeDouble(l,r.y),l+=8,m.writeDouble(l,i),l+=8,m.writeDouble(l,s),l+=8,m.writeDouble(l,a),l+=8,pe(e,t,n,m,0)}function ge(e,t,n,r,i){const s=e.getGeometryType();if(s===a.enumEllipticArc)return ve(e,t,n,r,i);if(s===a.enumBezier)return xe(e,t,n,r,i);if(s===a.enumRationalBezier2)return Ae(e,t,n,r,i);if(s===a.enumBezier2){const s=new B;return s.constructFromQuadraticSegment(e),xe(s,t,n,r,i)}o("")}function ve(e,t,n,i,s){r(!V(e));const a=e.getEndXY(),o=e.hasAttribute(1)&&!t,u=e.hasAttribute(2)&&!n;let m=Number.NaN,l=Number.NaN;if(o&&(m=e.getEndAttributeAsDbl(1,0)),u&&(l=e.getEndAttributeAsDbl(2,0)),e.isDegenerateToLine()||e.isDegenerate(0))return Se(o,u,a.x,a.y,m,l,i,s),!0;const c=0===e.projectionBehavior(),d=!!c&&e.isClosed();if(c&&!d)s.startObject(),s.addFieldName("c"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s),we(e.m_interior.x,e.m_interior.y,17,s),s.endArray(),s.endObject();else if(c){s.startObject(),s.addFieldName("a"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s);const t=0,n=0;we(e.m_center.x+t,e.m_center.y+n,17,s);const r=!e.isMajor();s.addInt32(r?1:0);const c=e.isClockwise();s.addInt32(c?1:0),s.endArray(),s.endObject()}else{s.startObject(),s.addFieldName("a"),s.startArray(),Se(o,u,a.x,a.y,m,l,i,s);const t=e;we(t.m_center.x,t.m_center.y,17,s);const n=!t.isMajor();s.addInt32(n?1:0);const r=t.isClockwise();s.addInt32(r?1:0),s.addDouble(t.m_rotation,17),s.addDouble(t.m_semiMajorAxis,17),s.addDouble(t.m_minorMajorRatio,17),s.endArray(),s.endObject()}return!1}function xe(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;return a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("b"),i.startArray(),Se(a,o,s.x,s.y,u,m,r,i),we(e.m_cp[0].x,e.m_cp[0].y,r,i),we(e.m_cp[1].x,e.m_cp[1].y,r,i),i.endArray(),i.endObject(),!1}function Ae(e,t,n,r,i){const s=e.getEndXY(),a=e.hasAttribute(1)&&!t,o=e.hasAttribute(2)&&!n;let u=Number.NaN,m=Number.NaN;a&&(u=e.getEndAttributeAsDbl(1,0)),o&&(m=e.getEndAttributeAsDbl(2,0)),i.startObject(),i.addFieldName("n"),i.startArray(),Se(a,o,s.x,s.y,u,m,r,i),we(e.m_cp.x,e.m_cp.y,r,i);const l=r;return i.addDouble(e.m_weights[0],l),i.addDouble(e.m_weights[1],l),i.addDouble(e.m_weights[2],l),i.endArray(),i.endObject(),!1}function Se(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}function we(e,t,n,r){r.startArray(),r.addDouble(e,n),r.addDouble(t,n),r.endArray()}class Ce{getOperatorType(){return 10405}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,r,i,s){De(e,t,n,r)}exportSpatialReference(e,t,n,i){r(0)}exportProjectionTransformation(e,t,n,i){r(0)}exportDatumTransformation(e,t,n,i){r(0)}static geometryTypeToString(e){return r(0),""}}function De(e,n,i,s,o){if(n||i){if(s.startObject(),null!==n){switch(n.getGeometryType()){case a.enumPolygon:Fe(!0,e,n,s);break;case a.enumPolyline:Fe(!1,e,n,s);break;case a.enumMultiPoint:je(e,n,s);break;case a.enumPoint:Oe(e,n,s);break;case a.enumEnvelope:ze(e,n,s);break;case a.enumMultipatch:r(0);break;default:t("exportToJSON")}}null!==i&&(s.addFieldName("spatialReference"),Ee(e,i,s)),s.endObject()}}function Fe(e,t,n,i){const s=n.getImpl(),a=!!(2&t),u=!!(4&t),m=!!(8&t),l=s.hasAttribute(1)&&!a,c=s.hasAttribute(2)&&!u,d=s.hasAttribute(3)&&!m,_=s.hasNonLinearSegments();l&&(i.addFieldName("hasZ"),i.addBool(!0)),c&&(i.addFieldName("hasM"),i.addBool(!0)),e?_?i.addFieldName("curveRings"):i.addFieldName("rings"):_?i.addFieldName("curvePaths"):i.addFieldName("paths");let h=null;const f=[];if(n.isEmpty())i.startArray(),i.endArray();else{const e=17-(31&t>>13);i.startArray();const r=n.getPathCount();let m=0;const p=s.getAttributeStreamRef(0);let k=null,b=null,y=null;const T=new E;let N=null,g=null,v=null;_&&(N=s.getSegmentFlagsStreamRef(),g=s.getSegmentIndexStreamRef(),v=s.getSegmentDataStreamRef()),l&&(k=s.getAttributeStreamRef(1)),c&&(b=s.getAttributeStreamRef(2)),d&&(y=s.getAttributeStreamRef(3),h=O(3,0));for(let t=0;t<r;t++){i.startArray(),d&&f.push(0);const r=n.getPathEnd(t);if(m===r){i.endArray();continue}const s=n.isClosedPath(t);let _=p.read(2*m),x=p.read(2*m+1),A=l?k.read(m):Number.NaN,S=c?b.read(m):Number.NaN,w=d?y.read(m):0;Pe(l,c,_,x,A,S,e,i);let C=1;d&&(h.add(w),f[f.length-1]++);const D=_,F=x,j=A,O=S,z=w;let I=!1,E=0,P=Number.NaN,B=Number.NaN,V=0;for(let t=m+1,n=m,R=s?r+1:r;t<R;t++,n++){const s=null!==N?31&N.read(n):1;let m,R;if(t<r?(m=p.read(2*t),R=p.read(2*t+1),l&&(P=k.read(t)),c&&(B=b.read(t)),d&&(V=y.read(t))):(m=D,R=F,P=j,B=O,V=z),1!==s){I=!0,4===s?T.createEllipticArc():2===s?T.createCubicBezier():16===s?T.createQuadraticBezier():8===s?T.createQuadraticRationalBezier():o("JSON export.unsupported curve");const t=T.get(),r=g.read(n);t.setStartXYCoords(_,x),t.setEndXYCoords(m,R),l&&(t.setStartAttribute(1,0,A),t.setEndAttribute(1,0,P)),c&&(t.setStartAttribute(2,0,S),t.setEndAttribute(2,0,B)),t.readFromBufferStream(v,r);ge(T.get(),a,u,e,i)&&E++}else Pe(l,c,m,R,P,B,e,i);d&&(h.add(V),f[f.length-1]++),C++,_=m,x=R,A=P,S=B,w=V}I&&0===E||(C<2&&E<1&&(Pe(l,c,_,x,A,S,e,i),C++,d&&(h.add(w),f[f.length-1]++)),s&&C<3&&E<2&&(Pe(l,c,D,F,j,O,e,i),C++,_=D,x=F,A=j,S=O,w=z,d&&(h.add(z),f[f.length-1]++))),i.endArray(),m=r}i.endArray()}if(d){i.addFieldName("ids"),i.startArray();let e=0;for(let t=0,n=f.length;t<n;++t){const n=f[t];r(0===n||null!==h&&e+n<=h.size()),i.startArray();for(let t=0;t<n;++t)i.addInt32(h.read(e)),e++;i.endArray()}i.endArray()}}function je(e,t,n){const i=t.getImpl(),s=i.hasAttribute(1)&&!(2&e),a=i.hasAttribute(2)&&!(4&e),o=i.hasAttribute(3)&&!(8&e);s&&(n.addFieldName("hasZ"),n.addBool(!0)),a&&(n.addFieldName("hasM"),n.addBool(!0)),n.addFieldName("points");const u=t.getPointCount();if(t.isEmpty())n.startArray(),n.endArray();else{const t=17-(31&e>>13);n.startArray();const r=i.getAttributeStreamRef(0);let o=null,m=null;s&&(o=i.getAttributeStreamRef(1)),a&&(m=i.getAttributeStreamRef(2));for(let e=0;e<u;e++){const i=r.read(2*e),u=r.read(2*e+1);let l=Number.NaN,c=Number.NaN;s&&(l=o.read(e)),a&&(c=m.read(e)),Pe(s,a,i,u,l,c,t,n)}n.endArray()}if(o){let e=null;i.isEmpty()||(e=i.getAttributeStreamRef(3)),r(0===u||null!==e&&e.size()>=u),n.addFieldName("ids"),n.startArray();for(let t=0;t<u;t++)n.addInt32(e.read(t));n.endArray()}}function Oe(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("x"),n.addNull(),n.addFieldName("y"),n.addNull(),r&&(n.addFieldName("z"),n.addNull()),i&&(n.addFieldName("m"),n.addNull()),void(s&&(n.addFieldName("id"),n.addInt32(0)));const a=17-(31&e>>13);n.addFieldName("x"),n.addDouble(t.getX(),a),n.addFieldName("y"),n.addDouble(t.getY(),a),r&&(n.addFieldName("z"),n.addDouble(t.getZ(),a)),i&&(n.addFieldName("m"),n.addDouble(t.getM(),a)),s&&(n.addFieldName("id"),n.addInt32(t.getID()))}function ze(e,t,n){const r=t.hasAttribute(1)&&!(2&e),i=t.hasAttribute(2)&&!(4&e),s=t.hasAttribute(3)&&!(8&e);if(t.isEmpty())return n.addFieldName("xmin"),n.addNull(),n.addFieldName("ymin"),n.addNull(),n.addFieldName("xmax"),n.addNull(),n.addFieldName("ymax"),n.addNull(),r&&(n.addFieldName("zmin"),n.addNull(),n.addFieldName("zmax"),n.addNull()),i&&(n.addFieldName("mmin"),n.addNull(),n.addFieldName("mmax"),n.addNull()),void(s&&(n.addFieldName("idmin"),n.addInt32(0),n.addFieldName("idmax"),n.addInt32(0)));const a=17-(31&e>>13);if(n.addFieldName("xmin"),n.addDouble(t.getXMin(),a),n.addFieldName("ymin"),n.addDouble(t.getYMin(),a),n.addFieldName("xmax"),n.addDouble(t.getXMax(),a),n.addFieldName("ymax"),n.addDouble(t.getYMax(),a),r){const e=t.queryInterval(1,0);n.addFieldName("zmin"),n.addDouble(e.vmin,a),n.addFieldName("zmax"),n.addDouble(e.vmax,a)}if(i){const e=t.queryInterval(2,0);n.addFieldName("mmin"),n.addDouble(e.vmin,a),n.addFieldName("mmax"),n.addDouble(e.vmax,a)}if(s){const e=t.queryInterval(3,0);n.addFieldName("idmin"),n.addInt32(e.vmin),n.addFieldName("idmax"),n.addInt32(e.vmax)}}function Ie(e,t,r){r.startObject();const i=t.getID();i<=0&&n("cannot export unit that has no valid WKID"),r.addFieldName("uwkid"),r.addInt32(i),r.endObject()}function Ee(e,t,n){n.startObject();let r=0;t.isCustomWkid()||(r=t.getOldID());let i=0;const s=t.getVCS();if(null!==s&&(s.isCustomWkid()||(i=s.getOldID()),i<=0&&(r=0)),r>0){n.addFieldName("wkid"),n.addInt32(r);const e=t.getLatestID();if(e>0&&e!==r&&(n.addFieldName("latestWkid"),n.addInt32(e)),i>0){n.addFieldName("vcsWkid"),n.addInt32(i);const e=t.getLatestVerticalID();e!==i&&(n.addFieldName("latestVcsWkid"),n.addInt32(e))}}if(0===t.getCoordinateSystemType())n.addFieldName("wkid"),n.addNull(),null!==t.getUnit()&&(n.addFieldName("unit"),Ie(e,t.getUnit(),n));else if(r<=0||1&e){let r="";64&e&&(r=t.getText2(),n.addFieldName("wkt2"),n.addString(r));const i=t.getText();i!==r&&(n.addFieldName("wkt"),n.addString(i))}if(16&e){const e=new N;t.queryPrecisionDescriptor(e),n.addFieldName("xyTolerance"),n.addDouble(e.getTolerance(0)),n.addFieldName("zTolerance"),n.addDouble(e.getTolerance(1)),n.addFieldName("mTolerance"),n.addDouble(e.getTolerance(2)),n.addFieldName("falseX"),n.addDouble(e.getFalseX()),n.addFieldName("falseY"),n.addDouble(e.getFalseY()),n.addFieldName("xyUnits"),n.addDouble(e.getGridUnitsXY()),n.addFieldName("falseZ"),n.addDouble(e.getFalseZ()),n.addFieldName("zUnits"),n.addDouble(e.getGridUnitsZ()),n.addFieldName("falseM"),n.addDouble(e.getFalseM()),n.addFieldName("mUnits"),n.addDouble(e.getGridUnitsM())}n.endObject()}function Pe(e,t,n,r,i,s,a,o){o.startArray(),o.addDouble(n,a),o.addDouble(r,a),e&&o.addDouble(i,a),t&&o.addDouble(s,a),o.endArray()}const Be={s_a:"a".charCodeAt(0),s_A:"A".charCodeAt(0),s_asterisk:"*".charCodeAt(0),s_b:"b".charCodeAt(0),s_backslash:"\\".charCodeAt(0),s_beginArray:"[".charCodeAt(0),s_beginObject:"{".charCodeAt(0),s_colon:":".charCodeAt(0),s_period:".".charCodeAt(0),s_comma:",".charCodeAt(0),s_doubleQuote:'"'.charCodeAt(0),s_endArray:"]".charCodeAt(0),s_endObject:"}".charCodeAt(0),s_e:"e".charCodeAt(0),s_E:"E".charCodeAt(0),s_f:"f".charCodeAt(0),s_F:"F".charCodeAt(0),s_forwardslash:"/".charCodeAt(0),s_minus:"-".charCodeAt(0),s_plus:"+".charCodeAt(0),s_n:"n".charCodeAt(0),s_N:"N".charCodeAt(0),s_r:"r".charCodeAt(0),s_t:"t".charCodeAt(0),s_u:"u".charCodeAt(0),s_zero:"0".charCodeAt(0),s_nine:"9".charCodeAt(0)};class Ve{m_jsonString;m_endToken;m_startToken;m_currentTokenType;m_bHasEscapes;m_functionStack=[];m_pushPositions=[];m_utf8Decoder=new TextDecoder("utf-8",{fatal:!0});m_prepSubstr;m_getCurrentSubstr;m_stepOverChar;m_peekChar;m_get;m_increment;m_eof;constructor(e){void 0===e?(this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_endToken=0,this.m_currentTokenType=0,this.m_functionStack.push(()=>this.accept_()),this.m_jsonString=null,this.m_bHasEscapes=!1):e.jsonString?this.resetParserFromString(e.jsonString):e.jsonStream?o("streaming json parsing not yet impl"):t("invalid constructor parameter")}prepSubstrString_(){}getCurrentSubstrString_(){return this.m_jsonString.slice(this.m_startToken,this.m_endToken)}stepOverCharString_(){this.m_endToken++}peekCharString_(){return this.m_jsonString.charCodeAt(this.m_endToken)}getString_(e){const t=this.m_jsonString?.slice(this.m_startToken,this.m_startToken+e-1);this.m_endToken+=e-1;return{s:t,bDone:this.m_endToken>=this.m_jsonString.length}}incrementString_(){this.m_endToken++}eofString_(){return this.m_endToken>=this.m_jsonString.length}setStringFunctions_(){this.m_prepSubstr=this.prepSubstrString_,this.m_getCurrentSubstr=this.getCurrentSubstrString_,this.m_stepOverChar=this.stepOverCharString_,this.m_peekChar=this.peekCharString_,this.m_get=this.getString_,this.m_increment=this.incrementString_,this.m_eof=this.eofString_}setStreamFunctions_(){o("streaming json parsing not yet impl")}reset_(){this.m_jsonString=null,this.m_endToken=0,this.m_startToken=Number.MAX_SAFE_INTEGER,this.m_currentTokenType=0,this.m_bHasEscapes=!1,this.m_functionStack.length=0,this.m_functionStack.push(()=>this.start_()),this.m_pushPositions.length=0}resetParserFromString(e){this.reset_(),this.setStringFunctions_(),this.m_jsonString=e}resetParserFromStream(e){o("streaming json parsing not yet impl")}resetToPosition(e){return!!this.m_jsonString&&(this.m_endToken=e,this.m_startToken=Number.MAX_VALUE,this.m_currentTokenType=0,this.m_functionStack.length=0,e>=this.m_jsonString.length?(this.m_functionStack.push(()=>this.accept_()),!1):(this.m_functionStack.push(()=>this.start_()),!0))}nextToken(){return this.m_functionStack.at(-1)(),this.m_currentTokenType}currentToken(){return this.m_currentTokenType}currentTokenStartIndex(){return this.m_startToken}currentTokenEndIndex(){return this.m_endToken}currentText(){return r(0),""}childrenAsString(){return r(0),""}skipChildren(){this.skipChildren_()}skipChildren_(){if(1===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),1===this.m_currentTokenType?e++:3===this.m_currentTokenType&&e--}while(3!==this.m_currentTokenType||0!==e);return}if(2===this.m_currentTokenType){let e=1;do{this.m_currentTokenType=this.nextToken(),2===this.m_currentTokenType?e++:4===this.m_currentTokenType&&e--}while(4!==this.m_currentTokenType||0!==e);return}}currentTerminalAsString_(){switch(this.m_currentTokenType){case 7:case 8:case 9:return this.m_getCurrentSubstr().slice(0,this.m_endToken-this.m_startToken);case 10:return"null";case 11:return"true";case 12:return"false"}n("invalid token")}toUTF8_(e,t){let n=0,r=e;for(;t.charCodeAt(r)===Be.s_backslash&&t.charCodeAt(r+1)===Be.s_u;)n++,r+=6;r=e;const i=new Uint8Array(n);let s=0;for(;t.charCodeAt(r)===Be.s_backslash&&t.charCodeAt(r+1)===Be.s_u;)i[s++]=Number.parseInt(t.slice(r+2,r+6),16),r+=6;return{u8s:this.m_utf8Decoder.decode(i),end:r}}unquoteCurrentString_(){let e="",t=1;const n=this.m_endToken-this.m_startToken-1;let r=0;const i=this.m_getCurrentSubstr();for(let s=t;s<n;s++)if(i.charCodeAt(s)!==Be.s_backslash)r++;else{switch(r>0&&(e+=i.slice(t,t+r)),i.charCodeAt(++s)){case Be.s_doubleQuote:e+='"';break;case Be.s_u:{const{u8s:t,end:n}=this.toUTF8_(s-1,i);s=n-1,e+=t;break}case Be.s_backslash:e+="\\";break;case Be.s_forwardslash:e+="/";break;case Be.s_b:e+="\b";break;case Be.s_f:e+="\f";break;case Be.s_n:e+="\n";break;case Be.s_r:e+="\r";break;case Be.s_t:e+="\t"}t=s+1,r=0}return r>0&&(e+=i.slice(t,t+r)),e}currentString(){if(5!==this.m_currentTokenType&&6!==this.m_currentTokenType)return this.currentTerminalAsString_();if(this.m_bHasEscapes)return this.unquoteCurrentString_();return this.m_getCurrentSubstr().slice(1,this.m_endToken-this.m_startToken-2+1)}currentDoubleValue(){if(7!==this.m_currentTokenType&&8!==this.m_currentTokenType&&9!==this.m_currentTokenType&&6!==this.m_currentTokenType&&10!==this.m_currentTokenType&&n("invalid token"),10===this.m_currentTokenType)return Number.NaN;let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;if(6===this.m_currentTokenType){if("NaN"===this.currentString())return Number.NaN;e=e.slice(1),t-=2,0===t&&n("invalid token")}const r=Number.parseFloat(e);if(6===this.m_currentTokenType)Number.isNaN(r)&&n("invalid token");else if(Number.isNaN(r))return Number.NaN;return r}currentInt32Value(){8!==this.m_currentTokenType&&6!==this.m_currentTokenType&&n("invalid token");let e=this.m_getCurrentSubstr(),t=this.m_endToken-this.m_startToken;6===this.m_currentTokenType&&(e=e.slice(1),t-=2,0===t&&n("invalid token"));const r=parseInt(e);return Number.isNaN(r)&&n("invalid token"),r}currentInt64Value(){return r(0),0n}currentBoolValue(){return r(0),!1}isError(){return 0}JSONString(){return r(0),""}pushPosition(){return r(0),!1}popPosition(){return r(0),!1}skipCStyleComments_(){r(0)}skipCppStyleComments_(){r(0)}skipComments_(){this.m_prepSubstr();let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e===Be.s_asterisk?this.skipCStyleComments_():e===Be.s_forwardslash?this.skipCppStyleComments_():n("invalid token")}skipWhiteSpace_(){let e;do{this.m_eof()&&n("invalid token");let t=this.m_peekChar();for(;t>=9&&t<=13||32===t;)this.m_increment(),this.m_eof()&&n("invalid token"),t=this.m_peekChar();t===Be.s_forwardslash?(this.m_startToken=this.m_endToken,e=!0,this.skipComments_()):e=!1}while(e)}rightBracket_(){return this.m_peekChar()===Be.s_endArray&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=4,!0)}rightBrace_(){return this.m_peekChar()===Be.s_endObject&&(this.m_startToken=this.m_endToken,this.m_increment(),this.m_currentTokenType=3,!0)}string_(){this.m_prepSubstr(),this.m_bHasEscapes=!1,this.m_stepOverChar(),this.m_eof()&&n("invalid token");let e=this.m_peekChar();for(;e!==Be.s_doubleQuote;){const t=e===Be.s_backslash;if(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),t)if(this.m_bHasEscapes=!0,e===Be.s_doubleQuote||e===Be.s_backslash||e===Be.s_forwardslash||e===Be.s_b||e===Be.s_f||e===Be.s_n||e===Be.s_r||e===Be.s_t)this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar();else if(e===Be.s_u)for(let r=0;r<4;r++)this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e>=Be.s_zero&&e<=Be.s_nine||e>=Be.s_a&&e<=Be.s_f||e>=Be.s_A&&e<=Be.s_F||n("invalid token");else n("invalid token")}this.m_stepOverChar()}comma_(){return this.m_peekChar()===Be.s_comma&&(this.m_increment(),!0)}colon_(){return this.m_peekChar()===Be.s_colon&&(this.m_increment(),!0)}fieldNameEnd_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.colon_()?(this.skipWhiteSpace_(),this.value_()):n("invalid token")}fieldNameStart_(){this.m_startToken=this.m_endToken;this.m_peekChar()!==Be.s_doubleQuote&&n("invalid token"),this.string_(),this.m_currentTokenType=5,this.m_functionStack.push(()=>this.fieldNameEnd_())}pairEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.fieldNameStart_()):this.rightBrace_()?this.m_functionStack.pop():n("invalid token")}arrayStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBracket_()||(this.m_functionStack.push(()=>this.elementEnd_()),this.value_())}elementEnd_(){this.skipWhiteSpace_(),this.comma_()?(this.skipWhiteSpace_(),this.value_()):this.rightBracket_()?this.m_functionStack.pop():n("invalid token")}objectStart_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.rightBrace_()||(this.m_functionStack.push(()=>this.pairEnd_()),this.fieldNameStart_())}valueStartObject_(){this.m_increment(),this.m_currentTokenType=1,this.m_functionStack.push(()=>this.objectStart_())}valueStartArray_(){this.m_increment(),this.m_currentTokenType=2,this.m_functionStack.push(()=>this.arrayStart_())}valueString_(){this.string_(),this.m_currentTokenType=6}int_(){this.m_peekChar()!==Be.s_zero?this.digits_():this.m_stepOverChar()}digits_(){let e=this.m_peekChar();do{this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar()}while(e>=Be.s_zero&&e<=Be.s_nine)}frac_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e>=Be.s_zero&&e<=Be.s_nine||n("invalid token"),this.digits_()}exp_(){let e=this.m_peekChar();this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar(),e!==Be.s_plus&&e!==Be.s_minus||(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),e=this.m_peekChar()),e>=Be.s_zero&&e<=Be.s_nine||n("invalid token"),this.digits_()}valueNumber_(){this.m_prepSubstr();let e=!1,t=this.m_peekChar();if(t===Be.s_minus?(this.m_stepOverChar(),this.m_eof()&&n("invalid token"),t=this.m_peekChar(),e=!0,t>=Be.s_zero&&t<=Be.s_nine||n("invalid token"),this.int_()):this.int_(),t=this.m_peekChar(),t===Be.s_period)this.m_currentTokenType=7,this.frac_(),t=this.m_peekChar(),t!==Be.s_e&&t!==Be.s_E||this.exp_();else if(t===Be.s_e||t===Be.s_E)this.m_currentTokenType=7,this.exp_();else{let t=0;e&&t++;const n=this.m_endToken-this.m_startToken-t;if(n<10)this.m_currentTokenType=8;else if(10===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="2147483648"?this.m_currentTokenType=8:this.m_currentTokenType=9:n.slice(t)<="2147483647"?this.m_currentTokenType=8:this.m_currentTokenType=9}else if(n<19)this.m_currentTokenType=9;else if(19===n){const n=this.m_getCurrentSubstr();e?n.slice(t)<="9223372036854775808"?this.m_currentTokenType=9:this.m_currentTokenType=7:n.slice(t)<="9223372036854775807"?this.m_currentTokenType=9:this.m_currentTokenType=7}else this.m_currentTokenType=7}}valueNull_(){const{s:e,bDone:t}=this.m_get(5);t&&n("invalid token"),"null"!==e&&n("invalid token"),this.m_currentTokenType=10}valueTrue_(){const{s:e,bDone:t}=this.m_get(5);t&&n("invalid token"),"true"!==e&&n("invalid token"),this.m_currentTokenType=11}valueFalse_(){const{s:e,bDone:t}=this.m_get(6);t&&n("invalid token"),"false"!==e&&n("invalid token"),this.m_currentTokenType=12}valueNan_(){const{s:e,bDone:t}=this.m_get(4);t&&n("invalid token"),"NaN"!==e&&n("invalid token"),this.m_currentTokenType=7}value_(){this.m_startToken=this.m_endToken;const e=this.m_peekChar();e===Be.s_beginObject?this.valueStartObject_():e===Be.s_beginArray?this.valueStartArray_():e===Be.s_doubleQuote?this.valueString_():e===Be.s_minus||e>=Be.s_zero&&e<=Be.s_zero+9?this.valueNumber_():e===Be.s_n?this.valueNull_():e===Be.s_t?this.valueTrue_():e===Be.s_f?this.valueFalse_():e===Be.s_N?this.valueNan_():n("invalid token")}start_(){this.skipWhiteSpace_(),this.m_functionStack.pop(),this.m_functionStack.push(()=>this.accept_());const e=this.m_peekChar();e!==Be.s_beginObject&&e!==Be.s_beginArray&&n("invalid token"),this.value_()}accept_(){this.m_startToken=this.m_endToken,this.m_currentTokenType=0}}class Re{getOperatorType(){return 10404}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,r,i,s,a,o){let u;"string"==typeof r?(u=new Ve({jsonString:r}),u.nextToken()):u=r,1!==u.currentToken()&&n("failed to import map geometry: start of object is expected");const m=ne(t,e,u,i,s);return new v(m)}importSpatialReference(e){const n=ie(e);return null===n&&t("failed to import spatial reference"),n}importProjectionTransformation(e,t){return r(0),{}}importDatumTransformation(e,t){return r(0),{}}static stringToGeometryType(e){return(e=e.toLowerCase()).startsWith("esrigeometry")||n("string_to_geometry_type"),e.endsWith("point")?a.enumPoint:e.endsWith("envelope")?a.enumEnvelope:e.endsWith("multipoint")?a.enumMultiPoint:e.endsWith("polyline")?a.enumPolyline:e.endsWith("polygon")?a.enumPolygon:void n("string_to_geometry_type")}}const Me=new ee,Ue=new Ce,We=new Re;function Xe(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function Ge(t,n=!1){if(!n&&(q(t)||K(t)||J(t)||Q(t))){const n=new v;return n.setGeometry(e(L(t))),n}const r=new $(t,{strict:!1});return r.nextToken(),We.execute(0,a.enumUnknown,r,!0,!1)}function Le(e){let t=null;return[e.map(e=>{if(null==t){const n=Ye(e);return t=n.getSpatialReference(),n.getGeometry()}return qe(e)}),t]}function Ye(e){const t=Ge(e),n=Je(e.spatialReference);return n&&t.setSpatialReference(n),t}function qe(e){return Ge(e).getGeometry()}function Ke(e){return Ge(e,!0).getGeometry()}function Je(e){if(null==e)return null;let t=!1;if(e instanceof Y){const{wkt2:n}=e;e=e.toJSON(),e.wkt2??=n,t=!0}(e.latestVcsWkid||e.vcsWkid)&&(t||(e={...e}),delete e?.latestVcsWkid,delete e?.vcsWkid);const n=new $(e,{strict:!1});n.nextToken();const r=We.importSpatialReference(n);return 0===r.getCoordinateSystemType()?null:r}function Qe(e,t){if(e instanceof v&&(t=e.getSpatialReference(),e=e.getGeometry()),null==e||e.isEmpty())return null;let n;switch(e.getGeometryType()){case a.enumPoint:case a.enumMultiPoint:case a.enumPolyline:case a.enumPolygon:n=X(e)}if(n){const e=G(n);return e.spatialReference=Ze(t),null==e.spatialReference&&delete e.spatialReference,e}return Me.reset(),Ue.execute(0,e,t??null,Me),Me.getObject()}function Ze(e){return null==e||0===e.getCoordinateSystemType()?null:(Me.reset(),Ue.execute(0,null,e,Me),Me.getObject().spatialReference)}export{Le as fromGeometries,Ye as fromGeometry,qe as fromGeometryToGXGeometry,Ke as fromGeometryToGXGeometryUsingImportOperator,Je as fromSpatialReference,Xe as getSpatialReference,Qe as toGeometry,Ze as toSpatialReference};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{a7 as e,v as t,x as n,C as s,B as a,A as r,a8 as i,E as o}from"../../../chunks/UnitFactory.js";import"../../../chunks/Point2D.js";import"../../../chunks/Envelope.js";import"../../../chunks/Geometry.js";import{Envelope2D as c}from"../../../chunks/Envelope2D.js";function f(c,f,m){let u,l;if(m?.geographicTransformation){if(m.geographicTransformation.steps?.length){const s=new e;s.setInputSpatialReference(c),s.setOutputSpatialReference(f);for(const e of m.geographicTransformation.steps){let a;a=e.wkid?t(e.wkid,e.isInverse):n(e.wkt,e.isInverse),s.add(a)}u=s.create()}else u=i();if(m.extendedParams){l=o();const{densificationStep:e}=m.extendedParams;null!=e&&(l.densificationStep=e)}}else if(m?.areaOfInterestExtent)return s(c,f,p(m.areaOfInterestExtent));return u?a(c,f,u,l):r(c,f)}function p(e){return c.construct(e.xmin,e.ymin,e.xmax,e.ymax)}export{f as createProjectionTransformation};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.
|
|
2
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.2.0-next.82",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
package/layers/raster/types.d.ts
CHANGED
|
@@ -59,9 +59,15 @@ export default class AggregateField extends JSONSupport {
|
|
|
59
59
|
*/
|
|
60
60
|
accessor alias: string | null | undefined;
|
|
61
61
|
/**
|
|
62
|
-
* Indicates whether the field
|
|
63
|
-
* default [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) visualizations.
|
|
64
|
-
*
|
|
62
|
+
* Indicates whether the field is automatically generated by the JS API's rendering engine for
|
|
63
|
+
* default [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) visualizations. Auto-generated aggregate fields
|
|
64
|
+
* are discarded and replaced when the underlying layer's renderer changes.
|
|
65
|
+
*
|
|
66
|
+
* Set this property to `false` to retain an auto-generated aggregate field when the underlying layer's
|
|
67
|
+
* renderer changes. To retain an auto-generated cluster renderer that uses this field, also set
|
|
68
|
+
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) to `false` on the
|
|
69
|
+
* [cluster renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#renderer). When `true`, all other
|
|
70
|
+
* properties of the AggregateField are read-only.
|
|
65
71
|
*
|
|
66
72
|
* @default false
|
|
67
73
|
* @since 4.25
|
|
@@ -476,9 +476,14 @@ export interface FeatureReductionClusterProperties extends Partial<Pick<FeatureR
|
|
|
476
476
|
* See [Styles and configurations](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#styles-and-configurations)
|
|
477
477
|
* for more information about this behavior. In this scenario, the renderer will be persisted when
|
|
478
478
|
* the layer is saved to the web map, but it will be flagged as "auto generated" in the
|
|
479
|
-
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property of the
|
|
480
|
-
* the [
|
|
481
|
-
*
|
|
479
|
+
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property of the [Renderer.authoringInfo](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/#authoringInfo) object.
|
|
480
|
+
* By default, the renderer and any auto-generated [AggregateFields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/) it uses are
|
|
481
|
+
* discarded and replaced each time the underlying layer's renderer changes.
|
|
482
|
+
*
|
|
483
|
+
* To retain an auto-generated cluster renderer as an explicit renderer, set the cluster renderer's
|
|
484
|
+
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property to `false`.
|
|
485
|
+
* To retain an auto-generated aggregate field used by that renderer, set its
|
|
486
|
+
* [AggregateField.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/#isAutoGenerated) property to `false`.
|
|
482
487
|
*
|
|
483
488
|
* This property allows you to override the auto generated cluster styling using any
|
|
484
489
|
* renderer type suitable for point geometries. For example, if you want to render clusters
|
|
@@ -1192,9 +1197,14 @@ export default class FeatureReductionCluster extends FeatureReductionClusterSupe
|
|
|
1192
1197
|
* See [Styles and configurations](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/#styles-and-configurations)
|
|
1193
1198
|
* for more information about this behavior. In this scenario, the renderer will be persisted when
|
|
1194
1199
|
* the layer is saved to the web map, but it will be flagged as "auto generated" in the
|
|
1195
|
-
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property of the
|
|
1196
|
-
* the [
|
|
1197
|
-
*
|
|
1200
|
+
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property of the [Renderer.authoringInfo](https://developers.arcgis.com/javascript/latest/references/core/renderers/Renderer/#authoringInfo) object.
|
|
1201
|
+
* By default, the renderer and any auto-generated [AggregateFields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/) it uses are
|
|
1202
|
+
* discarded and replaced each time the underlying layer's renderer changes.
|
|
1203
|
+
*
|
|
1204
|
+
* To retain an auto-generated cluster renderer as an explicit renderer, set the cluster renderer's
|
|
1205
|
+
* [AuthoringInfo.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/renderers/support/AuthoringInfo/#isAutoGenerated) property to `false`.
|
|
1206
|
+
* To retain an auto-generated aggregate field used by that renderer, set its
|
|
1207
|
+
* [AggregateField.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/#isAutoGenerated) property to `false`.
|
|
1198
1208
|
*
|
|
1199
1209
|
* This property allows you to override the auto generated cluster styling using any
|
|
1200
1210
|
* renderer type suitable for point geometries. For example, if you want to render clusters
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import s from"../../request.js";import r from"../../core/Accessor.js";import{result as t}from"../../core/asyncUtils.js";import o from"../../core/Logger.js";import{getOrCreateMapValue as a}from"../../core/MapUtils.js";import{whenOrAbort as l,isAbortError as n}from"../../core/promiseUtils.js";import{subclass as i}from"../../core/accessorSupport/decorators.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import{parse as c}from"./arcgisLayerUrl.js";let u=class extends r{constructor(e){super(e),this._abortController=new AbortController,this._pendingBatches=new Map,this._flushHandle=void 0,this._flushDeadline=null,this._flushInProgress=!1,this._flushRequested=!1}async fetch(e,s){const r=c(e?.url)?.url.path;if(!e||!r)return null;const t=f(e,r,s),o=e.layerId,n=a(this._pendingBatches,m(t),()=>({...t,layers:new Map})),i=a(n.layers,o,()=>({resolvers:[],serverGen:s.serverGen}));if(i.serverGen!==s.serverGen)throw new Error(`I3SExtractChanges: serverGen mismatch for layer ${e.title} (${o}). Expected ${i.serverGen}, got ${s.serverGen}.`);const h=Promise.withResolvers();return i.resolvers.push(h),this._scheduleFlush(),l(h.promise,s)}destroy(){clearTimeout(this._flushHandle),this._flushHandle=void 0,this._flushDeadline=null,this._flushRequested=!1;for(const e of this._pendingBatches.values())this._resolveBatch(e,null);this._pendingBatches.clear(),this._abortController.abort()}_scheduleFlush(){if(!this.batchingEnabled)return void this._flushSerially().catch(()=>{});const e=Date.now();this._flushDeadline??=e+g,clearTimeout(this._flushHandle);const s=Math.min(y,Math.max(0,this._flushDeadline-e));this._flushHandle=setTimeout(()=>{this._flushHandle=void 0,this._flushDeadline=null,this._flushSerially().catch(()=>{})},s)}async _flushSerially(){if(this._flushInProgress)this._flushRequested=!0;else{this._flushInProgress=!0;try{do{this._flushRequested=!1,await this._flush()}while(this._flushRequested)}finally{this._flushInProgress=!1}}}async _flush(){const e=Array.from(this._pendingBatches.values());this._pendingBatches.clear(),await Promise.all(e.map(e=>this._fetchBatch(e)))}async _fetchBatch(e){const{layers:r}=e,o=Array.from(r.keys()),a={...e.customParameters,f:"json",returnIdsOnly:!0,layers:JSON.stringify(o),returnUpdates:!0,returnDeletes:e.returnGeometryChanges,returnInserts:e.returnGeometryChanges,layerServerGens:JSON.stringify(Array.from(r,([e,{serverGen:s}])=>({id:e,serverGen:s})))};null!=e.apiKey&&(a.token=e.apiKey),e.fieldsToCompare.length>0&&(a.fieldsToCompare=JSON.stringify({fields:e.fieldsToCompare}));const l=await t(s(`${e.serviceUrl}/extractChanges`,{method:"post",query:a,timeout:p,signal:this._abortController.signal}));if(!l.ok)return n(l.error)||this._logUnavailable(),void this._resolveBatch(e,null);const i=new Map(l.value.data?.edits?.map(e=>[e.id,e]));for(const[s,t]of r){const r=i.get(s),o=null!=r?this._getChangedObjectIdsFromExtractChanges(r,e.returnGeometryChanges):new d;for(const e of t.resolvers)e.resolve(o)}}_resolveBatch(e,s){for(const r of e.layers.values())for(const e of r.resolvers)e.resolve(s)}_logUnavailable(){o.getLogger(this.layer).warn("extractChanges:unavailable",this.layer.title,": could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.")}_getChangedObjectIdsFromExtractChanges(e,s){const r=e.objectIds,t=e.fieldUpdates,o=r?.adds??[],a=r?.updates??[],l=r?.deletes??[];return new d([...o,...a,...l],s?[...o,...t??a,...l]:[])}};e([h()],u.prototype,"layer",void 0),e([h()],u.prototype,"batchingEnabled",void 0),u=e([i("esri.layers.support.I3SExtractChanges")],u);class d{constructor(e=[],s=[]){this.attributeChangedObjectIds=e,this.geometryChangedObjectIds=s}}function f(e,s,r){const t=r.returnGeometryChanges?e.infoFor3D:null,o=null!=t?[...new Set([...Object.values(t.transformFieldRoles),t.sourceHashField])].sort():[];return{serviceUrl:s,customParameters:e.customParameters?{...e.customParameters}:{},apiKey:e.apiKey,returnGeometryChanges:r.returnGeometryChanges,fieldsToCompare:o}}function m(e){return JSON.stringify([e.serviceUrl,Object.entries(e.customParameters).sort(([e],[s])=>e.localeCompare(s)),e.apiKey??null,e.returnGeometryChanges,e.fieldsToCompare])}const p=1e4,y=200,g=600;export{d as I3SChangedObjectIds,u as I3SExtractChanges,g as extractChangesFetchMaxWait,y as extractChangesFetchQuietTime};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.82",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.2",
|
|
23
|
-
"@arcgis/toolkit": "^5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "^5.2.0-next.77",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.50",
|
|
26
26
|
"@vaadin/grid": "~25.2.8",
|
|
27
27
|
"@zip.js/zip.js": "~2.8.51",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
29
|
-
"marked": "~18.0.
|
|
29
|
+
"marked": "~18.0.10",
|
|
30
30
|
"tslib": "^2.8.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -117,9 +117,14 @@ export default class AuthoringInfo extends JSONSupport {
|
|
|
117
117
|
*/
|
|
118
118
|
accessor focus: RelationshipFocus | null | undefined;
|
|
119
119
|
/**
|
|
120
|
-
* Indicates whether the renderer
|
|
121
|
-
* default [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) visualizations.
|
|
122
|
-
*
|
|
120
|
+
* Indicates whether the renderer is automatically generated by the JS API's rendering engine for
|
|
121
|
+
* default [FeatureReductionCluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) visualizations. Auto-generated cluster renderers
|
|
122
|
+
* are discarded and replaced when the underlying layer's renderer changes.
|
|
123
|
+
*
|
|
124
|
+
* Set this property to `false` to retain an auto-generated cluster renderer as an explicit renderer
|
|
125
|
+
* when the underlying layer's renderer changes. To retain any auto-generated
|
|
126
|
+
* [AggregateFields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/) used by that renderer, also set their
|
|
127
|
+
* [AggregateField.isAutoGenerated](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AggregateField/#isAutoGenerated) property to `false`.
|
|
123
128
|
*
|
|
124
129
|
* @default false
|
|
125
130
|
*/
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const c="
|
|
2
|
+
const c="20260820",b="9224c7c8ac7c7fbcb431e951c077049cc9e0d64b";export{c as buildDate,b as commitHash};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as h}from"../../../core/reactiveUtils.js";import{isScreenRect as p}from"../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../core/accessorSupport/decorators.js";import u from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as f}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/mathUtils.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import S from"../engine/webgl/OverlayContainer.js";import{LayerView2D as E}from"./LayerView2D.js";import{getMapPointsFromScreen as T}from"../support/hitTestUtils.js";import R from"../../layers/MediaLayerView.js";import{TaskPriority as G}from"../../support/Scheduler.js";let U=class extends(E(R)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([h(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),h(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new S,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:G.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],n=p(t);for(const{elementView:{normalizedCoords:o,element:l}}of this._elementReferences.values())if(n){const r=T(this.view,t).map(e=>[e.x,e.y]);null!=o&&y(r,o.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=o&&f(o.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(q,e,!0);const r=new u({xmin:q[0],ymin:q[1],xmax:q[2],ymax:q[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([c({readOnly:!0})],U.prototype,"elements",void 0),U=e([d("esri.views.2d.layers.MediaLayerView2D")],U);const q=g(),V={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(q,t.key,!0),V.xmin=q[0],V.ymin=q[1],V.xmax=q[2],V.ymax=q[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=U;export{M as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as n}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import l from"../../../core/ReactiveMap.js";import{watch as a,syncAndInitial as m,on as c}from"../../../core/reactiveUtils.js";import{isScreenRect as h}from"../../../core/screenUtils.js";import{property as p,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../geometry/Extent.js";import{create as f}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as g}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as y,extentIntersectsPolygon as j}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as _}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../Viewpoint.js";import"../../../core/mathUtils.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/GpuMeshState.js";import"../engine/webgl/shaderGraph/techniques/shaders/Tile.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/ViewInfo.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import w from"../tiling/TileQueue.js";import v from"../tiling/TileStrategy.js";import b from"../engine/webgl/Overlay.js";import E from"../engine/webgl/OverlayContainer.js";import{LayerView2D as S}from"./LayerView2D.js";import{getMapPointsFromScreen as R}from"../support/hitTestUtils.js";import T from"../../layers/MediaLayerView.js";import{TaskPriority as G}from"../../support/Scheduler.js";let U=class extends(S(T)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new l,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([a(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import("./support/MediaLayerInteraction.js"));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},m),a(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},m),a(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},m)])}isUpdating(){return!0===this._interaction?.updating||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([c(()=>this.layer.effectiveSource,"refresh",()=>{const e=this.layer.effectiveSource;if(e)for(const{elementView:{element:t}}of this._elementReferences.values())e.hasElement(t)||this._removeElementReference(t);this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),c(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new E,this.container.addChild(this._overlayContainer),this._fetchQueue=new w({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:G.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new v({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y],n=h(t);for(const{elementView:{normalizedCoords:o,element:l}}of this._elementReferences.values())if(n){const r=R(this.view,t).map(e=>[e.x,e.y]);null!=o&&y(r,o.rings)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:null,sourcePoint:l.toSource(e)})}else null!=o&&g(o.rings,s)&&i.push({type:"media",element:l,layer:this.layer,mapPoint:e,sourcePoint:l.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new x(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(q,e,!0);const r=new d({xmin:q[0],ymin:q[1],xmax:q[2],ymax:q[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){n(this._elementReferences,t.uid,()=>{const e=new _({element:t,spatialReference:this.view.spatialReference}),r=new b(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i&&(i.tiles.delete(e),i.tiles.size||this._removeElementReference(t))}_removeElementReference(e){const t=this._elementReferences.get(e.uid);t&&(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),this._debugGraphicsView?.graphics.remove(t.debugGraphic))}_elementUpdateHandler(e){if(!this.layer.effectiveSource?.hasElement(e))return;let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return void this._removeElementReference(e);const r=[],s=[];for(const e of this._tileStrategy.tiles){const n=C(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?n||s.push(e):n&&r.push(e)}for(const t of r)this._referenceElement(t,e);for(const t of s)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new _({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const r of this._tileStrategy.tiles){C(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}}};e([p({readOnly:!0})],U.prototype,"elements",void 0),U=e([u("esri.views.2d.layers.MediaLayerView2D")],U);const q=f(),V={xmin:0,ymin:0,xmax:0,ymax:0};function C(e,t,i){return e.getTileBounds(q,t.key,!0),V.xmin=q[0],V.ymin=q[1],V.xmax=q[2],V.ymax=q[3],j(V,i)}class x{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const r of e)i.has(r)?i.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const M=U;export{M as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,initial as r,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import"../../../../core/has.js";import{destroyMaybe as i}from"../../../../core/maybe.js";import{watch as s,initial as r,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{property as n,subclass as a}from"../../../../core/accessorSupport/decorators.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as c,fromPoints as u}from"../../../../geometry/support/lineSegment.js";import{absoluteHeightElevationInfo as h,getConvertedElevation as p}from"../../../../support/elevationInfoUtils.js";import{LineOfSightInteractionVisuals as v}from"./LineOfSightInteractionVisuals.js";import{Settings as d}from"../../interactive/editingTools/settings.js";import{VerticesVisualElement as f}from"../../interactive/visualElements/VerticesVisualElement.js";let V=class extends t{constructor(e){super(e),this.elevationInfo=null,this.analysisVisible=!0,this._active=!1,this._rendererVisuals=new Map,this._observerRenderLocation=l(),this._targetRenderLocation=l(),this._laserLineSegment=c(),this._settings=new d({getTheme:()=>this.view.effectiveTheme})}initialize(){this._interactionVisuals=new v({view:this.view});const e=this._settings;this.addHandles([this._connectInteractionVisuals(),s(()=>({selectedColor:e.colors.selected.toUnitRGBA(),outlineColor:e.manipulators.vertex.outlineColor.toUnitRGBA()}),({selectedColor:e,outlineColor:t})=>{for(const{element:i}of this._rendererVisuals.values())i.color=e,i.outlineColor=t},r)])}destroy(){for(const e of this._rendererVisuals.keys())this.removeVisual(e);i(this._interactionVisuals)}activate(){this._active=!0,this._refreshVisuals(),this._refreshInteractionVisuals()}refresh(){this._refreshVisuals(),this._refreshInteractionVisuals()}deactivate(){this._active=!1;for(const{element:e}of this._rendererVisuals.values())e.attached=!1;this._interactionVisuals.hide()}addOrUpdateGraphic(e,t){}addOrUpdateVisual(e,t){const i=this._rendererVisuals.get(e),s=w(t,i?.props);if(!_(s))return void this.removeVisual(e);if(i)return i.props=s,this._applyVisual(i.element,s),void this._refreshInteractionVisuals();const r=this._settings,o=r.manipulators.vertex,n=new f({view:this.view,isDecoration:!0,spatialReference:this.view.renderCoordsHelper.spatialReference,elevationInfo:h,size:o.size,outlineSize:o.outlineSize,renderOccluded:o.renderOccluded,color:r.colors.selected.toUnitRGBA(),outlineColor:o.outlineColor.toUnitRGBA()});this._rendererVisuals.set(e,{element:n,props:s}),this._applyVisual(n,s),this._refreshInteractionVisuals()}removeGraphic(e){}removeVisual(e){const t=this._rendererVisuals.get(e);t&&(t.element.destroy(),this._rendererVisuals.delete(e),this._refreshInteractionVisuals())}hitTestVisualDistance(e,t){return null}_connectInteractionVisuals(){return s(()=>({active:this._active,analysisVisible:this.analysisVisible,cursorTargetElevationInfo:this.analysisViewData.cursorTarget?.elevationInfo,cursorTargetPosition:this.analysisViewData.cursorTarget?.position,observerElevationInfo:this.analysis.observer?.elevationInfo,observerPosition:this.analysis.observer?.position}),()=>this._refreshInteractionVisuals(),o)}_refreshVisuals(){for(const{element:e,props:t}of this._rendererVisuals.values())this._applyVisual(e,t)}_refreshInteractionVisuals(){const{_observerRenderLocation:e,_targetRenderLocation:t,_laserLineSegment:i,view:s}=this,r=this.analysis.observer,o=this.analysisViewData.cursorTarget;if(!this._active||!this.analysisVisible)return void this._interactionVisuals.hide();if(null==r?.position){const e=this._getObserverPreviewRenderLocation();return void this._interactionVisuals.update({target:e,visible:null!=e})}if(null==o?.position)return void this._interactionVisuals.hide();const n=g(s,r.position,r.elevationInfo,e),a=g(s,o.position,o.elevationInfo,t);if(null==n||null==a)return void this._interactionVisuals.hide();const l=u(n,a,i);this._interactionVisuals.update({target:a,lineVerticalPlaneSegment:l,visible:!0})}_getObserverPreviewRenderLocation(){for(const{props:e}of this._rendererVisuals.values()){if("cursor"!==e.role)continue;const t=m(e.geometry);return t?g(this.view,t,this.elevationInfo):null}return null}_applyVisual(e,t){const i=m(t.geometry);if(!i)return e.vertices=[],void(e.attached=!1);const s=g(this.view,i,this.elevationInfo);if(!s)return e.vertices=[],void(e.attached=!1);this._applyVisualStyle(e),e.vertices=[s],e.attached=this._active&&this.analysisVisible}_applyVisualStyle(e){const t=this._settings,i=t.manipulators.vertex;e.color=t.colors.selected.toUnitRGBA(),e.outlineColor=i.outlineColor.toUnitRGBA()}get test(){}};function _(e){return null!=m(e.geometry)&&("cursor"===e.role||"controlPoint"===e.role)}function m(e){if(!e)return null;switch(e.type){case"point":return e;case"multipoint":return y(e);default:return null}}function y(e){return 0===e.points.length?null:e.getPoint(e.points.length-1)}function g(e,t,i,s=l()){const r=p(e,t,i??h,h);return s[0]=t.x,s[1]=t.y,s[2]=r??0,e.renderCoordsHelper.toRenderCoords(s,t.spatialReference,s)?s:null}function w(e,t={geometry:null,role:"outputGeometry",state:"idle"}){return{...t,...e}}e([n({constructOnly:!0})],V.prototype,"analysis",void 0),e([n({constructOnly:!0})],V.prototype,"analysisViewData",void 0),e([n({constructOnly:!0})],V.prototype,"view",void 0),e([n()],V.prototype,"elevationInfo",void 0),e([n()],V.prototype,"analysisVisible",void 0),e([n()],V.prototype,"_active",void 0),V=e([a("esri.views.3d.analysis.LineOfSight.LineOfSightDrawToolRenderer")],V);export{V as LineOfSightDrawToolRenderer};
|