@arcgis/core 4.34.0-next.28 → 4.34.0-next.29

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.
Files changed (91) hide show
  1. package/applications/Components/featureUtils.d.ts +6 -0
  2. package/applications/Components/featureUtils.js +5 -0
  3. package/arcade/arcade.js +1 -1
  4. package/arcade/arcadeAsyncRuntime.js +1 -1
  5. package/arcade/arcadeCompiler.js +1 -1
  6. package/arcade/arcadeRuntime.js +1 -1
  7. package/arcade/functions/feature.js +1 -1
  8. package/arcade/functions/track.js +5 -0
  9. package/arcade/treeAnalysis.js +1 -1
  10. package/arcade.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/086f3bc5938bf9a37274.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7e5d3735a9c718591d64.js → 22f38cad0213f2112394.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{746c78e1c84f9612d69b.js → 2f54776ff86f397adc55.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{edfd8b482182803b44ca.js → 2fdf457786d2d5d7414f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/5192f38682f1f9be7da0.js +1 -0
  17. package/assets/esri/core/workers/chunks/{7ee50f75914d8d650af4.js → 63cb3dcd359e96733b1b.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{e49a95f2126ef9a994d3.js → 6ccd6171d3c572883034.js} +1 -1
  19. package/assets/esri/core/workers/chunks/89999baefa341bd3329c.js +1 -0
  20. package/assets/esri/core/workers/chunks/{629a924e99d5d6eb1998.js → 90a9b618058dc41294de.js} +1 -1
  21. package/assets/esri/core/workers/chunks/98f6d4ea026ed96fd3f3.js +1 -0
  22. package/assets/esri/core/workers/chunks/d3b1d1c389d70919fb02.js +1 -0
  23. package/assets/esri/core/workers/chunks/db81d881805f6f92a2e4.js +1 -0
  24. package/assets/esri/core/workers/chunks/e89698fc404379627349.js +1 -0
  25. package/assets/esri/core/workers/chunks/{0254ef9fb7f8ebb25304.js → ecc15622d6c434ea842b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{aa781b28dbe457427afc.js → fb71e533995c54cd806f.js} +1 -1
  27. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  28. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  29. package/chunks/OperatorGeodesicBuffer.js +1 -1
  30. package/chunks/OperatorGeodeticArea.js +1 -1
  31. package/chunks/OperatorGeodeticLength.js +1 -1
  32. package/chunks/OperatorProximityGeodesic.js +1 -1
  33. package/chunks/OperatorShapePreservingLength.js +1 -1
  34. package/chunks/OperatorShapePreservingProject.js +1 -1
  35. package/chunks/Terrain.glsl.js +11 -11
  36. package/chunks/UnitFactory.js +1 -1
  37. package/chunks/arcade.js +1 -1
  38. package/chunks/bundle.js +1 -1
  39. package/config.js +1 -1
  40. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  41. package/interfaces.d.ts +80 -2
  42. package/kernel.js +1 -1
  43. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  44. package/layers/ParquetLayer.js +1 -1
  45. package/layers/graphics/sources/ParquetSource.js +1 -1
  46. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  47. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  48. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  49. package/layers/orientedImagery/transformations/utils.js +1 -1
  50. package/layers/orientedImagery/transformations/worldToImage.js +1 -1
  51. package/layers/support/ParquetEncodingWkb.js +1 -1
  52. package/layers/support/layerUtils.js +1 -1
  53. package/layers/support/parquetUtils.js +1 -1
  54. package/libs/parquet/parquet.js +1 -1
  55. package/package.json +2 -2
  56. package/support/arcadeUtils.js +1 -1
  57. package/support/revision.js +1 -1
  58. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  59. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  60. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  61. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  62. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  63. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +5 -0
  64. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +5 -0
  65. package/views/2d/layers/features/sources/strategies/chunks/FeatureSourceEndChunk.js +5 -0
  66. package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +5 -0
  67. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  68. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  69. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  70. package/views/2d/layers/features/support/XZOrder.js +5 -0
  71. package/views/3d/terrain/TerrainRenderer.js +1 -1
  72. package/views/3d/webgl-engine/shaders/{ReadShadowMapConfiguration.js → ReceiveShadowsConfiguration.js} +1 -1
  73. package/views/draw/support/ConnectedReshapeManager.js +5 -0
  74. package/views/draw/support/Reshape.js +1 -1
  75. package/views/draw/support/layerUtils.js +1 -1
  76. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  77. package/widgets/Feature/support/featureUtils.js +1 -1
  78. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  79. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  80. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  81. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  82. package/widgets/OrientedImageryViewer/constants.js +1 -1
  83. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  84. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  85. package/widgets/PanoramicViewer.js +1 -1
  86. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  87. package/assets/esri/core/workers/chunks/16ff0bf4cb74f478ec1e.js +0 -1
  88. package/assets/esri/core/workers/chunks/1aff43dad2302677b4f4.js +0 -1
  89. package/assets/esri/core/workers/chunks/c6be02d2dff6e0734dab.js +0 -1
  90. package/assets/esri/core/workers/chunks/c8719205518e97131375.js +0 -1
  91. package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.t)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>T});var n=s(76061),i=s(55537),r=s(79187),o=s(39117),m=s(31635),a=s(88885),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new I(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new I(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new G(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.a3)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.O).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.r)((0,o.ao)());let m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let p,P,b;for(;null!==(p=s.next());){if(P=s.getGnomonic(),P!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==P&&(m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2)),n=P}if(s.isRunningInGnomonic()){if(P.project(p),s.needsSimplify()){const e=(0,h.b)(null,p,!0);p=(0,o.a3)(p,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(v(p)),a.tock()}else this.putInGridCursors(e,p,i,!0,l,_,f,d,g)}let x=!1;for(let e=0;e<6;e++)if(null!=g[e]){x=!0;break}if(x){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.ap,p=(new o.W).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.T).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.e)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.L).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(v(s)),p.tock()}b=p.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),P.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.a3)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(v(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.T).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.e)(l);b=n.unproject(u,_,this.m_progressTracker),b=(new o.L).execute(b,this.m_gcs,!0,this.m_progressTracker)}return b=(new o.O).foldInto360RangeGeodetic(b,this.m_gcs,2),b}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.ap,h[e]=(new o.W).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(v(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.f)(t,_),d=(0,h.c)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=C(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.a3)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.aq)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.ai.q(this.m_a,this.m_eSquared,h),_=o.ai.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.o,d=n+u.o,g=f-Math.PI,x=f+Math.PI,y=d+Math.PI,S=[Number.NaN],w=[Number.NaN],C=[Number.NaN],v=[Number.NaN];let D=!1;if(b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,S,w),b(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,C,v),(d<S[0]&&S[0]<y||d<w[0]&&w[0]<y)&&(D=!0),D||(g<C[0]&&C[0]<f||g<v[0]&&v[0]<f)&&(D=!0),!D&&i)return!1;const I=[];for(let t=e.length-1;t>=0;t--)I.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let G=0;G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,G,r,S[0],w[0]),G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,I,y,x,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,G,r,C[0],v[0]);let T=!1;return i||(T=this.checkAndPrepForPole(r)),D||T}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.as)(t.ymax,this.m_gcs90)&&!(0,o.as)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.as)(t.y,this.m_gcs90),n=(0,o.as)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.as)(n.y,this.m_gcs90),a=(0,o.as)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.as)(i.y,this.m_gcs90),m=(0,o.as)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const p=Math.ceil(g.width()/_);let P,b;i.x>m.x?(P=-_,b=this.m_gcs90):(P=_,b=-this.m_gcs90),n.setShiftCoords(P,0),t.addPath(e,0,!0),s.add(t,!1);const x=new h.P;for(let e=0;e<p;e++)s.applyTransformation(n),s.getPointByVal(0,x),t.lineToPoint(x),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),S=t.getXY(t.getPointCount()-1);y.y=b,S.y=b,t.lineTo(S);const w=new u.P;for(w.setCoordsPoint2D(S),w.x-=.5*P;Math.abs(w.x-y.x)>f;)t.lineTo(w),w.x-=.5*P;t.lineTo(y);const C=d.getCenterX(),v=new r.Envelope2D;t.queryEnvelope(v);let D=0;const I=v.getCenter().x;I-C>f?D=-Math.ceil((I-C-f)/_):C-I>f&&(D=Math.ceil((C-I-f)/_)),0!==D&&(n.setShiftCoords(D*_,0),t.applyTransformation(n));const G=new a.E,T=G.addGeometry(t);(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmin),(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmax);const k=G.getGeometry(T),M=(0,h.f)(k,d);M.inflateCoords(0,1);const E=(0,h.c)(null,M,!0).total(),N=(0,l.c)(k,d,E,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(N,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let p=e.createInstance();p.addPathPoint2D(null,0,!0);const P=new u.P;if(P.setCoords(g.xmin,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(g.xmin,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymin),p.insertPoint2D(0,-1,P),_){p.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),p.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(p);(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmax),p=r.getGeometry(m);const u=(0,h.f)(p,n);u.inflateCoords(0,1);const _=(0,h.c)(null,u,!0).total();p=(0,l.c)(p,n,_,Number.NaN,this.m_progressTracker)}else p.addPath(e,0,!0);e.setEmpty(),e.add(p,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),a=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.mS)(e,new o.a7,!1),g=(0,m.mS)(e,new o.a7,!1);o.ab.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.ab.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const p=(0,m.mS)(e,new o.a7,!1);if(o.ab.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,p,null,null,2),p.val<=this.m_convergenceOffset)break;i*=.9,o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}const g=i-n,p=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=p}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.mS)(e,new o.a7,!1),r=(0,m.mS)(e,new o.a7,!1),a=(0,m.mS)(e,new o.a7,!1);o.ab.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=(0,m.mS)(e,new o.a7,!1),f=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),d=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),g=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),p=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),P=new u.P,b=new u.P,x=new u.P,y=new u.P,S=0;let w=1;const C=i.val,v=r.val,D=C-.5*Math.PI,I=v+.5*Math.PI,G=a.val;for(o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,D,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val),o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,I,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(S+w);o.ab.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*G,C,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.ab.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),x.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.mS)(e,new o.a7,!1),u=(0,m.mS)(e,new o.a7,!1);o.ab.geodeticDistance(this.m_a,this.m_eSquared,P.x,P.y,b.x,b.y,a,u,null,2),o.ab.geodeticCoordinate(this.m_a,this.m_eSquared,P.x,P.y,.5*a.val,u.val,p.at(0),p.at(1),2),y.setCoords(p.at(0).val,p.at(1).val);const f=(0,m.mS)(e,new o.a7,!1);if(o.ab.geodeticDistance(this.m_a,this.m_eSquared,x.x,x.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,o.ab.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,w*G,C,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.mS)(e,new o.a7,!1);o.ab.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.ab.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),b.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}let T=w*G;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.m)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.g)(t,g.m_gcs,null);const p=(0,o.F)();g.m_gcs.querySpheroidData(p);const P=new r.Envelope2D;_.queryEnvelope(P),g.m_a=p.majorSemiAxis,g.m_eSquared=p.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.ai.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const b=g.m_gcs.getTolerance(0);g.m_radTolerance=b*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let x,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),x=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.e)((0,h.c)(g.m_sr,P,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),x=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),x=t,y=i.G.enumPolygon}}else x=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:x.getDescription()}):g.m_bShapePreserving?x:(0,o.ak)(x,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:x.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.ak)(x,t,4,Number.NaN,g.m_convergenceOffset,l);x=(new o.O).execute(e,g.m_transform,l)}else x=(new o.O).execute(x,g.m_transform,l);if(x=(0,o.ag)(x,g.m_gcs),x.isEmpty())return new a.a({vd:x.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(x=(0,o.an)(g.m_rpu,x)),x=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0);const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(x,g.m_gcs);let S=new a.a;switch(y){case i.G.enumPolygon:S=g.bufferPolygon(x);break;case i.G.enumPolyline:S=g.bufferPolyline(x);break;case i.G.enumMultiPoint:S=g.bufferMultiPoint(x);break;case i.G.enumPoint:S=g.bufferPoint(x);break;default:(0,i.n)("")}const w=(new o.O).execute(S,g.m_transform.getInverse(),l);return w.mergeVertexDescription(x.getDescription()),w}function p(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.mS)(f,new o.a7,!1),p=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1),P=new u.P,b=new u.P,y=r.at(-1),S=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.ab.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.ab.geodesicCoordinate(e,t,m.x,m.y,n,u,p.at(0),p.at(1)),c?b.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=x(m.x,P.x,d.x,l),b.setCoords(l+P.x,P.y),d.setCoordsPoint2D(b)),b.scale(S),_.insertPoint2D(0,-1,b)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function P(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const p=(0,m.mS)(g,new u.S(new o.a7,new o.a7),!1),P=new u.P,b=new u.P,y=new u.P;b.setNAN(),c||_.getPointCount()>0&&(b.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),b.scale(s));let S=Math.ceil(r/h),w=S++*h;w===r&&(w=S++*h);let C=r;const v=1/s;for(;w<a+h&&(C<f&&f<w?(w=f,S--):C<d&&d<w&&(w=d,S--),!(w>=a));)o.ab.geodesicCoordinate(e,t,i.x,i.y,n,w,p.at(0),p.at(1)),c?y.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=x(i.x,P.x,b.x,l),y.setCoords(l+P.x,P.y),b.setCoordsPoint2D(y)),y.scale(v),_.insertPoint2D(0,-1,y),C=w,w=S++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.hk)(g)}}function b(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1);o.ab.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.ab.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const p=(0,m.mS)(f,new o.a7,!1);for(o.ab.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,p,null,0),l[0]=p.val,o.ab.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,p,null,0),_[0]=p.val;l[0]<=_[0];)l[0]+=u.p;for(;l[0]>_[0];)l[0]-=u.p;for(;l[0]>=c;)l[0]-=u.p,_[0]-=u.p;for(;l[0]<c;)l[0]+=u.p,_[0]+=u.p}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function x(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.p;for(;e-(n+t)>Math.PI;)n+=u.p;return n}return n+t-s>Math.PI?n-=u.p:s-(n+t)>Math.PI&&(n+=u.p),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.mS)(a,new o.a7,!1),l=(0,m.mS)(a,new o.a7,!1),_=(0,m.mS)(a,new o.a7,!1);o.ab.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.ab.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.ab.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.mS)(a,new o.a7,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.ab.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function S(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.at)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function w(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.mS)(a,new o.a7,!1);return o.ab.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function C(e,t){return new o.ay(e,t)}function v(e){return(0,h.h)(e,0)||(0,h.s)(e,0),e}class D{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class I extends D{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.ax)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.o;const i=this.m_endAzimuth[0]+u.o;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(u.p-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.p:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.p)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class G extends D{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.at)(e,t,n,75/180*Math.PI);return!!w(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class T{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.W).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.d)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.t)(""),t||(0,i.a)(""),0===t.getCoordinateSystemType()&&(0,i.a)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.c)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.a)("Geodesic_bufferer.buffer - bad distance"),(0,i.c)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.t)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>T});var n=s(76061),i=s(55537),r=s(79187),o=s(39117),m=s(31635),a=s(88885),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new I(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new I(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new G(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.a3)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.O).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.r)((0,o.ao)());let m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let p,P,x;for(;null!==(p=s.next());){if(P=s.getGnomonic(),P!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==P&&(m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2)),n=P}if(s.isRunningInGnomonic()){if(P.project(p),s.needsSimplify()){const e=(0,h.b)(null,p,!0);p=(0,o.a3)(p,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(v(p)),a.tock()}else this.putInGridCursors(e,p,i,!0,l,_,f,d,g)}let b=!1;for(let e=0;e<6;e++)if(null!=g[e]){b=!0;break}if(b){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.ap,p=(new o.W).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.T).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.e)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.L).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(v(s)),p.tock()}x=p.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),P.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.a3)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(v(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.T).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.e)(l);x=n.unproject(u,_,this.m_progressTracker),x=(new o.L).execute(x,this.m_gcs,!0,this.m_progressTracker)}return x=(new o.O).foldInto360RangeGeodetic(x,this.m_gcs,2),x}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.ap,h[e]=(new o.W).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(v(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.f)(t,_),d=(0,h.c)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=C(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.a3)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.aq)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.ai.q(this.m_a,this.m_eSquared,h),_=o.ai.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.o,d=n+u.o,g=f-Math.PI,b=f+Math.PI,y=d+Math.PI,S=[Number.NaN],w=[Number.NaN],C=[Number.NaN],v=[Number.NaN];let D=!1;if(x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,S,w),x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,C,v),(d<S[0]&&S[0]<y||d<w[0]&&w[0]<y)&&(D=!0),D||(g<C[0]&&C[0]<f||g<v[0]&&v[0]<f)&&(D=!0),!D&&i)return!1;const I=[];for(let t=e.length-1;t>=0;t--)I.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let G=0;G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,G,r,S[0],w[0]),G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,I,y,b,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,G,r,C[0],v[0]);let T=!1;return i||(T=this.checkAndPrepForPole(r)),D||T}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.as)(t.ymax,this.m_gcs90)&&!(0,o.as)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.as)(t.y,this.m_gcs90),n=(0,o.as)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.as)(n.y,this.m_gcs90),a=(0,o.as)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.as)(i.y,this.m_gcs90),m=(0,o.as)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const p=Math.ceil(g.width()/_);let P,x;i.x>m.x?(P=-_,x=this.m_gcs90):(P=_,x=-this.m_gcs90),n.setShiftCoords(P,0),t.addPath(e,0,!0),s.add(t,!1);const b=new h.P;for(let e=0;e<p;e++)s.applyTransformation(n),s.getPointByVal(0,b),t.lineToPoint(b),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),S=t.getXY(t.getPointCount()-1);y.y=x,S.y=x,t.lineTo(S);const w=new u.P;for(w.setCoordsPoint2D(S),w.x-=.5*P;Math.abs(w.x-y.x)>f;)t.lineTo(w),w.x-=.5*P;t.lineTo(y);const C=d.getCenterX(),v=new r.Envelope2D;t.queryEnvelope(v);let D=0;const I=v.getCenter().x;I-C>f?D=-Math.ceil((I-C-f)/_):C-I>f&&(D=Math.ceil((C-I-f)/_)),0!==D&&(n.setShiftCoords(D*_,0),t.applyTransformation(n));const G=new a.E,T=G.addGeometry(t);(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmin),(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmax);const k=G.getGeometry(T),M=(0,h.f)(k,d);M.inflateCoords(0,1);const E=(0,h.c)(null,M,!0).total(),N=(0,l.c)(k,d,E,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(N,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let p=e.createInstance();p.addPathPoint2D(null,0,!0);const P=new u.P;if(P.setCoords(g.xmin,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(g.xmin,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymin),p.insertPoint2D(0,-1,P),_){p.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),p.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(p);(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmax),p=r.getGeometry(m);const u=(0,h.f)(p,n);u.inflateCoords(0,1);const _=(0,h.c)(null,u,!0).total();p=(0,l.c)(p,n,_,Number.NaN,this.m_progressTracker)}else p.addPath(e,0,!0);e.setEmpty(),e.add(p,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),a=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.mS)(e,new o.a7,!1),g=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const p=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,p,null,null,2),p.val<=this.m_convergenceOffset)break;i*=.9,o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}const g=i-n,p=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=p}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.mS)(e,new o.a7,!1),r=(0,m.mS)(e,new o.a7,!1),a=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=(0,m.mS)(e,new o.a7,!1),f=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),d=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),g=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),p=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,b=new u.P,y=new u.P,S=0;let w=1;const C=i.val,v=r.val,D=C-.5*Math.PI,I=v+.5*Math.PI,G=a.val;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,D,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,I,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(S+w);o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*G,C,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),b.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.mS)(e,new o.a7,!1),u=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,P.x,P.y,x.x,x.y,a,u,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,P.x,P.y,.5*a.val,u.val,p.at(0),p.at(1),2),y.setCoords(p.at(0).val,p.at(1).val);const f=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,b.x,b.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,w*G,C,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}let T=w*G;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.m)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.g)(t,g.m_gcs,null);const p=(0,o.F)();g.m_gcs.querySpheroidData(p);const P=new r.Envelope2D;_.queryEnvelope(P),g.m_a=p.majorSemiAxis,g.m_eSquared=p.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.ai.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const x=g.m_gcs.getTolerance(0);g.m_radTolerance=x*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let b,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),b=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.e)((0,h.c)(g.m_sr,P,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),b=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolygon}}else b=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:b.getDescription()}):g.m_bShapePreserving?b:(0,o.ak)(b,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:b.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.ak)(b,t,4,Number.NaN,g.m_convergenceOffset,l);b=(new o.O).execute(e,g.m_transform,l)}else b=(new o.O).execute(b,g.m_transform,l);if(b=(0,o.af)(b,g.m_gcs),b.isEmpty())return new a.a({vd:b.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(b=(0,o.an)(g.m_rpu,b)),b=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0);const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(b,g.m_gcs);let S=new a.a;switch(y){case i.G.enumPolygon:S=g.bufferPolygon(b);break;case i.G.enumPolyline:S=g.bufferPolyline(b);break;case i.G.enumMultiPoint:S=g.bufferMultiPoint(b);break;case i.G.enumPoint:S=g.bufferPoint(b);break;default:(0,i.n)("")}const w=(new o.O).execute(S,g.m_transform.getInverse(),l);return w.mergeVertexDescription(b.getDescription()),w}function p(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.mS)(f,new o.a7,!1),p=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=r.at(-1),S=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.a8.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.a8.geodesicCoordinate(e,t,m.x,m.y,n,u,p.at(0),p.at(1)),c?x.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(m.x,P.x,d.x,l),x.setCoords(l+P.x,P.y),d.setCoordsPoint2D(x)),x.scale(S),_.insertPoint2D(0,-1,x)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function P(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const p=(0,m.mS)(g,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=new u.P;x.setNAN(),c||_.getPointCount()>0&&(x.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),x.scale(s));let S=Math.ceil(r/h),w=S++*h;w===r&&(w=S++*h);let C=r;const v=1/s;for(;w<a+h&&(C<f&&f<w?(w=f,S--):C<d&&d<w&&(w=d,S--),!(w>=a));)o.a8.geodesicCoordinate(e,t,i.x,i.y,n,w,p.at(0),p.at(1)),c?y.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(i.x,P.x,x.x,l),y.setCoords(l+P.x,P.y),x.setCoordsPoint2D(y)),y.scale(v),_.insertPoint2D(0,-1,y),C=w,w=S++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.hk)(g)}}function x(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1);o.a8.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.a8.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const p=(0,m.mS)(f,new o.a7,!1);for(o.a8.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,p,null,0),l[0]=p.val,o.a8.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,p,null,0),_[0]=p.val;l[0]<=_[0];)l[0]+=u.p;for(;l[0]>_[0];)l[0]-=u.p;for(;l[0]>=c;)l[0]-=u.p,_[0]-=u.p;for(;l[0]<c;)l[0]+=u.p,_[0]+=u.p}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function b(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.p;for(;e-(n+t)>Math.PI;)n+=u.p;return n}return n+t-s>Math.PI?n-=u.p:s-(n+t)>Math.PI&&(n+=u.p),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.mS)(a,new o.a7,!1),l=(0,m.mS)(a,new o.a7,!1),_=(0,m.mS)(a,new o.a7,!1);o.a8.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.a8.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.a8.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.mS)(a,new o.a7,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.a8.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function S(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.at)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function w(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.mS)(a,new o.a7,!1);return o.a8.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function C(e,t){return new o.ay(e,t)}function v(e){return(0,h.h)(e,0)||(0,h.s)(e,0),e}class D{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class I extends D{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.ax)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.o;const i=this.m_endAzimuth[0]+u.o;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(u.p-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.p:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.p)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class G extends D{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.at)(e,t,n,75/180*Math.PI);return!!w(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class T{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.W).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.d)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.t)(""),t||(0,i.a)(""),0===t.getCoordinateSystemType()&&(0,i.a)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.c)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.a)("Geodesic_bufferer.buffer - bad distance"),(0,i.c)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9926],{18047:(e,t,n)=>{n.d(t,{ZV:()=>u,yx:()=>l});var r=n(73444);const i={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let a=new WeakMap,o={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function u(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!a.has(t)){const n=(0,r.lR)(),o=n&&i[n]||(0,r.QC)();a.set(t,new Intl.NumberFormat(o,e))}return a.get(t)}(t).format(e)}(0,r.Ml)(()=>{a=new WeakMap,o={}}),new Map},29926:(e,t,n)=>{n.r(t),n.d(t,{applyTextFormattingHTML:()=>W,createFieldInfoMap:()=>J,findRelatedLayer:()=>oe,findUtilityNetwork:()=>le,fixTokens:()=>j,formatAttributes:()=>B,formatEditInfo:()=>V,formatValueToFieldInfo:()=>G,getAllFieldInfos:()=>P,getFieldInfo:()=>Q,getFieldInfoLabel:()=>A,getFixedFieldName:()=>k,getFixedFieldNames:()=>q,getSourceLayer:()=>N,graphicCallback:()=>C,htmlEntities:()=>_,isAssociatedFeatureSupportedLayer:()=>O,isExpressionField:()=>Z,isFeatureSupportedLayer:()=>S,isGraphicForRelatableFeatureSupportedLayer:()=>z,isRelatableFeatureSupportedLayer:()=>$,isRelatableLayer:()=>D,isRelatedField:()=>ee,preLayerQueryCallback:()=>ie,preRequestCallback:()=>ae,querySourceLayer:()=>K,queryUpdatedFeature:()=>X,shouldOpenInNewTab:()=>x,substituteAttributes:()=>v,substituteFieldsInLinksAndAttributes:()=>M});var r=n(44208),i=n(53966),a=n(799),o=n(97770),l=n(18047),u=n(30524),s=n(77548),f=n(4560),c=n(43668),d=n(56400);const p=()=>i.A.getLogger("esri.widgets.Feature.support.featureUtils"),y=/href=(""|'')/gi,m=/(\{([^{\r\n]+)\})/g,b=/'/g,g=/^\s*expression\//i,I=/(\n)/gi,h=/[\u00A0-\u9999<>&]/gim,F=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,w=/^(?:mailto:|tel:)/,T="relationships/",L=(0,o.J2)("short-date-short-time");function N(e){if(null!=e)return(e.sourceLayer||e.layer)??void 0}async function C({type:e,value:t,event:n}){try{return"function"==typeof t?t(n):await t}catch(r){return void p().error("error",`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t})}}function x(e=""){if(e)return!w.test(e.trim().toLowerCase())}function Z(e){return!!e&&g.test(e)}function A(e,t){const n=function(e,t){if(!t||!Z(t)||!e)return;const n=t.replace(g,"").toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function k(e,t){const n=R(t,e);return n?n.name:e}function q(e,t){return e&&e.map(e=>k(e,t))}function R(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function E(e){return`${e}`.trim()}function M({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?v({formattedAttributes:t,template:U(r,{...t,...i,...e},n),fieldInfoMap:a}):""}function v({formattedAttributes:e,template:t,fieldInfoMap:n}){return E(function(e){return e.replaceAll(y,"")}((0,a.HC)((0,a.HC)(t,e=>function(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}(e,n)),e)))}function j(e,t){return e.replaceAll(m,(e,n,r)=>{const i=R(t,r);return i?`{${i.name}}`:n})}function U(e,t,n){const r=j(e,n);return r?r.replaceAll(F,(e,n,r)=>function(e,t,n){const r=(t=E(t))&&"{"!==t[0];return(0,a.HC)(e,function(e,t=!1){const n={...e};return Object.keys(n).forEach(e=>function(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",a=(n?encodeURIComponent(r):r).replaceAll(b,i);t[e]=a}}(e,n,t)),n}(n,r||!1))}(e,n||r,t)):r}function S(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function D(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function $(e){return S(e)&&D(e)}function O(e){return!(!(e&&"object"==typeof e&&"createQuery"in e&&"getField"in e&&"queryFeatureCount"in e&&"queryFeatures"in e&&"queryObjectIds"in e&&"capabilities"in e&&"fields"in e&&"fieldsIndex"in e&&"type"in e)||"feature"!==e.type&&"subtype-group"!==e.type&&"subtype-sublayer"!==e.type&&"sublayer"!==e.type||!("when"in e))&&("subtype-sublayer"===e.type&&"parent"in e&&e.parent&&"object"==typeof e.parent?"globalIdField"in e.parent:"globalIdField"in e)}function z(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&$(e.sourceLayer)}function G(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:i,layer:a,timeZone:o}=t,s=Q(n,r),c=R(a,r);if(s&&!(0,u.JL)(r)){const t=c?.type,n=s.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||n)return(0,f.i0)(e,{format:n,fieldType:t,timeZoneOptions:{layerTimeZone:a&&"preferredTimeZone"in a?a.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!a||!("datesInUnknownTimezone"in a)||!a.datesInUnknownTimezone)}})}const d=s?.format;return"string"==typeof e&&(0,u.JL)(r)&&d?function(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?H(e,",",", ",t):e.includes(";")?H(e,";","; ",t):e.includes(" ")?H(e," "," ",t):(0,l.ZV)(Number(e),(0,l.yx)(t))}(e,d):"string"==typeof(e=function(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}(e,d))||null==e||null==d?W(e):(0,l.ZV)(e,i?{...(0,l.yx)(d),minimumFractionDigits:0,maximumFractionDigits:20}:(0,l.yx)(d))}function H(e,t,n,r){return e.trim().split(t).map(e=>(0,l.ZV)(Number(e),(0,l.yx)(r))).join(n)}function Q(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function V(e,t,n,r){const{creatorField:i,creationDateField:a,editorField:l,editDateField:u}=e;if(!t)return;const s=(0,d.hv)(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r)||!r.datesInUnknownTimezone),n,L,"date"),f={...L,...s},c=t[u];if("number"==typeof c){const e=t[l];return{type:"edit",date:(0,o.Yq)(c,f),user:e}}const p=t[a];if("number"==typeof p){const e=t[i];return{type:"create",date:(0,o.Yq)(p,f),user:e}}return null}function J(e,t){const n=new Map;if(!e)return n;for(const r of e){if(!r.fieldName)continue;const e=k(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function P(e){const t=[];if(!e)return t;const{fieldInfos:n,content:r}=e;return n&&t.push(...n),r&&Array.isArray(r)?(r.forEach(e=>{if("fields"===e.type){const n=e?.fieldInfos;n&&t.push(...n)}}),t):t}function _(e){return e.replaceAll(h,e=>`&#${e.charCodeAt(0)};`)}function W(e){return"string"==typeof e?e.replaceAll(I,'<br class="esri-text-new-line" />'):e}function Y(e){const{value:t,fieldName:n,fieldInfos:i,fieldInfoMap:a,layer:o,graphic:l,timeZone:s}=e;if(null==t)return"";const c=function({fieldName:e,value:t,graphic:n,layer:i}){if(ee(e))return null;if(!i||"function"!=typeof i.getFieldDomain)return null;const a=n&&i.getFieldDomain(e,{feature:n,excludeImpliedDomains:(0,r.A)("esri-widget-legacy-field-domain-calculation")});return a&&"coded-value"===a.type?a.getName(t):null}({fieldName:n,value:t,graphic:l,layer:o});if(c)return c;const d=function({fieldName:e,graphic:t,layer:n}){if(ee(e))return null;if(!n||"function"!=typeof n.getFeatureType)return null;const{typeIdField:r}=n;if(!r||e!==r)return null;const i=n.getFeatureType(t);return i?i.name:null}({fieldName:n,graphic:l,layer:o});if(d)return d;if(a.get(n.toLowerCase()))return G(t,{fieldInfos:i||Array.from(a.values()),fieldName:n,layer:o,timeZone:s});const p=o?.fieldsIndex?.get(n);return p&&((0,f.fs)(p)||(0,u.OH)(p))?(0,f.i0)(t,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o)||!o.datesInUnknownTimezone)}}):W(t)}function B({fieldInfos:e,attributes:t,layer:n,graphic:r,fieldInfoMap:i,relatedInfos:a,timeZone:o}){const l={};return a?.forEach(t=>function({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:n,timeZone:o})),t&&Object.keys(t).forEach(a=>{const u=t[a];l[a]=Y({fieldName:a,fieldInfos:e,fieldInfoMap:i,layer:n,value:u,graphic:r,timeZone:o})}),l}async function K(e,t){const{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:l}=e,u=a[0];if("number"!=typeof u&&"string"!=typeof u){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:n,graphic:r,objectId:u,requiredFields:i};return p().warn(e,t),null}if(!(0,s.BR)(n)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return p().warn(e,t),null}const f=n.createQuery();return f.objectIds=a,f.outFields=i?.length?i:[n.objectIdField],f.returnGeometry=!!o,f.returnZ=!!o,f.returnM=!!o,f.outSpatialReference=l,(await n.queryFeatures(f,t)).features[0]}async function X({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t)return;if("function"==typeof n.load&&await n.load(i),!e.attributes)return;const a=n.objectIdField,o=e.attributes[a];if(null==o)return;const l=[o],s=await t.getRequiredFields(n.fieldsIndex),f=(0,u.Kl)(e,s),d=f?[]:s.includes(a)?s:[...s,a],p=t.returnGeometry||await async function(e){if(!e.expressionInfos?.length)return!1;const t=await(0,c.l)(),{arcadeUtils:{hasGeometryFunctions:n}}=t;return n(e)}(t);if(f&&!p)return;const y=await K({layer:n,graphic:e,outFields:d,objectIds:l,returnGeometry:p,spatialReference:r},i);y&&(y.geometry&&(e.geometry=y.geometry),y.attributes&&(e.attributes={...e.attributes,...y.attributes}))}function ee(e=""){return!!e&&e.includes(T)}function te({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(l=>{const u=function(e){return e?`${T}${e.layerId}/${e.fieldName}`:""}({layerId:n.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=Y({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:a,value:s,graphic:t,timeZone:o})})}const ne=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},re=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=n.where?n.where:null,a=null!=n.geometry?n.geometry:null;ne(r)||ne(i)||"extent"===a?.type||"tile"===n.resultType||(n.cacheHint=!0)},ie=({query:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},ae=({queryPayload:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function oe(e,t,n){return e&&t&&n?"sublayer"===t.type?se({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||se({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):se({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||se({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function le(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(e=>e.isUtilityLayer(t)):null}function ue(e,t){return e?.allTables.find(e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url)}function se({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(const a of i){if("map-image"===a.type){const n=se({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||se({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!$(a))continue;if("sublayer"===r.type){if(a!==r&&a.id===n)return a.isTable?ue(e,a):a;continue}const i="scene"===r.type&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if("sublayer"!==a.type){if(a!==r&&a.url===i&&a.layerId===n)return a}else if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?ue(e,a):a}return null}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9926],{18047:(e,t,n)=>{n.d(t,{ZV:()=>u,yx:()=>l});var r=n(73444);const i={ar:"ar-u-nu-latn",bs:"sr-Latn-CS",nn:"no-NN"};let a=new WeakMap,o={};function l(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function u(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!a.has(t)){const n=(0,r.lR)(),o=n&&i[n]||(0,r.QC)();a.set(t,new Intl.NumberFormat(o,e))}return a.get(t)}(t).format(e)}(0,r.Ml)(()=>{a=new WeakMap,o={}}),new Map},29926:(e,t,n)=>{n.r(t),n.d(t,{applyTextFormattingHTML:()=>W,createFieldInfoMap:()=>J,findRelatedLayer:()=>oe,findUtilityNetwork:()=>le,fixTokens:()=>j,formatAttributes:()=>B,formatEditInfo:()=>V,formatValueToFieldInfo:()=>G,getAllFieldInfos:()=>P,getFieldInfo:()=>Q,getFieldInfoLabel:()=>Z,getFixedFieldName:()=>q,getFixedFieldNames:()=>A,getSourceLayer:()=>N,graphicCallback:()=>x,htmlEntities:()=>_,isAssociatedFeatureSupportedLayer:()=>O,isExpressionField:()=>k,isFeatureSupportedLayer:()=>S,isGraphicForRelatableFeatureSupportedLayer:()=>z,isRelatableFeatureSupportedLayer:()=>$,isRelatableLayer:()=>D,isRelatedField:()=>ee,preLayerQueryCallback:()=>ie,preRequestCallback:()=>ae,querySourceLayer:()=>K,queryUpdatedFeature:()=>X,shouldOpenInNewTab:()=>C,substituteAttributes:()=>v,substituteFieldsInLinksAndAttributes:()=>M});var r=n(44208),i=n(53966),a=n(799),o=n(97770),l=n(18047),u=n(30524),s=n(77548),f=n(4560),c=n(43668),d=n(56400);const p=()=>i.A.getLogger("esri.widgets.Feature.support.featureUtils"),y=/href=(""|'')/gi,m=/(\{([^{\r\n]+)\})/g,b=/'/g,g=/^\s*expression\//i,I=/(\n)/gi,h=/[\u00A0-\u9999<>&]/gim,F=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,w=/^(?:mailto:|tel:)/,T="relationships/",L=(0,o.J2)("short-date-short-time");function N(e){if(null!=e)return(e.sourceLayer||e.layer)??void 0}async function x({type:e,value:t,event:n}){try{return"function"==typeof t?t(n):await t}catch(r){return void p().error("error",`An error occurred when calling the "${e}" function`,{error:r,graphic:n.graphic,value:t})}}function C(e=""){if(e)return!w.test(e.trim().toLowerCase())}function k(e){return!!e&&g.test(e)}function Z(e,t){const n=function(e,t){if(!t||!k(t)||!e)return;const n=t.replace(g,"").toLowerCase();return e.find(({name:e})=>e.toLowerCase()===n)}(t,e?.fieldName);return n?n.title||null:e?e.label||e.fieldName:null}function q(e,t){const n=R(t,e);return n?n.name:e}function A(e,t){return e&&e.map(e=>q(e,t))}function R(e,t){return e&&"function"==typeof e.getField&&t?e.getField(t)??null:null}function E(e){return`${e}`.trim()}function M({attributes:e,globalAttributes:t,layer:n,text:r,expressionAttributes:i,fieldInfoMap:a}){return r?v({formattedAttributes:t,template:U(r,{...t,...i,...e},n),fieldInfoMap:a}):""}function v({formattedAttributes:e,template:t,fieldInfoMap:n}){return E(function(e){return e.replaceAll(y,"")}((0,a.HC)((0,a.HC)(t,e=>function(e,t){const n=t.get(e.toLowerCase());return`{${n?.fieldName||e}}`}(e,n)),e)))}function j(e,t){return e.replaceAll(m,(e,n,r)=>{const i=R(t,r);return i?`{${i.name}}`:n})}function U(e,t,n){const r=j(e,n);return r?r.replaceAll(F,(e,n,r)=>function(e,t,n){const r=(t=E(t))&&"{"!==t[0];return(0,a.HC)(e,function(e,t=!1){const n={...e};return Object.keys(n).forEach(e=>function(e,t,n=!1){const r=t[e];if("string"==typeof r){const i="%27",a=(n?encodeURIComponent(r):r).replaceAll(b,i);t[e]=a}}(e,n,t)),n}(n,r||!1))}(e,n||r,t)):r}function S(e){return null!=e&&"object"==typeof e&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&("feature"===e.type||"scene"===e.type||"subtype-group"===e.type||"subtype-sublayer"===e.type||"sublayer"===e.type)&&"when"in e}function D(e){return null!=e&&"object"==typeof e&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function $(e){return S(e)&&D(e)}function O(e){return!(!(e&&"object"==typeof e&&"createQuery"in e&&"getField"in e&&"queryFeatureCount"in e&&"queryFeatures"in e&&"queryObjectIds"in e&&"capabilities"in e&&"fields"in e&&"fieldsIndex"in e&&"type"in e)||"feature"!==e.type&&"subtype-group"!==e.type&&"subtype-sublayer"!==e.type&&"sublayer"!==e.type||!("when"in e))&&("subtype-sublayer"===e.type&&"parent"in e&&e.parent&&"object"==typeof e.parent?"globalIdField"in e.parent:"globalIdField"in e)}function z(e){return!!e&&"object"==typeof e&&"sourceLayer"in e&&$(e.sourceLayer)}function G(e,t){const{fieldInfos:n,fieldName:r,preventPlacesFormatting:i,layer:a,timeZone:o}=t,s=Q(n,r),c=R(a,r);if(s&&!(0,u.JL)(r)){const t=c?.type,n=s.format?.dateFormat;if("date"===t||"date-only"===t||"time-only"===t||"timestamp-offset"===t||n)return(0,f.i0)(e,{format:n,fieldType:t,timeZoneOptions:{layerTimeZone:a&&"preferredTimeZone"in a?a.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!a||!("datesInUnknownTimezone"in a)||!a.datesInUnknownTimezone)}})}const d=s?.format;return"string"==typeof e&&(0,u.JL)(r)&&d?function(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?H(e,",",", ",t):e.includes(";")?H(e,";","; ",t):e.includes(" ")?H(e," "," ",t):(0,l.ZV)(Number(e),(0,l.yx)(t))}(e,d):"string"==typeof(e=function(e,t){if("string"==typeof e&&t&&null==t.dateFormat&&(null!=t.places||null!=t.digitSeparator)){const t=Number(e);if(!isNaN(t))return t}return e}(e,d))||null==e||null==d?W(e):(0,l.ZV)(e,i?{...(0,l.yx)(d),minimumFractionDigits:0,maximumFractionDigits:20}:(0,l.yx)(d))}function H(e,t,n,r){return e.trim().split(t).map(e=>(0,l.ZV)(Number(e),(0,l.yx)(r))).join(n)}function Q(e,t){if(e?.length&&t)return e.find(e=>e.fieldName?.toLowerCase()===t.toLowerCase())}function V(e,t,n,r){const{creatorField:i,creationDateField:a,editorField:l,editDateField:u}=e;if(!t)return;const s=(0,d.hv)(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r)||!r.datesInUnknownTimezone),n,L,"date"),f={...L,...s},c=t[u];if("number"==typeof c){const e=t[l];return{type:"edit",date:(0,o.Yq)(c,f),user:e}}const p=t[a];if("number"==typeof p){const e=t[i];return{type:"create",date:(0,o.Yq)(p,f),user:e}}return null}function J(e,t){const n=new Map;if(!e)return n;for(const r of e){if(!r.fieldName)continue;const e=q(r.fieldName,t);r.fieldName=e,n.set(e.toLowerCase(),r)}return n}function P(e){const t=[];if(!e)return t;const{fieldInfos:n,content:r}=e;return n&&t.push(...n),r&&Array.isArray(r)?(r.forEach(e=>{if("fields"===e.type){const n=e?.fieldInfos;n&&t.push(...n)}}),t):t}function _(e){return e.replaceAll(h,e=>`&#${e.charCodeAt(0)};`)}function W(e){return"string"==typeof e?e.replaceAll(I,'<br class="esri-text-new-line" />'):e}function Y(e){const{value:t,fieldName:n,fieldInfos:i,fieldInfoMap:a,layer:o,graphic:l,timeZone:s}=e;if(null==t)return"";const c=function({fieldName:e,value:t,graphic:n,layer:i}){if(ee(e))return null;if(!i||"function"!=typeof i.getFieldDomain)return null;const a=n&&i.getFieldDomain(e,{feature:n,excludeImpliedDomains:(0,r.A)("esri-widget-legacy-field-domain-calculation")});return a&&"coded-value"===a.type?a.getName(t):null}({fieldName:n,value:t,graphic:l,layer:o});if(c)return c;const d=function({fieldName:e,graphic:t,layer:n}){if(ee(e))return null;if(!n||"function"!=typeof n.getFeatureType)return null;const{typeIdField:r}=n;if(!r||e!==r)return null;const i=n.getFeatureType(t);return i?i.name:null}({fieldName:n,graphic:l,layer:o});if(d)return d;if(a.get(n.toLowerCase()))return G(t,{fieldInfos:i||Array.from(a.values()),fieldName:n,layer:o,timeZone:s});const p=o?.fieldsIndex?.get(n);return p&&((0,f.fs)(p)||(0,u.OH)(p))?(0,f.i0)(t,{fieldType:p.type,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:s,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o)||!o.datesInUnknownTimezone)}}):W(t)}function B({fieldInfos:e,attributes:t,layer:n,graphic:r,fieldInfoMap:i,relatedInfos:a,timeZone:o}){const l={};return a?.forEach(t=>function({attributes:e,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a}){e&&t&&(t.relatedFeatures?.forEach(o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})),t.relatedStatsFeatures?.forEach(o=>te({attributes:e,graphic:o,relatedInfo:t,fieldInfoMap:n,fieldInfos:r,layer:i,timeZone:a})))}({attributes:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:e,layer:n,timeZone:o})),t&&Object.keys(t).forEach(a=>{const u=t[a];l[a]=Y({fieldName:a,fieldInfos:e,fieldInfoMap:i,layer:n,value:u,graphic:r,timeZone:o})}),l}async function K(e,t){const{layer:n,graphic:r,outFields:i,objectIds:a,returnGeometry:o,spatialReference:l}=e,u=a[0];if("number"!=typeof u&&"string"!=typeof u){const e="Could not query required fields for the specified feature. The feature's ID is invalid.",t={layer:n,graphic:r,objectId:u,requiredFields:i};return p().warn(e,t),null}if(!(0,s.BR)(n)?.operations?.supportsQuery){const e="The specified layer cannot be queried. The following fields will not be available.",t={layer:n,graphic:r,requiredFields:i,returnGeometry:o};return p().warn(e,t),null}const f=n.createQuery();return f.objectIds=a,f.outFields=i?.length?i:[n.objectIdField],f.returnGeometry=!!o,f.returnZ=!!o,f.returnM=!!o,f.outSpatialReference=l,(await n.queryFeatures(f,t)).features[0]}async function X({graphic:e,popupTemplate:t,layer:n,spatialReference:r},i){if(!n||!t)return;if("function"==typeof n.load&&await n.load(i),!e.attributes)return;const a=n.objectIdField,o=e.attributes[a];if(null==o)return;const l=[o],s=new Set(await t.getRequiredFields(n.fieldsIndex));null==n.timeInfo?.trackIdField||s.has(n.timeInfo.trackIdField)||await async function(e){if(!e.expressionInfos?.length)return!1;const t=await(0,c.l)(),{arcadeUtils:{requiresTrack:n}}=t;return n(e)}(t)&&s.add(n.timeInfo.trackIdField);const f=(0,u.Kl)(e,s),d=f?[]:s.has(a)?[...s]:[...s,a],p=t.returnGeometry||await async function(e){if(!e.expressionInfos?.length)return!1;const t=await(0,c.l)(),{arcadeUtils:{hasGeometryFunctions:n}}=t;return n(e)}(t);if(f&&!p)return;const y=await K({layer:n,graphic:e,outFields:d,objectIds:l,returnGeometry:p,spatialReference:r},i);y&&(y.geometry&&(e.geometry=y.geometry),y.attributes&&(e.attributes={...e.attributes,...y.attributes}))}function ee(e=""){return!!e&&e.includes(T)}function te({attributes:e,graphic:t,relatedInfo:n,fieldInfos:r,fieldInfoMap:i,layer:a,timeZone:o}){e&&t&&n&&Object.keys(t.attributes).forEach(l=>{const u=function(e){return e?`${T}${e.layerId}/${e.fieldName}`:""}({layerId:n.relation.id.toString(),fieldName:l}),s=t.attributes[l];e[u]=Y({fieldName:u,fieldInfos:r,fieldInfoMap:i,layer:a,value:s,graphic:t,timeZone:o})})}const ne=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},re=({layer:e,method:t,query:n,definitionExpression:r})=>{if(!e.capabilities?.query?.supportsCacheHint||"attachments"===t)return;const i=null!=n.where?n.where:null,a=null!=n.geometry?n.geometry:null;ne(r)||ne(i)||"extent"===a?.type||"tile"===n.resultType||(n.cacheHint=!0)},ie=({query:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},ae=({queryPayload:e,layer:t,method:n})=>{re({layer:t,method:n,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function oe(e,t,n){return e&&t&&n?"sublayer"===t.type?se({layers:t.layer?.allSublayers,map:e,relatedLayer:t,relationship:n})||se({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:n}):se({layers:e.allLayers,map:e,relatedLayer:t,relationship:n})||se({layers:e.allTables,map:e,relatedLayer:t,relationship:n}):null}function le(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(e=>e.isUtilityLayer(t)):null}function ue(e,t){return e?.allTables.find(e=>"feature"===e.type&&e.layerId===t.id&&e.url===t.layer?.url)}function se({map:e,relationship:t,relationship:{relatedTableId:n},relatedLayer:r,layers:i}){if(!i)return null;for(const a of i){if("map-image"===a.type){const n=se({layers:a.sublayers,map:e,relatedLayer:r,relationship:t})||se({layers:a.subtables,map:e,relatedLayer:r,relationship:t});if(n)return n;continue}if(!$(a))continue;if("sublayer"===r.type){if(a!==r&&a.id===n)return a.isTable?ue(e,a):a;continue}const i="scene"===r.type&&r.associatedLayer?r.associatedLayer.url:r.url;if(!i)return null;if("sublayer"!==a.type){if(a!==r&&a.url===i&&a.layerId===n)return a}else if(a!==r&&a.layer?.url===i&&a.id===n)return a.isTable?ue(e,a):a}return null}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4167],{28879:(e,t,n)=>{n.r(t),n.d(t,{OperatorGeodeticLength:()=>m});var s=n(31635),o=n(55537),r=n(47591),a=n(88885),i=n(83661),c=n(39117),g=n(5247);class m{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n,s){if(4===n)return(new r.O).execute(e,t,s);if(0===t.getCoordinateSystemType()&&(0,o.a)(""),(0,o.c)(e),e.isEmpty()||e.getDimension()<1)return 0;const m=t.getGCS(),u=(0,c.F)();m.querySpheroidData(u);const l=u.majorSemiAxis,h=u.e2,y=m.getUnit().getUnitToBaseFactor();let x;const p=e.getGeometryType();if(p===o.G.enumPolygon?x=e.getBoundary():p===o.G.enumEnvelope?x=(0,a.c)(e):(0,o.f)(p)?(x=new a.P({vd:e.getDescription()}),x.addSegment(e,!0)):x=e,x.hasNonLinearSegments()&&(x=(new g.O).execute(x,0,t.getTolerance(0),0,s)),m!==t){const n=t.getSRToGCSTransform();if(t.isPannable()){x=(0,c.ag)(x,t),p===o.G.enumPolyline&&x===e&&(x=e.clone());const n=new i.E;t.getPannableExtent().queryIntervalX(n);for(let e=0,t=x.getPointCount();e<t;e++){const t=x.getXY(e);t.x=(0,c.al)(t.x,n),x.setXY(e,t)}}const r=x.createInstance();x=(0,c.am)(n,x,r,s)?r:(new c.O).execute(x,n,s)}return this._ExecuteMultiPathGeodeticLength(x,n,l,h,y)}_ExecuteMultiPathGeodeticLength(e,t,n,o,r){const a={stack:[],error:void 0,hasError:!1};try{const i=(0,s.mS)(a,new c.a7,!1);let g=0;const m=e.querySegmentIterator();for(;m.nextPath();)for(;m.hasNextSegment();){const e=m.nextSegment(),s=e.getStartXY(),a=e.getEndXY();s.scale(r),a.scale(r),c.ab.geodeticDistance(n,o,s.x,s.y,a.x,a.y,i,null,null,t),g+=i.val}return g}catch(e){a.error=e,a.hasError=!0}finally{(0,s.hk)(a)}}}},47591:(e,t,n)=>{n.d(t,{O:()=>x});var s=n(55537),o=n(39117),r=n(88885),a=n(83661),i=n(95213),c=n(79187),g=n(5247),m=n(31139);function u(){return{m_pGcs:new a.P,m_xyz:new i.d,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:l,setLength:h,assign:y}}function l(e,t,n,s){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(s),this.m_geoLength=n}function h(e){this.m_geoLength=e}function y(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class x{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,s,r){if(e.hasNonLinearSegments()&&(e=(new g.O).execute(e,0,t.getTolerance(0),0,r)),t.isPannable()){let s=90,a=-90;if(1===n.getUnit().getUnitToBaseFactor()&&(s*=Math.PI/180,a*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=s,n[2]=0,n[3]=a,o.aj.geogToProj(e,2,n),s=n[1],a=n[3]}const i=new c.Envelope2D;e.queryEnvelope(i),i.ymin=a,i.ymax=s,e=(new m.O).execute(e,i,t,r)}else{const n=t.getPCSHorizon();if((e=(new o.U).execute(e,n,t,r))===n){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,s,1,r)}_ExecuteIterativeApproach(e,t,n,r,c,g){const m=(0,o.F)();n.querySpheroidData(m);const l=m.majorSemiAxis,h=m.e2,y=n.getUnit().getUnitToBaseFactor(),x=(0,a.n)(u,40),_=(0,a.d)(40,Number.NaN),f=u(),S=u();let G;const P=[0,0,0,0],w=t.getPECoordSys(),C=new a.P,E=new a.P,v=new a.P,N=new a.P,T=new a.P;let L=0;const b=e.querySegmentIterator();for(;b.nextPath();)for(;b.hasNextSegment();){const e=b.nextSegment();C.assign(e.getStartXY()),E.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(P[0]=C.x,P[1]=C.y,P[2]=E.x,P[3]=E.y,o.aj.projToGeog(w,2,P),v.x=P[0]*y,v.y=P[1]*y,N.x=P[2]*y,N.y=P[3]*y):(v.setCoordsPoint2D(C),N.setCoordsPoint2D(E),v.scale(y),N.scale(y));const n=new i.d,r=new i.d;p(l,h,v,n),p(l,h,N,r);let a=d(l,n,r);f.setValues(0,v,Number.NaN,n),S.setValues(1,N,a,r),G=c,x[0].assign(S),_[0]=c;let g=0;for(;;){g>128&&(0,s.d)("iterations exceeded");const n=.5*(f.m_factor+S.m_factor),r=e.getCoord2D(n);2===t.getCoordinateSystemType()?(P[0]=r.x,P[1]=r.y,o.aj.projToGeog(w,1,P),T.x=P[0]*y,T.y=P[1]*y):(T.setCoordsPoint2D(r),T.scale(y)),v.setCoordsPoint2D(f.m_pGcs),N.setCoordsPoint2D(S.m_pGcs);const m=new i.d;p(l,h,T,m);const u=d(l,f.m_xyz,m),C=d(l,S.m_xyz,m);a=S.m_geoLength,Number.isNaN(a)&&(a=d(l,f.m_xyz,S.m_xyz));const E=u+C,b=G===c&&E>=20&&Math.abs(E-a)>1e-8*(a+E);if(g+2<40&&(b||Math.abs(E-a)>0&&G>0))S.setLength(C),x[g].assign(S),S.setValues(n,T,u,m),x[++g].assign(S),b?(G=c,_[g]=c):(G--,_[g-1]=G,_[g]=G);else{if(L+=E,0===g)break;f.assign(S),S.assign(x[--g]),G=_[g]}}}return L}execute(e,t,n){if(t&&0!==t.getCoordinateSystemType()||(0,s.a)(""),e.isEmpty()||e.getDimension()<1)return 0;let a=null;const i=t.getGCS();i!==t&&(a=(0,o.g)(t,i,null));const c=e.getGeometryType();if(c===s.G.enumEnvelope){const s=new r.a;return s.addEnvelope(e,!1),this._ExecuteShapePreservingLength(s,t,i,a,n)}if((0,s.f)(c)){const s=new r.P;return s.addSegment(e,!0),this._ExecuteShapePreservingLength(s,t,i,a,n)}return this._ExecuteShapePreservingLength(e,t,i,a,n)}}function p(e,t,n,s){s.assign((0,o.a8)(e,t,n))}function d(e,t,n){const s=e,o=new i.d;o.setSub(t,n);const r=o.length();return 2*s*Math.asin(r/(2*s))}},76061:(e,t,n)=>{n.d(t,{G:()=>s,S:()=>o});class s{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class o extends s{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4167],{28879:(e,t,n)=>{n.r(t),n.d(t,{OperatorGeodeticLength:()=>m});var s=n(31635),o=n(55537),r=n(47591),a=n(88885),i=n(83661),c=n(39117),g=n(5247);class m{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n,s){if(4===n)return(new r.O).execute(e,t,s);if(0===t.getCoordinateSystemType()&&(0,o.a)(""),(0,o.c)(e),e.isEmpty()||e.getDimension()<1)return 0;const m=t.getGCS(),u=(0,c.F)();m.querySpheroidData(u);const l=u.majorSemiAxis,h=u.e2,y=m.getUnit().getUnitToBaseFactor();let x;const p=e.getGeometryType();if(p===o.G.enumPolygon?x=e.getBoundary():p===o.G.enumEnvelope?x=(0,a.c)(e):(0,o.f)(p)?(x=new a.P({vd:e.getDescription()}),x.addSegment(e,!0)):x=e,x.hasNonLinearSegments()&&(x=(new g.O).execute(x,0,t.getTolerance(0),0,s)),m!==t){const n=t.getSRToGCSTransform();if(t.isPannable()){x=(0,c.af)(x,t),p===o.G.enumPolyline&&x===e&&(x=e.clone());const n=new i.E;t.getPannableExtent().queryIntervalX(n);for(let e=0,t=x.getPointCount();e<t;e++){const t=x.getXY(e);t.x=(0,c.al)(t.x,n),x.setXY(e,t)}}const r=x.createInstance();x=(0,c.am)(n,x,r,s)?r:(new c.O).execute(x,n,s)}return this._ExecuteMultiPathGeodeticLength(x,n,l,h,y)}_ExecuteMultiPathGeodeticLength(e,t,n,o,r){const a={stack:[],error:void 0,hasError:!1};try{const i=(0,s.mS)(a,new c.a7,!1);let g=0;const m=e.querySegmentIterator();for(;m.nextPath();)for(;m.hasNextSegment();){const e=m.nextSegment(),s=e.getStartXY(),a=e.getEndXY();s.scale(r),a.scale(r),c.a8.geodeticDistance(n,o,s.x,s.y,a.x,a.y,i,null,null,t),g+=i.val}return g}catch(e){a.error=e,a.hasError=!0}finally{(0,s.hk)(a)}}}},47591:(e,t,n)=>{n.d(t,{O:()=>x});var s=n(55537),o=n(39117),r=n(88885),a=n(83661),i=n(95213),c=n(79187),g=n(5247),m=n(31139);function u(){return{m_pGcs:new a.P,m_xyz:new i.d,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:l,setLength:h,assign:y}}function l(e,t,n,s){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(s),this.m_geoLength=n}function h(e){this.m_geoLength=e}function y(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class x{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,s,r){if(e.hasNonLinearSegments()&&(e=(new g.O).execute(e,0,t.getTolerance(0),0,r)),t.isPannable()){let s=90,a=-90;if(1===n.getUnit().getUnitToBaseFactor()&&(s*=Math.PI/180,a*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=s,n[2]=0,n[3]=a,o.aj.geogToProj(e,2,n),s=n[1],a=n[3]}const i=new c.Envelope2D;e.queryEnvelope(i),i.ymin=a,i.ymax=s,e=(new m.O).execute(e,i,t,r)}else{const n=t.getPCSHorizon();if((e=(new o.U).execute(e,n,t,r))===n){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,s,1,r)}_ExecuteIterativeApproach(e,t,n,r,c,g){const m=(0,o.F)();n.querySpheroidData(m);const l=m.majorSemiAxis,h=m.e2,y=n.getUnit().getUnitToBaseFactor(),x=(0,a.n)(u,40),_=(0,a.d)(40,Number.NaN),f=u(),S=u();let G;const P=[0,0,0,0],w=t.getPECoordSys(),C=new a.P,E=new a.P,v=new a.P,N=new a.P,T=new a.P;let L=0;const b=e.querySegmentIterator();for(;b.nextPath();)for(;b.hasNextSegment();){const e=b.nextSegment();C.assign(e.getStartXY()),E.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(P[0]=C.x,P[1]=C.y,P[2]=E.x,P[3]=E.y,o.aj.projToGeog(w,2,P),v.x=P[0]*y,v.y=P[1]*y,N.x=P[2]*y,N.y=P[3]*y):(v.setCoordsPoint2D(C),N.setCoordsPoint2D(E),v.scale(y),N.scale(y));const n=new i.d,r=new i.d;p(l,h,v,n),p(l,h,N,r);let a=d(l,n,r);f.setValues(0,v,Number.NaN,n),S.setValues(1,N,a,r),G=c,x[0].assign(S),_[0]=c;let g=0;for(;;){g>128&&(0,s.d)("iterations exceeded");const n=.5*(f.m_factor+S.m_factor),r=e.getCoord2D(n);2===t.getCoordinateSystemType()?(P[0]=r.x,P[1]=r.y,o.aj.projToGeog(w,1,P),T.x=P[0]*y,T.y=P[1]*y):(T.setCoordsPoint2D(r),T.scale(y)),v.setCoordsPoint2D(f.m_pGcs),N.setCoordsPoint2D(S.m_pGcs);const m=new i.d;p(l,h,T,m);const u=d(l,f.m_xyz,m),C=d(l,S.m_xyz,m);a=S.m_geoLength,Number.isNaN(a)&&(a=d(l,f.m_xyz,S.m_xyz));const E=u+C,b=G===c&&E>=20&&Math.abs(E-a)>1e-8*(a+E);if(g+2<40&&(b||Math.abs(E-a)>0&&G>0))S.setLength(C),x[g].assign(S),S.setValues(n,T,u,m),x[++g].assign(S),b?(G=c,_[g]=c):(G--,_[g-1]=G,_[g]=G);else{if(L+=E,0===g)break;f.assign(S),S.assign(x[--g]),G=_[g]}}}return L}execute(e,t,n){if(t&&0!==t.getCoordinateSystemType()||(0,s.a)(""),e.isEmpty()||e.getDimension()<1)return 0;let a=null;const i=t.getGCS();i!==t&&(a=(0,o.g)(t,i,null));const c=e.getGeometryType();if(c===s.G.enumEnvelope){const s=new r.a;return s.addEnvelope(e,!1),this._ExecuteShapePreservingLength(s,t,i,a,n)}if((0,s.f)(c)){const s=new r.P;return s.addSegment(e,!0),this._ExecuteShapePreservingLength(s,t,i,a,n)}return this._ExecuteShapePreservingLength(e,t,i,a,n)}}function p(e,t,n,s){s.assign((0,o.a9)(e,t,n))}function d(e,t,n){const s=e,o=new i.d;o.setSub(t,n);const r=o.length();return 2*s*Math.asin(r/(2*s))}},76061:(e,t,n)=>{n.d(t,{G:()=>s,S:()=>o});class s{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class o extends s{constructor(e){super(),this.m_iGeom=-1,this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6558],{6558:(e,t,n)=>{n.r(t),n.d(t,{OperatorGeodeticArea:()=>q});var s=n(55537),i=n(88885),a=n(5247),_=n(39117),r=n(83661),h=n(79187),o=n(95213),m=n(31139),l=n(47591),u=n(31635),p=n(11878),c=n(16859);class g{constructor(e,t,n,s,i=100){this.m_startPt=e.clone(),this.m_endPt=t.clone(),this.m_cE2=s,this.m_cE=Math.sqrt(this.m_cE2),this.m_c1By2e=1/(2*this.m_cE),this.m_cRpu=n.getGCS().getUnit().getUnitToBaseFactor(),this.isPcs=2===n.getCoordinateSystemType(),this.PEProjcs=n.getPECoordSys(),this.m_points=(0,r.d)(2*i,Number.NaN)}setSegmentEndPoints(e,t){this.m_startPt.assign(e),this.m_endPt.assign(t)}makeFunctor(){return e=>{const t=[0,0];t[0]=this.m_startPt.x*(1-e)+this.m_endPt.x*e,t[1]=this.m_startPt.y*(1-e)+this.m_endPt.y*e,this.isPcs&&_.aj.projToGeogCenter(this.PEProjcs,1,t,0);const n=Math.sin(t[1]*this.m_cRpu);return 0===this.m_cE2?n:-Math.log((1-this.m_cE*n)/(1+this.m_cE*n))*this.m_c1By2e+n/(1-this.m_cE2*n*n)}}}function d(e,t,n,s,i){const r=(new a.O).execute(e,t,0,0,i);let o;o=s?(new _.O).execute(r,s,i):r;const m=1===n.getUnit().getUnitToBaseFactor()?Math.PI/180:1,l=new h.Envelope2D;o.queryEnvelope(l);const u=new h.Envelope2D,p=new h.Envelope2D,c=new h.Envelope2D;u.setCoords({xmin:l.xmin,ymin:75*m,xmax:l.xmax,ymax:90*m}),p.setCoords({xmin:l.xmin,ymin:-60*m,xmax:l.xmax,ymax:75*m}),c.setCoords({xmin:l.xmin,ymin:-90*m,xmax:l.xmax,ymax:-60*m}),u.inflateCoords(.01*u.width(),0),p.inflateCoords(.01*p.width(),0),c.inflateCoords(.01*c.width(),0);let g=0;return g+=E(o,u,n,i),g+=E(o,p,n,i),g+=E(o,c,n,i),g}function E(e,t,n,i){const a=(new m.O).execute(e,t,n,i);if(null!==a&&!a.isEmpty()){const e=new h.Envelope2D;a.queryEnvelope(e);const{first:t,second:o}=function(e,t){const n=function(e,t){const n=e.getUnit().getUnitToBaseFactor(),i=t.getCenter();i.scale(180*n/Math.PI);const a=new r.P;a.x=0,a.y=0;let h=0;if(0===h){i.y>45?(a.y=r.o,h=0):i.y<-45?(a.y=-r.o,h=1):i.x>=45&&i.x<135?(a.x=r.o,h=2):i.x>=135||i.x<-135?(a.x=r.o,h=3):i.x<-45&&i.x>=-135?(a.x=-r.o,h=4):(a.x=0,h=5);const e=n*Math.sqrt((0,r.a)(t.xmin-t.xmax)+(0,r.a)(t.ymin-t.ymax)),s=a.clone(),_=t.getCenter();if(_.scale(n),h<2&&(s.x=_.x),r.P.distance(s,_)+.5*e>r.o)return null}const o=P[h];if(null!==o&&o.getGCS().equalHorizontal(e))return o;const m=e.getText(),l=a.x,u=a.y;let p=0,c=-1;6!==h?c=_.aG.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:((0,s.g)(false),p=0,c=_.aG.PE_PRJ_CYLINDRICAL_EQAREA);const g=(0,_.v)("EqualAreaPCS");let d;c===_.aG.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?d=`PROJCS["${g}",${m},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${l}],PARAMETER["Latitude_of_Origin",${u}],UNIT["Meter",1.0]]`:c===_.aG.PE_PRJ_CYLINDRICAL_EQAREA?d=`PROJCS["${g}",${m},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${l}],PARAMETER["Standard_Parallel_1",${p}],PARAMETER["Latitude_of_Origin",${u}],UNIT["Meter",1.0]]`:(0,s.d)("getEqualAreaPcsFixed");const E=(0,_.o)(d);return P[h]&&P[h].destroy(),P[h]=E,E}(e,t);if(null!==n)return(0,r.k)(n,!1);const i=e.getText(),a=e.getUnit().getUnitToBaseFactor(),h=(t.xmin+t.width()/2)*a,o=(t.ymin+t.height()/2)*a;let m=0,l=0,u=-1;t.ymin*a>=75*Math.PI/180||t.ymax*a<=-60*Math.PI/180?u=_.aG.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA:t.ymin>0||t.ymax<0?(m=(t.ymin+1/3*t.height())*a,l=(t.ymin+2/3*t.height())*a,u=_.aG.PE_PRJ_ALBERS):(m=(t.ymin+2/3*t.height())*a,u=_.aG.PE_PRJ_CYLINDRICAL_EQAREA);const p=(0,_.v)("EqualAreaPCS");let c;return u===_.aG.PE_PRJ_LAMBERT_AZIMUTHAL_EQAREA?c=`PROJCS["${p}",${i},PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${h}],PARAMETER["Latitude_of_Origin",${o}],UNIT["Meter",1.0]]`:u===_.aG.PE_PRJ_ALBERS?c=`PROJCS["${p}",${i},PROJECTION["Albers"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${h}],PARAMETER["Standard_Parallel_1",${m}],PARAMETER["Standard_Parallel_2",${l}],PARAMETER["Latitude_of_Origin",${o}],UNIT["Meter",1.0]]`:u===_.aG.PE_PRJ_CYLINDRICAL_EQAREA?c=`PROJCS["${p}",${i},PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",${h}],PARAMETER["Standard_Parallel_1",${m}],PARAMETER["Latitude_of_Origin",${o}],UNIT["Meter",1.0]]`:(0,s.d)("getEqualAreaPCSInstance"),(0,r.k)((0,_.o)(c),!0)}(n,e),m=(0,_.g)(n,t,null),l=(new _.O).execute(a,m,i).calculateArea2D();return o&&t.destroy(),l}return 0}const P=[null,null,null,null,null,null,null];class f{getOperatorType(){return 10314}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n){if(0===t.getCoordinateSystemType()&&(0,s.a)(""),e.isEmpty()||e.getDimension()<2)return 0;if((0,s.c)(e),e.getGeometryType()===s.G.enumEnvelope){const s=new i.a;return s.addEnvelope(e,!1),this.execute(s,t,n)}let u=e;e.getDescription().getAttributeCount()>1&&(u=e.clone(),u.dropAllAttributes());const p=(new a.O).execute(u,0,t.getTolerance(0),0,n);let c=null;const E=t.getGCS();E!==t&&(c=(0,_.g)(t,E));let P=(new _.L).execute(p,t,!1,n);return P.isEmpty()?0:(P===e&&(P=e.clone()),t.isPannable()?function(e,t,n){const s=new h.Envelope2D;e.queryEnvelope(s);const a=(0,o.c)(t,s,!0).total(),l=t.getPannableExtent();l.xmin=s.xmin-10*a,l.xmax=s.xmax+10*a;const u=(new m.O).execute(e,l,t,n).getImpl().querySegmentIterator();u.stripAttributes();const p=(0,_.F)();t.querySpheroidData(p);const c=p.e2,d=0===c?2:1,E=new r.P(0,0),P=new r.P(0,0),f=new r.K(0),S=new g(E,P,t,c,100);for(;u.nextPath();)for(;u.hasNextSegment();){const e=u.nextSegment();E.assign(e.getStartXY()),P.assign(e.getEndXY()),S.setSegmentEndPoints(E,P);const t=(0,i.x)(6,0,1,1e-12,1e-15,S.makeFunctor());f.pe((P.x-E.x)*t)}const y=p.majorSemiAxis;return d*y*y*(1-c)*Math.PI*f.getResult()/t.getPannableExtent().width()}(P,t,n):function(e,t,n,s,i){const a=function(e,t,n){const s=e.calculateLength2D(),i=(new l.O).execute(e,t,n)/25e3,a=s/e.getSegmentCount()*2;let _=Math.min(a,s/i);return 0===_&&(_=1),(0,r.k)(_,s/_)}(e,t,i);let _=d(e,a.first,n,s,i),h=1,o=0,m=0;do{if(h++,a.first*=.5,a.first<50*t.getTolerance(0))return _;a.second*=2,m=d(e,a.first,n,s,i),o=Math.abs(m-_),_=m}while(Math.abs(_)>1&&o>1e-8*Math.abs(_)&&(a.second<65e3&&h<8||h<4));return m}(P,t,E,c,n))}}function S(){return{m_p_PCS:new r.P,m_factor:Number.NaN,setValues:y,assign:x}}function y(e,t){this.m_factor=e,this.m_p_PCS.assign(t)}function x(e){this.m_factor=e.m_factor,this.m_p_PCS.assign(e.m_p_PCS)}class A{constructor(e,t,n,s){this.m_ptStart=new o.d,this.m_ptEnd=new o.d,this.m_ptStart.assign(t),this.m_ptEnd.assign(n),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y,this.m_e=Math.sqrt(e),this.m_e2=e,this.m_c1MinusE2=1-e;const i=Math.sin(s);let a;a=0===this.m_e2?2*i:i*((0,r.y)(this.m_e*i)+1/(1-this.m_e2*i*i)),this.m_baseA=a}setSegmentEndPoints(e,t){this.m_ptStart.assign(e),this.m_ptEnd.assign(t),this.m_deltaX=this.m_ptEnd.x-this.m_ptStart.x,this.m_deltaY=this.m_ptEnd.y-this.m_ptStart.y}makeFunctor(){return e=>{const t=1-e,n=t*this.m_ptStart.x+e*this.m_ptEnd.x,s=t*this.m_ptStart.y+e*this.m_ptEnd.y,i=t*this.m_ptStart.z+e*this.m_ptEnd.z,a=n*n+s*s,_=i/Math.sqrt(i*i+this.m_c1MinusE2*this.m_c1MinusE2*a);let h;return h=0===this.m_e2?2*_:_*((0,r.y)(this.m_e*_)+1/(1-this.m_e2*_*_)),(this.m_deltaY*n-this.m_deltaX*s)/a*(h-this.m_baseA)}}}function R(){return{sin_phi:Number.NaN,one_p_sin_phi:Number.NaN,one_m_sin_phi:Number.NaN,one_m_e_2_sin_2_phi:Number.NaN,sin_half_phi_pf:Number.NaN,sin_half_phi_pz:Number.NaN,sin_half_asin_e_sin_phi_pf:Number.NaN,sin_half_asin_e_sin_phi_pz:Number.NaN,atanh_sin_phi:Number.NaN,atanh_esin_phi:Number.NaN,make_negative:!1,initialize:C,changeSign:M,assign:T,clone:w}}function C(e,t,n,s){const i=.5*e;this.sin_phi=Math.sin(e);const a=t*this.sin_phi,_=.5*Math.asin(a);this.one_p_sin_phi=1+this.sin_phi,this.one_m_sin_phi=1-this.sin_phi,this.one_m_e_2_sin_2_phi=(1+a)*(1-a),this.sin_half_phi_pf=Math.sin(i+n),this.sin_half_phi_pz=Math.sin(i+s),this.sin_half_asin_e_sin_phi_pf=Math.sin(_+n),this.sin_half_asin_e_sin_phi_pz=Math.sin(_+s),this.atanh_sin_phi=Math.log(this.sin_half_phi_pf/this.sin_half_phi_pz),this.atanh_esin_phi=Math.log(this.sin_half_asin_e_sin_phi_pf/this.sin_half_asin_e_sin_phi_pz)}function M(){this.sin_phi=-this.sin_phi;let e=this.one_p_sin_phi;this.one_p_sin_phi=this.one_m_sin_phi,this.one_m_sin_phi=e,e=this.sin_half_phi_pf,this.sin_half_phi_pf=this.sin_half_phi_pz,this.sin_half_phi_pz=e,e=this.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pf=this.sin_half_asin_e_sin_phi_pz,this.sin_half_asin_e_sin_phi_pz=e,this.atanh_sin_phi=-this.atanh_sin_phi,this.atanh_esin_phi=-this.atanh_esin_phi}function T(e){this.sin_phi=e.sin_phi,this.one_p_sin_phi=e.one_p_sin_phi,this.one_m_sin_phi=e.one_m_sin_phi,this.one_m_e_2_sin_2_phi=e.one_m_e_2_sin_2_phi,this.sin_half_phi_pf=e.sin_half_phi_pf,this.sin_half_phi_pz=e.sin_half_phi_pz,this.sin_half_asin_e_sin_phi_pf=e.sin_half_asin_e_sin_phi_pf,this.sin_half_asin_e_sin_phi_pz=e.sin_half_asin_e_sin_phi_pz,this.atanh_sin_phi=e.atanh_sin_phi,this.atanh_esin_phi=e.atanh_esin_phi,this.make_negative=e.make_negative}function w(){return{...this}}class N{constructor(e,t,n){this.m_transformPCS2GCS=null,this.m_scaleToRadians=new p.T,this.m_scaleToDegrees=new p.T,this.m_progressTracker=n,(0,s.g)(4!==t),this.m_curveType=t,this.m_inputSR=e,e&&0!==e.getCoordinateSystemType()||(0,s.a)(""),this.m_inputGCS=e.getGCS(),this.m_a=0,this.m_eSquared=0,this.m_b=0,this.m_rpu=0}executePolygonGeodeticArea(e){let t,n=e.clone();if(n.dropAllAttributes(),e.hasNonLinearSegments()&&(n=(new a.O).execute(n,0,this.m_inputSR.getTolerance(0),0,this.m_progressTracker)),this.m_inputSR.isPannable()){const e=new h.Envelope2D;n.queryEnvelope(e);const t=this.m_inputSR.getPannableExtent();if(!t.containsEnvelope(e)){const s=t.getCenterX()-e.getCenterX(),i=new p.T;i.setShiftCoords(s,0),n.applyTransformation(i),e.move(s,0);const a=new r.E;t.queryIntervalX(a);const h=new r.E;e.queryIntervalX(h),n=a.contains(h)?(0,_.af)(n,this.m_inputSR):(new _.O).foldInto360RangeGeodetic(n,this.m_inputSR,this.m_curveType)}}if(this.m_transformPCS2GCS?(n=(new _.L).execute(n,this.m_inputSR,!1,this.m_progressTracker),t=n.createInstance(),(0,_.am)(this.m_transformPCS2GCS,n,t,this.m_progressTracker)||(t=(new _.O).execute(n,this.m_transformPCS2GCS,this.m_progressTracker))):t=(new _.L).execute(n,this.m_inputGCS,!1,this.m_progressTracker),t.isEmpty())return 0;if(1===this.m_curveType){const e=(0,_.F)();return this.m_inputGCS.querySpheroidData(e),this.m_a=e.majorSemiAxis,this.m_eSquared=e.e2,this.loxodromeArea(t)}const s=t.getImpl();this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_scaleToRadians.setScale(this.m_rpu),s.applyTransformation(this.m_scaleToRadians),this.m_scaleToDegrees=this.m_scaleToRadians,this.m_scaleToDegrees.invertThis();const i=(0,_.F)();if(this.m_inputGCS.querySpheroidData(i),this.m_a=i.majorSemiAxis,this.m_b=i.minorSemiAxis,this.m_eSquared=i.e2,2===this.m_curveType)return this.executeClippedPolygonGreatEllipticArea(t);{const e={stack:[],error:void 0,hasError:!1};try{const n=_.aY.unit(9101),s=this.m_inputGCS.getPECoordSys(),i=(0,u.mS)(e,s.cloneAlterUnits(n),!1);let a,r,h=this.executeClippedPolygonGeodeticArea(t,i,0),o=0;do{o++,a=this.executeClippedPolygonGeodeticArea(t,i,o),r=Math.abs(a-h),h=a}while(Math.abs(a)>1&&r>1e-8*Math.abs(a)&&o<7);return a}catch(t){e.error=t,e.hasError=!0}finally{(0,u.hk)(e)}}}executeClippedPolygonGeodeticArea(e,t,n){const s={stack:[],error:void 0,hasError:!1};try{const i=new h.Envelope2D;e.queryEnvelope(i);const a=(0,u.mS)(s,this.getEqualAreaPCSInstance(t,i),!1),o=e.clone();(0,_.aZ)(a,o);const m=50,l=o.getImpl().getAttributeStreamRef(0),p=e.getImpl().getAttributeStreamRef(0),c=(0,u.mS)(s,new _.a7,!1),g=(0,u.mS)(s,new _.a7,!1),d=40,E=[0,0],P=(0,r.n)(S,d),f=(0,r.d)(d,-1),y=S(),x=S();let A,R;const C=a;let M=o.calculateArea2D();const T=new r.K(0),w=.5*Math.PI,N=1e-10*Math.abs(M)+1e-6,q=e.getPathCount();let b,v,I,G;const L=new r.P,z=new r.P,D=new r.P,O=new r.P,k=new r.P,F=new r.P;let $,Y;for(v=e.getPathStart(0),b=0;b<q;b++,v=I)for(I=e.getPathEnd(b),l.queryPoint2D(I-1<<1,D),p.queryPoint2D(I-1<<1,L),Math.abs(L.y)>w&&(L.y=(0,r.f)(w,L.y)),G=v;G<I;G++,D.assign(O),L.assign(z)){if(l.queryPoint2D(G<<1,O),p.queryPoint2D(G<<1,z),Math.abs(z.y)>w&&(z.y=(0,r.f)(w,z.y)),$=r.P.distance(D,O),$<m||0===L.y&&0===z.y)continue;_.a8.geodeticDistance(this.m_a,this.m_eSquared,L.x,L.y,z.x,z.y,c,g,null,this.m_curveType);const e=c.val,t=g.val;for(y.setValues(0,D),x.setValues(1,O),R=n,P[0].assign(x),f[0]=n,A=0;A>=0;){Y=.5*(y.m_factor+x.m_factor),_.a8.geodeticCoordinate(this.m_a,this.m_eSquared,L.x,L.y,e*Y,t,c,g,this.m_curveType),k.x=c.val,k.y=g.val,E[0]=k.x,E[1]=k.y,_.aj.geogToProj(C,1,E),F.x=E[0],F.y=E[1];const n=.5*-F.offset(y.m_p_PCS,x.m_p_PCS)*r.P.distance(y.m_p_PCS,x.m_p_PCS);if(T.pe(n),Math.abs(n)>N||Math.abs(n)>0&&R>0)x.setValues(Y,F),A++,P[A].assign(x),Math.abs(n)<=N?(R--,f[A-1]=R,f[A]=R):(R=f[A-1],f[A]=R);else{if(A<=0)break;y.assign(x),A--,x.assign(P[A]),R=f[A]}}}return M+=T.getResult(),Math.abs(M)}catch(e){s.error=e,s.hasError=!0}finally{(0,u.hk)(s)}}executeClippedPolygonGreatEllipticArea(e){const t=[],n=[],s=new r.P,i=new r.P,a=(0,_.a9)(1,this.m_eSquared,new r.P(0,.5*Math.PI)),m=new r.K(0),l=new r.K(0),u=new r.K(0),p=new o.d,c=new o.d,g=new h.Envelope2D;e.queryLooseEnvelope(g);let d=0;g.containsCoords(g.xmin,0)||(d=Math.abs(g.ymin)<Math.abs(g.ymax)?g.ymin:g.ymax);const E=new A(this.m_eSquared,p,c,d),P=this.m_a*this.m_a,f=e.getImpl().querySegmentIterator();for(f.stripAttributes();f.nextPath();)for(;f.hasNextSegment();){const e=f.nextSegment();s.assign(e.getStartXY()),i.assign(e.getEndXY()),i.x-s.x>Math.PI?s.x+=2*Math.PI:i.x-s.x<-Math.PI&&(i.x+=2*Math.PI),this.splitSegmentCrossingItegralThreshold(e,t,n);for(let e of t)p.assign((0,_.a9)(this.m_a,this.m_eSquared,e.getStartXY())),c.assign((0,_.a9)(this.m_a,this.m_eSquared,e.getEndXY())),E.setSegmentEndPoints(p,c),this.adaptiveIntegrationWithRomberg(E,m);for(let e of n){let t=e.getStartXY(),n=e.getEndXY(),s=d;t.y<0&&(n=(0,r.c)(t,t=n),t.y=-t.y,n.y=-n.y,s=-s);const i=(0,_.a9)(1,this.m_eSquared,t),h=(0,_.a9)(1,this.m_eSquared,n),m=Math.min(t.y,n.y),p=(0,_.a_)(this.m_eSquared,t.x,n.x,s,m);l.pe(p);const c=Math.abs((0,_.a_)(this.m_eSquared,t.x,n.x,m,r.o)),g=new o.d;g.setSub(i,a);const E=new o.d;E.setSub(h,a);const f=new o.d;f.setCrossProductVector(g,E);let S=P*(c-.5*f.length());S=(0,r.f)(S,n.x-t.x),u.pe(S)}t.length=0,n.length=0}return u.getResult()+P*(.5*(1-this.m_eSquared)*m.getResult()+l.getResult())}getEqualAreaPCSInstance(e,t){const n=t.getCenterX();let s,i;const a=t.height();let h,o;(h=t.ymin>45*Math.PI/180||t.ymax<45*-Math.PI/180)?s=(0,r.f)(.5*Math.PI,t.getCenterY()):(s=t.getCenterY(),i=t.ymin+a*(2/3));const m=(0,_.v)("EqualAreaPCS"),l=e.toString();return o=h?_.aY.fromString(_.aG.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Lambert_Azimuthal_Equal_Area"],PARAMETER["False_Easting",0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}], PARAMETER["Latitude_of_Origin", ${s}], UNIT["Meter",1.0]]`):_.aY.fromString(_.aG.PE_TYPE_PROJCS,`PROJCS["${m}", ${l}, PROJECTION["Cylindrical_Equal_Area"],PARAMETER["False_Easting", 0],PARAMETER["False_Northing", 0],PARAMETER["Central_Meridian", ${n}],PARAMETER["Standard_Parallel_1", ${i}],PARAMETER["Latitude_of_Origin", ${s}],UNIT["Meter",1.0]]`),o}splitSegmentCrossingItegralThreshold(e,t,n){const s=100,a=400,h=(0,_.a9)(this.m_a,this.m_eSquared,new r.P(0,r.o)),m=(0,_.a9)(this.m_a,this.m_eSquared,new r.P(0,-r.o)),l=this.splitSegmentPassingThroughPole(e);for(let e of l){const l=e.getStartXY(),u=e.getEndXY(),p=(0,_.a9)(this.m_a,this.m_eSquared,l),c=(0,_.a9)(this.m_a,this.m_eSquared,u),g=new r.P,d=new o.d;let E=o.d.sqrDistance(h,p),P=o.d.sqrDistance(p,c);if(E<=s){if(!(P>a)){n.push(new i.L({start:l,end:u}));continue}d.assign(c.sub(p)),d.normalizeThis(),d.assign(p.add(d.mul(20))),g.assign((0,_.ah)(this.m_a,this.m_eSquared,d)),n.push(new i.L({start:l,end:g})),l.assign(g)}if(p.assign((0,_.a9)(this.m_a,this.m_eSquared,l)),E=o.d.sqrDistance(h,c),P=o.d.sqrDistance(p,c),E<=s){if(!(P>a)){n.push(new i.L({start:l,end:u}));continue}d.assign(c.sub(p)),d.normalizeThis(),d.assign(c.sub(d.mul(20))),g.assign((0,_.ah)(this.m_a,this.m_eSquared,d)),n.push(new i.L({start:g,end:u})),u.assign(g)}if(p.assign((0,_.a9)(this.m_a,this.m_eSquared,l)),c.assign((0,_.a9)(this.m_a,this.m_eSquared,u)),E=o.d.sqrDistance(m,p),P=o.d.sqrDistance(p,c),E<=s){if(!(P>a)){n.push(new i.L({start:l,end:u}));continue}d.assign(c.sub(p)),d.normalizeThis(),d.assign(p.add(d.mul(20))),g.assign((0,_.ah)(this.m_a,this.m_eSquared,d)),n.push(new i.L({start:l,end:g})),l.assign(g)}if(p.assign((0,_.a9)(this.m_a,this.m_eSquared,l)),c.assign((0,_.a9)(this.m_a,this.m_eSquared,u)),E=o.d.sqrDistance(m,c),P=o.d.sqrDistance(p,c),E<=s){if(!(P>a)){n.push(new i.L({start:l,end:u}));continue}d.assign(c.sub(p)),d.normalizeThis(),d.assign(c.sub(d.mul(20))),g.assign((0,_.ah)(this.m_a,this.m_eSquared,d)),n.push(new i.L({start:g,end:u})),u.assign(g)}t.push(new i.L({start:l,end:u}))}}splitSegmentPassingThroughPole(e){const t={stack:[],error:void 0,hasError:!1};try{const n=[],s=new o.d,a=new o.d,h=new o.d,m=new r.P,l=20,p=3.124139361,g=10,d=e.getStartXY(),E=e.getEndXY(),P=(0,u.mS)(t,new _.a7,!1);if(_.a8.geodeticDistance(this.m_a,this.m_eSquared,d.x,d.y,E.x,E.y,P,null,null,2),Math.abs(E.x-d.x)>p&&P.val>l){const e=new c.a(new r.P(0,90),d.divide(this.m_rpu),E.divide(this.m_rpu),this.m_inputGCS,2,2);let t=(0,_.ac)(e.makeFunctor(),0,1,1e-10);if(t.second<=g&&t.first>0&&t.first<1)return s.assign((0,_.a9)(this.m_a,this.m_eSquared,d)),a.assign((0,_.a9)(this.m_a,this.m_eSquared,E)),(0,r.x)(s,a,t.first,h),m.assign((0,_.ah)(this.m_a,this.m_eSquared,h)),n.push(new i.L({start:d,end:m})),n.push(new i.L({start:m,end:E})),n;if(e.setPointDistFrom(new r.P(0,-90)),t=(0,_.ac)(e.makeFunctor(),0,1,1e-10),t.second<=g&&t.first>0&&t.first<1)return s.assign((0,_.a9)(this.m_a,this.m_eSquared,d)),a.assign((0,_.a9)(this.m_a,this.m_eSquared,E)),(0,r.x)(s,a,t.first,h),m.assign((0,_.ah)(this.m_a,this.m_eSquared,h)),n.push(new i.L({start:d,end:m})),n.push(new i.L({start:m,end:E})),n}return n.push(new i.L({start:d,end:E})),n}catch(e){t.error=e,t.hasError=!0}finally{(0,u.hk)(t)}}adaptiveIntegrationWithRomberg(e,t){const n=e.makeFunctor();let s=0,a=1,_=n(s),r=n(a);const h=1e-17,o=1e-14;let m=(s+a)/2,l=n(m),u=Math.abs(l-_),p=Math.abs(r-l),c=0;for(;c++<32&&(u/p<.1||p/u<.1);)u<p?(t.pe((0,i.x)(5,s,m,o,h,n)),s=m,_=l):(t.pe((0,i.x)(5,m,a,o,h,n)),a=m,r=l),m=(s+a)/2,l=Math.abs(n(m)),u=Math.abs(l-_),p=Math.abs(r-l);t.pe((0,i.x)(5,s,a,o,h,n))}loxodromeAreaHemi(e,t,n,s,i){const a=n.clone(),_=i.clone();let h,o,m,l,u,p,c,g,d,E,P,f,S,y,x,A;return a.make_negative&&a.changeSign(),_.make_negative&&_.changeSign(),P=s-t,1===Math.abs(a.sin_phi)||1===Math.abs(_.sin_phi)?e.half_qp*P:a.sin_phi===_.sin_phi?(E=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+(0,r.y)(e.e*a.sin_phi))*P,E):(x=Math.log(_.sin_half_phi_pf*a.sin_half_phi_pz/(_.sin_half_phi_pz*a.sin_half_phi_pf)),A=Math.log(_.sin_half_asin_e_sin_phi_pf*a.sin_half_asin_e_sin_phi_pz/(_.sin_half_asin_e_sin_phi_pz*a.sin_half_asin_e_sin_phi_pf)),1===this.m_eSquared?(u=0,h=.5*(x+_.sin_phi/_.one_m_e_2_sin_2_phi-a.sin_phi/a.one_m_e_2_sin_2_phi),o=0):(u=-2*e.atanh_e_over_e*(Math.log(_.one_p_sin_phi/a.one_p_sin_phi)-e.e*A),h=(x-e.e*A)/e.one_m_e_2,o=(Math.log(_.one_m_e_2_sin_2_phi/a.one_m_e_2_sin_2_phi)+u/e.atanh_e_over_e)/e.one_m_e_2),m=-A*(a.atanh_esin_phi+_.atanh_esin_phi),l=1/a.one_m_e_2_sin_2_phi-1/_.one_m_e_2_sin_2_phi,p=(0,r.z)(_.one_m_sin_phi/e.one_p_e,e.e)-(0,r.z)(a.one_m_sin_phi/e.one_p_e,e.e),c=(0,r.z)(_.one_p_sin_phi/e.one_p_e,e.e)-(0,r.z)(a.one_p_sin_phi/e.one_p_e,e.e),g=(0,r.z)(a.one_m_sin_phi/-e.one_m_e,e.e)-(0,r.z)(_.one_m_sin_phi/-e.one_m_e,e.e),d=(0,r.z)(a.one_p_sin_phi/-e.one_m_e,e.e)-(0,r.z)(_.one_p_sin_phi/-e.one_m_e,e.e),E=.25/h*(o+m+l+u+.5*(p+c+g+d)),E+=e.half_qp,f=.5*e.one_m_e_2*a.sin_phi*(1/a.one_m_e_2_sin_2_phi+(0,r.y)(e.e*a.sin_phi)),S=.5*e.one_m_e_2*_.sin_phi*(1/_.one_m_e_2_sin_2_phi+(0,r.y)(e.e*_.sin_phi)),S<f&&(y=f,f=S,S=y),E<f&&(E=f),E>S&&(E=S),E*=P,E)}loxodromeArea(e){const t=Math.PI/180;let n=0;const s={e:Number.NaN,one_p_e:Number.NaN,one_m_e:Number.NaN,one_m_e_2:Number.NaN,atanh_e_over_e:Number.NaN,half_qp:Number.NaN,f:Number.NaN,z:Number.NaN},i=R(),a=R();s.e=Math.sqrt(this.m_eSquared),s.one_p_e=1+s.e,s.one_m_e=1-s.e,s.one_m_e_2=1-this.m_eSquared,s.atanh_e_over_e=(0,r.y)(s.e),this.m_eSquared>=1?s.half_qp=1:s.half_qp=.5*(1+s.atanh_e_over_e*s.one_m_e_2),s.f=.25*Math.PI,s.z=.75*Math.PI,a.initialize(0,s.e,s.f,s.z);const _=e.getPathCount(),h=new r.P,o=new r.P,m=e.getImpl().getAttributeStreamRef(0);for(let r=0;r<_;r++){const _=e.getPathStart(r),l=e.getPathEnd(r);if(!(l-_<=1)){m.queryPoint2D(2*(l-1),h);for(let e=_;e<l;e++){m.queryPoint2D(2*e,o);const r=h.y*t,l=o.y*t;if(e===_?(i.initialize(r,s.e,s.f,s.z),i.make_negative=!1):i.assign(a),a.initialize(l,s.e,s.f,s.z),a.make_negative=!1,h.y*o.y<0){if(h.y>=90&&o.y<=-90||o.y>=90&&h.y<=-90)return Number.NaN;const e=R();e.initialize(0,s.e,s.f,s.z),e.make_negative=!1;const _=i.atanh_sin_phi-s.e*i.atanh_esin_phi,m=a.atanh_sin_phi-s.e*a.atanh_esin_phi,l=(m*h.x-_*o.x)/(m-_);r<0?(i.make_negative=!0,n-=this.loxodromeAreaHemi(s,h.x*t,i,l*t,e),i.make_negative=!1,n+=this.loxodromeAreaHemi(s,l*t,e,o.x*t,a)):(n+=this.loxodromeAreaHemi(s,h.x*t,i,l*t,e),a.make_negative=!0,n-=this.loxodromeAreaHemi(s,l*t,e,o.x*t,a),a.make_negative=!1)}else h.y>=0?n+=this.loxodromeAreaHemi(s,h.x*t,i,o.x*t,a):(i.make_negative=!0,a.make_negative=!0,n-=this.loxodromeAreaHemi(s,h.x*t,i,o.x*t,a),i.make_negative=!1,a.make_negative=!1);h.assign(o)}}}return this.m_a*n*this.m_a}calculate(e){if(e.isEmpty()||e.getDimension()<2)return 0;if(e.getGeometryType()===s.G.enumEnvelope){const t=new i.a;return t.addEnvelope(e,!1),this.calculate(t)}return this.m_inputSR!==this.m_inputGCS&&null===this.m_transformPCS2GCS&&(this.m_transformPCS2GCS=(0,_.g)(this.m_inputSR,this.m_inputGCS,null)),this.executePolygonGeodeticArea(e)}}class q{getOperatorType(){return 10311}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}execute(e,t,n,i){return(0,s.c)(e),4===n?(new f).execute(e,t,i):new N(t,n,i).calculate(e)}}},47591:(e,t,n)=>{n.d(t,{O:()=>g});var s=n(55537),i=n(39117),a=n(88885),_=n(83661),r=n(95213),h=n(79187),o=n(5247),m=n(31139);function l(){return{m_pGcs:new _.P,m_xyz:new r.d,m_factor:Number.NaN,m_geoLength:Number.NaN,setValues:u,setLength:p,assign:c}}function u(e,t,n,s){this.m_factor=e,this.m_pGcs.assign(t),this.m_xyz.assign(s),this.m_geoLength=n}function p(e){this.m_geoLength=e}function c(e){this.m_pGcs.assign(e.m_pGcs),this.m_xyz.assign(e.m_xyz),this.m_factor=e.m_factor,this.m_geoLength=e.m_geoLength}class g{getOperatorType(){return 10315}supportsCurves(){return!0}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}_ExecuteShapePreservingLength(e,t,n,s,a){if(e.hasNonLinearSegments()&&(e=(new o.O).execute(e,0,t.getTolerance(0),0,a)),t.isPannable()){let s=90,_=-90;if(1===n.getUnit().getUnitToBaseFactor()&&(s*=Math.PI/180,_*=Math.PI/180),2===t.getCoordinateSystemType()){let e=null;const n=[0,0,0,0];e=t.getPECoordSys(),n[0]=0,n[1]=s,n[2]=0,n[3]=_,i.aj.geogToProj(e,2,n),s=n[1],_=n[3]}const r=new h.Envelope2D;e.queryEnvelope(r),r.ymin=_,r.ymax=s,e=(new m.O).execute(e,r,t,a)}else{const n=t.getPCSHorizon();if((e=(new i.U).execute(e,n,t,a))===n){const t=e.clone();e=t}}return e.isEmpty()?0:this._ExecuteIterativeApproach(e,t,n,s,1,a)}_ExecuteIterativeApproach(e,t,n,a,h,o){const m=(0,i.F)();n.querySpheroidData(m);const u=m.majorSemiAxis,p=m.e2,c=n.getUnit().getUnitToBaseFactor(),g=(0,_.n)(l,40),P=(0,_.d)(40,Number.NaN),f=l(),S=l();let y;const x=[0,0,0,0],A=t.getPECoordSys(),R=new _.P,C=new _.P,M=new _.P,T=new _.P,w=new _.P;let N=0;const q=e.querySegmentIterator();for(;q.nextPath();)for(;q.hasNextSegment();){const e=q.nextSegment();R.assign(e.getStartXY()),C.assign(e.getEndXY()),2===t.getCoordinateSystemType()?(x[0]=R.x,x[1]=R.y,x[2]=C.x,x[3]=C.y,i.aj.projToGeog(A,2,x),M.x=x[0]*c,M.y=x[1]*c,T.x=x[2]*c,T.y=x[3]*c):(M.setCoordsPoint2D(R),T.setCoordsPoint2D(C),M.scale(c),T.scale(c));const n=new r.d,a=new r.d;d(u,p,M,n),d(u,p,T,a);let _=E(u,n,a);f.setValues(0,M,Number.NaN,n),S.setValues(1,T,_,a),y=h,g[0].assign(S),P[0]=h;let o=0;for(;;){o>128&&(0,s.d)("iterations exceeded");const n=.5*(f.m_factor+S.m_factor),a=e.getCoord2D(n);2===t.getCoordinateSystemType()?(x[0]=a.x,x[1]=a.y,i.aj.projToGeog(A,1,x),w.x=x[0]*c,w.y=x[1]*c):(w.setCoordsPoint2D(a),w.scale(c)),M.setCoordsPoint2D(f.m_pGcs),T.setCoordsPoint2D(S.m_pGcs);const m=new r.d;d(u,p,w,m);const l=E(u,f.m_xyz,m),R=E(u,S.m_xyz,m);_=S.m_geoLength,Number.isNaN(_)&&(_=E(u,f.m_xyz,S.m_xyz));const C=l+R,q=y===h&&C>=20&&Math.abs(C-_)>1e-8*(_+C);if(o+2<40&&(q||Math.abs(C-_)>0&&y>0))S.setLength(R),g[o].assign(S),S.setValues(n,w,l,m),g[++o].assign(S),q?(y=h,P[o]=h):(y--,P[o-1]=y,P[o]=y);else{if(N+=C,0===o)break;f.assign(S),S.assign(g[--o]),y=P[o]}}}return N}execute(e,t,n){if(t&&0!==t.getCoordinateSystemType()||(0,s.a)(""),e.isEmpty()||e.getDimension()<1)return 0;let _=null;const r=t.getGCS();r!==t&&(_=(0,i.g)(t,r,null));const h=e.getGeometryType();if(h===s.G.enumEnvelope){const s=new a.a;return s.addEnvelope(e,!1),this._ExecuteShapePreservingLength(s,t,r,_,n)}if((0,s.f)(h)){const s=new a.P;return s.addSegment(e,!0),this._ExecuteShapePreservingLength(s,t,r,_,n)}return this._ExecuteShapePreservingLength(e,t,r,_,n)}}function d(e,t,n,s){s.assign((0,i.a9)(e,t,n))}function E(e,t,n){const s=e,i=new r.d;i.setSub(t,n);const a=i.length();return 2*s*Math.asin(a/(2*s))}}}]);