@arcgis/core 4.32.0-next.20250211 → 4.32.0-next.20250212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9a237b396518b1c67f19.js → 00780271be2fd6e298c1.js} +1 -1
- package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
- package/assets/esri/core/workers/chunks/{a4a9b4f792d47566fbf4.js → 17213c3fc63f580e5b73.js} +1 -1
- package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
- package/assets/esri/core/workers/chunks/{74844334b3a2100220fc.js → 37cfd102b6ab5b959f9d.js} +1 -1
- package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
- package/assets/esri/core/workers/chunks/{8ddd4e2e50b8206564a7.js → 3ebdd0701e77bb28c75d.js} +1 -1
- package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
- package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 6c30a25adf22d73d4977.js} +1 -1
- package/assets/esri/core/workers/chunks/{50ae86c23efe709f41cc.js → 6fa1f1e431aae1794ce3.js} +1 -1
- package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
- package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
- package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
- package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
- package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
- package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
- package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
- package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
- package/assets/esri/themes/base/_core.scss +4 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
- package/assets/esri/themes/base/widgets/_Editor.scss +1 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
- package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Bufferer-B-V7yYm-.js +5 -0
- package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
- package/chunks/Envelope.js +1 -1
- package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
- package/chunks/Geometry.js +1 -1
- package/chunks/OperatorClip.js +1 -1
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeneralize.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +2 -4
- package/chunks/distanceOperator.js +1 -1
- package/editing/templateUtils.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/shapePreservingProjectOperator.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/interfaces.d.ts +91 -67
- package/layers/support/SubtypeSublayer.js +1 -1
- package/networks/Network.js +1 -1
- package/networks/RulesTable.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/SceneView.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +5 -0
- package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
- package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
- package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
- package/widgets/support/FilterCondition.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
- package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0ac1399d252f2df670b6.js +0 -1
- package/assets/esri/core/workers/chunks/3d5442055e01493efcb2.js +0 -1
- package/assets/esri/core/workers/chunks/74f42e46bf551aab14dc.js +0 -1
- package/assets/esri/core/workers/chunks/9fb45c006d790273e8c1.js +0 -1
- package/assets/esri/core/workers/chunks/a6be1105a5e1f9597c5e.js +0 -1
- package/assets/esri/core/workers/chunks/d0e9874eb304010305c6.js +0 -1
- package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
- package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
- package/chunks/Bufferer-DjC-SKTJ.js +0 -5
- package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
- package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3169,6061,7817,8125],{76061:(e,t,n)=>{n.d(t,{G:()=>s,S:()=>r});class s{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}class r 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}}},68925:(e,t,n)=>{n.d(t,{c:()=>c,e:()=>u,s:()=>i});var s=n(4576),r=n(90756),o=n(78125);function u(e,t){const n=(0,o.getSpatialReference)(e);return(0,r.g)((0,o.fromGeometry)(e),(0,o.fromPolyline)(t),(0,o.fromSpatialReference)(n)).map((e=>(0,o.toGeometry)(e,n))).filter(s.Ru)}const i=(0,r.f)(),c=Object.freeze(Object.defineProperty({__proto__:null,execute:u,supportsCurves:i},Symbol.toStringTag,{value:"Module"}))},37817:(e,t,n)=>{n.r(t),n.d(t,{execute:()=>s.e,supportsCurves:()=>s.s}),n(4576),n(90756),n(78125);var s=n(68925)},90756:(e,t,n)=>{n.d(t,{g:()=>h,f:()=>y});var s=n(76061),r=n(55537),o=n(35368),u=n(95213),i=n(12189),c=i.C;function a(e,t){return{m_geometry:e,m_side:t}}class m extends s.G{constructor(e,t,n,s,r){super(),this.m_cutIndex=-1,this.m_cuts=[],this.m_progressTracker=r,this.m_cuttee=t.clone(),this.m_cutter=new o.P({copy:n}),this.m_bConsiderTouch=e;const i=(0,u.g)(t,n);this.m_tolerance=(0,u.c)(s,i,!0)}next(){return-1===this.m_cutIndex&&this.generateCuts(),++this.m_cutIndex<this.m_cuts.length?this.m_cuts[this.m_cutIndex]:null}getGeometryID(){return 0}tock(){return!0}getRank(){return 1}generateCuts(){switch(this.m_cuttee.getGeometryType()){case r.G.enumPolyline:this.generatePolylineCuts();break;case r.G.enumPolygon:this.generatePolygonCuts()}}generatePolylineCuts(){const e=new o.P,t=new o.P,n=new o.P;this.m_cuts.length=0,this.m_cuts.push(e),this.m_cuts.push(t);const s=[];!function(e,t,n,s,r,u){if(t.isEmpty()){const e=a(t,0);return void r.push(e)}if(n.isEmpty()){const e=a(t,0);return void r.push(e)}const m=[],l=new o.E;{const o=l.createGeometryUserIndex(),h=l.addGeometry(t),y=l.addGeometry(n),p=new i.T(u);let g=0,f=null;if(l.hasCurves()){f=new c;const e=l.getEnvelope2D(u);g=(0,i.s)(s.total());const t=(0,i.k)(s.total(),e);(0,i.l)(l,t,s.total(),12e3,f,null,u)}l.dbgVerifyCurves(),p.setEditShapeCrackAndCluster(l,s),p.cut(e,o,h,y,m);for(const e of m){null!==f&&f.stitchCurves(l,e,g,!1);const t=a(l.getGeometry(e),(0,i.m)(l.getGeometryUserIndex(e,o)));r.push(t)}null!==f&&f.clearStitcher(l)}}(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,s,this.m_progressTracker);for(let o=0;o<s.length;o++){const u=s[o];1===u.m_side?e.add(u.m_geometry,!1):2===u.m_side||4===u.m_side?t.add(u.m_geometry,!1):3===u.m_side?this.m_cuts.push(u.m_geometry):0===u.m_side?n.add(u.m_geometry,!1):(0,r.c)("")}n.isEmpty()||e.isEmpty()&&t.isEmpty()&&!(this.m_cuts.length>=3)||this.m_cuts.push(n),e.isEmpty()&&t.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}generatePolygonCuts(){const e=new o.a,t=new o.a,n=new o.a;this.m_cuts.length=0,this.m_cuts.push(e),this.m_cuts.push(t);const s=[];!function(e,t,n,s,r,u){if(t.isEmpty()){const e=a(t,0);return void r.push(e)}if(n.isEmpty()){const e=a(t,0);return void r.push(e)}const m=[],l=new o.E;{const e=l.createGeometryUserIndex(),h=l.addGeometry(t),y=l.addGeometry(n),p=new i.T(u);let g=0,f=null;if(l.hasCurves()){f=new c;const e=l.getEnvelope2D(u);g=(0,i.s)(s.total());const t=(0,i.k)(s.total(),e);(0,i.l)(l,t,s.total(),12e3,f,null,u)}l.dbgVerifyCurves(),p.setEditShapeCrackAndCluster(l,s),p.cut(!1,e,h,y,m),null!==f&&f.stitchCurves(l,o.n,g,!0);let d=l.getGeometry(h);const _=new o.a,C=new o.a,G=[];for(let t=0;t<m.length;t++){let n=null;{const r=new o.E,c=r.addGeometry(d),a=r.addGeometry(l.getGeometry(m[t]));if(r.hasCurves()){const e=r.getEnvelope2D(u);g=(0,i.s)(s.total());const t=(0,i.k)(s.total(),e);(0,i.l)(r,t,s.total(),12e3,f,null,u)}p.setEditShapeCrackAndCluster(r,s);const h=p.intersection(c,a);if(null!==f&&f.stitchCurves(r,o.n,g,!0),n=r.getGeometry(h),n.isEmpty())continue;const y=l.getGeometryUserIndex(m[t],e);2===y?_.add(n,!1):1===y?C.add(n,!1):G.push(n)}{const e=new o.E,n=e.addGeometry(d),r=e.addGeometry(l.getGeometry(m[t]));if(e.hasCurves()){const t=e.getEnvelope2D(u);g=(0,i.s)(s.total());const n=(0,i.k)(s.total(),t);(0,i.l)(e,n,s.total(),12e3,f,null,u)}p.setEditShapeCrackAndCluster(e,s);const c=p.difference(n,r);null!==f&&f.stitchCurves(e,o.n,g,!0),d=e.getGeometry(c)}}if(!d.isEmpty()&&m.length>0&&G.push(d),_.isEmpty()&&C.isEmpty())return;if(!_.isEmpty()){const e=a(_,1);r.push(e)}if(!C.isEmpty()){const e=a(C,2);r.push(e)}for(let e=0,t=G.length;e<t;++e){const t=a(G[e],3);r.push(t)}}}(this.m_bConsiderTouch,this.m_cuttee,this.m_cutter,this.m_tolerance,s,this.m_progressTracker);for(let o=0;o<s.length;o++){const u=s[o];1===u.m_side?e.add(u.m_geometry,!1):2===u.m_side?t.add(u.m_geometry,!1):3===u.m_side?this.m_cuts.push(u.m_geometry):0===u.m_side?n.add(u.m_geometry,!1):(0,r.c)("")}(0,r.g)(n.isEmpty()||1===s.length),e.isEmpty()&&t.isEmpty()&&this.m_cuts.length<3&&(this.m_cuts.length=0)}}const l=new class{getOperatorType(){return 10005}accelerateGeometry(e,t,n){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}execute(e,t,n,s,r){return new m(e,t,n,s,r)}};function h(e,t,n){const s=l.execute(!0,e,t,n,null);return Array.from(s)}function y(){return l.supportsCurves()}},78125:(e,t,n)=>{n.r(t),n.d(t,{fromExtent:()=>C,fromGeometry:()=>_,fromMultipoint:()=>G,fromPoint:()=>x,fromPolygon:()=>v,fromPolyline:()=>E,fromSpatialReference:()=>w,getSpatialReference:()=>d,toExtent:()=>k,toGeometry:()=>P,toMultipoint:()=>M,toPoint:()=>V,toPolygon:()=>R,toPolyline:()=>S});var s=n(83661),r=(n(79187),n(55537)),o=n(95213),u=n(35368),i=n(12189),c=n(5443),a=n(48526),m=n(86738),l=n(39829),h=n(82799),y=(n(90293),n(83299));const p="_gxVersion",g=2,f=1;function d(e){return Array.isArray(e)?e[0].spatialReference:e.spatialReference}function _(e){switch(e.type){case"point":return x(e);case"multipoint":return G(e);case"polyline":return E(e);case"polygon":return v(e);case"extent":return C(e);default:throw new Error(`Unsupported geometry type: ${e.type}`)}}function C(e){if(!e.getCacheValue(p)){const t=new o.E;t.setCoords(e.xmin,e.ymin,e.xmax,e.ymax),e.hasM&&t.setInterval(g,0,e.mmin,e.mmax),e.hasZ&&t.setInterval(f,0,e.zmin,e.zmax),e.setCacheValue(p,t)}return e.getCacheValue(p)}function G(e){if(!e.getCacheValue(p)){const t=new u.M,n=new o.P,s=e.points,r=e.hasM,i=e.hasZ,c=i?3:2;for(let e=0,o=s.length;e<o;e++){const o=s[e];n.setXYCoords(o[0],o[1]),i&&n.setZ(o[2]??0),r&&n.setM(o[c]??NaN),t.add(n)}e.setCacheValue(p,t)}return e.getCacheValue(p)}function x(e){if(!e.getCacheValue(p)){const t=new o.P;t.setXYCoords(e.x,e.y),e.hasM&&t.setM(e.m),e.hasZ&&t.setZ(e.z),e.setCacheValue(p,t)}return e.getCacheValue(p)}function v(e){if(!e.getCacheValue(p)){const{curveRings:t,hasM:n,hasZ:s,rings:r}=e,o=(0,y.fromGeometryToGXGeometry)({curveRings:t,hasM:n,hasZ:s,rings:r});e.setCacheValue(p,o)}return e.getCacheValue(p)}function E(e){if(!e.getCacheValue(p)){const{curvePaths:t,hasM:n,hasZ:s,paths:r}=e,o=(0,y.fromGeometryToGXGeometry)({curvePaths:t,hasM:n,hasZ:s,paths:r});e.setCacheValue(p,o)}return e.getCacheValue(p)}function w(e){if(e.wkid)return(0,i.c)(e.wkid);const t=e.wkt2||e.wkt;return t?(0,i.a)(t):null}function P(e,t){if(e)switch(e.getGeometryType()){case r.G.enumPoint:return V(e,t);case r.G.enumEnvelope:return k(e,t);case r.G.enumMultiPoint:return M(e,t);case r.G.enumPolyline:return S(e,t);case r.G.enumPolygon:return R(e,t)}return null}function k(e,t){if(e.isEmpty())return null;const n=new c.A({xmin:e.getXMin(),ymin:e.getYMin(),xmax:e.getXMax(),ymax:e.getYMax(),spatialReference:t}),s=e.getDescription();if(s.hasM()){const t=e.queryInterval(g,0);n.mmin=t.vmin,n.mmax=t.vmax}if(s.hasZ()){const t=e.queryInterval(f,0);n.zmin=t.vmin,n.zmax=t.vmax}return n.setCacheValue(p,e),n}function M(e,t){if(e.isEmpty())return null;const n=e.getDescription(),s=n.hasM(),r=n.hasZ(),u=[],i=new o.P;for(let t=0,n=e.getPointCount();t<n;t++){e.getPointByVal(t,i);const n=[i.getX(),i.getY()];r&&n.push(i.getZ()),s&&n.push(i.getM()),u.push(n)}const c=new a.A({hasM:s,hasZ:r,points:u,spatialReference:t});return c.setCacheValue(p,e),c}function V(e,t){if(e instanceof s.P)return new m.A({x:e.x,y:e.y,spatialReference:t});if(e.isEmpty())return null;const n=new m.A({x:e.getX(),y:e.getY(),spatialReference:t}),r=e.getDescription();return r.hasM()&&(n.m=e.getM()),r.hasZ()&&(n.z=e.getZ()),n.setCacheValue(p,e),n}function R(e,t){if(e.isEmpty())return null;const n=l.A.fromJSON({spatialReference:t,...(0,y.toGeometry)(e,null)});return n.setCacheValue(p,e),n}function S(e,t){if(e.isEmpty())return null;const n=h.A.fromJSON({spatialReference:t,...(0,y.toGeometry)(e,null)});return n.setCacheValue(p,e),n}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1878],{55537:(t,s,i)=>{function e(t,s){try{if(!t)throw new Error(s)}catch(t){throw t}}i.d(s,{A:()=>Z,B:()=>S,C:()=>D,G:()=>a,a:()=>g,b:()=>E,c:()=>P,d:()=>z,e:()=>y,f:()=>d,g:()=>e,h:()=>v,i:()=>b,j:()=>N,k:()=>p,l:()=>q,m:()=>T,n:()=>I,o:()=>_,p:()=>f,q:()=>x,r:()=>A,s:()=>R,t:()=>M,u:()=>B,v:()=>w,w:()=>C,x:()=>F,y:()=>k,z:()=>m});class n extends Error{constructor(t,s){super(s),this.m_AdditionalMessage=s,this.m_ErrorType=t,this.name="GeometryError"}what(){return function(t){switch(t){case 1:return"Unknown error";case 2:return"Corrupted geometry";case 3:return"Empty geometry";case 4:return"Math singularity";case 5:return"Buffer is too small";case 6:return"Invalid shape type";case 7:return"Projection out of supported range";case 8:return"Non simple geometry";case 9:return"Cannot calculate geodesic";case 10:return"Notation conversion";case 11:return"Missing grid file";case 12:return"Invalid call";case 13:return"Internal error";case 14:return"Not implemented";case 15:return"IO error";case 16:return"Invalid 3D";case 17:return"An ambiguous geography edge with antipodal points";case 18:return"Geocentric coordinates require ellipsoidal height";case 19:return"Geography cannot be projected into a gnomonic plane or a result of an operation cannot fit into a gnomonic plane";case 20:return"Geometry is too large to be exported in to a given format";case 21:return"Operation is canceled by the user";default:return"unknown error"}}(this.m_ErrorType)}additionalMessage(){return this.m_AdditionalMessage?this.m_AdditionalMessage:""}code(){return this.m_ErrorType}}class r extends n{constructor(t){super(2,t),this.name="CorruptedGeometryError"}}class o extends n{constructor(t){super(3,t),this.name="EmptyGeometryError"}}class h extends n{constructor(t){super(4,t),this.name="MathSingularityError"}}class u extends n{constructor(t){super(8,t),this.name="NonSimpleGeometryError"}}var a,l;(l=a||(a={}))[l.enumUnknown=0]="enumUnknown",l[l.enumPoint=513]="enumPoint",l[l.enumLine=5122]="enumLine",l[l.enumBezier=5123]="enumBezier",l[l.enumEllipticArc=5124]="enumEllipticArc",l[l.enumEnvelope=3077]="enumEnvelope",l[l.enumMultiPoint=8710]="enumMultiPoint",l[l.enumPolyline=25607]="enumPolyline",l[l.enumPolygon=27656]="enumPolygon",l[l.enumMultipatch=40969]="enumMultipatch",l[l.enumGeometryCollection=3594]="enumGeometryCollection",l[l.enumRationalBezier2=5134]="enumRationalBezier2",l[l.enumBezier2=5135]="enumBezier2",l[l.enumRationalBezier23d=5392]="enumRationalBezier23d",l[l.enumGreatArc3d=5393]="enumGreatArc3d";const c=[0,0,1,1,1,2,0,1,2,3,-1,-1,-1,-1,1,1];function m(t){return c[15&t]}function y(t){return!!(512&t)}function x(t){return!!(1024&t)}function f(t){return!!(2048&t)}function d(t){return!!(4096&t)}function b(t){return!!(8192&t)}function v(t){return!!(16384&t)}function _(t){return!!(32768&t)}function w(t){const s=t.getGeometryType();return b(s)?t.getPointCount():t.isEmpty()?0:s===a.enumEnvelope?4:s===a.enumPoint?1:d(s)?2:void P("missing type")}function N(t){const s=t.getGeometryType();if(v(s))return t.hasNonLinearSegments();if(s===a.enumGeometryCollection){const s=t;for(let t=0,i=s.getGeometryCount();t<i;t++)if(N(s.getGeometry(t)))return!0;return!1}return!!d(s)&&s!==a.enumLine}function p(t){throw new r(t)}function M(t){throw new Error(t)}function g(t){throw new h(t)}function C(){M("Geometry type is not supported for 3D operations.")}function T(t){throw new n(12,t)}function R(t){throw new o(t)}function E(t){throw new n(14,t)}function I(t){throw new Error(t)}function P(t){throw new n(13,t)}function A(t){throw new Error(t)}function D(t){throw new u(t)}function q(t){t&&N(t)&&E("Operation does not support curves.")}function z(t){t&&_(t.getGeometryType())&&E("Unsupported geometry type.")}function S(t){t===a.enumGeometryCollection&&M("Geometry_collection instances are not supported in this operation")}function Z(t){S(t.getGeometryType())}function F(t){M(`bad wkid: ${t}`)}function k(t){let s="bad wkt: ";s+=t,s+="...",M(s)}function B(t,s){t||M(s)}},83661:(t,s,i)=>{i.d(s,{$:()=>Pt,A:()=>at,B:()=>ft,C:()=>ds,D:()=>Rt,E:()=>a,F:()=>z,G:()=>S,H:()=>ut,I:()=>c,J:()=>xt,K:()=>n,L:()=>vs,M:()=>Is,N:()=>E,O:()=>I,P:()=>Zs,Q:()=>dt,R:()=>Vt,S:()=>Et,T:()=>Z,U:()=>w,V:()=>N,W:()=>P,X:()=>A,Y:()=>D,Z:()=>bs,_:()=>Ut,a:()=>lt,a0:()=>ps,a1:()=>Ts,a2:()=>gs,a3:()=>Ms,a4:()=>et,a5:()=>nt,a6:()=>v,a7:()=>b,a8:()=>Qt,a9:()=>_,aA:()=>C,aB:()=>rs,aC:()=>jt,aD:()=>kt,aE:()=>hs,aF:()=>os,aa:()=>As,ab:()=>Ps,ac:()=>B,ad:()=>Ns,ae:()=>it,af:()=>qt,ag:()=>Mt,ah:()=>V,ai:()=>G,aj:()=>Rs,ak:()=>bt,al:()=>fs,am:()=>$t,an:()=>ct,ao:()=>ns,ap:()=>us,aq:()=>gt,ar:()=>ls,as:()=>pt,at:()=>R,au:()=>es,av:()=>ws,aw:()=>zs,ax:()=>qs,ay:()=>_t,az:()=>Ss,b:()=>mt,c:()=>_s,d:()=>L,e:()=>T,f:()=>wt,g:()=>xs,h:()=>Yt,i:()=>Xt,j:()=>Tt,k:()=>At,l:()=>Dt,m:()=>Nt,n:()=>It,o:()=>st,p:()=>Ct,q:()=>q,r:()=>Wt,s:()=>k,t:()=>O,u:()=>vt,v:()=>yt,w:()=>F,x:()=>p,y:()=>g,z:()=>cs});var e=i(55537);class n{constructor(t){this.sum=t,this.compensation=0}assign(t){return this.compensation=t.compensation,this.sum=t.sum,this}reset(){this.sum=this.compensation=0}resetToStart(t){this.sum=t,this.compensation=0}normalize(){const t=[Number.NaN];this.sum=tt(this.sum,this.compensation,t),this.compensation=t[0]}add(t){const s=this.sum+t;let i;if(Math.abs(this.sum)>=Math.abs(t)){const e=this.sum-s+t;i=this.compensation+e}else{const e=t-s+this.sum;i=this.compensation+e}this.sum=s,this.compensation=i}sub(t){this.add(-t)}addProduct(t,s){const i=[0],e=$(t,s,i);this.add(e),this.add(i[0])}mul(t){const s=new n(0);s.addProduct(this.sum,t),s.addProduct(this.compensation,t),this.assign(s)}getResult(){return this.sum+this.compensation}pe(t){return this.add(t),this}me(t){return this.add(-t),this}}const r=[5,1,2,1,3,1,2,1,4,1,2,1,3,1,2,1],o=[-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3];function h(t){let s=0;return 65535n&t||(s+=16,t>>=16n),255n&t||(s+=8,t>>=8n),15n&t||(s+=4,t>>=4n),s+r[Number(BigInt.asUintN(4,t))]}function u(t){let s=0;return 4294967295n&t||(s=32,t>>=32n),s+h(BigInt.asUintN(32,t))}class a{constructor(t,s){if(this.m_EnvelopeType=1,void 0!==t){if(t instanceof a)return this.vmin=t.vmin,void(this.vmax=t.vmax);this.vmin=t,this.vmax=s,this.normalize()}else this.setEmpty()}static construct(t,s){return new a(t,s)}static constructEmpty(){return new a}setCoords(t,s){this.vmin=t,this.vmax=s,this.normalize()}setCoordsFromEnvelope(t){this.vmin=t.vmin,this.vmax=t.vmax}setEmpty(){this.vmin=Number.NaN,this.vmax=Number.NaN}getCenter(){return.5*(this.vmin+this.vmax)}equalsRange(t,s){return Ut(this.vmin,t)&&Ut(this.vmax,s)}equals(t,s){return!(!this.isEmpty()||!t.isEmpty())||(void 0!==s?Math.abs(this.vmin-t.vmin)<=s&&Math.abs(this.vmax-t.vmax)<=s:this.vmin===t.vmin&&this.vmax===t.vmax)}width(){return this.vmax-this.vmin}isEmpty(){return Number.isNaN(this.vmin)||Number.isNaN(this.vmax)}isZero(){return this.vmin===this.vmax}setInfinite(){this.vmin=Number.NEGATIVE_INFINITY,this.vmax=Number.POSITIVE_INFINITY}move(t){this.isEmpty()||(this.vmin+=t,this.vmax+=t)}contains(t){return t.vmin>=this.vmin&&t.vmax<=this.vmax}containsCoordinate(t){return t>=this.vmin&&t<=this.vmax}containsRightExclusive(t){return t>=this.vmin&&t<this.vmax}containsExclusiveCoordinate(t){return t>this.vmin&&t<this.vmax}containsExclusive(t){return t.vmin>this.vmin&&t.vmax<this.vmax}isIntersecting(t){return this.vmin<=t.vmin?this.vmax>=t.vmin:t.vmax>=this.vmin}mergeCoordinate(t){if(this.isEmpty())return this.vmin=t,void(this.vmax=t);this.mergeNeCoordinate(t)}merge(t){if(t.isEmpty())return;const s=t.vmin,i=t.vmax;this.mergeCoordinate(s),this.mergeCoordinate(i)}mergeNe(t){const s=t.vmin,i=t.vmax;this.mergeNeCoordinate(s),this.mergeNeCoordinate(i)}mergeNeCoordinate(t){t<this.vmin?this.vmin=t:t>this.vmax&&(this.vmax=t)}intersect(t){this.isEmpty()||t.isEmpty()?this.setEmpty():(this.vmin<t.vmin&&(this.vmin=t.vmin),this.vmax>t.vmax&&(this.vmax=t.vmax),this.vmin>this.vmax&&this.setEmpty())}inflate(t){this.isEmpty()||(this.vmin-=t,this.vmax+=t,this.vmax<this.vmin&&this.setEmpty())}normalize(){this.vmin<=this.vmax||(this.vmin>this.vmax?this.vmax=mt(this.vmin,this.vmin=this.vmax):this.setEmpty())}isValid(){return this.isEmpty()||this.vmin<=this.vmax}snapClip(t){return _s(t,this.vmin,this.vmax)}calculateToleranceFromEnvelope(){return this.isEmpty()?xs():(Math.abs(this.vmin)+Math.abs(this.vmax)+1)*xs()}static unit(){return l}normalizeNoNAN(){this.vmin>this.vmax&&(this.vmax=mt(this.vmin,this.vmin=this.vmax))}setCoordsNoNAN(t,s){this.vmin=t,this.vmax=s,this.normalizeNoNAN()}clone(){return new a(this.vmin,this.vmax)}}const l=new a(0,1);class c{static getNAN(){return new c(Number.NaN)}constructor(t,s){this.m_value=t??0,this.m_eps=s??0}[Symbol.toPrimitive](t){return this}clone(){return new c(this.m_value,this.m_eps)}assign(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}scaleError(t){this.m_eps*=t}setError(t){this.m_eps=t}set(t,s){return this.m_value=t,this.m_eps=s??0,this}setWithEps(t,s){return void 0===s&&(s=1),this.m_value=t,this.m_eps=c.ulp(t)*s,this}setE(t){return this.m_value=t.m_value,this.m_eps=t.m_eps,this}precise(){return new c(this.m_value)}value(){return this.m_value}toDouble(){return this.m_value}eps(){return this.m_eps}resetError(){return this.m_eps=0,this}absThis(){return this.m_value=Math.abs(this.m_value),this}add(t){return this.clone().addThis(t)}addE(t){return this.clone().addThisE(t)}addThisE(t){const s=this.m_value+t.m_value,i=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=i,this}addThis(t){const s=this.m_value+t,i=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=i,this}subE(t){return this.clone().subThisE(t)}sub(t){return this.clone().subThis(t)}subThisE(t){const s=this.m_value-t.m_value,i=this.m_eps+t.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=i,this}subThis(t){const s=this.m_value-t,i=this.m_eps+c.ulp(s);return this.m_value=s,this.m_eps=i,this}setAddE(t,s){return this.m_value=t.m_value+s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setAdd(t,s){return this.m_value=t+s,this.m_eps=c.ulp(this.m_value),this}setAddEN(t,s){return this.m_value=t.m_value+s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setAddNE(t,s){return this.m_value=t+s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}setSubE(t,s){return this.m_value=t.m_value-s.m_value,this.m_eps=t.m_eps+s.m_eps+c.ulp(this.m_value),this}setSub(t,s){return this.m_value=t-s,this.m_eps=c.ulp(this.m_value),this}setSubEN(t,s){return this.m_value=t.m_value-s,this.m_eps=t.m_eps+c.ulp(this.m_value),this}setSubNE(t,s){return this.m_value=t-s.m_value,this.m_eps=s.m_eps+c.ulp(this.m_value),this}mulThisE(t){const s=this.m_value*t.m_value;return this.m_eps=this.m_eps*Math.abs(t.m_value)+t.m_eps*Math.abs(this.m_value)+this.m_eps*t.m_eps+c.ulp(s),this.m_value=s,this}mulThis(t){const s=this.m_value*t;return this.m_eps=this.m_eps*Math.abs(t)+c.ulp(s),this.m_value=s,this}mul(t){return this.clone().mulThis(t)}mulE(t){return this.clone().mulThisE(t)}setMulE(t,s){const i=t.m_value*s.m_value;return this.m_eps=t.m_eps*Math.abs(s.m_value)+s.m_eps*Math.abs(t.m_value)+t.m_eps*s.m_eps+c.ulp(i),this.m_value=i,this}setMul(t,s){return this.m_value=t*s,this.m_eps=c.ulp(this.m_value),this}setMulEN(t,s){return this.setE(t),this.mulThis(s)}setMulNE(t,s){return this.setE(s),this.mulThis(t)}mulThisByPower2(t){return this.m_value*=t,this.m_eps*=Math.abs(t),this}static st_mulByPower2(t,s){return new c(t.m_value,t.m_eps).mulThisByPower2(s)}divE(t){return this.clone().divThisE(t)}divThisE(t){const s=Math.abs(t.m_value),i=this.m_value/t.m_value;let e=(this.m_eps+Math.abs(i)*t.m_eps)/s;if(t.m_eps>.01*s){const i=t.m_eps/s;e*=1+(1+i)*i}return this.m_value=i,this.m_eps=e+c.ulp(i),this}divThis(t){const s=Math.abs(t);return this.m_value/=t,this.m_eps=this.m_eps/s+c.ulp(this.m_value),this}setDivE(t,s){return this.setE(t),this.divThisE(s)}setDiv(t,s){return this.m_value=t/s,this.m_eps=c.ulp(this.m_value),this}setDivEN(t,s){return this.setE(t),this.divThis(s)}setDivNE(t,s){return this.set(t),this.divThisE(s)}divThisByPower2(t){return this.m_value/=t,this.m_eps/=Math.abs(t),this}invThis(){return this.setE(v.clone().divThisE(this)),this}sqrt(){return this.clone().sqrtThis()}sqrtThis(){let t,s;return this.m_value>=0?(t=Math.sqrt(this.m_value),s=this.m_value>10*this.m_eps?.5*this.m_eps/t:this.m_value>this.m_eps?t-Math.sqrt(this.m_value-this.m_eps):Math.max(t,Math.sqrt(this.m_value+this.m_eps)-t),s+=c.ulp(t)):this.m_value<-this.m_eps?(t=Number.NaN,s=Number.NaN):(t=0,s=Math.sqrt(this.m_eps)),this.m_value=t,this.m_eps=s,this}sqr(){return this.clone().sqrThis()}sqrThis(){const t=this.m_value*this.m_value;return this.m_eps=2*this.m_eps*Math.abs(this.m_value)+this.m_eps*this.m_eps+c.ulp(t),this.m_value=t,this}setSin(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=s;const e=Math.abs(s),n=Math.abs(t.value());return this.m_eps=(Math.abs(i)+.5*e*t.m_eps)*t.m_eps+c.ulp(e+n),this}static ulp(t){let s=Bt(t);const i=((0x7ff0000000000000n&s)>>52n)-1075n;return i>-1023n?(s=i+0x3ffn<<52n,function(t){return Zt[0]=t,St[0]}(s)):0===t?0:Number.MIN_VALUE}setCos(t){const s=Math.sin(t.m_value),i=Math.cos(t.m_value);this.m_value=i;const e=Math.abs(i),n=Math.abs(t.value());return this.m_eps=(Math.abs(s)+.5*e*t.m_eps)*t.m_eps+c.ulp(e+n),this}static st_cosAndSin(t,s,i){const e=Math.sin(t.m_value),n=Math.cos(t.m_value);i.m_value=e,s.m_value=n;const r=Math.abs(e),o=Math.abs(n),h=Math.abs(t.value());i.m_eps=(Math.abs(n)+.5*r*t.m_eps)*t.m_eps+c.ulp(r+h),s.m_eps=(Math.abs(e)+.5*o*t.m_eps)*t.m_eps+c.ulp(o+h)}negate(){return this.clone().negateThis()}negateThis(){return this.m_value=-this.m_value,this}setAbs(){return this.m_value=Math.abs(this.m_value),this}isInInterval(t){return a.construct(this.m_value-this.m_eps,this.m_value+this.m_eps).isIntersecting(t)}eq(t){return Math.abs(this.m_value-t.m_value)<=this.m_eps+t.m_eps}ne(t){return!this.eq(t)}gt(t){return this.m_value-t.m_value>this.m_eps+t.m_eps}lt(t){return t.m_value-this.m_value>this.m_eps+t.m_eps}ge(t){return!this.lt(t)}le(t){return!this.gt(t)}tolEQ(t,s){return Math.abs(this.m_value-t.m_value)<=s||this.eq(t)}tolNE(t,s){return!this.tolEQ(t,s)}tolGT(t,s){return this.m_value-t.m_value>s&&this.gt(t)}tolLT(t,s){return t.m_value-this.m_value>s&&this.lt(t)}tolGE(t,s){return!this.tolLT(t,s)}tolLE(t,s){return!this.tolGT(t,s)}isZero(){return Math.abs(this.m_value)<=this.m_eps}isFuzzyZero(){return this.isZero()&&0!==this.m_eps}tolIsZero(t){return Math.abs(this.m_value)<=Math.max(this.m_eps,t)}setPi(){this.setE(d)}setEuler(){this.set(2.718281828459045,f())}static size(){return 1}}function m(t,s){const i=Gt(t),e=Gt(s),n=53-u(i),r=53-u(e);return(n>=0?n:0)+(r>=0?r:0)<=52}function y(t,s){const i=t+s;return i-t===s&&i-s===t}function x(t,s){const i=t-s;return t-i===s&&s+i===t}function f(){return bs()}c.dimensions=1;const d=new c(Math.PI,.5*f()),b=new c(0,0),v=new c(1,0),_=new c(4,0);function w(t,s,i){return t.addE(s.subE(t).mulE(i))}function N(t,s,i){return s.subE(s.subE(t).mulE(v.subE(i)))}function p(t){let s;if(0===t)s=1;else if(Math.abs(t)>.01)s=function(t){return Math.atanh(t)}(t)/t;else{let i;const e=-36.841361487904734;s=0;const n=t*t;for(let t=2*Math.trunc(e/Math.log(n)+2.5)-1;t>1;t-=2)i=1/t,s=(s+i)*n;s+=1}return s}function M(t){const s=Math.PI*Math.PI/6;let i;if(1===t)i=s;else if(t>1)i=s;else if(0===t)i=t;else if(t<0){const s=1+(t=Math.abs(t)),e=Math.log(s);i=e*e/-2-M(t/s)}else if(t>.5){const e=1-t,n=Math.log(t)*Math.log(e);i=s-M(e)-n}else{i=0;const s=1+Math.trunc(-16*Math.log(10)/Math.log(t)+1.5);let e=s;for(let n=s;n>0;n--,e-=1)i*=t,i+=1/(e*e);i*=t}return i}function g(t,s){const i=s*t;if(Math.abs(s)<.1){let s=0;for(let t=60;t>=1;t--)s*=i,s+=1/t/t;return s*=t,s}return M(i)/s}function C(t,s){return t<s?It(t,s):It(s,t)}function T(t,s){const i=Math.abs(t);return s>=0?i:-i}function R(t){return Math.round(t)}function E(t,s,i,e,n){n[0]=s[0]+(i[0]-s[0])*e,n[1]=s[1]+(i[1]-s[1])*e,3===t&&(n[2]=s[2]+(i[2]-s[2])*e)}function I(t,s,i,e,n){n[0]=i[0]-(i[0]-s[0])*(1-e),n[1]=i[1]-(i[1]-s[1])*(1-e),3===t&&(n[2]=i[2]-(i[2]-s[2])*(1-e))}function P(t,s,i,e,n){e<=.5?E(t,s,i,e,n):I(t,s,i,e,n)}function A(t,s,i,e,n){n[0]=s[0].addE(i[0].subE(s[0]).mulE(e)),n[1]=s[1].addE(i[1].subE(s[1]).mulE(e))}function D(t,s,i,e,n){n[0]=i[0].subE(i[0].subE(s[0]).mulE(v.subE(e))),n[1]=i[1].subE(i[1].subE(s[1]).mulE(v.subE(e)))}function q(t,s,i){let e;return e=i<=.5?t+(s-t)*i:s-(s-t)*(1-i),e}function z(t,s,i){return t+(s-t)*i}function S(t,s,i){return s-(s-t)*(1-i)}function Z(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i))}function F(t,s,i,e){i<=.5?(e.x=t.x+(s.x-t.x)*i,e.y=t.y+(s.y-t.y)*i,e.z=t.z+(s.z-t.z)*i):(e.x=s.x-(s.x-t.x)*(1-i),e.y=s.y-(s.y-t.y)*(1-i),e.z=s.z-(s.z-t.z)*(1-i))}function k(t){return t*t}function B(t){return t*t*t}function G(t){return 1/Math.sqrt(t)}function L(t){return t<0?-1:t>0?1:0}function O(t,s,i,e){const n=[0],r=[0],o=[0];return tt($(t,i,n),$(s,e,r),o)+(n[0]+r[0]+o[0])}const U=[0],Q=[0];function V(t,s,i){return function(t,s,i,e){const n=tt(t,s,J),r=tt(n,i,K);return tt(r,J[0]+K[0],e)}($(t,s,U),i,U[0],Q)}const W=[0],Y=[0],j=[0],X=[0];function $(t,s,i){const e=t*s;return H(t,W,Y),H(s,j,X),i[0]=Y[0]*X[0]-(e-W[0]*j[0]-Y[0]*j[0]-W[0]*X[0]),e}function H(t,s,i){const e=134217729*t;s[0]=e-(e-t),i[0]=t-s[0]}const J=[0],K=[0];function tt(t,s,i){const e=t+s;return Math.abs(t)>Math.abs(s)?i[0]=t-e+s:i[0]=s-e+t,e}function st(t,s){return t%s}function it(t){const s=1-t;if(0===s)return 1;let i;if(s<=.01){const t=s,e=Math.log(t);i=1+t*(.4431471805599453-.25*e+t*(.05680519270997949-.09375*e+t*(.02183137044373718-.05859375*e+t*(.011544521417308362-.042724609375*e+t*(.00714200031339596-.0336456298828125*e+t*(.004854743337164948-.027757644653320312*e+t*(.003514687963781376-.023627042770385742*e)))))))}else{if(t<.016){const s=t,i=.25,e=.046875,n=.01953125,r=.01068115234375,o=.0067291259765625,h=.004626274108886719,u=.0033752918243408203,a=.0025710230693221092;return gs()*(1-s*(i+s*(e+s*(n+s*(r+s*(o+s*(h+s*(u+s*a))))))))}i=rt(0,s,1)-t*ot(0,s,1)/3}return _s(i,1,gs())}function et(t,s,i=Number.NaN){if((0,e.g)(s>=0&&s<=1),0===s)return t;let n=1,r=t;if(r<0&&(r=-r,n=-1),1===s){const t=Math.round(r/ps()),s=r-t*ps();return n*(2*t+Math.sin(s))}const o=gs(),h=Math.floor(r/o);1&h?r=(h+1)*o-r:r-=h*o;const u=Math.sin(r),a=Number.isNaN(i)?it(s):i;let l;if(1===u)l=a+Math.sqrt(1-s)*(r-o);else{const t=r*r;if(.01424*Math.pow(t,4)<=2*bs())l=r*(1+t*s*(-1/6+t*((4-3*s)/120-(16+(45*s-60)*s)/5040*t)));else if(s<=.01){const t=Math.sin(2*r),i=Math.sin(4*r),e=Math.sin(6*r),n=Math.sin(8*r),o=Math.sin(10*r);l=r+s*((2*-r+t)/8+s*((-3*r+2*t-.25*i)/64+s*((-20*r+15*t-3*i+e/3)/1024+s*(5*(-140*r+112*t-28*i+16/3*e-.5*n)/65536+7*s*((-63*r+52.5*t-15*i+3.75*e-.625*n+.05*o)/65536+s*(-693*r+594*t-185.625*i+1.375*e-12.375*n+1.8*o-.125*Math.sin(12*r))/1048576)))))}else{const t=u*u,i=Math.cos(r),e=i*i,n=ht(u,i,s);l=u*(rt(e,n,1)-s*t*ot(e,n,1)/3)}}return 1&h?l=a*(h+1)-l:l+=a*h,n*l}function nt(t,s,i=Number.NaN){if(0===t)return 0;let e=1,n=t;t<0&&(n=-n,e=-1);const r=Number.isNaN(i)?it(s):i,o=Math.floor(n/r);1&o?n=(o+1)*r-n:n-=o*r;let h=n<=0?0:n>=r?gs():function(t,s,i){if(0===s)return t;if(1===s)return Math.asin(t);let e=0,n=!0;if(t<.2){const i=t*t,r=t*(1+i*s*(1/6+i*((13*s-4)/120+(16-284*s+493*s*s)/5040*i))),o=Math.abs(s*(4944*s-64-31224*s*s+37369*s*s*s)/362880*Math.pow(t,9));if(o<Math.abs(r)*bs())return r;e=r,n=o>.1*r}if(n){const n=1-s,r=1-t/i,o=Math.sqrt(r*r+n*n),h=Math.atan2(n,t+bs());e=gs()+Math.sqrt(o)*(h-gs())}let r=0;for(let n=0;n<7;n++){r=et(e,s,i);const o=ht(Math.sin(e),Math.cos(e),s);if(e-=(r-t)/Math.sqrt(o),n>0&&Math.abs(r-t)<=4*bs()*t)break}return e}(n,s,r);return 1&o?h=gs()*(o+1)-h:h+=gs()*o,e*h}function rt(t,s,i){(0,e.g)((0!==t?1:0)+(0!==s?1:0)+1>1);let n=t,r=s,o=i;for(;;){const t=Math.sqrt(n*r)+Math.sqrt(r*o)+Math.sqrt(o*n);n=.25*(n+t),r=.25*(r+t),o=.25*(o+t);const s=(n+r+o)/3,i=(s-n)/s,e=(s-r)/s,h=(s-o)/s;if(Math.abs(i)<=.0024&&Math.abs(e)<=.0024&&Math.abs(h)<=.0024){const t=i*e-h*h,n=i*e*h;return(1+(1/24*t-.1-3/44*n-5*t*t/208+t*n/16)*t+(1/14+3*n/104)*n)/Math.sqrt(s)}}}function ot(t,s,i){(0,e.g)(0!==t||0!==s);let r=t,o=s,h=i;const u=new n(0);let a=1;for(;;){const t=.2*(r+o+3*h),s=(t-r)/t,i=(t-o)/t,e=(t-h)/t;if(Math.abs(s)<=.0015&&Math.abs(i)<=.0015&&Math.abs(e)<=.0015){const n=s*i,r=e*e,o=n-r,h=n-6*r,l=h+o+o,c=3/26,m=h*(9/22*.25*h-.21428571428571427-1.5*c*e*l),y=e*(1/6*l+e*(-.4090909090909091*o+e*c*n));return 3*u.getResult()+a*(1+m+y)/(t*Math.sqrt(t))}const n=Math.sqrt(r),l=Math.sqrt(o),c=Math.sqrt(h),m=n*(l+c)+l*c;u.add(a/(c*(h+m))),a*=.25,r=.25*(r+m),o=.25*(o+m),h=.25*(h+m)}}function ht(t,s,i){return t<.999?1-i*k(t):1-i+i*k(s)}function ut(t,s,i,n,r){return 0===t?0===n?s:1===n?i:r:1===t?0===n?s:1===n?i:q(s,i,n):(2===t&&(0,e.b)("angular interpolation"),void(0,e.b)(""))}function at(t,s,i,n,r,o,h,u){if(0===t)for(let t=0;t<o;++t)n[t+r]=0===h?s[t]:1===h?i[t]:u;else if(1===t)if(0===h)lt(n,s,r,0,o);else if(1===h)lt(n,i,r,0,o);else for(let t=0;t<o;++t)n[t+r]=q(s[t],i[t],h);else if(2===t)if(0===h)lt(n,s,r,0,o);else if(1===h)lt(n,i,r,0,o);else{let t=0;for(let e=0,u=r;e<o;++e,++u)n[u]=q(s[e],i[e],h),t+=n[u]*n[u];if(t>0){t=Math.sqrt(t);for(let s=r;s<r+o;++s)n[s]/=t}else{for(let t=r;t<r+o;++t)n[t]=0;n[r]=1}}else(0,e.b)("")}function lt(t,s,i,e,n){if(0===n)return;let r=0,o=i,h=e;for(;r++<n;)t[o++]=s[h++]}function ct(t,s,i){let e=0;for(let n=0;!e&&n<i;++n)e=t[n]-s[n];return e}function mt(t,s){return t}function yt(t){t.sort(((t,s)=>t<s?-1:t>s?1:0))}function xt(t,s){const i=t.slice(0,s);yt(i),lt(t,i,0,0,s)}function ft(t,s,i,e){const n=t.slice(s,s+i);n.sort(e),lt(t,n,s,0,i)}function dt(t,s){return t<s?-1:t>s?1:0}function bt(t,s,i,e){return t<i?-1:t>i?1:s<e?-1:s>e?1:0}function vt(t,s){if(t.length<2)return t.length;let i=0;for(let e=1;e<t.length;++e)s(t[e],t[i])||(i++,t[e]=mt(t[i],t[i]=t[e]));return 1+i}function _t(t,s){t[s]=t.at(-1),t.pop()}function wt(t,s=!1){return{[Symbol.dispose](){this.bForget||t()},bForget:s}}function Nt(t,s){return Array.from({length:s},(()=>new t))}function pt(t,s,i){for(let e=0;e<i;++e)t[e].assign(s[e]);return i}function Mt(t,s){const i=t.slice(0,s);for(let t=0;t<s;++t)i[t]=i[t].clone();return i}function gt(t){return Array.from({length:t},(()=>null))}function Ct(t,s){return Array.from({length:s},(()=>t()))}function Tt(t,s){return Array.from({length:t},(()=>s))}function Rt(t,s){return s in t&&1===Object.getOwnPropertyNames(t).length}class Et{constructor(...t){this.m_elts=t}get length(){return this.m_elts.length}at(t){return this.m_elts[t]}[Symbol.dispose](){for(const t of this.m_elts)t[Symbol.dispose]()}}function It(t,s){return{first:t,second:s}}const Pt=Math.PI,At=2*Math.PI,Dt=.5*Math.PI;class qt{constructor(t,s){this.m_cr=t,this.m_cc=s,this.m_v=Tt(t*s,0)}get(t,s){return this.m_v[t*this.m_cc+s]}set(t,s,i){this.m_v[t*this.m_cc+s]=i}inc(t,s){return++this.m_v[t*this.m_cc+s]}}const zt=new ArrayBuffer(8),St=new Float64Array(zt),Zt=new BigUint64Array(zt),Ft=0x0fffffffffffffn;function kt(){return Number.EPSILON*ys}function Bt(t){return St[0]=t,Zt[0]}function Gt(t){return Bt(t)&Ft}function Lt(t){return Number((9218868437227405312n&Bt(t))>>52n)}function Ot(t){if(0n===t)return-1n;if(1n===t||-1n===t)return 0n;t<0n&&(t=-t);let s=0n,i=512n,e=1n<<s+i;for(;t>=e;)s+=i,i<<=1n,e<<=i;let n=s;i>>=1n;let r=n+i;for(;i>0n;)t<1n<<r||(n=r),i>>=1n,r=n+i;return n}function Ut(t,s){return t===s||Number.isNaN(t)&&Number.isNaN(s)}function Qt(t,s,i){return t===s||Math.abs(t-s)<=i||Number.isNaN(t)&&Number.isNaN(s)}function Vt(t,s){return t<s?-1:t>s?1:0}function Wt(t,s){if(t<s)return-1;if(t>s)return 1;if(t===s)return 0;{const i=Number.isNaN(t),e=Number.isNaN(s);return i<e?-1:i>e?1:0}}function Yt(){return 2147483647}function jt(){return 32767}function Xt(){return 2147483647}function $t(){return-2147483648}const Ht=2147483647,Jt=BigInt(Ht),Kt=2166136261,ts=16777619,ss=14695981039346656037n,is=1099511628211n;function es(t){let s=Kt;for(let i=0,e=t.length;i<e;++i)s=(s^t.charCodeAt(i))*ts;return s&Ht}function ns(t,s){return s+2654435769+(t<<6)+(t>>2)&Ht}function rs(t,s){return ns(t,as(s))}function os(t){return ns(3735928559,t)}function hs(t,s){return ns(t,os(s))}function us(t){return function(t){let s=Kt,i=t;return s=(s^255&i)*ts,i>>=8,s=(s^255&i)*ts,i>>=8,s=(s^255&i)*ts,i>>=8,s=(s^255&i)*ts,s&Ht}(t)}function as(t){return Number(function(t){let s=ss,i=t;return s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,i>>=8n,s=(s^0xffn&i)*is,s&Jt}(t))}function ls(t){return as(Bt(function(t){return Rs(t)}(t)))}function cs(t){return function(t){return 1103515245*t+12345&2147483647}(t)}const ms=100,ys=100;function xs(){return Number.EPSILON*ms}function fs(){return.38196601125010515}function ds(){return 1.4142135623730951}function bs(){return Number.EPSILON}function vs(t,s,i){return t===s||t===i}function _s(t,s,i){return t>=s?t<=i?t:i:s}function ws(t,s,i){const e=t[0];if(e>=s){if(e<=i)return!1;t[0]=i}else t[0]=s;return!0}function Ns(t,s){return t>=s?s:t<-s?-s:t}function ps(){return Pt}function Ms(){return At}function gs(){return Dt}const Cs=3*gs();function Ts(){return Cs}function Rs(t){return t+0}function Es(t){return{v:t}}class Is{constructor(){this.m_rn=Es(0n),this.m_rd=Es(1n),this.m_bNaN=!1,this.m_bNormalized=!1,this.m_power=0,this.m_sign=0}static constructAssign(t,s){const i=t.clone();return void 0!==s&&i.limitPrecisionThis(s),i}static constructDouble(t){return(new Is).setDouble(t)}static constructInt64(t){return(new Is).setInt64(t)}static constructRational(t,s){return(new Is).setRational(t,s)}static constructInt32(t){return this.constructInt64(BigInt(Math.trunc(t)))}[Symbol.toPrimitive](t){return this}compare(t){return this.lt(t)?-1:this.gt(t)?1:0}assignCopy(t){return this.setThis(t)}abs(){return this.clone().absThis()}absThis(){return this.isNAN()||(this.m_sign*=this.m_sign),this}clone(){return(new Is).setThis(this)}setThis(t){return this.m_bNaN=t.m_bNaN,this.m_bNormalized=t.m_bNormalized,this.m_rn.v=t.m_rn.v,this.m_rd.v=t.m_rd.v,this.m_power=t.m_power,this.m_sign=t.m_sign,this}setZero(){return this.m_rn.v=0n,this.m_rd.v=1n,this.m_bNaN=!1,this.m_power=0,this.m_bNormalized=!0,this.m_sign=0,this}setDouble(t){if(this.setZero(),0===t)return this;if(Number.isInteger(t)&&Math.abs(t)<2147483647)return this.setInt32(t);const s=Bt(t),i=(s&Is.s_em)>>52n,n=!!(s&Is.s_sm),r=s&Is.s_fm;if(i===Is.s_emax)return r?(this.m_rn.v=this.m_rd.v=0n,this.m_bNaN=!0,this):(this.m_rn.v=n?-1n:1n,this.m_rd.v=0n,this);0n===i&&(0,e.b)("denormalized numbers not yet implemented");const o=i-1023n,h=o>=0n?o:0n,u=o<0n?-o:0n;return this.m_rn.v=(1n<<52n|r)<<h,this.m_rd.v=1n<<52n+u,this.m_sign=n?-1:1,this.m_bNormalized=!1,this.normalizeThis()}setInt64(t){return 0n===t?this.setZero():(this.m_bNaN=!1,this.m_sign=t>0n?1:-1,this.m_rn.v=t>0n?t:-t,this.m_rd.v=1n,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setRational(t,s){return 0n===t?0n===s?this.setNAN():this.setZero():0n===s?t>0n?this.setPositiveInf():this.setNegativeInf():(this.m_sign=(t>0n?1:-1)*(s>0n?1:-1),this.m_rn.v=t>0n?t:-t,this.m_rd.v=s>0n?s:-s,this.m_power=0,this.m_bNormalized=!1,this.normalizeThis())}setInt32(t){return this.setInt64(BigInt(Math.trunc(t)))}getDouble(){return this.convertToDouble()}toDouble(){return this.convertToDouble()}value(){return this.convertToDouble()}isNAN(){return this.m_bNaN}isPositiveInf(){return!this.isNAN()&&0n===this.m_rd.v&&1===this.m_sign}isNegativeInf(){return!this.isNAN()&&0n===this.m_rd.v&&-1===this.m_sign}isFinite(){return!this.isNAN()&&0n!==this.m_rd.v}setNAN(){return this.m_bNaN=!0,this.m_rn.v=0n,this.m_rd.v=0n,this.m_power=0,this.m_bNormalized=!0,this}setPositiveInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=1,this.m_power=0,this}setNegativeInf(){return this.m_rn.v=1n,this.m_rd.v=0n,this.m_bNaN=!1,this.m_bNormalized=!0,this.m_sign=-1,this.m_power=0,this}subThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())this.setNAN();else{if(this.isPositiveInf()&&t.isNegativeInf())return this.setPositiveInf(),this;if(this.isNegativeInf()&&t.isNegativeInf())this.setNAN();else if(this.isNegativeInf()&&t.isPositiveInf())return this.setNegativeInf(),this}return this.isNAN()?this:this.opPlusMinus(t,!1)}thisSubAbs(t){return(0,e.g)(0),this}mulThis(t){return t.isNAN()&&this.setNAN(),this.isNAN()?this:(this.m_sign*=t.m_sign,0===this.m_sign?this.setZero():(this.m_rn.v*=t.m_rn.v,this.m_rd.v*=t.m_rd.v,this.m_power+=t.m_power,this.m_bNormalized=!1,this.normalizeThis(),this))}mulDoubleThis(t){return this.mulThis(Is.constructDouble(t))}thisMulInt64(t){return(0,e.g)(0),this}thisMulInt32(t){return(0,e.g)(0),this}divThis(t){return this.mulThis(t.clone().invertThis())}divDoubleThis(t){return this.divThis(Is.constructDouble(t))}addDoubleThis(t){return this.addThis(Is.constructDouble(t))}subDoubleThis(t){return this.subThis(Is.constructDouble(t))}mul(t){return this.clone().mulThis(t)}mulBigIntThis(t){return this.mulThis(Is.constructInt64(t))}mulDouble(t){return this.clone().mulThis(Is.constructDouble(t))}div(t){return this.clone().divThis(t)}divDouble(t){return this.clone().divDoubleThis(t)}add(t){return this.clone().addThis(t)}fmSubThis(t,s){return this.subThis(t.clone().mulThis(s))}fmAddThis(t,s){return this.addThis(t.clone().mulThis(s))}addThis(t){if(t.isNAN()&&this.setNAN(),this.isPositiveInf()&&t.isPositiveInf())return this.setPositiveInf(),this;if(this.isPositiveInf()&&t.isNegativeInf())this.setNAN();else{if(this.isNegativeInf()&&t.isNegativeInf())return this.setNegativeInf(),this;this.isNegativeInf()&&t.isPositiveInf()&&this.setNAN()}return this.isNAN()?this:this.opPlusMinus(t,!0)}addDouble(t){return this.clone().addThis(Is.constructDouble(t))}sub(t){return this.clone().subThis(t)}subDouble(t){return this.clone().subThis(Is.constructDouble(t))}isZero(){return 0===this.m_sign}equals(t){return this.clone().subThis(t).isZero()}lt(t){return!this.isNAN()&&!t.isNAN()&&!(this.isPositiveInf()&&t.isPositiveInf()||this.isNegativeInf()&&t.isNegativeInf())&&!this.isPositiveInf()&&(!!t.isPositiveInf()||this.clone().sub(t).LZ())}absLessAbs(t){return this.abs().lt(t.abs())}gt(t){return this.clone().sub(t).GZ()}lte(t){return this.sub(t).LEZ()}gte(t){return this.sub(t).GEZ()}normalizeThis(){if(this.m_bNormalized)return this;if(0n===this.m_rn.v)return this.setZero();let t=0,s=0xffffffffn;for(;0n===(this.m_rn.v&s)&&s<=this.m_rn.v;)s<<=32n,t+=32;s&=this.m_rn.v,s>>=BigInt(t),t+=h(BigInt.asUintN(32,s))-1;let i=0;for(s=0xffffffffn;0n===(this.m_rd.v&s)&&s<=this.m_rd.v;)s<<=32n,i+=32;return s&=this.m_rd.v,s>>=BigInt(i),i+=h(BigInt.asUintN(32,s))-1,this.m_rn.v>>=BigInt(t),this.m_rd.v>>=BigInt(i),this.m_power+=t-i,this.m_rn.v>1n&&this.m_rd.v>1n&&(this.m_rn.v%this.m_rd.v===0n?(this.m_rn.v/=this.m_rd.v,this.m_rd.v=1n):this.m_rd.v%this.m_rn.v===0n&&(this.m_rd.v/=this.m_rn.v,this.m_rn.v=1n)),this.m_bNormalized=!0,this}negateThis(){return this.isNAN()||(this.m_sign*=-1),this}negate(){return this.clone().negateThis()}invertThis(){return this.isNAN()?this:this.isPositiveInf()||this.isNegativeInf()?(this.setZero(),this):0n===this.m_rn.v?(this.setPositiveInf(),this):(this.m_rd=mt(this.m_rn,this.m_rn=this.m_rd),this.m_power=-this.m_power,this)}limitPrecisionThis(t){if(0===t)return this;if(this.isZero())return this.setZero();if(!this.isFinite())return this;this.normalizeThis();let s=Number(Ot(this.m_rn.v));if(s>t){const i=s-t;this.m_rn.v>>=BigInt(s-t),this.m_power+=i}if(s=Number(Ot(this.m_rd.v)),s>t){const i=s-t;this.m_rd.v>>=BigInt(s-t),this.m_power-=i}return this}hiBitIndex(){return Math.max(Number(Ot(this.m_rn.v)),Number(Ot(this.m_rd.v)))}ldexp(t){return this.clone().ldexpThis(t)}ldexpThis(t){return t&&(this.m_bNormalized=!1,this.m_power+=t,this.normalizeThis()),this}LZ(){return!this.isNAN()&&-1===this.m_sign}GZ(){return!this.isNAN()&&1===this.m_sign}LEZ(){return!this.isNAN()&&this.m_sign<=0}GEZ(){return!this.isNAN()&&this.m_sign>=0}toString(){return this.toDouble().toString()}sqr(){return this.clone().sqrThis()}sqrThis(){return this.mulThis(this.clone())}static sqrt(t,s){if(t.m_sign<0n&&(0,e.n)("MP_value: sqrt(-1)"),t.isZero())return t.clone();let i=52,n=2220446049250313e-31;for(;i<s;)2*i<=s?(n*=n,i*=2):(n*=2220446049250313e-31,i+=52);i+=52;const r=Ot(t.m_rn.v),o=Ot(t.m_rd.v);let h,u=t.m_power+Number(r-o);const a=new Is;Math.abs(u)>200?(1&Math.abs(u)&&(u+=1),h=Is.constructAssign(t,53).ldexpThis(-u).value(),a.setThis(t).ldexpThis(-u),(0,e.g)(Number.isFinite(h))):(a.setThis(t),h=a.value(),(0,e.g)(Number.isFinite(h)),u=0),h=Math.sqrt(h);const l=Is.constructDouble(h),c=Is.constructDouble(n);c.mulThis(l).ldexpThis(1);const m=n*h*2,y=l.clone(),x=new Is;let f;for(let t=0;t<10;++t){y.mulThis(l),x.setThis(a).subThis(y).absThis();let t=x.value();if(f=1,t<.9)for(;t>m;)t*=t,++f;else f=4;if(x.lte(c))break;for(let t=0;t<f;t++)y.setThis(l).divThis(a).invertThis().addThis(l).ldexpThis(-1).limitPrecisionThis(i),l.setThis(y)}return l.ldexpThis(u/2)}static cubicRoot(t,s){if(t.isZero())return t.clone();let i=52,e=2220446049250313e-31;for(;i<s;)2*i<=s?(e*=e,i*=2):(e*=2220446049250313e-31,i+=52);i+=52;const n=Math.pow(Math.abs(t.value()),1/3),r=Is.constructDouble(n),o=r.clone();o.sqrThis().mulDoubleThis(3).mulDoubleThis(e),o.limitPrecisionThis(32),t.LZ()&&r.negateThis();for(let s=0;s<10;++s){const s=r.clone();s.sqrThis().mulThis(r);const e=s.clone();if(e.subThis(t),e.absThis().limitPrecisionThis(32),e.lte(o))break;e.setThis(t),e.ldexpThis(1),e.addThis(s);const n=s.clone();n.ldexpThis(1),n.addThis(t),e.divThis(n),r.mulThis(e),r.limitPrecisionThis(i)}return r}isInTheRangeOfDouble(){return(0,e.g)(0),!1}sign(){return this.m_sign}cosAndSin(t,s){(0,e.g)(0)}static nan(){return(0,e.g)(0),new Is}convertToDouble(){if(this.m_bNaN)return Number.NaN;if(this.isZero())return 0;if(0n===this.m_rd.v)return 1===this.m_sign?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;const t=-1===this.m_sign,s=this.m_rn.v<<(this.m_power>=0?BigInt(this.m_power):0n);let i=this.m_rd.v<<(this.m_power<0?BigInt(-this.m_power):0n);const e=s/i;let n=Number(e);if(BigInt(n)!==e)return t?-n:n;let r=s-e*i;if(r){let t=Ot(i)-1023n;t>0n&&(i>>=t,r<<=52n,r>>=t);let s=Number(r);Number.isFinite(s)||(r>>=52n,s=Number(r),t=0n),t>0n&&(s/=Math.pow(2,52)),n+=s/Number(i)}return t?-n:n}signVal(){return 1===this.m_sign?1n:-1===this.m_sign?-1n:0n}opPlusMinus(t,s){const i=Math.min(this.m_power,t.m_power);let e,n;this.m_power>i?(e=BigInt(this.m_power-i),n=0n):(e=0n,n=BigInt(t.m_power-i));const r=this.signVal()*this.m_rn.v*t.m_rd.v<<e,o=t.signVal()*t.m_rn.v*this.m_rd.v<<n;return this.m_rn.v=s?r+o:r-o,this.m_rd.v*=t.m_rd.v,this.m_power=i,this.m_sign=1,this.m_rn.v<0n&&(this.m_sign=-1,this.m_rn.v=-this.m_rn.v),this.m_bNormalized=!1,this.normalizeThis(),this}}Is.s_sm=0x8000000000000000n,Is.s_em=0x7ff0000000000000n,Is.s_fm=0x000fffffffffffffn,Is.s_emax=0x7ffn;const Ps=Is.constructInt32(1),As=Is.constructInt32(0);function Ds(t,s){let i=Lt(t);const e=Lt(s);return i===e?(i-=53-function(t,s){return function(t){let s=0;return 0xffffffff00000000n&t&&(s=32,t>>=32n),s+function(t){let s=0;return 4294901760n&t&&(s+=16,t>>=16n),65280n&t&&(s+=8,t>>=8n),240n&t&&(s+=4,t>>=4n),s+o[Number(BigInt.asUintN(4,t))]+1}(t)}(t^s)}(Gt(t),Gt(s)),i):i>e?i:e}function qs(t,s){for(let i=0,e=0,n=t.length;i<n;i+=2,e++)s[e].x=t[i],s[e].y=t[i+1]}function zs(t){const s=new Float64Array(2*t.length);for(let i=0,e=t.length;i<e;++i){const e=i<<1;s[e]=t[i].x,s[e+1]=t[i].y}return s}function Ss(t){const s=Nt(Zs,t.length);for(let i=0,e=t.length;i<e;++i)s[i].setCoords(t[i][0],t[i][1]);return s}class Zs{static construct(t,s){return new Zs(t,s)}constructor(t,s){void 0!==t?(this.x=t,this.y=s):this.x=this.y=Number.NaN}clone(){return new Zs(this.x,this.y)}assign(t){this.setCoordsPoint2D(t)}setCoords(t,s){return this.x=t,this.y=s,this}setCoordsPoint2D(t){this.x=t.x,this.y=t.y}isEqualPoint2D(t,s){return void 0!==s?Math.abs(this.x-t.x)<=s&&Math.abs(this.y-t.y)<=s:this.x===t.x&&this.y===t.y}isEqual(t,s,i){return void 0!==i?Math.abs(this.x-t)<=i&&Math.abs(this.y-s)<=i:this.x===t&&this.y===s}equalsPoint2D(t,s){return this.isEqualPoint2D(t,s)}setSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}addThis(t){return this.x+=t.x,this.y+=t.y,this}setAdd(t,s){return this.x=t.x+s.x,this.y=t.y+s.y,this}absoluteOther(t){}absolute(){return(0,e.g)(0),this}setNegate(){this.x=-this.x,this.y=-this.y}setNegateOther(t){this.x=-t.x,this.y=-t.y}interpolateThis(t,s){}interpolate(t,s,i){(0,e.g)(0)}scaleAddThis(t,s){this.x=this.x*t+s.x,this.y=this.y*t+s.y}setScaleAdd(t,s,i){this.x=s.x*t+i.x,this.y=s.y*t+i.y}scaleOther(t,s){(0,e.g)(0)}scale(t){this.x*=t,this.y*=t}compare(t){return this.y<t.y?-1:this.y>t.y?1:this.x<t.x?-1:this.x>t.x?1:0}compareX(t){return this.x<t.x?-1:this.x>t.x?1:this.y<t.y?-1:this.y>t.y?1:0}normalizeOther(t){(0,e.g)(0)}normalize(){const t=this.length();return t?(this.x/=t,this.y/=t):(this.x=1,this.y=0),this}getUnitVector(){return this.clone().normalize()}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}sqrLength(){return this.x*this.x+this.y*this.y}static averageFast(t,s){return(0,e.g)(0),{}}static average(t,s){const i=new Zs;if(0===s)return i.setNAN(),i;if(1===s)return i.assign(t[0]),i;const e=new n(t[0].x),r=new n(t[0].y);for(let i=1;i<s;i++)e.add(t[i].x),r.add(t[i].y),255&i||(e.normalize(),r.normalize());return i.x=e.getResult()/s,i.y=r.getResult()/s,i}offset(t,s){const i=Zs.distance(t,s),e=Zs.construct(this.x,this.y);if(0===i)return Zs.distance(e,t);const n=s.clone();return n.subThis(t),e.subThis(t),e.crossProduct(n)/i}side(t,s){return t.equals(s)?this.equals(t)?0:1:Zs.orientationRobust(s,t,this)}static sqrDistance(t,s){const i=t.x-s.x,e=t.y-s.y;return i*i+e*e}static sqrDistanceCoords(t,s,i,e){const n=i-t,r=e-s;return n*n+r*r}static distance(t,s){return Math.sqrt(Zs.sqrDistance(t,s))}dotProduct(t){return this.x*t.x+this.y*t.y}dotProductAbs(t){return Math.abs(this.x*t.x)+Math.abs(this.y*t.y)}crossProduct(t){return this.x*t.y-this.y*t.x}crossProductAbs(t){return(0,e.g)(0),0}rotateDirect(t,s){const i=this.x*t-this.y*s,e=this.x*s+this.y*t;this.x=i,this.y=e}rotateReverse(t,s){const i=this.x*t+this.y*s,e=-this.x*s+this.y*t;this.x=i,this.y=e}leftPerpendicularThis(){const t=this.x;this.x=-this.y,this.y=t}leftPerpendicularOther(t){const s=t.x;this.x=-t.y,this.y=s}rightPerpendicularThis(){const t=this.x;this.x=this.y,this.y=-t}rightPerpendicularOther(t){const s=t.x;this.x=t.y,this.y=-s}equals(t){return this.x===t.x&&this.y===t.y}notequals(t){return this.x!==t.x||this.y!==t.y}not(){return!this.x&&!this.y}gt(t){return this.y>t.y||this.y===t.y&&this.x>t.x}gte(t){return!this.lt(t)}lt(t){return this.y<t.y||this.y===t.y&&this.x<t.x}lte(t){return!this.gt(t)}subThis(t){return this.x-=t.x,this.y-=t.y,this}divThis(t){return this.x/=t,this.y/=t,this}add(t){return new Zs(this.x+t.x,this.y+t.y)}sub(t){return new Zs(this.x-t.x,this.y-t.y)}negateThis(){return this.x=-this.x,this.y=-this.y,this}negate(){return new Zs(-this.x,-this.y)}mul(t){return new Zs(this.x*t,this.y*t)}mulThis(t){return this.x*=t,this.y*=t,this}divide(t){return new Zs(this.x/t,this.y/t)}setNAN(){this.x=this.y=Number.NaN}isNAN(){return Number.isNaN(this.x)||Number.isNaN(this.y)}static getNAN(){return new Zs(Number.NaN,Number.NaN)}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)}isZero(){return 0===this.x&&0===this.y}norm(t){switch(t){case 0:{const t=Math.abs(this.x),s=Math.abs(this.y),i=t-s;return i>=0?t:i<=0?s:Number.NaN}case 1:return Math.abs(this.x)+Math.abs(this.y);case 2:return Math.sqrt(this.x*this.x+this.y*this.y);default:(0,e.t)("norm")}}getQuarter(){return Zs.getQuarterCoords(this.x,this.y)}static getQuarterCoords(t,s){return t>0?s>=0?1:4:s>0?2:0===t?4:3}static compareVectors(t,s){const i=t.getQuarter(),e=s.getQuarter();return e===i?Zs.orientationRobustImpl(Zs.construct(0,0),s,t,!0):i<e?-1:1}static compareVectorsOrigin(t,s,i){const e=s.sub(t),n=i.sub(t),r=e.getQuarter(),o=n.getQuarter();return o===r?Zs.orientationRobustImpl(t,i,s,!0):r<o?-1:1}static orientationRobust(t,s,i){return Zs.orientationRobustImpl(t,s,i,!1)}static orientationRobustEx(t,s,i,e){if(t.equals(s)||i.equals(e))return 0;const n=s.x-t.x,r=s.y-t.y,o=e.x-i.x,h=e.y-i.y;{const t=Zs.getQuarterCoords(n,r)-1,s=Zs.getQuarterCoords(o,h)-1,i=Zs.d[t][s];if(0!==i)return i}const u=n*h,a=r*o,l=4*bs()*(Math.abs(u)+Math.abs(a)),c=u-a;return Math.abs(c)>=l?c<0?-1:c>0?1:0:Zs.orientationRobustExMp(t,s,i,e)}static orientationRobustExMp(t,s,i,e){const n=Is.constructDouble(s.x),r=Is.constructDouble(e.x);n.subThis(Is.constructDouble(t.x)),r.subThis(Is.constructDouble(i.x));const o=Is.constructDouble(s.y),h=Is.constructDouble(e.y);return o.subThis(Is.constructDouble(t.y)),h.subThis(Is.constructDouble(i.y)),n.mulThis(h),o.mulThis(r),n.subThis(o),n.LZ()?-1:n.GZ()?1:0}static orientationNonRobust(t,s,i){const e=s.sub(t).crossProduct(i.sub(t));return e<0?-1:e>0?1:0}static orientationRobustImpl(t,s,i,e){if(s.isEqualPoint2D(t)||i.isEqualPoint2D(t)||s.isEqualPoint2D(i))return 0;const n=s.x-t.x,r=s.y-t.y,o=i.x-t.x,h=i.y-t.y;if(!e){const t=Zs.getQuarterCoords(n,r)-1,s=Zs.getQuarterCoords(o,h)-1,i=Zs.d[t][s];if(0!==i)return i}const u=(Math.abs(n)+Math.abs(r)+Math.abs(o)+Math.abs(h))*(Math.abs(s.x)+Math.abs(s.y)+Math.abs(i.x)+Math.abs(i.y))*8*f(),a=n*h-r*o;if(Math.abs(a)>u)return a<0?-1:1;if(x(s.x,t.x)&&x(i.y,t.y)&&x(s.y,t.y)&&x(i.x,t.x)&&m(n,h)&&m(r,o)){const t=n*h,s=r*o;if(x(t,s)){const i=t-s;return i<0?-1:i>0?1:0}}return Zs.orientationRobustMp(t,s,i)}static orientationRobustMp(t,s,i){const e=Is.constructDouble(s.x),n=Is.constructDouble(i.x);{const s=Is.constructDouble(t.x);e.subThis(s),n.subThis(s)}const r=Is.constructDouble(i.y),o=Is.constructDouble(s.y);{const s=Is.constructDouble(t.y);r.subThis(s),o.subThis(s)}return e.mulThis(r),o.mulThis(n),e.subThis(o),e.LZ()?-1:e.GZ()?1:0}static inCircleRobust(t,s,i,e){const n=new c,r=new c;n.set(t.x),n.subThis(e.x),r.set(t.y),r.subThis(e.y);const o=new c,h=new c;o.set(s.x),o.subThis(e.x),h.set(s.y),h.subThis(e.y);const u=new c,a=new c;u.set(i.x),u.subThis(e.x),a.set(i.y),a.subThis(e.y);const l=n.mulE(h).subE(r.mulE(o)),m=o.mulE(a).subE(h.mulE(u)),y=n.mulE(a).subE(r.mulE(u)),x=n.mulE(n).addE(r.mulE(r)),f=o.mulE(o).addE(h.mulE(h)),d=u.mulE(u).addE(a.mulE(a)),b=x.mulE(m).subE(f.mulE(y)).addE(d.mulE(l));if(!b.isFuzzyZero()){const t=b.value();return t<0?-1:t>0?1:0}return Zs.inCircleRobustMp(t,s,i,e)}static inCircleRobustMp(t,s,i,e){do{if(!x(t.x,e.x)||!x(t.y,e.y))break;if(!x(s.x,e.x)||!x(s.y,e.y))break;if(!x(i.x,e.x)||!x(i.y,e.y))break;const n=t.x-e.x,r=t.y-e.y,o=s.x-e.x,h=s.y-e.y,u=i.x-e.x,a=i.y-e.y;if(!m(n,h)||!m(r,o))break;if(!m(o,a)||!m(h,u))break;if(!m(n,a)||!m(r,u))break;if(!m(n,n)||!m(r,r))break;if(!m(o,o)||!m(h,h))break;if(!m(u,u)||!m(a,a))break;const l=n*h,c=r*o,f=o*a,d=h*u,b=n*a,v=r*u,_=n*n,w=r*r,N=o*o,p=h*h,M=u*u,g=a*a;if(!x(l,c))break;if(!x(f,d))break;if(!x(b,v))break;if(!y(_,w))break;if(!y(N,p))break;if(!y(M,g))break;const C=l-c,T=f-d,R=b-v,E=_+w,I=N+p,P=M+g;if(!m(E,T))break;if(!m(I,R))break;if(!m(P,C))break;const A=E*T,D=I*R,q=P*C;if(!x(A,D))break;const z=A-D;if(!y(z,q))break;const S=z+q;return S<0?-1:S>0?1:0}while(0);const n=Is.constructDouble(e.x),r=Is.constructDouble(e.y),o=Is.constructDouble(t.x),h=Is.constructDouble(t.y);o.subThis(n),h.subThis(r);const u=Is.constructDouble(s.x),a=Is.constructDouble(s.y);u.subThis(n),a.subThis(r);const l=Is.constructDouble(i.x),c=Is.constructDouble(i.y);l.subThis(n),c.subThis(r);const f=o.mul(a).sub(h.mul(u)),d=u.mul(c).sub(a.mul(l)),b=o.mul(c).sub(h.mul(l)),v=o.mul(o).add(h.mul(h)),_=u.mul(u).add(a.mul(a)),w=l.mul(l).add(c.mul(c)),N=v.mul(d).sub(_.mul(b)).add(w.mul(f));return N.LZ()?-1:N.GZ()?1:0}static inCircleRobustMp3Point(t,s,i){const e=Is.constructDouble(t.x),n=Is.constructDouble(t.y),r=Is.constructDouble(s.x),o=Is.constructDouble(s.y),h=Is.constructDouble(i.x),u=Is.constructDouble(i.y),a=h.mul(h).add(u.mul(u)).sub(h.mul(e).add(u.mul(n)).add(h.mul(r)).add(u.mul(o))).add(e.mul(r).add(n.mul(o)));return a.LZ()?-1:a.GZ()?1:0}static inCircleRobust3Point(t,s,i){const e=new c(t.x),n=new c(t.y),r=new c(s.x),o=new c(s.y),h=new c(i.x),u=new c(i.y),a=h.mulE(h).addE(u.mulE(u)).subE(h.mulE(e).addE(u.mulE(n)).addE(h.mulE(r)).addE(u.mulE(o))).addE(e.mulE(r).addE(n.mulE(o)));if(!a.isFuzzyZero()){const t=a.value();return t<0?-1:t>0?1:0}return Zs.inCircleRobustMp3Point(t,s,i)}static calculateCircleCenterFromThreePoints(t,s,i){if(t.equals(i)||t.equals(s)||i.equals(s))return Zs.getNAN();const e=function(t,s,i){const e=new c(s.x);e.subThis(t.x);const n=new c(s.y);n.subThis(t.y);const r=new c(i.x);r.subThis(t.x);const o=new c(i.y);o.subThis(t.y);const h=e.clone();h.mulThisE(o);let u=n.clone();if(u.mulThisE(r),h.subThisE(u),0===h.value())return Zs.getNAN();h.mulThis(2);const a=e.clone();a.mulThisE(e);const l=n.clone();l.mulThisE(n);const m=a.clone();m.addThisE(l);const y=r.clone();y.mulThisE(r);const x=o.clone();x.mulThisE(o);const f=y.clone();f.addThisE(x);const d=n.clone();d.mulThisE(f),u=o.clone(),u.mulThisE(m),d.subThisE(u),d.divThisE(h);const b=e.clone();b.mulThisE(f),u=r.clone(),u.mulThisE(m),b.subThisE(u),b.divThisE(h);const v=Zs.construct(t.x-d.value(),t.y+b.value()),_=t.sub(v).length(),w=s.sub(v).length(),N=i.sub(v).length(),p=1e-15*(_+Math.abs(t.x)+Math.abs(s.x)+Math.abs(i.x)+Math.abs(t.y)+Math.abs(s.y)+Math.abs(i.y));return Math.abs(_-w)<=p&&Math.abs(_-N)<=p&&d.eps()<p&&b.eps()<p?v:Zs.getNAN()}(t,s,i);return e.isNAN()?function(t,s,i){const e=Is.constructDouble(s.x);e.subDoubleThis(t.x);const n=Is.constructDouble(s.y);n.subDoubleThis(t.y);const r=Is.constructDouble(i.x);r.subDoubleThis(t.x);const o=Is.constructDouble(i.y);o.subDoubleThis(t.y);const h=e.clone();h.mulThis(o);let u=n.clone();if(u.mulThis(r),h.subThis(u),h.isZero())return Zs.getNAN();h.mulDoubleThis(2);const a=e.clone();a.mulThis(e);const l=n.clone();l.mulThis(n);const c=a.clone();c.addThis(l);const m=r.clone();m.mulThis(r);const y=o.clone();y.mulThis(o);const x=m.clone();x.addThis(y);const f=n.clone();f.mulThis(x),u=o.clone(),u.mulThis(c),f.subThis(u),f.divThis(h);const d=e.clone();return d.mulThis(x),u=r.clone(),u.mulThis(c),d.subThis(u),d.divThis(h),Zs.construct(t.x-f.value(),t.y+d.value())}(t,s,i):e}static calculateAngle(t,s){return Math.atan2(t.crossProduct(s),t.dotProduct(s))}static isBisectorRobust(t,s,i){return(0,e.g)(0),!1}static size(){return 2}get 0(){return this.x}get 1(){return this.y}set 0(t){this.x=t}set 1(t){this.y=t}static compareZorder(t,s){const i=Zs.c_compare_zorder_xx[t.x<0?1:0]|Zs.c_compare_zorder_yy[t.y<0?1:0],e=Zs.c_compare_zorder_xx[s.x<0?1:0]|Zs.c_compare_zorder_yy[s.y<0?1:0];if(i===e){let i=0,e=0;for(let n=0;n<2;++n){const r=Ds(t[n],s[n]);r>i&&(i=r,e=n)}return t[e]<s[e]}return i<e}static lerp(t,s,i){const e=new Zs;return Z(t,s,i,e),e}static getClosestCoordinate(t,s,i,e=!1){const n=Zs.getNAN();n.setSub(s,t);const r=n.sqrLength();if(0===r)return.5;if(s.isEqualPoint2D(i))return 1;const o=Zs.getNAN();o.setSub(i,t);let h=o.dotProduct(n)/r;return e||(h<0?h=0:h>1&&(h=1)),h}static intersectLinesAtOnePoint(t,s,i,e){if(t.equals(s)||i.equals(e))return Zs.getNAN();const n=s.x-t.x,r=i.x-e.x,o=s.y-t.y,h=i.y-e.y,u=n*h-r*o;if(!u)return Zs.getNAN();const a=u;if(0===a)return Zs.getNAN();let l=(i.x-t.x)*h-(i.y-t.y)*r;l/=a;const c=new Zs;return Z(t,s,l,c),c.isFinite()?c:Zs.getNAN()}toString(){return`[${this.x},${this.y}]`}}Zs.dimensions=2,Zs.d=[[0,1,0,-1],[-1,0,1,0],[0,-1,0,1],[1,0,-1,0]],Zs.c_compare_zorder_xx=[2,0],Zs.c_compare_zorder_yy=[1,0]},11878:(t,s,i)=>{i.d(s,{T:()=>h});var e=i(55537),n=i(83661);class r{constructor(t,s,i){if(t instanceof r)return this.data=t.data,this.N=t.N,this.M=t.M,t.data=null,t.N=0,void(t.M=0);this.data=t,this.N=s,this.M=i}assignCopy(t){return this===t||((0,e.g)(this.N*this.M==t.N*t.M),this.data.set(t.data),this.N=t.N,this.M=t.M),this}setZero(){return this.data?.fill(0),this}setIdentity(){for(let t=0;t<this.N;t++)for(let s=0;s<this.M;s++)this.setRowCol(t,s,t===s?1:0);return this}rows(){return this.N}cols(){return this.M}row(t){return(0,e.g)(0),{}}set(t,s){return this.data[t]=s,this}setRowCol(t,s,i){return this.data[t*this.M+s]=i,this}at(t){return this.data[t]}atRowCol(t,s){return this.data[t*this.M+s]}mulScalar(t,s){(0,e.g)(0)}mul(t,s){if((0,e.g)(this.M===t.rows()),(0,e.g)(this.N===s.rows()),(0,e.g)(t.cols()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),e=new r(i,this.N,this.M);return this.mul(t,e),void s.assignCopy(e)}if(s===t){const i=new Float64Array(t.N*t.M),e=new r(i,t.N,t.M);return this.mul(t,e),void s.assignCopy(e)}const i=t.cols();for(let e=0;e<this.N;e++)for(let n=0;n<i;n++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(e,s)*t.atRowCol(s,n);s.setRowCol(e,n,i)}}mulTranspose(t,s){if((0,e.g)(this.M===t.cols()),(0,e.g)(this.N===s.rows()),(0,e.g)(t.rows()===s.cols()),s===this){const i=new Float64Array(this.N*this.M),e=new r(i,this.N,this.M);return this.mulTranspose(t,e),void s.assignCopy(e)}if(s===t){const i=new Float64Array(t.N*t.M),e=new r(i,t.N,t.M);return this.mulTranspose(t,e),void s.assignCopy(e)}const i=t.rows();for(let e=0;e<this.N;e++)for(let n=0;n<i;n++){let i=0;for(let s=0;s<this.M;s++)i+=this.atRowCol(e,s)*t.atRowCol(n,s);s.setRowCol(e,n,i)}}mulLeft(t,s){(0,e.g)(0)}mulLeftTranspose(t,s){(0,e.g)(0)}mulDiag(t,s){if((0,e.g)(this.M===t.N*t.M),(0,e.g)(this.N===s.rows()),(0,e.g)(this.M===s.cols()),s===this){const i=new Float64Array(this.N*this.M),e=new r(i,this.N,this.M);return this.mulDiag(t,e),void s.assignCopy(e)}const i=this.M;for(let e=0;e<this.N;e++)for(let n=0;n<i;n++)s.setRowCol(e,n,this.atRowCol(e,n)*t.at(n))}transposeInPlace(){if(this.N===this.M){for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++){const i=this.atRowCol(t,s);this.setRowCol(t,s,this.atRowCol(s,t)),this.setRowCol(s,t,i)}return this}const t=new Float64Array(this.N*this.M),s=new r(t,this.N,this.M);return s.assignCopy(this),this.M=(0,n.b)(this.N,this.N=this.M),s.transpose(this),this}transpose(t){if(this!==t){r.checkDims(t,this.M,this.N);for(let s=0;s<this.N;s++)for(let i=0;i<this.M;i++)t.setRowCol(i,s,this.atRowCol(s,i))}else t.transposeInPlace()}add(t,s){}svd(t,s,i,n=!1){if(r.checkDims(t,this.N,this.M),r.checkDims(s,this.M,1),r.checkDims(i,this.M,this.M),n){if((0,e.g)(this.N===this.M),!this.symmetricEigen(s,i))return!1;for(let t=0;t<this.M;++t)s.at(t)<0&&s.set(t,0);return t.assignCopy(i),!0}let o,h,u,a,l,c,m,y=0,x=0,f=0,d=0,b=0;const v=this.M,_=this.N;t.assignCopy(this);const w=new Float64Array(v),N=new r(w,v,1),p=(t,s)=>s>=0?Math.abs(t):-Math.abs(t),M=(t,s)=>{if((t=Math.abs(t))>(s=Math.abs(s))){const i=s/t;return t*Math.sqrt(i*i+1)}if(s>0){const i=t/s;return s*Math.sqrt(i*i+1)}return 0};for(let i=0;i<v;i++){if(y=i+1,N.set(i,d*f),f=a=d=0,i<_){for(let s=i;s<_;s++)d+=Math.abs(t.atRowCol(s,i));if(d){for(let s=i;s<_;s++)t.setRowCol(s,i,t.atRowCol(s,i)/d),a+=t.atRowCol(s,i)*t.atRowCol(s,i);h=t.atRowCol(i,i),f=-p(Math.sqrt(a),h),u=h*f-a,t.setRowCol(i,i,h-f);for(let s=y;s<v;s++){a=0;for(let e=i;e<_;e++)a+=t.atRowCol(e,i)*t.atRowCol(e,s);h=a/u;for(let e=i;e<_;e++)t.setRowCol(e,s,t.atRowCol(e,s)+h*t.atRowCol(e,i))}for(let s=i;s<_;s++)t.setRowCol(s,i,t.atRowCol(s,i)*d)}}if(s.set(i,d*f),f=a=d=0,i<_&&i!==v-1){for(let s=y;s<v;s++)d+=Math.abs(t.atRowCol(i,s));if(d){for(let s=y;s<v;s++)t.setRowCol(i,s,t.atRowCol(i,s)/d),a+=t.atRowCol(i,s)*t.atRowCol(i,s);h=t.atRowCol(i,y),f=-p(Math.sqrt(a),h),u=h*f-a,t.setRowCol(i,y,h-f);for(let s=y;s<v;s++)N.set(s,t.atRowCol(i,s)/u);for(let s=y;s<_;s++){a=0;for(let e=y;e<v;e++)a+=t.atRowCol(s,e)*t.atRowCol(i,e);for(let i=y;i<v;i++)t.setRowCol(s,i,t.atRowCol(s,i)+a*N.at(i))}for(let s=y;s<v;s++)t.setRowCol(i,s,t.atRowCol(i,s)*d)}}const e=Math.abs(s.at(i))+Math.abs(N.at(i));b=e>b?e:b}for(let s=v-1;s>=0;s--){if(s<v-1){if(f){for(let e=y;e<v;e++)i.setRowCol(e,s,t.atRowCol(s,e)/t.atRowCol(s,y)/f);for(let e=y;e<v;e++){a=0;for(let n=y;n<v;n++)a+=t.atRowCol(s,n)*i.atRowCol(n,e);for(let t=y;t<v;t++)i.setRowCol(t,e,i.atRowCol(t,e)+a*i.atRowCol(t,s))}}for(let t=y;t<v;t++)i.setRowCol(s,t,0),i.setRowCol(t,s,0)}i.setRowCol(s,s,1),f=N.at(s),y=s}for(let i=(_<v?_:v)-1;i>=0;i--){y=i+1,f=s.at(i);for(let s=y;s<v;s++)t.setRowCol(i,s,0);if(f){f=1/f;for(let s=y;s<v;s++){a=0;for(let e=y;e<_;e++)a+=t.atRowCol(e,i)*t.atRowCol(e,s);h=a/t.atRowCol(i,i)*f;for(let e=i;e<_;e++)t.setRowCol(e,s,t.atRowCol(e,s)+h*t.atRowCol(e,i))}for(let s=i;s<_;s++)t.setRowCol(s,i,t.atRowCol(s,i)*f)}else for(let s=i;s<_;s++)t.setRowCol(s,i,0);t.setRowCol(i,i,t.atRowCol(i,i)+1)}for(let e=v-1;e>=0;e--)for(let n=1;;n++){let r=1;for(y=e;y>=0;y--){if(x=y-1,Math.abs(N.at(y))+b===b){r=0;break}if(Math.abs(s.at(x))+b===b)break}if(r){o=0,a=1;for(let i=y;i<=e&&(h=a*N.at(i),N.set(i,N.at(i)*o),Math.abs(h)+b!==b);i++){f=s.at(i),u=M(h,f),s.set(i,u),u=1/u,o=f*u,a=-h*u;for(let s=0;s<_;s++)c=t.atRowCol(s,x),m=t.atRowCol(s,i),t.setRowCol(s,x,c*o+m*a),t.setRowCol(s,i,m*o-c*a)}}if(m=s.at(e),y===e){if(m<0){s.set(e,-m);for(let t=0;t<v;t++)i.setRowCol(t,e,-i.atRowCol(t,e))}break}if(100===n)return!1;l=s.at(y),x=e-1,c=s.at(x),f=N.at(x),u=N.at(e),h=((c-m)*(c+m)+(f-u)*(f+u))/(2*u*c),f=M(h,1),h=((l-m)*(l+m)+u*(c/(h+p(f,h))-u))/l,o=a=1;for(let e=y;e<=x;e++){const n=e+1;f=N.at(n),c=s.at(n),u=a*f,f*=o,m=M(h,u),N.set(e,m),o=h/m,a=u/m,h=l*o+f*a,f=f*o-l*a,u=c*a,c*=o;for(let t=0;t<v;t++)l=i.atRowCol(t,e),m=i.atRowCol(t,n),i.setRowCol(t,e,l*o+m*a),i.setRowCol(t,n,m*o-l*a);m=M(h,u),s.set(e,m),m&&(m=1/m,o=h*m,a=u*m),h=o*f+a*c,l=o*c-a*f;for(let s=0;s<_;s++)c=t.atRowCol(s,e),m=t.atRowCol(s,n),t.setRowCol(s,e,c*o+m*a),t.setRowCol(s,n,m*o-c*a)}N.set(y,0),N.set(e,h),s.set(e,l)}const g=new Float64Array(this.N),C=new Float64Array(this.M),T=new r(g,this.N,1),R=new r(C,this.M,1);let E=1;do{E*=3,E++}while(E<=this.M);do{E/=3,E=Math.trunc(E);for(let e=E;e<this.M;e++){const n=s.at(e);for(let s=0;s<this.N;s++)T.set(s,t.atRowCol(s,e));for(let t=0;t<this.M;t++)R.set(t,i.atRowCol(t,e));let r=e;for(;s.at(r-E)<n;){s.set(r,s.at(r-E));for(let s=0;s<this.N;s++)t.setRowCol(s,r,t.atRowCol(s,r-E));for(let t=0;t<this.M;t++)i.setRowCol(t,r,i.atRowCol(t,r-E));if(r-=E,r<E)break}s.set(r,n);for(let s=0;s<this.N;s++)t.setRowCol(s,r,T.at(s));for(let t=0;t<this.M;t++)i.setRowCol(t,r,R.at(t))}}while(E>1);for(let s=0;s<this.M;s++){let e=0;for(let i=0;i<this.N;i++)t.atRowCol(i,s)<0&&e++;for(let t=0;t<this.M;t++)i.atRowCol(t,s)<0&&e++;if(e>Math.trunc((this.N+this.M)/2)){for(let i=0;i<this.N;i++)t.setRowCol(i,s,-t.atRowCol(i,s));for(let t=0;t<this.M;t++)i.setRowCol(t,s,-i.atRowCol(t,s))}}return!0}isSymmetric(){if(this.N!==this.M)return!1;for(let t=0;t<this.N;t++)for(let s=t+1;s<this.M;s++)if(this.atRowCol(t,s)!==this.atRowCol(s,t))return!1;return!0}isZero(){return(0,e.g)(0),!1}isIdentity(){return(0,e.g)(0),!1}equals(t,s){if(void 0!==s&&(0,e.g)(0),this.N!==t.N||this.M!==t.M)return!1;for(let s=0;s<this.N*this.M;s++)if(this.data[s]!==t.data[s])return!1;return!0}maxElement(){return(0,e.g)(0),0}minElement(){return(0,e.g)(0),0}determinant(){if((0,e.g)(this.N===this.M),1===this.N)return this.data[0];if(2===this.N)return this.data[0]*this.data[3]-this.data[1]*this.data[2];if(3===this.N){const t=this;return t.atRowCol(0,0)*(t.atRowCol(1,1)*t.atRowCol(2,2)-t.atRowCol(1,2)*t.atRowCol(2,1))-t.atRowCol(0,1)*(t.atRowCol(1,0)*t.atRowCol(2,2)-t.atRowCol(2,0)*t.atRowCol(1,2))+t.atRowCol(0,2)*(t.atRowCol(1,0)*t.atRowCol(2,1)-t.atRowCol(1,1)*t.atRowCol(2,0))}const t=new Float64Array(this.N*this.N),s=new r(t,this.N,this.N),i=new Float64Array(this.N);if(!this.luDecomposition(s,i))return 0;let n=1;for(let t=0;t<this.N;t++)n*=s.atRowCol(t,t),i[t]!==t&&(n=-n);return n}submatrix(t,s,i){(0,e.g)(0)}inverse(t){(0,e.g)(0)}pseudoInverse(t,s=!1,i=2220446049250313e-31){if(t.setZero(),1===this.N&&1===this.M)return 0!==this.atRowCol(0,0)?t.setRowCol(0,0,1/this.atRowCol(0,0)):t.setRowCol(0,0,0),!0;if(2===this.N&&2===this.M){const s=this.atRowCol(0,0)*this.atRowCol(1,1)-this.atRowCol(0,1)*this.atRowCol(1,0),i=1e-5*(Math.abs(this.atRowCol(0,0)*this.atRowCol(1,1))+Math.abs(this.atRowCol(0,1)*this.atRowCol(1,0)));if(Math.abs(s)>i)return t.setRowCol(0,0,this.atRowCol(1,1)/s),t.setRowCol(0,1,-this.atRowCol(0,1)/s),t.setRowCol(1,0,-this.atRowCol(1,0)/s),t.setRowCol(1,1,this.atRowCol(0,0)/s),!0}const e=new Float64Array(this.N*this.M),n=new r(e,this.N,this.M),o=new Float64Array(this.M),h=new r(o,this.M,1),u=new Float64Array(this.M*this.M),a=new r(u,this.M,this.M);if(!this.svd(n,h,a,s))return!1;const l=Math.max(this.N,this.M),c=i*Math.abs(h.at(0))*l;for(let t=0;t<this.M;t++)h.at(t)>c?h.set(t,1/h.at(t)):h.set(t,0);return a.mulDiag(h,t),t.mulTranspose(n,t),!0}luDecomposition(t,s){return(0,e.g)(0),!1}symmetricEigen(t,s){(0,e.g)(this.rows()===this.cols()),(0,e.g)(this.rows()===t.rows()),(0,e.g)(s.rows()===s.cols()&&s.rows()===this.rows()),(0,e.g)(this.isSymmetric());const i=new Float64Array(this.N*this.M),n=new r(i,this.N,this.M);n.assignCopy(this);const o=100/Number.EPSILON,h=this.rows(),u=new Float64Array(h),a=new Float64Array(h),l=new r(u,h,1),c=new r(a,h,1);for(let s=0;s<h;s++)l.set(s,n.atRowCol(s,s)),t.set(s,n.atRowCol(s,s)),c.set(s,0);s.setIdentity();const m=()=>{const i=l;s.transposeInPlace();let e=1;do{e*=3,e++}while(e<=h);do{e/=3,e=Math.trunc(e);for(let n=e;n<h;n++){const r=t.at(n),o=Math.abs(r);for(let t=0;t<this.M;t++)i.set(t,s.atRowCol(t,n));let h=n;for(;Math.abs(t.at(h-e))<o;){t.set(h,t.at(h-e));for(let t=0;t<this.M;t++)s.setRowCol(t,h,s.atRowCol(t,h-e));if(h-=e,h<e)break}if(h!==n){t.set(h,r);for(let t=0;t<this.M;t++)s.setRowCol(t,h,i.at(t))}}}while(e>1)};for(let i=1;;i++){let e=0;for(let t=1;t<h;t++)for(let s=0;s<t;s++)e+=Math.abs(n.atRowCol(t,s));if(0===e)return m(),!0;const r=i<4?.2*e/(h*h):0;for(let e=0;e<h;e++)for(let u=e+1;u<h;u++){let a=o*Math.abs(n.atRowCol(u,e));if(i>4&&a<=Math.abs(t.at(e))&&a<=Math.abs(t.at(u)))n.setRowCol(u,e,0);else if(Math.abs(n.atRowCol(u,e))>r){let i,r=t.at(u)-t.at(e);if(a<Math.abs(r))i=n.atRowCol(u,e)/r;else{const t=.5*r/n.atRowCol(u,e);i=1/(Math.abs(t)+Math.sqrt(1+t*t)),t<0&&(i=-i)}const o=1/Math.sqrt(1+i*i),l=i*o,m=l/(1+o);r=i*n.atRowCol(u,e),c.set(e,c.at(e)-r),c.set(u,c.at(u)+r),t.set(e,t.at(e)-r),t.set(u,t.at(u)+r),n.setRowCol(u,e,0);let y=0;for(;y<e;y++)a=n.atRowCol(e,y),r=n.atRowCol(u,y),n.setRowCol(e,y,a-l*(r+a*m)),n.setRowCol(u,y,r+l*(a-r*m));for(y++;y<u;y++)a=n.atRowCol(y,e),r=n.atRowCol(u,y),n.setRowCol(y,e,a-l*(r+a*m)),n.setRowCol(u,y,r+l*(a-r*m));for(y++;y<h;y++)a=n.atRowCol(y,e),r=n.atRowCol(y,u),n.setRowCol(y,e,a-l*(r+a*m)),n.setRowCol(y,u,r+l*(a-r*m));for(y=0;y<h;y++)a=s.atRowCol(e,y),r=s.atRowCol(u,y),s.setRowCol(e,y,a-l*(r+a*m)),s.setRowCol(u,y,r+l*(a-r*m))}}for(let s=0;s<h;s++)l.set(s,l.at(s)+c.at(s)),t.set(s,l.at(s)),c.set(s,0)}}static checkDims(t,s,i){(0,e.g)(t.rows()===s&&t.cols()===i)}}class o extends r{constructor(t){if(t.copy){const s=new Float64Array(t.copy.N*t.copy.M);return super(s,t.copy.N,t.copy.M),this.buffer=s,void this.assignCopy(t.copy)}const s=new Float64Array(t.NN*t.MM);super(s,t.NN,t.MM),this.buffer=s,t.initializerList&&(0,n.a)(this.buffer,t.initializerList,0,0,t.initializerList.length)}assignCopy(t){return this===t||super.assignCopy(t),this}}class h{constructor(t){this.m_TransformationType=1,void 0===t?this.setIdentity():t instanceof h?this.set(t):this.setScale(t)}set(t){return this.xx=t.xx,this.xy=t.xy,this.xd=t.xd,this.yx=t.yx,this.yy=t.yy,this.yd=t.yd,this}clone(){return(new h).set(this)}setZero(){this.xx=0,this.yy=0,this.xy=0,this.yx=0,this.xd=0,this.yd=0}isEqual(t){return this===t||this.xx===t.xx&&this.xy===t.xy&&this.xd===t.xd&&this.yx===t.yx&&this.yy===t.yy&&this.yd===t.yd}transformInPlace(t){const s=this.xx*t.x+this.xy*t.y+this.xd,i=this.yx*t.x+this.yy*t.y+this.yd;t.x=s,t.y=i}transform(t){const s=t.clone();return this.transformInPlace(s),s}queryTransform(t,s){const i=this.xx*t.x+this.xy*t.y+this.xd,e=this.yx*t.x+this.yy*t.y+this.yd;s.setCoords(i,e)}transformEnvInPlace(t){if(t.isEmpty())return;const s=(0,n.m)(n.P,4);t.queryCorners(s),this.transformPoints2D(s,4,s),t.setFromPoints(s,4)}queryTransformEnv(t,s){(0,e.g)(0)}transformPoints2D(t,s,i){for(let e=0;e<s;++e)this.queryTransform(t[e],i[e])}transformInterleavedPoints(t,s,i){s*=2;const e=n.P.getNAN();for(let n=0;n<s;n+=2)e.x=t[n],e.y=t[n+1],this.transformInPlace(e),i[n]=e.x,i[n+1]=e.y}multiply(t){return h.st_multiply(this,t,this),this}mulLeft(t){return(0,e.g)(0),this}static st_multiply(t,s,i){const e=t.xx*s.xx+t.yx*s.xy,n=t.xy*s.xx+t.yy*s.xy,r=t.xd*s.xx+t.yd*s.xy+s.xd,o=t.xx*s.yx+t.yx*s.yy,h=t.xy*s.yx+t.yy*s.yy,u=t.xd*s.yx+t.yd*s.yy+s.yd;i.xx=e,i.xy=n,i.xd=r,i.yx=o,i.yy=h,i.yd=u}getCoefficients(t){(0,e.g)(t.length>=6),t[0]=this.xx,t[1]=this.xy,t[2]=this.xd,t[3]=this.yx,t[4]=this.yy,t[5]=this.yd}setCoefficients(t){(0,e.g)(t.length>=6),this.xx=t[0],this.xy=t[1],this.xd=t[2],this.yx=t[3],this.yy=t[4],this.yd=t[5]}copyTo(t){(0,e.g)(0)}initializeFromRect(t,s){t.isEmpty()||s.isEmpty()||!t.width()||!t.height()?this.setZero():(this.xy=this.yx=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xd=s.xmin-t.xmin*this.xx,this.yd=s.ymin-t.ymin*this.yy)}initializeFromRectIsotropic(t,s){if(t.isEmpty()||!t.width()||!t.height()||s.isEmpty())this.setZero();else{this.yx=0,this.xy=0,this.xx=s.width()/t.width(),this.yy=s.height()/t.height(),this.xx>this.yy?this.xx=this.yy:this.yy=this.xx;const i=s.getCenter(),e=t.getCenter();this.xd=i.x-e.x*this.xx,this.yd=i.y-e.y*this.yy}}initializeFromTwoPointsArray(t,s){if(t[0].equals(s[0])&&t[1].equals(s[1]))return void this.setIdentity();if(t[0].equals(t[1])){if(s[0].equals(s[1]))return void this.setShift(s[0].sub(t[0]));(0,e.t)("")}if(!t[0].equals(t[1])&&s[0].equals(s[1]))return this.setZero(),void this.shift(s[0]);this.setShiftCoords(-t[0].x,-t[0].y);const i=n.P.distance(t[0],t[1]),r=n.P.distance(s[0],s[1]),o=r/i;this.scale(o,o);const h=t[1].sub(t[0]);h.divThis(i);const u=s[1].sub(s[0]);u.divThis(r);const a=h.crossProduct(u),l=h.dotProduct(u);this.rotate(l,a),this.shiftCoords(s[0].x,s[0].y)}initializeFromTwoPoints(t,s,i,e){const n=[t,s],r=[i,e];this.initializeFromTwoPointsArray(n,r)}transformSizeInPlace(t){(0,e.g)(0)}transformSize(t,s){(0,e.g)(0)}transformTol(t){return(0,e.g)(0),0}transformWithoutTranslateArray(t,s,i){for(let e=0;e<s;++e)this.transformWithoutTranslate(t[e],i[e])}transformWithoutTranslateInPlace(t){const s=this.xx*t.x+this.xy*t.y,i=this.yx*t.x+this.yy*t.y;t.setCoords(s,i)}transformWithoutTranslate(t,s){const i=this.xx*t.x+this.xy*t.y,e=this.yx*t.x+this.yy*t.y;s.setCoords(i,e)}setIdentity(){this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=1,this.yd=0}isIdentity(){return!(1!==this.xx||1!==this.yy||this.xy||this.xd||this.yx||this.yd)}isIdentityTol(t){const s=t*t;return!((0,n.s)(this.xd)+(0,n.s)(this.yd)>s||(0,n.s)(this.xy+this.xd)+(0,n.s)(this.yy+this.yd-1)>s||(0,n.s)(this.xx+this.xd-1)+(0,n.s)(this.yx+this.yd)>s)}isReflective(){return this.xx*this.yy-this.yx*this.xy<0}isUniform(t){const s=this.xx*this.xx+this.yx*this.yx,i=this.xy*this.xy+this.yy*this.yy,e=(s+i)*t;return Math.abs(s-i)<=e&&Math.abs(this.xx*this.xy+this.yx*this.yy)<=e}isUniformNoRotation(){return 0!==this.xx&&Math.abs(this.xx)===Math.abs(this.yy)&&0===this.xy&&0===this.yx}isTranslate(){return 1===this.xx&&1===this.yy&&!this.xy&&!this.yx}isTranslateTol(t){const s=new n.P;return s.setCoords(0,1),this.transformWithoutTranslateInPlace(s),s.y-=1,!(s.sqrLength()>t*t)&&(s.setCoords(1,0),this.transformWithoutTranslateInPlace(s),s.x-=1,s.sqrLength()<=t*t)}isOrthonormal(t){const s=new h;return s.xx=this.xx*this.xx+this.xy*this.xy,s.xy=this.xx*this.yx+this.xy*this.yy,s.yx=this.yx*this.xx+this.yy*this.xy,s.yy=this.yx*this.yx+this.yy*this.yy,s.xd=0,s.yd=0,s.isIdentityTol(t)}isDegenerate(t){return Math.abs(this.xx*this.yy-this.yx*this.xy)<=2*t*(Math.abs(this.xx*this.yy)+Math.abs(this.yx*this.xy))}isZero(){return 0===this.xx&&0===this.yy&&0===this.xy&&0===this.yx&&0===this.xd&&0===this.yd}isScaleAndTranslateTol(t){return this.xy*this.xy+this.yx*this.yx<=(this.xx*this.xx+this.yy*this.yy)*t}setTranslate(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShiftCoords(t,s){return this.xx=1,this.xy=0,this.xd=t,this.yx=0,this.yy=1,this.yd=s,this}setShift(t){return this.xx=1,this.xy=0,this.xd=t.x,this.yx=0,this.yy=1,this.yd=t.y,this}setScaleCoords(t,s){return this.xx=t,this.xy=0,this.xd=0,this.yx=0,this.yy=s,this.yd=0,this}setScale(t){return this.setScaleCoords(t,t),this}setFlipX(t,s){return this.xx=-1,this.xy=0,this.xd=t+s,this.yx=0,this.yy=1,this.yd=0,this}setFlipY(t,s){return this.xx=1,this.xy=0,this.xd=0,this.yx=0,this.yy=-1,this.yd=t+s,this}setShear(t,s){return this.xx=1,this.xy=t,this.xd=0,this.yx=s,this.yy=1,this.yd=0,this}scale(t,s){return this.xx*=t,this.xy*=t,this.xd*=t,this.yx*=s,this.yy*=s,this.yd*=s,this}setRotateAngle(t){return this.setRotate(Math.cos(t),Math.sin(t))}setRotate(t,s){return this.xx=t,this.xy=-s,this.xd=0,this.yx=s,this.yy=t,this.yd=0,this}setRotateAngleAbout(t,s){return this.setRotateAbout(Math.cos(t),Math.sin(t),s)}setRotateAbout(t,s,i){return this.setTranslate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}setSwapCoordinates(){return this.xx=0,this.xy=1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}setRotateCw90(){return this.xx=0,this.xy=1,this.xd=0,this.yx=-1,this.yy=0,this.yd=0,this}setRotateCcw90(){return this.xx=0,this.xy=-1,this.xd=0,this.yx=1,this.yy=0,this.yd=0,this}shiftCoords(t,s){return this.xd+=t,this.yd+=s,this}shift(t){return this.xd+=t.x,this.yd+=t.y,this}translate(t,s){return this.xd+=t,this.yd+=s,this}flipX(t,s){return this.xx=-this.xx,this.xy=-this.xy,this.xd=t+s-this.xd,this}flipY(t,s){return this.yx=-this.yx,this.yy=-this.yy,this.yd=t+s-this.yd,this}shear(t,s){const i=new h;return i.setShear(t,s),this.multiply(i)}rotateAngle(t){const s=new h;return s.setRotateAngle(t),this.multiply(s)}rotate(t,s){const i=new h;return i.setRotate(t,s),this.multiply(i)}rotateAbout(t,s,i){return this.translate(-i.x,-i.y),this.rotate(t,s),this.translate(i.x,i.y)}rotateAngleAbout(t,s){return this.rotateAbout(Math.cos(t),Math.sin(t),s)}setInvert(t){return this.set(t),this.invertThis()}invertThis(){let t=this.xx*this.yy-this.xy*this.yx;if(0===t)return this.setZero(),this;t=1/t;const s=(this.xy*this.yd-this.xd*this.yy)*t,i=(this.xd*this.yx-this.xx*this.yd)*t,e=this.yy*t,n=-this.xy*t,r=-this.yx*t,o=this.xx*t;return this.xd=s,this.yd=i,this.xx=e,this.yy=o,this.xy=n,this.yx=r,this}invertPrecise(t){return this.set(t),this.invertPreciseThis()}invertPreciseThis(){const t=n.M.constructDouble(this.xy),s=n.M.constructDouble(this.xx),i=s.mulDouble(this.yy).sub(t.mulDouble(this.yx));if(i.isZero())return this.setZero(),this;const e=i.clone();e.invertThis();const r=n.M.constructDouble(this.xd),o=t.mulDouble(this.yd).sub(r.mulDouble(this.yy)).mul(e).toDouble(),h=r.mulDouble(this.yx).sub(s.mulDouble(this.yd)).mul(e).toDouble(),u=e.mulDouble(this.yy).toDouble(),a=e.mulDouble(-this.xy).toDouble(),l=e.mulDouble(-this.yx).toDouble(),c=e.mulDouble(this.xx).toDouble();return this.xd=o,this.yd=h,this.xx=u,this.yy=c,this.xy=a,this.yx=l,this}extractScaleTransform(t,s){const i=Math.sqrt(this.xx*this.xx+this.xy*this.xy),e=Math.sqrt(this.yx*this.yx+this.yy*this.yy);s.setScaleCoords(1/i,1/e),s.multiply(this),t.setScaleCoords(i,e)}setFromTwoTriangles(t,s){let i=!0;for(let e=0;e<3;++e)i=i&&t[e].equals(s[e]);if(i)return this.setIdentity(),!0;const e=new n.P;e.setSub(t[0],t[1]);const r=new n.P;r.setSub(t[0],t[2]);const o=new n.P;o.setSub(s[0],s[1]);const h=new n.P;h.setSub(s[0],s[2]);const u=4*Number.EPSILON*(Math.abs(e.x*r.y)+Math.abs(r.x*e.y));let a=e.x*r.y-e.y*r.x;return Math.abs(a)>u?(a=1/a,this.xx=(o.x*r.y-e.y*h.x)*a,this.xy=(e.x*h.x-o.x*r.x)*a,this.yx=(o.y*r.y-e.y*h.y)*a,this.yy=(e.x*h.y-o.y*r.x)*a,this.xd=s[0].x-(this.xx*t[0].x+this.xy*t[0].y),this.yd=s[0].y-(this.yx*t[0].x+this.yy*t[0].y),!0):(this.setZero(),!1)}initializeFromControlPoints(t,s,i,r,l=null){return 0===s?(this.setIdentity(),void(l&&l.setIdentity())):1===s?(this.setShift(r[0].sub(i[0])),void(l&&l.setShift(i[0].sub(r[0])))):(s<3&&(t=1),void(4===t&&s>2?function(t,s,i,r,h){const u=n.P.average(i,s),l=n.P.average(r,s),c=new o({NN:2,MM:2});c.setZero();const m=new o({NN:2,MM:2});m.setZero();for(let t=0;t<s;++t)c.setRowCol(0,0,c.atRowCol(0,0)+(i[t].x-u.x)*(i[t].x-u.x)),c.setRowCol(0,1,c.atRowCol(0,1)+(i[t].x-u.x)*(i[t].y-u.y)),c.setRowCol(1,1,c.atRowCol(1,1)+(i[t].y-u.y)*(i[t].y-u.y)),m.setRowCol(0,0,m.atRowCol(0,0)+(r[t].x-l.x)*(i[t].x-u.x)),m.setRowCol(0,1,m.atRowCol(0,1)+(r[t].x-l.x)*(i[t].y-u.y)),m.setRowCol(1,0,m.atRowCol(1,0)+(r[t].y-l.y)*(i[t].x-u.x)),m.setRowCol(1,1,m.atRowCol(1,1)+(r[t].y-l.y)*(i[t].y-u.y));c.setRowCol(1,0,c.atRowCol(0,1));const y=new o({NN:2,MM:2});c.pseudoInverse(y,!0)||(0,e.a)("Failed to compute pseudo inverse"),m.mul(y,m),a(t,m);const x=u.clone();t.transformInPlace(x),t.xd=l.x-x.x,t.yd=l.y-x.y,h&&(m.pseudoInverse(y,!1)||(0,e.a)("Failed to compute pseudo inverse"),a(h,y),h.transformInPlace(l),h.xd=u.x-l.x,h.yd=u.y-l.y)}(this,s,i,r,l):function(t,s,i,r,l,c){(0,e.g)(1===t||0===t||2===t||3===t),s.setIdentity();const m=n.P.average(r,i),y=n.P.average(l,i);if((0,e.g)(t<u.length&&t>0),8&u[t]){const n=new o({NN:2,MM:2});n.setZero();for(let t=0;t<i;++t)n.setRowCol(0,0,n.atRowCol(0,0)+(l[t].x-y.x)*(r[t].x-m.x)),n.setRowCol(1,0,n.atRowCol(1,0)+(l[t].x-y.x)*(r[t].y-m.y)),n.setRowCol(0,1,n.atRowCol(0,1)+(l[t].y-y.y)*(r[t].x-m.x)),n.setRowCol(1,1,n.atRowCol(1,1)+(l[t].y-y.y)*(r[t].y-m.y));const c=new o({NN:2,MM:2}),x=new o({NN:2,MM:1}),f=new o({NN:2,MM:2});n.svd(c,x,f)||(0,e.a)("Failed to compute svd");const d=new o({NN:2,MM:2});c.transpose(d);const b=new o({NN:2,MM:2});f.mul(d,b),32&u[t]||b.determinant()<0&&(d.setRowCol(1,0,-d.atRowCol(1,0)),d.setRowCol(1,1,-d.atRowCol(1,1)),f.mul(d,b));const v=new h;a(v,b),s.set(v)}if(2&u[t]){let t=0,e=0;for(let n=0;n<i;++n){const i=r[n].sub(m);t+=i.sqrLength(),s.transformInPlace(i),e+=i.dotProduct(l[n].sub(y))}if(0===t)0===e?s.setIdentity():s.setZero();else{const i=e/t;s.scale(i,i)}}else(0,e.g)(!(4&u[t]));const x=m.clone();s.transformInPlace(x),s.xd=y.x-x.x,s.yd=y.y-x.y,c&&(c.set(s),c.invertThis(),c.isZero()&&(c.xd=m.x,c.yd=m.y))}(t,this,s,i,r,l)))}calculateErrors(t,s,i,r){(0,e.g)(t>0&&null!==s&&null!==i);let o=0;for(let e=0;e<t;++e){const t=this.transform(s[e]),h=n.P.sqrDistance(i[e],t);o+=h,r&&(r[e]=Math.sqrt(h))}return Math.sqrt(o/t)}}const u=[43,11,41,9,61];function a(t,s){(0,e.g)(!(2!==s.rows()&&3!==s.rows()||2!==s.cols()&&3!==s.rows())),t.xx=s.atRowCol(0,0),t.xy=s.atRowCol(0,1),t.yx=s.atRowCol(1,0),t.yy=s.atRowCol(1,1),3===s.cols()?(t.xd=s.atRowCol(0,2),t.yd=s.atRowCol(1,2)):(t.xd=0,t.yd=0)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1162,3200],{85334:(e,t,r)=>{r.d(t,{$:()=>m,IB:()=>a,Iy:()=>A,N2:()=>g,RH:()=>v,ZD:()=>w});var n=r(68197),i=r(4576),o=r(4718);function a(e){return"r"in e&&"g"in e&&"b"in e}function s(e){return"h"in e&&"s"in e&&"v"in e}function l(e){return"l"in e&&"a"in e&&"b"in e}function u(e){return"l"in e&&"c"in e&&"h"in e}r(87317),r(91829);const c=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],p=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function d(e,t){const r=[];let n,i;if(e[0].length!==t.length)throw new Error("dimensions do not match");const o=e.length,a=e[0].length;let s=0;for(n=0;n<o;n++){for(s=0,i=0;i<a;i++)s+=e[n][i]*t[i];r.push(s)}return r}function y(e){const t=[e.r/255,e.g/255,e.b/255].map((e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4)),r=d(c,t);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function h(e){const t=d(p,[e.x/100,e.y/100,e.z/100]).map((e=>{const t=e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055;return Math.min(1,Math.max(t,0))}));return{r:Math.round(255*t[0]),g:Math.round(255*t[1]),b:Math.round(255*t[2])}}function f(e){const t=[e.x/95.047,e.y/100,e.z/108.883].map((e=>e>(6/29)**3?e**(1/3):1/3*(29/6)**2*e+4/29));return{l:116*t[1]-16,a:500*(t[0]-t[1]),b:200*(t[1]-t[2])}}function b(e){const t=e.l,r=[(t+16)/116+e.a/500,(t+16)/116,(t+16)/116-e.b/200].map((e=>e>6/29?e**3:3*(6/29)**2*(e-4/29)));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function m(e){return a(e)?e:u(e)?function(e){return h(b(function(e){const t=e.l,r=e.c,n=e.h;return{l:t,a:r*Math.cos(n),b:r*Math.sin(n)}}(e)))}(e):l(e)?function(e){return h(b(e))}(e):function(e){return"x"in e&&"y"in e&&"z"in e}(e)?h(e):s(e)?function(e){const t=(e.h+360)%360/60,r=e.s/100,n=e.v/100*255,i=n*r,o=i*(1-Math.abs(t%2-1));let a;switch(Math.floor(t)){case 0:a={r:i,g:o,b:0};break;case 1:a={r:o,g:i,b:0};break;case 2:a={r:0,g:i,b:o};break;case 3:a={r:0,g:o,b:i};break;case 4:a={r:o,g:0,b:i};break;case 5:case 6:a={r:i,g:0,b:o};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-i),a.g=Math.round(a.g+n-i),a.b=Math.round(a.b+n-i),a}(e):e}function g(e){return s(e)?e:function(e){const t=e.r,r=e.g,n=e.b,i=Math.max(t,r,n),o=i-Math.min(t,r,n);let a=i,s=0===o?0:i===t?(r-n)/o%6:i===r?(n-t)/o+2:(t-r)/o+4,l=0===o?0:o/a;return s<0&&(s+=6),s*=60,l*=100,a*=100/255,{h:s,s:l,v:a}}(m(e))}function w(e){return l(e)?e:function(e){return f(y(e))}(m(e))}function v(e){return u(e)?e:function(e){return function(e){const t=e.l,r=e.a,n=e.b,i=Math.sqrt(r*r+n*n);let o=Math.atan2(n,r);return o=o>0?o:o+2*Math.PI,{l:t,c:i,h:o}}(f(y(e)))}(m(e))}var M,S;function A(e,t,r={}){if(0===e.length||t<=0)return[];if(1===(e=e.map((e=>"string"==typeof e?new n.A(e):e))).length||1===t){const r=[],n=e[0];for(let e=0;e<t;e++)r.push(n.clone());return r}if(r.shuffle&&(e=(0,i.k4)((0,o.o8)(e),r.seed)),e.length>=t){const r=[],n=(e.length-1)/(t-1);for(let i=0;i<t;i++){const t=Math.round(i*n);r.push(e[t].clone())}return r}return function(e,t,r={}){const n=[],o=e.length-1,a=Math.ceil((t-e.length)/o);e:for(let i=0;i<o;i++){const o=e[i],s=e[i+1];for(let i=1;i<=a;i++){const l=i/(a+1);if(n.push(I(o,s,l,r)),n.length+e.length===t)break e}}return[...e.map((e=>e.clone())),...(0,i.k4)(n,r.seed??1)]}(e,t,r)}(S=M||(M={}))[S.Low=160]="Low",S[S.High=225]="High";const _=(e,t)=>{const r=Math.floor(10*t())-5;return Math.min(255,Math.max(0,e+r))};function I(e,t,r,o={}){const a=e.r,s=e.g,l=e.b,u=t.r,c=t.g,p=t.b,d=Math.round(a+(u-a)*r),y=Math.round(s+(c-s)*r),h=Math.round(l+(p-l)*r);if(!o.offset)return new n.A([d,y,h]);const f=(0,i.Mo)(o.seed);return new n.A([_(d,f),_(y,f),_(h,f)])}},81583:(e,t,r)=>{r.d(t,{L:()=>s,g:()=>a});var n=r(60999),i=r(5503),o=r(92474);async function a(e,t){return await e.load(),s(e,t)}async function s(e,t){const r=[],a=(...e)=>{for(const t of e)null!=t&&(Array.isArray(t)?a(...t):i.A.isCollection(t)?t.forEach((e=>a(e))):o.A.isLoadable(t)&&r.push(t))};t(a);let s=null;if(await(0,n.Tj)(r,(async e=>{const t=await(0,n.Ke)(function(e){return"loadAll"in e&&"function"==typeof e.loadAll}(e)?e.loadAll():e.load());!1!==t.ok||s||(s=t)})),s)throw s.error;return e}},39516:(e,t,r)=>{let n;async function i(){return null==n&&(n=r.e(4123).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),n}async function o(e,t){const r=await i(),n=r.get(e,t);if(null==n)throw r.getError(e,t);return n}function a(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function s(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>o,IW:()=>s,mA:()=>a})},13069:(e,t,r)=>{r.d(t,{AG:()=>s,lk:()=>i,vD:()=>a,yS:()=>o});const n="randomUUID"in crypto;function i(){if(n)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function a(){return`{${i()}}`}function s(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},59929:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ce});var n=r(90237),i=r(69540),o=r(5503),a=r(49186),s=r(81583),l=r(92071),u=r(74887),c=r(36708),p=r(39516),d=r(84952),y=r(10107),h=(r(44208),r(53966)),f=(r(87811),r(36005)),b=r(40608),m=r(4146),g=r(52136),w=r(18768),v=r(63074),M=r(69208),S=r(6455),A=r(47685),_=r(87796),I=r(16131),F=r(8303),x=r(54310),T=r(25036),C=r(82935),E=r(60694),j=r(10873),k=r(15426),O=r(17036),Z=r(30524),L=r(85334),P=r(90360),$=r(86162),q=r(92438),z=r(96576),R=r(93618),V=r(62046),N=r(37531);const G={key:"type",base:q.A,errorContext:"renderer",typeMap:{simple:z.A,"unique-value":R.A,"class-breaks":$.A}},D=(0,P.C)({types:G}),U=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];var H=r(13874),Q=r(4902),B=r(4718),K=r(92474),W=r(93637),X=r(43937),J=r(89317),Y=r(38141),ee=r(16930),te=r(29005),re=r(46499),ne=r(39383),ie=r(61956),oe=r(30291),ae=r(59868),se=r(85360);const le=(0,O.p)();let ue=0;function ce(e,t){let r=e.json.write;return"object"!=typeof r&&(r=e.json.write={}),r.ignoreOrigin=!0,t?.spatialOnly&&(r.layerContainerTypes=J.K),e}function pe(e){const t={write:{ignoreOrigin:!0}};return e?.name&&(t.name=e.name),"object"==typeof t.write&&(e?.spatialOnly&&(t.write.layerContainerTypes=J.K),e?.target&&(t.write.target=e.target)),t}function de(e){switch(e){case"point":case"multipoint":return ae.UK.clone();case"polyline":return ae.A7.clone();case"polygon":case"multipatch":return ae.Cx.clone();default:return null}}function ye(e,t){return null==e?null:t.subtypes?.find((t=>t.code===e))}function he(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},i=ye(e,t);if(null!=i){const{defaultValues:e}=i;for(const t in e)n[t]=e[t]}return n[t.subtypeField]=e,new te.A({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}let fe=class extends((0,l.P)(i.A.ClonableMixin(Q.A.IdentifiableMixin(K.A)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ue++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return(0,Z.yp)(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:n,parent:i}=this;let o;if(n){o=[];let e=0;n.forEach((({name:t,alias:r,editable:n,visible:a})=>{if(!a)return;const s=i?.fields?.find((e=>e.name===t));if(!s)return;const l={name:t};let u=!1;r!==s.alias&&(l.alias=r,u=!0),n!==s.editable&&(l.editable=n,u=!0),o.push(l),u&&e++})),0===e&&o.length===n.length&&(o=null)}else o=(0,B.o8)(e);o?.length&&(0,W.sM)(r,o,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e?.fields;if(!e||!n?.length)return null;const{subtypes:i,subtypeField:o}=e,a=i?.find((e=>e.code===r)),s=a?.defaultValues,l=a?.domains,u=[];for(const e of n){const n=e.clone(),{name:i}=n,a=t?.find((e=>e.name===i));if(n.visible=!t||!!a,a){const{alias:e,editable:t}=a;e&&(n.alias=e),!1===t&&(n.editable=!1)}const c=s?.[i]??null;n.defaultValue=i===o?r:c;const p=l?.[i]??null;n.domain=i===o?null:p?"inherited"===p.type?n.domain:p.clone():null,u.push(n)}return u}get floorInfo(){return this.parent?.floorInfo}get isTable(){return!!this.parent?.isTable}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||h.A.getLogger(this).error(ge("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){(0,Z.yp)(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&"mesh"!==e.geometryType?function(e){return new z.A({symbol:de(e)})}(e.geometryType):null}readRendererFromService(e,t,r){if("Table"===t.type)return null;const n=t.drawingInfo?.renderer,i=D(n,t,r);let o;const{subtypeCode:a}=this;if(null!=a&&function(e,t){return!(!t||"unique-value"!==e?.type||null==e.field||e.field.toLowerCase()!==t.toLowerCase()||e.field2||e.field3||e.valueExpression)}(i,t.subtypeField)){const e=i.uniqueValueInfos?.find((({value:e})=>(e="number"==typeof e?String(e):e)===String(a)));e&&(o=new z.A({symbol:e.symbol}))}else"simple"!==i?.type||i.visualVariables?.length||(o=i);return o}readRenderer(e,t,r){const n=t?.layerDefinition?.drawingInfo?.renderer;if(!n)return;const i=n.visualVariables?.some((e=>"rotationInfo"!==e.type));return i?void 0:D(n,t,r)||void 0}get spatialReference(){return this.parent?.spatialReference??ee.A.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[he(this.subtypeCode,t)]}readTitleFromService(e,t){const r=ye(this.subtypeCode,t);return null!=r?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw ge("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a.A("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw ge("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new a.A("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw ge("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new a.A("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw ge("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:i}=this;if(r){const{displayField:e,editFieldsInfo:o,objectIdField:a}=r;t={displayField:e,editFieldsInfo:o,fields:n,objectIdField:a,title:i}}return(0,oe.tn)(t,e)}createQuery(){if(!this.parent)throw ge("createQuery");const e=(0,k.VZ)(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=(0,p.mA)(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const t=(0,k.pc)(this.parent,e);if(t)return t}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw ge("queryAttachments");const n=e.clone();return n.where=me(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw ge("queryFeatureCount");return r.parent.queryFeatureCount(be(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw ge("queryFeatures");return r.parent.queryFeatures(be(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw ge("queryObjectIds");return r.parent.queryObjectIds(be(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw ge("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw ge("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};(0,n._)([(0,y.MZ)({type:se.A,json:pe({name:"attributeTableInfo"})})],fe.prototype,"attributeTableTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"capabilities",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"effectiveCapabilities",null),(0,n._)([(0,y.MZ)({json:pe()})],fe.prototype,"charts",void 0),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:pe({name:"enableEditing"})})],fe.prototype,"editingEnabled",void 0),(0,n._)([(0,y.MZ)({type:Boolean,readOnly:!0})],fe.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"elevationInfo",null),(0,n._)([(0,y.MZ)({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],fe.prototype,"fieldOverrides",void 0),(0,n._)([(0,X.K)("fieldOverrides")],fe.prototype,"writeFieldOverrides",null),(0,n._)([(0,y.MZ)({...le.fields,readOnly:!0,json:{read:!1}})],fe.prototype,"fields",null),(0,n._)([(0,y.MZ)(le.fieldsIndex)],fe.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"floorInfo",null),(0,n._)([(0,y.MZ)({type:Y.A,json:pe({name:"formInfo"})})],fe.prototype,"formTemplate",void 0),(0,n._)([(0,y.MZ)({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],fe.prototype,"id",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"isTable",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"geometryType",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"type",void 0),(0,n._)([(0,y.MZ)(ce((0,B.o8)(j.kF)))],fe.prototype,"labelsVisible",void 0),(0,n._)([(0,y.MZ)({type:[re.A],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:ne.w},write:{ignoreOrigin:!0,layerContainerTypes:J.K}}})],fe.prototype,"labelingInfo",void 0),(0,n._)([(0,y.MZ)({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,layerContainerTypes:J.K}}})],fe.prototype,"layerType",void 0),(0,n._)([(0,y.MZ)(ce((0,B.o8)(j.fV)))],fe.prototype,"legendEnabled",void 0),(0,n._)([(0,y.MZ)({type:["show","hide"]})],fe.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(j.hn);return e.json.origins.service.read=!1,ce(e,{spatialOnly:!0})})())],fe.prototype,"minScale",void 0),(0,n._)([(0,y.MZ)((()=>{const e=(0,B.o8)(j.hG);return e.json.origins.service.read=!1,ce(e,{spatialOnly:!0})})())],fe.prototype,"maxScale",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],fe.prototype,"effectiveScaleRange",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"objectIdField",null),(0,n._)([(0,y.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0,json:pe({spatialOnly:!0})})],fe.prototype,"opacity",void 0),(0,n._)([(0,y.MZ)({clonable:!1})],fe.prototype,"parent",void 0),(0,n._)([(0,y.MZ)(ce((0,B.o8)(j.M6)))],fe.prototype,"popupEnabled",void 0),(0,n._)([(0,y.MZ)({type:H.A,json:pe({name:"popupInfo"})})],fe.prototype,"popupTemplate",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],fe.prototype,"defaultPopupTemplate",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"relationships",null),(0,n._)([(0,y.MZ)({types:G,json:pe({target:"layerDefinition.drawingInfo.renderer",spatialOnly:!0})})],fe.prototype,"renderer",null),(0,n._)([(0,f.w)("service","renderer",["drawingInfo.renderer","subtypeField","type"])],fe.prototype,"readRendererFromService",null),(0,n._)([(0,f.w)("renderer",["layerDefinition.drawingInfo.renderer"])],fe.prototype,"readRenderer",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"spatialReference",null),(0,n._)([(0,y.MZ)({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],fe.prototype,"subtypeCode",void 0),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"subtypeField",null),(0,n._)([(0,y.MZ)({type:[te.A],json:pe({name:"layerDefinition.templates"})})],fe.prototype,"templates",void 0),(0,n._)([(0,f.w)("service","templates",["geometryType","subtypeField","subtypes","type"])],fe.prototype,"readTemplatesFromService",null),(0,n._)([(0,y.MZ)({type:String,json:pe()})],fe.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["subtypes"])],fe.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({readOnly:!0,json:{read:!1}})],fe.prototype,"url",null),(0,n._)([(0,y.MZ)({readOnly:!0})],fe.prototype,"userHasUpdateItemPrivileges",null),(0,n._)([(0,y.MZ)({type:Boolean,nonNullable:!0,json:pe({name:"visibility",spatialOnly:!0})})],fe.prototype,"visible",void 0),fe=(0,n._)([(0,b.$)("esri.layers.support.SubtypeSublayer")],fe);const be=(e,t,r)=>{if(!r)return t.createQuery();const n=ie.A.from(r);return n.where=me(n.where,e.subtypeField,t.subtypeCode),n},me=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),i=`${t}=${r}`,o=e??"";return n.test(o)?o.replace(n,i):(0,p.mA)(i,o)},ge=e=>new a.A(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),we=fe;var ve=r(96184),Me=r(91908),Se=r(54218),Ae=r(92935);const _e="SubtypeGroupLayer";function Ie(e,t){return new a.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function Fe(e,t){const r=[];for(const n of e){const e=new we;e.read(n,t),r.push(e)}return r}const xe=(0,O.p)();let Te=class extends((0,_.j)((0,S.FJ)((0,A.w6)((0,v.dM)((0,C.e)((0,T.j)((0,x.J)((0,w.b)((0,I.q)((0,F.A)((0,l.P)((0,M.d)((0,g.p)(i.A.ClonableMixin(m.A))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(o.A.ofType(we)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer","Table"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=(0,u.sg)((async(e,t,n)=>{const{save:i,saveAs:o}=await r.e(5740).then(r.bind(r,33359));switch(e){case Ae.X.SAVE:return i(this,t);case Ae.X.SAVE_AS:return o(this,n,t)}})),this.addHandles((0,c.wB)((()=>this.sublayers),((e,t)=>this._handleSublayersChange(e,t)),c.OH))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(u.QP).then((async()=>{if(!this.url)throw new a.A("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(null==this.layerId)throw new a.A("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>(0,k.VA)(this,"load",e)));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return(0,k.C$)(this)}get operationalLayerType(){return this.isTable?"SubtypeGroupTable":"SubtypeGroupLayer"}get parsedUrl(){const e=(0,d.An)(this.url);return null!=e&&null!=this.layerId&&(e.path=(0,d.fj)(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?(0,E.yG)(this.url,t):t}async addAttachment(e,t){const r=await(0,k.Xl)(this,e,t,_e);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const n=await(0,k.bt)(this,e,t,r,_e);return this.lastEditsEventDate=new Date,n}async applyEdits(e,t){return(0,k.ct)(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await(0,u.qr)(Promise.all([r.e(364),r.e(8628),r.e(2593),r.e(9062)]).then(r.bind(r,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,k.VZ)(this),t=this.sublayers.map((e=>e.subtypeCode));return e.where=(0,p.mA)(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await(0,k.mm)(this,e,t,_e);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return(0,k.WP)(this,e,_e)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const t=(0,k.pc)(this,e);if(t)return t}const r=(0,k.Nv)(this,t?.feature);if(r){const t=r.domains?.[e];return"inherited"===t?.type?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return(0,s.g)(this,(e=>{e(this.sublayers)}))}async queryAttachments(e,t){return(0,k.lV)(this,e,t,_e)}async queryFeatures(e,t){const r=await this.load(),n=ie.A.from(e)??r.createQuery(),i=n.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),n.outFields=i);const o=await r.source.queryFeatures(n,t);if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this.findSublayerForFeature(e);return o}async queryObjectIds(e,t){return(await(0,k.sg)(this,e,t,_e)).filter(Se.Et)}async queryFeatureCount(e,t){return(0,k.Ye)(this,e,t,_e)}async queryExtent(e,t){return(0,k.B5)(this,e,t,_e)}async queryRelatedFeatures(e,t){return(0,k.hM)(this,e,t,_e)}async queryRelatedFeaturesCount(e,t){return(0,k.S2)(this,e,t,_e)}async save(e){return this._debouncedSaveOperations(Ae.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Ae.X.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:n,messages:i}=t;if(this.isTable){if("web-scene"===r||"web-map"===r&&"tables"!==n)return i?.push(Ie(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&"web-map"===r&&"tables"===n)return i?.push(Ie(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(i?.push(new a.A("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&(0,Me.D)(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new a.A("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),(0,Z.sv)(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return(0,k.jp)(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some((e=>"geometry"===e.type))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach((e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),this.addHandles([e.on("after-add",(({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)})),e.on("after-remove",(({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)}))],"sublayers-owner"))}};(0,n._)([(0,y.MZ)({readOnly:!0})],Te.prototype,"createQueryVersion",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Te.prototype,"editingEnabled",null),(0,n._)([(0,y.MZ)({readOnly:!0})],Te.prototype,"effectiveEditingEnabled",null),(0,n._)([(0,y.MZ)({...xe.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],Te.prototype,"fields",void 0),(0,n._)([(0,y.MZ)(xe.fieldsIndex)],Te.prototype,"fieldsIndex",void 0),(0,n._)([(0,y.MZ)(j.id)],Te.prototype,"id",void 0),(0,n._)([(0,y.MZ)({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],Te.prototype,"listMode",void 0),(0,n._)([(0,y.MZ)({type:["SubtypeGroupLayer","SubtypeGroupTable"],json:{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{"web-document":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}},"portal-item":{name:"layerType",read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],Te.prototype,"operationalLayerType",null),(0,n._)([(0,y.MZ)(xe.outFields)],Te.prototype,"outFields",void 0),(0,n._)([(0,y.MZ)({readOnly:!0})],Te.prototype,"parsedUrl",null),(0,n._)([(0,y.MZ)({clonable:!1})],Te.prototype,"source",null),(0,n._)([(0,y.MZ)({type:o.A.ofType(we),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let n=null;if(this.useUniqueColorsForSublayers){const i=function(e,t){const r=e.drawingInfo?.renderer,n=r?D(r,e,t):null;if("simple"===n?.type)return(0,N.Sx)(n.symbol,null)?n.symbol.clone():null}(t,r);n=i?function(e,t){return(0,L.Iy)(U,e,{offset:!0,shuffle:!0}).reverse().map((e=>{const r=t.clone();return"cim"===r.type?(0,V.Fe)(r,e):(0,N.dt)(r,e),new z.A({symbol:r})}))}(e.length,i):null}const i=e.map((({code:e},i)=>{const o=new we({subtypeCode:e});o.read(t,r);const a=n?.[i];return a&&o.read({drawingInfo:{renderer:a.toJSON()}},r),o}));return new(o.A.ofType(we))(i)}}}},read:{source:["layers","tables"],reader(e,t,r){let n;return"SubtypeGroupLayer"===t.layerType&&t.layers?.length?n=Fe(t.layers,r):"SubtypeGroupTable"===t.layerType&&t.tables?.length&&(n=Fe(t.tables,r)),new(o.A.ofType(we))(n)}},write:{ignoreOrigin:!0,writer(e,t,r,n){const i=[];for(const t of e){const e=t.write({},n);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],Te.prototype,"sublayers",void 0),(0,n._)([(0,y.MZ)()],Te.prototype,"useUniqueColorsForSublayers",void 0),(0,n._)([(0,y.MZ)({type:ve.A})],Te.prototype,"timeInfo",void 0),(0,n._)([(0,y.MZ)({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],Te.prototype,"title",void 0),(0,n._)([(0,f.w)("service","title",["name"])],Te.prototype,"readTitleFromService",null),(0,n._)([(0,y.MZ)({json:{read:!1}})],Te.prototype,"type",void 0),Te=(0,n._)([(0,b.$)("esri.layers.SubtypeGroupLayer")],Te);const Ce=Te},41560:(e,t,r)=>{r.d(t,{Ch:()=>a,mW:()=>o});var n=r(34727),i=r(39516);function o(e,t){return{...t,filterMode:e.mode}}function a(e,t,r){const o=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:n}of e.filters)t[0]=Math.max(t[0],c(r)),t[1]=Math.min(t[1],p(n));return t}(e);if(o&&((0,n.gg)(t,o[0])||(0,n.ZH)(r,o[1])))return"";const a=Array.from(s(e,t,r)),l=function(e,t,r){if(0===e.length)return!0;const i=c(e.at(0)?.minScale),o=p(e.at(-1)?.maxScale);if((0,n.ZH)(i,t)||(0,n.gg)(o,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],i=e[t+1];if((0,n.ZH)(c(i.minScale),p(r.maxScale)))return!0}return!1}(a,t,r)?"1=1":a.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,i.IW)(e,t)),"");return l&&"1=1"!==l?l:""}function*s(e,t,r){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const n of e.filters)l(n.minScale,n.maxScale,t,r)&&(yield n)}}function l(e,t,r,i){return e=c(e),r=c(r),t=p(t),!(!(0,n.Sp)(r,e)&&(i??r)>e||(0,n.Hx)(t,r)||void 0!==i&&(0,n.Sp)(i,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function p(e){return e||0}},32730:(e,t,r)=>{r.d(t,{BI:()=>b,D3:()=>h,XJ:()=>f,lc:()=>y,mX:()=>g,rU:()=>m,tH:()=>A});var n=r(799);const i="__begin__",o="__end__",a=new RegExp(i,"ig"),s=new RegExp(o,"ig"),l=new RegExp("^"+i,"i"),u=new RegExp(o+"$","i"),c='"',p=c+" + ",d=" + "+c;function y(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=y(e.labelExpression),t.type="conventional"),t}function b(e){const t=f(e);switch(t.type){case"conventional":return g(t.expression);case"arcade":return t.expression}return null}function m(e){const t=f(e);switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return A(t.expression)}return null}function g(e){let t;return e?(t=(0,n.HC)(e,(e=>i+'$feature["'+e+'"]'+o)),t=l.test(t)?t.replace(l,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(a,p).replaceAll(s,d)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,M=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,S=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function A(e){if(!e)return null;let t=v.exec(e)||M.exec(e);return t?t[1]||t[3]:(t=S.exec(e),t?t[2]:null)}},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var n=r(90237),i=r(66552),o=r(53966),a=r(10107),s=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,i.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",p="field",d=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&p||r&&c||null,t&&r&&o.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==p&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n._)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,n._)([(0,s.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,n._)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},62046:(e,t,r)=>{r.d(t,{Fe:()=>l,Nk:()=>o});var n=r(68197),i=r(93397);function o(e){const t=[];return a((0,i.lW)(e),t),t.length?new n.A((0,i.e6)(t[0])):null}function a(e,t){if(!e)return;let r;r="CIMTextSymbol"===e.type?e.symbol:e;const n="CIMPolygonSymbol"===e.type;if(r?.symbolLayers)for(const e of r.symbolLayers)if(!(e.colorLocked||n&&((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&s(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{a(e.symbol,t)}));break;case"CIMSolidStroke":case"CIMSolidFill":s(t,e.color);break;case"CIMHatchFill":a(e.lineSymbol,t)}}function s(e,t){for(const r of e)if(r.join(".")===t.join("."))return;e.push(t)}function l(e,t,r){t instanceof n.A||(t=new n.A(t));const o=(0,i.lW)(e);o&&u(o,t,r)}function u(e,t,r){if(!e)return;let n;n="CIMTextSymbol"===e.type?e.symbol:e;const o="CIMPolygonSymbol"===n?.type;if(n?.symbolLayers)for(const e of n.symbolLayers){if(e.colorLocked)continue;if(o)if(r){const{layersToColor:t}=r;if(((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))&&"fill"===t||(0,i.jn)(e)&&"outline"===t)continue}else if((0,i.mA)(e)||(0,i.MM)(e)&&e.markerPlacement&&(0,i.zr)(e.markerPlacement))continue;const n=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=n;break;case"CIMVectorMarker":e.markerGraphics?.forEach((e=>{u(e.symbol,t,r)}));break;case"CIMSolidStroke":case"CIMSolidFill":e.color=n;break;case"CIMHatchFill":u(e.lineSymbol,t,r)}}}},37531:(e,t,r)=>{r.d(t,{dt:()=>y,GG:()=>g,UQ:()=>m,Sx:()=>p});var n=r(68197),i=r(60999),o=(r(44208),r(51850)),a=(r(76369),r(62046)),s=(r(2741),r(78888),r(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new s.q(1e3),new n.A([128,128,128]);var l=r(78504),u=r(33910);const c=new n.A("white");function p(e,t){if(!e)return null;let r=null;return(0,u.wk)(e)?r=function(e){const t=e.symbolLayers;if(!t)return null;let r=null;return t.forEach((e=>{"object"===e.type&&e.resource?.href||(r="water"===e.type?e.color:e.material?e.material.color:null)})),r?new n.A(r):null}(e):(0,u.$y)(e)&&(r="cim"===e.type?(0,a.Nk)(e):e.color?new n.A(e.color):null),r?d(r,t):null}function d(e,t){if(null==t||null==e)return e;const r=e.toRgba();return r[3]=r[3]*t,new n.A(r)}function y(e,t,r){e&&(t||null!=r)&&(t&&(t=new n.A(t)),(0,u.wk)(e)?function(e,t,r){const n=e.symbolLayers;if(!n)return;const i=e=>d(t=t??e??(null!=r?c:null),r);n.forEach((e=>{if("object"!==e.type||!e.resource?.href||t)if("water"===e.type)e.color=i(e.color);else{const t=null!=e.material?e.material.color:null,n=i(t);null==e.material?e.material=new l.N({color:n}):e.material.color=n,null!=r&&"outline"in e&&null!=e.outline?.color&&(e.outline.color=d(e.outline.color,r))}}))}(e,t,r):(0,u.$y)(e)&&function(e,t,r){(t=t??e.color)&&(e.color=d(t,r)),null!=r&&"outline"in e&&e.outline?.color&&(e.outline.color=d(e.outline.color,r))}(e,t,r))}function h(e){for(const t of e)if("number"==typeof t)return t;return null}function f(e,t,r){for(let n=0;n<3;n++){const i=e[n];switch(i){case"symbol-value":{const e=r[n];return null!=e?e/t[n]:1}case"proportional":break;default:if(i&&t[n])return i/t[n]}}return 1}function b(e,t,r,n){switch(e){case"proportional":return r*n;case"symbol-value":return null!=t?t:r;default:return e}}async function m(e,t){if(e&&t)return(0,u.wk)(e)?async function(e,t){const n=e.symbolLayers;n&&await(0,i.jJ)(n,(async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){e.size="number"==typeof t[2]?t[2]:0}(e,t);break;case"icon":case"line":case"text":!function(e,t){const r=h(t);null!=r&&(e.size=r)}(e,t);break;case"path":!function(e,t){const r=f(t,o.Un,[e.width,void 0,e.height]);e.width=b(t[0],e.width,1,r),e.height=b(t[2],e.height,1,r)}(e,t);break;case"object":await async function(e,t){const{resourceSize:n,symbolSize:i}=await async function(e){const{computeObjectLayerResourceSize:t}=await r.e(5404).then(r.bind(r,95404)),n=await t(e,10),{width:i,height:o,depth:a}=e,s=[i,a,o];let l=1;for(let e=0;e<3;e++){const t=s[e];if(null!=t){l=t/n[e];break}}for(let e=0;e<3;e++)null==s[e]&&(s[e]=n[e]*l);return{resourceSize:n,symbolSize:s}}(e),o=f(t,n,i);e.width=b(t[0],i[0],n[0],o),e.depth=b(t[1],i[1],n[1],o),e.height=b(t[2],i[2],n[2],o)}(e,t)}}(e,t)))}(e,t):void((0,u.$y)(e)&&function(e,t){const r=h(t);if(null!=r)switch(e.type){case"simple-marker":e.size=r;break;case"picture-marker":{const t=e.width/e.height;t>1?(e.width=r,e.height=r*t):(e.width=r*t,e.height=r);break}case"simple-line":e.width=r;break;case"text":e.font.size=r}}(e,t))}function g(e,t,r){if(e&&null!=t)if((0,u.wk)(e)){const n=e.symbolLayers;n&&n.forEach((e=>{if("object"===e.type)switch(r){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)}))}else(0,u.$y)(e)&&("simple-marker"!==e.type&&"picture-marker"!==e.type&&"text"!==e.type||(e.angle+=t))}},92935:(e,t,r)=>{var n;r.d(t,{X:()=>n}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(n||(n={}))}}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{b as e,c as t}from"./tslib.es6.js";import{c as s,t as i,d as n,G as r,o as m,b as o,p as a,e as h,q as l,j as c,f as u,g as f}from"./Geometry.js";import{S as _,G as g}from"./SimpleGeometryCursor.js";import{C as d,c as p,P as y,E as b,s as P}from"./Envelope.js";import{i as x,P as C,m as D,f as w,j as T,s as v}from"./Point2D.js";import{L as S,D as I,a as M,P as E,i as V,E as k,n as R}from"./QuadraticBezier.js";import{Envelope2D as B}from"./Envelope2D.js";import{T as A}from"./Transformation2D.js";import{c as X}from"./GeometryCleaner-BEJM7I4l.js";import{aj as Y,ak as j,j as F,h as G,y as q}from"./ProjectionTransformation.js";import{O as z}from"./OperatorGeneralize.js";class L{getOperatorType(){return 10104}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}supportsCurves(){return!0}isSimple(e,t,s,i,n){return 5===Y(e,t,s,i,n)}executeMany(e,t,s,i){return new N(e,t,s,i)}execute(e,t,i,n){const r=new _([e]),m=this.executeMany(r,t,i,n).next();return m||s("null output"),m}}class N extends g{constructor(e,t,s,n){super(),e||i(""),this.m_progressTracker=n,this.m_bForceSimplify=s,this.m_index=-1,this.m_inputGeometryCursor=e,this.m_spatialReference=t}next(){const e=this.m_inputGeometryCursor.next();return e?(n(e),this.m_index=this.m_inputGeometryCursor.getGeometryID(),this.simplify(e)):null}getGeometryID(){return this.m_index}tock(){return!1}getRank(){return 1}simplify(e){e||i("");return j(e,this.m_spatialReference,this.m_bForceSimplify,this.m_progressTracker)}}var O;function J(e,t,s,i,n,r){return{m_from:e.clone(),m_to:t.clone(),m_center:s.clone(),m_next:n,m_type:i}}function U(e,t,s,i,n){return{m_from:e.clone(),m_to:t.clone(),m_next:s,m_type:4,m_center:new C}}!function(e){e[e.enumDummy=256]="enumDummy",e[e.enumLine=1]="enumLine",e[e.enumArc=2]="enumArc",e[e.enumMiter=8]="enumMiter",e[e.enumBevel=16]="enumBevel",e[e.enumJoinMask=26]="enumJoinMask",e[e.enumConnectionMask=27]="enumConnectionMask"}(O||(O={}));class Q extends g{constructor(e,t,s,i,n,r,m,o,a,h){super(),this.m_index=0,this.m_bufferedPolygon=null,this.m_x=0,this.m_y=0,this.m_progressTracker=h,this.m_parent=e,this.m_mp=t,this.m_distance=s,this.m_spatialReference=i,this.m_densifyDist=o,this.m_maxVertexInCompleteCircle=a,this.m_joins=n,this.m_caps=r,this.m_miterLimit=m}next(){const e=new y;for(;;){if(this.m_index===this.m_mp.getPointCount())return null;if(1===this.m_caps)return this.m_index=this.m_mp.getPointCount(),new M({vd:this.m_mp.getDescription()});if(this.m_mp.getPointByVal(this.m_index,e),this.m_index++,!e.isEmpty())break}let t,s=!1;if(null===this.m_bufferedPolygon&&(this.m_x=e.getX(),this.m_y=e.getY(),this.m_bufferedPolygon=this.m_parent.buffer(e,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle),s=!0),t=this.m_index<this.m_mp.getPointCount()?this.m_bufferedPolygon.clone():this.m_bufferedPolygon,!s){const s=new A,i=e.getX()-this.m_x,n=e.getY()-this.m_y;s.setShiftCoords(i,n),t.applyTransformation(s)}return P(t,0),t}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class H extends g{constructor(e){super(),this.m_currentPathIndex=0,this.m_polyline=e}next(){if(!this.m_polyline)return null;const e=this.m_polyline.getImpl(),t=e.getPathCount();if(this.m_currentPathIndex<t){const t=this.m_currentPathIndex;if(this.m_currentPathIndex++,!e.isClosedPathInXYPlane(t)){let s=e.getXY(e.getPathEnd(t)-1);for(;this.m_currentPathIndex<e.getPathCount();){const t=e.getXY(e.getPathStart(this.m_currentPathIndex));if(e.isClosedPathInXYPlane(this.m_currentPathIndex))break;if(!t.equals(s))break;s=e.getXY(e.getPathEnd(this.m_currentPathIndex)-1),this.m_currentPathIndex++}}if(0===t&&this.m_currentPathIndex===this.m_polyline.getPathCount()){const e=this.m_polyline;return this.m_polyline=null,e}const s=new E({vd:this.m_polyline.getDescription()});s.addPath(this.m_polyline,t,!0);for(let i=t+1;i<this.m_currentPathIndex;i++)s.addSegmentsFromPath(this.m_polyline,i,0,e.getSegmentCountPath(i),!1);return this.m_currentPathIndex===this.m_polyline.getPathCount()&&(this.m_polyline=null),s}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class K extends g{constructor(e,t,s){super(),this.m_geometry=null,this.m_index=0,this.m_bufferer=e,this.m_geoms=t,this.m_index=0,this.m_bFilter=s}next(){if(null===this.m_geometry&&(this.m_index=0,this.m_geometry=this.m_geoms.next(),!this.m_geometry))return null;const e=this.m_geometry.getImpl();if(this.m_index<e.getPathCount()){const e=this.m_index;this.m_index++;return this.m_bufferer.bufferPolylinePath(this.m_geometry,e,this.m_bFilter)}return this.m_geometry=null,this.next()}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class W extends g{constructor(e){super(),this.m_index=0,this.m_bufferer=e}next(){const e=this.m_bufferer.m_geometry;if(this.m_index<e.getPathCount()){const t=this.m_index,s=e.calculateRingArea2D(this.m_index);for(f(s>0),this.m_index++;this.m_index<e.getPathCount();){if(e.calculateRingArea2D(this.m_index)>0)break;this.m_index++}let i;return i=0===t&&this.m_index===e.getPathCount()?this.m_bufferer.bufferPolygonImpl(e,0,e.getPathCount()):this.m_bufferer.bufferPolygonImpl(e,t,this.m_index),i}return null}getGeometryID(){return 0}getRank(){return 1}tock(){return!0}}class Z{constructor(e){this.m_geometry=null,this.m_bufferCommands=[],this.m_originalGeomType=r.enumUnknown,this.m_maxVertexInCompleteCircle=-1,this.m_circleTemplateSize=-1,this.m_oldCircleTemplateSize=0,this.m_spatialReference=null,this.m_tolerance=new d(0,0),this.m_smallTolerance=new d(0,0),this.m_filterTolerance=0,this.m_densifyDist=-1,this.m_distance=Number.NaN,this.m_absDistance=0,this.m_absDistanceReversed=0,this.m_dA=-1,this.m_miterLimit=4,this.m_joins=0,this.m_caps=0,this.m_bRoundBuffer=!0,this.m_bOutputLoops=!0,this.m_bFilter=!0,this.m_circleTemplate=[],this.m_leftStack=[],this.m_middleStack=[],this.m_helperLine1=new S,this.m_helperLine2=new S,this.m_helperArray=[],this.m_progressCounter=0,this.m_densificator=I.constructDefault(e),this.m_progressTracker=e}buffer(e,t,s,n,r,u,f,_){if(e||i("Geometry.Bufferer.Impl.Buffer"),f<0&&i("Geometry.Bufferer.Impl.Buffer"),m(e.getGeometryType())&&o("Unsupported geometry type."),e.isEmpty())return new M({vd:e.getDescription()});if(this.m_joins=n,this.m_caps=r,this.m_bRoundBuffer=!1,this.m_miterLimit=u,this.m_originalGeomType=e.getGeometryType(),a(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_joins:h(this.m_originalGeomType)?this.m_bRoundBuffer=0===this.m_caps:l(this.m_originalGeomType)&&(this.m_bRoundBuffer=0===this.m_joins&&0===this.m_caps),this.m_bFilter=this.m_bRoundBuffer,this.m_geometry=X(e),this.m_geometry.isEmpty())return new M({vd:e.getDescription()});const g=new B;this.m_geometry.queryLooseEnvelope(g),t>0&&g.inflateCoords(t,t),this.m_tolerance=p(s,g,!0),this.m_smallTolerance=p(null,g,!0),_<=0&&(_=96),this.m_spatialReference=s,this.m_distance=t,this.m_absDistance=Math.abs(this.m_distance),this.m_absDistanceReversed=0!==this.m_absDistance?1/this.m_absDistance:0,Number.isNaN(f)||0===f?f=1e-5*this.m_absDistance:f>.5*this.m_absDistance&&(f=.5*this.m_absDistance),_<12&&(_=12);const d=Math.abs(t)*(1-Math.cos(Math.PI/_));if(d>f)f=d;else if(0!==t){const e=Math.PI/Math.acos(1-f/Math.abs(t));e<_-1&&(_=Math.trunc(e))<12&&(_=12,f=Math.abs(t)*(1-Math.cos(Math.PI/_)))}this.m_densifyDist=f,this.m_maxVertexInCompleteCircle=_,this.m_filterTolerance=this.m_bRoundBuffer?Math.min(this.m_smallTolerance.total(),.25*this.m_densifyDist):0,this.m_circleTemplateSize=this.calcN(),this.m_circleTemplateSize!==this.m_oldCircleTemplateSize&&(this.m_circleTemplate.length=0,this.m_oldCircleTemplateSize=this.m_circleTemplateSize),this.m_densifyDist>0&&c(this.m_geometry)&&(this.m_geometry=this.m_densificator.densifyEx(this.m_geometry,0,this.m_densifyDist,0,0!==this.m_joins,x()));const y=this.bufferImpl();return this.m_geometry=null,y}generateCircleTemplate(){if(this.m_circleTemplate.length)return;const e=this.m_circleTemplateSize,t=Math.trunc((e+3)/4),s=.5*Math.PI/t;this.m_dA=s,this.m_circleTemplate.length=4*t;const i=Math.cos(s),n=Math.sin(s),r=C.construct(0,1);for(let m=0;m<t;m++)this.m_circleTemplate[m+0*t]=C.construct(r.y,-r.x),this.m_circleTemplate[m+1*t]=C.construct(-r.x,-r.y),this.m_circleTemplate[m+2*t]=C.construct(-r.y,r.x),this.m_circleTemplate[m+3*t]=r.clone(),r.rotateReverse(i,n)}bufferImpl(){const e=this.m_geometry.getGeometryType();if(u(e)){const e=new E({vd:this.m_geometry.getDescription()});return e.addSegment(this.m_geometry,!0),this.m_geometry=e,this.bufferImpl()}if(this.m_distance<=this.m_tolerance.total()){if(!a(e))return new M({vd:this.m_geometry.getDescription()});if(this.m_distance<0){const e=new B;if(this.m_geometry.queryEnvelope(e),e.width()<=2*this.m_absDistance||e.height()<=2*this.m_absDistance)return new M({vd:this.m_geometry.getDescription()})}}switch(this.m_geometry.getGeometryType()){case r.enumPoint:return this.bufferPoint();case r.enumMultiPoint:return this.bufferMultiPoint();case r.enumPolyline:return this.bufferPolyline();case r.enumPolygon:return this.bufferPolygon();case r.enumEnvelope:return this.bufferEnvelope();default:s("")}}bufferPolyline(){if(this.isDegenerateGeometry(this.m_geometry)){const e=new y;this.m_geometry.getPointByVal(0,e);const t=new B;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const e=this.m_geometry,t=this.m_geometry.getDescription();this.m_geometry=null;const s=new H(e);let i,n;i=0===this.m_joins?(new z).executeMany(s,.25*this.m_densifyDist,!1,this.m_progressTracker):s,n=this.m_bRoundBuffer?(new L).executeMany(i,null,!0,this.m_progressTracker):i;const r=new K(this,n,this.m_bFilter),m=(new F).executeMany(r,this.m_spatialReference,this.m_progressTracker,2),o=(new G).executeMany(m,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==o?o:new M({vd:t})}bufferPolygon(){if(0===this.m_distance)return this.m_geometry;this.generateCircleTemplate();const e=(new G).execute(this.m_geometry,null,!1,this.m_progressTracker);if(this.m_distance<0){if(this.m_geometry=e,this.m_geometry.isEmpty())return this.m_geometry;const t=this.m_geometry,s=this.bufferPolygonImpl(t,0,t.getPathCount());return(new G).execute(s,this.m_spatialReference,!1,this.m_progressTracker)}{if(this.m_geometry=e,this.isDegenerateGeometry(this.m_geometry)){const e=new y;this.m_geometry.getPointByVal(0,e);const t=new B;return this.m_geometry.queryEnvelope(t),e.setXY(t.getCenter()),this.bufferDegeneratePath(e,!0)}const t=new W(this),s=(new F).executeMany(t,this.m_spatialReference,this.m_progressTracker,2),i=(new G).executeMany(s,this.m_spatialReference,!1,this.m_progressTracker).next();return null!==i?i:new M({vd:this.m_geometry.getDescription()})}}bufferPolygonImpl(e,t,s){const i=e,n=i.getImpl();let r=new M({vd:e.getDescription()});for(let m=t;m<s;m++){if(n.getPathSize(m)<1)continue;const t=n.calculateRingArea2D(m),s=new B;if(n.queryPathEnvelope(m,s),this.m_distance>0)if(t>0)if(this.isDegeneratePath(n,m)){const e=new y;n.getPointByVal(n.getPathStart(m),e),e.setXY(s.getCenter()),r.add(this.bufferDegeneratePath(e,!0),!1)}else{const t=new E({vd:e.getDescription()}),s=t.getImpl();if(V(this.m_geometry,m)){const e=this.bufferConvexPath(i,m);r.add(e,!1)}else{this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,1);const e=this.bufferCleanup(t);r.add(e,!1)}}else{if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new E({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,1),!t.isEmpty()){const e=s,n=Math.max(1,this.m_absDistance),m=e.clone();m.inflateCoords(n,n),i.addEnvelope(m,!1);const o=this.bufferCleanup(t);r.reserve(r.getPointCount()+o.getPointCount()-4),re(o,r,m,!0)}}else if(t>0){if(s.width()+this.m_tolerance.total()<=2*this.m_absDistance||s.height()+this.m_tolerance.total()<=2*this.m_absDistance)continue;const t=new E({vd:e.getDescription()}),i=t.getImpl();if(this.bufferClosedPath(this.m_geometry,m,i,this.m_bRoundBuffer,-1),!t.isEmpty()){const e=new B;i.queryLooseEnvelope(e);const s=Math.max(1,this.m_absDistance),n=e.clone();n.inflateCoords(s,s),i.addEnvelope(n,!1);re(this.bufferCleanup(t),r,n,!0)}}else{const t=new E({vd:e.getDescription()}),s=t.getImpl();this.bufferClosedPath(this.m_geometry,m,s,this.m_bRoundBuffer,-1);const i=this.bufferCleanup(t);for(let e=0,n=i.getPathCount();e<n;e++)r.addPath(i,e,!0)}}if(this.m_distance>0){if(r.getPathCount()>1){return this.bufferCleanup(r)}return $(r)}{const e=new B;if(r.queryLooseEnvelope(e),r.isEmpty())return $(r);{const t=Math.max(1,this.m_absDistance),s=e.clone();s.inflateCoords(t,t),r.addEnvelope(s,!1);const i=this.bufferCleanup(r);r=new M;const n=new M({vd:i.getDescription()});return re(i,n,s,!1),$(n)}}}bufferPoint(){return this.bufferPointImpl(this.m_geometry)}bufferPointImpl(e){const t=new M({vd:e.getDescription()});return 0===this.m_caps?(this.addCircle(t.getImpl(),e),this.setStrongSimple(t)):2===this.m_caps?(this.addSquare(t.getImpl(),e),this.setStrongSimple(t)):t}bufferDegeneratePath(e,t){const s=new M({vd:e.getDescription()});return t&&0===this.m_joins||!t&&0===this.m_caps?(this.addCircle(s.getImpl(),e),this.setStrongSimple(s)):t||2!==this.m_caps?s:(this.addSquare(s.getImpl(),e),this.setStrongSimple(s))}bufferMultiPoint(){const e=new Q(this,this.m_geometry,this.m_distance,this.m_spatialReference,this.m_joins,this.m_caps,this.m_miterLimit,this.m_densifyDist,this.m_maxVertexInCompleteCircle,this.m_progressTracker);return(new F).executeMany(e,this.m_spatialReference,this.m_progressTracker,2).next()}bufferEnvelope(){let e=new M({vd:this.m_geometry.getDescription()});if(this.m_distance<=0){if(0===this.m_distance)e.addEnvelope(this.m_geometry,!1),ee(this.m_geometry,this.m_tolerance.total())&&(e=this.setStrongSimple(e));else{const t=new b;this.m_geometry.queryEnvelope(t),t.inflateCoords(this.m_distance,this.m_distance),e.addEnvelope(t,!1),ee(t,this.m_tolerance.total())&&(e=this.setStrongSimple(e))}return e}if(1===this.m_joins){const t=new b({copy:this.m_geometry});return t.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(t,!1),e}const t=this.m_geometry.clone();if(0===t.width()||0===t.height()){if(0===t.width()&&0===t.height()){const e=new y({vd:this.m_geometry.getDescription()});return t.queryCornerByVal(0,e),this.m_geometry=e,this.bufferImpl()}const e=new E({vd:this.m_geometry.getDescription()}),s=new y;return t.queryCornerByVal(0,s),e.startPathPoint(s),t.queryCornerByVal(2,s),e.lineToPoint(s),this.m_geometry=e,this.bufferImpl()}return e.addEnvelope(this.m_geometry,!1),this.m_geometry=e,this.bufferConvexPath(e,0)}bufferConvexPath(e,t){this.generateCircleTemplate();const i=e.hasAttribute(10),n=new M({vd:e.getDescription()}),r=n.getImpl();n.reserve((this.m_circleTemplate.length/10+4)*e.getPathSize(t));const m=new C,o=new C,a=new C,h=new C(0,0),l=new C,c=new C,u=e.getImpl(),f=e.getPathSize(t),_=e.getPathStart(t);for(let g=0,d=e.getPathSize(t);g<d;g++){const e=u.getXY(_+g),t=u.getXY(_+(g+1)%f),n=u.getXY(_+(g+2)%f);l.setSub(t,e),0===l.length()&&s("");const d=i&&!!(1&u.getAttributeAsInt(10,(g+1)%f,0));l.normalize();const p=l.clone();l.leftPerpendicularThis(),l.scale(this.m_absDistance),m.setAdd(l,e),o.setAdd(l,t),0===g?r.startPath(m):r.lineTo(m),r.lineTo(o),c.setSub(n,t),0===c.length()&&s(""),c.normalize();const y=c.clone();c.leftPerpendicularThis(),c.scale(this.m_absDistance),a.setAdd(c,t);let b=O.enumArc;const P=d?0:this.m_joins;if(2===P)b=O.enumBevel;else if(1===P){const e=-p.crossProduct(y);h.setSub(p,y),h.scale(this.m_absDistance/e),h.length()<this.m_miterLimit*this.m_absDistance?(h.addThis(t),b=O.enumMiter):b=O.enumBevel}else h.assign(t);this.addJoin(b,r,h,o,a,!1,!1)}return $(n)}bufferPolylinePath(e,t,s){this.generateCircleTemplate();const i=e,n=i.getImpl();if(n.getPathSize(t)<1)return null;let r;if(r=this.m_bRoundBuffer?n.isClosedPathInXYPlane(t):n.isClosedPath(t),this.isDegeneratePath(n,t)&&this.m_distance>0){const e=new y;n.getPointByVal(n.getPathStart(t),e);const s=new B;return n.queryPathEnvelope(t,s),e.setXY(s.getCenter()),this.bufferDegeneratePath(e,r)}const m=new E({vd:e.getDescription()});m.reserve((Math.trunc(this.m_circleTemplate.length/10)+4)*n.getPathSize(t));const o=m.getImpl();return r?2!==this.bufferClosedPath(i,t,o,s,1)&&this.bufferClosedPath(i,t,o,s,-1):this.bufferOpenPath(i,t,o,s),this.bufferCleanup(m)}progress_(){}bufferCleanup(e,t=!1){const s=t?this.m_tolerance:this.m_smallTolerance;return q(e,s,!0,!t,-1,this.m_progressTracker,0,!1)}calcN(){const e=4;if(0===this.m_densifyDist)return this.m_maxVertexInCompleteCircle;const t=1-this.m_densifyDist*Math.abs(this.m_absDistanceReversed);let s=e;return s=t<-1?e:2*Math.PI/Math.acos(t)+.5,s<e?s=e:s>this.m_maxVertexInCompleteCircle&&(s=this.m_maxVertexInCompleteCircle),Math.trunc(s)}addJoin(e,t,s,i,n,r,m){if(this.generateCircleTemplate(),r&&(t.startPath(i),r=!1),e===O.enumBevel)return void(m&&t.lineTo(n));if(e===O.enumMiter){const e=s.clone();return t.lineTo(e),void(m&&t.lineTo(n))}const o=new C;o.setSub(i,s),o.scale(this.m_absDistanceReversed);const a=new C;a.setSub(n,s),a.scale(this.m_absDistanceReversed);let h=Math.atan2(o.y,o.x)/this.m_dA;h<0&&(h=this.m_circleTemplate.length+h),h=this.m_circleTemplate.length-h;let l=Math.atan2(a.y,a.x)/this.m_dA;l<0&&(l=this.m_circleTemplate.length+l),l=this.m_circleTemplate.length-l,l<h&&(l+=this.m_circleTemplate.length);let c=Math.trunc(l),u=Math.ceil(h),f=this.m_circleTemplate[u%this.m_circleTemplate.length].clone();f.scaleAddThis(this.m_absDistance,s);const _=10*this.m_tolerance.total();f.sub(i).length()<_&&(u+=1),f=this.m_circleTemplate[c%this.m_circleTemplate.length].clone(),f.scaleAddThis(this.m_absDistance,s),f.sub(n).length()<_&&(c-=1);let g=c-u;g++;for(let d=0,p=u%this.m_circleTemplate.length;d<g;d++,p=(p+1)%this.m_circleTemplate.length)f=this.m_circleTemplate[p].clone(),f.scaleAddThis(this.m_absDistance,s),t.lineTo(f),this.progress_();m&&t.lineTo(n)}bufferClosedPath(e,t,s,i,n){const r=new k,m=r.addPathFromMultiPath(e,t,!0);return this.bufferClosedPathImpl(r,m,s,i,n)}bufferClosedPathImpl(e,t,s,i,n){const r=e.getFirstVertex(e.getFirstPath(t)),m=new y;e.queryPoint(r,m),e.filterClosePoints(this.m_filterTolerance,!1,!1,!1,-1);if(e.getPointCount(t)<2)return n<0?0:(this.m_bRoundBuffer&&this.addCircle(s,m),2);f(e.getFirstPath(t)!==R),f(e.getFirstVertex(e.getFirstPath(t))!==R);const o=e.getXY(e.getFirstVertex(e.getFirstPath(t))),a=new A;if(a.setShift(o.negate()),e.applyTransformation(a),i){const i=ne(e,t,n,!0,this.m_absDistance,this.m_filterTolerance,this.m_densifyDist);if(f(1===i),e.getPointCount(t)<2)return n<0?0:(this.addCircle(s,m),2)}const h=0!==this.m_joins&&e.getVertexDescription().hasAttribute(10);this.m_bufferCommands.length=0;const l=e.getFirstPath(t);let c=e.getFirstVertex(l),u=1===n?e.getPrevVertex(c):e.getNextVertex(c),_=1===n?e.getNextVertex(c):e.getPrevVertex(c),g=!0;const d=new C,p=new C,b=new C,P=new C,x=new C,D=new C,w=new C,T=new C,v=this.m_absDistance,S=e.getPathSize(l),I=new C(0,0);for(let f=0;f<S;f++){p.assign(e.getXY(_)),g&&(d.assign(e.getXY(c)),b.assign(e.getXY(u)),D.setSub(d,b),D.normalize(),T.leftPerpendicularOther(D),T.scale(v),P.setAdd(T,d));const t=h&&!!(1&e.getAttributeAsDbl(10,c,0));x.setSub(p,d),x.normalize(),w.leftPerpendicularOther(x),w.scale(v);const s=new C;s.setAdd(d,w);const i=D.crossProduct(x),r=D.dotProduct(x);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8){let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;I.setSub(D,x),I.scale(this.m_absDistance/t),I.length()<this.m_miterLimit*this.m_absDistance&&(I.addThis(d),e=!0),this.m_bufferCommands.push(J(P,s,I,e?O.enumMiter:O.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(J(P,s,d,0===n?O.enumArc:O.enumBevel,this.m_bufferCommands.length+1))}else P.equals(s)||(this.m_bufferCommands.push(U(P,d,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(U(d,s,this.m_bufferCommands.length+1)));const m=new C;m.setAdd(p,w),this.m_bufferCommands.push(J(s,m,d,O.enumLine,this.m_bufferCommands.length+1)),P.setCoordsPoint2D(m),T.setCoordsPoint2D(w),b.setCoordsPoint2D(d),d.setCoordsPoint2D(p),D.setCoordsPoint2D(x),u=c,c=_,g=!1,_=1===n?e.getNextVertex(c):e.getPrevVertex(c)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),a.setShift(o),s.applyTransformationToPath(a,s.getPathCount()-1),1}bufferOpenPath(e,t,s,i){if(this.m_bRoundBuffer){const n=new E({vd:e.getDescription()});return n.addPath(e,t,!1),n.addSegmentsFromPath(e,t,0,e.getSegmentCountPath(t),!1),this.bufferClosedPath(n,0,s,i,1)}let n=0;const r=new E({vd:e.getDescription()}),m=new C(0,0);{const i=new k,o=i.addPathFromMultiPath(e,t,!1),a=i.getFirstVertex(i.getFirstPath(o)),h=new y;i.queryPoint(a,h),m.assign(h.getXY()),i.filterClosePoints(0,!1,!1,!1,-1);if(i.getPointCount(o)<2)return this.m_bRoundBuffer&&this.addCircle(s,h),2;const l=i.getGeometry(i.getFirstGeometry());r.addPath(l,0,!1),n=r.getPointCount()-1,r.addSegmentsFromPath(l,0,0,l.getSegmentCountPath(0)-1,!1)}const o=new k,a=o.addPathFromMultiPath(r,0,!0);f(o.getFirstPath(a)!==R),f(o.getFirstVertex(o.getFirstPath(a))!==R);const h=new A;h.setShift(m.negate()),o.applyTransformation(h),this.m_bufferCommands.length=0;const l=o.getFirstPath(a),c=0!==this.m_joins&&o.getVertexDescription().hasAttribute(10);let u=o.getFirstVertex(l),_=o.getPrevVertex(u),g=o.getNextVertex(u),d=!0;const p=new C,b=new C,P=new C,x=new C,D=new C,w=new C,T=new C,v=new C,S=this.m_absDistance,I=o.getPathSize(l),M=new C(0,0);for(let f=0;f<I;f++){let e=!1;0!==f&&f!==n||(e=!0),b.assign(o.getXY(g)),d&&(p.assign(o.getXY(u)),P.assign(o.getXY(_)),w.setSub(p,P),w.normalize(),v.leftPerpendicularOther(w),v.scale(S),x.setAdd(v,p));const t=c&&!!(1&o.getAttributeAsDbl(10,u,0));D.setSub(b,p),D.normalize(),T.leftPerpendicularOther(D),T.scale(S);const s=new C;s.setAdd(p,T);const i=w.crossProduct(D),r=w.dotProduct(D);if(i<0||r<0&&i<Math.abs(r)*Number.EPSILON*8)if(e)if(0===this.m_caps)this.m_bufferCommands.push(J(x,s,p,O.enumArc,this.m_bufferCommands.length+1));else if(1===this.m_caps)this.m_bufferCommands.push(J(x,s,p,O.enumLine,this.m_bufferCommands.length+1));else{const e=D.mul(this.m_absDistance).negate(),t=e.clone();e.addThis(x),t.addThis(s),this.m_bufferCommands.push(J(x,e,p,O.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(J(e,t,p,O.enumLine,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(J(t,s,p,O.enumLine,this.m_bufferCommands.length+1))}else{let e=!1;const n=t?0:this.m_joins;if(1===n){const t=-i;M.setSub(w,D),M.scale(this.m_absDistance/t),M.length()<this.m_miterLimit*this.m_absDistance&&(M.addThis(p),e=!0),this.m_bufferCommands.push(J(x,s,M,e?O.enumMiter:O.enumBevel,this.m_bufferCommands.length+1))}else this.m_bufferCommands.push(J(x,s,p,0===n?O.enumArc:O.enumBevel,this.m_bufferCommands.length+1))}else x.equals(s)||(this.m_bufferCommands.push(U(x,p,this.m_bufferCommands.length+1)),this.m_bufferCommands.push(U(p,s,this.m_bufferCommands.length+1)));const m=new C;m.setAdd(b,T),this.m_bufferCommands.push(J(s,m,p,O.enumLine,this.m_bufferCommands.length+1)),x.setCoordsPoint2D(m),v.setCoordsPoint2D(T),P.setCoordsPoint2D(p),p.setCoordsPoint2D(b),w.setCoordsPoint2D(D),_=u,u=g,d=!1,g=o.getNextVertex(u)}return this.m_bufferCommands.at(-1).m_next=0,this.processBufferCommands(s),h.setShift(m),s.applyTransformationToPath(h,s.getPathCount()-1),1}processBufferCommands(e){const t=this.cleanupBufferCommands();let s=!0,i=t+1;for(let n=t;i!==t;n=i){const t=this.m_bufferCommands[n];i=-1!==t.m_next?t.m_next:(n+1)%this.m_bufferCommands.length,t.m_type&&(s&&(e.startPath(t.m_from),s=!1),t.m_type&O.enumJoinMask?this.addJoin(t.m_type,e,t.m_center,t.m_from,t.m_to,!1,!0):e.lineTo(t.m_to))}}cleanupBufferCommands(){this.m_helperArray=D(C,9);let e=0;for(let s=0,i=this.m_bufferCommands.length;s<i;){const t=this.m_bufferCommands[s];if(t.m_type&O.enumConnectionMask){e=s;break}s=t.m_next}let t=e+1;for(let s=e;t!==e;s=t){const e=this.m_bufferCommands[s];t=e.m_next;let i=1,n=null;for(;t!==s&&(n=this.m_bufferCommands[t],!(n.m_type&O.enumConnectionMask));)t=n.m_next,i++;if(1!==i&&(e.m_type&n.m_type)===O.enumLine){this.m_helperLine1.setStartXY(e.m_from),this.m_helperLine1.setEndXY(e.m_to),this.m_helperLine2.setStartXY(n.m_from),this.m_helperLine2.setEndXY(n.m_to);1===this.m_helperLine1.intersect(this.m_helperLine2,this.m_helperArray,null,null,this.m_smallTolerance.total())&&(e.m_to.assign(this.m_helperArray[0]),n.m_from.assign(this.m_helperArray[0]),e.m_next=t)}}return e}isDegeneratePath(e,t){if(1===e.getPathSize(t))return!0;if(0===this.m_joins&&0===this.m_caps){const s=new B;if(e.queryPathEnvelope(t,s),Math.max(s.width(),s.height())<.5*this.m_densifyDist)return!0}return!1}isDegenerateGeometry(e){if(0===this.m_joins&&0===this.m_caps){const t=new B;if(e.queryEnvelope(t),Math.max(t.width(),t.height())<.5*this.m_densifyDist)return!0}return!1}addCircle(e,t){const s=t.getXY();if(0!==this.m_circleTemplate.length){let t=this.m_circleTemplate[0].clone();t.scaleAddThis(this.m_absDistance,s),e.startPath(t);for(let i=1,n=this.m_circleTemplate.length;i<n;i++)t=this.m_circleTemplate[i].clone(),t.scaleAddThis(this.m_absDistance,s),e.lineTo(t);return}const i=this.m_circleTemplateSize,n=Math.trunc((i+3)/4),r=.5*Math.PI/n;e.reserve(4*n);const m=Math.cos(r),o=Math.sin(r);for(let a=3;a>=0;a--){const t=C.construct(0,this.m_absDistance);switch(a){case 0:for(let i=0;i<n;i++)e.lineToCoords(t.x+s.x,t.y+s.y),t.rotateReverse(m,o);break;case 1:for(let i=0;i<n;i++)e.lineToCoords(-t.y+s.x,t.x+s.y),t.rotateReverse(m,o);break;case 2:for(let i=0;i<n;i++)e.lineToCoords(-t.x+s.x,-t.y+s.y),t.rotateReverse(m,o);break;default:e.startPathCoords(t.y+s.x,-t.x+s.y);for(let i=1;i<n;i++)t.rotateReverse(m,o),e.lineToCoords(t.y+s.x,-t.x+s.y)}this.progress_()}}addSquare(e,t){const s=new b({vd:t.getDescription()});s.setCoords(t.getX(),t.getY(),t.getX(),t.getY()),s.inflateCoords(this.m_absDistance,this.m_absDistance),e.addEnvelope(s,!1)}setStrongSimple(e){return e.getImpl().setIsSimple(4,this.m_tolerance.total()),e.getImpl().updateOGCFlagsProtected(),e}}function $(e){return P(e,0),e}function ee(e,t){return!!e.isEmpty()||Math.min(e.width(),e.height())>t}function te(e,t,s,i,n,r,m,o){const a=e.getXY(s),h=e.getXY(i);if(a.equals(h))return-1;const l=.25*m,c=.25*m,u=new C;u.setSub(h,a);const _=u.length(),g=_*_*.25,d=r*r-g;if(d<=g)return-1;const p=Math.sqrt(d);u.normalize();const y=u.clone();y.rightPerpendicularThis();const b=g/p,P=b<=c,x=C.lerp(h,a,.5),D=y.clone(),w=b-l;D.scaleAddThis(Math.max(0,w),x);y.negate().scaleAddThis(p,x);const S=3.61*v(r-c),I=D.sub(a),M=D.sub(h);let E=!1,V=0;const k=T(64,0);f(o===k.length);{for(let o=e.getPrevVertexEx(i,n);o!==s;){if(1===e.getUserIndex(o,t))return-1;if(!e.getXY(o).equals(h))break;{const t=e.getPrevVertexEx(o,n);e.removeVertex(o,!1),o=t}}const r=new C,m=a.clone();k[V++]=1;for(let o=e.getNextVertexEx(s,n);o!==i;){if(1===e.getUserIndex(o,t))return-1;const s=e.getXY(o);if(s.equals(m)){const t=e.getNextVertexEx(o,n);e.removeVertex(o,!1),o=t;continue}k[V++]=0;const i=new C;if(i.setSub(s,a),i.dotProduct(y)<0)return 0;(C.sqrDistance(s,a)>S||C.sqrDistance(s,h)>S)&&(E=!0);let l=0;s.sub(a).crossProduct(I)>=0&&(l=1);if(s.sub(h).crossProduct(M)<=0&&(l|=2),0===l)return 0;k[V-1]=l,r.assign(m),m.assign(s),o=e.getNextVertexEx(o,n)}if(1===V)return 0;f(V<k.length),k[V++]=2}let R=!0;for(let f=1,C=0;f<V;f++)if(k[f]!==k[f-1]&&(C++,R=C<3&&(1===C&&3===k[f]||2===C&&2===k[f]),!R))return 0;if(V>2&&R&&(3===V||!E)){let t=0,r=e.getNextVertexEx(s,n);for(P||(e.setXY(r,D),r=e.getNextVertexEx(r,n));r!==i;){const s=e.getNextVertexEx(r,n);e.removeVertex(r,!1),r=s,++t}return t}if(f(3!==V),E&&V>3)return 0;const B=a.clone();let A=s;const X=a.clone();let Y=1,j=-1,F=A,G=0;for(V=1;F!==i;){F=e.getNextVertexEx(F,n);const t=k[V++];if(0===t){if(F===i)break;continue}const s=e.getXY(F);if(-1!==j){if(3&(j&Y&t)){e.removeVertex(A,!0),G++,A=F,X.setCoordsPoint2D(s),Y=t;continue}if(3===Y&&0!==j&&0!==t){if(X.setCoordsPoint2D(D),P||X.equals(B)){e.removeVertex(A,!0),G++,A=F,X.setCoordsPoint2D(s),Y=t;continue}e.setXY(A,X)}}j=Y,B.setCoordsPoint2D(X),A=F,Y=t,X.setCoordsPoint2D(s)}return G}function se(e,t,s,i){let n=-1;const r=new C,m=new C,o=new C;for(let a=0,h=e.getPathSize(i),l=e.getFirstVertex(i);a<h;++a){-1===n&&(e.queryXY(l,m),n=e.getPrevVertex(l),-1!==n&&(e.queryXY(n,r),o.setSub(m,r),o.normalize()));const s=e.getNextVertex(l);if(-1===s)break;const i=e.getXY(s),a=i.sub(m);if(a.normalize(),-1!==n){a.dotProduct(o)<-.99&&Math.abs(a.crossProduct(o))<1e-7&&e.setUserIndex(l,t,1)}n=l,l=s,r.assign(m),m.assign(i),o.assign(a)}}function ie(s,i,n,r,m,o,a){const h={stack:[],error:void 0,hasError:!1};try{const t=s.getFirstPath(i),r=s.createUserIndex();e(h,w((()=>{s.removeUserIndex(r)}),!1),!1),se(s,r,i,t);for(let e=0;e<100;++e){if(0===s.getPathSize(t))return 1;let e=s.getFirstVertex(t),i=s.getPathSize(t);if(i<3)return 1;s.isClosedPath(t)||(i-=1);const o=64;let h=0,l=!1;for(let t=0;t<i&&e!==R;t++){let c=0,u=e;for(let h=1,l=Math.min(o,i-t);h<l;h++)if(u=s.getNextVertexEx(u,n),h>1){const t=te(s,r,e,u,n,m,a,o);if(-1===t)break;c+=t,i-=t}if(h+=c,l=c>0,l){const t=s.getPrevVertexEx(e,n);if(-1!==t){e=t,i++;continue}}e=s.getNextVertexEx(e,n)}if(0===h)break}return s.filterClosePoints(o,!1,!1,!1,-1),1}catch(l){h.error=l,h.hasError=!0}finally{t(h)}}function ne(e,t,s,i,n,r,m){return ie(e,t,s,i,n,r,m)}function re(e,t,s,i){for(let n=0,r=e.getPathCount();n<r;n++){const r=e.getXY(e.getPathStart(n));r.x!==s.xmin&&r.x!==s.xmax&&t.addPath(e,n,i)}}export{Z as B};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{b as e,c as t}from"./tslib.es6.js";import{G as n,v as i}from"./Geometry.js";import{s as r,S as s,a as o}from"./QuadraticBezier.js";import{g as m}from"./ProjectionTransformation.js";import{P as a,b as u,c,i as h,f as l,h as g}from"./Point2D.js";import{Envelope2D as y}from"./Envelope2D.js";import{P as _,E as D}from"./Envelope.js";function p(){return{outPoint:new a,index:-1,t:Number.NaN}}function v(e,t,n){return{outPoint:e.clone(),index:t,t:n}}function N(e,t,n,i){e.outPoint.assign(t),e.index=n,e.t=i}function f(e,t){e.outPoint.assign(t.outPoint),e.index=t.index,e.t=t.t}function P(e,t,n,i){e.index=n,e.t=i,t.queryCoord2D(e.t,e.outPoint)}function I(e,t){const n=p();f(n,e),f(e,t),f(t,n)}function d(e,t,i,r,s,o){if(e.getGeometryType()===n.enumPolygon){for(;r.nextPath();)if(r.hasNextSegment()){const t=r.nextSegment();if(0!==m(e,t.getEndXY(),0))return N(s,t.getEndXY(),-1,Number.NaN),N(o,t.getEndXY(),-1,Number.NaN),!0}r.resetToFirstPath()}if(t.getGeometryType()===n.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const e=i.nextSegment();if(0!==m(t,e.getEndXY(),0))return N(s,e.getEndXY(),-1,Number.NaN),N(o,e.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function q(e){const t=e.getPathCount(),n=new Array(e.getSegmentCount());let i=0;for(let r=0;r<t;++r){const t=i+e.getSegmentCountPath(r);for(let s=i,o=e.getPathStart(r);s<t;++s,++o)n[s]=o;i=t}return r(e.getPointCount(),n),n}function M(e,t){return!!Number.isNaN(t)||e<=t}function x(e){const t=new o;return t.addEnvelope(e,!1),t}class E{constructor(e,t){if(this.m_env2DgeometryA=null,this.m_env2DgeometryB=null,this.m_progressCounter=0,this.m_progressTracker=t,this.m_maxSqrDistance=e*e,this.m_maxDistance=e,this.m_bIsNearCalc=!1,Number.isNaN(this.m_maxDistance)?this.m_maxDistance=Number.POSITIVE_INFINITY:this.m_maxDistance=e,this.m_maxSqrDistance=this.m_maxDistance*this.m_maxDistance,Number.isFinite(this.m_maxSqrDistance)){let e=Math.sqrt(this.m_maxSqrDistance);for(;e<this.m_maxDistance;)this.m_maxSqrDistance*=1+Number.EPSILON,e=Math.sqrt(this.m_maxSqrDistance)}}calculate(e,t,n,i){if(e.getGeometryType()!==_.type||t.getGeometryType()!==_.type){this.m_env2DgeometryA=new y,this.m_env2DgeometryB=new y,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB);if(!M(this.m_env2DgeometryA.distanceFromEnvelope(this.m_env2DgeometryB),this.m_maxDistance))return Number.POSITIVE_INFINITY}const r=v(new a,g(),Number.NaN),s=v(new a,g(),Number.NaN),o=this._ExecuteBruteForce(e,t,r,s);return M(o,this.m_maxDistance)?(null!==n&&f(n,r),null!==i&&f(i,s),o):Number.POSITIVE_INFINITY}isNear(e,t){if(this.m_bIsNearCalc=!0,e.isEmpty()||t.isEmpty())return!1;if(e===t)return!0;let n=!0;if(e.getGeometryType()!==_.type&&e.getGeometryType()!==D.type||t.getGeometryType()!==_.type&&t.getGeometryType()!==D.type||(n=!1),n){if(this.m_env2DgeometryA=new y,this.m_env2DgeometryB=new y,e.queryEnvelope(this.m_env2DgeometryA),t.queryEnvelope(this.m_env2DgeometryB),!(this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)>this.m_maxSqrDistance))return!0;if(this.m_env2DgeometryA.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>this.m_maxSqrDistance)return!1}const i=v(new a,g(),Number.NaN),r=v(new a,g(),Number.NaN);return this._ExecuteBruteForce(e,t,i,r)<=this.m_maxDistance}progress_(e=!1){}_ExecuteBruteForce(e,t,i,r){switch(e.getGeometryType()){case n.enumPoint:return this.distancePointGeometry(e,t,i,r);case n.enumMultiPoint:return this.distanceMultipointGeometry(e,t,i,r);case n.enumEnvelope:return this.distanceEnvelopeGeometry(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathGeometry(e,t,i,r);default:return Number.NaN}}distancePointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointPoint(e,t,i,r);case n.enumMultiPoint:return this.distancePointMultipoint(e,t,i,r);case n.enumPolyline:case n.enumPolygon:return this.distancePointMultipath(e,t,i,r);case n.enumEnvelope:return this.distancePointEnvelope(e,t,i,r);default:return Number.NaN}}distancePointPoint(e,t,n,i){const r=e.getXY(),s=t.getXY();return N(n,r,0,0),N(i,s,0,0),Math.sqrt(a.sqrDistance(r,s))}distancePointMultipoint(e,t,n,i){const r=e.getXY();let s=this.m_maxSqrDistance,o=s,m=!1;const u=t.getPointCount(),c=new a;for(let h=0;h<u;++h)if(t.queryXY(h,c),o=a.sqrDistance(r,c),this.m_bIsNearCalc){if(o<=s)return 0}else if(!(o>s)&&(!m&&o===s||o<s)&&(s=o,N(n,r,0,0),N(i,c,h,0),m=!0,0===s))return 0;return m?Math.sqrt(s):Number.POSITIVE_INFINITY}distancePointMultipath(e,t,i,r){const s=!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB),o=e.getXY();if(!s&&t.getGeometryType()===n.enumPolygon&&0!==m(t,o,0))return N(i,o,0,0),N(r,o,-1,Number.NaN),0;t.getImpl().getAccelerators();let u=this.m_maxSqrDistance,c=u,h=-1;const l=new y,g=t.querySegmentIterator();let _=!1;for(;g.nextPath();)for(;g.hasNextSegment();){const e=g.nextSegment();e.queryEnvelope(l);const t=l.sqrDistance(o);if(t>u)continue;if(!this.m_bIsNearCalc&&_&&t===u)continue;h=e.getClosestCoordinate(o,!1);const n=e.getCoord2D(h);if(c=a.sqrDistance(o,n),this.m_bIsNearCalc){if(c<=u)return 0}else if(!(c>u)&&(!_||c<u)&&(u=c,N(i,o,0,0),N(r,n,g.getStartPointIndex(),h),_=!0,0===u))return 0}return _?Math.sqrt(u):Number.POSITIVE_INFINITY}distancePointEnvelope(e,t,n,i){const r=e.getXY();N(n,r,0,0),N(i,r,-1,Number.NaN);const s=t.asEnvelope2D();return!s.contains(r)?Math.sqrt(s.sqrDistance(r,i.outPoint)):0}distanceMultipointGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipoint(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:return this.distanceMultipointMultipoint(e,t,i,r,1,1);case n.enumPolyline:case n.enumPolygon:return this.distanceMultipointMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipointMultipath(e,x(t),i,r);default:return Number.NaN}}distanceMultipointMultipoint(n,i,r,s,o,m){const g={stack:[],error:void 0,hasError:!1};try{if(this.m_bIsNearCalc&&1===o&&1===m){const e=Math.trunc(c(Math.sqrt(n.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(i.getPointCount())+1,1,h()));if((e>=4||t>=4)&&this.distanceMultipointMultipoint(n,i,r,s,e,t)<=this.m_maxSqrDistance)return 0}let t=this.m_maxSqrDistance;const y=[n],_=[i],D=this.swapGeometriesIfBGtA(y,_);D&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),m=u(o,o=m),I(r,s)),e(g,l((()=>{I(r,s),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)}),!D),!1);const p=y[0].getImpl(),v=_[0].getImpl(),f=p.getPointCount(),P=v.getPointCount(),d=P>1;let q=!1;const M=new a,x=new a;for(let e=0;e<f;e+=o){if(p.queryXY(e,M),d){const e=this.m_env2DgeometryB.sqrDistance(M);if(this.m_bIsNearCalc){if(e>t)continue;if(this.m_env2DgeometryB.sqrMaxMinDistance(M)<=t)return 0}else if(e>=t)continue}for(let n=0;n<P;n+=m){v.queryXY(n,x);const i=a.sqrDistance(M,x);if(this.m_bIsNearCalc){if(i<=t)return 0}else if(!(i>t||q&&i===t)&&(!q||i<t)&&(N(r,M,e,0),N(s,x,n,0),q=!0,t=i,0===t))return q?Math.sqrt(t):Number.POSITIVE_INFINITY}}return q?Math.sqrt(t):Number.POSITIVE_INFINITY}catch(y){g.error=y,g.hasError=!0}finally{t(g)}}distanceMultipointMultipath(e,t,i,r){let s=!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)&&t.getGeometryType()===n.enumPolygon;const o=t.querySegmentIterator();o.stripAttributes();const u=new y,c=new a;let h=this.m_maxSqrDistance;const l=e.getImpl(),g=l.getPointCount(),_=g>1;let D=!1;for(;o.nextPath();)for(;o.hasNextSegment();){const e=o.nextSegment();if(e.queryLooseEnvelope(u),_){const e=u.sqrDistanceEnvelope(this.m_env2DgeometryA,null,null);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h||D&&e===h)continue}for(let n=0;n<g;n++){if(l.queryXY(n,c),s&&0!==m(t,c,0))return N(i,c,-1,Number.NaN),N(r,c,n,0),0;{const e=u.sqrDistance(c);if(this.m_bIsNearCalc){if(e>h)continue}else if(e>h)continue}const a=e.getClosestCoordinate(c,!1),g=e.getCoord2D(a);c.subThis(g);const y=c.sqrLength();if(this.m_bIsNearCalc){if(y<=h)return 0}else if(!(y>h)&&(!D||y<h)&&(h=y,N(i,l.getXY(n),n,0),N(r,g,o.getStartPointIndex(),a),D=!0,0===h))return 0}s=!1}return D?Math.sqrt(h):Number.POSITIVE_INFINITY}distanceEnvelopeGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:return this.distancePointEnvelope(t,e,r,i);case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,x(e),r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(x(e),t,i,r);case n.enumEnvelope:return this.distanceEnvelopeEnvelope(e,t,i,r);default:return Number.NaN}}distanceEnvelopeEnvelope(e,t,n,i){n.t=Number.NaN,n.index=-1,i.t=Number.NaN,i.index=-1;const r=e.asEnvelope2D(),s=t.asEnvelope2D();return Math.sqrt(r.sqrDistanceEnvelope(s,n.outPoint,i.outPoint))}distanceMultipathGeometry(e,t,i,r){switch(t.getGeometryType()){case n.enumPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distancePointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumMultiPoint:{this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const n=this.distanceMultipointMultipath(t,e,r,i);return this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),n}case n.enumPolyline:case n.enumPolygon:return this.distanceMultipathMultipath(e,t,i,r);case n.enumEnvelope:return this.distanceMultipathMultipath(e,x(t),i,r);default:return Number.NaN}}distanceMultipathMultipath(n,i,r,o){const m={stack:[],error:void 0,hasError:!1};try{const t=[n],a=[i],g=this.swapGeometriesIfAGtB(t,a);g&&(this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),I(r,o)),e(m,l((()=>{I(r,o),this.m_env2DgeometryB=u(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)}),!g),!1);const _=t[0],D=a[0],v=_.querySegmentIterator();v.stripAttributes();const N=D.querySegmentIterator();if(N.stripAttributes(),this.m_bIsNearCalc&&this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)<=this.m_maxSqrDistance)return 0;if(this.m_bIsNearCalc){const e=Math.trunc(c(Math.sqrt(_.getPointCount())+1,1,h())),t=Math.trunc(c(Math.sqrt(_.getPointCount())+1,1,h()));if(this.distanceMultipointMultipoint(_,D,r,o,e,t)<=this.m_maxSqrDistance)return 0}if(!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)){const e=p(),t=p();if(d(_,D,v,N,e,t))return f(r,e),f(o,t),0}const M=q(_),x=[],E=new s,b=new y,B=new y,S=new y;let A=this.m_maxSqrDistance,T=!0,C=!1;for(let e=0,n=M.length;e<n;++e){_.querySegment(M[e],E,!0);const t=E.get();if(t.queryEnvelope(b),!(b.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>A)){if(this.m_bIsNearCalc&&b.sqrMaxDistanceEnvelope(this.m_env2DgeometryB)<=A)return 0;for(;N.nextPath();){if(this.progress_(),T)D.queryPathEnvelope(N.getPathIndex(),S),x[N.getPathIndex()]=S.clone();else if(b.sqrDistanceEnvelope(x[N.getPathIndex()],null,null)>A)continue;for(;N.hasNextSegment();){const n=N.nextSegment();if(n.queryEnvelope(B),b.sqrDistanceEnvelope(B,null,null)<=A){const i=!b.isIntersecting(B),s=[0],m=[0];let a=t.distance(n,i,s,m);if(a*=a,this.m_bIsNearCalc&&a<=this.m_maxSqrDistance)return 0;if(a<A||a===A&&M[e]<r.index){if(C=!0,P(r,t,M[e],s[0]),P(o,n,N.getStartPointIndex(),m[0]),0===a)return 0;A=a}}}}N.resetToFirstPath(),T=!1}}return C?Math.sqrt(A):Number.POSITIVE_INFINITY}catch(a){m.error=a,m.hasError=!0}finally{t(m)}}swapGeometriesIfAGtB(e,t){return i(e[0])>i(t[0])&&(t[0]=u(e[0],e[0]=t[0]),!0)}swapGeometriesIfBGtA(e,t){return this.swapGeometriesIfAGtB(t,e)}}export{E as D,p as m,q as s,d as w};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../Widget.js";import{loadCalciteComponents as n}from"../../support/componentsUtils.js";import{globalCss as s}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{messageBundle as r}from"../../support/decorators/messageBundle.js";import{tsx as a}from"../../support/jsxFactory.js";import{getFeatureTitle as c,getAssociationTitle as l}from"../../support/UtilityNetworkAssociations/utilityNetworkUtils.js";const m="esri-feature-form-utility-network-association-settings",d={base:m,header:`${m}__header`,headingContent:`${m}__heading-content`,listContainer:`${m}__list-container`};let u=class extends i{constructor(t,e){super(t,e),this.association=null,this.editedAssociation=null,this.fromFeature=null,this.headingLevel=5,this.messagesFeature=null,this.messagesCommon=null,this.messagesFeatureForm=null,this.readOnly=!1,this.toFeature=null,this.utilityNetwork=null}loadDependencies(){return n({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get associationType(){return this.association.associationType}set associationType(t){this.association.associationType=t}render(){return a("div",{class:this.classes(d.base,s.widget)},this._renderFromAssociationEndpoint(),this._renderToAssociationEndpoint(),this._renderAdditionalContent())}_renderFromAssociationEndpoint(){const{associationType:t,association:e,fromFeature:o,messagesFeatureForm:i}=this,n=c(o),s=l(e,"from",i.associations);switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(n,s,this._renderConnectivityContent(o,e.fromNetworkElement))}return this._renderAssociationEndpoint(n,s)}_renderToAssociationEndpoint(){const{associationType:t,association:e,toFeature:o,messagesFeatureForm:i}=this,n=c(o),s=l(e,"to",i.associations);switch(t){case"connectivity":case"junction-junction-connectivity":return this._renderAssociationEndpoint(n,s,this._renderConnectivityContent(o,e.toNetworkElement));case"containment":return this._renderAssociationEndpoint(n,s,this._renderContainmentContent())}return this._renderAssociationEndpoint(n,s)}_renderAssociationEndpoint(t,e,o){return a("calcite-block",{description:e,heading:t},o)}_renderContainmentContent(){const{messagesFeatureForm:t,association:e}=this,o=e.isContentVisible??!1;return a("calcite-label",{layout:"inline"},t.associations.visible,a("calcite-switch",{checked:o,onCalciteSwitchChange:({currentTarget:t})=>{e.isContentVisible=t.checked}}))}_renderConnectivityContent(t,e){const{messagesFeatureForm:o,utilityNetwork:i}=this,n=i.getTerminalConfiguration(t),s=n?.terminals.map((t=>this._renderComboboxListItemNumber(t.id,e.terminalId,t.name)))||[];return a("calcite-label",null,o.associations.terminal,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:o.associations.terminalComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{e.terminalId=parseInt(t.value,10)}},...s))}_renderAdditionalContent(){const{associationType:t,association:e}=this;switch(t){case"connectivity":case"junction-junction-connectivity":case"attachment":case"containment":return}const o="junction-edge-midspan-connectivity"===t?t:"junction-edge-to-connectivity",{messagesFeatureForm:i}=this,n=[this._renderComboboxListItemString("junction-edge-midspan-connectivity",o,i.associations.midspanEdge),this._renderComboboxListItemString("junction-edge-to-connectivity",o,i.associations.endpointEdge)];return a("div",null,a("label",null,i.associations.connectTo,a("calcite-combobox",{allowCustomValues:!1,clearDisabled:!0,label:i.associations.edgeConnectionComboboxLabel,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{const o="1"===t.value?"junction-edge-midspan-connectivity":"junction-edge-from-connectivity";e.associationType=o}},...n)),"junction-edge-midspan-connectivity"===o?this._renderMidspanEdgeContent():this._renderEndpointEdgeContent())}_renderMidspanEdgeContent(){const{association:t,messagesFeatureForm:e}=this;return a("calcite-label",null,e.associations.midspanLocation,a("calcite-input-number",{numberButtonType:"vertical",value:`${t.percentAlong}`,onCalciteInputNumberInput:({currentTarget:e})=>{t.percentAlong=parseFloat(e.value)}}))}_renderEndpointEdgeContent(){const{association:t,associationType:e,messagesFeatureForm:o}=this,i="junction-edge-to-connectivity"===e;return a("calcite-label",null,o.associations.edgeSide,a("calcite-label",{layout:"inline"},o.associations.fromSide,a("calcite-switch",{checked:i,onCalciteSwitchChange:({currentTarget:e})=>{const o=e.checked?"junction-edge-to-connectivity":"junction-edge-from-connectivity";t.associationType=o}}),o.associations.toSide))}_renderComboboxListItemNumber(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}_renderComboboxListItemString(t,e,o){return a("calcite-combobox-item",{heading:o,key:`#${t}`,selected:e===t,value:`${t}`})}};t([e()],u.prototype,"association",void 0),t([e()],u.prototype,"associationType",null),t([e()],u.prototype,"editedAssociation",void 0),t([e()],u.prototype,"fromFeature",void 0),t([e()],u.prototype,"headingLevel",void 0),t([e(),r("esri/widgets/Feature/t9n/Feature")],u.prototype,"messagesFeature",void 0),t([e(),r("esri/t9n/common")],u.prototype,"messagesCommon",void 0),t([e(),r("esri/widgets/FeatureForm/t9n/FeatureForm")],u.prototype,"messagesFeatureForm",void 0),t([e()],u.prototype,"readOnly",void 0),t([e()],u.prototype,"toFeature",void 0),t([e()],u.prototype,"utilityNetwork",void 0),u=t([o("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.FeatureFormUtilityNetworkAssociationSettings")],u);const p=u;export{p as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../Graphic.js";import o from"../../../core/Accessor.js";import s from"../../../core/Clonable.js";import r from"../../../core/Collection.js";import a from"../../../core/Identifiable.js";import{ignoreAbortErrors as i,debounce as n}from"../../../core/promiseUtils.js";import c from"../../../core/ReactiveMap.js";import{watch as l,initial as u}from"../../../core/reactiveUtils.js";import{property as d}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as y}from"../../../core/accessorSupport/decorators/subclass.js";import h from"../../../rest/networks/support/NetworkElement.js";import p from"../../../rest/support/Query.js";import{featureUtilityNetworkFields as g}from"../../Feature/FeatureUtilityNetworkAssociations/resources.js";import{findUtilityNetwork as m}from"../../Feature/support/featureUtils.js";const w=100;let b=class extends(s.ClonableMixin(a.IdentifiableMixin(o))){constructor(t){super(t),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.source="popup",this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,this._queryOpenAssociationType=async()=>{this.activeAssociationType&&await this._queryDebounced(this.activeAssociationType)},this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._queryController=async t=>{this._cancelQuery();const e=new AbortController;this._queryAbortController=e,await i(this._query(t)),this._queryAbortController===e&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await i(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=n(this._queryController,w),this._queryFeatureCountDebounced=n(this._queryFeatureCountController,w)}initialize(){this.addHandles([l((()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery]),(()=>this.refresh()),u),l((()=>this.activeAssociationType),(t=>this._queryDebounced(t)),u)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&"string"==typeof this.globalId}get canQuery(){const t=this.layer?.capabilities?.query;return!!this.associationTypes&&"string"==typeof this.globalId&&!!t?.supportsPagination}set displayCount(t){const e=0,o=3;this._set("displayCount",Math.max(t??o,e))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:t}=this;return"subtype-sublayer"===t?.type&&t?.parent?t.parent.globalIdField??null:t?.globalIdField??null}get activeAssociationType(){return this._get("activeAssociationType")}set activeAssociationType(t){t&&!this.associationTypes.includes(t)||this._set("activeAssociationType",t)}get state(){const{_queryAbortController:t,_queryFeatureCountAbortController:e,_queryPageAbortController:o,canQuery:s,_loaded:r,canLoad:a}=this;return e||a&&!r?"loading":t||o?"querying":s&&0!==this.featureCount?"ready":"disabled"}get utilityNetwork(){const{layer:t,map:e}=this;return t?.loaded&&e?"subtype-sublayer"===t?.type&&t?.parent?m(e,t.parent)??null:m(e,t)??null:null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new r}get structureAssociations(){return this._get("structureAssociations")||new r}get contentAssociations(){return this._get("contentAssociations")||new r}get containerAssociations(){return this._get("containerAssociations")||new r}get connectivityAssociations(){return this._get("connectivityAssociations")||new r}get associationFeatures(){return this._get("associationFeatures")||new c}get associationViewModels(){return this._get("associationViewModels")||new Map}async refresh(){await this._queryFeatureCountDebounced(),await this._queryOpenAssociationType()}getFeatureCountForAssociationType(t){switch(t){case"attachment":return this.attachmentsFeatureCount;case"structure":return this.structureFeatureCount;case"content":return this.contentFeatureCount;case"container":return this.containerFeatureCount;case"connectivity":return this.connectivityFeatureCount}}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach((t=>t.destroyAll()))}async _loadUtiltyNetworks(){const t=this.map;if(!t)return;await Promise.allSettled(t.utilityNetworks?.map((async t=>{await t.load()}))??[]);const e=this.utilityNetwork;if(e){const o=t=>{if("layerId"in t&&e.isUtilityLayer(t)){const o=e.getSourceIdByLayerId(t.layerId);null!==o&&this.networkSourceIdsInUse.add(o)}};this._set("networkSourceIdsInUse",new Set),t.allLayers.forEach(o),t.allTables.forEach(o)}}async _findLayersBySourceId(t){const{utilityNetwork:e,map:o}=this,s=t=>{const o=t;if(!t.url)return!1;if(o.layerId===r){return t.url.replace(/\/\d+$/,"")===e?.featureServiceUrl}return!1};await(e?.load());const r=e.getLayerIdBySourceId(t),a=o.allLayers.filter(s),i=o.allTables.filter(s),n=a.concat(i).toArray();return await Promise.allSettled(n.map((t=>t.load()))),n}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach((t=>t.removeAll())),this.associationFeatures.clear()}_getAssociationsByType(t){switch(t){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}async _queryLayer(t,e,o,s,r){const a=t.fieldsIndex.get(g.assetGroup),i=t.fieldsIndex.get(g.assetType),n=null!=o,c=null!=s,l="("+e.map((t=>`'${t}'`)).join(", ")+")",u=n?` AND ${a?.name} = ${o}`:"",d=n&&c?` AND ${i?.name} = ${s}`:"",y=`${t.globalIdField} IN ${l}`+u+d,h=new p({outFields:["*"],cacheHint:this.supportsCacheHint,where:y});return await this._queryAll(h,t,{signal:r?.signal})}async _createAssociationFeatureObjects(t,e,o,s,r,a){if(0===t.length)return[];const i=new Map;for(const[c,l]of e){const t=await this._findLayersBySourceId(c);for(const e of t){(await this._queryLayer(e,l,s,r,a)).forEach((t=>{if("popup"===this.source?t.layer&&t.getEffectivePopupTemplate():!!t.layer){const o=i.get(t.attributes[e.globalIdField])??[];o.push(t),i.set(t.attributes[e.globalIdField],o)}}))}}const n=[];return t.toArray().forEach((t=>{const{fromNetworkElement:e,toNetworkElement:s}=t,r=e.globalId===o?s:e;(i.get(r.globalId)??[]).forEach((e=>{const o=this.utilityNetwork?.getTerminalById(r?.terminalId)?.name;n.push({association:t,feature:e,terminalName:o})}))})),n}_parseFeatureObjects(t,e){t.forEach((t=>{const o=t?.feature,s=o.layer,a=e.get(s)??new r;a.add(t),e.set(s,a)}))}async _queryAll(t,e,o){const s=[];let r=0,a=!1;t.num=e.sourceJSON?.maxRecordCount??2e3;do{t.start=r;const i=await e.queryFeatures(t,o);s.push(...i.features),a=i.exceededTransferLimit,a&&(r+=i.features.length)}while(a);return s}async _queryAssociations(t){const{layer:e,globalId:o,associationTypes:s,utilityNetwork:r,canQuery:a}=this;if(await Promise.allSettled([e?.load(),r?.load()]),this._clearAssociations(),!(a&&e&&s&&r&&o))return;const i=new h({globalId:o,networkSourceId:r?.getSourceIdByLayerId(e?.layerId??e?.parent?.layerId)}),n=new Set;s.forEach((t=>{switch(t.type){case"attachment":case"structure":n.add("attachment");break;case"container":case"content":n.add("containment");break;case"connectivity":n.add("connectivity"),n.add("junction-junction-connectivity"),n.add("junction-edge-from-connectivity"),n.add("junction-edge-midspan-connectivity"),n.add("junction-edge-to-connectivity")}}));const c=await(r?.queryAssociations({elements:[i],types:Array.from(n)},{signal:t?.signal})),l=new Map,u=new Map;s.forEach((t=>{u.set(t.type,t),l.set(t.type,[])})),c?.forEach((t=>{const{toNetworkElement:e,fromNetworkElement:s}=t;switch(t.associationType){case"connectivity":case"junction-junction-connectivity":case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":if(s?.globalId===o){if(null!=u.get("connectivity")?.associatedNetworkSourceId&&u.get("connectivity")?.associatedNetworkSourceId!==e?.networkSourceId)break;l.get("connectivity").push(e.globalId)}else{if(null!=u.get("connectivity")?.associatedNetworkSourceId&&u.get("connectivity")?.associatedNetworkSourceId!==s?.networkSourceId)break;l.get("connectivity")?.push(s.globalId)}this.connectivityAssociations.add(t);break;case"containment":if(s?.globalId===o){if(null!=u.get("content")?.associatedNetworkSourceId&&u.get("content")?.associatedNetworkSourceId!==e?.networkSourceId)break;l.get("content")?.push(e.globalId),this.contentAssociations.add(t)}else{if(null!=u.get("container")?.associatedNetworkSourceId&&u.get("container")?.associatedNetworkSourceId!==s?.networkSourceId)break;l.get("container")?.push(s.globalId),this.containerAssociations.add(t)}break;case"attachment":if(s?.globalId===o){if(null!=u.get("attachment")?.associatedNetworkSourceId&&u.get("attachment")?.associatedNetworkSourceId!==e?.networkSourceId)break;l.get("attachment")?.push(e.globalId),this.attachmentsAssociations.add(t)}else{if(null!=u.get("structure")?.associatedNetworkSourceId&&u.get("structure")?.associatedNetworkSourceId!==s?.networkSourceId)break;l.get("structure")?.push(s.globalId),this.structureAssociations.add(t)}}}));const d=s.map((async e=>{const{associatedNetworkSourceId:o,associatedAssetGroup:s,associatedAssetType:r}=e,a=l.get(e.type),i=null!=s?await this._countAssociatedFeatures(o,a,s,r,t):a.length;switch(e.type){case"attachment":this._set("attachmentsFeatureCount",i);break;case"structure":this._set("structureFeatureCount",i);break;case"content":this._set("contentFeatureCount",i);break;case"container":this._set("containerFeatureCount",i);break;case"connectivity":this._set("connectivityFeatureCount",i)}}));await Promise.allSettled(d)}async _countAssociatedFeatureCount(t,e,o,s,r){const a=t.fieldsIndex.get(g.assetGroup),i=t.fieldsIndex.get(g.assetType),n=null!=s,c="("+e.map((t=>`'${t}'`)).join(", ")+")",l=` AND ${a?.name} = ${o}`,u=n?` AND ${i?.name} = ${s}`:"",d=`${t.globalIdField} IN ${c}`+l+u;return t.queryFeatureCount({where:d,outFields:["*"],returnGeometry:!1},{signal:r?.signal})}async _countAssociatedFeatures(t,e,o,s,r){if(0===e.length)return 0;const a=(await this._findLayersBySourceId(t)).map((async t=>this._countAssociatedFeatureCount(t,e,o,s,r)));return(await Promise.all(a)).reduce(((t,e)=>t+e),0)}async _queryAssociatedFeatures(t,e){const{layer:o,globalId:s,associationTypes:r,utilityNetwork:a,canQuery:i,associationFeatures:n}=this;if(await Promise.allSettled([o?.load(),a?.load()]),!(i&&o&&r&&a))return;const c=this._getAssociationsByType(t.type),{associatedAssetGroup:l,associatedAssetType:u}=t,d=new Map;c.forEach((t=>{const{fromNetworkElement:e,toNetworkElement:o}=t,{networkSourceId:r,elementGlobalId:a}=e.globalId===s?{networkSourceId:o.networkSourceId,elementGlobalId:o.globalId}:{networkSourceId:e.networkSourceId,elementGlobalId:e.globalId},i=d.get(r)||[];i.push(a),d.set(r,i)}));const y=await this._createAssociationFeatureObjects(c,d,s,l,u,e);this._parseFeatureObjects(y,n)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:t,canQuery:e}=this;e?(await this._queryAssociations(t),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(t){if(!t)return;await this._loadUtiltyNetworks();const{_queryAbortController:e}=this;this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),0!==this.featureCount&&(this.destroyed||await this._queryAssociatedFeatures(t,{signal:e?.signal}))}};t([d()],b.prototype,"_loaded",void 0),t([d()],b.prototype,"_queryAbortController",void 0),t([d()],b.prototype,"_queryPageAbortController",void 0),t([d()],b.prototype,"_queryFeatureCountAbortController",void 0),t([d({readOnly:!0})],b.prototype,"supportsCacheHint",null),t([d({readOnly:!0})],b.prototype,"canLoad",null),t([d({readOnly:!0})],b.prototype,"canQuery",null),t([d()],b.prototype,"networkSourceIdsInUse",void 0),t([d({constructOnly:!0})],b.prototype,"source",void 0),t([d()],b.prototype,"description",void 0),t([d({value:3})],b.prototype,"displayCount",null),t([d({type:e})],b.prototype,"graphic",void 0),t([d()],b.prototype,"layer",void 0),t([d()],b.prototype,"map",void 0),t([d({readOnly:!0})],b.prototype,"objectId",null),t([d({readOnly:!0})],b.prototype,"objectIdField",null),t([d({readOnly:!0})],b.prototype,"globalId",null),t([d({readOnly:!0})],b.prototype,"globalIdField",null),t([d()],b.prototype,"featureCount",void 0),t([d()],b.prototype,"associationTypes",void 0),t([d()],b.prototype,"activeAssociationType",null),t([d()],b.prototype,"showAllEnabled",void 0),t([d()],b.prototype,"state",null),t([d()],b.prototype,"title",void 0),t([d({readOnly:!0})],b.prototype,"utilityNetwork",null),t([d({readOnly:!0})],b.prototype,"attachmentsFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"structureFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"attachmentsAssociations",null),t([d({readOnly:!0})],b.prototype,"structureAssociations",null),t([d({readOnly:!0})],b.prototype,"contentFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"containerFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"contentAssociations",null),t([d({readOnly:!0})],b.prototype,"containerAssociations",null),t([d({readOnly:!0})],b.prototype,"connectivityFeatureCount",void 0),t([d({readOnly:!0})],b.prototype,"connectivityAssociations",null),t([d({readOnly:!0})],b.prototype,"associationFeatures",null),t([d({readOnly:!0})],b.prototype,"associationViewModels",null),b=t([y("esri.widgets.support.UtilityNetworkAssociations.UtilityNetworkAssociationsViewModel")],b);const A=b;export{A as default};
|